From 354e4cb89947c8ca0e1b30233bb3c1af2bd99235 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 09:05:13 -0700 Subject: [PATCH 01/85] remove deprecated arkode code --- include/arkode/arkode_arkstep.h | 49 ------------------------ include/arkode/arkode_butcher_dirk.h | 43 --------------------- include/arkode/arkode_butcher_erk.h | 43 --------------------- include/arkode/arkode_erkstep.h | 32 ---------------- include/arkode/arkode_mristep.h | 51 ------------------------- src/arkode/arkode_arkstep.c | 27 ------------- src/arkode/arkode_arkstep_io.c | 20 ---------- src/arkode/arkode_erkstep_io.c | 2 - src/arkode/arkode_mristep_io.c | 16 -------- src/arkode/fmod/farkode_arkstep_mod.c | 14 ------- src/arkode/fmod/farkode_arkstep_mod.f90 | 26 ------------- src/arkode/fmod/farkode_erkstep_mod.c | 14 ------- src/arkode/fmod/farkode_erkstep_mod.f90 | 26 ------------- src/arkode/fmod/farkode_mod.f90 | 38 ++---------------- src/arkode/fmod/farkode_mristep_mod.c | 14 ------- src/arkode/fmod/farkode_mristep_mod.f90 | 37 ------------------ 16 files changed, 3 insertions(+), 449 deletions(-) diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index a4951bb888..91167b7f5a 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -59,53 +59,6 @@ static const int ARKSTEP_DEFAULT_ARK_ITABLE_3 = ARKODE_ARK324L2SA_DIRK_4_2_3; static const int ARKSTEP_DEFAULT_ARK_ITABLE_4 = ARKODE_ARK436L2SA_DIRK_6_3_4; static const int ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5; -#ifndef DEFAULT_ERK_2 -/* DEPRECATED DEFAULT_ERK_2: use ARKSTEP_ERK_DEFAULT_2 */ -#define DEFAULT_ERK_2 ARKSTEP_ERK_DEFAULT_2 -#endif - -#ifndef DEFAULT_ERK_3 -/* DEPRECATED DEFAULT_ERK_3: use ARKSTEP_ERK_DEFAULT_3 */ -#define DEFAULT_ERK_3 ARKSTEP_ERK_DEFAULT_3 -#endif - -#ifndef DEFAULT_ERK_4 -/* DEPRECATED DEFAULT_ERK_4: use ARKSTEP_ERK_DEFAULT_4 */ -#define DEFAULT_ERK_4 ARKSTEP_ERK_DEFAULT_4 -#endif - -#ifndef DEFAULT_ERK_5 -/* DEPRECATED DEFAULT_ERK_5: use ARKSTEP_ERK_DEFAULT_5 */ -#define DEFAULT_ERK_5 ARKSTEP_ERK_DEFAULT_5 -#endif - -#ifndef DEFAULT_ERK_6 -/* DEPRECATED DEFAULT_ERK_6: use ARKSTEP_ERK_DEFAULT_6 */ -#define DEFAULT_ERK_6 ARKSTEP_ERK_DEFAULT_6 -#endif - -#ifndef DEFAULT_ERK_8 -/* DEPRECATED DEFAULT_ERK_8: use ARKSTEP_ERK_DEFAULT_8 */ -#define DEFAULT_ERK_8 ARKSTEP_ERK_DEFAULT_8 -#endif - -/* ImEx */ -/* DEPRECATED DEFAULT_ARK_ETABLE_3: use ARKSTEP_DEFAULT_ARK_ETABLE_3 */ -#define DEFAULT_ARK_ETABLE_3 ARKSTEP_DEFAULT_ARK_ETABLE_3 -/* DEPRECATED DEFAULT_ARK_ETABLE_4: use ARKSTEP_DEFAULT_ARK_ETABLE_4 */ -#define DEFAULT_ARK_ETABLE_4 ARKSTEP_DEFAULT_ARK_ETABLE_4 -/* DEPRECATED DEFAULT_ARK_ETABLE_5: use ARKSTEP_DEFAULT_ARK_ETABLE_4 */ -#define DEFAULT_ARK_ETABLE_5 ARKSTEP_DEFAULT_ARK_ETABLE_5 -/* DEPRECATED DEFAULT_ARK_ITABLE_3: use ARKSTEP_DEFAULT_ARK_ITABLE_3 */ -#define DEFAULT_ARK_ITABLE_3 ARKSTEP_DEFAULT_ARK_ITABLE_3 -/* DEPRECATED DEFAULT_ARK_ITABLE_4: use ARKSTEP_DEFAULT_ARK_ITABLE_4 */ -#define DEFAULT_ARK_ITABLE_4 ARKSTEP_DEFAULT_ARK_ITABLE_4 -/* DEPRECATED DEFAULT_ARK_ITABLE_5: use ARKSTEP_DEFAULT_ARK_ITABLE_5 */ -#define DEFAULT_ARK_ITABLE_5 ARKSTEP_DEFAULT_ARK_ITABLE_5 - -/* backwards-compatibility */ -typedef ARKStagePredictFn ARKStepStagePredictFn; - /* ------------------- * Exported Functions * ------------------- */ @@ -261,8 +214,6 @@ SUNDIALS_EXPORT int ARKStepSetErrFile(void *arkode_mem, FILE *errfp); SUNDIALS_EXPORT int ARKStepSetUserData(void *arkode_mem, void *user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDIALS_LOGGER instead") -int ARKStepSetDiagnostics(void *arkode_mem, FILE *diagfp); SUNDIALS_EXPORT int ARKStepSetPostprocessStepFn(void *arkode_mem, ARKPostProcessFn ProcessStep); diff --git a/include/arkode/arkode_butcher_dirk.h b/include/arkode/arkode_butcher_dirk.h index aecaf16a82..0dd8a788ea 100644 --- a/include/arkode/arkode_butcher_dirk.h +++ b/include/arkode/arkode_butcher_dirk.h @@ -23,49 +23,6 @@ extern "C" { #endif - -/* Butcher table accessor IDs - ERK: 0 - 99 - DIRK: 100 - 199 - MRI: 200 - 299 */ - -/* DEPRECATED SDIRK_2_1_2: use ARKODE_SDIRK_2_1_2 */ -#define SDIRK_2_1_2 100 -/* DEPRECATED BILLINGTON_3_3_2: use ARKODE_BILLINGTON_3_3_2 */ -#define BILLINGTON_3_3_2 101 -/* DEPRECATED TRBDF2_3_3_2: use ARKODE_TRBDF2_3_3_2 */ -#define TRBDF2_3_3_2 102 -/* DEPRECATED KVAERNO_4_2_3: use ARKODE_KVAERNO_4_2_3 */ -#define KVAERNO_4_2_3 103 -/* DEPRECATED ARK324L2SA_DIRK_4_2_3: use ARKODE_ARK324L2SA_DIRK_4_2_3 */ -#define ARK324L2SA_DIRK_4_2_3 104 -/* DEPRECATED CASH_5_2_4: use ARKODE_CASH_5_2_4 */ -#define CASH_5_2_4 105 -/* DEPRECATED CASH_5_3_4: use ARKODE_CASH_5_3_4 */ -#define CASH_5_3_4 106 -/* DEPRECATED SDIRK_5_3_4: use ARKODE_SDIRK_5_3_4 */ -#define SDIRK_5_3_4 107 -/* DEPRECATED KVAERNO_5_3_4: use ARKODE_KVAERNO_5_3_4 */ -#define KVAERNO_5_3_4 108 -/* DEPRECATED ARK436L2SA_DIRK_6_3_4: use ARKODE_ARK436L2SA_DIRK_6_3_4 */ -#define ARK436L2SA_DIRK_6_3_4 109 -/* DEPRECATED KVAERNO_7_4_5: use ARKODE_KVAERNO_7_4_5 */ -#define KVAERNO_7_4_5 110 -/* DEPRECATED ARK548L2SA_DIRK_8_4_5: use ARKODE_ARK548L2SA_DIRK_8_4_5 */ -#define ARK548L2SA_DIRK_8_4_5 111 -/* DEPRECATED ARK437L2SA_DIRK_7_3_4: use ARKODE_ARK437L2SA_DIRK_7_3_4 */ -#define ARK437L2SA_DIRK_7_3_4 112 -/* DEPRECATED ARK548L2SAb_DIRK_8_4_5: use ARKODE_ARK548L2SAb_DIRK_8_4_5 */ -#define ARK548L2SAb_DIRK_8_4_5 113 - -/* Utility #defines to ensure valid input IDs for DIRK tables */ - -/* DEPRECATED MIN_DIRK_NUM: use ARKODE_MIN_DIRK_NUM */ -#define MIN_DIRK_NUM 100 - -/* DEPRECATED MAX_DIRK_NUM: use ARKODE_MAX_DIRK_NUM */ -#define MAX_DIRK_NUM 113 - typedef enum { ARKODE_DIRK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_DIRK_NUM = 100, diff --git a/include/arkode/arkode_butcher_erk.h b/include/arkode/arkode_butcher_erk.h index 1fa298ae75..fa5a1581c7 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -23,49 +23,6 @@ extern "C" { #endif -/* Butcher table accessor IDs - ERK: 0 - 99 - DIRK: 100 - 199 - MRI: 200 - 299 */ - -/* DEPRECATED HEUN_EULER_2_1_2: use ARKODE_HEUN_EULER_2_1_2 */ -#define HEUN_EULER_2_1_2 0 -/* DEPRECATED BOGACKI_SHAMPINE_4_2_3: use ARKODE_BOGACKI_SHAMPINE_4_2_3 */ -#define BOGACKI_SHAMPINE_4_2_3 1 -/* DEPRECATED ARK324L2SA_ERK_4_2_3: use ARKODE_ARK324L2SA_ERK_4_2_3 */ -#define ARK324L2SA_ERK_4_2_3 2 -/* DEPRECATED ZONNEVELD_5_3_4: use ARKODE_ZONNEVELD_5_3_4 */ -#define ZONNEVELD_5_3_4 3 -/* DEPRECATED ARK436L2SA_ERK_6_3_4: use ARKODE_ARK436L2SA_ERK_6_3_4 */ -#define ARK436L2SA_ERK_6_3_4 4 -/* DEPRECATED SAYFY_ABURUB_6_3_4: use ARKODE_SAYFY_ABURUB_6_3_4 */ -#define SAYFY_ABURUB_6_3_4 5 -/* DEPRECATED CASH_KARP_6_4_5: use ARKODE_CASH_KARP_6_4_5 */ -#define CASH_KARP_6_4_5 6 -/* DEPRECATED FEHLBERG_6_4_5: use ARKODE_FEHLBERG_6_4_5 */ -#define FEHLBERG_6_4_5 7 -/* DEPRECATED DORMAND_PRINCE_7_4_5: use ARKODE_DORMAND_PRINCE_7_4_5 */ -#define DORMAND_PRINCE_7_4_5 8 -/* DEPRECATED ARK548L2SA_ERK_8_4_5: use ARKODE_ARK548L2SA_ERK_8_4_5 */ -#define ARK548L2SA_ERK_8_4_5 9 -/* DEPRECATED VERNER_8_5_6: use ARKODE_VERNER_8_5_6 */ -#define VERNER_8_5_6 10 -/* DEPRECATED FEHLBERG_13_7_8: use ARKODE_FEHLBERG_13_7_8 */ -#define FEHLBERG_13_7_8 11 -/* DEPRECATED KNOTH_WOLKE_3_3: use ARKODE_KNOTH_WOLKE_3_3 */ -#define KNOTH_WOLKE_3_3 12 -/* DEPRECATED ARK437L2SA_ERK_7_3_4: use ARKODE_ARK437L2SA_ERK_7_3_4 */ -#define ARK437L2SA_ERK_7_3_4 13 -/* DEPRECATED ARK548L2SAb_ERK_8_4_5: use ARKODE_ARK548L2SAb_ERK_8_4_5 */ -#define ARK548L2SAb_ERK_8_4_5 14 - -/* Utility #defines to ensure valid input IDs for ERK tables */ - -/* DEPRECATED MIN_ERK_NUM: use ARKODE_MIN_ERK_NUM */ -#define MIN_ERK_NUM 0 -/* DEPRECATED MAX_ERK_NUM: use ARKODE_MAX_ERK_NUM */ -#define MAX_ERK_NUM 14 - typedef enum { ARKODE_ERK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_ERK_NUM = 0, diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index 9f5b56f072..cd4e5c7018 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -38,36 +38,6 @@ static const int ERKSTEP_DEFAULT_5 = ARKODE_CASH_KARP_6_4_5; static const int ERKSTEP_DEFAULT_6 = ARKODE_VERNER_8_5_6; static const int ERKSTEP_DEFAULT_8 = ARKODE_FEHLBERG_13_7_8; -#ifndef DEFAULT_ERK_2 -/* DEPRECATED DEFAULT_ERK_2: use ERKSTEP_DEFAULT_2 */ -#define DEFAULT_ERK_2 ERKSTEP_DEFAULT_2 -#endif - -#ifndef DEFAULT_ERK_3 -/* DEPRECATED DEFAULT_ERK_3: use ERKSTEP_DEFAULT_3 */ -#define DEFAULT_ERK_3 ERKSTEP_DEFAULT_3 -#endif - -#ifndef DEFAULT_ERK_4 -/* DEPRECATED DEFAULT_ERK_4: use ERKSTEP_DEFAULT_4 */ -#define DEFAULT_ERK_4 ERKSTEP_DEFAULT_4 -#endif - -#ifndef DEFAULT_ERK_5 -/* DEPRECATED DEFAULT_ERK_5: use ERKSTEP_DEFAULT_5 */ -#define DEFAULT_ERK_5 ERKSTEP_DEFAULT_5 -#endif - -#ifndef DEFAULT_ERK_6 -/* DEPRECATED DEFAULT_ERK_6: use ERKSTEP_DEFAULT_6 */ -#define DEFAULT_ERK_6 ERKSTEP_DEFAULT_6 -#endif - -#ifndef DEFAULT_ERK_8 -/* DEPRECATED DEFAULT_ERK_8: use ERKSTEP_DEFAULT_8 */ -#define DEFAULT_ERK_8 ERKSTEP_DEFAULT_8 -#endif - /* ------------------- * Exported Functions * ------------------- */ @@ -174,8 +144,6 @@ SUNDIALS_EXPORT int ERKStepSetErrFile(void *arkode_mem, FILE *errfp); SUNDIALS_EXPORT int ERKStepSetUserData(void *arkode_mem, void *user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDIALS_LOGGER instead") -int ERKStepSetDiagnostics(void *arkode_mem, FILE *diagfp); SUNDIALS_EXPORT int ERKStepSetPostprocessStepFn(void *arkode_mem, ARKPostProcessFn ProcessStep); diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index d4d889813f..fbfb91c349 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -41,38 +41,6 @@ typedef enum { MRISTEP_IMEX } MRISTEP_METHOD_TYPE; - -/* MRI coupling table table accessor IDs: - ERK: 0 - 99 - DIRK: 100 - 199 - MRI: 200 - 299 */ - -/* DEPRECATED MIS_KW3: use ARKODE_MIS_KW3 */ -#define MIS_KW3 200 -/* DEPRECATED MRI_GARK_ERK33a: use ARKODE_MRI_GARK_ERK33a */ -#define MRI_GARK_ERK33a 201 -/* DEPRECATED MRI_GARK_ERK45a: use ARKODE_MRI_GARK_ERK45a */ -#define MRI_GARK_ERK45a 202 -/* DEPRECATED MRI_GARK_IRK21a: use ARKODE_MRI_GARK_IRK21a */ -#define MRI_GARK_IRK21a 203 -/* DEPRECATED MRI_GARK_ESDIRK34a: use ARKODE_MRI_GARK_ESDIRK34a */ -#define MRI_GARK_ESDIRK34a 204 -/* DEPRECATED MRI_GARK_ESDIRK46a: use ARKODE_MRI_GARK_ESDIRK46a */ -#define MRI_GARK_ESDIRK46a 205 -/* DEPRECATED IMEX_MRI_GARK3a: use ARKODE_IMEX_MRI_GARK3a */ -#define IMEX_MRI_GARK3a 206 -/* DEPRECATED IMEX_MRI_GARK3b: use ARKODE_IMEX_MRI_GARK3b */ -#define IMEX_MRI_GARK3b 207 -/* DEPRECATED IMEX_MRI_GARK4: use ARKODE_IMEX_MRI_GARK4 */ -#define IMEX_MRI_GARK4 208 - -/* Utility #defines to ensure valid input IDs for MRI tables */ - -/* DEPRECATED MIN_MRI_NUM: use ARKODE_MIN_MRI_NUM */ -#define MIN_MRI_NUM 200 -/* DEPRECATED MAX_MRI_NUM: use ARKODE_MAX_MRI_NUM */ -#define MAX_MRI_NUM 208 - typedef enum { ARKODE_MRI_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_MRI_NUM = 200, @@ -100,23 +68,6 @@ static const int MRISTEP_DEFAULT_IMPL_SD_4 = ARKODE_MRI_GARK_ESDIRK46a; static const int MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b; static const int MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4; -/* DEPRECATED DEFAULT_MRI_TABLE_3: use MRISTEP_DEFAULT_3 */ -#define DEFAULT_MRI_TABLE_3 MRISTEP_DEFAULT_3 /* backwards-compatibility */ -/* DEPRECATED DEFAULT_EXPL_MRI_TABLE_3: use MRISTEP_DEFAULT_EXPL_3 */ -#define DEFAULT_EXPL_MRI_TABLE_3 MRISTEP_DEFAULT_EXPL_3 -/* DEPRECATED DEFAULT_EXPL_MRI_TABLE_4: use MRISTEP_DEFAULT_EXPL_4 */ -#define DEFAULT_EXPL_MRI_TABLE_4 MRISTEP_DEFAULT_EXPL_4 -/* DEPRECATED DEFAULT_IMPL_SD_TABLE_2: use MRISTEP_DEFAULT_IMPL_SD_2 */ -#define DEFAULT_IMPL_SD_MRI_TABLE_2 MRISTEP_DEFAULT_IMPL_SD_2 -/* DEPRECATED DEFAULT_IMPL_SD_TABLE_3: use MRISTEP_DEFAULT_IMPL_SD_3 */ -#define DEFAULT_IMPL_SD_MRI_TABLE_3 MRISTEP_DEFAULT_IMPL_SD_3 -/* DEPRECATED DEFAULT_IMPL_SD_TABLE_4: use MRISTEP_DEFAULT_IMPL_SD_4 */ -#define DEFAULT_IMPL_SD_MRI_TABLE_4 MRISTEP_DEFAULT_IMPL_SD_4 -/* DEPRECATED DEFAULT_IMEX_SD_TABLE_3: use MRISTEP_DEFAULT_IMEX_SD_3 */ -#define DEFAULT_IMEX_SD_MRI_TABLE_3 MRISTEP_DEFAULT_IMEX_SD_3 -/* DEPRECATED DEFAULT_IMEX_SD_TABLE_4: use MRISTEP_DEFAULT_IMEX_SD_4 */ -#define DEFAULT_IMEX_SD_MRI_TABLE_4 MRISTEP_DEFAULT_IMEX_SD_4 - /* ------------------------------------ * MRIStep Inner Stepper Function Types * ------------------------------------ */ @@ -268,8 +219,6 @@ SUNDIALS_EXPORT int MRIStepSetErrFile(void *arkode_mem, FILE *errfp); SUNDIALS_EXPORT int MRIStepSetUserData(void *arkode_mem, void *user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDIALS_LOGGER instead") -int MRIStepSetDiagnostics(void *arkode_mem, FILE *diagfp); SUNDIALS_EXPORT int MRIStepSetPostprocessStepFn(void *arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_EXPORT int MRIStepSetPostprocessStageFn(void *arkode_mem, diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index e1245168e0..2bedd445eb 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1231,16 +1231,6 @@ int arkStep_Init(void* arkode_mem, int init_type) return (ARK_ILL_INPUT); } } - - /* If configured with either predictor 4 or 5 and a non-identity mass - matrix, reset to trivial predictor */ - if (step_mem->mass_type != MASS_IDENTITY) - if ((step_mem->predictor == 4) || (step_mem->predictor == 5)) - step_mem->predictor = 0; - - /* If the bootstrap predictor is enabled, signal to shared arkode module that - fullrhs is required after each step */ - if (step_mem->predictor == 4) ark_mem->call_fullrhs = SUNTRUE; } /* set appropriate TakeStep routine based on problem configuration */ @@ -2515,23 +2505,6 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) ONE : step_mem->gamma / step_mem->gammap; /* protect x/x != 1.0 */ } - /* If predictor==5, then sdata=0 (plus any implicit forcing). - Set sdata appropriately and return */ - if (implicit && (step_mem->predictor == 5)) { - - /* apply external polynomial forcing (updates nvec, cvals, Xvecs) */ - if (step_mem->impforcing) { - nvec = 0; - arkStep_ApplyForcing(step_mem, ark_mem->tcur, step_mem->gamma, &nvec); - retval = N_VLinearCombination(nvec, cvals, Xvecs, step_mem->sdata); - if (retval != 0) return(ARK_VECTOROP_ERR); - } else { - N_VConst(ZERO, step_mem->sdata); - } - return (ARK_SUCCESS); - - } - /* If implicit, initialize sdata to yn - zpred (here: zpred = zp), and set first entries for eventual N_VLinearCombination call */ nvec = 0; diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index fc2df26f98..26f6e1b6bc 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -44,8 +44,6 @@ int ARKStepSetErrHandlerFn(void *arkode_mem, ARKErrHandlerFn ehfun, return(arkSetErrHandlerFn(arkode_mem, ehfun, eh_data)); } int ARKStepSetErrFile(void *arkode_mem, FILE *errfp) { return(arkSetErrFile(arkode_mem, errfp)); } -int ARKStepSetDiagnostics(void *arkode_mem, FILE *diagfp) { - return(arkSetDiagnostics(arkode_mem, diagfp)); } int ARKStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int ARKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { @@ -1333,16 +1331,6 @@ int ARKStepSetPredictorMethod(void *arkode_mem, int pred_method) return(ARK_ILL_INPUT); } - /* Deprecate options 4 and 5 */ - if (pred_method == 4) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", "ARKStepSetPredictorMethod", - "Predictor option 4 is deprecated, and will be removed in an upcoming release"); - } - if (pred_method == 5) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", "ARKStepSetPredictorMethod", - "Predictor option 5 is deprecated, and will be removed in an upcoming release"); - } - /* set parameter */ step_mem->predictor = pred_method; @@ -1441,14 +1429,6 @@ int ARKStepSetStagePredictFn(void *arkode_mem, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); - /* override predictor method 5 if non-NULL PredictStage is supplied */ - if ((step_mem->predictor == 5) && (PredictStage != NULL)) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", - "ARKStepSetStagePredictFn", - "User-supplied predictor is incompatible with predictor method 5"); - return(ARK_ILL_INPUT); - } - step_mem->stage_predict = PredictStage; return(ARK_SUCCESS); } diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 34bb7d46c2..53ba691d34 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -45,8 +45,6 @@ int ERKStepSetErrFile(void *arkode_mem, FILE *errfp) { return(arkSetErrFile(arkode_mem, errfp)); } int ERKStepSetUserData(void *arkode_mem, void *user_data) { return(arkSetUserData(arkode_mem, user_data)); } -int ERKStepSetDiagnostics(void *arkode_mem, FILE *diagfp) { - return(arkSetDiagnostics(arkode_mem, diagfp)); } int ERKStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int ERKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 5c6ced636e..da5a76442b 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -40,8 +40,6 @@ int MRIStepSetErrHandlerFn(void *arkode_mem, ARKErrHandlerFn ehfun, return(arkSetErrHandlerFn(arkode_mem, ehfun, eh_data)); } int MRIStepSetErrFile(void *arkode_mem, FILE *errfp) { return(arkSetErrFile(arkode_mem, errfp)); } -int MRIStepSetDiagnostics(void *arkode_mem, FILE *diagfp) { - return(arkSetDiagnostics(arkode_mem, diagfp)); } int MRIStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int MRIStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { @@ -600,12 +598,6 @@ int MRIStepSetPredictorMethod(void *arkode_mem, int pred_method) &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); - /* Deprecate option 4 */ - if (pred_method == 4) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::MRIStep", "MRIStepSetPredictorMethod", - "Predictor option 4 is deprecated, and will be removed in an upcoming release"); - } - /* set parameter */ step_mem->predictor = pred_method; @@ -704,14 +696,6 @@ int MRIStepSetStagePredictFn(void *arkode_mem, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); - /* override predictor method 5 if non-NULL PredictStage is supplied */ - if ((step_mem->predictor == 5) && (PredictStage != NULL)) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::MRIStep", - "MRIStepSetStagePredictFn", - "User-supplied predictor is incompatible with predictor method 5"); - return(ARK_ILL_INPUT); - } - step_mem->stage_predict = PredictStage; return(ARK_SUCCESS); } diff --git a/src/arkode/fmod/farkode_arkstep_mod.c b/src/arkode/fmod/farkode_arkstep_mod.c index 2ae77231a3..cf29b827f6 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.c +++ b/src/arkode/fmod/farkode_arkstep_mod.c @@ -1227,20 +1227,6 @@ SWIGEXPORT int _wrap_FARKStepSetUserData(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FARKStepSetDiagnostics(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)ARKStepSetDiagnostics(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_arkstep_mod.f90 b/src/arkode/fmod/farkode_arkstep_mod.f90 index c52006c929..f9f0c191eb 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -129,7 +129,6 @@ module farkode_arkstep_mod public :: FARKStepSetErrHandlerFn public :: FARKStepSetErrFile public :: FARKStepSetUserData - public :: FARKStepSetDiagnostics public :: FARKStepSetPostprocessStepFn public :: FARKStepSetPostprocessStageFn public :: FARKStepSetStagePredictFn @@ -865,15 +864,6 @@ function swigc_FARKStepSetUserData(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKStepSetDiagnostics(farg1, farg2) & -bind(C, name="_wrap_FARKStepSetDiagnostics") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FARKStepSetPostprocessStepFn(farg1, farg2) & bind(C, name="_wrap_FARKStepSetPostprocessStepFn") & result(fresult) @@ -2968,22 +2958,6 @@ function FARKStepSetUserData(arkode_mem, user_data) & swig_result = fresult end function -function FARKStepSetDiagnostics(arkode_mem, diagfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: diagfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = diagfp -fresult = swigc_FARKStepSetDiagnostics(farg1, farg2) -swig_result = fresult -end function - function FARKStepSetPostprocessStepFn(arkode_mem, processstep) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod/farkode_erkstep_mod.c b/src/arkode/fmod/farkode_erkstep_mod.c index 46836ba780..8616db5916 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.c +++ b/src/arkode/fmod/farkode_erkstep_mod.c @@ -895,20 +895,6 @@ SWIGEXPORT int _wrap_FERKStepSetUserData(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FERKStepSetDiagnostics(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)ERKStepSetDiagnostics(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FERKStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_erkstep_mod.f90 b/src/arkode/fmod/farkode_erkstep_mod.f90 index 3857ac1a7d..57279f04be 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -94,7 +94,6 @@ module farkode_erkstep_mod public :: FERKStepSetErrHandlerFn public :: FERKStepSetErrFile public :: FERKStepSetUserData - public :: FERKStepSetDiagnostics public :: FERKStepSetPostprocessStepFn public :: FERKStepSetPostprocessStageFn public :: FERKStepEvolve @@ -566,15 +565,6 @@ function swigc_FERKStepSetUserData(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepSetDiagnostics(farg1, farg2) & -bind(C, name="_wrap_FERKStepSetDiagnostics") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FERKStepSetPostprocessStepFn(farg1, farg2) & bind(C, name="_wrap_FERKStepSetPostprocessStepFn") & result(fresult) @@ -1798,22 +1788,6 @@ function FERKStepSetUserData(arkode_mem, user_data) & swig_result = fresult end function -function FERKStepSetDiagnostics(arkode_mem, diagfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: diagfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = diagfp -fresult = swigc_FERKStepSetDiagnostics(farg1, farg2) -swig_result = fresult -end function - function FERKStepSetPostprocessStepFn(arkode_mem, processstep) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 5ca5dcc9f2..3f51ff8cec 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -160,22 +160,6 @@ module farkode_mod public :: FARKodeButcherTable_Write public :: FARKodeButcherTable_CheckOrder public :: FARKodeButcherTable_CheckARKOrder - integer(C_INT), parameter, public :: SDIRK_2_1_2 = 100_C_INT - integer(C_INT), parameter, public :: BILLINGTON_3_3_2 = 101_C_INT - integer(C_INT), parameter, public :: TRBDF2_3_3_2 = 102_C_INT - integer(C_INT), parameter, public :: KVAERNO_4_2_3 = 103_C_INT - integer(C_INT), parameter, public :: ARK324L2SA_DIRK_4_2_3 = 104_C_INT - integer(C_INT), parameter, public :: CASH_5_2_4 = 105_C_INT - integer(C_INT), parameter, public :: CASH_5_3_4 = 106_C_INT - integer(C_INT), parameter, public :: SDIRK_5_3_4 = 107_C_INT - integer(C_INT), parameter, public :: KVAERNO_5_3_4 = 108_C_INT - integer(C_INT), parameter, public :: ARK436L2SA_DIRK_6_3_4 = 109_C_INT - integer(C_INT), parameter, public :: KVAERNO_7_4_5 = 110_C_INT - integer(C_INT), parameter, public :: ARK548L2SA_DIRK_8_4_5 = 111_C_INT - integer(C_INT), parameter, public :: ARK437L2SA_DIRK_7_3_4 = 112_C_INT - integer(C_INT), parameter, public :: ARK548L2SAb_DIRK_8_4_5 = 113_C_INT - integer(C_INT), parameter, public :: MIN_DIRK_NUM = 100_C_INT - integer(C_INT), parameter, public :: MAX_DIRK_NUM = 113_C_INT ! typedef enum ARKODE_DIRKTableID enum, bind(c) enumerator :: ARKODE_DIRK_NONE = -1 @@ -220,23 +204,6 @@ module farkode_mod integer(C_SIZE_T), public :: size = 0 end type public :: FARKodeButcherTable_LoadDIRKByName - integer(C_INT), parameter, public :: HEUN_EULER_2_1_2 = 0_C_INT - integer(C_INT), parameter, public :: BOGACKI_SHAMPINE_4_2_3 = 1_C_INT - integer(C_INT), parameter, public :: ARK324L2SA_ERK_4_2_3 = 2_C_INT - integer(C_INT), parameter, public :: ZONNEVELD_5_3_4 = 3_C_INT - integer(C_INT), parameter, public :: ARK436L2SA_ERK_6_3_4 = 4_C_INT - integer(C_INT), parameter, public :: SAYFY_ABURUB_6_3_4 = 5_C_INT - integer(C_INT), parameter, public :: CASH_KARP_6_4_5 = 6_C_INT - integer(C_INT), parameter, public :: FEHLBERG_6_4_5 = 7_C_INT - integer(C_INT), parameter, public :: DORMAND_PRINCE_7_4_5 = 8_C_INT - integer(C_INT), parameter, public :: ARK548L2SA_ERK_8_4_5 = 9_C_INT - integer(C_INT), parameter, public :: VERNER_8_5_6 = 10_C_INT - integer(C_INT), parameter, public :: FEHLBERG_13_7_8 = 11_C_INT - integer(C_INT), parameter, public :: KNOTH_WOLKE_3_3 = 12_C_INT - integer(C_INT), parameter, public :: ARK437L2SA_ERK_7_3_4 = 13_C_INT - integer(C_INT), parameter, public :: ARK548L2SAb_ERK_8_4_5 = 14_C_INT - integer(C_INT), parameter, public :: MIN_ERK_NUM = 0_C_INT - integer(C_INT), parameter, public :: MAX_ERK_NUM = 14_C_INT ! typedef enum ARKODE_ERKTableID enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 @@ -257,14 +224,15 @@ module farkode_mod enumerator :: ARKODE_ARK437L2SA_ERK_7_3_4 enumerator :: ARKODE_ARK548L2SAb_ERK_8_4_5 enumerator :: ARKODE_ARK2_ERK_3_1_2 - enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_ARK2_ERK_3_1_2 + enumerator :: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_SOFRONIOU_SPALETTA_5_3_4 end enum integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, 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_MAX_ERK_NUM + ARKODE_ARK548L2SAb_ERK_8_4_5, ARKODE_ARK2_ERK_3_1_2, ARKODE_SOFRONIOU_SPALETTA_5_3_4, ARKODE_MAX_ERK_NUM public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName ! typedef enum ARKODE_SPRKMethodID diff --git a/src/arkode/fmod/farkode_mristep_mod.c b/src/arkode/fmod/farkode_mristep_mod.c index 8ba7ad5296..0065b6553f 100644 --- a/src/arkode/fmod/farkode_mristep_mod.c +++ b/src/arkode/fmod/farkode_mristep_mod.c @@ -1171,20 +1171,6 @@ SWIGEXPORT int _wrap_FMRIStepSetUserData(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FMRIStepSetDiagnostics(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)MRIStepSetDiagnostics(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_mristep_mod.f90 b/src/arkode/fmod/farkode_mristep_mod.f90 index b80ca727f8..c0358e1ad1 100644 --- a/src/arkode/fmod/farkode_mristep_mod.f90 +++ b/src/arkode/fmod/farkode_mristep_mod.f90 @@ -47,17 +47,6 @@ module farkode_mristep_mod end enum integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX - integer(C_INT), parameter, public :: MIS_KW3 = 200_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ERK33a = 201_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ERK45a = 202_C_INT - integer(C_INT), parameter, public :: MRI_GARK_IRK21a = 203_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ESDIRK34a = 204_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ESDIRK46a = 205_C_INT - integer(C_INT), parameter, public :: IMEX_MRI_GARK3a = 206_C_INT - integer(C_INT), parameter, public :: IMEX_MRI_GARK3b = 207_C_INT - integer(C_INT), parameter, public :: IMEX_MRI_GARK4 = 208_C_INT - integer(C_INT), parameter, public :: MIN_MRI_NUM = 200_C_INT - integer(C_INT), parameter, public :: MAX_MRI_NUM = 208_C_INT ! typedef enum ARKODE_MRITableID enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 @@ -168,7 +157,6 @@ module farkode_mristep_mod public :: FMRIStepSetErrHandlerFn public :: FMRIStepSetErrFile public :: FMRIStepSetUserData - public :: FMRIStepSetDiagnostics public :: FMRIStepSetPostprocessStepFn public :: FMRIStepSetPostprocessStageFn public :: FMRIStepSetPreInnerFn @@ -806,15 +794,6 @@ function swigc_FMRIStepSetUserData(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepSetDiagnostics(farg1, farg2) & -bind(C, name="_wrap_FMRIStepSetDiagnostics") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FMRIStepSetPostprocessStepFn(farg1, farg2) & bind(C, name="_wrap_FMRIStepSetPostprocessStepFn") & result(fresult) @@ -2448,22 +2427,6 @@ function FMRIStepSetUserData(arkode_mem, user_data) & swig_result = fresult end function -function FMRIStepSetDiagnostics(arkode_mem, diagfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: diagfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = diagfp -fresult = swigc_FMRIStepSetDiagnostics(farg1, farg2) -swig_result = fresult -end function - function FMRIStepSetPostprocessStepFn(arkode_mem, processstep) & result(swig_result) use, intrinsic :: ISO_C_BINDING From 4a3a32321e4809a57ed037b106fd2dc1fd457177 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 09:07:27 -0700 Subject: [PATCH 02/85] remove direct and spils header files --- include/cvode/cvode_direct.h | 67 ----------------- include/cvode/cvode_spils.h | 92 ----------------------- include/cvodes/cvodes_direct.h | 79 -------------------- include/cvodes/cvodes_spils.h | 127 -------------------------------- include/ida/ida_direct.h | 68 ----------------- include/ida/ida_spils.h | 95 ------------------------ include/idas/idas_direct.h | 81 -------------------- include/idas/idas_spils.h | 131 --------------------------------- include/kinsol/kinsol_direct.h | 66 ----------------- include/kinsol/kinsol_spils.h | 85 --------------------- 10 files changed, 891 deletions(-) delete mode 100644 include/cvode/cvode_direct.h delete mode 100644 include/cvode/cvode_spils.h delete mode 100644 include/cvodes/cvodes_direct.h delete mode 100644 include/cvodes/cvodes_spils.h delete mode 100644 include/ida/ida_direct.h delete mode 100644 include/ida/ida_spils.h delete mode 100644 include/idas/idas_direct.h delete mode 100644 include/idas/idas_spils.h delete mode 100644 include/kinsol/kinsol_direct.h delete mode 100644 include/kinsol/kinsol_spils.h diff --git a/include/cvode/cvode_direct.h b/include/cvode/cvode_direct.h deleted file mode 100644 index 88568252d4..0000000000 --- a/include/cvode/cvode_direct.h +++ /dev/null @@ -1,67 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * CVODE; these routines now just wrap the updated CVODE generic - * linear solver interface in cvode_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVDLS_H -#define _CVDLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in cvode_ls.h) - =================================================================*/ - -typedef CVLsJacFn CVDlsJacFn; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in cvode_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFn instead") -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJacEvals instead") -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVDlsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVDlsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/cvode/cvode_spils.h b/include/cvode/cvode_spils.h deleted file mode 100644 index 2c60f794d4..0000000000 --- a/include/cvode/cvode_spils.h +++ /dev/null @@ -1,92 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODE; these routines now just wrap - * the updated CVODE generic linear solver interface in cvode_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVSPILS_H -#define _CVSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in cvode_ls.h) - ===============================================================*/ - -typedef CVLsPrecSetupFn CVSpilsPrecSetupFn; -typedef CVLsPrecSolveFn CVSpilsPrecSolveFn; -typedef CVLsJacTimesSetupFn CVSpilsJacTimesSetupFn; -typedef CVLsJacTimesVecFn CVSpilsJacTimesVecFn; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in cvode_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetEpsLin instead") -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditioner instead") -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, - CVSpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimes instead") -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, - CVSpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecEvals instead") -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecSolves instead") -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinIters instead") -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumConvFails instead") -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJTSetupEvals instead") -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJtimesEvals instead") -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVSpilsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/cvodes/cvodes_direct.h b/include/cvodes/cvodes_direct.h deleted file mode 100644 index a1b8a02cbe..0000000000 --- a/include/cvodes/cvodes_direct.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * CVODES; these routines now just wrap the updated CVODE generic - * linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVSDLS_H -#define _CVSDLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in cvodes_ls.h) - =================================================================*/ - -typedef CVLsJacFn CVDlsJacFn; -typedef CVLsJacFnB CVDlsJacFnB; -typedef CVLsJacFnBS CVDlsJacFnBS; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in cvodes_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFn instead") -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJacEvals instead") -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVDlsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVDlsGetReturnFlagName(long int flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolverB instead") -int CVDlsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS, SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFnB instead") -int CVDlsSetJacFnB(void *cvode_mem, int which, CVDlsJacFnB jacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFnBS instead") -int CVDlsSetJacFnBS(void *cvode_mem, int which, CVDlsJacFnBS jacBS); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/cvodes/cvodes_spils.h b/include/cvodes/cvodes_spils.h deleted file mode 100644 index 76b986d880..0000000000 --- a/include/cvodes/cvodes_spils.h +++ /dev/null @@ -1,127 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODES; these routines now just wrap - * the updated CVODES generic linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVSSPILS_H -#define _CVSSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in cvodes_ls.h) - ===============================================================*/ - -typedef CVLsPrecSetupFn CVSpilsPrecSetupFn; -typedef CVLsPrecSolveFn CVSpilsPrecSolveFn; -typedef CVLsJacTimesSetupFn CVSpilsJacTimesSetupFn; -typedef CVLsJacTimesVecFn CVSpilsJacTimesVecFn; -typedef CVLsPrecSetupFnB CVSpilsPrecSetupFnB; -typedef CVLsPrecSetupFnBS CVSpilsPrecSetupFnBS; -typedef CVLsPrecSolveFnB CVSpilsPrecSolveFnB; -typedef CVLsPrecSolveFnBS CVSpilsPrecSolveFnBS; -typedef CVLsJacTimesSetupFnB CVSpilsJacTimesSetupFnB; -typedef CVLsJacTimesSetupFnBS CVSpilsJacTimesSetupFnBS; -typedef CVLsJacTimesVecFnB CVSpilsJacTimesVecFnB; -typedef CVLsJacTimesVecFnBS CVSpilsJacTimesVecFnBS; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in cvodes_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetEpsLin instead") -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditioner instead") -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, - CVSpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimes instead") -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, - CVSpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecEvals instead") -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecSolves instead") -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinIters instead") -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumConvFails instead") -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJTSetupEvals instead") -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJtimesEvals instead") -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVSpilsGetReturnFlagName(long int flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolverB instead") -int CVSpilsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetEpsLinB instead") -int CVSpilsSetEpsLinB(void *cvode_mem, int which, realtype eplifacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditionerB instead") -int CVSpilsSetPreconditionerB(void *cvode_mem, int which, - CVSpilsPrecSetupFnB psetB, - CVSpilsPrecSolveFnB psolveB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditionerBS instead") -int CVSpilsSetPreconditionerBS(void *cvode_mem, int which, - CVSpilsPrecSetupFnBS psetBS, - CVSpilsPrecSolveFnBS psolveBS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimesB instead") -int CVSpilsSetJacTimesB(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnB jtsetupB, - CVSpilsJacTimesVecFnB jtimesB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimesBS instead") -int CVSpilsSetJacTimesBS(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnBS jtsetupBS, - CVSpilsJacTimesVecFnBS jtimesBS); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/ida/ida_direct.h b/include/ida/ida_direct.h deleted file mode 100644 index e45fc3018c..0000000000 --- a/include/ida/ida_direct.h +++ /dev/null @@ -1,68 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in ida_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDADLS_H -#define _IDADLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in ida_ls.h) - =================================================================*/ - -typedef IDALsJacFn IDADlsJacFn; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in ida_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFn instead") -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJacEvals instead") -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDADlsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDADlsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDADlsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/ida/ida_spils.h b/include/ida/ida_spils.h deleted file mode 100644 index 2d40789ac2..0000000000 --- a/include/ida/ida_spils.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Alan Hindmarsh, Radu Serban and Aaron Collier @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in IDA; these routines now just wrap - * the updated IDA generic linear solver interface in ida_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDASPILS_H -#define _IDASPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in ida_ls.h) - ===============================================================*/ - -typedef IDALsPrecSetupFn IDASpilsPrecSetupFn; -typedef IDALsPrecSolveFn IDASpilsPrecSolveFn; -typedef IDALsJacTimesSetupFn IDASpilsJacTimesSetupFn; -typedef IDALsJacTimesVecFn IDASpilsJacTimesVecFn; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in ida_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditioner instead") -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimes instead") -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetEpsLin instead") -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetIncrementFactor instead") -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecEvals instead") -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecSolves instead") -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinIters instead") -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinConvFails instead") -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJTSetupEvals instead") -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJtimesEvals instead") -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDASpilsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDASpilsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/idas/idas_direct.h b/include/idas/idas_direct.h deleted file mode 100644 index 7fc6f47cf2..0000000000 --- a/include/idas/idas_direct.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in idas_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDADLS_H -#define _IDADLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in ida_ls.h) - =================================================================*/ - -typedef IDALsJacFn IDADlsJacFn; -typedef IDALsJacFnB IDADlsJacFnB; -typedef IDALsJacFnBS IDADlsJacFnBS; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in idas_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFn instead") -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJacEvals instead") -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDADlsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDADlsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDADlsGetReturnFlagName(long int flag); - - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolverB instead") -int IDADlsSetLinearSolverB(void *ida_mem, int which, - SUNLinearSolver LS, SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFnB instead") -int IDADlsSetJacFnB(void *ida_mem, int which, IDADlsJacFnB jacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFnBS instead") -int IDADlsSetJacFnBS(void *ida_mem, int which, IDADlsJacFnBS jacBS); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/idas/idas_spils.h b/include/idas/idas_spils.h deleted file mode 100644 index 9ea7b01749..0000000000 --- a/include/idas/idas_spils.h +++ /dev/null @@ -1,131 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in IDAS; these routines now just wrap - * the updated IDA generic linear solver interface in idas_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDASSPILS_H -#define _IDASSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in idas_ls.h) - ===============================================================*/ - -typedef IDALsPrecSetupFn IDASpilsPrecSetupFn; -typedef IDALsPrecSolveFn IDASpilsPrecSolveFn; -typedef IDALsJacTimesSetupFn IDASpilsJacTimesSetupFn; -typedef IDALsJacTimesVecFn IDASpilsJacTimesVecFn; -typedef IDALsPrecSetupFnB IDASpilsPrecSetupFnB; -typedef IDALsPrecSetupFnBS IDASpilsPrecSetupFnBS; -typedef IDALsPrecSolveFnB IDASpilsPrecSolveFnB; -typedef IDALsPrecSolveFnBS IDASpilsPrecSolveFnBS; -typedef IDALsJacTimesSetupFnB IDASpilsJacTimesSetupFnB; -typedef IDALsJacTimesSetupFnBS IDASpilsJacTimesSetupFnBS; -typedef IDALsJacTimesVecFnB IDASpilsJacTimesVecFnB; -typedef IDALsJacTimesVecFnBS IDASpilsJacTimesVecFnBS; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in idas_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditioner instead") -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimes instead") -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetEpsLin instead") -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetIncrementFactor instead") -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecEvals instead") -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecSolves instead") -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinIters instead") -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinConvFails instead") -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJTSetupEvals instead") -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJtimesEvals instead") -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDASpilsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDASpilsGetReturnFlagName(long int flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolverB instead") -int IDASpilsSetLinearSolverB(void *ida_mem, int which, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetEpsLinB instead") -int IDASpilsSetEpsLinB(void *ida_mem, int which, realtype eplifacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetIncrementFactorB instead") -int IDASpilsSetIncrementFactorB(void *ida_mem, int which, realtype dqincfacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditionerB instead") -int IDASpilsSetPreconditionerB(void *ida_mem, int which, - IDASpilsPrecSetupFnB psetB, - IDASpilsPrecSolveFnB psolveB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditionerBS instead") -int IDASpilsSetPreconditionerBS(void *ida_mem, int which, - IDASpilsPrecSetupFnBS psetBS, - IDASpilsPrecSolveFnBS psolveBS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimesB instead") -int IDASpilsSetJacTimesB(void *ida_mem, int which, - IDASpilsJacTimesSetupFnB jtsetupB, - IDASpilsJacTimesVecFnB jtimesB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimesBS instead") -int IDASpilsSetJacTimesBS(void *ida_mem, int which, - IDASpilsJacTimesSetupFnBS jtsetupBS, - IDASpilsJacTimesVecFnBS jtimesBS); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/kinsol/kinsol_direct.h b/include/kinsol/kinsol_direct.h deleted file mode 100644 index bc5c1c6307..0000000000 --- a/include/kinsol/kinsol_direct.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * KINSOL; these routines now just wrap the updated KINSOL generic - * linear solver interface in kinsol_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _KINDLS_H -#define _KINDLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in kinsol_ls.h) - =================================================================*/ - -typedef KINLsJacFn KINDlsJacFn; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetLinearSolver instead") -int KINDlsSetLinearSolver(void *kinmem, SUNLinearSolver LS, SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetJacFn instead") -int KINDlsSetJacFn(void *kinmem, KINDlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinWorkSpace instead") -int KINDlsGetWorkSpace(void *kinmem, long int *lenrw, long int *leniw); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumJacEvals instead") -int KINDlsGetNumJacEvals(void *kinmem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinFuncEvals instead") -int KINDlsGetNumFuncEvals(void *kinmem, long int *nfevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLastLinFlag instead") -int KINDlsGetLastFlag(void *kinmem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinReturnFlagName instead") -char *KINDlsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/kinsol/kinsol_spils.h b/include/kinsol/kinsol_spils.h deleted file mode 100644 index 075ff106ea..0000000000 --- a/include/kinsol/kinsol_spils.h +++ /dev/null @@ -1,85 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Scott Cohen, Alan Hindmarsh, Radu Serban, - * and Aaron Collier @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled Preconditioned Iterative - * Linear Solver interface in KINSOL; these routines now just wrap - * the updated KINSOL generic linear solver interface in kinsol_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _KINSPILS_H -#define _KINSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in kinsol_ls.h) - ===============================================================*/ - -typedef KINLsPrecSetupFn KINSpilsPrecSetupFn; -typedef KINLsPrecSolveFn KINSpilsPrecSolveFn; -typedef KINLsJacTimesVecFn KINSpilsJacTimesVecFn; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetLinearSolver instead") -int KINSpilsSetLinearSolver(void *kinmem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetPreconditioner instead") -int KINSpilsSetPreconditioner(void *kinmem, KINSpilsPrecSetupFn psetup, - KINSpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetJacTimesVecFn instead") -int KINSpilsSetJacTimesVecFn(void *kinmem, KINSpilsJacTimesVecFn jtv); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinWorkSpace instead") -int KINSpilsGetWorkSpace(void *kinmem, long int *lenrwLS, long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumPrecEvals instead") -int KINSpilsGetNumPrecEvals(void *kinmem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumPrecSolves instead") -int KINSpilsGetNumPrecSolves(void *kinmem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinIters instead") -int KINSpilsGetNumLinIters(void *kinmem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinConvFails instead") -int KINSpilsGetNumConvFails(void *kinmem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumJtimesEvals instead") -int KINSpilsGetNumJtimesEvals(void *kinmem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinFuncEvals instead") -int KINSpilsGetNumFuncEvals(void *kinmem, long int *nfevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLastLinFlag instead") -int KINSpilsGetLastFlag(void *kinmem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinReturnFlagName instead") -char *KINSpilsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif From c3c4b288fba164a8837ba7c8d363bddf57c7a0cb Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 09:09:12 -0700 Subject: [PATCH 03/85] remove kinsol deprecated code --- include/kinsol/kinsol.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index 7d8c7da50d..196b708def 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -139,11 +139,7 @@ SUNDIALS_EXPORT int KINSetErrHandlerFn(void *kinmem, KINErrHandlerFn ehfun, SUNDIALS_EXPORT int KINSetErrFile(void *kinmem, FILE *errfp); SUNDIALS_EXPORT int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, void *ih_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -SUNDIALS_EXPORT int KINSetInfoFile(void *kinmem, FILE *infofp); SUNDIALS_EXPORT int KINSetPrintLevel(void *kinmem, int printfl); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetDebugFilename instead") -int KINSetDebugFile(void *kinmem, FILE *debugfp); /* Optional output functions */ From 9a43a8a7425c3fd0bfb88373e9d4f5c96fd1b8d7 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:12:47 -0700 Subject: [PATCH 04/85] more changes for the removal of spils and direct --- .../serial/cvsRoberts_ASAi_dns_constraints.c | 1 - examples/sunlinsol/test_sunlinsol.h | 4 +- include/sundials/sundials_band.h | 43 --- include/sundials/sundials_dense.h | 48 ---- include/sundials/sundials_direct.h | 70 +---- include/sundials/sundials_iterative.h | 30 -- include/sundials/sundials_lapack.h | 258 ------------------ src/cvode/CMakeLists.txt | 4 - src/cvode/cvode_direct.c | 54 ---- src/cvode/cvode_spils.c | 76 ------ src/cvodes/CMakeLists.txt | 4 - src/cvodes/cvodes_direct.c | 65 ----- src/cvodes/cvodes_spils.c | 107 -------- src/ida/CMakeLists.txt | 4 - src/ida/ida_direct.c | 56 ---- src/ida/ida_spils.c | 81 ------ src/idas/CMakeLists.txt | 4 - src/idas/idas_direct.c | 66 ----- src/idas/idas_spils.c | 114 -------- src/kinsol/CMakeLists.txt | 3 - src/kinsol/kinsol_direct.c | 55 ---- src/kinsol/kinsol_spils.c | 73 ----- 22 files changed, 4 insertions(+), 1216 deletions(-) delete mode 100644 include/sundials/sundials_lapack.h delete mode 100644 src/cvode/cvode_direct.c delete mode 100644 src/cvode/cvode_spils.c delete mode 100644 src/cvodes/cvodes_direct.c delete mode 100644 src/cvodes/cvodes_spils.c delete mode 100644 src/ida/ida_direct.c delete mode 100644 src/ida/ida_spils.c delete mode 100644 src/idas/idas_direct.c delete mode 100644 src/idas/idas_spils.c delete mode 100644 src/kinsol/kinsol_direct.c delete mode 100644 src/kinsol/kinsol_spils.c diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c index 79c9d8038f..21538d367d 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c @@ -61,7 +61,6 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* access to CVDls interface */ #include /* defs. of realtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ diff --git a/examples/sunlinsol/test_sunlinsol.h b/examples/sunlinsol/test_sunlinsol.h index d816f613de..7ae8aa000c 100644 --- a/examples/sunlinsol/test_sunlinsol.h +++ b/examples/sunlinsol/test_sunlinsol.h @@ -38,8 +38,8 @@ int Test_SUNLinSolSpace(SUNLinearSolver S, int myid); int Test_SUNLinSolNumIters(SUNLinearSolver S, int myid); int Test_SUNLinSolResNorm(SUNLinearSolver S, int myid); int Test_SUNLinSolResid(SUNLinearSolver S, int myid); -int Test_SUNLinSolSetATimes(SUNLinearSolver S, void* ATdata, ATimesFn ATimes, int myid); -int Test_SUNLinSolSetPreconditioner(SUNLinearSolver S, void* Pdata, PSetupFn PSetup, PSolveFn PSolve, int myid); +int Test_SUNLinSolSetATimes(SUNLinearSolver S, void* ATdata, SUNATimesFn ATimes, int myid); +int Test_SUNLinSolSetPreconditioner(SUNLinearSolver S, void* Pdata, SUNPSetupFn PSetup, SUNPSolveFn PSolve, int myid); int Test_SUNLinSolSetScalingVectors(SUNLinearSolver S, N_Vector s1, N_Vector s2, int myid); int Test_SUNLinSolSetZeroGuess(SUNLinearSolver S, int myid); int Test_SUNLinSolInitialize(SUNLinearSolver S, int myid); diff --git a/include/sundials/sundials_band.h b/include/sundials/sundials_band.h index 47ef42a4cf..9c306de2c1 100644 --- a/include/sundials/sundials_band.h +++ b/include/sundials/sundials_band.h @@ -79,19 +79,11 @@ extern "C" { SUNDIALS_EXPORT sunindextype SUNDlsMat_BandGBTRF(SUNDlsMat A, sunindextype* p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandGBTRF instead") -sunindextype BandGBTRF(DlsMat A, sunindextype *p); - SUNDIALS_EXPORT sunindextype SUNDlsMat_bandGBTRF(realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandGBTRF instead") -sunindextype bandGBTRF(realtype **a, sunindextype n, - sunindextype mu, sunindextype ml, - sunindextype smu, sunindextype *p); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_BandGBTRS @@ -113,17 +105,10 @@ sunindextype bandGBTRF(realtype **a, sunindextype n, SUNDIALS_EXPORT void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandGBTRS instead") -void BandGBTRS(DlsMat A, sunindextype *p, realtype *b); - SUNDIALS_EXPORT void SUNDlsMat_bandGBTRS(realtype **a, sunindextype n, sunindextype smu, sunindextype ml, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandGBTRS instead") -void bandGBTRS(realtype **a, sunindextype n, sunindextype smu, - sunindextype ml, sunindextype *p, realtype *b); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_BandCopy @@ -143,21 +128,11 @@ void bandGBTRS(realtype **a, sunindextype n, sunindextype smu, SUNDIALS_EXPORT void SUNDlsMat_BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandCopy instead") -void BandCopy(DlsMat A, DlsMat B, sunindextype copymu, - sunindextype copyml); - SUNDIALS_EXPORT void SUNDlsMat_bandCopy(realtype **a, realtype **b, sunindextype n, sunindextype a_smu, sunindextype b_smu, sunindextype copymu, sunindextype copyml); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandCopy instead") -void bandCopy(realtype **a, realtype **b, sunindextype n, - sunindextype a_smu, sunindextype b_smu, - sunindextype copymu, sunindextype copyml); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_BandScale @@ -174,17 +149,10 @@ void bandCopy(realtype **a, realtype **b, sunindextype n, void SUNDlsMat_BandScale(realtype c, SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandScale instead") -void BandScale(realtype c, DlsMat A); - SUNDIALS_EXPORT void SUNDlsMat_bandScale(realtype c, realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandScale instead") -void bandScale(realtype c, realtype **a, sunindextype n, - sunindextype mu, sunindextype ml, sunindextype smu); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_bandAddIdentity @@ -196,9 +164,6 @@ void bandScale(realtype c, realtype **a, sunindextype n, void SUNDlsMat_bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandAddIdentity instead") -void bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); - /* * ----------------------------------------------------------------- @@ -218,19 +183,11 @@ void bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); SUNDIALS_EXPORT void SUNDlsMat_BandMatvec(SUNDlsMat A, realtype *x, realtype *y); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandMatvec instead") -void BandMatvec(DlsMat A, realtype *x, realtype *y); - SUNDIALS_EXPORT void SUNDlsMat_bandMatvec(realtype **a, realtype *x, realtype *y, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandMatvec instead") -void bandMatvec(realtype **a, realtype *x, realtype *y, - sunindextype n, sunindextype mu, - sunindextype ml, sunindextype smu); - #ifdef __cplusplus } #endif diff --git a/include/sundials/sundials_dense.h b/include/sundials/sundials_dense.h index 2ba052c968..201580cad4 100644 --- a/include/sundials/sundials_dense.h +++ b/include/sundials/sundials_dense.h @@ -71,27 +71,17 @@ extern "C" { SUNDIALS_EXPORT sunindextype SUNDlsMat_DenseGETRF(SUNDlsMat A, sunindextype *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseGETRF instead") -sunindextype DenseGETRF(DlsMat A, sunindextype *p); SUNDIALS_EXPORT void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseGETRS instead") -void DenseGETRS(DlsMat A, sunindextype *p, realtype *b); SUNDIALS_EXPORT sunindextype SUNDlsMat_denseGETRF(realtype **a, sunindextype m, sunindextype n, sunindextype *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseGETRF instead") -sunindextype denseGETRF(realtype **a, sunindextype m, - sunindextype n, sunindextype *p); SUNDIALS_EXPORT void SUNDlsMat_denseGETRS(realtype **a, sunindextype n, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseGETRS instead") -void denseGETRS(realtype **a, sunindextype n, sunindextype *p, - realtype *b); /* * ---------------------------------------------------------------------------- @@ -114,23 +104,15 @@ void denseGETRS(realtype **a, sunindextype n, sunindextype *p, SUNDIALS_EXPORT sunindextype SUNDlsMat_DensePOTRF(SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DensePOTRF instead") -sunindextype DensePOTRF(DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_DensePOTRS(SUNDlsMat A, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DensePOTRS instead") -void DensePOTRS(DlsMat A, realtype *b); SUNDIALS_EXPORT sunindextype SUNDlsMat_densePOTRF(realtype **a, sunindextype m); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_densePOTRF instead") -sunindextype densePOTRF(realtype **a, sunindextype m); SUNDIALS_EXPORT void SUNDlsMat_densePOTRS(realtype **a, sunindextype m, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_densePOTRS instead") -void densePOTRS(realtype **a, sunindextype m, realtype *b); /* * ----------------------------------------------------------------------------- @@ -160,32 +142,20 @@ void densePOTRS(realtype **a, sunindextype m, realtype *b); SUNDIALS_EXPORT int SUNDlsMat_DenseGEQRF(SUNDlsMat A, realtype *beta, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseGEQRF instead") -int DenseGEQRF(DlsMat A, realtype *beta, realtype *wrk); SUNDIALS_EXPORT int SUNDlsMat_DenseORMQR(SUNDlsMat A, realtype *beta, realtype *vn, realtype *vm, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseORMQR instead") -int DenseORMQR(DlsMat A, realtype *beta, realtype *vn, - realtype *vm, realtype *wrk); SUNDIALS_EXPORT int SUNDlsMat_denseGEQRF(realtype **a, sunindextype m, sunindextype n, realtype *beta, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseGEQRF instead") -int denseGEQRF(realtype **a, sunindextype m, sunindextype n, - realtype *beta, realtype *wrk); SUNDIALS_EXPORT int SUNDlsMat_denseORMQR(realtype **a, sunindextype m, sunindextype n, realtype *beta, realtype *v, realtype *w, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseORMQR instead") -int denseORMQR(realtype **a, sunindextype m, sunindextype n, - realtype *beta, realtype *v, realtype *w, - realtype *wrk); /* * ---------------------------------------------------------------------------- @@ -201,15 +171,10 @@ int denseORMQR(realtype **a, sunindextype m, sunindextype n, SUNDIALS_EXPORT void SUNDlsMat_DenseCopy(SUNDlsMat A, SUNDlsMat B); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseCopy instead") -void DenseCopy(DlsMat A, DlsMat B); SUNDIALS_EXPORT void SUNDlsMat_denseCopy(realtype **a, realtype **b, sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseCopy instead") -void denseCopy(realtype **a, realtype **b, sunindextype m, - sunindextype n); /* * ----------------------------------------------------------------------------- @@ -226,16 +191,10 @@ void denseCopy(realtype **a, realtype **b, sunindextype m, SUNDIALS_EXPORT void SUNDlsMat_DenseScale(realtype c, SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsSUNDlsMat_DenseScale_denseCopy instead") -void DenseScale(realtype c, DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_denseScale(realtype c, realtype **a, sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseScale instead") -void denseScale(realtype c, realtype **a, sunindextype m, - sunindextype n); - /* * ----------------------------------------------------------------------------- @@ -248,8 +207,6 @@ void denseScale(realtype c, realtype **a, sunindextype m, SUNDIALS_EXPORT void SUNDlsMat_denseAddIdentity(realtype **a, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseAddIdentity instead") -void denseAddIdentity(realtype **a, sunindextype n); /* @@ -268,15 +225,10 @@ void denseAddIdentity(realtype **a, sunindextype n); SUNDIALS_EXPORT void SUNDlsMat_DenseMatvec(SUNDlsMat A, realtype *x, realtype *y); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseMatvec instead") -void DenseMatvec(DlsMat A, realtype *x, realtype *y); SUNDIALS_EXPORT void SUNDlsMat_denseMatvec(realtype **a, realtype *x, realtype *y, sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseMatvec instead") -void denseMatvec(realtype **a, realtype *x, realtype *y, - sunindextype m, sunindextype n); #ifdef __cplusplus diff --git a/include/sundials/sundials_direct.h b/include/sundials/sundials_direct.h index b33c718032..b73ffeae7e 100644 --- a/include/sundials/sundials_direct.h +++ b/include/sundials/sundials_direct.h @@ -125,9 +125,8 @@ typedef struct _DlsMat { realtype *data; sunindextype ldata; realtype **cols; -} *SUNDlsMat; /* DEPRECATED DlsMat: use SUNDlsMat instead */ +} *SUNDlsMat; -typedef SUNDlsMat DlsMat; /* * ================================================================== @@ -155,11 +154,6 @@ typedef SUNDlsMat DlsMat; #define SUNDLS_DENSE_COL(A,j) ((A->cols)[j]) #define SUNDLS_DENSE_ELEM(A,i,j) ((A->cols)[j][i]) -/* DEPRECATED DENSE_COL: use SUNDLS_DENSE_COL instead */ -#define DENSE_COL(A,j) SUNDLS_DENSE_COL(A,j) -/* DEPRECATED DENSE_ELEM: use SUNDLS_DENSE_ELEM instead */ -#define DENSE_ELEM(A,i,j) SUNDLS_DENSE_ELEM(A,i,j) - /* * ----------------------------------------------------------------- * SUNDLS_BAND_COL, SUNDLS_BAND_COL_ELEM, and SUNDLS_BAND_ELEM @@ -185,14 +179,6 @@ typedef SUNDlsMat DlsMat; #define SUNDLS_BAND_COL(A,j) (((A->cols)[j])+(A->s_mu)) #define SUNDLS_BAND_COL_ELEM(col_j,i,j) (col_j[(i)-(j)]) #define SUNDLS_BAND_ELEM(A,i,j) ((A->cols)[j][(i)-(j)+(A->s_mu)]) - -/* DEPRECATED BAND_COL: use SUNDLS_BAND_COL */ -#define BAND_COL(A,j) SUNDLS_BAND_COL(A,j) -/* DEPRECATED BAND_COL_ELEM: use SUNDLS_BAND_COL_ELEM */ -#define BAND_COL_ELEM(col_j,i,j) SUNDLS_BAND_COL_ELEM(col_j,i,j) -/* DEPRECATED BAND_ELEM: use SUNDLS_BAND_ELEM */ -#define BAND_ELEM(A,i,j) SUNDLS_BAND_ELEM(A,i,j) - /* * ================================================================== * Exported function prototypes (functions working on SUNDlsMat) @@ -214,9 +200,6 @@ typedef SUNDlsMat DlsMat; SUNDIALS_EXPORT SUNDlsMat SUNDlsMat_NewDenseMat(sunindextype M, sunindextype N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewDenseMat instead") -DlsMat NewDenseMat(sunindextype M, sunindextype N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_NewBandMat @@ -241,10 +224,6 @@ SUNDIALS_EXPORT SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewBandMat instead") -DlsMat NewBandMat(sunindextype N, sunindextype mu, - sunindextype ml, sunindextype smu); - /* * ----------------------------------------------------------------- * Functions: SUNDlsMat_DestroyMat @@ -255,10 +234,7 @@ DlsMat NewBandMat(sunindextype N, sunindextype mu, */ SUNDIALS_EXPORT -void SUNDlsMat_DestroyMat(DlsMat A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DestroyMat instead") -void DestroyMat(DlsMat A); +void SUNDlsMat_DestroyMat(SUNDlsMat A); /* * ----------------------------------------------------------------- @@ -273,9 +249,6 @@ void DestroyMat(DlsMat A); SUNDIALS_EXPORT int* SUNDlsMat_NewIntArray(int N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewIntArray instead") -int* NewIntArray(int N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_NewIndexArray @@ -290,9 +263,6 @@ int* NewIntArray(int N); SUNDIALS_EXPORT sunindextype* SUNDlsMat_NewIndexArray(sunindextype N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewIndexArray instead") -sunindextype* NewIndexArray(sunindextype N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_NewRealArray @@ -306,9 +276,6 @@ sunindextype* NewIndexArray(sunindextype N); SUNDIALS_EXPORT realtype* SUNDlsMat_NewRealArray(sunindextype N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewRealArray instead") -realtype* NewRealArray(sunindextype N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_DestroyArray @@ -322,9 +289,6 @@ realtype* NewRealArray(sunindextype N); SUNDIALS_EXPORT void SUNDlsMat_DestroyArray(void *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DestroyArray instead") -void DestroyArray(void *p); - /* * ----------------------------------------------------------------- * Function : SUNDlsMat_AddIdentity @@ -340,9 +304,6 @@ void DestroyArray(void *p); SUNDIALS_EXPORT void SUNDlsMat_AddIdentity(SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_AddIdentity instead") -void AddIdentity(DlsMat A); - /* * ----------------------------------------------------------------- * Function : SUNDlsMat_SetToZero @@ -355,9 +316,6 @@ void AddIdentity(DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_SetToZero(SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_SetToZero instead") -void SetToZero(DlsMat A); - /* * ----------------------------------------------------------------- * Functions: SUNDlsMat_PrintMat @@ -373,9 +331,6 @@ void SetToZero(DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_PrintMat(SUNDlsMat A, FILE *outfile); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_PrintMat") -void PrintMat(DlsMat A, FILE *outfile); - /* * ================================================================== * Exported function prototypes (functions working on realtype**) @@ -385,47 +340,26 @@ void PrintMat(DlsMat A, FILE *outfile); SUNDIALS_EXPORT realtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newDenseMat instead") -realtype** newDenseMat(sunindextype m, sunindextype n); - SUNDIALS_EXPORT realtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, sunindextype ml); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newBandMat instead") -realtype** newBandMat(sunindextype n, sunindextype smu, - sunindextype ml); SUNDIALS_EXPORT void SUNDlsMat_destroyMat(realtype** a); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_destroyMat instead") -void destroyMat(realtype** a); - SUNDIALS_EXPORT int* SUNDlsMat_newIntArray(int n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newIntArray instead") -int* newIntArray(int n); - SUNDIALS_EXPORT sunindextype* SUNDlsMat_newIndexArray(sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newIndexArray instead") -sunindextype* newIndexArray(sunindextype n); - SUNDIALS_EXPORT realtype* SUNDlsMat_newRealArray(sunindextype m); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newRealArray instead") - realtype* newRealArray(sunindextype m); - SUNDIALS_EXPORT void SUNDlsMat_destroyArray(void* v); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_destroyArray instead") -void destroyArray(void* v); - #ifdef __cplusplus } diff --git a/include/sundials/sundials_iterative.h b/include/sundials/sundials_iterative.h index 80cf17ab75..ba909df174 100644 --- a/include/sundials/sundials_iterative.h +++ b/include/sundials/sundials_iterative.h @@ -51,11 +51,6 @@ extern "C" { * ----------------------------------------------------------------- */ -/* DEPRECATED PREC_NONE: use SUN_PREC_NONE */ -/* DEPRECATED PREC_LEFT: use SUN_PREC_LEFT */ -/* DEPRECATED PREC_RIGHT: use SUN_PREC_RIGHT */ -/* DEPRECATED PREC_BOTH: use SUN_PREC_BOTH */ -enum { PREC_NONE, PREC_LEFT, PREC_RIGHT, PREC_BOTH }; enum { SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH }; /* @@ -72,9 +67,6 @@ enum { SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH }; * ----------------------------------------------------------------- */ -/* DEPRECATED MODIFIED_GS: use SUN_MODIFIED_GS */ -/* DEPRECATED CLASSICAL_GS: use SUN_CLASSICAL_GS */ -enum { MODIFIED_GS = 1, CLASSICAL_GS = 2 }; enum { SUN_MODIFIED_GS = 1, SUN_CLASSICAL_GS = 2 }; /* @@ -90,8 +82,6 @@ enum { SUN_MODIFIED_GS = 1, SUN_CLASSICAL_GS = 2 }; * ----------------------------------------------------------------- */ -/* DEPRECATED ATimesFn: use SUNATimesFn */ -typedef int (*ATimesFn)(void *A_data, N_Vector v, N_Vector z); typedef int (*SUNATimesFn)(void *A_data, N_Vector v, N_Vector z); /* @@ -104,8 +94,6 @@ typedef int (*SUNATimesFn)(void *A_data, N_Vector v, N_Vector z); * ----------------------------------------------------------------- */ -/* DEPRECATED PSetupFn: use SUNPSetupFn */ -typedef int (*PSetupFn)(void *P_data); typedef int (*SUNPSetupFn)(void *P_data); /* @@ -134,9 +122,6 @@ typedef int (*SUNPSetupFn)(void *P_data); * ----------------------------------------------------------------- */ -/* DEPRECATED PSolveFn: use SUNPSolveFn */ -typedef int (*PSolveFn)(void *P_data, N_Vector r, N_Vector z, - realtype tol, int lr); typedef int (*SUNPSolveFn)(void *P_data, N_Vector r, N_Vector z, realtype tol, int lr); @@ -207,10 +192,6 @@ SUNDIALS_EXPORT int SUNModifiedGS(N_Vector* v, realtype **h, int k, int p, realtype *new_vk_norm); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNModifiedGS instead") -int ModifiedGS(N_Vector* v, realtype **h, int k, int p, - realtype *new_vk_norm); - /* * ----------------------------------------------------------------- * Function: SUNClassicalGS @@ -236,11 +217,6 @@ int SUNClassicalGS(N_Vector* v, realtype **h, int k, int p, realtype *new_vk_norm, realtype *stemp, N_Vector* vtemp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNClassicalGS instead") -int ClassicalGS(N_Vector* v, realtype **h, int k, int p, - realtype *new_vk_norm, realtype *stemp, - N_Vector* vtemp); - /* * ----------------------------------------------------------------- * Function: SUNQRfact @@ -276,9 +252,6 @@ int ClassicalGS(N_Vector* v, realtype **h, int k, int p, SUNDIALS_EXPORT int SUNQRfact(int n, realtype **h, realtype *q, int job); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNQRFact instead") -int QRfact(int n, realtype **h, realtype *q, int job); - /* * ----------------------------------------------------------------- * Function: SUNQRsol @@ -314,9 +287,6 @@ int QRfact(int n, realtype **h, realtype *q, int job); SUNDIALS_EXPORT int SUNQRsol(int n, realtype **h, realtype *q, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNQRsol instead") -int QRsol(int n, realtype **h, realtype *q, realtype *b); - /* * ----------------------------------------------------------------- * Function: SUNQRAdd_MGS diff --git a/include/sundials/sundials_lapack.h b/include/sundials/sundials_lapack.h deleted file mode 100644 index b7e6ef0cd4..0000000000 --- a/include/sundials/sundials_lapack.h +++ /dev/null @@ -1,258 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer: Radu Serban @ LLNL - * Daniel Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 a generic package of direct matrix - * operations for use with BLAS/LAPACK. - * -----------------------------------------------------------------*/ - -#ifndef _SUNDIALS_LAPACK_H -#define _SUNDIALS_LAPACK_H - -#include - -#warning "This header file is deprecated and will be removed in SUNDIALS v7.0.0" - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/* - * ================================================================== - * Blas and Lapack functions - * ================================================================== - */ - -#if defined(SUNDIALS_F77_FUNC) - -#define dcopy_f77 SUNDIALS_F77_FUNC(dcopy, DCOPY) -#define dscal_f77 SUNDIALS_F77_FUNC(dscal, DSCAL) -#define dgemv_f77 SUNDIALS_F77_FUNC(dgemv, DGEMV) -#define dtrsv_f77 SUNDIALS_F77_FUNC(dtrsv, DTRSV) -#define dsyrk_f77 SUNDIALS_F77_FUNC(dsyrk, DSKYR) - -#define dgbtrf_f77 SUNDIALS_F77_FUNC(dgbtrf, DGBTRF) -#define dgbtrs_f77 SUNDIALS_F77_FUNC(dgbtrs, DGBTRS) -#define dgetrf_f77 SUNDIALS_F77_FUNC(dgetrf, DGETRF) -#define dgetrs_f77 SUNDIALS_F77_FUNC(dgetrs, DGETRS) -#define dgeqp3_f77 SUNDIALS_F77_FUNC(dgeqp3, DGEQP3) -#define dgeqrf_f77 SUNDIALS_F77_FUNC(dgeqrf, DGEQRF) -#define dormqr_f77 SUNDIALS_F77_FUNC(dormqr, DORMQR) -#define dpotrf_f77 SUNDIALS_F77_FUNC(dpotrf, DPOTRF) -#define dpotrs_f77 SUNDIALS_F77_FUNC(dpotrs, DPOTRS) - -#define scopy_f77 SUNDIALS_F77_FUNC(scopy, SCOPY) -#define sscal_f77 SUNDIALS_F77_FUNC(sscal, SSCAL) -#define sgemv_f77 SUNDIALS_F77_FUNC(sgemv, SGEMV) -#define strsv_f77 SUNDIALS_F77_FUNC(strsv, STRSV) -#define ssyrk_f77 SUNDIALS_F77_FUNC(ssyrk, SSKYR) - -#define sgbtrf_f77 SUNDIALS_F77_FUNC(sgbtrf, SGBTRF) -#define sgbtrs_f77 SUNDIALS_F77_FUNC(sgbtrs, SGBTRS) -#define sgetrf_f77 SUNDIALS_F77_FUNC(sgetrf, SGETRF) -#define sgetrs_f77 SUNDIALS_F77_FUNC(sgetrs, SGETRS) -#define sgeqp3_f77 SUNDIALS_F77_FUNC(sgeqp3, SGEQP3) -#define sgeqrf_f77 SUNDIALS_F77_FUNC(sgeqrf, SGEQRF) -#define sormqr_f77 SUNDIALS_F77_FUNC(sormqr, SORMQR) -#define spotrf_f77 SUNDIALS_F77_FUNC(spotrf, SPOTRF) -#define spotrs_f77 SUNDIALS_F77_FUNC(spotrs, SPOTRS) - -#else - -#define dcopy_f77 dcopy_ -#define dscal_f77 dscal_ -#define dgemv_f77 dgemv_ -#define dtrsv_f77 dtrsv_ -#define dsyrk_f77 dsyrk_ - -#define dgbtrf_f77 dgbtrf_ -#define dgbtrs_f77 dgbtrs_ -#define dgeqp3_f77 dgeqp3_ -#define dgeqrf_f77 dgeqrf_ -#define dgetrf_f77 dgetrf_ -#define dgetrs_f77 dgetrs_ -#define dormqr_f77 dormqr_ -#define dpotrf_f77 dpotrf_ -#define dpotrs_f77 dpotrs_ - -#define scopy_f77 scopy_ -#define sscal_f77 sscal_ -#define sgemv_f77 sgemv_ -#define strsv_f77 strsv_ -#define ssyrk_f77 ssyrk_ - -#define sgbtrf_f77 sgbtrf_ -#define sgbtrs_f77 sgbtrs_ -#define sgeqp3_f77 sgeqp3_ -#define sgeqrf_f77 sgeqrf_ -#define sgetrf_f77 sgetrf_ -#define sgetrs_f77 sgetrs_ -#define sormqr_f77 sormqr_ -#define spotrf_f77 spotrf_ -#define spotrs_f77 spotrs_ - -#endif - -/* Level-1 BLAS */ - -extern void dcopy_f77(sunindextype *n, const double *x, - const sunindextype *inc_x, double *y, - const sunindextype *inc_y); - -extern void dscal_f77(sunindextype *n, const double *alpha, double *x, - const sunindextype *inc_x); - -extern void scopy_f77(sunindextype *n, const float *x, - const sunindextype *inc_x, float *y, - const sunindextype *inc_y); - -extern void sscal_f77(sunindextype *n, const float *alpha, float *x, - const sunindextype *inc_x); - -/* Level-2 BLAS */ - -extern void dgemv_f77(const char *trans, sunindextype *m, sunindextype *n, - const double *alpha, const double *a, sunindextype *lda, - const double *x, sunindextype *inc_x, const double *beta, - double *y, sunindextype *inc_y); - -extern void dtrsv_f77(const char *uplo, const char *trans, const char *diag, - const sunindextype *n, const double *a, - const sunindextype *lda, double *x, - const sunindextype *inc_x); - -extern void sgemv_f77(const char *trans, sunindextype *m, sunindextype *n, - const float *alpha, const float *a, sunindextype *lda, - const float *x, sunindextype *inc_x, const float *beta, - float *y, sunindextype *inc_y); - -extern void strsv_f77(const char *uplo, const char *trans, const char *diag, - const sunindextype *n, const float *a, - const sunindextype *lda, float *x, - const sunindextype *inc_x); - -/* Level-3 BLAS */ - -extern void dsyrk_f77(const char *uplo, const char *trans, - const sunindextype *n, const sunindextype *k, - const double *alpha, const double *a, - const sunindextype *lda, const double *beta, - const double *c, const sunindextype *ldc); - -extern void ssyrk_f77(const char *uplo, const char *trans, - const sunindextype *n, const sunindextype *k, - const float *alpha, const float *a, - const sunindextype *lda, const float *beta, - const float *c, const sunindextype *ldc); - -/* LAPACK */ - -extern void dgbtrf_f77(const sunindextype *m, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - double *ab, sunindextype *ldab, sunindextype *ipiv, - sunindextype *info); - -extern void dgbtrs_f77(const char *trans, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - const sunindextype *nrhs, double *ab, - const sunindextype *ldab, sunindextype *ipiv, - double *b, const sunindextype *ldb, sunindextype *info); - - -extern void dgeqp3_f77(const sunindextype *m, const sunindextype *n, double *a, - const sunindextype *lda, sunindextype *jpvt, double *tau, - double *work, const sunindextype *lwork, - sunindextype *info); - -extern void dgeqrf_f77(const sunindextype *m, const sunindextype *n, double *a, - const sunindextype *lda, double *tau, double *work, - const sunindextype *lwork, sunindextype *info); - -extern void dgetrf_f77(const sunindextype *m, const sunindextype *n, double *a, - sunindextype *lda, sunindextype *ipiv, - sunindextype *info); - -extern void dgetrs_f77(const char *trans, const sunindextype *n, - const sunindextype *nrhs, double *a, - const sunindextype *lda, sunindextype *ipiv, double *b, - const sunindextype *ldb, sunindextype *info); - - -extern void dormqr_f77(const char *side, const char *trans, - const sunindextype *m, const sunindextype *n, - const sunindextype *k, double *a, - const sunindextype *lda, double *tau, double *c, - const sunindextype *ldc, double *work, - const sunindextype *lwork, sunindextype *info); - -extern void dpotrf_f77(const char *uplo, const sunindextype *n, double *a, - sunindextype *lda, sunindextype *info); - -extern void dpotrs_f77(const char *uplo, const sunindextype *n, - const sunindextype *nrhs, double *a, - const sunindextype *lda, double *b, - const sunindextype *ldb, sunindextype *info); - - -extern void sgbtrf_f77(const sunindextype *m, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - float *ab, sunindextype *ldab, sunindextype *ipiv, - sunindextype *info); - -extern void sgbtrs_f77(const char *trans, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - const sunindextype *nrhs, float *ab, - const sunindextype *ldab, sunindextype *ipiv, - float *b, const sunindextype *ldb, sunindextype *info); - - -extern void sgeqp3_f77(const sunindextype *m, const sunindextype *n, float *a, - const sunindextype *lda, sunindextype *jpvt, float *tau, - float *work, const sunindextype *lwork, - sunindextype *info); - -extern void sgeqrf_f77(const sunindextype *m, const sunindextype *n, float *a, - const sunindextype *lda, float *tau, float *work, - const sunindextype *lwork, sunindextype *info); - -extern void sgetrf_f77(const sunindextype *m, const sunindextype *n, float *a, - sunindextype *lda, sunindextype *ipiv, - sunindextype *info); - -extern void sgetrs_f77(const char *trans, const sunindextype *n, - const sunindextype *nrhs, float *a, - const sunindextype *lda, sunindextype *ipiv, - float *b, const sunindextype *ldb, sunindextype *info); - - -extern void sormqr_f77(const char *side, const char *trans, - const sunindextype *m, const sunindextype *n, - const sunindextype *k, float *a, const sunindextype *lda, - float *tau, float *c, const sunindextype *ldc, - float *work, const sunindextype *lwork, - sunindextype *info); - -extern void spotrf_f77(const char *uplo, const sunindextype *n, float *a, - sunindextype *lda, sunindextype *info); - -extern void spotrs_f77(const char *uplo, const sunindextype *n, - const sunindextype *nrhs, float *a, - const sunindextype *lda, float *b, - const sunindextype *ldb, sunindextype *info); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/cvode/CMakeLists.txt b/src/cvode/CMakeLists.txt index bcdbe0d513..ed1eb55dfe 100644 --- a/src/cvode/CMakeLists.txt +++ b/src/cvode/CMakeLists.txt @@ -23,12 +23,10 @@ set(cvode_SOURCES cvode_bandpre.c cvode_bbdpre.c cvode_diag.c - cvode_direct.c cvode_io.c cvode_ls.c cvode_nls.c cvode_proj.c - cvode_spils.c ) # Add variable cvode_HEADERS with the exported CVODE header files @@ -37,10 +35,8 @@ set(cvode_HEADERS cvode_bandpre.h cvode_bbdpre.h cvode_diag.h - cvode_direct.h cvode_ls.h cvode_proj.h - cvode_spils.h ) # Add prefix with complete path to the CVODE header files diff --git a/src/cvode/cvode_direct.c b/src/cvode/cvode_direct.c deleted file mode 100644 index ca7c25ec13..0000000000 --- a/src/cvode/cvode_direct.c +++ /dev/null @@ -1,54 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * CVODE; these routines now just wrap the updated CVODE generic - * linear solver interface in cvode_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in cvode_ls.h) - =================================================================*/ - -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, SUNMatrix A) -{ return(CVodeSetLinearSolver(cvode_mem, LS, A)); } - -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac) -{ return(CVodeSetJacFn(cvode_mem, jac)); } - -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals) -{ return(CVodeGetNumJacEvals(cvode_mem, njevals)); } - -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVDlsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVDlsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif diff --git a/src/cvode/cvode_spils.c b/src/cvode/cvode_spils.c deleted file mode 100644 index eebde519c5..0000000000 --- a/src/cvode/cvode_spils.c +++ /dev/null @@ -1,76 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Implementation file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODE; these routines now just wrap - * the updated CVODE generic linear solver interface in cvode_ls.h. - * -----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - CVSPILS Exported functions (wrappers for equivalent routines in - cvode_ls.h) - =================================================================*/ - -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS) -{ return(CVodeSetLinearSolver(cvode_mem, LS, NULL)); } - -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac) -{ return(CVodeSetEpsLin(cvode_mem, eplifac)); } - -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, CVSpilsPrecSolveFn psolve) -{ return(CVodeSetPreconditioner(cvode_mem, pset, psolve)); } - -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, CVSpilsJacTimesVecFn jtimes) -{ return(CVodeSetJacTimes(cvode_mem, jtsetup, jtimes)); } - -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals) -{ return(CVodeGetNumPrecEvals(cvode_mem, npevals)); } - -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves) -{ return(CVodeGetNumPrecSolves(cvode_mem, npsolves)); } - -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters) -{ return(CVodeGetNumLinIters(cvode_mem, nliters)); } - -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails) -{ return(CVodeGetNumLinConvFails(cvode_mem, nlcfails)); } - -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups) -{ return(CVodeGetNumJTSetupEvals(cvode_mem, njtsetups)); } - -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals) -{ return(CVodeGetNumJtimesEvals(cvode_mem, njvevals)); } - -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVSpilsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif diff --git a/src/cvodes/CMakeLists.txt b/src/cvodes/CMakeLists.txt index 480830056d..38cfc129a9 100644 --- a/src/cvodes/CMakeLists.txt +++ b/src/cvodes/CMakeLists.txt @@ -25,7 +25,6 @@ set(cvodes_SOURCES cvodes_bandpre.c cvodes_bbdpre.c cvodes_diag.c - cvodes_direct.c cvodes_io.c cvodes_ls.c cvodes_nls.c @@ -33,7 +32,6 @@ set(cvodes_SOURCES cvodes_nls_stg.c cvodes_nls_stg1.c cvodes_proj.c - cvodes_spils.c ) # Add variable cvodes_HEADERS with the exported CVODES header files @@ -42,10 +40,8 @@ set(cvodes_HEADERS cvodes_bandpre.h cvodes_bbdpre.h cvodes_diag.h - cvodes_direct.h cvodes_ls.h cvodes_proj.h - cvodes_spils.h ) # Add prefix with complete path to the CVODES header files diff --git a/src/cvodes/cvodes_direct.c b/src/cvodes/cvodes_direct.c deleted file mode 100644 index e5bccaf427..0000000000 --- a/src/cvodes/cvodes_direct.c +++ /dev/null @@ -1,65 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * CVODES; these routines now just wrap the updated CVODE generic - * linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in cvodes_ls.h) - =================================================================*/ - -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, - SUNMatrix A) -{ return(CVodeSetLinearSolver(cvode_mem, LS, A)); } - -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac) -{ return(CVodeSetJacFn(cvode_mem, jac)); } - -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals) -{ return(CVodeGetNumJacEvals(cvode_mem, njevals)); } - -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVDlsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVDlsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - -int CVDlsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS, SUNMatrix A) -{ return(CVodeSetLinearSolverB(cvode_mem, which, LS, A)); } - -int CVDlsSetJacFnB(void *cvode_mem, int which, CVDlsJacFnB jacB) -{ return(CVodeSetJacFnB(cvode_mem, which, jacB)); } - -int CVDlsSetJacFnBS(void *cvode_mem, int which, CVDlsJacFnBS jacBS) -{ return(CVodeSetJacFnBS(cvode_mem, which, jacBS)); } - -#ifdef __cplusplus -} -#endif diff --git a/src/cvodes/cvodes_spils.c b/src/cvodes/cvodes_spils.c deleted file mode 100644 index 9f6f6cd037..0000000000 --- a/src/cvodes/cvodes_spils.c +++ /dev/null @@ -1,107 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODES; these routines now just wrap - * the updated CVODES generic linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - CVSSPILS Exported functions (wrappers for equivalent routines in - cvodes_ls.h) - =================================================================*/ - -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS) -{ return(CVodeSetLinearSolver(cvode_mem, LS, NULL)); } - -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac) -{ return(CVodeSetEpsLin(cvode_mem, eplifac)); } - -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, - CVSpilsPrecSolveFn psolve) -{ return(CVodeSetPreconditioner(cvode_mem, pset, psolve)); } - -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, - CVSpilsJacTimesVecFn jtimes) -{ return(CVodeSetJacTimes(cvode_mem, jtsetup, jtimes)); } - -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals) -{ return(CVodeGetNumPrecEvals(cvode_mem, npevals)); } - -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves) -{ return(CVodeGetNumPrecSolves(cvode_mem, npsolves)); } - -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters) -{ return(CVodeGetNumLinIters(cvode_mem, nliters)); } - -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails) -{ return(CVodeGetNumLinConvFails(cvode_mem, nlcfails)); } - -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups) -{ return(CVodeGetNumJTSetupEvals(cvode_mem, njtsetups)); } - -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals) -{ return(CVodeGetNumJtimesEvals(cvode_mem, njvevals)); } - -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVSpilsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - -int CVSpilsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS) -{ return(CVodeSetLinearSolverB(cvode_mem, which, LS, NULL)); } - -int CVSpilsSetEpsLinB(void *cvode_mem, int which, realtype eplifacB) -{ return(CVodeSetEpsLinB(cvode_mem, which, eplifacB)); } - -int CVSpilsSetPreconditionerB(void *cvode_mem, int which, - CVSpilsPrecSetupFnB psetB, - CVSpilsPrecSolveFnB psolveB) -{ return(CVodeSetPreconditionerB(cvode_mem, which, psetB, psolveB)); } - -int CVSpilsSetPreconditionerBS(void *cvode_mem, int which, - CVSpilsPrecSetupFnBS psetBS, - CVSpilsPrecSolveFnBS psolveBS) -{ return(CVodeSetPreconditionerBS(cvode_mem, which, psetBS, psolveBS)); } - -int CVSpilsSetJacTimesB(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnB jtsetupB, - CVSpilsJacTimesVecFnB jtimesB) -{ return(CVodeSetJacTimesB(cvode_mem, which, jtsetupB, jtimesB)); } - -int CVSpilsSetJacTimesBS(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnBS jtsetupBS, - CVSpilsJacTimesVecFnBS jtimesBS) -{ return(CVodeSetJacTimesBS(cvode_mem, which, jtsetupBS, jtimesBS)); } - - -#ifdef __cplusplus -} -#endif - diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt index 120f3f9687..b95ee46f48 100644 --- a/src/ida/CMakeLists.txt +++ b/src/ida/CMakeLists.txt @@ -21,21 +21,17 @@ install(CODE "MESSAGE(\"\nInstall IDA\n\")") set(ida_SOURCES ida.c ida_bbdpre.c - ida_direct.c ida_ic.c ida_io.c ida_ls.c ida_nls.c - ida_spils.c ) # Add variable ida_HEADERS with the exported IDA header files set(ida_HEADERS ida.h ida_bbdpre.h - ida_direct.h ida_ls.h - ida_spils.h ) # Add prefix with complete path to the IDA header files diff --git a/src/ida/ida_direct.c b/src/ida/ida_direct.c deleted file mode 100644 index 52ef5ef0b6..0000000000 --- a/src/ida/ida_direct.c +++ /dev/null @@ -1,56 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in ida_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in ida_ls.h) - =================================================================*/ - -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, SUNMatrix A) -{ return(IDASetLinearSolver(ida_mem, LS, A)); } - -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac) -{ return(IDASetJacFn(ida_mem, jac)); } - -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals) -{ return(IDAGetNumJacEvals(ida_mem, njevals)); } - -int IDADlsGetNumResEvals(void *ida_mem, long int *nfevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nfevalsLS)); } - -int IDADlsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDADlsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif - diff --git a/src/ida/ida_spils.c b/src/ida/ida_spils.c deleted file mode 100644 index 50e2cbe94f..0000000000 --- a/src/ida/ida_spils.c +++ /dev/null @@ -1,81 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Alan Hindmarsh, Radu Serban and Aaron Collier @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated Scaled and Preconditioned - * Iterative Linear Solver interface in IDA; these routines now just - * wrap the updated IDA generic linear solver interface in ida_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in ida_ls.h) - =================================================================*/ - -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS) -{ return(IDASetLinearSolver(ida_mem, LS, NULL)); } - -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve) -{ return(IDASetPreconditioner(ida_mem, pset, psolve)); } - -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes) -{ return(IDASetJacTimes(ida_mem, jtsetup, jtimes)); } - -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac) -{ return(IDASetEpsLin(ida_mem, eplifac)); } - -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac) -{ return(IDASetIncrementFactor(ida_mem, dqincfac)); } - -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals) -{ return(IDAGetNumPrecEvals(ida_mem, npevals)); } - -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves) -{ return(IDAGetNumPrecSolves(ida_mem, npsolves)); } - -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters) -{ return(IDAGetNumLinIters(ida_mem, nliters)); } - -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails) -{ return(IDAGetNumLinConvFails(ida_mem, nlcfails)); } - -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups) -{ return(IDAGetNumJTSetupEvals(ida_mem, njtsetups)); } - -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals) -{ return(IDAGetNumJtimesEvals(ida_mem, njvevals)); } - -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nrevalsLS)); } - -int IDASpilsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDASpilsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - -#ifdef __cplusplus -} -#endif - diff --git a/src/idas/CMakeLists.txt b/src/idas/CMakeLists.txt index c825d114c1..b0c6aa4df0 100644 --- a/src/idas/CMakeLists.txt +++ b/src/idas/CMakeLists.txt @@ -21,7 +21,6 @@ install(CODE "MESSAGE(\"\nInstall IDAS\n\")") set(idas_SOURCES idas.c idaa.c - idas_direct.c idas_io.c idas_ic.c idaa_io.c @@ -30,16 +29,13 @@ set(idas_SOURCES idas_nls.c idas_nls_sim.c idas_nls_stg.c - idas_spils.c ) # Add variable idas_HEADERS with the exported IDAS header files set(idas_HEADERS idas.h idas_bbdpre.h - idas_direct.h idas_ls.h - idas_spils.h ) # Add prefix with complete path to the IDAS header files diff --git a/src/idas/idas_direct.c b/src/idas/idas_direct.c deleted file mode 100644 index c42f22c1ff..0000000000 --- a/src/idas/idas_direct.c +++ /dev/null @@ -1,66 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in idas_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in idas_ls.h) - =================================================================*/ - -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, - SUNMatrix A) -{ return(IDASetLinearSolver(ida_mem, LS, A)); } - -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac) -{ return(IDASetJacFn(ida_mem, jac)); } - -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals) -{ return(IDAGetNumJacEvals(ida_mem, njevals)); } - -int IDADlsGetNumResEvals(void *ida_mem, long int *nrevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nrevalsLS)); } - -int IDADlsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDADlsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - -int IDADlsSetLinearSolverB(void *ida_mem, int which, - SUNLinearSolver LS, SUNMatrix A) -{ return(IDASetLinearSolverB(ida_mem, which, LS, A)); } - -int IDADlsSetJacFnB(void *ida_mem, int which, IDADlsJacFnB jacB) -{ return(IDASetJacFnB(ida_mem, which, jacB)); } - -int IDADlsSetJacFnBS(void *ida_mem, int which, IDADlsJacFnBS jacBS) -{ return(IDASetJacFnBS(ida_mem, which, jacBS)); } - -#ifdef __cplusplus -} -#endif - diff --git a/src/idas/idas_spils.c b/src/idas/idas_spils.c deleted file mode 100644 index 9ee1b1d311..0000000000 --- a/src/idas/idas_spils.c +++ /dev/null @@ -1,114 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated Scaled and Preconditioned - * Iterative Linear Solver interface in IDAS; these routines now just - * wrap the updated IDA generic linear solver interface in idas_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in idas_ls.h) - =================================================================*/ - -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS) -{ return(IDASetLinearSolver(ida_mem, LS, NULL)); } - -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve) -{ return(IDASetPreconditioner(ida_mem, pset, psolve)); } - -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes) -{ return(IDASetJacTimes(ida_mem, jtsetup, jtimes)); } - -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac) -{ return(IDASetEpsLin(ida_mem, eplifac)); } - -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac) -{ return(IDASetIncrementFactor(ida_mem, dqincfac)); } - -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals) -{ return(IDAGetNumPrecEvals(ida_mem, npevals)); } - -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves) -{ return(IDAGetNumPrecSolves(ida_mem, npsolves)); } - -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters) -{ return(IDAGetNumLinIters(ida_mem, nliters)); } - -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails) -{ return(IDAGetNumLinConvFails(ida_mem, nlcfails)); } - -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups) -{ return(IDAGetNumJTSetupEvals(ida_mem, njtsetups)); } - -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals) -{ return(IDAGetNumJtimesEvals(ida_mem, njvevals)); } - -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nrevalsLS)); } - -int IDASpilsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDASpilsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - -int IDASpilsSetLinearSolverB(void *ida_mem, int which, - SUNLinearSolver LS) -{ return(IDASetLinearSolverB(ida_mem, which, LS, NULL)); } - -int IDASpilsSetEpsLinB(void *ida_mem, int which, realtype eplifacB) -{ return(IDASetEpsLinB(ida_mem, which, eplifacB)); } - -int IDASpilsSetIncrementFactorB(void *ida_mem, int which, - realtype dqincfacB) -{ return(IDASetIncrementFactorB(ida_mem, which, dqincfacB)); } - -int IDASpilsSetPreconditionerB(void *ida_mem, int which, - IDASpilsPrecSetupFnB psetB, - IDASpilsPrecSolveFnB psolveB) -{ return(IDASetPreconditionerB(ida_mem, which, psetB, psolveB)); } - -int IDASpilsSetPreconditionerBS(void *ida_mem, int which, - IDASpilsPrecSetupFnBS psetBS, - IDASpilsPrecSolveFnBS psolveBS) -{ return(IDASetPreconditionerBS(ida_mem, which, psetBS, psolveBS)); } - -int IDASpilsSetJacTimesB(void *ida_mem, int which, - IDASpilsJacTimesSetupFnB jtsetupB, - IDASpilsJacTimesVecFnB jtimesB) -{ return(IDASetJacTimesB(ida_mem, which, jtsetupB, jtimesB)); } - -int IDASpilsSetJacTimesBS(void *ida_mem, int which, - IDASpilsJacTimesSetupFnBS jtsetupBS, - IDASpilsJacTimesVecFnBS jtimesBS) -{ return(IDASetJacTimesBS(ida_mem, which, jtsetupBS, jtimesBS)); } - - - -#ifdef __cplusplus -} -#endif - diff --git a/src/kinsol/CMakeLists.txt b/src/kinsol/CMakeLists.txt index 20fd1572ec..ff7b5fcbca 100644 --- a/src/kinsol/CMakeLists.txt +++ b/src/kinsol/CMakeLists.txt @@ -21,10 +21,8 @@ install(CODE "MESSAGE(\"\nInstall KINSOL\n\")") set(kinsol_SOURCES kinsol.c kinsol_bbdpre.c - kinsol_direct.c kinsol_io.c kinsol_ls.c - kinsol_spils.c ) # Add variable kinsol_HEADERS with the exported KINSOL header files @@ -33,7 +31,6 @@ set(kinsol_HEADERS kinsol_bbdpre.h kinsol_direct.h kinsol_ls.h - kinsol_spils.h ) # Add prefix with complete path to the KINSOL header files diff --git a/src/kinsol/kinsol_direct.c b/src/kinsol/kinsol_direct.c deleted file mode 100644 index a9427041ea..0000000000 --- a/src/kinsol/kinsol_direct.c +++ /dev/null @@ -1,55 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * KINSOL; these routines now just wrap the updated KINSOL generic - * linear solver interface in kinsol_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - =================================================================*/ - -int KINDlsSetLinearSolver(void *kinmem, SUNLinearSolver LS, SUNMatrix A) -{ return(KINSetLinearSolver(kinmem, LS, A)); } - -int KINDlsSetJacFn(void *kinmem, KINDlsJacFn jac) -{ return(KINSetJacFn(kinmem, jac)); } - -int KINDlsGetWorkSpace(void *kinmem, long int *lenrw, long int *leniw) -{ return(KINGetLinWorkSpace(kinmem, lenrw, leniw)); } - -int KINDlsGetNumJacEvals(void *kinmem, long int *njevals) -{ return(KINGetNumJacEvals(kinmem, njevals)); } - -int KINDlsGetNumFuncEvals(void *kinmem, long int *nfevals) -{ return(KINGetNumLinFuncEvals(kinmem, nfevals)); } - -int KINDlsGetLastFlag(void *kinmem, long int *flag) -{ return(KINGetLastLinFlag(kinmem, flag)); } - -char *KINDlsGetReturnFlagName(long int flag) -{ return(KINGetLinReturnFlagName(flag)); } - -#ifdef __cplusplus -} -#endif - diff --git a/src/kinsol/kinsol_spils.c b/src/kinsol/kinsol_spils.c deleted file mode 100644 index aad4005762..0000000000 --- a/src/kinsol/kinsol_spils.c +++ /dev/null @@ -1,73 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Scott Cohen, Alan Hindmarsh, Radu Serban, - * and Aaron Collier @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Header file for the deprecated Scaled Preconditioned Iterative - * Linear Solver interface in KINSOL; these routines now just wrap - * the updated KINSOL generic linear solver interface in kinsol_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - =================================================================*/ - -int KINSpilsSetLinearSolver(void *kinmem, SUNLinearSolver LS) -{ return(KINSetLinearSolver(kinmem, LS, NULL)); } - -int KINSpilsSetPreconditioner(void *kinmem, KINSpilsPrecSetupFn psetup, - KINSpilsPrecSolveFn psolve) -{ return(KINSetPreconditioner(kinmem, psetup, psolve)); } - -int KINSpilsSetJacTimesVecFn(void *kinmem, KINSpilsJacTimesVecFn jtv) -{ return(KINSetJacTimesVecFn(kinmem, jtv)); } - -int KINSpilsGetWorkSpace(void *kinmem, long int *lenrwLS, long int *leniwLS) -{ return(KINGetLinWorkSpace(kinmem, lenrwLS, leniwLS)); } - -int KINSpilsGetNumPrecEvals(void *kinmem, long int *npevals) -{ return(KINGetNumPrecEvals(kinmem, npevals)); } - -int KINSpilsGetNumPrecSolves(void *kinmem, long int *npsolves) -{ return(KINGetNumPrecSolves(kinmem, npsolves)); } - -int KINSpilsGetNumLinIters(void *kinmem, long int *nliters) -{ return(KINGetNumLinIters(kinmem, nliters)); } - -int KINSpilsGetNumConvFails(void *kinmem, long int *nlcfails) -{ return(KINGetNumLinConvFails(kinmem, nlcfails)); } - -int KINSpilsGetNumJtimesEvals(void *kinmem, long int *njvevals) -{ return(KINGetNumJtimesEvals(kinmem, njvevals)); } - -int KINSpilsGetNumFuncEvals(void *kinmem, long int *nfevals) -{ return(KINGetNumLinFuncEvals(kinmem, nfevals)); } - -int KINSpilsGetLastFlag(void *kinmem, long int *flag) -{ return(KINGetLastLinFlag(kinmem, flag)); } - -char *KINSpilsGetReturnFlagName(long int flag) -{ return(KINGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif - From 511f7b96a1e65fa0bc9e9fb81b7bd443b20b22e8 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:35:50 -0700 Subject: [PATCH 05/85] remove more deprecated code --- examples/arkode/C_serial/ark_brusselator_fp.c | 49 +++++++----- examples/cvode/serial/cvKrylovDemo_ls.c | 80 +++++-------------- examples/cvodes/serial/cvsKrylovDemo_ls.c | 79 +++++------------- examples/kinsol/serial/kinAnalytic_fp.c | 8 +- .../kinsol/serial/kinLaplace_picard_kry.c | 8 +- include/nvector/nvector_openmp.h | 16 ---- include/nvector/nvector_openmpdev.h | 16 ---- include/nvector/nvector_parallel.h | 15 ---- include/nvector/nvector_parhyp.h | 18 ----- include/nvector/nvector_petsc.h | 15 ---- include/nvector/nvector_pthreads.h | 18 ----- include/nvector/nvector_serial.h | 15 ---- include/sunlinsol/sunlinsol_pcg.h | 5 -- include/sunlinsol/sunlinsol_spbcgs.h | 6 -- include/sunlinsol/sunlinsol_spfgmr.h | 6 -- include/sunlinsol/sunlinsol_spgmr.h | 7 -- include/sunlinsol/sunlinsol_sptfqmr.h | 6 -- .../sunnonlinsol/sunnonlinsol_fixedpoint.h | 9 --- include/sunnonlinsol/sunnonlinsol_newton.h | 9 --- src/kinsol/kinsol_io.c | 48 ----------- 20 files changed, 75 insertions(+), 358 deletions(-) diff --git a/examples/arkode/C_serial/ark_brusselator_fp.c b/examples/arkode/C_serial/ark_brusselator_fp.c index a8f3084cde..3c99f2d8de 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -59,6 +59,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to FP nonlinear solver */ #include /* def. of type 'realtype' */ +#include #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -96,25 +97,40 @@ int main(int argc, char *argv[]) int monitor = 0; /* turn on/off monitoring */ /* general problem variables */ + SUNContext ctx = NULL; + SUNLogger logger = NULL; + const char* info_fname = "ark_brusselator_fp-info.txt"; int flag; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ - FILE *UFID, *INFOFID; + FILE *UFID; realtype t, tout; int iout; long int nst, nst_a, nfe, nfi, nni, ncfn, netf; - /* Create SUNDIALS context */ - SUNContext ctx = NULL; - flag = SUNContext_Create(NULL, &ctx); - if (check_flag(&flag, "SUNContext_Create", 1)) return 1; - /* read inputs */ if (argc == 2) { monitor = atoi(argv[1]); } + /* create SUNDIALS context and a logger which will record + nonlinear solver info (e.g., residual) amongst other things. */ + + flag = SUNContext_Create(NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) return 1; + + flag = SUNLogger_Create(NULL, 0, &logger); + if (check_flag(&flag, "SUNLogger_Create", 1)) return 1; + + if (monitor) { + flag = SUNLogger_SetInfoFilename(logger, info_fname); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + } + + flag = SUNContext_SetLogger(ctx, logger); + if (check_flag(&flag, "SUNContext_SetLogger", 1)) return 1; + /* set up the test problem according to the desired test */ if (test == 1) { u0 = RCONST(3.9); @@ -145,10 +161,6 @@ int main(int argc, char *argv[]) printf(" problem parameters: a = %"GSYM", b = %"GSYM", ep = %"GSYM"\n",a,b,ep); printf(" reltol = %.1"ESYM", abstol = %.1"ESYM"\n\n",reltol,abstol); - /* Open up info output file */ - INFOFID = NULL; - if (monitor) INFOFID = fopen("ark_brusselator_fp-info.txt","w"); - /* Initialize data structures */ rdata[0] = a; /* set user data */ rdata[1] = b; @@ -168,12 +180,7 @@ int main(int argc, char *argv[]) /* Initialize fixed-point nonlinear solver and attach to ARKStep */ NLS = SUNNonlinSol_FixedPoint(y, fp_m, ctx); if (check_flag((void *)NLS, "SUNNonlinSol_FixedPoint", 0)) return 1; - if (monitor) { - flag = SUNNonlinSolSetPrintLevel_FixedPoint(NLS, 1); - if (check_flag(&flag, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - flag = SUNNonlinSolSetInfoFile_FixedPoint(NLS, INFOFID); - if (check_flag(&flag, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - } + flag = ARKStepSetNonlinearSolver(arkode_mem, NLS); if (check_flag(&flag, "ARKStepSetNonlinearSolver", 1)) return 1; @@ -217,7 +224,6 @@ int main(int argc, char *argv[]) } printf(" ----------------------------------------------\n"); fclose(UFID); - if (monitor) fclose(INFOFID); /* Print some final statistics */ flag = ARKStepGetNumSteps(arkode_mem, &nst); @@ -241,10 +247,11 @@ int main(int argc, char *argv[]) printf(" Total number of error test failures = %li\n\n", netf); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNNonlinSolFree(NLS); /* Free NLS object */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); + ARKStepFree(&arkode_mem); + SUNNonlinSolFree(NLS); + SUNLogger_Destroy(&logger); + SUNContext_Free(&ctx); return 0; } diff --git a/examples/cvode/serial/cvKrylovDemo_ls.c b/examples/cvode/serial/cvKrylovDemo_ls.c index 3b4cbf411a..dc89dfc91f 100644 --- a/examples/cvode/serial/cvKrylovDemo_ls.c +++ b/examples/cvode/serial/cvKrylovDemo_ls.c @@ -53,6 +53,7 @@ #include /* serial N_Vector types, fct. and macros */ #include /* use generic DENSE solver in preconditioning */ #include /* definition of realtype */ +#include /* helpful macros */ @@ -195,17 +196,17 @@ int main(int argc, char* argv[]) SUNNonlinearSolver NLS; void *cvode_mem; int linsolver, iout, retval; - FILE* infofp; int nrmfactor; /* LS norm conversion factor flag */ realtype nrmfac; /* LS norm conversion factor */ int monitor; /* LS resiudal monitoring flag */ SUNContext sunctx; + SUNLogger logger; + const char* info_fname = "cvKrylovDemo_ls-info.txt"; u = NULL; data = NULL; LS = NULL; cvode_mem = NULL; - infofp = NULL; nrmfactor = 0; monitor = 0; @@ -213,16 +214,23 @@ int main(int argc, char* argv[]) if (argc > 1) nrmfactor = atoi(argv[1]); if (argc > 2) monitor = atoi(argv[2]); - /* Create SUNDIALS context */ + /* Create SUNDIALS context and a logger which will record + nonlinear solver info (e.g., residual) amongst other things. */ + retval = SUNContext_Create(NULL, &sunctx); - if (check_retval(&retval, "SUNContext_Create", 1)) return(1); + if (check_retval(&retval, "SUNContext_Create", 1)) return 1; + + retval = SUNLogger_Create(NULL, 0, &logger); + if (check_retval(&retval, "SUNLogger_Create", 1)) return 1; - /* Open info file if monitoring is turned on */ if (monitor) { - infofp = fopen("cvKrylovDemo_ls-info.txt", "w+"); - if (check_retval((void *)infofp, "fopen", 0)) return(1); + retval = SUNLogger_SetInfoFilename(logger, info_fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; } + retval = SUNContext_SetLogger(sunctx, logger); + if (check_retval(&retval, "SUNContext_SetLogger", 1)) return 1; + /* Allocate memory, and set problem data, initial values, tolerances */ u = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)u, "N_VNew_Serial", 0)) return(1); @@ -265,14 +273,6 @@ int main(int argc, char* argv[]) /* Create the SUNNonlinearSolver */ NLS = SUNNonlinSol_Newton(u, sunctx); if (check_retval(&retval, "SUNNonlinSol_Newton", 0)) return(1); - if (monitor) { - /* Set the print level set to 1, so that the nonlinear residual - is printed every newton iteration. */ - retval = SUNNonlinSolSetPrintLevel_Newton(NLS, 1); - if (check_retval(&retval, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - retval = SUNNonlinSolSetInfoFile_Newton(NLS, infofp); - if (check_retval(&retval, "SUNNonlinSolSetInfoFile_Newton", 1)) return(1); - } /* Call CVodeSetNonlinearSolver to attach the nonlinear solver to CVode */ retval = CVodeSetNonlinearSolver(cvode_mem, NLS); @@ -309,22 +309,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPGMR |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPGMR to specify the linear solver SPGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -337,22 +327,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPFGMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPFGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPFGMR to specify the linear solver SPFGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPFGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPFGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPFGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPFGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPFGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPFGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -365,22 +345,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPBCGS |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPBCGS |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPBCGS to specify the linear solver SPBCGS with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPBCGS(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPBCGS", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPBCGS(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPBCGS", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPBCGS(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPBCGS", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -393,22 +363,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPTFQMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPTFQMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPTFQMR to specify the linear solver SPTFQMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPTFQMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPTFQMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPTFQMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPTFQMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPTFQMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPTFQMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -454,12 +414,12 @@ int main(int argc, char* argv[]) } /* END: Loop through SPGMR, SPBCG and SPTFQMR linear solver modules */ /* Free memory */ - if (monitor) fclose(infofp); N_VDestroy(u); FreeUserData(data); CVodeFree(&cvode_mem); SUNLinSolFree(LS); SUNNonlinSolFree(NLS); + SUNLogger_Destroy(&logger); SUNContext_Free(&sunctx); return(0); diff --git a/examples/cvodes/serial/cvsKrylovDemo_ls.c b/examples/cvodes/serial/cvsKrylovDemo_ls.c index 02309e0010..e76ccfa5dc 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_ls.c +++ b/examples/cvodes/serial/cvsKrylovDemo_ls.c @@ -192,17 +192,17 @@ int main(int argc, char* argv[]) SUNNonlinearSolver NLS; void *cvode_mem; int linsolver, iout, retval; - FILE* infofp; int nrmfactor; /* LS norm conversion factor flag */ realtype nrmfac; /* LS norm conversion factor */ int monitor; /* LS resiudal monitoring flag */ SUNContext sunctx; + SUNLogger logger; + const char* info_fname = "cvKrylovDemo_ls-info.txt"; u = NULL; data = NULL; LS = NULL; cvode_mem = NULL; - infofp = NULL; nrmfactor = 0; monitor = 0; @@ -210,16 +210,23 @@ int main(int argc, char* argv[]) if (argc > 1) nrmfactor = atoi(argv[1]); if (argc > 2) monitor = atoi(argv[2]); - /* Create SUNDIALS context */ + /* Create SUNDIALS context and a logger which will record + nonlinear solver info (e.g., residual) amongst other things. */ + retval = SUNContext_Create(NULL, &sunctx); - if (check_retval(&retval, "SUNContext_Create", 1)) return(1); + if (check_retval(&retval, "SUNContext_Create", 1)) return 1; + + retval = SUNLogger_Create(NULL, 0, &logger); + if (check_retval(&retval, "SUNLogger_Create", 1)) return 1; - /* Open info file if monitoring is turned on */ if (monitor) { - infofp = fopen("cvKrylovDemo_ls-info.txt", "w+"); - if (check_retval((void *)infofp, "fopen", 0)) return(1); + retval = SUNLogger_SetInfoFilename(logger, info_fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; } + retval = SUNContext_SetLogger(sunctx, logger); + if (check_retval(&retval, "SUNContext_SetLogger", 1)) return 1; + /* Allocate memory, and set problem data, initial values, tolerances */ u = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)u, "N_VNew_Serial", 0)) return(1); @@ -253,14 +260,6 @@ int main(int argc, char* argv[]) /* Create the SUNNonlinearSolver */ NLS = SUNNonlinSol_Newton(u, sunctx); if (check_retval(&retval, "SUNNonlinSol_Newton", 0)) return(1); - if (monitor) { - /* Set the print level set to 1, so that the nonlinear residual - is printed every newton iteration. */ - retval = SUNNonlinSolSetPrintLevel_Newton(NLS, 1); - if (check_retval(&retval, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - retval = SUNNonlinSolSetInfoFile_Newton(NLS, infofp); - if (check_retval(&retval, "SUNNonlinSolSetInfoFile_Newton", 1)) return(1); - } /* Call CVodeSetNonlinearSolver to attach the nonlinear solver to CVode */ retval = CVodeSetNonlinearSolver(cvode_mem, NLS); @@ -294,22 +293,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPGMR |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPGMR to specify the linear solver SPGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -322,22 +311,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPFGMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPFGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPFGMR to specify the linear solver SPFGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPFGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPFGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPFGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPFGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPFGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPFGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -350,22 +329,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPBCGS |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPBCGS |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPBCGS to specify the linear solver SPBCGS with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPBCGS(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPBCGS", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPBCGS(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPBCGS", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPBCGS(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPBCGS", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -378,22 +347,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPTFQMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPTFQMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPTFQMR to specify the linear solver SPTFQMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPTFQMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPTFQMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPTFQMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPTFQMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPTFQMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPTFQMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -439,12 +398,12 @@ int main(int argc, char* argv[]) } /* END: Loop through SPGMR, SPBCG and SPTFQMR linear solver modules */ /* Free memory */ - if (monitor) fclose(infofp); N_VDestroy(u); FreeUserData(data); CVodeFree(&cvode_mem); SUNLinSolFree(LS); SUNNonlinSolFree(NLS); + SUNLogger_Destroy(&logger); SUNContext_Free(&sunctx); return(0); diff --git a/examples/kinsol/serial/kinAnalytic_fp.c b/examples/kinsol/serial/kinAnalytic_fp.c index 9fedd989c7..c635dcb520 100644 --- a/examples/kinsol/serial/kinAnalytic_fp.c +++ b/examples/kinsol/serial/kinAnalytic_fp.c @@ -231,11 +231,11 @@ int main(int argc, char *argv[]) infofp = fopen("kinsol.log", "w"); if (check_retval((void *)infofp, "fopen", 0)) return(1); - retval = KINSetInfoFile(kmem, infofp); - if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); + // retval = KINSetInfoFile(kmem, infofp); + // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - retval = KINSetPrintLevel(kmem, 1); - if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); + // retval = KINSetPrintLevel(kmem, 1); + // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ------------- * Initial guess diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index 30b18a92ba..9122e8b0ef 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -144,11 +144,11 @@ int main() infofp = fopen("KINSOL.log", "w"); - retval = KINSetInfoFile(kmem, infofp); - if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); + // retval = KINSetInfoFile(kmem, infofp); + // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - retval = KINSetPrintLevel(kmem, 3); - if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); + // retval = KINSetPrintLevel(kmem, 3); + // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ---------------------- * Create SUNLinearSolver diff --git a/include/nvector/nvector_openmp.h b/include/nvector/nvector_openmp.h index 9eaf4d8d04..713f1fbd64 100644 --- a/include/nvector/nvector_openmp.h +++ b/include/nvector/nvector_openmp.h @@ -194,22 +194,6 @@ SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, booleant SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, booleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_OpenMP(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_OpenMP(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_OpenMP(N_Vector* vs, int count); - - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_openmpdev.h b/include/nvector/nvector_openmpdev.h index 62cb37e811..fcc2ced766 100644 --- a/include/nvector/nvector_openmpdev.h +++ b/include/nvector/nvector_openmpdev.h @@ -195,22 +195,6 @@ SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, boole SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, booleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArray_OpenMPDEV(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArrayEmpty_OpenMPDEV(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_OpenMPDEV(N_Vector *vs, int count); - - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_parallel.h b/include/nvector/nvector_parallel.h index bbb29b7de3..127f319c0b 100644 --- a/include/nvector/nvector_parallel.h +++ b/include/nvector/nvector_parallel.h @@ -225,21 +225,6 @@ SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, b SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Parallel(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_Parallel(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_Parallel(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Parallel(N_Vector* vs, int count); - #ifdef __cplusplus } diff --git a/include/nvector/nvector_parhyp.h b/include/nvector/nvector_parhyp.h index f2748db746..03e7f66df6 100644 --- a/include/nvector/nvector_parhyp.h +++ b/include/nvector/nvector_parhyp.h @@ -211,24 +211,6 @@ SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArray_ParHyp(int count, - N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArrayEmpty_ParHyp(int count, - N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_ParHyp(N_Vector *vs, - int count); - SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_ParHyp(N_Vector v, booleantype tf); #ifdef __cplusplus diff --git a/include/nvector/nvector_petsc.h b/include/nvector/nvector_petsc.h index 8ccbdcf2dc..f7745ad98f 100644 --- a/include/nvector/nvector_petsc.h +++ b/include/nvector/nvector_petsc.h @@ -195,21 +195,6 @@ SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, bool SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Petsc(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArray_Petsc(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArrayEmpty_Petsc(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Petsc(N_Vector *vs, int count); - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_pthreads.h b/include/nvector/nvector_pthreads.h index da6be3e461..4e20c7ad5b 100644 --- a/include/nvector/nvector_pthreads.h +++ b/include/nvector/nvector_pthreads.h @@ -243,24 +243,6 @@ SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Pthreads(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_Pthreads(int count, - N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_Pthreads(int count, - N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Pthreads(N_Vector* vs, - int count); - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_serial.h b/include/nvector/nvector_serial.h index 7a96499ee9..1b08708c6c 100644 --- a/include/nvector/nvector_serial.h +++ b/include/nvector/nvector_serial.h @@ -184,21 +184,6 @@ SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, booleant SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, booleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_Serial(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_Serial(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Serial(N_Vector* vs, int count); - #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_pcg.h b/include/sunlinsol/sunlinsol_pcg.h index 3b748e813e..28e34ae6f9 100644 --- a/include/sunlinsol/sunlinsol_pcg.h +++ b/include/sunlinsol/sunlinsol_pcg.h @@ -105,11 +105,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_PCG(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_PCG(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_PCG(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_PCG(SUNLinearSolver LS, int print_level); #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_spbcgs.h b/include/sunlinsol/sunlinsol_spbcgs.h index a257d850ee..f2caa1ba06 100644 --- a/include/sunlinsol/sunlinsol_spbcgs.h +++ b/include/sunlinsol/sunlinsol_spbcgs.h @@ -112,12 +112,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPBCGS(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPBCGS(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPBCGS(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPBCGS(SUNLinearSolver LS, int print_level); - diff --git a/include/sunlinsol/sunlinsol_spfgmr.h b/include/sunlinsol/sunlinsol_spfgmr.h index 5814662e6d..39ba18027e 100644 --- a/include/sunlinsol/sunlinsol_spfgmr.h +++ b/include/sunlinsol/sunlinsol_spfgmr.h @@ -119,12 +119,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPFGMR(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPFGMR(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPFGMR(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPFGMR(SUNLinearSolver LS, int print_level); - #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_spgmr.h b/include/sunlinsol/sunlinsol_spgmr.h index 3fe7da9aee..807556b9a3 100644 --- a/include/sunlinsol/sunlinsol_spgmr.h +++ b/include/sunlinsol/sunlinsol_spgmr.h @@ -121,13 +121,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPGMR(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPGMR(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPGMR(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPGMR(SUNLinearSolver LS, int print_level); - - #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_sptfqmr.h b/include/sunlinsol/sunlinsol_sptfqmr.h index 79f4f5f306..11355d15d9 100644 --- a/include/sunlinsol/sunlinsol_sptfqmr.h +++ b/include/sunlinsol/sunlinsol_sptfqmr.h @@ -112,12 +112,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPTFQMR(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPTFQMR(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPTFQMR(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPTFQMR(SUNLinearSolver LS, int print_level); - #ifdef __cplusplus } diff --git a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h index 06c5f386a8..caaea50c20 100644 --- a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h +++ b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h @@ -122,15 +122,6 @@ SUNDIALS_EXPORT int SUNNonlinSolGetNumConvFails_FixedPoint(SUNNonlinearSolver NL SUNDIALS_EXPORT int SUNNonlinSolGetSysFn_FixedPoint(SUNNonlinearSolver NLS, SUNNonlinSolSysFn *SysFn); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNNonlinSolSetInfoFile_FixedPoint(SUNNonlinearSolver NLS, - FILE* info_file); - -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -SUNDIALS_EXPORT int SUNNonlinSolSetPrintLevel_FixedPoint(SUNNonlinearSolver NLS, - int print_level); - - #ifdef __cplusplus } #endif diff --git a/include/sunnonlinsol/sunnonlinsol_newton.h b/include/sunnonlinsol/sunnonlinsol_newton.h index 9f6333cb5c..d6bbe89d4f 100644 --- a/include/sunnonlinsol/sunnonlinsol_newton.h +++ b/include/sunnonlinsol/sunnonlinsol_newton.h @@ -113,15 +113,6 @@ SUNDIALS_EXPORT int SUNNonlinSolGetNumConvFails_Newton(SUNNonlinearSolver NLS, SUNDIALS_EXPORT int SUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver NLS, SUNNonlinSolSysFn *SysFn); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNNonlinSolSetInfoFile_Newton(SUNNonlinearSolver NLS, - FILE* info_file); - -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -SUNDIALS_EXPORT int SUNNonlinSolSetPrintLevel_Newton(SUNNonlinearSolver NLS, - int print_level); - - #ifdef __cplusplus } #endif diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index 2e393ee383..6645333d90 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -135,54 +135,6 @@ int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, void *ih_data) return(KIN_SUCCESS); } - -/* - * ----------------------------------------------------------------- - * Function : KINSetInfoFile - * DEPRECATED: use SUNLogger_SetInfoFilename instead - * ----------------------------------------------------------------- - */ - -int KINSetInfoFile(void *kinmem, FILE *infofp) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetInfoFile", MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - kin_mem->kin_infofp = infofp; - - return(KIN_SUCCESS); -} - - -/* - * ----------------------------------------------------------------- - * Function : KINSetDebugFile - * DEPRECATED: use SUNLogger_SetDebugFilename instead - * ----------------------------------------------------------------- - */ - -int KINSetDebugFile(void *kinmem, FILE *debugfp) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetDebugFile", - MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - kin_mem->kin_debugfp = debugfp; - - return(KIN_SUCCESS); -} - - /* * ----------------------------------------------------------------- * Function : KINSetUserData From 269c00af278942c2e1f0f5c5df05bc04b871754c Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:41:00 -0700 Subject: [PATCH 06/85] realtype --> sunrealtype --- .../kokkos/ParallelGrid.hpp | 48 +- .../advection_reaction_3D/kokkos/README.md | 14 +- .../kokkos/advection_reaction_3D.cpp | 92 ++-- .../kokkos/advection_reaction_3D.hpp | 30 +- .../kokkos/arkode_driver.cpp | 14 +- .../kokkos/cvode_driver.cpp | 4 +- .../kokkos/ida_driver.cpp | 2 +- .../advection_reaction_3D/kokkos/rhs3D.hpp | 218 ++++----- .../advection_reaction_3D/raja/README.md | 14 +- .../raja/advection_reaction_3D.cpp | 116 ++--- .../raja/advection_reaction_3D.hpp | 32 +- .../raja/arkode_driver.cpp | 14 +- .../advection_reaction_3D/raja/backends.hpp | 2 +- .../raja/cvode_driver.cpp | 4 +- .../advection_reaction_3D/raja/ida_driver.cpp | 2 +- .../advection_reaction_3D/raja/rhs3D.hpp | 254 +++++----- benchmarks/diffusion_2D/README.md | 16 +- benchmarks/diffusion_2D/diffusion_2D.cpp | 26 +- benchmarks/diffusion_2D/diffusion_2D.hpp | 66 +-- benchmarks/diffusion_2D/main_arkode.cpp | 16 +- benchmarks/diffusion_2D/main_cvode.cpp | 14 +- benchmarks/diffusion_2D/main_ida.cpp | 14 +- benchmarks/diffusion_2D/mpi_gpu/buffers.cpp | 40 +- benchmarks/diffusion_2D/mpi_gpu/diffusion.cpp | 130 ++--- benchmarks/diffusion_2D/mpi_gpu/solution.cpp | 44 +- .../diffusion_2D/mpi_serial/buffers.cpp | 18 +- .../diffusion_2D/mpi_serial/diffusion.cpp | 34 +- .../diffusion_2D/mpi_serial/solution.cpp | 20 +- .../diffusion_2D/preconditioner_jacobi.cpp | 30 +- .../cuda/test_nvector_performance_cuda.cu | 32 +- .../hip/test_nvector_performance_hip.cpp | 32 +- .../test_nvector_performance_mpiplusx.c | 18 +- .../openmp/test_nvector_performance_openmp.c | 18 +- .../test_nvector_performance_openmpdev.c | 8 +- .../test_nvector_performance_parallel.c | 18 +- .../parhyp/test_nvector_performance_parhyp.c | 18 +- .../petsc/test_nvector_performance_petsc.c | 12 +- .../test_nvector_performance_pthreads.c | 18 +- .../raja/test_nvector_performance_raja.cpp | 2 +- .../serial/test_nvector_performance_serial.c | 18 +- .../sycl/test_nvector_performance_sycl.cpp | 2 +- benchmarks/nvector/test_nvector_performance.c | 160 +++--- benchmarks/nvector/test_nvector_performance.h | 10 +- cmake/SundialsBuildOptionsPre.cmake | 2 +- .../guide/source/ARKodeButcherTable.rst | 12 +- .../ARKStep_c_interface/Preconditioners.rst | 12 +- .../Usage/ARKStep_c_interface/Skeleton.rst | 2 +- .../ARKStep_c_interface/User_callable.rst | 92 ++-- .../Usage/ARKStep_c_interface/XBraid.rst | 8 +- .../Usage/ERKStep_c_interface/Skeleton.rst | 2 +- .../ERKStep_c_interface/User_callable.rst | 66 +-- doc/arkode/guide/source/Usage/General.rst | 2 +- .../Custom_Inner_Stepper/Description.rst | 10 +- .../MRIStep_c_interface/MRIStepCoupling.rst | 10 +- .../Usage/MRIStep_c_interface/Skeleton.rst | 2 +- .../MRIStep_c_interface/User_callable.rst | 60 +-- .../Usage/SPRKStep_c_interface/Skeleton.rst | 2 +- .../SPRKStep_c_interface/User_callable.rst | 22 +- .../guide/source/Usage/User_supplied.rst | 38 +- .../source/sunnonlinsol/ARKODE_interface.rst | 4 +- doc/cvode/cv_ex_serial.tex | 8 +- doc/cvode/guide/source/Usage/index.rst | 106 ++-- .../source/sunnonlinsol/CVODE_interface.rst | 4 +- doc/cvodes/cvs_ex_adj.tex | 2 +- doc/cvodes/cvs_ex_fwd.tex | 4 +- doc/cvodes/guide/source/Usage/ADJ.rst | 68 +-- doc/cvodes/guide/source/Usage/FSA.rst | 36 +- doc/cvodes/guide/source/Usage/SIM.rst | 116 ++--- .../source/sunnonlinsol/CVODES_interface.rst | 4 +- doc/ida/guide/source/Usage/index.rst | 86 ++-- .../source/sunnonlinsol/IDA_interface.rst | 4 +- doc/ida/ida_ex_serial.tex | 4 +- doc/idas/guide/source/Usage/ADJ.rst | 72 +-- doc/idas/guide/source/Usage/FSA.rst | 32 +- doc/idas/guide/source/Usage/SIM.rst | 98 ++-- .../source/sunnonlinsol/IDAS_interface.rst | 6 +- doc/kinsol/guide/source/Usage/index.rst | 36 +- doc/kinsol/kin_ex_c.tex | 6 +- doc/kinsol/kin_ex_fortran.tex | 2 +- doc/shared/Types.rst | 32 +- doc/shared/nvectors/NVector_CUDA.rst | 12 +- doc/shared/nvectors/NVector_Description.rst | 74 +-- doc/shared/nvectors/NVector_HIP.rst | 12 +- doc/shared/nvectors/NVector_MPIManyVector.rst | 4 +- doc/shared/nvectors/NVector_MPIPlusX.rst | 4 +- doc/shared/nvectors/NVector_ManyVector.rst | 4 +- doc/shared/nvectors/NVector_OpenMP.rst | 4 +- doc/shared/nvectors/NVector_OpenMPDEV.rst | 10 +- doc/shared/nvectors/NVector_Operations.rst | 100 ++-- doc/shared/nvectors/NVector_ParHyp.rst | 2 +- doc/shared/nvectors/NVector_Parallel.rst | 4 +- doc/shared/nvectors/NVector_Pthreads.rst | 4 +- doc/shared/nvectors/NVector_RAJA.rst | 12 +- doc/shared/nvectors/NVector_SYCL.rst | 12 +- doc/shared/nvectors/NVector_Serial.rst | 4 +- doc/shared/nvectors/NVector_Trilinos.rst | 4 +- doc/shared/sundials/Fortran.rst | 12 +- doc/shared/sunlinsol/SUNLinSol_API.rst | 12 +- doc/shared/sunlinsol/SUNLinSol_KLU.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_LapackBand.rst | 4 +- .../sunlinsol/SUNLinSol_LapackDense.rst | 4 +- doc/shared/sunlinsol/SUNLinSol_PCG.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst | 10 +- doc/shared/sunlinsol/SUNLinSol_SPGMR.rst | 10 +- doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst | 2 +- .../sunlinsol/SUNLinSol_SuperLUDIST.rst | 6 +- doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst | 4 +- doc/shared/sunmatrix/SUNMatrix_Band.rst | 14 +- doc/shared/sunmatrix/SUNMatrix_Dense.rst | 14 +- .../sunmatrix/SUNMatrix_Description.rst | 4 +- doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst | 14 +- .../sunmatrix/SUNMatrix_OneMklDense.rst | 14 +- doc/shared/sunmatrix/SUNMatrix_Operations.rst | 6 +- doc/shared/sunmatrix/SUNMatrix_Sparse.rst | 10 +- doc/shared/sunmatrix/SUNMatrix_cuSparse.rst | 12 +- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 8 +- .../sunnonlinsol/SUNNonlinSol_FixedPoint.rst | 10 +- .../source/benchmarks/advection_reaction.rst | 14 +- .../source/benchmarks/diffusion.rst | 16 +- .../source/testing/Local.rst | 2 +- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 226 ++++----- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 168 +++---- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 160 +++--- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 172 +++---- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 216 ++++----- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 192 ++++---- .../ark_advection_diffusion_reaction.cpp | 88 ++-- .../ark_advection_diffusion_reaction.hpp | 112 ++--- .../arkode/CXX_serial/ark_analytic_sys.cpp | 48 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 126 ++--- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 166 +++---- examples/arkode/CXX_serial/ark_pendulum.cpp | 2 +- .../ark_brusselator1D_FEM_sludist.cpp | 128 ++--- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 164 +++---- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 160 +++--- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 118 ++--- .../C_manyvector/ark_brusselator1D_manyvec.c | 86 ++-- .../arkode/C_openmp/ark_brusselator1D_omp.c | 88 ++-- examples/arkode/C_openmp/ark_heat1D_omp.c | 44 +- .../C_openmpdev/ark_analytic_nonlin_ompdev.c | 24 +- .../C_openmpdev/ark_heat1D_adapt_ompdev.c | 84 ++-- .../arkode/C_openmpdev/ark_heat1D_ompdev.c | 44 +- .../arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 72 +-- .../arkode/C_parallel/ark_diurnal_kry_p.c | 106 ++-- examples/arkode/C_parhyp/ark_diurnal_kry_ph.c | 108 ++--- .../arkode/C_serial/ark_KrylovDemo_prec.c | 124 ++--- examples/arkode/C_serial/ark_analytic.c | 42 +- examples/arkode/C_serial/ark_analytic_mels.c | 44 +- .../arkode/C_serial/ark_analytic_nonlin.c | 18 +- examples/arkode/C_serial/ark_brusselator.c | 50 +- examples/arkode/C_serial/ark_brusselator1D.c | 82 ++-- .../C_serial/ark_brusselator1D_FEM_slu.c | 120 ++--- .../C_serial/ark_brusselator1D_imexmri.c | 228 ++++----- .../arkode/C_serial/ark_brusselator1D_klu.c | 86 ++-- .../arkode/C_serial/ark_brusselator_1D_mri.c | 86 ++-- examples/arkode/C_serial/ark_brusselator_fp.c | 44 +- .../arkode/C_serial/ark_brusselator_mri.c | 46 +- examples/arkode/C_serial/ark_heat1D.c | 44 +- examples/arkode/C_serial/ark_heat1D_adapt.c | 72 +-- examples/arkode/C_serial/ark_kepler.h | 2 +- examples/arkode/C_serial/ark_kpr_mri.c | 172 +++---- .../arkode/C_serial/ark_onewaycouple_mri.c | 50 +- .../C_serial/ark_reaction_diffusion_mri.c | 50 +- examples/arkode/C_serial/ark_robertson.c | 50 +- .../C_serial/ark_robertson_constraints.c | 52 +- examples/arkode/C_serial/ark_robertson_root.c | 44 +- .../arkode/C_serial/ark_twowaycouple_mri.c | 32 +- .../arkode/F77_parallel/fark_diag_kry_bbd_p.f | 2 +- .../arkode/F77_serial/fark_diurnal_kry_bp.f | 2 +- .../arkode/F77_serial/fark_roberts_dnsL.f | 2 +- examples/arkode/F90_parallel/fark_heat2D.f90 | 72 +-- examples/arkode/F90_serial/ark_bruss.f90 | 28 +- .../arkode/F90_serial/ark_bruss1D_FEM_klu.f90 | 34 +- .../CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp | 76 +-- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 164 +++---- .../cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp | 156 +++--- .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 168 +++---- examples/cvode/CXX_serial/cv_heat2D.cpp | 8 +- examples/cvode/CXX_serial/cv_kpr.cpp | 60 +-- .../cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp | 82 ++-- .../cvDiurnal_kry_mpimanyvec.c | 94 ++-- examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c | 32 +- .../cvode/C_openmpdev/cvAdvDiff_kry_ompdev.c | 62 +-- examples/cvode/cuda/cvAdvDiff_diag_cuda.cu | 38 +- examples/cvode/cuda/cvAdvDiff_kry_cuda.cu | 70 +-- .../cvode/cuda/cvAdvDiff_kry_cuda_managed.cu | 70 +-- .../cvRoberts_block_cusolversp_batchqr.cu | 34 +- examples/cvode/fcmix_serial/fcvRoberts_dnsL.f | 2 +- examples/cvode/ginkgo/cv_kpr_ginkgo.cpp | 58 +-- examples/cvode/hip/cvAdvDiff_diag_hip.cpp | 38 +- examples/cvode/hip/cvAdvDiff_kry_hip.cpp | 70 +-- .../kokkos/cv_bruss_batched_kokkos_2D.cpp | 4 +- examples/cvode/parallel/cvAdvDiff_diag_p.c | 30 +- examples/cvode/parallel/cvAdvDiff_non_p.c | 30 +- examples/cvode/parallel/cvDiurnal_kry_bbd_p.c | 74 +-- examples/cvode/parallel/cvDiurnal_kry_p.c | 106 ++-- examples/cvode/parhyp/cvAdvDiff_non_ph.c | 32 +- examples/cvode/petsc/cvAdvDiff_petsc.c | 28 +- examples/cvode/raja/cvAdvDiff_kry_raja.cpp | 74 +-- examples/cvode/serial/cvAdvDiff_bnd.c | 32 +- examples/cvode/serial/cvAdvDiff_bndL.c | 32 +- examples/cvode/serial/cvAnalytic_mels.c | 44 +- examples/cvode/serial/cvDirectDemo_ls.c | 56 +-- examples/cvode/serial/cvDisc_dns.c | 8 +- examples/cvode/serial/cvDiurnal_kry.c | 82 ++-- examples/cvode/serial/cvDiurnal_kry_bp.c | 36 +- examples/cvode/serial/cvHeat2D_klu.c | 54 +-- examples/cvode/serial/cvKrylovDemo_ls.c | 70 +-- examples/cvode/serial/cvKrylovDemo_prec.c | 120 ++--- examples/cvode/serial/cvParticle_dns.c | 70 +-- examples/cvode/serial/cvPendulum_dns.c | 100 ++-- examples/cvode/serial/cvRoberts_block_klu.c | 24 +- examples/cvode/serial/cvRoberts_dns.c | 32 +- examples/cvode/serial/cvRoberts_dnsL.c | 24 +- .../cvode/serial/cvRoberts_dns_constraints.c | 30 +- examples/cvode/serial/cvRoberts_dns_negsol.c | 14 +- examples/cvode/serial/cvRoberts_dns_uw.c | 26 +- examples/cvode/serial/cvRoberts_klu.c | 26 +- examples/cvode/serial/cvRoberts_sps.c | 26 +- .../cvode/superludist/cvAdvDiff_sludist.cpp | 42 +- examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c | 32 +- .../cvodes/parallel/cvsAdvDiff_ASAp_non_p.c | 76 +-- .../cvodes/parallel/cvsAdvDiff_FSA_non_p.c | 42 +- examples/cvodes/parallel/cvsAdvDiff_non_p.c | 30 +- .../parallel/cvsAtmDisp_ASAi_kry_bbd_p.c | 88 ++-- .../cvodes/parallel/cvsDiurnal_FSA_kry_p.c | 120 ++--- .../cvodes/parallel/cvsDiurnal_kry_bbd_p.c | 74 +-- examples/cvodes/parallel/cvsDiurnal_kry_p.c | 110 ++--- examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c | 46 +- examples/cvodes/serial/cvsAdvDiff_FSA_non.c | 38 +- examples/cvodes/serial/cvsAdvDiff_bnd.c | 32 +- examples/cvodes/serial/cvsAdvDiff_bndL.c | 32 +- examples/cvodes/serial/cvsAnalytic_mels.c | 44 +- examples/cvodes/serial/cvsDirectDemo_ls.c | 56 +-- examples/cvodes/serial/cvsDiurnal_FSA_kry.c | 82 ++-- examples/cvodes/serial/cvsDiurnal_kry.c | 82 ++-- examples/cvodes/serial/cvsDiurnal_kry_bp.c | 36 +- examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c | 162 +++---- examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c | 164 +++---- examples/cvodes/serial/cvsHessian_ASA_FSA.c | 112 ++--- examples/cvodes/serial/cvsKrylovDemo_ls.c | 68 +-- examples/cvodes/serial/cvsKrylovDemo_prec.c | 120 ++--- examples/cvodes/serial/cvsParticle_dns.c | 70 +-- examples/cvodes/serial/cvsPendulum_dns.c | 100 ++-- examples/cvodes/serial/cvsRoberts_ASAi_dns.c | 74 +-- .../serial/cvsRoberts_ASAi_dns_constraints.c | 74 +-- examples/cvodes/serial/cvsRoberts_ASAi_klu.c | 78 +-- examples/cvodes/serial/cvsRoberts_ASAi_sps.c | 78 +-- examples/cvodes/serial/cvsRoberts_FSA_dns.c | 44 +- .../cvodes/serial/cvsRoberts_FSA_dns_Switch.c | 40 +- .../serial/cvsRoberts_FSA_dns_constraints.c | 46 +- examples/cvodes/serial/cvsRoberts_FSA_klu.c | 52 +- examples/cvodes/serial/cvsRoberts_FSA_sps.c | 52 +- examples/cvodes/serial/cvsRoberts_dns.c | 32 +- examples/cvodes/serial/cvsRoberts_dnsL.c | 24 +- .../serial/cvsRoberts_dns_constraints.c | 30 +- examples/cvodes/serial/cvsRoberts_dns_uw.c | 26 +- examples/cvodes/serial/cvsRoberts_klu.c | 26 +- examples/cvodes/serial/cvsRoberts_sps.c | 26 +- examples/ida/C_openmp/idaFoodWeb_bnd_omp.c | 50 +- examples/ida/C_openmp/idaFoodWeb_kry_omp.c | 78 +-- examples/ida/cuda/idaHeat2D_kry_cuda.cu | 64 +-- .../ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu | 206 ++++---- .../ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp | 178 +++---- examples/ida/parallel/idaFoodWeb_kry_bbd_p.c | 74 +-- examples/ida/parallel/idaFoodWeb_kry_p.c | 98 ++-- examples/ida/parallel/idaHeat2D_kry_bbd_p.c | 60 +-- examples/ida/parallel/idaHeat2D_kry_p.c | 124 ++--- examples/ida/petsc/idaHeat2D_petsc_snes.c | 16 +- examples/ida/petsc/idaHeat2D_petsc_spgmr.c | 32 +- examples/ida/raja/idaHeat2D_kry_raja.cpp | 56 +-- examples/ida/serial/idaAnalytic_mels.c | 64 +-- examples/ida/serial/idaFoodWeb_bnd.c | 52 +- examples/ida/serial/idaFoodWeb_kry.c | 80 +-- examples/ida/serial/idaHeat2D_bnd.c | 26 +- examples/ida/serial/idaHeat2D_klu.c | 46 +- examples/ida/serial/idaHeat2D_kry.c | 44 +- examples/ida/serial/idaHeat2D_sps.c | 46 +- examples/ida/serial/idaKrylovDemo_ls.c | 48 +- examples/ida/serial/idaRoberts_dns.c | 46 +- examples/ida/serial/idaRoberts_klu.c | 50 +- examples/ida/serial/idaRoberts_sps.c | 42 +- examples/ida/serial/idaSlCrank_dns.c | 68 +-- .../ida/trilinos/idaHeat2D_kry_p_tpetra.cpp | 116 ++--- .../ida/trilinos/idaHeat2D_kry_tpetra.cpp | 48 +- examples/idas/C_openmp/idasFoodWeb_bnd_omp.c | 50 +- examples/idas/C_openmp/idasFoodWeb_kry_omp.c | 78 +-- .../idas/parallel/idasBruss_ASAp_kry_bbd_p.c | 96 ++-- .../idas/parallel/idasBruss_FSA_kry_bbd_p.c | 88 ++-- examples/idas/parallel/idasBruss_kry_bbd_p.c | 78 +-- .../idas/parallel/idasFoodWeb_kry_bbd_p.c | 74 +-- examples/idas/parallel/idasFoodWeb_kry_p.c | 98 ++-- .../idas/parallel/idasHeat2D_FSA_kry_bbd_p.c | 68 +-- examples/idas/parallel/idasHeat2D_kry_bbd_p.c | 60 +-- examples/idas/parallel/idasHeat2D_kry_p.c | 74 +-- examples/idas/serial/idasAkzoNob_ASAi_dns.c | 56 +-- examples/idas/serial/idasAkzoNob_dns.c | 48 +- examples/idas/serial/idasAnalytic_mels.c | 64 +-- examples/idas/serial/idasFoodWeb_bnd.c | 52 +- examples/idas/serial/idasHeat2D_bnd.c | 26 +- examples/idas/serial/idasHeat2D_kry.c | 44 +- examples/idas/serial/idasHessian_ASA_FSA.c | 102 ++-- examples/idas/serial/idasKrylovDemo_ls.c | 48 +- examples/idas/serial/idasRoberts_ASAi_dns.c | 68 +-- examples/idas/serial/idasRoberts_ASAi_klu.c | 72 +-- examples/idas/serial/idasRoberts_ASAi_sps.c | 72 +-- examples/idas/serial/idasRoberts_FSA_dns.c | 50 +- examples/idas/serial/idasRoberts_FSA_klu.c | 60 +-- examples/idas/serial/idasRoberts_FSA_sps.c | 60 +-- examples/idas/serial/idasRoberts_dns.c | 46 +- examples/idas/serial/idasRoberts_klu.c | 50 +- examples/idas/serial/idasRoberts_sps.c | 42 +- examples/idas/serial/idasSlCrank_FSA_dns.c | 80 +-- examples/idas/serial/idasSlCrank_dns.c | 76 +-- examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu | 54 +-- examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp | 10 +- examples/kinsol/CXX_parallel/kin_em_p.cpp | 46 +- examples/kinsol/CXX_parallel/kin_em_p.hpp | 10 +- .../CXX_parallel/kin_heat2D_nonlin_p.cpp | 76 +-- .../CXX_parallel/kin_heat2D_nonlin_p.hpp | 108 ++--- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 26 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp | 18 +- .../kin_heat2D_nonlin_hypre_pfmg.cpp | 64 +-- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 114 ++--- examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c | 54 +-- .../kinsol/parallel/kinFoodWeb_kry_bbd_p.c | 76 +-- examples/kinsol/parallel/kinFoodWeb_kry_p.c | 92 ++-- examples/kinsol/serial/kinAnalytic_fp.c | 22 +- examples/kinsol/serial/kinFerTron_dns.c | 30 +- examples/kinsol/serial/kinFerTron_klu.c | 34 +- examples/kinsol/serial/kinFoodWeb_kry.c | 54 +-- examples/kinsol/serial/kinKrylovDemo_ls.c | 54 +-- examples/kinsol/serial/kinLaplace_bnd.c | 16 +- .../kinsol/serial/kinLaplace_picard_bnd.c | 22 +- .../kinsol/serial/kinLaplace_picard_kry.c | 24 +- examples/kinsol/serial/kinRoberts_fp.c | 16 +- examples/kinsol/serial/kinRoboKin_dns.c | 22 +- examples/kinsol/serial/kinRoboKin_slu.c | 24 +- .../nvector/C_openmp/test_nvector_openmp.c | 12 +- examples/nvector/cuda/test_nvector_cuda.cu | 24 +- examples/nvector/hip/test_nvector_hip.cpp | 24 +- .../nvector/kokkos/test_nvector_kokkos.cpp | 8 +- .../manyvector/test_nvector_manyvector.c | 10 +- .../nvector/mpicuda/test_nvector_mpicuda.cu | 12 +- .../test_nvector_mpimanyvector_parallel1.c | 10 +- .../test_nvector_mpimanyvector_parallel2.c | 10 +- .../nvector/mpiplusx/test_nvector_mpiplusx.c | 16 +- .../nvector/mpiraja/test_nvector_mpiraja.cpp | 12 +- .../openmpdev/test_nvector_openmpdev.c | 18 +- examples/nvector/parallel/test_nvector_mpi.c | 12 +- examples/nvector/parhyp/test_nvector_parhyp.c | 14 +- examples/nvector/petsc/test_nvector_petsc.c | 10 +- .../nvector/pthreads/test_nvector_pthreads.c | 12 +- examples/nvector/raja/test_nvector_raja.cpp | 24 +- examples/nvector/serial/test_nvector_serial.c | 12 +- examples/nvector/sycl/test_nvector_sycl.cpp | 24 +- examples/nvector/test_nvector.c | 128 ++--- examples/nvector/test_nvector.h | 8 +- .../trilinos/test_nvector_trilinos.cpp | 8 +- examples/sunlinsol/band/test_sunlinsol_band.c | 10 +- .../test_sunlinsol_cusolversp_batchqr.cu | 10 +- .../sunlinsol/dense/test_sunlinsol_dense.c | 10 +- examples/sunlinsol/klu/test_sunlinsol_klu.c | 10 +- .../kokkos/test_sunlinsol_kokkosdense.cpp | 2 +- .../lapackband/test_sunlinsol_lapackband.c | 10 +- .../lapackdense/test_sunlinsol_lapackdense.c | 10 +- .../magmadense/test_sunlinsol_magmadense.cpp | 14 +- .../test_sunlinsol_onemkldense.cpp | 18 +- .../parallel/test_sunlinsol_pcg_parallel.c | 20 +- .../pcg/serial/test_sunlinsol_pcg_serial.c | 20 +- .../parallel/test_sunlinsol_spbcgs_parallel.c | 20 +- .../serial/test_sunlinsol_spbcgs_serial.c | 20 +- .../parallel/test_sunlinsol_spfgmr_parallel.c | 20 +- .../serial/test_sunlinsol_spfgmr_serial.c | 20 +- .../parallel/test_sunlinsol_spgmr_parallel.c | 20 +- .../serial/test_sunlinsol_spgmr_serial.c | 20 +- .../test_sunlinsol_sptfqmr_parallel.c | 20 +- .../serial/test_sunlinsol_sptfqmr_serial.c | 20 +- .../test_sunlinsol_superludist.cpp | 22 +- .../superlumt/test_sunlinsol_superlumt.c | 10 +- examples/sunlinsol/test_sunlinsol.c | 2 +- examples/sunlinsol/test_sunlinsol.h | 4 +- examples/sunmatrix/band/test_sunmatrix_band.c | 16 +- .../cusparse/test_sunmatrix_cusparse.cu | 28 +- .../sunmatrix/dense/test_sunmatrix_dense.c | 18 +- examples/sunmatrix/dreadrb.c | 14 +- .../ginkgo/test_sunmatrix_ginkgo.cpp | 14 +- .../magmadense/test_sunmatrix_magmadense.cpp | 24 +- .../test_sunmatrix_onemkldense.cpp | 26 +- .../slunrloc/test_sunmatrix_slunrloc.cpp | 42 +- .../sunmatrix/sparse/test_sunmatrix_sparse.c | 32 +- examples/sunmatrix/test_sunmatrix.c | 12 +- examples/sunmatrix/test_sunmatrix.h | 6 +- .../fixedpoint/test_sunnonlinsol_fixedpoint.c | 28 +- .../newton/test_sunnonlinsol_newton.c | 14 +- .../petsc/test_sunnonlinsol_petscsnes.c | 12 +- include/arkode/arkode.h | 26 +- include/arkode/arkode_arkstep.h | 92 ++-- include/arkode/arkode_bbdpre.h | 8 +- include/arkode/arkode_butcher.h | 16 +- include/arkode/arkode_erkstep.h | 66 +-- include/arkode/arkode_ls.h | 32 +- include/arkode/arkode_mristep.h | 76 +-- include/arkode/arkode_sprkstep.h | 26 +- include/arkode/arkode_xbraid.h | 10 +- include/cvode/cvode.h | 72 +-- include/cvode/cvode_bbdpre.h | 8 +- include/cvode/cvode_hypamgpre.h | 12 +- include/cvode/cvode_ls.h | 26 +- include/cvode/cvode_proj.h | 8 +- include/cvodes/cvodes.h | 182 +++---- include/cvodes/cvodes_bbdpre.h | 16 +- include/cvodes/cvodes_ls.h | 68 +-- include/cvodes/cvodes_proj.h | 8 +- include/ida/ida.h | 72 +-- include/ida/ida_bbdpre.h | 8 +- include/ida/ida_ls.h | 24 +- include/idas/idas.h | 176 +++---- include/idas/idas_bbdpre.h | 16 +- include/idas/idas_ls.h | 66 +-- include/kinsol/kinsol.h | 28 +- include/kinsol/kinsol_bbdpre.h | 2 +- include/nvector/nvector_cuda.h | 70 +-- include/nvector/nvector_hip.h | 70 +-- include/nvector/nvector_manyvector.h | 58 +-- include/nvector/nvector_mpimanyvector.h | 70 +-- include/nvector/nvector_mpiplusx.h | 4 +- include/nvector/nvector_openmp.h | 62 +-- include/nvector/nvector_openmpdev.h | 66 +-- include/nvector/nvector_parallel.h | 76 +-- include/nvector/nvector_parhyp.h | 72 +-- include/nvector/nvector_petsc.h | 72 +-- include/nvector/nvector_pthreads.h | 72 +-- include/nvector/nvector_raja.h | 68 +-- include/nvector/nvector_serial.h | 62 +-- include/nvector/nvector_sycl.h | 70 +-- include/nvector/nvector_trilinos.h | 42 +- .../SundialsTpetraVectorInterface.hpp | 2 +- include/sundials/sundials_band.h | 26 +- include/sundials/sundials_config.in | 2 +- include/sundials/sundials_dense.h | 48 +- include/sundials/sundials_direct.h | 26 +- include/sundials/sundials_iterative.h | 48 +- include/sundials/sundials_linearsolver.h | 8 +- include/sundials/sundials_math.h | 4 +- include/sundials/sundials_matrix.h | 8 +- include/sundials/sundials_nonlinearsolver.h | 6 +- include/sundials/sundials_nvector.h | 140 +++--- .../sundials/sundials_nvector_senswrapper.h | 28 +- include/sundials/sundials_types.h | 5 +- include/sunlinsol/sunlinsol_band.h | 2 +- .../sunlinsol/sunlinsol_cusolversp_batchqr.h | 2 +- include/sunlinsol/sunlinsol_dense.h | 4 +- include/sunlinsol/sunlinsol_klu.h | 4 +- include/sunlinsol/sunlinsol_lapackband.h | 2 +- include/sunlinsol/sunlinsol_lapackdense.h | 2 +- include/sunlinsol/sunlinsol_magmadense.h | 2 +- include/sunlinsol/sunlinsol_onemkldense.h | 2 +- include/sunlinsol/sunlinsol_pcg.h | 6 +- include/sunlinsol/sunlinsol_spbcgs.h | 6 +- include/sunlinsol/sunlinsol_spfgmr.h | 14 +- include/sunlinsol/sunlinsol_spgmr.h | 14 +- include/sunlinsol/sunlinsol_sptfqmr.h | 6 +- include/sunlinsol/sunlinsol_superludist.h | 6 +- include/sunlinsol/sunlinsol_superlumt.h | 8 +- include/sunmatrix/sunmatrix_band.h | 16 +- include/sunmatrix/sunmatrix_cusparse.h | 14 +- include/sunmatrix/sunmatrix_dense.h | 16 +- include/sunmatrix/sunmatrix_magmadense.h | 24 +- include/sunmatrix/sunmatrix_onemkldense.h | 24 +- include/sunmatrix/sunmatrix_slunrloc.h | 4 +- include/sunmatrix/sunmatrix_sparse.h | 14 +- .../sunnonlinsol/sunnonlinsol_fixedpoint.h | 12 +- include/sunnonlinsol/sunnonlinsol_newton.h | 2 +- include/sunnonlinsol/sunnonlinsol_petscsnes.h | 2 +- src/arkode/arkode.c | 78 +-- src/arkode/arkode_adapt.c | 36 +- src/arkode/arkode_adapt_impl.h | 48 +- src/arkode/arkode_arkstep.c | 84 ++-- src/arkode/arkode_arkstep_impl.h | 52 +- src/arkode/arkode_arkstep_io.c | 78 +-- src/arkode/arkode_arkstep_nls.c | 12 +- src/arkode/arkode_bandpre.c | 26 +- src/arkode/arkode_bbdpre.c | 30 +- src/arkode/arkode_bbdpre_impl.h | 2 +- src/arkode/arkode_butcher.c | 410 ++++++++-------- src/arkode/arkode_erkstep.c | 40 +- src/arkode/arkode_erkstep_impl.h | 8 +- src/arkode/arkode_erkstep_io.c | 42 +- src/arkode/arkode_impl.h | 168 +++---- src/arkode/arkode_interp.c | 52 +- src/arkode/arkode_interp_impl.h | 30 +- src/arkode/arkode_io.c | 48 +- src/arkode/arkode_ls.c | 64 +-- src/arkode/arkode_ls_impl.h | 42 +- src/arkode/arkode_mri_tables.c | 30 +- src/arkode/arkode_mri_tables.def | 6 +- src/arkode/arkode_mristep.c | 78 +-- src/arkode/arkode_mristep_impl.h | 56 +-- src/arkode/arkode_mristep_io.c | 40 +- src/arkode/arkode_mristep_nls.c | 10 +- src/arkode/arkode_relaxation.c | 2 +- src/arkode/arkode_root.c | 12 +- src/arkode/arkode_root_impl.h | 16 +- src/arkode/arkode_sprkstep.c | 18 +- src/arkode/arkode_sprkstep_io.c | 14 +- src/arkode/fmod/farkode_arkstep_mod.c | 190 ++++---- src/arkode/fmod/farkode_erkstep_mod.c | 138 +++--- src/arkode/fmod/farkode_mod.c | 56 +-- src/arkode/fmod/farkode_mristep_mod.c | 144 +++--- src/arkode/fmod/farkode_sprkstep_mod.c | 60 +-- src/arkode/xbraid/arkode_xbraid.c | 18 +- src/arkode/xbraid/arkode_xbraid_impl.h | 2 +- src/cvode/cvode.c | 154 +++--- src/cvode/cvode_bandpre.c | 28 +- src/cvode/cvode_bbdpre.c | 30 +- src/cvode/cvode_bbdpre_impl.h | 2 +- src/cvode/cvode_diag.c | 16 +- src/cvode/cvode_diag_impl.h | 2 +- src/cvode/cvode_fused_gpu.cpp | 128 ++--- src/cvode/cvode_fused_stubs.c | 22 +- src/cvode/cvode_hypamgpre.c | 22 +- src/cvode/cvode_hypamgpre_impl.h | 2 +- src/cvode/cvode_impl.h | 116 ++--- src/cvode/cvode_io.c | 66 +-- src/cvode/cvode_ls.c | 44 +- src/cvode/cvode_ls_impl.h | 16 +- src/cvode/cvode_nls.c | 18 +- src/cvode/cvode_proj.c | 6 +- src/cvode/cvode_proj_impl.h | 4 +- src/cvode/fmod/fcvode_mod.c | 172 +++---- src/cvodes/cvodea.c | 60 +-- src/cvodes/cvodea_io.c | 10 +- src/cvodes/cvodes.c | 294 ++++++------ src/cvodes/cvodes_bandpre.c | 28 +- src/cvodes/cvodes_bbdpre.c | 42 +- src/cvodes/cvodes_bbdpre_impl.h | 2 +- src/cvodes/cvodes_diag.c | 4 +- src/cvodes/cvodes_diag_impl.h | 2 +- src/cvodes/cvodes_impl.h | 198 ++++---- src/cvodes/cvodes_io.c | 70 +-- src/cvodes/cvodes_ls.c | 120 ++--- src/cvodes/cvodes_ls_impl.h | 16 +- src/cvodes/cvodes_nls.c | 14 +- src/cvodes/cvodes_nls_sim.c | 14 +- src/cvodes/cvodes_nls_stg.c | 10 +- src/cvodes/cvodes_nls_stg1.c | 8 +- src/cvodes/cvodes_proj.c | 6 +- src/cvodes/cvodes_proj_impl.h | 4 +- src/cvodes/fmod/fcvodes_mod.c | 390 +++++++-------- src/ida/fmod/fida_mod.c | 164 +++---- src/ida/ida.c | 102 ++-- src/ida/ida_bbdpre.c | 32 +- src/ida/ida_bbdpre_impl.h | 2 +- src/ida/ida_ic.c | 22 +- src/ida/ida_impl.h | 106 ++-- src/ida/ida_io.c | 64 +-- src/ida/ida_ls.c | 38 +- src/ida/ida_ls_impl.h | 18 +- src/ida/ida_nls.c | 12 +- src/idas/fmod/fidas_mod.c | 394 +++++++-------- src/idas/idaa.c | 68 +-- src/idas/idaa_io.c | 8 +- src/idas/idas.c | 276 +++++------ src/idas/idas_bbdpre.c | 44 +- src/idas/idas_bbdpre_impl.h | 2 +- src/idas/idas_ic.c | 44 +- src/idas/idas_impl.h | 186 +++---- src/idas/idas_io.c | 68 +-- src/idas/idas_ls.c | 120 ++--- src/idas/idas_ls_impl.h | 18 +- src/idas/idas_nls.c | 12 +- src/idas/idas_nls_sim.c | 12 +- src/idas/idas_nls_stg.c | 8 +- src/kinsol/fmod/fkinsol_mod.c | 60 +-- src/kinsol/kinsol.c | 70 +-- src/kinsol/kinsol_bbdpre.c | 10 +- src/kinsol/kinsol_bbdpre_impl.h | 2 +- src/kinsol/kinsol_impl.h | 62 +-- src/kinsol/kinsol_io.c | 44 +- src/kinsol/kinsol_ls.c | 16 +- src/kinsol/kinsol_ls_impl.h | 6 +- src/nvector/cuda/nvector_cuda.cu | 234 ++++----- src/nvector/hip/nvector_hip.hip.cpp | 350 +++++++------- .../manyvector/fmod/fnvector_manyvector_mod.c | 132 ++--- .../fmod/fnvector_mpimanyvector_mod.c | 166 +++---- src/nvector/manyvector/nvector_manyvector.c | 114 ++--- .../mpiplusx/fmod/fnvector_mpiplusx_mod.c | 8 +- src/nvector/mpiplusx/nvector_mpiplusx.c | 4 +- src/nvector/openmp/fmod/fnvector_openmp_mod.c | 132 ++--- src/nvector/openmp/nvector_openmp.c | 288 +++++------ src/nvector/openmpdev/nvector_openmpdev.c | 454 +++++++++--------- .../parallel/fmod/fnvector_parallel_mod.c | 170 +++---- src/nvector/parallel/nvector_parallel.c | 316 ++++++------ src/nvector/parhyp/nvector_parhyp.c | 222 ++++----- src/nvector/petsc/nvector_petsc.c | 116 ++--- .../pthreads/fmod/fnvector_pthreads_mod.c | 132 ++--- src/nvector/pthreads/nvector_pthreads.c | 372 +++++++------- src/nvector/raja/nvector_raja.cpp | 260 +++++----- src/nvector/serial/fmod/fnvector_serial_mod.c | 132 ++--- src/nvector/serial/nvector_serial.c | 280 +++++------ src/nvector/sycl/nvector_sycl.cpp | 272 +++++------ src/nvector/trilinos/nvector_trilinos.cpp | 40 +- .../fmod/fsundials_linearsolver_mod.c | 114 ++--- src/sundials/fmod/fsundials_matrix_mod.c | 8 +- .../fmod/fsundials_nonlinearsolver_mod.c | 4 +- src/sundials/fmod/fsundials_nvector_mod.c | 170 +++---- src/sundials/sundials_band.c | 52 +- src/sundials/sundials_dense.c | 92 ++-- src/sundials/sundials_direct.c | 52 +- src/sundials/sundials_iterative.c | 46 +- src/sundials/sundials_iterative_impl.h | 6 +- src/sundials/sundials_linearsolver.c | 4 +- src/sundials/sundials_matrix.c | 4 +- src/sundials/sundials_nonlinearsolver.c | 2 +- src/sundials/sundials_nvector.c | 136 +++--- src/sundials/sundials_nvector_senswrapper.c | 42 +- src/sundials/sundials_profiler.c | 2 +- src/sunlinsol/band/fmod/fsunlinsol_band_mod.c | 4 +- src/sunlinsol/band/sunlinsol_band.c | 6 +- .../sunlinsol_cusolversp_batchqr.cu | 10 +- .../dense/fmod/fsunlinsol_dense_mod.c | 4 +- src/sunlinsol/dense/sunlinsol_dense.c | 6 +- src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c | 4 +- src/sunlinsol/klu/sunlinsol_klu.c | 6 +- .../lapackband/sunlinsol_lapackband.c | 8 +- .../lapackdense/sunlinsol_lapackdense.c | 8 +- .../magmadense/sunlinsol_magmadense.cpp | 14 +- .../onemkldense/sunlinsol_onemkldense.cpp | 32 +- src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c | 10 +- src/sunlinsol/pcg/sunlinsol_pcg.c | 8 +- .../spbcgs/fmod/fsunlinsol_spbcgs_mod.c | 10 +- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 10 +- .../spfgmr/fmod/fsunlinsol_spfgmr_mod.c | 10 +- src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 20 +- .../spgmr/fmod/fsunlinsol_spgmr_mod.c | 10 +- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 20 +- .../sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c | 10 +- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 16 +- .../superludist/sunlinsol_superludist.c | 6 +- src/sunlinsol/superlumt/sunlinsol_superlumt.c | 4 +- src/sunmatrix/band/fmod/fsunmatrix_band_mod.c | 20 +- src/sunmatrix/band/sunmatrix_band.c | 34 +- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 50 +- .../dense/fmod/fsunmatrix_dense_mod.c | 20 +- src/sunmatrix/dense/sunmatrix_dense.c | 18 +- .../magmadense/sunmatrix_magmadense.cpp | 82 ++-- .../onemkldense/sunmatrix_onemkldense.cpp | 58 +-- src/sunmatrix/slunrloc/sunmatrix_slunrloc.c | 8 +- .../sparse/fmod/fsunmatrix_sparse_mod.c | 20 +- src/sunmatrix/sparse/sunmatrix_sparse.c | 34 +- .../fmod/fsunnonlinsol_fixedpoint_mod.c | 8 +- .../fixedpoint/sunnonlinsol_fixedpoint.c | 12 +- .../newton/fmod/fsunnonlinsol_newton_mod.c | 4 +- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 2 +- .../petscsnes/sunnonlinsol_petscsnes.c | 2 +- swig/nvector/fnvector_manyvector_mod.i | 4 +- swig/nvector/fnvector_mpimanyvector_mod.i | 4 +- swig/nvector/fnvector_mpiplusx_mod.i | 4 +- swig/nvector/fnvector_openmp_mod.i | 4 +- swig/nvector/fnvector_parallel_mod.i | 4 +- swig/nvector/fnvector_pthreads_mod.i | 4 +- swig/nvector/fnvector_serial_mod.i | 4 +- swig/sundials/fsundials.i | 4 +- swig/sundials/fsundials_nvector_mod.i | 8 +- swig/sunmatrix/fsunmatrix_band_mod.i | 8 +- swig/sunmatrix/fsunmatrix_dense_mod.i | 8 +- swig/sunmatrix/fsunmatrix_sparse_mod.i | 4 +- test/test_driver.sh | 24 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 114 ++--- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 46 +- .../CXX_serial/ark_test_dahlquist_mri.cpp | 66 +-- .../C_serial/ark_test_arkstepsetforcing.c | 54 +-- .../arkode/C_serial/ark_test_getuserdata.c | 2 +- .../arkode/C_serial/ark_test_interp.c | 52 +- .../arkode/C_serial/ark_test_reset.c | 46 +- .../cvode/CXX_serial/cv_test_kpr.cpp | 56 +-- .../cvode/CXX_serial/cv_test_kpr.hpp | 44 +- .../cvode/C_serial/cv_test_getuserdata.c | 2 +- .../cvodes/CXX_serial/cvs_test_kpr.cpp | 56 +-- .../cvodes/CXX_serial/cvs_test_kpr.hpp | 44 +- .../cvodes/C_serial/cvs_test_getuserdata.c | 2 +- .../ida/CXX_serial/ida_test_getjac.cpp | 4 +- .../ida/CXX_serial/ida_test_kpr.cpp | 66 +-- .../ida/CXX_serial/ida_test_kpr.hpp | 38 +- .../ida/C_serial/ida_test_getuserdata.c | 2 +- .../idas/CXX_serial/idas_test_getjac.cpp | 4 +- .../idas/CXX_serial/idas_test_kpr.cpp | 66 +-- .../idas/CXX_serial/idas_test_kpr.hpp | 38 +- .../idas/C_serial/idas_test_getuserdata.c | 2 +- .../kinsol/CXX_serial/kin_test_getjac.cpp | 2 +- 692 files changed, 17131 insertions(+), 17132 deletions(-) diff --git a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp index c324105b02..6d35bed198 100644 --- a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp @@ -47,8 +47,8 @@ using MemSpace = Kokkos::HostSpace; using ExecSpace = Kokkos::Serial; using MemSpace = Kokkos::HostSpace; #endif -using Vec1D = Kokkos::View; -using Vec4D = Kokkos::View; +using Vec1D = Kokkos::View; +using Vec4D = Kokkos::View; using Vec1DHost = Vec1D::HostMirror; using Vec4DHost = Vec4D::HostMirror; using Range3D = Kokkos::MDRangePolicy>; @@ -84,8 +84,8 @@ class ParallelGrid // [in] st - the stencil to use (see StencilType) // [in] npxyz - the number of processors in each dimension; defaults to 0 which means MPI will choose // [in] reorder - should MPI_Cart_create do process reordering to optimize or not; defaults to false (some MPI implementations ignore this) - ParallelGrid(MPI_Comm* comm, const realtype a[], const realtype b[], const GLOBALINT npts[], - int dof, BoundaryType bc, StencilType st, const realtype c, + ParallelGrid(MPI_Comm* comm, const sunrealtype a[], const sunrealtype b[], const GLOBALINT npts[], + int dof, BoundaryType bc, StencilType st, const sunrealtype c, const int npxyz[] = nullptr, bool reorder = false) : nx(1), ny(1), nz(1), nxl(1), nyl(1), nzl(1), @@ -130,7 +130,7 @@ class ParallelGrid nx = npts[0]; ax = a[0]; bx = b[0]; - dx = (bx-ax) / (realtype) nx; + dx = (bx-ax) / (sunrealtype) nx; int is = nx*(coords[0])/npx; int ie = nx*(coords[0]+1)/npx-1; nxl = ie-is+1; @@ -141,7 +141,7 @@ class ParallelGrid ny = npts[1]; ay = a[1]; by = b[1]; - dy = (by-ay) / (realtype) ny; + dy = (by-ay) / (sunrealtype) ny; int js = ny*(coords[1])/npy; int je = ny*(coords[1]+1)/npy-1; nyl = je-js+1; @@ -152,7 +152,7 @@ class ParallelGrid nz = npts[2]; az = a[2]; bz = b[2]; - dz = (bz-az) / (realtype) nz; + dz = (bz-az) / (sunrealtype) nz; int ks = nz*(coords[2])/npz; int ke = nz*(coords[2]+1)/npz-1; nzl = ke-ks+1; @@ -469,31 +469,31 @@ class ParallelGrid return dof*nptsl(); } - realtype* GetRecvView(const std::string& direction) + sunrealtype* GetRecvView(const std::string& direction) { if (direction == "WEST") { - return static_cast(Wrecv_.data()); + return static_cast(Wrecv_.data()); } else if (direction == "EAST") { - return static_cast(Erecv_.data()); + return static_cast(Erecv_.data()); } else if (direction == "NORTH") { - return static_cast(Nrecv_.data()); + return static_cast(Nrecv_.data()); } else if (direction == "SOUTH") { - return static_cast(Srecv_.data()); + return static_cast(Srecv_.data()); } else if (direction == "FRONT") { - return static_cast(Frecv_.data()); + return static_cast(Frecv_.data()); } else if (direction == "BACK") { - return static_cast(Brecv_.data()); + return static_cast(Brecv_.data()); } else { @@ -502,31 +502,31 @@ class ParallelGrid } } - realtype* GetSendView(const std::string& direction) + sunrealtype* GetSendView(const std::string& direction) { if (direction == "WEST") { - return static_cast(Wsend_.data()); + return static_cast(Wsend_.data()); } else if (direction == "EAST") { - return static_cast(Esend_.data()); + return static_cast(Esend_.data()); } else if (direction == "NORTH") { - return static_cast(Nsend_.data()); + return static_cast(Nsend_.data()); } else if (direction == "SOUTH") { - return static_cast(Ssend_.data()); + return static_cast(Ssend_.data()); } else if (direction == "FRONT") { - return static_cast(Fsend_.data()); + return static_cast(Fsend_.data()); } else if (direction == "BACK") { - return static_cast(Bsend_.data()); + return static_cast(Bsend_.data()); } else { @@ -538,9 +538,9 @@ class ParallelGrid GLOBALINT nx, ny, nz; /* number of intervals globally */ int nxl, nyl, nzl; /* number of intervals locally */ int npx, npy, npz; /* numner of processes */ - realtype dx, dy, dz; /* mesh spacing */ - realtype ax, ay, az; /* domain in [a, b] */ - realtype bx, by, bz; + sunrealtype dx, dy, dz; /* mesh spacing */ + sunrealtype ax, ay, az; /* domain in [a, b] */ + sunrealtype bx, by, bz; int dof; /* degrees of freedom per node */ int neq; /* total number of equations locally */ diff --git a/benchmarks/advection_reaction_3D/kokkos/README.md b/benchmarks/advection_reaction_3D/kokkos/README.md index f27484385f..711b5ef201 100644 --- a/benchmarks/advection_reaction_3D/kokkos/README.md +++ b/benchmarks/advection_reaction_3D/kokkos/README.md @@ -60,19 +60,19 @@ listed below. | `--nout ` | Number of output times | 40 | | `--npts ` | Number of mesh points in each direction | 100 | | `--npxyz ` | Number of MPI tasks in each direction (0 forces MPI to decide) | 0 0 0 | -| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | -| `--A ` | Constant concentration of species `A` | 1.0 | -| `--B ` | Constant concentration of species `B` | 3.5 | -| `--c ` | Advection speed `c` | 0.01 | +| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | +| `--A ` | Constant concentration of species `A` | 1.0 | +| `--B ` | Constant concentration of species `B` | 3.5 | +| `--c ` | Advection speed `c` | 0.01 | | `--order ` | Integration method order | 3 | | `--method ` | Integrator to use: `ERK`, `ARK-DIRK`, `ARK-IMEX`, `CV-BDF`, `CV-ADAMS`, `IDA` | `ARK-DIRK` | | `--nls ` | Nonlinear Solver Method: `newton`, `tl-newton`, `fixedpoint`, `none` | `newton` | | `--fpaccel ` | Number of fixed point acceleration vectors | 3 | | `--nopre` | Disable preconditioning | False | | `--fused` | Enabled fused operations | Off | -| `--tf ` | Final integration time `t_f` | 10.0 | -| `--rtol ` | Relative tolerance | 1.0e-6 | -| `--atol ` | Absolute tolerance | 1.0e-9 | +| `--tf ` | Final integration time `t_f` | 10.0 | +| `--rtol ` | Relative tolerance | 1.0e-6 | +| `--atol ` | Absolute tolerance | 1.0e-9 | ## Building and Running diff --git a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp index fa9f2bcc94..6a47db5427 100644 --- a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp @@ -49,14 +49,14 @@ * --nopre turn off preconditioning * --order the method order to use * --npts number of mesh points in each direction - * --xmax maximum value of x (size of domain) - * --tf final time - * --A A parameter value - * --B B parameter value - * --k reaction rate - * --c advection speed - * --rtol relative tolerance - * --atol absolute tolerance + * --xmax maximum value of x (size of domain) + * --tf final time + * --A A parameter value + * --B B parameter value + * --k reaction rate + * --c advection speed + * --rtol relative tolerance + * --atol absolute tolerance * --------------------------------------------------------------------------*/ #include "advection_reaction_3D.hpp" @@ -167,7 +167,7 @@ int FillSendBuffers(N_Vector y, UserData* udata) { /* Shortcuts */ - const realtype c = udata->c; + const sunrealtype c = udata->c; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; @@ -468,8 +468,8 @@ int SetupProblem(int argc, char *argv[], UserData* udata, UserOptions* uopt, /* Setup the parallel decomposition */ const sunindextype npts[] = {uopt->npts, uopt->npts, uopt->npts}; - const realtype amax[] = {0.0, 0.0, 0.0}; - const realtype bmax[] = {udata->xmax, udata->xmax, udata->xmax}; + const sunrealtype amax[] = {0.0, 0.0, 0.0}; + const sunrealtype bmax[] = {udata->xmax, udata->xmax, udata->xmax}; udata->grid = new ParallelGrid(&udata->comm, amax, bmax, npts, 3, BoundaryType::PERIODIC, StencilType::UPWIND, udata->c, uopt->npxyz); @@ -551,15 +551,15 @@ int SetupProblem(int argc, char *argv[], UserData* udata, UserOptions* uopt, /* Compute the 3D Gaussian function. */ KOKKOS_FUNCTION -void Gaussian3D(realtype& x, realtype& y, realtype& z, realtype xmax) +void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax) { /* Gaussian distribution defaults */ - const realtype alpha = 0.1; - const realtype mu[] = { xmax/RCONST(2.0), xmax/RCONST(2.0), xmax/RCONST(2.0) }; - const realtype sigma[] = { xmax/RCONST(4.0), xmax/RCONST(4.0), xmax/RCONST(4.0) }; // Sigma = diag(sigma) + const sunrealtype alpha = 0.1; + const sunrealtype mu[] = { xmax/RCONST(2.0), xmax/RCONST(2.0), xmax/RCONST(2.0) }; + const sunrealtype sigma[] = { xmax/RCONST(4.0), xmax/RCONST(4.0), xmax/RCONST(4.0) }; // Sigma = diag(sigma) /* denominator = 2*sqrt(|Sigma|*(2pi)^3) */ - const realtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3)); + const sunrealtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3)); x = alpha * exp( -((x - mu[0])*(x - mu[0])*(1.0/sigma[0])) / denom ); y = alpha * exp( -((y - mu[1])*(y - mu[1])*(1.0/sigma[1])) / denom ); z = alpha * exp( -((z - mu[2])*(z - mu[2])*(1.0/sigma[2])) / denom ); @@ -576,24 +576,24 @@ int SetIC(N_Vector y, UserData* udata) const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; const int dof = udata->grid->dof; - const realtype dx = udata->grid->dx; - const realtype dy = udata->grid->dy; - const realtype dz = udata->grid->dz; - const realtype xmax = udata->xmax; - const realtype A = udata->A; - const realtype B = udata->B; - const realtype k1 = udata->k1; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; + const sunrealtype dx = udata->grid->dx; + const sunrealtype dy = udata->grid->dy; + const sunrealtype dz = udata->grid->dz; + const sunrealtype xmax = udata->xmax; + const sunrealtype A = udata->A; + const sunrealtype B = udata->B; + const sunrealtype k1 = udata->k1; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; const int xcrd = udata->grid->coords[0]; const int ycrd = udata->grid->coords[1]; const int zcrd = udata->grid->coords[2]; /* Steady state solution */ - const realtype us = k1 * A / k4; - const realtype vs = k2 * k4 * B / (k1 * k3 * A); - const realtype ws = 3.0; + const sunrealtype us = k1 * A / k4; + const sunrealtype vs = k2 * k4 * B / (k1 * k3 * A); + const sunrealtype ws = 3.0; /* Create 4D view of y */ Vec4D yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(y)), nxl, nyl, nzl, dof); @@ -603,11 +603,11 @@ int SetIC(N_Vector y, UserData* udata) Range3D({0,0,0},{nxl,nyl,nzl}), KOKKOS_LAMBDA (int i, int j, int k) { - realtype x = (xcrd * nxl + i) * dx; - realtype y = (ycrd * nyl + j) * dy; - realtype z = (zcrd * nzl + k) * dz; + sunrealtype x = (xcrd * nxl + i) * dx; + sunrealtype y = (ycrd * nyl + j) * dy; + sunrealtype z = (zcrd * nzl + k) * dz; Gaussian3D(x,y,z,xmax); - const realtype p = x + y + z; + const sunrealtype p = x + y + z; yview(i,j,k,0) = us + p; yview(i,j,k,1) = vs + p; yview(i,j,k,2) = ws + p; @@ -619,17 +619,17 @@ int SetIC(N_Vector y, UserData* udata) /* Write time and solution to disk */ -int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt) +int WriteOutput(sunrealtype t, N_Vector y, UserData* udata, UserOptions* uopt) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); /* output current solution norm to screen */ - realtype N = (realtype) udata->grid->npts(); - realtype u = N_VWL2Norm(y, udata->umask); + sunrealtype N = (sunrealtype) udata->grid->npts(); + sunrealtype u = N_VWL2Norm(y, udata->umask); u = sqrt(u*u/N); - realtype v = N_VWL2Norm(y, udata->vmask); + sunrealtype v = N_VWL2Norm(y, udata->vmask); v = sqrt(v*v/N); - realtype w = N_VWL2Norm(y, udata->wmask); + sunrealtype w = N_VWL2Norm(y, udata->wmask); w = sqrt(w*w/N); if (udata->myid == 0) { printf(" %10.6f %10.6f %10.6f %10.6f\n", t, u, v, w); @@ -697,14 +697,14 @@ void InputError(char *name) fprintf(stderr, " --order the method order to use\n"); fprintf(stderr, " --npts number of mesh points in each direction\n"); fprintf(stderr, " --npxyz number of processors in each direction (0 forces MPI to decide)\n"); - fprintf(stderr, " --xmax maximum value of x (size of domain)\n"); - fprintf(stderr, " --tf final time\n"); - fprintf(stderr, " --A A parameter value\n"); - fprintf(stderr, " --B B parameter value\n"); - fprintf(stderr, " --k reaction rate\n"); - fprintf(stderr, " --c advection speed\n"); - fprintf(stderr, " --rtol relative tolerance\n"); - fprintf(stderr, " --atol absolute tolerance\n"); + fprintf(stderr, " --xmax maximum value of x (size of domain)\n"); + fprintf(stderr, " --tf final time\n"); + fprintf(stderr, " --A A parameter value\n"); + fprintf(stderr, " --B B parameter value\n"); + fprintf(stderr, " --k reaction rate\n"); + fprintf(stderr, " --c advection speed\n"); + fprintf(stderr, " --rtol relative tolerance\n"); + fprintf(stderr, " --atol absolute tolerance\n"); } MPI_Barrier(MPI_COMM_WORLD); diff --git a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp index cb0dceea64..3c6764990f 100644 --- a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp @@ -47,10 +47,10 @@ struct UserOptions { int npxyz[3]; /* number of processors in x,y,z */ sunindextype npts; /* number of spatial mesh points */ - realtype t0; /* initial time */ - realtype tf; /* final time */ - realtype rtol; /* relative tolerance */ - realtype atol; /* absolute tolerance */ + sunrealtype t0; /* initial time */ + sunrealtype tf; /* final time */ + sunrealtype rtol; /* relative tolerance */ + sunrealtype atol; /* absolute tolerance */ int order; /* method order */ string method; /* method string */ string nls; /* nonlinear solver to use */ @@ -93,16 +93,16 @@ struct UserData N_Vector wmask; /* Problem parameters */ - realtype xmax; /* maximum x value */ - realtype A; /* concentration of species A */ - realtype B; /* w source rate */ - realtype k1; /* reaction rates */ - realtype k2; - realtype k3; - realtype k4; - realtype k5; - realtype k6; - realtype c; /* advection coefficient */ + sunrealtype xmax; /* maximum x value */ + sunrealtype A; /* concentration of species A */ + sunrealtype B; /* w source rate */ + sunrealtype k1; /* reaction rates */ + sunrealtype k2; + sunrealtype k3; + sunrealtype k4; + sunrealtype k5; + sunrealtype k6; + sunrealtype c; /* advection coefficient */ /* Parallel mesh */ ParallelGrid* grid; @@ -166,6 +166,6 @@ void InputError(char *name); int ComponentMask(N_Vector mask, const int component, const UserData* udata); /* function to write solution to disk */ -int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt); +int WriteOutput(sunrealtype t, N_Vector y, UserData* udata, UserOptions* uopt); #endif diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index e2cf1451e3..d243f9e021 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -52,7 +52,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ SUNLinearSolver LS = NULL; /* empty linear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ @@ -227,7 +227,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ SUNLinearSolver LS = NULL; /* empty linear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ @@ -410,7 +410,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) { void* arkode_mem = NULL; /* empty ARKODE memory structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ @@ -529,12 +529,12 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) /* temporary variables */ UserData* udata; int retval; - realtype c[3]; + sunrealtype c[3]; N_Vector X[3]; /* nonlinear system data */ N_Vector z, zpred, Fi, sdata; - realtype tcur, gamma; + sunrealtype tcur, gamma; void *user_data; ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, @@ -578,7 +578,7 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) /* nonlinear system data */ N_Vector z, zpred, Fi, sdata; - realtype tcur, gamma; + sunrealtype tcur, gamma; void* user_data = NULL; ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, @@ -617,7 +617,7 @@ int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem) { /* local variables */ diff --git a/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp index e147ccd8c4..c50fed59ed 100644 --- a/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp @@ -27,7 +27,7 @@ int EvolveProblemBDF(N_Vector y, UserData* udata, UserOptions* uopt) SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ SUNLinearSolver LS = NULL; /* empty linear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, netf; /* step stats */ @@ -184,7 +184,7 @@ int EvolveProblemAdams(N_Vector y, UserData* udata, UserOptions* uopt) void* cvode_mem = NULL; /* empty CVODE memory structure */ SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, netf; /* step stats */ diff --git a/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp index 3ae28a43ca..4cdee7ec3b 100644 --- a/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp @@ -41,7 +41,7 @@ int EvolveDAEProblem(N_Vector y, UserData* udata, UserOptions* uopt) SUNLinearSolver LS = NULL; /* empty linear solver structure */ N_Vector yp = NULL; /* empty vector structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, netf; /* step stats */ diff --git a/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp b/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp index 34698146ab..75f18209a0 100644 --- a/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp @@ -26,7 +26,7 @@ upwind 1st order finite differences. At present, only periodic boudary conditions are supported, which are handled via MPI's Cartesian communicator (even for serial runs). */ -static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) +static int Advection(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { /* access problem data */ UserData* udata = (UserData*) user_data; @@ -38,10 +38,10 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; const int dof = udata->grid->dof; - const realtype c = udata->c; - const realtype cx = -c / udata->grid->dx; - const realtype cy = -c / udata->grid->dy; - const realtype cz = -c / udata->grid->dz; + const sunrealtype c = udata->c; + const sunrealtype cx = -c / udata->grid->dx; + const sunrealtype cy = -c / udata->grid->dy; + const sunrealtype cz = -c / udata->grid->dz; /* local variables */ int retval; @@ -71,9 +71,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) Range3D({1,1,1},{nxl,nyl,nzl}), KOKKOS_LAMBDA (int i, int j, int k) { - const realtype u_ijk = Yview(i,j,k,0); - const realtype v_ijk = Yview(i,j,k,1); - const realtype w_ijk = Yview(i,j,k,2); + const sunrealtype u_ijk = Yview(i,j,k,0); + const sunrealtype v_ijk = Yview(i,j,k,1); + const sunrealtype w_ijk = Yview(i,j,k,2); // grad * u dYview(i,j,k,0) = cz * (u_ijk - Yview(i,j,k-1,0)); // du/dz @@ -98,9 +98,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) Range3D({0,0,0},{nxl-1,nyl-1,nzl-1}), KOKKOS_LAMBDA (int i, int j, int k) { - const realtype u_ijk = Yview(i,j,k,0); - const realtype v_ijk = Yview(i,j,k,1); - const realtype w_ijk = Yview(i,j,k,2); + const sunrealtype u_ijk = Yview(i,j,k,0); + const sunrealtype v_ijk = Yview(i,j,k,1); + const sunrealtype w_ijk = Yview(i,j,k,2); // grad * u dYview(i,j,k,0) = cz * (Yview(i,j,k+1,0) - u_ijk); // du/dz @@ -143,9 +143,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) KOKKOS_LAMBDA (int j, int k, int l) { const int i = 0; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,0,k,l); - const realtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,0,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,0,k,l); + const sunrealtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,0,l); dYview(i,j,k,l) = cx * (Yijkl - Wrecv(0,j,k,l)); // d/dx dYview(i,j,k,l) += cy * (Yijkl - YSouth); // d/dy dYview(i,j,k,l) += cz * (Yijkl - YBack); // d/dz @@ -155,9 +155,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) KOKKOS_LAMBDA (int i, int k, int l) { const int j = 0; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(0,j,k,l); - const realtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,0,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(0,j,k,l); + const sunrealtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,0,l); dYview(i,j,k,l) = cx * (Yijkl - YWest); // d/dx dYview(i,j,k,l) += cy * (Yijkl - Srecv(i,0,k,l)); // d/dy dYview(i,j,k,l) += cz * (Yijkl - YBack); // d/dz @@ -167,9 +167,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) KOKKOS_LAMBDA (int i, int j, int l) { const int k = 0; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(0,j,k,l); - const realtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,0,k,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(0,j,k,l); + const sunrealtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,0,k,l); dYview(i,j,k,l) = cx * (Yijkl - YWest); // d/dx dYview(i,j,k,l) += cy * (Yijkl - YSouth); // d/dy dYview(i,j,k,l) += cz * (Yijkl - Brecv(i,j,0,l)); // d/dz @@ -193,9 +193,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) KOKKOS_LAMBDA (int j, int k, int l) { const int i = nxl-1; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,0,k,l); - const realtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,0,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,0,k,l); + const sunrealtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,0,l); dYview(i,j,k,l) = cx * (Erecv(0,j,k,l) - Yijkl); // d/dx dYview(i,j,k,l) += cy * (YNorth - Yijkl); // d/dy dYview(i,j,k,l) += cz * (YFront - Yijkl); // d/dz @@ -205,9 +205,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) KOKKOS_LAMBDA (int i, int k, int l) { const int j = nyl-1; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(0,j,k,l); - const realtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,0,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(0,j,k,l); + const sunrealtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,0,l); dYview(i,j,k,l) = cx * (YEast - Yijkl); // d/dx dYview(i,j,k,l) += cy * (Nrecv(i,0,k,l) - Yijkl); // d/dy dYview(i,j,k,l) += cz * (YFront - Yijkl); // d/dz @@ -217,9 +217,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) KOKKOS_LAMBDA (int i, int j, int l) { const int k = nzl-1; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(0,j,k,l); - const realtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,0,k,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(0,j,k,l); + const sunrealtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,0,k,l); dYview(i,j,k,l) = cx * (YEast - Yijkl); // d/dx dYview(i,j,k,l) += cy * (YNorth - Yijkl); // d/dy dYview(i,j,k,l) += cz * (Frecv(i,j,0,l) - Yijkl); // d/dz @@ -232,7 +232,7 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) /* Compute the reaction term g(t,y). */ -static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) +static int Reaction(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { /* access problem data */ UserData* udata = (UserData*) user_data; @@ -240,14 +240,14 @@ static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) SUNDIALS_CXX_MARK_FUNCTION(udata->prof); /* set variable shortcuts */ - const realtype A = udata->A; - const realtype B = udata->B; - const realtype k1 = udata->k1; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; - const realtype k5 = udata->k5; - const realtype k6 = udata->k6; + const sunrealtype A = udata->A; + const sunrealtype B = udata->B; + const sunrealtype k1 = udata->k1; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; + const sunrealtype k5 = udata->k5; + const sunrealtype k6 = udata->k6; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; @@ -266,9 +266,9 @@ static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) Range3D({0,0,0},{nxl,nyl,nzl}), KOKKOS_LAMBDA (int i, int j, int k) { - const realtype u = Yview(i,j,k,0); - const realtype v = Yview(i,j,k,1); - const realtype w = Yview(i,j,k,2); + const sunrealtype u = Yview(i,j,k,0); + const sunrealtype v = Yview(i,j,k,1); + const sunrealtype w = Yview(i,j,k,2); dYview(i,j,k,0) += k1 * A - k2 * w * u + k3 * u * u * v - k4 * u; dYview(i,j,k,1) += k2 * w * u - k3 * u * u * v; dYview(i,j,k,2) += -k2 * w * u + k5 * B - k6 * w; @@ -280,7 +280,7 @@ static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) /* Compute the RHS as h(t,y) = f(t,y) + g(t,y). */ -static int AdvectionReaction(realtype t, N_Vector y, N_Vector ydot, +static int AdvectionReaction(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { /* access problem data */ @@ -300,7 +300,7 @@ static int AdvectionReaction(realtype t, N_Vector y, N_Vector ydot, } /* Compute the residual F(t,y,y') = ydot - h(t,y) = 0. */ -static int AdvectionReactionResidual(realtype t, N_Vector y, N_Vector ydot, +static int AdvectionReactionResidual(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector F, void *user_data) { /* access problem data */ @@ -330,17 +330,17 @@ static int AdvectionReactionResidual(realtype t, N_Vector y, N_Vector ydot, When using a fully implicit method, we are approximating dh/dy as dg/dy. */ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b, - const realtype gamma, UserData* udata) + const sunrealtype gamma, UserData* udata) { /* set variable shortcuts */ const int dof = udata->grid->dof; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; - const realtype k6 = udata->k6; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; + const sunrealtype k6 = udata->k6; /* create 4D views of state, RHS and solution vectors */ Vec4D Yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(y)), nxl, nyl, nzl, dof); @@ -354,47 +354,47 @@ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b, { /* shortcuts to u, v, w for the block */ - const realtype u = Yview(i,j,k,0); - const realtype v = Yview(i,j,k,1); - const realtype w = Yview(i,j,k,2); + const sunrealtype u = Yview(i,j,k,0); + const sunrealtype v = Yview(i,j,k,1); + const sunrealtype w = Yview(i,j,k,2); // // compute A = I - gamma*(dg/dy) // /* 1st row: u, v, w */ - const realtype A0 = 1. - gamma * (-k2 * w + 2.0 * k3 * u * v - k4); - const realtype A1 = -gamma * (k3 * u * u); - const realtype A2 = -gamma * (-k2 * u); + const sunrealtype A0 = 1. - gamma * (-k2 * w + 2.0 * k3 * u * v - k4); + const sunrealtype A1 = -gamma * (k3 * u * u); + const sunrealtype A2 = -gamma * (-k2 * u); /* 2nd row: u, v, w */ - const realtype A3 = -gamma * (k2 * w - 2.0 * k3 * u * v); - const realtype A4 = 1. - gamma * (-k3 * u * u); - const realtype A5 = -gamma * (k2 * u); + const sunrealtype A3 = -gamma * (k2 * w - 2.0 * k3 * u * v); + const sunrealtype A4 = 1. - gamma * (-k3 * u * u); + const sunrealtype A5 = -gamma * (k2 * u); /* 3rd row: u, v, w */ - const realtype A6 = -gamma * (-k2 * w); - const realtype A7 = 0.0; - const realtype A8 = 1. - gamma * (-k2 * u - k6); + const sunrealtype A6 = -gamma * (-k2 * w); + const sunrealtype A7 = 0.0; + const sunrealtype A8 = 1. - gamma * (-k2 * u - k6); // // compute x = A^{-1}*b // - const realtype scratch_0 = A4*A8; - const realtype scratch_1 = A1*A5; - const realtype scratch_2 = A2*A7; - const realtype scratch_3 = A5*A7; - const realtype scratch_4 = A1*A8; - const realtype scratch_5 = A2*A4; - const realtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); - const realtype scratch_7 = A2*A3; - const realtype scratch_8 = A6*Bview(i,j,k,0); - const realtype scratch_9 = A2*A6; - const realtype scratch_10 = A3*Bview(i,j,k,0); - const realtype scratch_11 = 1.0/A0; - const realtype scratch_12 = A1*scratch_11; - const realtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); + const sunrealtype scratch_0 = A4*A8; + const sunrealtype scratch_1 = A1*A5; + const sunrealtype scratch_2 = A2*A7; + const sunrealtype scratch_3 = A5*A7; + const sunrealtype scratch_4 = A1*A8; + const sunrealtype scratch_5 = A2*A4; + const sunrealtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); + const sunrealtype scratch_7 = A2*A3; + const sunrealtype scratch_8 = A6*Bview(i,j,k,0); + const sunrealtype scratch_9 = A2*A6; + const sunrealtype scratch_10 = A3*Bview(i,j,k,0); + const sunrealtype scratch_11 = 1.0/A0; + const sunrealtype scratch_12 = A1*scratch_11; + const sunrealtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); Xview(i,j,k,0) = scratch_6*( Bview(i,j,k,0)*(scratch_0 - scratch_3) + Bview(i,j,k,1)*(scratch_2 - scratch_4) @@ -414,17 +414,17 @@ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b, /* Solve the linear systems Ax = b where A = -dg/dy + gamma. We are approximating dh/dy as dg/dy. */ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, - const realtype gamma, UserData* udata) + const sunrealtype gamma, UserData* udata) { /* set variable shortcuts */ const int dof = udata->grid->dof; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; - const realtype k6 = udata->k6; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; + const sunrealtype k6 = udata->k6; /* create 4D views of state, RHS and solution vectors */ Vec4D Yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(y)), nxl, nyl, nzl, dof); @@ -438,9 +438,9 @@ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, { /* shortcuts to u, v, w for the block */ - const realtype u = Yview(i,j,k,0); - const realtype v = Yview(i,j,k,1); - const realtype w = Yview(i,j,k,2); + const sunrealtype u = Yview(i,j,k,0); + const sunrealtype v = Yview(i,j,k,1); + const sunrealtype w = Yview(i,j,k,2); // // compute A = -dg/dy + gamma*diag(df/dydot) @@ -449,38 +449,38 @@ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, // /* 1st row: u, v, w */ - const realtype A0 = -(-k2 * w + 2.0 * k3 * u * v - k4) + gamma; - const realtype A1 = -(k3 * u * u); - const realtype A2 = -(-k2 * u); + const sunrealtype A0 = -(-k2 * w + 2.0 * k3 * u * v - k4) + gamma; + const sunrealtype A1 = -(k3 * u * u); + const sunrealtype A2 = -(-k2 * u); /* 2nd row: u, v, w */ - const realtype A3 = -(k2 * w - 2.0 * k3 * u * v); - const realtype A4 = -(-k3 * u * u) + gamma; - const realtype A5 = -(k2 * u); + const sunrealtype A3 = -(k2 * w - 2.0 * k3 * u * v); + const sunrealtype A4 = -(-k3 * u * u) + gamma; + const sunrealtype A5 = -(k2 * u); /* 3rd row: u, v, w */ - const realtype A6 = -(-k2 * w); - const realtype A7 = 0.0; - const realtype A8 = -(-k2 * u - k6) + gamma; + const sunrealtype A6 = -(-k2 * w); + const sunrealtype A7 = 0.0; + const sunrealtype A8 = -(-k2 * u - k6) + gamma; // // compute x = A^{-1}*b // - const realtype scratch_0 = A4*A8; - const realtype scratch_1 = A1*A5; - const realtype scratch_2 = A2*A7; - const realtype scratch_3 = A5*A7; - const realtype scratch_4 = A1*A8; - const realtype scratch_5 = A2*A4; - const realtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); - const realtype scratch_7 = A2*A3; - const realtype scratch_8 = A6*Bview(i,j,k,0); - const realtype scratch_9 = A2*A6; - const realtype scratch_10 = A3*Bview(i,j,k,0); - const realtype scratch_11 = 1.0/A0; - const realtype scratch_12 = A1*scratch_11; - const realtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); + const sunrealtype scratch_0 = A4*A8; + const sunrealtype scratch_1 = A1*A5; + const sunrealtype scratch_2 = A2*A7; + const sunrealtype scratch_3 = A5*A7; + const sunrealtype scratch_4 = A1*A8; + const sunrealtype scratch_5 = A2*A4; + const sunrealtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); + const sunrealtype scratch_7 = A2*A3; + const sunrealtype scratch_8 = A6*Bview(i,j,k,0); + const sunrealtype scratch_9 = A2*A6; + const sunrealtype scratch_10 = A3*Bview(i,j,k,0); + const sunrealtype scratch_11 = 1.0/A0; + const sunrealtype scratch_12 = A1*scratch_11; + const sunrealtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); Xview(i,j,k,0) = scratch_6*( Bview(i,j,k,0)*(scratch_0 - scratch_3) + Bview(i,j,k,1)*(scratch_2 - scratch_4) @@ -503,8 +503,8 @@ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, * --------------------------------------------------------------*/ /* Solves Pz = r where P = I - gamma * dg/dy */ -static int PSolve(realtype t, N_Vector y, N_Vector ydot, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { /* local variables */ @@ -520,8 +520,8 @@ static int PSolve(realtype t, N_Vector y, N_Vector ydot, N_Vector r, } /* Solves Pz = r where P = -dg/dy + gamma */ -static int PSolveRes(realtype t, N_Vector y, N_Vector ydot, N_Vector F, - N_Vector r, N_Vector z, realtype cj, realtype delta, +static int PSolveRes(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector F, + N_Vector r, N_Vector z, sunrealtype cj, sunrealtype delta, void *user_data) { /* local variables */ diff --git a/benchmarks/advection_reaction_3D/raja/README.md b/benchmarks/advection_reaction_3D/raja/README.md index 33c82db725..612e4702fd 100644 --- a/benchmarks/advection_reaction_3D/raja/README.md +++ b/benchmarks/advection_reaction_3D/raja/README.md @@ -60,19 +60,19 @@ listed below. | `--nout ` | Number of output times | 40 | | `--npts ` | Number of mesh points in each direction | 100 | | `--npxyz ` | Number of MPI tasks in each direction (0 forces MPI to decide) | 0 0 0 | -| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | -| `--A ` | Constant concentration of species `A` | 1.0 | -| `--B ` | Constant concentration of species `B` | 3.5 | -| `--c ` | Advection speed `c` | 0.01 | +| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | +| `--A ` | Constant concentration of species `A` | 1.0 | +| `--B ` | Constant concentration of species `B` | 3.5 | +| `--c ` | Advection speed `c` | 0.01 | | `--order ` | Integration method order | 3 | | `--method ` | Integrator to use: `ERK`, `ARK-DIRK`, `ARK-IMEX`, `CV-BDF`, `CV-ADAMS`, `IDA` | `ARK-DIRK` | | `--nls ` | Nonlinear Solver Method: `newton`, `tl-newton`, `fixedpoint`, `none` | `newton` | | `--fpaccel ` | Number of fixed point acceleration vectors | 3 | | `--nopre` | Disable preconditioning | False | | `--fused` | Enabled fused operations | Off | -| `--tf ` | Final integration time `t_f` | 10.0 | -| `--rtol ` | Relative tolerance | 1.0e-6 | -| `--atol ` | Absolute tolerance | 1.0e-9 | +| `--tf ` | Final integration time `t_f` | 10.0 | +| `--rtol ` | Relative tolerance | 1.0e-6 | +| `--atol ` | Absolute tolerance | 1.0e-9 | ## Building and Running diff --git a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp index 088e4536a0..50de56acbc 100644 --- a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp +++ b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp @@ -49,14 +49,14 @@ * --nopre turn off preconditioning * --order the method order to use * --npts number of mesh points in each direction - * --xmax maximum value of x (size of domain) - * --tf final time - * --A A parameter value - * --B B parameter value - * --k reaction rate - * --c advection speed - * --rtol relative tolerance - * --atol absolute tolerance + * --xmax maximum value of x (size of domain) + * --tf final time + * --A A parameter value + * --B B parameter value + * --k reaction rate + * --c advection speed + * --rtol relative tolerance + * --atol absolute tolerance * --------------------------------------------------------------------------*/ #include "advection_reaction_3D.hpp" @@ -184,14 +184,14 @@ int FillSendBuffers(N_Vector y, UserData* udata) { /* shortcuts */ - const realtype c = udata->c; + const sunrealtype c = udata->c; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; const int dof = udata->grid->dof; /* Create a 4D view of the vector */ - RAJA::View > Yview(GetVecData(y), + RAJA::View > Yview(GetVecData(y), nxl, nyl, nzl, dof); if (c > 0.0) @@ -200,11 +200,11 @@ int FillSendBuffers(N_Vector y, UserData* udata) /* Flow moving in the positive directions uses backward difference. */ /* Fill 3D views of send buffers on device */ - RAJA::View > + RAJA::View > Esend(udata->grid->getSendBuffer("EAST"), nyl, nzl, dof); - RAJA::View > + RAJA::View > Nsend(udata->grid->getSendBuffer("NORTH"), nxl, nzl, dof); - RAJA::View > + RAJA::View > Fsend(udata->grid->getSendBuffer("FRONT"), nxl, nyl, dof); auto east_face = RAJA::make_tuple(RAJA::RangeSegment(0, nyl), @@ -238,11 +238,11 @@ int FillSendBuffers(N_Vector y, UserData* udata) /* Flow moving in the negative directions uses forward difference. */ /* Fill 3D views of send buffers on device */ - RAJA::View > + RAJA::View > Wsend(udata->grid->getSendBuffer("WEST"), nyl, nzl, dof); - RAJA::View > + RAJA::View > Ssend(udata->grid->getSendBuffer("SOUTH"), nxl, nzl, dof); - RAJA::View > + RAJA::View > Bsend(udata->grid->getSendBuffer("BACK"), nxl, nyl, dof); auto west_face = RAJA::make_tuple(RAJA::RangeSegment(0, nyl), @@ -431,7 +431,7 @@ int ComponentMask(N_Vector mask, int component, const UserData* udata) N_VConst(0.0, mask); /* Create 4D view of mask data */ - RAJA::View > mask_view(GetVecData(mask), + RAJA::View > mask_view(GetVecData(mask), udata->grid->nxl, udata->grid->nyl, udata->grid->nzl, @@ -506,9 +506,9 @@ int SetupProblem(int argc, char *argv[], UserData* udata, UserOptions* uopt, /* Setup the parallel decomposition */ const sunindextype npts[] = {uopt->npts, uopt->npts, uopt->npts}; - const realtype amax[] = {0.0, 0.0, 0.0}; - const realtype bmax[] = {udata->xmax, udata->xmax, udata->xmax}; - udata->grid = new ParallelGrid(memhelper, &udata->comm, + const sunrealtype amax[] = {0.0, 0.0, 0.0}; + const sunrealtype bmax[] = {udata->xmax, udata->xmax, udata->xmax}; + udata->grid = new ParallelGrid(memhelper, &udata->comm, amax, bmax, npts, 3, BoundaryType::PERIODIC, StencilType::UPWIND, udata->c, STENCIL_WIDTH, uopt->npxyz); @@ -574,15 +574,15 @@ int SetupProblem(int argc, char *argv[], UserData* udata, UserOptions* uopt, /* Compute the 3D Gaussian function. */ DEVICE_FUNC -void Gaussian3D(realtype& x, realtype& y, realtype& z, realtype xmax) +void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax) { /* Gaussian distribution defaults */ - const realtype alpha = 0.1; - const realtype mu[] = { xmax/RCONST(2.0), xmax/RCONST(2.0), xmax/RCONST(2.0) }; - const realtype sigma[] = { xmax/RCONST(4.0), xmax/RCONST(4.0), xmax/RCONST(4.0) }; // Sigma = diag(sigma) + const sunrealtype alpha = 0.1; + const sunrealtype mu[] = { xmax/RCONST(2.0), xmax/RCONST(2.0), xmax/RCONST(2.0) }; + const sunrealtype sigma[] = { xmax/RCONST(4.0), xmax/RCONST(4.0), xmax/RCONST(4.0) }; // Sigma = diag(sigma) /* denominator = 2*sqrt(|Sigma|*(2pi)^3) */ - const realtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3)); + const sunrealtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3)); x = alpha * exp( -((x - mu[0])*(x - mu[0])*(1.0/sigma[0])) / denom ); y = alpha * exp( -((y - mu[1])*(y - mu[1])*(1.0/sigma[1])) / denom ); z = alpha * exp( -((z - mu[2])*(z - mu[2])*(1.0/sigma[2])) / denom ); @@ -599,27 +599,27 @@ int SetIC(N_Vector y, UserData* udata) const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; const int dof = udata->grid->dof; - const realtype dx = udata->grid->dx; - const realtype dy = udata->grid->dy; - const realtype dz = udata->grid->dz; - const realtype xmax = udata->xmax; - const realtype A = udata->A; - const realtype B = udata->B; - const realtype k1 = udata->k1; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; + const sunrealtype dx = udata->grid->dx; + const sunrealtype dy = udata->grid->dy; + const sunrealtype dz = udata->grid->dz; + const sunrealtype xmax = udata->xmax; + const sunrealtype A = udata->A; + const sunrealtype B = udata->B; + const sunrealtype k1 = udata->k1; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; const int xcrd = udata->grid->coords[0]; const int ycrd = udata->grid->coords[1]; const int zcrd = udata->grid->coords[2]; /* Steady state solution */ - const realtype us = k1 * A / k4; - const realtype vs = k2 * k4 * B / (k1 * k3 * A); - const realtype ws = 3.0; + const sunrealtype us = k1 * A / k4; + const sunrealtype vs = k2 * k4 * B / (k1 * k3 * A); + const sunrealtype ws = 3.0; /* Create 4D view of y */ - RAJA::View > yview(GetVecData(y), + RAJA::View > yview(GetVecData(y), nxl, nyl, nzl, dof); /* Gaussian perturbation of the steady state solution */ @@ -629,11 +629,11 @@ int SetIC(N_Vector y, UserData* udata) RAJA::kernel(range, [=] DEVICE_FUNC (int i, int j, int k) { - realtype x = (xcrd * nxl + i) * dx; - realtype y = (ycrd * nyl + j) * dy; - realtype z = (zcrd * nzl + k) * dz; + sunrealtype x = (xcrd * nxl + i) * dx; + sunrealtype y = (ycrd * nyl + j) * dy; + sunrealtype z = (zcrd * nzl + k) * dz; Gaussian3D(x,y,z,xmax); - const realtype p = x + y + z; + const sunrealtype p = x + y + z; yview(i,j,k,0) = us + p; yview(i,j,k,1) = vs + p; yview(i,j,k,2) = ws + p; @@ -645,7 +645,7 @@ int SetIC(N_Vector y, UserData* udata) /* Write time and solution to disk */ -int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt) +int WriteOutput(sunrealtype t, N_Vector y, UserData* udata, UserOptions* uopt) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -653,12 +653,12 @@ int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt) CopyVecFromDevice(N_VGetLocalVector_MPIPlusX(y)); /* output current solution norm to screen */ - realtype N = (realtype) udata->grid->npts(); - realtype u = N_VWL2Norm(y, udata->umask); + sunrealtype N = (sunrealtype) udata->grid->npts(); + sunrealtype u = N_VWL2Norm(y, udata->umask); u = sqrt(u*u/N); - realtype v = N_VWL2Norm(y, udata->vmask); + sunrealtype v = N_VWL2Norm(y, udata->vmask); v = sqrt(v*v/N); - realtype w = N_VWL2Norm(y, udata->wmask); + sunrealtype w = N_VWL2Norm(y, udata->wmask); w = sqrt(w*w/N); if (udata->myid == 0) { printf(" %10.6f %10.6f %10.6f %10.6f\n", t, u, v, w); @@ -674,14 +674,14 @@ int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt) } /* create 4D view of host data */ - realtype* ydata = NULL; + sunrealtype* ydata = NULL; ydata = N_VGetArrayPointer(y); if (check_retval((void *) ydata, "N_VGetArrayPointer", 0, udata->myid)) return -1; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; const int dof = udata->grid->dof; - RAJA::View > Yview(ydata, nxl, nyl, nzl, dof); + RAJA::View > Yview(ydata, nxl, nyl, nzl, dof); /* output results to disk */ for (int i = 0; i < nxl; i++) @@ -725,14 +725,14 @@ void InputError(char *name) fprintf(stderr, " --order the method order to use\n"); fprintf(stderr, " --npts number of mesh points in each direction\n"); fprintf(stderr, " --npxyz number of processors in each direction (0 forces MPI to decide)\n"); - fprintf(stderr, " --xmax maximum value of x (size of domain)\n"); - fprintf(stderr, " --tf final time\n"); - fprintf(stderr, " --A A parameter value\n"); - fprintf(stderr, " --B B parameter value\n"); - fprintf(stderr, " --k reaction rate\n"); - fprintf(stderr, " --c advection speed\n"); - fprintf(stderr, " --rtol relative tolerance\n"); - fprintf(stderr, " --atol absolute tolerance\n"); + fprintf(stderr, " --xmax maximum value of x (size of domain)\n"); + fprintf(stderr, " --tf final time\n"); + fprintf(stderr, " --A A parameter value\n"); + fprintf(stderr, " --B B parameter value\n"); + fprintf(stderr, " --k reaction rate\n"); + fprintf(stderr, " --c advection speed\n"); + fprintf(stderr, " --rtol relative tolerance\n"); + fprintf(stderr, " --atol absolute tolerance\n"); } MPI_Barrier(MPI_COMM_WORLD); diff --git a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp index e4227d62c7..6fdd714ffa 100644 --- a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp +++ b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp @@ -46,10 +46,10 @@ struct UserOptions { int npxyz[3]; /* number of processors in x,y,z */ sunindextype npts; /* number of spatial mesh points */ - realtype t0; /* initial time */ - realtype tf; /* final time */ - realtype rtol; /* relative tolerance */ - realtype atol; /* absolute tolerance */ + sunrealtype t0; /* initial time */ + sunrealtype tf; /* final time */ + sunrealtype rtol; /* relative tolerance */ + sunrealtype atol; /* absolute tolerance */ int order; /* method order */ string method; /* method string */ string nls; /* nonlinear solver to use */ @@ -92,19 +92,19 @@ struct UserData N_Vector wmask; /* problem paramaters */ - realtype xmax; /* maximum x value */ - realtype A; /* concentration of species A */ - realtype B; /* w source rate */ - realtype k1; /* reaction rates */ - realtype k2; - realtype k3; - realtype k4; - realtype k5; - realtype k6; - realtype c; /* advection coefficient */ + sunrealtype xmax; /* maximum x value */ + sunrealtype A; /* concentration of species A */ + sunrealtype B; /* w source rate */ + sunrealtype k1; /* reaction rates */ + sunrealtype k2; + sunrealtype k3; + sunrealtype k4; + sunrealtype k5; + sunrealtype k6; + sunrealtype c; /* advection coefficient */ /* parallel mesh */ - ParallelGrid* grid; + ParallelGrid* grid; /* count of implicit function evals by the task local nonlinear solver */ long int nnlfi; @@ -165,6 +165,6 @@ void InputError(char *name); int ComponentMask(N_Vector mask, const int component, const UserData* udata); /* function to write solution to disk */ -int WriteOutput(realtype t, N_Vector y, UserData* udata, UserOptions* uopt); +int WriteOutput(sunrealtype t, N_Vector y, UserData* udata, UserOptions* uopt); #endif diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index e2cf1451e3..d243f9e021 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -52,7 +52,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ SUNLinearSolver LS = NULL; /* empty linear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ @@ -227,7 +227,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ SUNLinearSolver LS = NULL; /* empty linear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ @@ -410,7 +410,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) { void* arkode_mem = NULL; /* empty ARKODE memory structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ @@ -529,12 +529,12 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) /* temporary variables */ UserData* udata; int retval; - realtype c[3]; + sunrealtype c[3]; N_Vector X[3]; /* nonlinear system data */ N_Vector z, zpred, Fi, sdata; - realtype tcur, gamma; + sunrealtype tcur, gamma; void *user_data; ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, @@ -578,7 +578,7 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) /* nonlinear system data */ N_Vector z, zpred, Fi, sdata; - realtype tcur, gamma; + sunrealtype tcur, gamma; void* user_data = NULL; ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, @@ -617,7 +617,7 @@ int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem) { /* local variables */ diff --git a/benchmarks/advection_reaction_3D/raja/backends.hpp b/benchmarks/advection_reaction_3D/raja/backends.hpp index f9fd5f388f..5d6c9799ee 100644 --- a/benchmarks/advection_reaction_3D/raja/backends.hpp +++ b/benchmarks/advection_reaction_3D/raja/backends.hpp @@ -162,7 +162,7 @@ constexpr auto LocalNvector = N_VNew_Serial; /* Get the vector data array pointer for the device if using the GPU, or host if not. */ -static realtype* GetVecData(N_Vector y) +static sunrealtype* GetVecData(N_Vector y) { #ifdef USE_GPU if (N_VGetVectorID(y) == SUNDIALS_NVEC_MPIPLUSX) diff --git a/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp b/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp index e147ccd8c4..c50fed59ed 100644 --- a/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp @@ -27,7 +27,7 @@ int EvolveProblemBDF(N_Vector y, UserData* udata, UserOptions* uopt) SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ SUNLinearSolver LS = NULL; /* empty linear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, netf; /* step stats */ @@ -184,7 +184,7 @@ int EvolveProblemAdams(N_Vector y, UserData* udata, UserOptions* uopt) void* cvode_mem = NULL; /* empty CVODE memory structure */ SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, netf; /* step stats */ diff --git a/benchmarks/advection_reaction_3D/raja/ida_driver.cpp b/benchmarks/advection_reaction_3D/raja/ida_driver.cpp index 3ae28a43ca..4cdee7ec3b 100644 --- a/benchmarks/advection_reaction_3D/raja/ida_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/ida_driver.cpp @@ -41,7 +41,7 @@ int EvolveDAEProblem(N_Vector y, UserData* udata, UserOptions* uopt) SUNLinearSolver LS = NULL; /* empty linear solver structure */ N_Vector yp = NULL; /* empty vector structure */ - realtype t, dtout, tout; /* current/output time data */ + sunrealtype t, dtout, tout; /* current/output time data */ int retval; /* reusable error-checking flag */ int iout; /* output counter */ long int nst, netf; /* step stats */ diff --git a/benchmarks/advection_reaction_3D/raja/rhs3D.hpp b/benchmarks/advection_reaction_3D/raja/rhs3D.hpp index 1bb2b6f105..6c38ef154e 100644 --- a/benchmarks/advection_reaction_3D/raja/rhs3D.hpp +++ b/benchmarks/advection_reaction_3D/raja/rhs3D.hpp @@ -24,7 +24,7 @@ /* Compute the advection term f(t,y) = -c (grad * y). This is done using upwind 1st order finite differences. */ -static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) +static int Advection(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { /* access problem data */ UserData* udata = (UserData*) user_data; @@ -36,10 +36,10 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; const int dof = udata->grid->dof; - const realtype c = udata->c; - const realtype cx = -c / udata->grid->dx; - const realtype cy = -c / udata->grid->dy; - const realtype cz = -c / udata->grid->dz; + const sunrealtype c = udata->c; + const sunrealtype cx = -c / udata->grid->dx; + const sunrealtype cy = -c / udata->grid->dy; + const sunrealtype cz = -c / udata->grid->dz; /* local variables */ int retval; @@ -58,8 +58,8 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) N_VConst(0.0, ydot); /* create views of the state and RHS vectors */ - RAJA::View > Yview(GetVecData(y), nxl, nyl, nzl, dof); - RAJA::View > dYview(GetVecData(ydot), nxl, nyl, nzl, dof); + RAJA::View > Yview(GetVecData(y), nxl, nyl, nzl, dof); + RAJA::View > dYview(GetVecData(ydot), nxl, nyl, nzl, dof); /* iterate over domain interior, computing advection */ if (c > 0.0) @@ -70,9 +70,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::RangeSegment(1, nzl)); RAJA::kernel(range, [=] DEVICE_FUNC (int i, int j, int k) { - const realtype u_ijk = Yview(i,j,k,0); - const realtype v_ijk = Yview(i,j,k,1); - const realtype w_ijk = Yview(i,j,k,2); + const sunrealtype u_ijk = Yview(i,j,k,0); + const sunrealtype v_ijk = Yview(i,j,k,1); + const sunrealtype w_ijk = Yview(i,j,k,2); // grad * u dYview(i,j,k,0) = cz * (u_ijk - Yview(i,j,k-1,0)); // du/dz @@ -99,9 +99,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::RangeSegment(0, nzl-1)); RAJA::kernel(range, [=] DEVICE_FUNC (int i, int j, int k) { - const realtype u_ijk = Yview(i,j,k,0); - const realtype v_ijk = Yview(i,j,k,1); - const realtype w_ijk = Yview(i,j,k,2); + const sunrealtype u_ijk = Yview(i,j,k,0); + const sunrealtype v_ijk = Yview(i,j,k,1); + const sunrealtype w_ijk = Yview(i,j,k,2); // grad * u dYview(i,j,k,0) = cz * (Yview(i,j,k+1,0) - u_ijk); // du/dz @@ -136,11 +136,11 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) * boundaries are west face, south face, back face */ /* Perform calculations on each "lower" face */ - RAJA::View> + RAJA::View> Wrecv(udata->grid->getRecvBuffer("WEST"), nyl, nzl, dof); - RAJA::View> + RAJA::View> Srecv(udata->grid->getRecvBuffer("SOUTH"), nxl, nzl, dof); - RAJA::View> + RAJA::View> Brecv(udata->grid->getRecvBuffer("BACK"), nxl, nyl, dof); auto west_face = RAJA::make_tuple(RAJA::RangeSegment(0, nyl), @@ -149,9 +149,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::kernel(west_face, [=] DEVICE_FUNC (int j, int k, int l) { const int i = 0; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,k,l); - const realtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,k,l); + const sunrealtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,l); dYview(i,j,k,l) = cx * (Yijkl - Wrecv(j,k,l)); // d/dx dYview(i,j,k,l) += cy * (Yijkl - YSouth); // d/dy dYview(i,j,k,l) += cz * (Yijkl - YBack); // d/dz @@ -163,9 +163,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::kernel(south_face, [=] DEVICE_FUNC (int i, int k, int l) { const int j = 0; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(j,k,l); - const realtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(j,k,l); + const sunrealtype YBack = (k > 0) ? Yview(i,j,k-1,l) : Brecv(i,j,l); dYview(i,j,k,l) = cx * (Yijkl - YWest); // d/dx dYview(i,j,k,l) += cy * (Yijkl - Srecv(i,k,l)); // d/dy dYview(i,j,k,l) += cz * (Yijkl - YBack); // d/dz @@ -177,9 +177,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::kernel(back_face, [=] DEVICE_FUNC (int i, int j, int l) { const int k = 0; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(j,k,l); - const realtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,k,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YWest = (i > 0) ? Yview(i-1,j,k,l) : Wrecv(j,k,l); + const sunrealtype YSouth = (j > 0) ? Yview(i,j-1,k,l) : Srecv(i,k,l); dYview(i,j,k,l) = cx * (Yijkl - YWest); // d/dx dYview(i,j,k,l) += cy * (Yijkl - YSouth); // d/dy dYview(i,j,k,l) += cz * (Yijkl - Brecv(i,j,l)); // d/dz @@ -193,11 +193,11 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) * boundaries are east face, north face, and front face */ /* Perform calculations on each "upper" face */ - RAJA::View > + RAJA::View > Erecv(udata->grid->getRecvBuffer("EAST"), nyl, nzl, dof); - RAJA::View > + RAJA::View > Nrecv(udata->grid->getRecvBuffer("NORTH"), nxl, nzl, dof); - RAJA::View > + RAJA::View > Frecv(udata->grid->getRecvBuffer("FRONT"), nxl, nyl, dof); auto east_face = RAJA::make_tuple(RAJA::RangeSegment(0, nyl), @@ -206,9 +206,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::kernel(east_face, [=] DEVICE_FUNC (int j, int k, int l) { const int i = nxl-1; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,k,l); - const realtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,k,l); + const sunrealtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,l); dYview(i,j,k,l) = cx * (Erecv(j,k,l) - Yijkl); // d/dx dYview(i,j,k,l) += cy * (YNorth - Yijkl); // d/dy dYview(i,j,k,l) += cz * (YFront - Yijkl); // d/dz @@ -220,9 +220,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::kernel(north_face, [=] DEVICE_FUNC (int i, int k, int l) { const int j = nyl-1; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(j,k,l); - const realtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(j,k,l); + const sunrealtype YFront = (k < nzl-1) ? Yview(i,j,k+1,l) : Frecv(i,j,l); dYview(i,j,k,l) = cx * (YEast - Yijkl); // d/dx dYview(i,j,k,l) += cy * (Nrecv(i,k,l) - Yijkl); // d/dy dYview(i,j,k,l) += cz * (YFront - Yijkl); // d/dz @@ -234,9 +234,9 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::kernel(front_face, [=] DEVICE_FUNC (int i, int j, int l) { const int k = nzl-1; - const realtype Yijkl = Yview(i,j,k,l); - const realtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(j,k,l); - const realtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,k,l); + const sunrealtype Yijkl = Yview(i,j,k,l); + const sunrealtype YEast = (i < nxl-1) ? Yview(i+1,j,k,l) : Erecv(j,k,l); + const sunrealtype YNorth = (j < nyl-1) ? Yview(i,j+1,k,l) : Nrecv(i,k,l); dYview(i,j,k,l) = cx * (YEast - Yijkl); // d/dx dYview(i,j,k,l) += cy * (YNorth - Yijkl); // d/dy dYview(i,j,k,l) += cz * (Frecv(i,j,l) - Yijkl); // d/dz @@ -249,7 +249,7 @@ static int Advection(realtype t, N_Vector y, N_Vector ydot, void* user_data) /* Compute the reaction term g(t,y). */ -static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) +static int Reaction(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { /* access problem data */ UserData* udata = (UserData*) user_data; @@ -257,14 +257,14 @@ static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) SUNDIALS_CXX_MARK_FUNCTION(udata->prof); /* set variable shortcuts */ - const realtype A = udata->A; - const realtype B = udata->B; - const realtype k1 = udata->k1; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; - const realtype k5 = udata->k5; - const realtype k6 = udata->k6; + const sunrealtype A = udata->A; + const sunrealtype B = udata->B; + const sunrealtype k1 = udata->k1; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; + const sunrealtype k5 = udata->k5; + const sunrealtype k6 = udata->k6; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; @@ -275,18 +275,18 @@ static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) N_VConst(0.0, ydot); /* access data arrays */ - realtype* Ydata = NULL; + sunrealtype* Ydata = NULL; Ydata = GetVecData(y); if (check_retval((void *)Ydata, "GetVecData", 0, udata->myid)) return(-1); - realtype* dYdata = NULL; + sunrealtype* dYdata = NULL; dYdata = GetVecData(ydot); if (check_retval((void *)dYdata, "GetVecData", 0, udata->myid)) return(-1); /* create 4D views of state and RHS vectors */ - RAJA::View > Yview(GetVecData(y), nxl, nyl, nzl, dof); - RAJA::View > dYview(GetVecData(ydot), nxl, nyl, nzl, dof); + RAJA::View > Yview(GetVecData(y), nxl, nyl, nzl, dof); + RAJA::View > dYview(GetVecData(ydot), nxl, nyl, nzl, dof); /* add reaction terms to RHS */ auto range = RAJA::make_tuple(RAJA::RangeSegment(0, nxl), @@ -294,9 +294,9 @@ static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) RAJA::RangeSegment(0, nzl)); RAJA::kernel(range, [=] DEVICE_FUNC (int i, int j, int k) { - const realtype u = Yview(i,j,k,0); - const realtype v = Yview(i,j,k,1); - const realtype w = Yview(i,j,k,2); + const sunrealtype u = Yview(i,j,k,0); + const sunrealtype v = Yview(i,j,k,1); + const sunrealtype w = Yview(i,j,k,2); dYview(i,j,k,0) += k1 * A - k2 * w * u + k3 * u * u * v - k4 * u; dYview(i,j,k,1) += k2 * w * u - k3 * u * u * v; dYview(i,j,k,2) += -k2 * w * u + k5 * B - k6 * w; @@ -308,7 +308,7 @@ static int Reaction(realtype t, N_Vector y, N_Vector ydot, void* user_data) /* Compute the RHS as h(t,y) = f(t,y) + g(t,y). */ -static int AdvectionReaction(realtype t, N_Vector y, N_Vector ydot, +static int AdvectionReaction(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { /* access problem data */ @@ -328,7 +328,7 @@ static int AdvectionReaction(realtype t, N_Vector y, N_Vector ydot, } /* Compute the residual F(t,y,y') = ydot - h(t,y) = 0. */ -static int AdvectionReactionResidual(realtype t, N_Vector y, N_Vector ydot, +static int AdvectionReactionResidual(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector F, void *user_data) { /* access problem data */ @@ -358,22 +358,22 @@ static int AdvectionReactionResidual(realtype t, N_Vector y, N_Vector ydot, When using a fully implicit method, we are approximating dh/dy as dg/dy. */ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b, - realtype gamma, UserData* udata) + sunrealtype gamma, UserData* udata) { /* set variable shortcuts */ const int dof = udata->grid->dof; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; - const realtype k6 = udata->k6; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; + const sunrealtype k6 = udata->k6; /* create 4D views of state, RHS and solution vectors */ - RAJA::View> Yview(GetVecData(y), nxl, nyl, nzl, dof); - RAJA::View> Bview(GetVecData(b), nxl, nyl, nzl, dof); - RAJA::View> Xview(GetVecData(x), nxl, nyl, nzl, dof); + RAJA::View> Yview(GetVecData(y), nxl, nyl, nzl, dof); + RAJA::View> Bview(GetVecData(b), nxl, nyl, nzl, dof); + RAJA::View> Xview(GetVecData(x), nxl, nyl, nzl, dof); /* solve reaction linear system */ auto blocks = RAJA::make_tuple(RAJA::RangeSegment(0, nxl), @@ -383,28 +383,28 @@ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b, [=] DEVICE_FUNC (int i, int j, int k) { /* shortcuts to u, v, w for the block */ - const realtype u = Yview(i,j,k,0); - const realtype v = Yview(i,j,k,1); - const realtype w = Yview(i,j,k,2); + const sunrealtype u = Yview(i,j,k,0); + const sunrealtype v = Yview(i,j,k,1); + const sunrealtype w = Yview(i,j,k,2); // // compute J = dg/dy // /* 1st row: u, v, w */ - realtype A0 = -k2 * w + 2.0 * k3 * u * v - k4; - realtype A1 = k3 * u * u; - realtype A2 = -k2 * u; + sunrealtype A0 = -k2 * w + 2.0 * k3 * u * v - k4; + sunrealtype A1 = k3 * u * u; + sunrealtype A2 = -k2 * u; /* 2nd row: u, v, w */ - realtype A3 = k2 * w - 2.0 * k3 * u * v; - realtype A4 = -k3 * u * u; - realtype A5 = k2 * u; + sunrealtype A3 = k2 * w - 2.0 * k3 * u * v; + sunrealtype A4 = -k3 * u * u; + sunrealtype A5 = k2 * u; /* 3rd row: u, v, w */ - realtype A6 = -k2 * w; - realtype A7 = 0.0; - realtype A8 = -k2 * u - k6; + sunrealtype A6 = -k2 * w; + sunrealtype A7 = 0.0; + sunrealtype A8 = -k2 * u - k6; // // compute A = I - gamma*J @@ -424,20 +424,20 @@ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b, // compute x = A^{-1}b // - realtype scratch_0 = A4*A8; - realtype scratch_1 = A1*A5; - realtype scratch_2 = A2*A7; - realtype scratch_3 = A5*A7; - realtype scratch_4 = A1*A8; - realtype scratch_5 = A2*A4; - realtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); - realtype scratch_7 = A2*A3; - realtype scratch_8 = A6*Bview(i,j,k,0); - realtype scratch_9 = A2*A6; - realtype scratch_10 = A3*Bview(i,j,k,0); - realtype scratch_11 = 1.0/A0; - realtype scratch_12 = A1*scratch_11; - realtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); + sunrealtype scratch_0 = A4*A8; + sunrealtype scratch_1 = A1*A5; + sunrealtype scratch_2 = A2*A7; + sunrealtype scratch_3 = A5*A7; + sunrealtype scratch_4 = A1*A8; + sunrealtype scratch_5 = A2*A4; + sunrealtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); + sunrealtype scratch_7 = A2*A3; + sunrealtype scratch_8 = A6*Bview(i,j,k,0); + sunrealtype scratch_9 = A2*A6; + sunrealtype scratch_10 = A3*Bview(i,j,k,0); + sunrealtype scratch_11 = 1.0/A0; + sunrealtype scratch_12 = A1*scratch_11; + sunrealtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); Xview(i,j,k,0) = scratch_6*( Bview(i,j,k,0)*(scratch_0 - scratch_3) + Bview(i,j,k,1)*(scratch_2 - scratch_4) @@ -457,22 +457,22 @@ static int SolveReactionLinSys(N_Vector y, N_Vector x, N_Vector b, /* Solve the linear systems Ax = b where A = -dg/dy + gamma. We are approximating dh/dy as dg/dy. */ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, - realtype gamma, UserData* udata) + sunrealtype gamma, UserData* udata) { /* set variable shortcuts */ const int dof = udata->grid->dof; const int nxl = udata->grid->nxl; const int nyl = udata->grid->nyl; const int nzl = udata->grid->nzl; - const realtype k2 = udata->k2; - const realtype k3 = udata->k3; - const realtype k4 = udata->k4; - const realtype k6 = udata->k6; + const sunrealtype k2 = udata->k2; + const sunrealtype k3 = udata->k3; + const sunrealtype k4 = udata->k4; + const sunrealtype k6 = udata->k6; /* create 4D views of state, RHS and solution vectors */ - RAJA::View> Yview(GetVecData(y), nxl, nyl, nzl, dof); - RAJA::View> Bview(GetVecData(b), nxl, nyl, nzl, dof); - RAJA::View> Xview(GetVecData(x), nxl, nyl, nzl, dof); + RAJA::View> Yview(GetVecData(y), nxl, nyl, nzl, dof); + RAJA::View> Bview(GetVecData(b), nxl, nyl, nzl, dof); + RAJA::View> Xview(GetVecData(x), nxl, nyl, nzl, dof); /* solve reaction linear system */ auto blocks = RAJA::make_tuple(RAJA::RangeSegment(0, nxl), @@ -482,28 +482,28 @@ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, [=] DEVICE_FUNC (int i, int j, int k) { /* shortcuts to u, v, w for the block */ - const realtype u = Yview(i,j,k,0); - const realtype v = Yview(i,j,k,1); - const realtype w = Yview(i,j,k,2); + const sunrealtype u = Yview(i,j,k,0); + const sunrealtype v = Yview(i,j,k,1); + const sunrealtype w = Yview(i,j,k,2); // // compute dg/dy // /* 1st row: u, v, w */ - realtype A0 = -k2 * w + 2.0 * k3 * u * v - k4; - realtype A1 = k3 * u * u; - realtype A2 = -k2 * u; + sunrealtype A0 = -k2 * w + 2.0 * k3 * u * v - k4; + sunrealtype A1 = k3 * u * u; + sunrealtype A2 = -k2 * u; /* 2nd row: u, v, w */ - realtype A3 = k2 * w - 2.0 * k3 * u * v; - realtype A4 = -k3 * u * u; - realtype A5 = k2 * u; + sunrealtype A3 = k2 * w - 2.0 * k3 * u * v; + sunrealtype A4 = -k3 * u * u; + sunrealtype A5 = k2 * u; /* 3rd row: u, v, w */ - realtype A6 = -k2 * w; - realtype A7 = 0.0; - realtype A8 = -k2 * u - k6; + sunrealtype A6 = -k2 * w; + sunrealtype A7 = 0.0; + sunrealtype A8 = -k2 * u - k6; // // compute A = -dg/dy + gamma*diag(df/dydot) @@ -525,20 +525,20 @@ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, // compute x = A^{-1}b // - realtype scratch_0 = A4*A8; - realtype scratch_1 = A1*A5; - realtype scratch_2 = A2*A7; - realtype scratch_3 = A5*A7; - realtype scratch_4 = A1*A8; - realtype scratch_5 = A2*A4; - realtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); - realtype scratch_7 = A2*A3; - realtype scratch_8 = A6*Bview(i,j,k,0); - realtype scratch_9 = A2*A6; - realtype scratch_10 = A3*Bview(i,j,k,0); - realtype scratch_11 = 1.0/A0; - realtype scratch_12 = A1*scratch_11; - realtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); + sunrealtype scratch_0 = A4*A8; + sunrealtype scratch_1 = A1*A5; + sunrealtype scratch_2 = A2*A7; + sunrealtype scratch_3 = A5*A7; + sunrealtype scratch_4 = A1*A8; + sunrealtype scratch_5 = A2*A4; + sunrealtype scratch_6 = 1.0/(A0*scratch_0 - A0*scratch_3 + A3*scratch_2 - A3*scratch_4 + A6*scratch_1 - A6*scratch_5); + sunrealtype scratch_7 = A2*A3; + sunrealtype scratch_8 = A6*Bview(i,j,k,0); + sunrealtype scratch_9 = A2*A6; + sunrealtype scratch_10 = A3*Bview(i,j,k,0); + sunrealtype scratch_11 = 1.0/A0; + sunrealtype scratch_12 = A1*scratch_11; + sunrealtype scratch_13 = (-A6*scratch_12 + A7)/(-A3*scratch_12 + A4); Xview(i,j,k,0) = scratch_6*( Bview(i,j,k,0)*(scratch_0 - scratch_3) + Bview(i,j,k,1)*(scratch_2 - scratch_4) @@ -561,8 +561,8 @@ static int SolveReactionLinSysRes(N_Vector y, N_Vector x, N_Vector b, * --------------------------------------------------------------*/ /* Solves Pz = r where P = I - gamma * dg/dy */ -static int PSolve(realtype t, N_Vector y, N_Vector ydot, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { /* local variables */ @@ -578,8 +578,8 @@ static int PSolve(realtype t, N_Vector y, N_Vector ydot, N_Vector r, } /* Solves Pz = r where P = -dg/dy + gamma */ -static int PSolveRes(realtype t, N_Vector y, N_Vector ydot, N_Vector F, - N_Vector r, N_Vector z, realtype cj, realtype delta, +static int PSolveRes(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector F, + N_Vector r, N_Vector z, sunrealtype cj, sunrealtype delta, void *user_data) { /* local variables */ diff --git a/benchmarks/diffusion_2D/README.md b/benchmarks/diffusion_2D/README.md index 453879953f..407eaaa8d9 100644 --- a/benchmarks/diffusion_2D/README.md +++ b/benchmarks/diffusion_2D/README.md @@ -56,24 +56,24 @@ listed below. | `--npy ` | Number of MPI tasks in the y-direction (0 forces MPI to decide) | 0 | | `--nx ` | Number of mesh points in the x-direction | 32 | | `--ny ` | Number of mesh points in the y-direction | 32 | -| `--xu ` | The domain upper bound in the x-direction $x_{\text{max}}$ | 1.0 | -| `--yu ` | The domain upper bound in the y-direction $y_{\text{max}}$ | 1.0 | -| `--kx ` | Diffusion coefficient in the x-direction $k_x$ | 1.0 | -| `--ky ` | Diffusion coefficient in the y-direction $k_y$ | 1.0 | -| `--tf ` | The final time `tf` | 1.0 | +| `--xu ` | The domain upper bound in the x-direction $x_{\text{max}}$ | 1.0 | +| `--yu ` | The domain upper bound in the y-direction $y_{\text{max}}$ | 1.0 | +| `--kx ` | Diffusion coefficient in the x-direction $k_x$ | 1.0 | +| `--ky ` | Diffusion coefficient in the y-direction $k_y$ | 1.0 | +| `--tf ` | The final time `tf` | 1.0 | | `--noforcing` | Disable the forcing term | Enabled | | Output Options | | | | `--output ` | Output level: `0` no output, `1` output progress and stats, `2` write solution to disk | 1 | | `--nout ` | Number of output times | 20 | | Common Integrator and Solver Options | | | -| `--rtol ` | Relative tolerance | 1e-5 | -| `--atol ` | Absolute tolerance | 1e-10 | +| `--rtol ` | Relative tolerance | 1e-5 | +| `--atol ` | Absolute tolerance | 1e-10 | | `--maxsteps ` | Max number of steps between outputs (0 uses the integrator default) | 0 | | `--onstep ` | Number of steps to run using `ONE_STEP` mode for debugging (0 uses `NORMAL` mode) | 0 | | `--ls ` | Linear solver: CG, GMRES, or SuperLU_DIST | cg | | `--lsinfo` | Output linear solver diagnostics | Off | | `--liniters ` | Number of linear iterations | 20 | -| `--epslin ` | Linear solve tolerance factor (0 uses the integrator default) | 0 | +| `--epslin ` | Linear solve tolerance factor (0 uses the integrator default) | 0 | | `--msbp ` | The linear solver setup frequency (CVODE and ARKODE only, 0 uses the integrator default) | 0 | | Additional ARKODE Options | | | | `--order ` | Methods order | 3 | diff --git a/benchmarks/diffusion_2D/diffusion_2D.cpp b/benchmarks/diffusion_2D/diffusion_2D.cpp index f8365b3a02..34d151c6b9 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.cpp +++ b/benchmarks/diffusion_2D/diffusion_2D.cpp @@ -22,7 +22,7 @@ #if defined(BENCHMARK_ODE) -int diffusion(realtype t, N_Vector u, N_Vector f, void *user_data) +int diffusion(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { // Access problem data UserData *udata = (UserData *) user_data; @@ -37,7 +37,7 @@ int diffusion(realtype t, N_Vector u, N_Vector f, void *user_data) return 0; } -int diffusion_jac(realtype t, N_Vector u, N_Vector f, SUNMatrix Jac, +int diffusion_jac(sunrealtype t, N_Vector u, N_Vector f, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Access problem data @@ -60,7 +60,7 @@ int diffusion_jac(realtype t, N_Vector u, N_Vector f, SUNMatrix Jac, #elif defined(BENCHMARK_DAE) -int diffusion(realtype t, N_Vector u, N_Vector up, N_Vector res, +int diffusion(sunrealtype t, N_Vector u, N_Vector up, N_Vector res, void *user_data) { // Access problem data @@ -79,7 +79,7 @@ int diffusion(realtype t, N_Vector u, N_Vector up, N_Vector res, return 0; } -int diffusion_jac(realtype t, realtype cj, N_Vector u, N_Vector up, +int diffusion_jac(sunrealtype t, sunrealtype cj, N_Vector u, N_Vector up, N_Vector res, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -708,7 +708,7 @@ int UserOutput::open(UserData *udata) if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << endl; if (error) { @@ -756,7 +756,7 @@ int UserOutput::open(UserData *udata) uoutstream << "# je " << udata->je << endl; uoutstream << scientific; - uoutstream << setprecision(numeric_limits::digits10); + uoutstream << setprecision(numeric_limits::digits10); if (error) { @@ -785,7 +785,7 @@ int UserOutput::open(UserData *udata) eoutstream << "# je " << udata->je << endl; eoutstream << scientific; - eoutstream << setprecision(numeric_limits::digits10); + eoutstream << setprecision(numeric_limits::digits10); } } @@ -793,10 +793,10 @@ int UserOutput::open(UserData *udata) } -int UserOutput::write(realtype t, N_Vector u, UserData *udata) +int UserOutput::write(sunrealtype t, N_Vector u, UserData *udata) { int flag; - realtype max; + sunrealtype max; bool outproc = (udata->myid_c == 0); if (output > 0) @@ -812,7 +812,7 @@ int UserOutput::write(realtype t, N_Vector u, UserData *udata) } // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -834,7 +834,7 @@ int UserOutput::write(realtype t, N_Vector u, UserData *udata) flag = CopyDataFromDevice(u); if (check_flag(&flag, "CopyDataFromDevice", 1)) return -1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; uoutstream << t << " "; @@ -851,7 +851,7 @@ int UserOutput::write(realtype t, N_Vector u, UserData *udata) if (check_flag(&flag, "CopyDataFromDevice", 1)) return -1; // Output error to disk - realtype *earray = N_VGetArrayPointer(error); + sunrealtype *earray = N_VGetArrayPointer(error); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; eoutstream << t << " "; @@ -912,7 +912,7 @@ int UserOutput::close(UserData *udata) // ----------------------------------------------------------------------------- // Compute the solution error -int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); diff --git a/benchmarks/diffusion_2D/diffusion_2D.hpp b/benchmarks/diffusion_2D/diffusion_2D.hpp index eabffd487b..ea7159e53f 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.hpp +++ b/benchmarks/diffusion_2D/diffusion_2D.hpp @@ -70,20 +70,20 @@ struct UserData SUNProfiler prof = NULL; // Diffusion coefficients in the x and y directions - realtype kx = ONE; - realtype ky = ONE; + sunrealtype kx = ONE; + sunrealtype ky = ONE; // Enable/disable forcing bool forcing = true; // Final time - realtype tf = ONE; + sunrealtype tf = ONE; // Lower and Upper bounds in x and y directions - realtype xl = ZERO; - realtype yl = ZERO; - realtype xu = ONE; - realtype yu = ONE; + sunrealtype xl = ZERO; + sunrealtype yl = ZERO; + sunrealtype xu = ONE; + sunrealtype yu = ONE; // Global number of nodes in the x and y directions sunindextype nx = 32; @@ -93,8 +93,8 @@ struct UserData sunindextype nodes = nx * ny; // Mesh spacing in the x and y directions - realtype dx = xu / (nx - 1); - realtype dy = yu / (ny - 1); + sunrealtype dx = xu / (nx - 1); + sunrealtype dy = yu / (ny - 1); // Minimum number of local nodes in the x and y directions sunindextype qx = 0; @@ -141,10 +141,10 @@ struct UserData int ipN = -1; // Receive buffers for neighbor exchange - realtype *Wrecv = NULL; - realtype *Erecv = NULL; - realtype *Srecv = NULL; - realtype *Nrecv = NULL; + sunrealtype *Wrecv = NULL; + sunrealtype *Erecv = NULL; + sunrealtype *Srecv = NULL; + sunrealtype *Nrecv = NULL; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -153,10 +153,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend = NULL; - realtype *Esend = NULL; - realtype *Ssend = NULL; - realtype *Nsend = NULL; + sunrealtype *Wsend = NULL; + sunrealtype *Esend = NULL; + sunrealtype *Ssend = NULL; + sunrealtype *Nsend = NULL; // Send requests for neighor exchange MPI_Request reqSW; @@ -204,7 +204,7 @@ struct UserOutput // Output functions int open(UserData* udata); - int write(realtype t, N_Vector u, UserData *udata); + int write(sunrealtype t, N_Vector u, UserData *udata); int close(UserData* udata); }; @@ -213,7 +213,7 @@ struct UserOutput // ----------------------------------------------------------------------------- // Common function for computing the Laplacian -int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata); +int laplacian(sunrealtype t, N_Vector u, N_Vector f, UserData* udata); #if defined(BENCHMARK_ODE) @@ -222,17 +222,17 @@ int laplacian_matrix_sludist(N_Vector u, SUNMatrix L, UserData* udata); #endif // ODE right hand side function -int diffusion(realtype t, N_Vector u, N_Vector f, void *user_data); +int diffusion(sunrealtype t, N_Vector u, N_Vector f, void *user_data); -int diffusion_jac(realtype t, N_Vector u, N_Vector f, SUNMatrix Jac, +int diffusion_jac(sunrealtype t, N_Vector u, N_Vector f, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Preconditioner setup and solve functions -int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); #elif defined(BENCHMARK_DAE) @@ -243,19 +243,19 @@ int laplacian_matrix_sludist(N_Vector u, sunrealtype cj, SUNMatrix L, #endif // DAE residual function -int diffusion(realtype t, N_Vector u, N_Vector up, N_Vector res, +int diffusion(sunrealtype t, N_Vector u, N_Vector up, N_Vector res, void *user_data); -int diffusion_jac(realtype t, realtype cj, N_Vector u, N_Vector up, +int diffusion_jac(sunrealtype t, sunrealtype cj, N_Vector u, N_Vector up, N_Vector res, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Preconditioner setup and solve functions -int PSetup(realtype t, N_Vector u, N_Vector up, N_Vector res, realtype cj, +int PSetup(sunrealtype t, N_Vector u, N_Vector up, N_Vector res, sunrealtype cj, void *user_data); -int PSolve(realtype t, N_Vector u, N_Vector up, N_Vector res, N_Vector r, - N_Vector z, realtype cj, realtype delta, void *user_data); +int PSolve(sunrealtype t, N_Vector u, N_Vector up, N_Vector res, N_Vector r, + N_Vector z, sunrealtype cj, sunrealtype delta, void *user_data); #else #error "Missing ODE/DAE preprocessor directive" @@ -272,11 +272,11 @@ int DeviceSynchronize(); int CopyDataFromDevice(N_Vector y); // Compute the true solution and its derivative -int Solution(realtype t, N_Vector u, UserData *udata); -int SolutionDerivative(realtype t, N_Vector up, UserData *udata); +int Solution(sunrealtype t, N_Vector u, UserData *udata); +int SolutionDerivative(sunrealtype t, N_Vector up, UserData *udata); // Compute the solution error -int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Check function return values int check_flag(void *flagvalue, const string funcname, int opt); diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index 2c6e549360..33984002a9 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -20,9 +20,9 @@ struct UserOptions { // Integrator settings - realtype rtol = RCONST(1.0e-5); // relative tolerance - realtype atol = RCONST(1.0e-10); // absolute tolerance - realtype hfixed = ZERO; // fixed step size + sunrealtype rtol = RCONST(1.0e-5); // relative tolerance + sunrealtype atol = RCONST(1.0e-10); // absolute tolerance + sunrealtype hfixed = ZERO; // fixed step size int order = 3; // ARKode method order int controller = 0; // step size adaptivity method int maxsteps = 0; // max steps between outputs @@ -36,7 +36,7 @@ struct UserOptions bool lsinfo = false; // output residual history int liniters = 20; // number of linear iterations int msbp = 0; // preconditioner setup frequency - realtype epslin = ZERO; // linear solver tolerance factor + sunrealtype epslin = ZERO; // linear solver tolerance factor // Helper functions int parse_args(vector &args, bool outproc); @@ -226,7 +226,7 @@ int main(int argc, char* argv[]) // Create arrays for CSR matrix: data, column indices, and row pointers sunindextype nnz_loc = 5 * udata.nodes_loc; - A_data = (realtype*)malloc(nnz_loc * sizeof(sunrealtype)); + A_data = (sunrealtype*)malloc(nnz_loc * sizeof(sunrealtype)); if (check_flag((void*)A_data, "malloc Adata", 0)) return 1; A_col_idxs = (sunindextype*)malloc(nnz_loc * sizeof(sunindextype)); @@ -364,9 +364,9 @@ int main(int argc, char* argv[]) stepmode = ARK_ONE_STEP; } - realtype t = ZERO; - realtype dTout = udata.tf / uout.nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / uout.nout; + sunrealtype tout = dTout; // Inital output flag = uout.open(&udata); diff --git a/benchmarks/diffusion_2D/main_cvode.cpp b/benchmarks/diffusion_2D/main_cvode.cpp index 77a917970d..c28239842e 100644 --- a/benchmarks/diffusion_2D/main_cvode.cpp +++ b/benchmarks/diffusion_2D/main_cvode.cpp @@ -20,8 +20,8 @@ struct UserOptions { // Integrator settings - realtype rtol = RCONST(1.0e-5); // relative tolerance - realtype atol = RCONST(1.0e-10); // absolute tolerance + sunrealtype rtol = RCONST(1.0e-5); // relative tolerance + sunrealtype atol = RCONST(1.0e-10); // absolute tolerance int maxsteps = 0; // max steps between outputs int onestep = 0; // one step mode, number of steps @@ -31,7 +31,7 @@ struct UserOptions bool lsinfo = false; // output residual history int liniters = 20; // number of linear iterations int msbp = 0; // preconditioner setup frequency - realtype epslin = ZERO; // linear solver tolerance factor + sunrealtype epslin = ZERO; // linear solver tolerance factor // Helper functions int parse_args(vector &args, bool outproc); @@ -221,7 +221,7 @@ int main(int argc, char* argv[]) // Create arrays for CSR matrix: data, column indices, and row pointers sunindextype nnz_loc = 5 * udata.nodes_loc; - A_data = (realtype*)malloc(nnz_loc * sizeof(sunrealtype)); + A_data = (sunrealtype*)malloc(nnz_loc * sizeof(sunrealtype)); if (check_flag((void*)A_data, "malloc Adata", 0)) return 1; A_col_idxs = (sunindextype*)malloc(nnz_loc * sizeof(sunindextype)); @@ -337,9 +337,9 @@ int main(int argc, char* argv[]) stepmode = CV_ONE_STEP; } - realtype t = ZERO; - realtype dTout = udata.tf / uout.nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / uout.nout; + sunrealtype tout = dTout; // Inital output flag = uout.open(&udata); diff --git a/benchmarks/diffusion_2D/main_ida.cpp b/benchmarks/diffusion_2D/main_ida.cpp index d34dc81948..43313b1edd 100644 --- a/benchmarks/diffusion_2D/main_ida.cpp +++ b/benchmarks/diffusion_2D/main_ida.cpp @@ -20,8 +20,8 @@ struct UserOptions { // Integrator settings - realtype rtol = RCONST(1.0e-5); // relative tolerance - realtype atol = RCONST(1.0e-10); // absolute tolerance + sunrealtype rtol = RCONST(1.0e-5); // relative tolerance + sunrealtype atol = RCONST(1.0e-10); // absolute tolerance int maxsteps = 0; // max steps between outputs int onestep = 0; // one step mode, number of steps @@ -30,7 +30,7 @@ struct UserOptions bool preconditioning = true; // preconditioner on/off bool lsinfo = false; // output residual history int liniters = 20; // number of linear iterations - realtype epslin = ZERO; // linear solver tolerance factor + sunrealtype epslin = ZERO; // linear solver tolerance factor // Helper functions int parse_args(vector &args, bool outproc); @@ -226,7 +226,7 @@ int main(int argc, char* argv[]) // Create arrays for CSR matrix: data, column indices, and row pointers sunindextype nnz_loc = 5 * udata.nodes_loc; - A_data = (realtype*)malloc(nnz_loc * sizeof(sunrealtype)); + A_data = (sunrealtype*)malloc(nnz_loc * sizeof(sunrealtype)); if (check_flag((void*)A_data, "malloc Adata", 0)) return 1; A_col_idxs = (sunindextype*)malloc(nnz_loc * sizeof(sunindextype)); @@ -333,9 +333,9 @@ int main(int argc, char* argv[]) stepmode = IDA_ONE_STEP; } - realtype t = ZERO; - realtype dTout = udata.tf / uout.nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / uout.nout; + sunrealtype tout = dTout; // Inital output flag = uout.open(&udata); diff --git a/benchmarks/diffusion_2D/mpi_gpu/buffers.cpp b/benchmarks/diffusion_2D/mpi_gpu/buffers.cpp index adb3280e99..b639a80164 100644 --- a/benchmarks/diffusion_2D/mpi_gpu/buffers.cpp +++ b/benchmarks/diffusion_2D/mpi_gpu/buffers.cpp @@ -33,9 +33,9 @@ // Pack exchange buffers kernel __global__ void pack_buffers_kernel(const sunindextype nx_loc, const sunindextype ny_loc, - const realtype *u, - realtype *wbuf, realtype *ebuf, - realtype *sbuf, realtype *nbuf) + const sunrealtype *u, + sunrealtype *wbuf, sunrealtype *ebuf, + sunrealtype *sbuf, sunrealtype *nbuf) { // Thread ID int i = blockIdx.x * blockDim.x + threadIdx.x; @@ -60,7 +60,7 @@ __global__ void pack_buffers_kernel(const sunindextype nx_loc, int UserData::pack_buffers(const N_Vector u) { // Access data array - const realtype *uarray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(u)); + const sunrealtype *uarray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(u)); if (check_flag((void *) uarray, "N_VGetDeviceArrayPointer", 0)) return -1; sunindextype maxdim = max(nx_loc, ny_loc); @@ -80,11 +80,11 @@ int UserData::allocate_buffers() if (HaveNbrW) { #if defined(USE_HIP) - hipMalloc(&Wrecv, ny_loc * sizeof(realtype)); - hipMalloc(&Wsend, ny_loc * sizeof(realtype)); + hipMalloc(&Wrecv, ny_loc * sizeof(sunrealtype)); + hipMalloc(&Wsend, ny_loc * sizeof(sunrealtype)); #elif defined(USE_CUDA) - cudaMalloc(&Wrecv, ny_loc * sizeof(realtype)); - cudaMalloc(&Wsend, ny_loc * sizeof(realtype)); + cudaMalloc(&Wrecv, ny_loc * sizeof(sunrealtype)); + cudaMalloc(&Wsend, ny_loc * sizeof(sunrealtype)); #else #error Define USE_CUDA or USE_HIP #endif @@ -93,11 +93,11 @@ int UserData::allocate_buffers() if (HaveNbrE) { #if defined(USE_HIP) - hipMalloc(&Erecv, ny_loc * sizeof(realtype)); - hipMalloc(&Esend, ny_loc * sizeof(realtype)); + hipMalloc(&Erecv, ny_loc * sizeof(sunrealtype)); + hipMalloc(&Esend, ny_loc * sizeof(sunrealtype)); #elif defined(USE_CUDA) - cudaMalloc(&Erecv, ny_loc * sizeof(realtype)); - cudaMalloc(&Esend, ny_loc * sizeof(realtype)); + cudaMalloc(&Erecv, ny_loc * sizeof(sunrealtype)); + cudaMalloc(&Esend, ny_loc * sizeof(sunrealtype)); #else #error Define USE_CUDA or USE_HIP #endif @@ -106,11 +106,11 @@ int UserData::allocate_buffers() if (HaveNbrS) { #if defined(USE_HIP) - hipMalloc(&Srecv, nx_loc * sizeof(realtype)); - hipMalloc(&Ssend, nx_loc * sizeof(realtype)); + hipMalloc(&Srecv, nx_loc * sizeof(sunrealtype)); + hipMalloc(&Ssend, nx_loc * sizeof(sunrealtype)); #elif defined(USE_CUDA) - cudaMalloc(&Srecv, nx_loc * sizeof(realtype)); - cudaMalloc(&Ssend, nx_loc * sizeof(realtype)); + cudaMalloc(&Srecv, nx_loc * sizeof(sunrealtype)); + cudaMalloc(&Ssend, nx_loc * sizeof(sunrealtype)); #else #error Define USE_CUDA or USE_HIP #endif @@ -119,11 +119,11 @@ int UserData::allocate_buffers() if (HaveNbrN) { #if defined(USE_HIP) - hipMalloc(&Nrecv, nx_loc * sizeof(realtype)); - hipMalloc(&Nsend, nx_loc * sizeof(realtype)); + hipMalloc(&Nrecv, nx_loc * sizeof(sunrealtype)); + hipMalloc(&Nsend, nx_loc * sizeof(sunrealtype)); #elif defined(USE_CUDA) - cudaMalloc(&Nrecv, nx_loc * sizeof(realtype)); - cudaMalloc(&Nsend, nx_loc * sizeof(realtype)); + cudaMalloc(&Nrecv, nx_loc * sizeof(sunrealtype)); + cudaMalloc(&Nsend, nx_loc * sizeof(sunrealtype)); #else #error Define USE_CUDA or USE_HIP #endif diff --git a/benchmarks/diffusion_2D/mpi_gpu/diffusion.cpp b/benchmarks/diffusion_2D/mpi_gpu/diffusion.cpp index 2043070b0e..13a2fd75dd 100644 --- a/benchmarks/diffusion_2D/mpi_gpu/diffusion.cpp +++ b/benchmarks/diffusion_2D/mpi_gpu/diffusion.cpp @@ -32,22 +32,22 @@ // Forcing device function -__device__ void add_forcing(const realtype t, - const realtype x, const realtype y, - const realtype kx, const realtype ky, - const sunindextype c, realtype *udot) +__device__ void add_forcing(const sunrealtype t, + const sunrealtype x, const sunrealtype y, + const sunrealtype kx, const sunrealtype ky, + const sunindextype c, sunrealtype *udot) { - realtype sin_sqr_x = sin(PI * x) * sin(PI * x); - realtype sin_sqr_y = sin(PI * y) * sin(PI * y); + sunrealtype sin_sqr_x = sin(PI * x) * sin(PI * x); + sunrealtype sin_sqr_y = sin(PI * y) * sin(PI * y); - realtype cos_sqr_x = cos(PI * x) * cos(PI * x); - realtype cos_sqr_y = cos(PI * y) * cos(PI * y); + sunrealtype cos_sqr_x = cos(PI * x) * cos(PI * x); + sunrealtype cos_sqr_y = cos(PI * y) * cos(PI * y); - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); - realtype bx = kx * TWO * PI * PI; - realtype by = ky * TWO * PI * PI; + sunrealtype bx = kx * TWO * PI * PI; + sunrealtype by = ky * TWO * PI * PI; udot[c] += -TWO * PI * sin_sqr_x * sin_sqr_y * sin_t_cos_t -bx * (cos_sqr_x - sin_sqr_x) * sin_sqr_y * cos_sqr_t @@ -56,17 +56,17 @@ __device__ void add_forcing(const realtype t, // Interior diffusion kernel -__global__ void diffusion_interior_kernel(const realtype t, - const realtype *u, - realtype *udot, +__global__ void diffusion_interior_kernel(const sunrealtype t, + const sunrealtype *u, + sunrealtype *udot, const sunindextype is, const sunindextype js, const sunindextype nx_loc, const sunindextype ny_loc, - const realtype dx, - const realtype dy, - const realtype kx, - const realtype ky, + const sunrealtype dx, + const sunrealtype dy, + const sunrealtype kx, + const sunrealtype ky, const bool forcing) { // Thread location in the local grid @@ -86,16 +86,16 @@ __global__ void diffusion_interior_kernel(const realtype t, int n = c + nx_loc; // Set diffusion term - realtype cx = kx / (dx * dx); - realtype cy = ky / (dy * dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = kx / (dx * dx); + sunrealtype cy = ky / (dy * dy); + sunrealtype cc = -TWO * (cx + cy); udot[c] = cc * u[c] + cx * (u[w] + u[e]) + cy * (u[s] + u[n]); if (forcing) { - realtype x = (is + i) * dx; - realtype y = (js + j) * dy; + sunrealtype x = (is + i) * dx; + sunrealtype y = (js + j) * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -104,30 +104,30 @@ __global__ void diffusion_interior_kernel(const realtype t, // Interior boundary kernel -__global__ void diffusion_boundary_kernel(const realtype t, - const realtype *u, - realtype *udot, +__global__ void diffusion_boundary_kernel(const sunrealtype t, + const sunrealtype *u, + sunrealtype *udot, const sunindextype is, const sunindextype js, const sunindextype nx_loc, const sunindextype ny_loc, - const realtype dx, - const realtype dy, - const realtype kx, - const realtype ky, + const sunrealtype dx, + const sunrealtype dy, + const sunrealtype kx, + const sunrealtype ky, const bool forcing, - const realtype *wbuf, - const realtype *ebuf, - const realtype *sbuf, - const realtype *nbuf) + const sunrealtype *wbuf, + const sunrealtype *ebuf, + const sunrealtype *sbuf, + const sunrealtype *nbuf) { // Thread ID int i = blockIdx.x * blockDim.x + threadIdx.x; // Set diffusion term - realtype cx = kx / (dx * dx); - realtype cy = ky / (dy * dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = kx / (dx * dx); + sunrealtype cy = ky / (dy * dy); + sunrealtype cc = -TWO * (cx + cy); // West and East faces excluding corners if (i > 0 && i < ny_loc - 1) @@ -146,8 +146,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = is * dx; - realtype y = (js + i) * dy; + sunrealtype x = is * dx; + sunrealtype y = (js + i) * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -172,8 +172,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = (is + nx_loc - 1) * dx; - realtype y = (js + i) * dy; + sunrealtype x = (is + nx_loc - 1) * dx; + sunrealtype y = (js + i) * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -204,8 +204,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = (is + i) * dx; - realtype y = js * dy; + sunrealtype x = (is + i) * dx; + sunrealtype y = js * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -230,8 +230,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = (is + i) * dx; - realtype y = (js + ny_loc - 1) * dy; + sunrealtype x = (is + i) * dx; + sunrealtype y = (js + ny_loc - 1) * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -262,8 +262,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = is * dx; - realtype y = js * dy; + sunrealtype x = is * dx; + sunrealtype y = js * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -288,8 +288,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = (is + nx_loc - 1) * dx; - realtype y = js * dy; + sunrealtype x = (is + nx_loc - 1) * dx; + sunrealtype y = js * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -314,8 +314,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = is * dx; - realtype y = (js + ny_loc - 1) * dy; + sunrealtype x = is * dx; + sunrealtype y = (js + ny_loc - 1) * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -340,8 +340,8 @@ __global__ void diffusion_boundary_kernel(const realtype t, if (forcing) { - realtype x = (is + nx_loc - 1) * dx; - realtype y = (js + ny_loc - 1) * dy; + sunrealtype x = (is + nx_loc - 1) * dx; + sunrealtype y = (js + ny_loc - 1) * dy; add_forcing(t, x, y, kx, ky, c, udot); } @@ -356,7 +356,7 @@ __global__ void diffusion_boundary_kernel(const realtype t, // Diffusion function -int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata) +int laplacian(sunrealtype t, N_Vector u, N_Vector f, UserData* udata) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -371,17 +371,17 @@ int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata) const sunindextype js = udata->js; const sunindextype nx_loc = udata->nx_loc; const sunindextype ny_loc = udata->ny_loc; - const realtype dx = udata->dx; - const realtype dy = udata->dy; - const realtype kx = udata->kx; - const realtype ky = udata->ky; + const sunrealtype dx = udata->dx; + const sunrealtype dy = udata->dy; + const sunrealtype kx = udata->kx; + const sunrealtype ky = udata->ky; const bool forcing = udata->forcing; // Access data arrays - const realtype *uarray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(u)); + const sunrealtype *uarray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(u)); if (check_flag((void *) uarray, "N_VGetDeviceArrayPointer", 0)) return -1; - realtype *farray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(f)); + sunrealtype *farray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(f)); if (check_flag((void *) farray, "N_VGetDeviceArrayPointer", 0)) return -1; // Update subdomain interior @@ -397,10 +397,10 @@ int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata) if (check_flag(&flag, "UserData::end_exchagne", 1)) return -1; // Update subdomain boundary - const realtype *Warray = (udata->HaveNbrW) ? udata->Wrecv : NULL; - const realtype *Earray = (udata->HaveNbrE) ? udata->Erecv : NULL; - const realtype *Sarray = (udata->HaveNbrS) ? udata->Srecv : NULL; - const realtype *Narray = (udata->HaveNbrN) ? udata->Nrecv : NULL; + const sunrealtype *Warray = (udata->HaveNbrW) ? udata->Wrecv : NULL; + const sunrealtype *Earray = (udata->HaveNbrE) ? udata->Erecv : NULL; + const sunrealtype *Sarray = (udata->HaveNbrS) ? udata->Srecv : NULL; + const sunrealtype *Narray = (udata->HaveNbrN) ? udata->Nrecv : NULL; sunindextype maxdim = max(nx_loc, ny_loc); dim3 bblock(BLOCK_SIZE); diff --git a/benchmarks/diffusion_2D/mpi_gpu/solution.cpp b/benchmarks/diffusion_2D/mpi_gpu/solution.cpp index 1dfd38c141..bafca2b739 100644 --- a/benchmarks/diffusion_2D/mpi_gpu/solution.cpp +++ b/benchmarks/diffusion_2D/mpi_gpu/solution.cpp @@ -32,13 +32,13 @@ // Compute the exact solution -__global__ void solution_kernel(const realtype t, realtype *u, +__global__ void solution_kernel(const sunrealtype t, sunrealtype *u, const sunindextype is, const sunindextype ie, const sunindextype js, const sunindextype je, const sunindextype nx, const sunindextype ny, const sunindextype nx_loc, const sunindextype ny_loc, - const realtype dx, const realtype dy) + const sunrealtype dx, const sunrealtype dy) { // Thread location in the local grid int i = blockIdx.x * blockDim.x + threadIdx.x; @@ -54,12 +54,12 @@ __global__ void solution_kernel(const realtype t, realtype *u, } else { - realtype x = (is + i) * dx; - realtype y = (js + j) * dy; + sunrealtype x = (is + i) * dx; + sunrealtype y = (js + j) * dy; - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); - realtype sin_sqr_x = sin(PI * x) * sin(PI * x); - realtype sin_sqr_y = sin(PI * y) * sin(PI * y); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_sqr_x = sin(PI * x) * sin(PI * x); + sunrealtype sin_sqr_y = sin(PI * y) * sin(PI * y); u[i + j * nx_loc] = sin_sqr_x * sin_sqr_y * cos_sqr_t; } @@ -68,13 +68,13 @@ __global__ void solution_kernel(const realtype t, realtype *u, // Compute the exact solution derivative -__global__ void solution_p_kernel(const realtype t, realtype *up, +__global__ void solution_p_kernel(const sunrealtype t, sunrealtype *up, const sunindextype is, const sunindextype ie, const sunindextype js, const sunindextype je, const sunindextype nx, const sunindextype ny, const sunindextype nx_loc, const sunindextype ny_loc, - const realtype dx, const realtype dy) + const sunrealtype dx, const sunrealtype dy) { // Thread location in the local grid int i = blockIdx.x * blockDim.x + threadIdx.x; @@ -90,12 +90,12 @@ __global__ void solution_p_kernel(const realtype t, realtype *up, } else { - realtype x = (is + i) * dx; - realtype y = (js + j) * dy; + sunrealtype x = (is + i) * dx; + sunrealtype y = (js + j) * dy; - realtype cos_sin_t = -TWO * PI * cos(PI * t) * sin(PI * t); - realtype sin_sqr_x = sin(PI * x) * sin(PI * x); - realtype sin_sqr_y = sin(PI * y) * sin(PI * y); + sunrealtype cos_sin_t = -TWO * PI * cos(PI * t) * sin(PI * t); + sunrealtype sin_sqr_x = sin(PI * x) * sin(PI * x); + sunrealtype sin_sqr_y = sin(PI * y) * sin(PI * y); up[i + j * nx_loc] = sin_sqr_x * sin_sqr_y * cos_sin_t; } @@ -104,7 +104,7 @@ __global__ void solution_p_kernel(const realtype t, realtype *up, // Compute the exact solution -int Solution(realtype t, N_Vector u, UserData *udata) +int Solution(sunrealtype t, N_Vector u, UserData *udata) { // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, u); @@ -118,10 +118,10 @@ int Solution(realtype t, N_Vector u, UserData *udata) const sunindextype ny = udata->ny; const sunindextype nx_loc = udata->nx_loc; const sunindextype ny_loc = udata->ny_loc; - const realtype dx = udata->dx; - const realtype dy = udata->dy; + const sunrealtype dx = udata->dx; + const sunrealtype dy = udata->dy; - realtype *uarray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(u)); + sunrealtype *uarray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(u)); if (check_flag((void *) uarray, "N_VGetDeviceArrayPointer", 0)) return -1; dim3 block(BLOCK_SIZE_X, BLOCK_SIZE_Y); @@ -135,7 +135,7 @@ int Solution(realtype t, N_Vector u, UserData *udata) // Compute the exact solution derivative -int SolutionDerivative(realtype t, N_Vector up, UserData *udata) +int SolutionDerivative(sunrealtype t, N_Vector up, UserData *udata) { // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, up); @@ -149,10 +149,10 @@ int SolutionDerivative(realtype t, N_Vector up, UserData *udata) const sunindextype ny = udata->ny; const sunindextype nx_loc = udata->nx_loc; const sunindextype ny_loc = udata->ny_loc; - const realtype dx = udata->dx; - const realtype dy = udata->dy; + const sunrealtype dx = udata->dx; + const sunrealtype dy = udata->dy; - realtype *uparray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(up)); + sunrealtype *uparray = N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(up)); if (check_flag((void *) uparray, "N_VGetDeviceArrayPointer", 0)) return -1; dim3 block(BLOCK_SIZE_X, BLOCK_SIZE_Y); diff --git a/benchmarks/diffusion_2D/mpi_serial/buffers.cpp b/benchmarks/diffusion_2D/mpi_serial/buffers.cpp index 8c68483510..6b54361711 100644 --- a/benchmarks/diffusion_2D/mpi_serial/buffers.cpp +++ b/benchmarks/diffusion_2D/mpi_serial/buffers.cpp @@ -20,7 +20,7 @@ int UserData::pack_buffers(const N_Vector u) { // Access data array - const realtype *uarray = N_VGetArrayPointer(u); + const sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; if (HaveNbrW) @@ -48,26 +48,26 @@ int UserData::allocate_buffers() { if (HaveNbrW) { - Wrecv = new realtype[ny_loc]; - Wsend = new realtype[ny_loc]; + Wrecv = new sunrealtype[ny_loc]; + Wsend = new sunrealtype[ny_loc]; } if (HaveNbrE) { - Erecv = new realtype[ny_loc]; - Esend = new realtype[ny_loc]; + Erecv = new sunrealtype[ny_loc]; + Esend = new sunrealtype[ny_loc]; } if (HaveNbrS) { - Srecv = new realtype[nx_loc]; - Ssend = new realtype[nx_loc]; + Srecv = new sunrealtype[nx_loc]; + Ssend = new sunrealtype[nx_loc]; } if (HaveNbrN) { - Nrecv = new realtype[nx_loc]; - Nsend = new realtype[nx_loc]; + Nrecv = new sunrealtype[nx_loc]; + Nsend = new sunrealtype[nx_loc]; } return 0; diff --git a/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp b/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp index 98724f7963..52d0f503ca 100644 --- a/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp +++ b/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp @@ -17,7 +17,7 @@ #include "diffusion_2D.hpp" // Diffusion function -int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata) +int laplacian(sunrealtype t, N_Vector u, N_Vector f, UserData* udata) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -39,15 +39,15 @@ int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -56,15 +56,15 @@ int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -104,10 +104,10 @@ int laplacian(realtype t, N_Vector u, N_Vector f, UserData* udata) if (check_flag(&flag, "UserData::end_excahnge", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) diff --git a/benchmarks/diffusion_2D/mpi_serial/solution.cpp b/benchmarks/diffusion_2D/mpi_serial/solution.cpp index 39639b68b6..c0b7326ea7 100644 --- a/benchmarks/diffusion_2D/mpi_serial/solution.cpp +++ b/benchmarks/diffusion_2D/mpi_serial/solution.cpp @@ -17,16 +17,16 @@ #include "diffusion_2D.hpp" // Compute the exact solution -int Solution(realtype t, N_Vector u, UserData *udata) +int Solution(sunrealtype t, N_Vector u, UserData *udata) { // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, u); - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); // Iterative over domain interior sunindextype istart = (udata->HaveNbrW) ? 0 : 1; @@ -35,7 +35,7 @@ int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -57,16 +57,16 @@ int Solution(realtype t, N_Vector u, UserData *udata) // Compute the exact solution derivative -int SolutionDerivative(realtype t, N_Vector up, UserData *udata) +int SolutionDerivative(sunrealtype t, N_Vector up, UserData *udata) { // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, up); - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution - realtype cos_sin_t = -TWO * PI * cos(PI * t) * sin(PI * t); + sunrealtype cos_sin_t = -TWO * PI * cos(PI * t) * sin(PI * t); // Iterative over domain interior sunindextype istart = (udata->HaveNbrW) ? 0 : 1; @@ -75,7 +75,7 @@ int SolutionDerivative(realtype t, N_Vector up, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uparray = N_VGetArrayPointer(up); + sunrealtype *uparray = N_VGetArrayPointer(up); if (check_flag((void *) uparray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) diff --git a/benchmarks/diffusion_2D/preconditioner_jacobi.cpp b/benchmarks/diffusion_2D/preconditioner_jacobi.cpp index b30c00bfde..f919bcd569 100644 --- a/benchmarks/diffusion_2D/preconditioner_jacobi.cpp +++ b/benchmarks/diffusion_2D/preconditioner_jacobi.cpp @@ -19,8 +19,8 @@ #if defined(BENCHMARK_ODE) // Preconditioner setup routine -int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Access problem data UserData *udata = (UserData *) user_data; @@ -28,13 +28,13 @@ int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, SUNDIALS_CXX_MARK_FUNCTION(udata->prof); // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Set all entries of d to the inverse diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE / (ONE - gamma * cc); + sunrealtype c = ONE / (ONE - gamma * cc); N_VConst(c, udata->diag); @@ -44,8 +44,8 @@ int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, // Preconditioner solve routine for Pz = r -int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { // Access user_data structure @@ -64,7 +64,7 @@ int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, #elif defined(BENCHMARK_DAE) // Preconditioner setup and solve functions -int PSetup(realtype t, N_Vector u, N_Vector up, N_Vector res, realtype cj, +int PSetup(sunrealtype t, N_Vector u, N_Vector up, N_Vector res, sunrealtype cj, void *user_data) { // Access problem data @@ -73,13 +73,13 @@ int PSetup(realtype t, N_Vector u, N_Vector up, N_Vector res, realtype cj, SUNDIALS_CXX_MARK_FUNCTION(udata->prof); // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Set all entries of d to the inverse diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE / (cj - cc); + sunrealtype c = ONE / (cj - cc); N_VConst(c, udata->diag); @@ -88,8 +88,8 @@ int PSetup(realtype t, N_Vector u, N_Vector up, N_Vector res, realtype cj, } -int PSolve(realtype t, N_Vector u, N_Vector up, N_Vector res, N_Vector r, - N_Vector z, realtype cj, realtype delta, void *user_data) +int PSolve(sunrealtype t, N_Vector u, N_Vector up, N_Vector res, N_Vector r, + N_Vector z, sunrealtype cj, sunrealtype delta, void *user_data) { // Access user_data structure UserData *udata = (UserData *) user_data; diff --git a/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu b/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu index 2d806be195..68dd937620 100644 --- a/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu +++ b/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu @@ -30,22 +30,22 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* h_data; /* host data */ -static realtype* h_sum; /* host sum */ -static realtype* d_data; /* device data */ -static realtype* d_sum; /* device sum */ +static sunrealtype* h_data; /* host data */ +static sunrealtype* h_sum; /* host sum */ +static sunrealtype* d_data; /* device data */ +static sunrealtype* d_sum; /* device sum */ static int blocksPerGrid; /* cuda reduction kernel to clearing cache between tests */ __global__ -void ClearCacheKernel(sunindextype N, realtype* data, realtype* out) +void ClearCacheKernel(sunindextype N, sunrealtype* data, sunrealtype* out) { - __shared__ realtype shared[256]; + __shared__ sunrealtype shared[256]; int sharedidx = blockIdx.x; int tid = blockIdx.x * blockDim.x + threadIdx.x; - realtype tmp = 0; + sunrealtype tmp = 0; while (tid < N) { tmp += data[tid]; tid += blockDim.x * gridDim.x; @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { rand_realtype(N_VGetHostArrayPointer_Cuda(Xvec), Xlen, lower, upper); N_VCopyToDevice_Cuda(Xvec); @@ -249,24 +249,24 @@ static int InitializeClearCache(int cachesize) cudaError_t err; /* cuda error flag */ size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate host data */ blocksPerGrid = SUNMIN(32,(N+255)/256); - h_data = (realtype*) malloc(N*sizeof(realtype)); - h_sum = (realtype*) malloc(blocksPerGrid*sizeof(realtype)); + h_data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); + h_sum = (sunrealtype*) malloc(blocksPerGrid*sizeof(sunrealtype)); /* allocate device data */ - err = cudaMalloc((void**) &d_data, N*sizeof(realtype)); + err = cudaMalloc((void**) &d_data, N*sizeof(sunrealtype)); if (err != cudaSuccess) { fprintf(stderr,"Failed to allocate device vector (error code %d )!\n",err); return(-1); } - err = cudaMalloc((void**) &d_sum, blocksPerGrid*sizeof(realtype)); + err = cudaMalloc((void**) &d_sum, blocksPerGrid*sizeof(sunrealtype)); if (err != cudaSuccess) { fprintf(stderr,"Failed to allocate device vector (error code %d )!\n",err); return(-1); @@ -275,7 +275,7 @@ static int InitializeClearCache(int cachesize) /* fill host vector with random data and copy to device */ rand_realtype(h_data, N, RCONST(-1.0), RCONST(1.0)); - err = cudaMemcpy(d_data, h_data, N*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_data, h_data, N*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr,"Failed to copy data from host to device (error code %d )!\n",err); return(-1); @@ -310,7 +310,7 @@ void ClearCache() { /* call cuda kernel to clear the cache */ ClearCacheKernel<<>>(N, d_data, d_sum); - cudaMemcpy(h_sum, d_sum, blocksPerGrid*sizeof(realtype), cudaMemcpyDeviceToHost); + cudaMemcpy(h_sum, d_sum, blocksPerGrid*sizeof(sunrealtype), cudaMemcpyDeviceToHost); cudaDeviceSynchronize(); return; } diff --git a/benchmarks/nvector/hip/test_nvector_performance_hip.cpp b/benchmarks/nvector/hip/test_nvector_performance_hip.cpp index eeabb4b871..d944397d90 100644 --- a/benchmarks/nvector/hip/test_nvector_performance_hip.cpp +++ b/benchmarks/nvector/hip/test_nvector_performance_hip.cpp @@ -30,22 +30,22 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* h_data; /* host data */ -static realtype* h_sum; /* host sum */ -static realtype* d_data; /* device data */ -static realtype* d_sum; /* device sum */ +static sunrealtype* h_data; /* host data */ +static sunrealtype* h_sum; /* host sum */ +static sunrealtype* d_data; /* device data */ +static sunrealtype* d_sum; /* device sum */ static int blocksPerGrid; /* hip reduction kernel to clearing cache between tests */ __global__ -void ClearCacheKernel(sunindextype N, realtype* data, realtype* out) +void ClearCacheKernel(sunindextype N, sunrealtype* data, sunrealtype* out) { - __shared__ realtype shared[256]; + __shared__ sunrealtype shared[256]; int sharedidx = blockIdx.x; int tid = blockIdx.x * blockDim.x + threadIdx.x; - realtype tmp = 0; + sunrealtype tmp = 0; while (tid < N) { tmp += data[tid]; tid += blockDim.x * gridDim.x; @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { rand_realtype(N_VGetHostArrayPointer_Hip(Xvec), Xlen, lower, upper); N_VCopyToDevice_Hip(Xvec); @@ -249,24 +249,24 @@ static int InitializeClearCache(int cachesize) hipError_t err; /* hip error flag */ size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate host data */ blocksPerGrid = SUNMIN(32,(N+255)/256); - h_data = (realtype*) malloc(N*sizeof(realtype)); - h_sum = (realtype*) malloc(blocksPerGrid*sizeof(realtype)); + h_data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); + h_sum = (sunrealtype*) malloc(blocksPerGrid*sizeof(sunrealtype)); /* allocate device data */ - err = hipMalloc((void**) &d_data, N*sizeof(realtype)); + err = hipMalloc((void**) &d_data, N*sizeof(sunrealtype)); if (err != hipSuccess) { fprintf(stderr,"Failed to allocate device vector (error code %d )!\n",err); return(-1); } - err = hipMalloc((void**) &d_sum, blocksPerGrid*sizeof(realtype)); + err = hipMalloc((void**) &d_sum, blocksPerGrid*sizeof(sunrealtype)); if (err != hipSuccess) { fprintf(stderr,"Failed to allocate device vector (error code %d )!\n",err); return(-1); @@ -275,7 +275,7 @@ static int InitializeClearCache(int cachesize) /* fill host vector with random data and copy to device */ rand_realtype(h_data, N, RCONST(-1.0), RCONST(1.0)); - err = hipMemcpy(d_data, h_data, N*sizeof(realtype), hipMemcpyHostToDevice); + err = hipMemcpy(d_data, h_data, N*sizeof(sunrealtype), hipMemcpyHostToDevice); if (err != hipSuccess) { fprintf(stderr,"Failed to copy data from host to device (error code %d )!\n",err); return(-1); @@ -310,7 +310,7 @@ void ClearCache() { /* call hip kernel to clear the cache */ ClearCacheKernel<<>>(N, d_data, d_sum); - hipMemcpy(h_sum, d_sum, blocksPerGrid*sizeof(realtype), hipMemcpyDeviceToHost); + hipMemcpy(h_sum, d_sum, blocksPerGrid*sizeof(sunrealtype), hipMemcpyDeviceToHost); hipDeviceSynchronize(); return; } diff --git a/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c b/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c index 8fab63253a..6912310bfd 100644 --- a/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c +++ b/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c @@ -33,7 +33,7 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* data; /* host data */ +static sunrealtype* data; /* host data */ /* ---------------------------------------------------------------------- @@ -196,9 +196,9 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype(Xdata, Xlen, lower, upper); @@ -207,7 +207,7 @@ void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) /* series of 0 and 1 */ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_zero_one(Xdata, Xlen); @@ -216,7 +216,7 @@ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) /* random values for constraint array */ void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_constraints(Xdata, Xlen); @@ -258,12 +258,12 @@ static int InitializeClearCache(int cachesize) { size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate data and fill random values */ - data = (realtype*) malloc(N*sizeof(realtype)); + data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); return(0); @@ -277,7 +277,7 @@ static int FinalizeClearCache() void ClearCache() { - realtype sum; + sunrealtype sum; sunindextype i; sum = RCONST(0.0); diff --git a/benchmarks/nvector/openmp/test_nvector_performance_openmp.c b/benchmarks/nvector/openmp/test_nvector_performance_openmp.c index ec01e7d624..24df44ecca 100644 --- a/benchmarks/nvector/openmp/test_nvector_performance_openmp.c +++ b/benchmarks/nvector/openmp/test_nvector_performance_openmp.c @@ -31,7 +31,7 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* data; /* host data */ +static sunrealtype* data; /* host data */ /* ---------------------------------------------------------------------- @@ -179,9 +179,9 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype(Xdata, Xlen, lower, upper); @@ -190,7 +190,7 @@ void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) /* series of 0 and 1 */ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_zero_one(Xdata, Xlen); @@ -199,7 +199,7 @@ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) /* random values for constraint array */ void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_constraints(Xdata, Xlen); @@ -231,12 +231,12 @@ static int InitializeClearCache(int cachesize) { size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate data and fill random values */ - data = (realtype*) malloc(N*sizeof(realtype)); + data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); return(0); @@ -250,7 +250,7 @@ static int FinalizeClearCache() void ClearCache() { - realtype sum; + sunrealtype sum; sunindextype i; sum = RCONST(0.0); diff --git a/benchmarks/nvector/openmpdev/test_nvector_performance_openmpdev.c b/benchmarks/nvector/openmpdev/test_nvector_performance_openmpdev.c index db1494a741..f5ed4ef6bf 100644 --- a/benchmarks/nvector/openmpdev/test_nvector_performance_openmpdev.c +++ b/benchmarks/nvector/openmpdev/test_nvector_performance_openmpdev.c @@ -159,9 +159,9 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetHostArrayPointer_OpenMPDEV(Xvec); rand_realtype(Xdata, Xlen, lower, upper); @@ -171,7 +171,7 @@ void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) /* series of 0 and 1 */ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetHostArrayPointer_OpenMPDEV(Xvec); rand_realtype_zero_one(Xdata, Xlen); @@ -181,7 +181,7 @@ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) /* random values for constraint array */ void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetHostArrayPointer_OpenMPDEV(Xvec); rand_realtype_constraints(Xdata, Xlen); diff --git a/benchmarks/nvector/parallel/test_nvector_performance_parallel.c b/benchmarks/nvector/parallel/test_nvector_performance_parallel.c index 0ab1fa7f7c..6195c13541 100644 --- a/benchmarks/nvector/parallel/test_nvector_performance_parallel.c +++ b/benchmarks/nvector/parallel/test_nvector_performance_parallel.c @@ -31,7 +31,7 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* data; /* host data */ +static sunrealtype* data; /* host data */ /* ---------------------------------------------------------------------- @@ -193,9 +193,9 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype(Xdata, Xlen, lower, upper); @@ -204,7 +204,7 @@ void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) /* series of 0 and 1 */ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_zero_one(Xdata, Xlen); @@ -213,7 +213,7 @@ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) /* random values for constraint array */ void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_constraints(Xdata, Xlen); @@ -255,12 +255,12 @@ static int InitializeClearCache(int cachesize) { size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate data and fill random values */ - data = (realtype*) malloc(N*sizeof(realtype)); + data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); return(0); @@ -274,7 +274,7 @@ static int FinalizeClearCache() void ClearCache() { - realtype sum; + sunrealtype sum; sunindextype i; sum = RCONST(0.0); diff --git a/benchmarks/nvector/parhyp/test_nvector_performance_parhyp.c b/benchmarks/nvector/parhyp/test_nvector_performance_parhyp.c index f73f8f00ba..186bf63d9f 100644 --- a/benchmarks/nvector/parhyp/test_nvector_performance_parhyp.c +++ b/benchmarks/nvector/parhyp/test_nvector_performance_parhyp.c @@ -31,7 +31,7 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* data; /* host data */ +static sunrealtype* data; /* host data */ /* ---------------------------------------------------------------------- @@ -212,10 +212,10 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { HYPRE_ParVector Xhyp; - realtype *Xdata; + sunrealtype *Xdata; Xhyp = N_VGetVector_ParHyp(Xvec); Xdata = hypre_VectorData(hypre_ParVectorLocalVector(Xhyp)); @@ -226,7 +226,7 @@ void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) { HYPRE_ParVector Xhyp; - realtype *Xdata; + sunrealtype *Xdata; Xhyp = N_VGetVector_ParHyp(Xvec); Xdata = hypre_VectorData(hypre_ParVectorLocalVector(Xhyp)); @@ -237,7 +237,7 @@ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen) { HYPRE_ParVector Xhyp; - realtype *Xdata; + sunrealtype *Xdata; Xhyp = N_VGetVector_ParHyp(Xvec); Xdata = hypre_VectorData(hypre_ParVectorLocalVector(Xhyp)); @@ -280,12 +280,12 @@ static int InitializeClearCache(int cachesize) { size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate data and fill random values */ - data = (realtype*) malloc(N*sizeof(realtype)); + data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); return(0); @@ -299,7 +299,7 @@ static int FinalizeClearCache() void ClearCache() { - realtype sum; + sunrealtype sum; sunindextype i; sum = RCONST(0.0); diff --git a/benchmarks/nvector/petsc/test_nvector_performance_petsc.c b/benchmarks/nvector/petsc/test_nvector_performance_petsc.c index 0689354a96..85b19ca10f 100644 --- a/benchmarks/nvector/petsc/test_nvector_performance_petsc.c +++ b/benchmarks/nvector/petsc/test_nvector_performance_petsc.c @@ -32,7 +32,7 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* data; /* host data */ +static sunrealtype* data; /* host data */ /* ---------------------------------------------------------------------- @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { Vec Xpetsc; PetscScalar *Xdata; @@ -275,12 +275,12 @@ static int InitializeClearCache(int cachesize) { size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate data and fill random values */ - data = (realtype*) malloc(N*sizeof(realtype)); + data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); return(0); @@ -294,7 +294,7 @@ static int FinalizeClearCache() void ClearCache() { - realtype sum; + sunrealtype sum; sunindextype i; sum = RCONST(0.0); diff --git a/benchmarks/nvector/pthreads/test_nvector_performance_pthreads.c b/benchmarks/nvector/pthreads/test_nvector_performance_pthreads.c index fb446f32be..c5ee591d96 100644 --- a/benchmarks/nvector/pthreads/test_nvector_performance_pthreads.c +++ b/benchmarks/nvector/pthreads/test_nvector_performance_pthreads.c @@ -29,7 +29,7 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* data; /* host data */ +static sunrealtype* data; /* host data */ /* ---------------------------------------------------------------------- @@ -176,9 +176,9 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype(Xdata, Xlen, lower, upper); @@ -187,7 +187,7 @@ void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) /* series of 0 and 1 */ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_zero_one(Xdata, Xlen); @@ -196,7 +196,7 @@ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) /* random values for constraint array */ void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_constraints(Xdata, Xlen); @@ -228,12 +228,12 @@ static int InitializeClearCache(int cachesize) { size_t nbytes; /* cache size in bytes */ - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate data and fill random values */ - data = (realtype*) malloc(N*sizeof(realtype)); + data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); return(0); @@ -247,7 +247,7 @@ static int FinalizeClearCache() void ClearCache() { - realtype sum; + sunrealtype sum; sunindextype i; sum = RCONST(0.0); diff --git a/benchmarks/nvector/raja/test_nvector_performance_raja.cpp b/benchmarks/nvector/raja/test_nvector_performance_raja.cpp index 4228ee84ef..cbeebc396e 100644 --- a/benchmarks/nvector/raja/test_nvector_performance_raja.cpp +++ b/benchmarks/nvector/raja/test_nvector_performance_raja.cpp @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { rand_realtype(N_VGetHostArrayPointer_Raja(Xvec), Xlen, lower, upper); N_VCopyToDevice_Raja(Xvec); diff --git a/benchmarks/nvector/serial/test_nvector_performance_serial.c b/benchmarks/nvector/serial/test_nvector_performance_serial.c index d0427268a0..9f65f9c948 100644 --- a/benchmarks/nvector/serial/test_nvector_performance_serial.c +++ b/benchmarks/nvector/serial/test_nvector_performance_serial.c @@ -30,7 +30,7 @@ static int FinalizeClearCache(); /* private data for clearing cache */ static sunindextype N; /* data length */ -static realtype* data; /* host data */ +static sunrealtype* data; /* host data */ /* ---------------------------------------------------------------------- @@ -169,9 +169,9 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ /* random data between lower and upper */ -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype(Xdata, Xlen, lower, upper); @@ -180,7 +180,7 @@ void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) /* series of 0 and 1 */ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_zero_one(Xdata, Xlen); @@ -189,7 +189,7 @@ void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen) /* random values for constraint array */ void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen) { - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(Xvec); rand_realtype_constraints(Xdata, Xlen); @@ -228,12 +228,12 @@ static int InitializeClearCache(int cachesize) return 0; } - /* determine size of vector to clear cache, N = ceil(2 * nbytes/realtype) */ + /* determine size of vector to clear cache, N = ceil(2 * nbytes/sunrealtype) */ nbytes = (size_t) (2 * cachesize * 1024 * 1024); - N = (sunindextype) ((nbytes + sizeof(realtype) - 1)/sizeof(realtype)); + N = (sunindextype) ((nbytes + sizeof(sunrealtype) - 1)/sizeof(sunrealtype)); /* allocate data and fill random values */ - data = (realtype*) malloc(N*sizeof(realtype)); + data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); return(0); @@ -249,7 +249,7 @@ void ClearCache() { if (data) { - realtype sum; + sunrealtype sum; sunindextype i; sum = RCONST(0.0); diff --git a/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp b/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp index c90020e78a..456be8a915 100644 --- a/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp +++ b/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp @@ -206,7 +206,7 @@ int main(int argc, char *argv[]) * --------------------------------------------------------------------*/ // random data between lower and upper -void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper) +void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper) { rand_realtype(N_VGetHostArrayPointer_Sycl(Xvec), Xlen, lower, upper); N_VCopyToDevice_Sycl(Xvec); diff --git a/benchmarks/nvector/test_nvector_performance.c b/benchmarks/nvector/test_nvector_performance.c index ab069fcc88..e41abc8443 100644 --- a/benchmarks/nvector/test_nvector_performance.c +++ b/benchmarks/nvector/test_nvector_performance.c @@ -74,7 +74,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) double start_time, stop_time; double *times; double avgtime, sdevtime, mintime, maxtime; - realtype a, b; + sunrealtype a, b; int i; N_Vector Y, Z; @@ -137,7 +137,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) /* fill vector data */ N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); - a = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + a = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; ClearCache(); start_time = get_time(); @@ -205,7 +205,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) /* fill vector data */ N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); - b = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + b = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; ClearCache(); start_time = get_time(); @@ -298,7 +298,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - b = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + b = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; ClearCache(); start_time = get_time(); @@ -322,7 +322,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - a = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + a = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; ClearCache(); start_time = get_time(); @@ -346,7 +346,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - b = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + b = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; ClearCache(); start_time = get_time(); @@ -370,7 +370,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - a = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + a = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; ClearCache(); start_time = get_time(); @@ -394,7 +394,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - a = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + a = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; ClearCache(); start_time = get_time(); @@ -418,7 +418,7 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - a = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + a = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; b = -1.0*a; ClearCache(); @@ -443,8 +443,8 @@ int Test_N_VLinearSum(N_Vector X, sunindextype local_length, int ntests) N_VRand(X, local_length, NEG_ONE, ONE); N_VRand(Y, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - a = 2.0*((realtype)rand() / (realtype)RAND_MAX) - 1.0; - b = 2.0*((realtype)rand() / (realtype)RAND_MAX) - 1.0; + a = 2.0*((sunrealtype)rand() / (sunrealtype)RAND_MAX) - 1.0; + b = 2.0*((sunrealtype)rand() / (sunrealtype)RAND_MAX) - 1.0; ClearCache(); start_time = get_time(); @@ -476,13 +476,13 @@ int Test_N_VConst(N_Vector X, sunindextype local_length, int ntests) double start_time, stop_time; double *times; double avgtime, sdevtime, mintime, maxtime; - realtype c; + sunrealtype c; int i; times = (double*) malloc((ntests+nwarmups)*sizeof(double)); for (i=0; i < ntests+nwarmups; i++) { - c = 2.0*((realtype)rand() / (realtype)RAND_MAX) - 1.0; + c = 2.0*((sunrealtype)rand() / (sunrealtype)RAND_MAX) - 1.0; ClearCache(); start_time = get_time(); @@ -601,7 +601,7 @@ int Test_N_VScale(N_Vector X, sunindextype local_length, int ntests) double start_time, stop_time; double *times; double avgtime, sdevtime, mintime, maxtime; - realtype c; + sunrealtype c; int i; N_Vector Z; @@ -617,7 +617,7 @@ int Test_N_VScale(N_Vector X, sunindextype local_length, int ntests) for (i=0; i < ntests+nwarmups; i++) { /* fill vector data */ N_VRand(X, local_length, NEG_ONE, ONE); - c = 2.0*((realtype)rand() / (realtype)RAND_MAX) - 1.0; + c = 2.0*((sunrealtype)rand() / (sunrealtype)RAND_MAX) - 1.0; ClearCache(); start_time = get_time(); @@ -684,7 +684,7 @@ int Test_N_VScale(N_Vector X, sunindextype local_length, int ntests) /* fill vector data */ N_VRand(X, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - c = 2.0*((realtype)rand() / (realtype)RAND_MAX) - 1.0; + c = 2.0*((sunrealtype)rand() / (sunrealtype)RAND_MAX) - 1.0; ClearCache(); start_time = get_time(); @@ -799,7 +799,7 @@ int Test_N_VAddConst(N_Vector X, sunindextype local_length, int ntests) double start_time, stop_time; double *times; double avgtime, sdevtime, mintime, maxtime; - realtype c; + sunrealtype c; int i; N_Vector Z; @@ -812,7 +812,7 @@ int Test_N_VAddConst(N_Vector X, sunindextype local_length, int ntests) /* fill vector data */ N_VRand(X, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - c = 2.0*((realtype)rand() / (realtype)RAND_MAX) - 1.0; + c = 2.0*((sunrealtype)rand() / (sunrealtype)RAND_MAX) - 1.0; ClearCache(); start_time = get_time(); @@ -1123,7 +1123,7 @@ int Test_N_VCompare(N_Vector X, sunindextype local_length, int ntests) double start_time, stop_time; double *times; double avgtime, sdevtime, mintime, maxtime; - realtype c; + sunrealtype c; int i; N_Vector Z; @@ -1136,7 +1136,7 @@ int Test_N_VCompare(N_Vector X, sunindextype local_length, int ntests) /* fill vector data */ N_VRand(X, local_length, NEG_ONE, ONE); N_VConst(ZERO, Z); - c = ((realtype)rand() / (realtype)RAND_MAX); + c = ((sunrealtype)rand() / (sunrealtype)RAND_MAX); ClearCache(); start_time = get_time(); @@ -1303,7 +1303,7 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, double *ftimes, *utimes; int i, j; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector *Y; /* allocate timing arrays */ @@ -1311,7 +1311,7 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create additional nvectors and array of scaling factors */ - c = (realtype*) malloc(nvecs*sizeof(realtype)); + c = (sunrealtype*) malloc(nvecs*sizeof(sunrealtype)); Y = N_VCloneVectorArray(nvecs, X); /* @@ -1324,7 +1324,7 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, for (j=1; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* unfused operation */ @@ -1354,7 +1354,7 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, for (j=1; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* fused operation */ @@ -1381,12 +1381,12 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, */ /* fill vector data */ - c[0] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[0] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; N_VRand(Y[0], local_length, NEG_ONE, ONE); for (j=1; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* unfused operation */ @@ -1412,12 +1412,12 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, } /* fill vector data */ - c[0] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[0] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; N_VRand(Y[0], local_length, NEG_ONE, ONE); for (j=1; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* fused operation */ @@ -1446,7 +1446,7 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, /* fill vector data */ for (j=0; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* unfused operation */ @@ -1474,7 +1474,7 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int nvecs, /* fill vector data */ for (j=0; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* fused operation */ @@ -1516,7 +1516,7 @@ int Test_N_VScaleAddMulti(N_Vector X, sunindextype local_length, int nvecs, int double *ftimes, *utimes; int i, j; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector *Y, *Z; /* allocate timing arrays */ @@ -1524,7 +1524,7 @@ int Test_N_VScaleAddMulti(N_Vector X, sunindextype local_length, int nvecs, int utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create additional nvectors and array of scaling factors */ - c = (realtype*) malloc(nvecs*sizeof(realtype)); + c = (sunrealtype*) malloc(nvecs*sizeof(sunrealtype)); Y = N_VCloneVectorArray(nvecs, X); Z = N_VCloneVectorArray(nvecs, X); @@ -1536,7 +1536,7 @@ int Test_N_VScaleAddMulti(N_Vector X, sunindextype local_length, int nvecs, int N_VRand(X, local_length, NEG_ONE, ONE); for (j=0; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* unfused operation */ @@ -1556,7 +1556,7 @@ int Test_N_VScaleAddMulti(N_Vector X, sunindextype local_length, int nvecs, int N_VRand(X, local_length, NEG_ONE, ONE); for (j=0; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* fused operation */ @@ -1586,7 +1586,7 @@ int Test_N_VScaleAddMulti(N_Vector X, sunindextype local_length, int nvecs, int N_VRand(X, local_length, NEG_ONE, ONE); for (j=0; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* unfused operation */ @@ -1606,7 +1606,7 @@ int Test_N_VScaleAddMulti(N_Vector X, sunindextype local_length, int nvecs, int N_VRand(X, local_length, NEG_ONE, ONE); for (j=0; j < nvecs; j++) { N_VRand(Y[j], local_length, NEG_ONE, ONE); - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; } /* fused operation */ @@ -1649,7 +1649,7 @@ int Test_N_VDotProdMulti(N_Vector X, sunindextype local_length, int nvecs, int n double *ftimes, *utimes; int i, j; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector *Y; /* allocate timing arrays */ @@ -1657,7 +1657,7 @@ int Test_N_VDotProdMulti(N_Vector X, sunindextype local_length, int nvecs, int n utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create additional nvectors and array of dot products */ - c = (realtype*) malloc(nvecs*sizeof(realtype)); + c = (sunrealtype*) malloc(nvecs*sizeof(sunrealtype)); Y = N_VCloneVectorArray(nvecs, X); /* fill vector data */ @@ -1723,7 +1723,7 @@ int Test_N_VLinearSumVectorArray(N_Vector V, sunindextype local_length, double *ftimes, *utimes; int i, j; int ier = 0; - realtype a, b; + sunrealtype a, b; N_Vector *X, *Y, *Z; /* allocate timing arrays */ @@ -1740,8 +1740,8 @@ int Test_N_VLinearSumVectorArray(N_Vector V, sunindextype local_length, */ /* fill vector data */ - a = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; - b = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + a = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; + b = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nvecs; j++) { N_VRand(X[j], local_length, NEG_ONE, ONE); N_VRand(Y[j], local_length, NEG_ONE, ONE); @@ -1761,8 +1761,8 @@ int Test_N_VLinearSumVectorArray(N_Vector V, sunindextype local_length, } /* fill vector data */ - a = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; - b = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + a = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; + b = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nvecs; j++) { N_VRand(X[j], local_length, NEG_ONE, ONE); N_VRand(Y[j], local_length, NEG_ONE, ONE); @@ -1809,7 +1809,7 @@ int Test_N_VScaleVectorArray(N_Vector X, sunindextype local_length, double *ftimes, *utimes; int i, j; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector *Y, *Z; /* allocate timing arrays */ @@ -1817,7 +1817,7 @@ int Test_N_VScaleVectorArray(N_Vector X, sunindextype local_length, utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create nvectors arrays and scaling factor array */ - c = (realtype*) malloc(nvecs*sizeof(realtype)); + c = (sunrealtype*) malloc(nvecs*sizeof(sunrealtype)); Y = N_VCloneVectorArray(nvecs, X); Z = N_VCloneVectorArray(nvecs, X); @@ -1827,7 +1827,7 @@ int Test_N_VScaleVectorArray(N_Vector X, sunindextype local_length, /* fill vector data */ for (j=0; j < nvecs; j++) { - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; N_VRand(Y[j], local_length, NEG_ONE, ONE); } @@ -1846,7 +1846,7 @@ int Test_N_VScaleVectorArray(N_Vector X, sunindextype local_length, /* fill vector data */ for (j=0; j < nvecs; j++) { - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; N_VRand(Y[j], local_length, NEG_ONE, ONE); } @@ -1875,7 +1875,7 @@ int Test_N_VScaleVectorArray(N_Vector X, sunindextype local_length, /* fill vector data */ for (j=0; j < nvecs; j++) { - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; N_VRand(Y[j], local_length, NEG_ONE, ONE); } @@ -1894,7 +1894,7 @@ int Test_N_VScaleVectorArray(N_Vector X, sunindextype local_length, /* fill vector data */ for (j=0; j < nvecs; j++) { - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; N_VRand(Y[j], local_length, NEG_ONE, ONE); } @@ -1939,7 +1939,7 @@ int Test_N_VConstVectorArray(N_Vector X, sunindextype local_length, double *ftimes, *utimes; int i, j; int ier = 0; - realtype c; + sunrealtype c; N_Vector *Y; /* allocate timing arrays */ @@ -1954,7 +1954,7 @@ int Test_N_VConstVectorArray(N_Vector X, sunindextype local_length, */ /* fill vector data */ - c = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nvecs; j++) N_VRand(Y[j], local_length, NEG_ONE, ONE); @@ -1972,7 +1972,7 @@ int Test_N_VConstVectorArray(N_Vector X, sunindextype local_length, } /* fill vector data */ - c = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nvecs; j++) N_VRand(Y[j], local_length, NEG_ONE, ONE); @@ -2015,7 +2015,7 @@ int Test_N_VWrmsNormVectorArray(N_Vector X, sunindextype local_length, double *ftimes, *utimes; int i, j; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector *Z, *W; /* allocate timing arrays */ @@ -2023,7 +2023,7 @@ int Test_N_VWrmsNormVectorArray(N_Vector X, sunindextype local_length, utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create nvectors arrays and array for norms */ - c = (realtype*) malloc(nvecs*sizeof(realtype)); + c = (sunrealtype*) malloc(nvecs*sizeof(sunrealtype)); Z = N_VCloneVectorArray(nvecs, X); W = N_VCloneVectorArray(nvecs, X); @@ -2097,7 +2097,7 @@ int Test_N_VWrmsNormMaskVectorArray(N_Vector X, sunindextype local_length, double *ftimes, *utimes; int i, j; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector *Z, *W, ID; /* allocate timing arrays */ @@ -2105,7 +2105,7 @@ int Test_N_VWrmsNormMaskVectorArray(N_Vector X, sunindextype local_length, utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create nvectors arrays and array for norms */ - c = (realtype*) malloc(nvecs*sizeof(realtype)); + c = (sunrealtype*) malloc(nvecs*sizeof(sunrealtype)); Z = N_VCloneVectorArray(nvecs, X); W = N_VCloneVectorArray(nvecs, X); ID = N_VClone(X); @@ -2183,7 +2183,7 @@ int Test_N_VScaleAddMultiVectorArray(N_Vector V, sunindextype local_length, double *ftimes, *utimes; int i, j, k; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector *X, **Y, **Z; /* allocate timing arrays */ @@ -2191,7 +2191,7 @@ int Test_N_VScaleAddMultiVectorArray(N_Vector V, sunindextype local_length, utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create nvectors arrays and array for norms */ - c = (realtype*) malloc(nsums*sizeof(realtype)); + c = (sunrealtype*) malloc(nsums*sizeof(sunrealtype)); X = N_VCloneVectorArray(nvecs, V); Y = (N_Vector**) malloc(nsums*sizeof(N_Vector*)); @@ -2207,7 +2207,7 @@ int Test_N_VScaleAddMultiVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (k=0; k < nvecs; k++) N_VRand(X[k], local_length, NEG_ONE, ONE); @@ -2232,7 +2232,7 @@ int Test_N_VScaleAddMultiVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (k=0; k < nvecs; k++) N_VRand(X[k], local_length, NEG_ONE, ONE); @@ -2266,7 +2266,7 @@ int Test_N_VScaleAddMultiVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (k=0; k < nvecs; k++) N_VRand(X[k], local_length, NEG_ONE, ONE); @@ -2291,7 +2291,7 @@ int Test_N_VScaleAddMultiVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (k=0; k < nvecs; k++) N_VRand(X[k], local_length, NEG_ONE, ONE); @@ -2347,7 +2347,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, double *ftimes, *utimes; int i, j, k; int ier = 0; - realtype *c; + sunrealtype *c; N_Vector **X, *Z; /* allocate timing arrays */ @@ -2355,7 +2355,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, utimes = (double*) malloc((ntests+nwarmups)*sizeof(double)); /* create nvectors arrays and array for norms */ - c = (realtype*) malloc(nsums*sizeof(realtype)); + c = (sunrealtype*) malloc(nsums*sizeof(sunrealtype)); Z = N_VCloneVectorArray(nvecs, V); X = (N_Vector**) malloc(nsums*sizeof(N_Vector*)); @@ -2369,7 +2369,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, /* fill data */ c[0] = ONE; for (j=1; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nsums; j++) for (k=0; k < nvecs; k++) @@ -2401,7 +2401,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, /* fill data */ c[0] = ONE; for (j=1; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nsums; j++) for (k=0; k < nvecs; k++) @@ -2433,7 +2433,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nsums; j++) for (k=0; k < nvecs; k++) @@ -2467,7 +2467,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nsums; j++) for (k=0; k < nvecs; k++) @@ -2499,7 +2499,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nsums; j++) for (k=0; k < nvecs; k++) @@ -2533,7 +2533,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, /* fill data */ for (j=0; j < nsums; j++) - c[j] = ((realtype)rand() / (realtype)RAND_MAX) + 1.0; + c[j] = ((sunrealtype)rand() / (sunrealtype)RAND_MAX) + 1.0; for (j=0; j < nsums; j++) for (k=0; k < nvecs; k++) @@ -2623,13 +2623,13 @@ void SetTiming(int onoff, int myid) /* ---------------------------------------------------------------------- - * Fill a realtype array with random numbers between lower and upper + * Fill a sunrealtype array with random numbers between lower and upper * using a linear congruential generator suggested in the C99 standard * --------------------------------------------------------------------*/ -void rand_realtype(realtype *data, sunindextype len, realtype lower, realtype upper) +void rand_realtype(sunrealtype *data, sunindextype len, sunrealtype lower, sunrealtype upper) { int i, rand; - realtype range; + sunrealtype range; static int rand_max = 0x7fffffff; /* 2^32 - 1 */ /* fill array with random data between lower and upper */ @@ -2637,7 +2637,7 @@ void rand_realtype(realtype *data, sunindextype len, realtype lower, realtype up rand = (int) time(NULL); for (i=0; i < len; i++) { rand = (1103515245*rand+12345) & rand_max; - data[i] = range*((realtype)rand / (realtype)rand_max) + lower; + data[i] = range*((sunrealtype)rand / (sunrealtype)rand_max) + lower; } return; @@ -2645,9 +2645,9 @@ void rand_realtype(realtype *data, sunindextype len, realtype lower, realtype up /* ---------------------------------------------------------------------- - * Fill a realtype array with random series of 0 or 1 + * Fill a sunrealtype array with random series of 0 or 1 * --------------------------------------------------------------------*/ -void rand_realtype_zero_one(realtype *data, sunindextype len) +void rand_realtype_zero_one(sunrealtype *data, sunindextype len) { int i, rand; static int rand_max = 0x7fffffff; /* 2^32 - 1 */ @@ -2656,7 +2656,7 @@ void rand_realtype_zero_one(realtype *data, sunindextype len) rand = (int) time(NULL); for (i=0; i < len; i++) { rand = (1103515245*rand+12345) & rand_max; - data[i] = (realtype) (rand % 2); + data[i] = (sunrealtype) (rand % 2); } return; @@ -2664,9 +2664,9 @@ void rand_realtype_zero_one(realtype *data, sunindextype len) /* ---------------------------------------------------------------------- - * Fill a realtype array with random values for constraint testing + * Fill a sunrealtype array with random values for constraint testing * --------------------------------------------------------------------*/ -void rand_realtype_constraints(realtype *data, sunindextype len) +void rand_realtype_constraints(sunrealtype *data, sunindextype len) { int i, rand; static int rand_max = 0x7fffffff; /* 2^32 - 1 */ @@ -2675,7 +2675,7 @@ void rand_realtype_constraints(realtype *data, sunindextype len) rand = (int) time(NULL); for (i=0; i < len; i++) { rand = (1103515245*rand+12345) & rand_max; - data[i] = (realtype) (rand % 5 - 2); + data[i] = (sunrealtype) (rand % 5 - 2); } return; diff --git a/benchmarks/nvector/test_nvector_performance.h b/benchmarks/nvector/test_nvector_performance.h index b81f1c2d98..b5bcda04c7 100644 --- a/benchmarks/nvector/test_nvector_performance.h +++ b/benchmarks/nvector/test_nvector_performance.h @@ -32,7 +32,7 @@ extern "C" { void collect_times(N_Vector X, double *times, int ntimes); void sync_device(N_Vector x); void ClearCache(); - void N_VRand(N_Vector Xvec, sunindextype Xlen, realtype lower, realtype upper); + void N_VRand(N_Vector Xvec, sunindextype Xlen, sunrealtype lower, sunrealtype upper); void N_VRandZeroOne(N_Vector Xvec, sunindextype Xlen); void N_VRandConstraints(N_Vector Xvec, sunindextype Xlen); @@ -89,10 +89,10 @@ extern "C" { /* Print output table header */ void PrintTableHeader(int type); - /* Fill realtype arrays with random data */ - void rand_realtype(realtype *data, sunindextype len, realtype lower, realtype upper); - void rand_realtype_zero_one(realtype *data, sunindextype len); - void rand_realtype_constraints(realtype *data, sunindextype len); + /* Fill sunrealtype arrays with random data */ + void rand_realtype(sunrealtype *data, sunindextype len, sunrealtype lower, sunrealtype upper); + void rand_realtype_zero_one(sunrealtype *data, sunindextype len); + void rand_realtype_constraints(sunrealtype *data, sunindextype len); #ifdef __cplusplus } diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index b9959f745d..e7d4631d7e 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -34,7 +34,7 @@ if(USE_XSDK_DEFAULTS) endif() # --------------------------------------------------------------- -# Option to specify precision (realtype) +# Option to specify precision (sunrealtype) # --------------------------------------------------------------- set(DOCSTR "single, double, or extended") diff --git a/doc/arkode/guide/source/ARKodeButcherTable.rst b/doc/arkode/guide/source/ARKodeButcherTable.rst index 8e6ea6acbc..7bed94ec83 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -57,10 +57,10 @@ where ``ARKodeButcherTableMem`` is the structure int q; int p; int stages; - realtype **A; - realtype *c; - realtype *b; - realtype *d; + sunrealtype **A; + sunrealtype *c; + sunrealtype *b; + sunrealtype *d; }; @@ -183,7 +183,7 @@ ARKodeButcherTable functions * :c:type:`ARKodeButcherTable` structure if successful. * ``NULL`` pointer if *stages* was invalid or an allocation error occurred. -.. c:function:: ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, realtype *c, realtype *A, realtype *b, realtype *d) +.. c:function:: ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, sunrealtype *c, sunrealtype *A, sunrealtype *b, sunrealtype *d) Allocates a Butcher table and fills it with the given values. @@ -226,7 +226,7 @@ ARKodeButcherTable functions **Arguments:** * *B* -- the Butcher table. - * *lenrw* -- the number of ``realtype`` values in the Butcher table workspace. + * *lenrw* -- the number of ``sunrealtype`` values in the Butcher table workspace. * *leniw* -- the number of integer values in the Butcher table workspace. **Return value:** diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst index 3dc9517777..4b4d07ccd2 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst @@ -172,7 +172,7 @@ the ARKBANDPRE module: **Arguments:** * *arkode_mem* -- pointer to the ARKStep memory block. - * *lenrwLS* -- the number of ``realtype`` values in the + * *lenrwLS* -- the number of ``sunrealtype`` values in the ARKBANDPRE workspace. * *leniwLS* -- the number of integer values in the ARKBANDPRE workspace. @@ -347,7 +347,7 @@ communicated between processes by *cfn*, and that are then used by -.. c:type:: int (*ARKLocalFn)(sunindextype Nlocal, realtype t, N_Vector y, N_Vector glocal, void* user_data) +.. c:type:: int (*ARKLocalFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector glocal, void* user_data) This *gloc* function computes :math:`g(t,y)`. It fills the vector *glocal* as a function of *t* and *y*. @@ -377,7 +377,7 @@ communicated between processes by *cfn*, and that are then used by -.. c:type:: int (*ARKCommFn)(sunindextype Nlocal, realtype t, N_Vector y, void* user_data) +.. c:type:: int (*ARKCommFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, void* user_data) This *cfn* function performs all inter-process communication necessary for the execution of the *gloc* function @@ -497,7 +497,7 @@ ARKBBDPRE user-callable functions The ARKBBDPRE preconditioner module is initialized (or re-initialized) and attached to the integrator by calling the following functions: -.. c:function:: int ARKBBDPrecInit(void* arkode_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, realtype dqrely, ARKLocalFn gloc, ARKCommFn cfn) +.. c:function:: int ARKBBDPrecInit(void* arkode_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dqrely, ARKLocalFn gloc, ARKCommFn cfn) Initializes and allocates (internal) memory for the ARKBBDPRE preconditioner. @@ -565,7 +565,7 @@ SUNLINSOL module, and/or one or more of the corresponding ``ARKStepSet***`` functions, must also be made (in the proper order). -.. c:function:: int ARKBBDPrecReInit(void* arkode_mem, sunindextype mudq, sunindextype mldq, realtype dqrely) +.. c:function:: int ARKBBDPrecReInit(void* arkode_mem, sunindextype mudq, sunindextype mldq, sunrealtype dqrely) Re-initializes the ARKBBDPRE preconditioner module. @@ -603,7 +603,7 @@ the ARKBBDPRE module: **Arguments:** * *arkode_mem* -- pointer to the ARKStep memory block. - * *lenrwBBDP* -- the number of ``realtype`` values in the + * *lenrwBBDP* -- the number of ``sunrealtype`` values in the ARKBBDPRE workspace. * *leniwBBDP* -- the number of integer values in the ARKBBDPRE workspace. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst index 4b75d6d36e..9ab0755b18 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst @@ -59,7 +59,7 @@ the function to be called or macro to be referenced. y0 = N_VMake_***(..., ydata); - if the ``realtype`` array ``ydata`` containing the initial values of + if the ``sunrealtype`` array ``ydata`` containing the initial values of :math:`y` already exists. Otherwise, create a new vector by making a call of the form diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst index df8a32a095..a6be7d8b6f 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst @@ -41,7 +41,7 @@ ARKStep initialization and deallocation functions ------------------------------------------------------ -.. c:function:: void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, realtype t0, N_Vector y0, SUNContext sunctx) +.. c:function:: void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, SUNContext sunctx) This function creates an internal memory block for a problem to be solved using the ARKStep time-stepping module in ARKODE. @@ -114,7 +114,7 @@ Alternatively, the user may supply a custom function to supply the -.. c:function:: int ARKStepSStolerances(void* arkode_mem, realtype reltol, realtype abstol) +.. c:function:: int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) This function specifies scalar relative and absolute tolerances. @@ -131,7 +131,7 @@ Alternatively, the user may supply a custom function to supply the -.. c:function:: int ARKStepSVtolerances(void* arkode_mem, realtype reltol, N_Vector abstol) +.. c:function:: int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) This function specifies a scalar relative tolerance and a vector absolute tolerance (a potentially different absolute tolerance for @@ -207,7 +207,7 @@ these functions is provided below. -.. c:function:: int ARKStepResStolerance(void* arkode_mem, realtype rabstol) +.. c:function:: int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol) This function specifies a scalar absolute residual tolerance. @@ -704,7 +704,7 @@ the user has set a stop time (with a call to the optional input function :c:func:`ARKStepSetStopTime()`) or has requested rootfinding. -.. c:function:: int ARKStepEvolve(void* arkode_mem, realtype tout, N_Vector yout, realtype *tret, int itask) +.. c:function:: int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) Integrates the ODE over an interval in :math:`t`. @@ -1074,7 +1074,7 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst -.. c:function:: int ARKStepSetFixedStep(void* arkode_mem, realtype hfixed) +.. c:function:: int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) Disables time step adaptivity within ARKStep, and specifies the fixed time step size to use for the following internal step(s). @@ -1132,7 +1132,7 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst -.. c:function:: int ARKStepSetInitStep(void* arkode_mem, realtype hin) +.. c:function:: int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin) Specifies the initial time step size ARKStep should use after initialization, re-initialization, or resetting. @@ -1206,7 +1206,7 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst -.. c:function:: int ARKStepSetMaxStep(void* arkode_mem, realtype hmax) +.. c:function:: int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) Specifies the upper bound on the magnitude of the time step size. @@ -1224,7 +1224,7 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst -.. c:function:: int ARKStepSetMinStep(void* arkode_mem, realtype hmin) +.. c:function:: int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) Specifies the lower bound on the magnitude of the time step size. @@ -1242,7 +1242,7 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst -.. c:function:: int ARKStepSetStopTime(void* arkode_mem, realtype tstop) +.. c:function:: int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) Specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -1733,7 +1733,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, realtype* adapt_params) +.. c:function:: int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, sunrealtype* adapt_params) Specifies the method (and associated parameters) used for time step adaptivity. @@ -1766,7 +1766,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetCFLFraction(void* arkode_mem, realtype cfl_frac) +.. c:function:: int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) Specifies the fraction of the estimated explicitly stable step to use. @@ -1785,7 +1785,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetErrorBias(void* arkode_mem, realtype bias) +.. c:function:: int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) Specifies the bias to be applied to the error estimates within accuracy-based adaptivity strategies. @@ -1805,7 +1805,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetFixedStepBounds(void* arkode_mem, realtype lb, realtype ub) +.. c:function:: int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) Specifies the step growth interval in which the step size will remain unchanged. @@ -1824,7 +1824,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetMaxCFailGrowth(void* arkode_mem, realtype etacf) +.. c:function:: int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) Specifies the maximum step size growth factor upon an algebraic solver convergence failure on a stage solve within a step, :math:`\eta_{cf}` from @@ -1845,7 +1845,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetMaxEFailGrowth(void* arkode_mem, realtype etamxf) +.. c:function:: int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) Specifies the maximum step size growth factor upon multiple successive accuracy-based error failures in the solver. @@ -1864,7 +1864,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetMaxFirstGrowth(void* arkode_mem, realtype etamx1) +.. c:function:: int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) Specifies the maximum allowed growth factor in step size following the very first integration step. @@ -1884,7 +1884,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetMaxGrowth(void* arkode_mem, realtype mx_growth) +.. c:function:: int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) Specifies the maximum allowed growth factor in step size between consecutive steps in the integration process. @@ -1904,7 +1904,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetMinReduction(void* arkode_mem, realtype eta_min) +.. c:function:: int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) Specifies the minimum allowed reduction factor in step size between step attempts, resulting from a temporal error failure in the integration @@ -1926,7 +1926,7 @@ Explicit stability function :c:func:`ARKStepSetSt -.. c:function:: int ARKStepSetSafetyFactor(void* arkode_mem, realtype safety) +.. c:function:: int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) Specifies the safety factor to be applied to the accuracy-based estimated step. @@ -2187,7 +2187,7 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe -.. c:function:: int ARKStepSetNonlinConvCoef(void* arkode_mem, realtype nlscoef) +.. c:function:: int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) Specifies the safety factor :math:`\epsilon` used within the nonlinear solver convergence test :eq:`ARKODE_NonlinearTolerance`. @@ -2207,7 +2207,7 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe -.. c:function:: int ARKStepSetNonlinCRDown(void* arkode_mem, realtype crdown) +.. c:function:: int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) Specifies the constant :math:`c_r` used in estimating the nonlinear solver convergence rate :eq:`ARKODE_NonlinearCRate`. @@ -2225,7 +2225,7 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe -.. c:function:: int ARKStepSetNonlinRDiv(void* arkode_mem, realtype rdiv) +.. c:function:: int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) Specifies the nonlinear correction threshold :math:`r_{div}` from :eq:`ARKODE_NonlinearDivergence`, beyond which the iteration will be declared divergent. @@ -2374,7 +2374,7 @@ is recomputed using the current :math:`\gamma` value. ============================================= ========================================= ============ -.. c:function:: int ARKStepSetDeltaGammaMax(void* arkode_mem, realtype dgmax) +.. c:function:: int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) Specifies a scaled step size ratio tolerance, :math:`\Delta\gamma_{max}` from :numref:`ARKODE.Mathematics.Linear.Setup`, beyond which the linear solver @@ -2908,7 +2908,7 @@ the user through the :c:func:`ARKStepSetEpsLin()` function. -.. c:function:: int ARKStepSetEpsLin(void* arkode_mem, realtype eplifac) +.. c:function:: int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) Specifies the factor :math:`\epsilon_L` by which the tolerance on the nonlinear iteration is multiplied to get a tolerance on the @@ -2934,7 +2934,7 @@ the user through the :c:func:`ARKStepSetEpsLin()` function. -.. c:function:: int ARKStepSetMassEpsLin(void* arkode_mem, realtype eplifac) +.. c:function:: int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) Specifies the factor by which the tolerance on the nonlinear iteration is multiplied to get a tolerance on the mass matrix @@ -2974,7 +2974,7 @@ functions :c:func:`ARKStepSetLSNormFactor()` and :c:func:`ARKStepSetMassLSNormFa allow for additional user control over these conversion factors. -.. c:function:: int ARKStepSetLSNormFactor(void* arkode_mem, realtype nrmfac) +.. c:function:: int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) Specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system @@ -3003,7 +3003,7 @@ allow for additional user control over these conversion factors. -.. c:function:: int ARKStepSetMassLSNormFactor(void* arkode_mem, realtype nrmfac) +.. c:function:: int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) Specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for mass matrix linear @@ -3123,7 +3123,7 @@ polynomial model may be evaluated upon request. -.. c:function:: int ARKStepGetDky(void* arkode_mem, realtype t, int k, N_Vector dky) +.. c:function:: int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) Computes the *k*-th derivative of the function :math:`y` at the time *t*, @@ -3270,7 +3270,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa **Arguments:** * *arkode_mem* -- pointer to the ARKStep memory block. - * *lenrw* -- the number of ``realtype`` values in the ARKStep workspace. + * *lenrw* -- the number of ``sunrealtype`` values in the ARKStep workspace. * *leniw* -- the number of integer values in the ARKStep workspace. **Return value:** @@ -3294,7 +3294,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa -.. c:function:: int ARKStepGetActualInitStep(void* arkode_mem, realtype* hinused) +.. c:function:: int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) Returns the value of the integration step size used on the first step. @@ -3317,7 +3317,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa -.. c:function:: int ARKStepGetLastStep(void* arkode_mem, realtype* hlast) +.. c:function:: int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) Returns the integration step size taken on the last successful internal step. @@ -3332,7 +3332,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa -.. c:function:: int ARKStepGetCurrentStep(void* arkode_mem, realtype* hcur) +.. c:function:: int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) Returns the integration step size to be attempted on the next internal step. @@ -3346,7 +3346,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa -.. c:function:: int ARKStepGetCurrentTime(void* arkode_mem, realtype* tcur) +.. c:function:: int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) Returns the current internal time reached by the solver. @@ -3378,7 +3378,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa on the particular use case and on when this routine is called. -.. c:function:: int ARKStepGetCurrentGamma(void *arkode_mem, realtype *gamma) +.. c:function:: int ARKStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) Returns the current internal value of :math:`\gamma` used in the implicit solver Newton matrix (see equation :eq:`ARKODE_NewtonMatrix`). @@ -3393,7 +3393,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa -.. c:function:: int ARKStepGetTolScaleFactor(void* arkode_mem, realtype* tolsfac) +.. c:function:: int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) Returns a suggested factor by which the user's tolerances should be scaled when too much accuracy has been @@ -3445,7 +3445,7 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa -.. c:function:: int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, realtype* hinused, realtype* hlast, realtype* hcur, realtype* tcur) +.. c:function:: int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) Returns many of the most useful optional outputs in a single call. @@ -3623,10 +3623,10 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa int q; /* method order of accuracy */ int p; /* embedding order of accuracy */ int stages; /* number of stages */ - realtype **A; /* Butcher table coefficients */ - realtype *c; /* canopy node coefficients */ - realtype *b; /* root node coefficients */ - realtype *d; /* embedding coefficients */ + sunrealtype **A; /* Butcher table coefficients */ + sunrealtype *c; /* canopy node coefficients */ + sunrealtype *b; /* root node coefficients */ + sunrealtype *d; /* embedding coefficients */ } *ARKStepButcherTable; @@ -3965,7 +3965,7 @@ Last return from a mass matrix solver function :c:func:`ARKS **Arguments:** * *arkode_mem* -- pointer to the ARKStep memory block. - * *lenrwLS* -- the number of ``realtype`` values in the ARKLS workspace. + * *lenrwLS* -- the number of ``sunrealtype`` values in the ARKLS workspace. * *leniwLS* -- the number of integer values in the ARKLS workspace. **Return value:** @@ -4212,7 +4212,7 @@ Last return from a mass matrix solver function :c:func:`ARKS **Arguments:** * *arkode_mem* -- pointer to the ARKStep memory block. - * *lenrwMLS* -- the number of ``realtype`` values in the ARKLS mass solver workspace. + * *lenrwMLS* -- the number of ``sunrealtype`` values in the ARKLS mass solver workspace. * *leniwMLS* -- the number of integer values in the ARKLS mass solver workspace. **Return value:** @@ -4558,7 +4558,7 @@ comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, realtype t0, N_Vector y0) +.. c:function:: int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0) Provides required problem specifications and re-initializes the ARKStep time-stepper module. @@ -4634,7 +4634,7 @@ comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int ARKStepReset(void* arkode_mem, realtype tR, N_Vector yR) +.. c:function:: int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) Resets the current ARKStep time-stepper module state to the provided independent variable value and dependent variable vector. @@ -4700,7 +4700,7 @@ rescale the upcoming time step by the specified factor. If a value -.. c:function:: int ARKStepResize(void* arkode_mem, N_Vector yR, realtype hscale, realtype tR, ARKVecResizeFn resize, void* resize_data) +.. c:function:: int ARKStepResize(void* arkode_mem, N_Vector yR, sunrealtype hscale, sunrealtype tR, ARKVecResizeFn resize, void* resize_data) Re-sizes ARKStep with a different state vector but with comparable dynamical time scale. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst index fab00f5214..501c4bd4bf 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst @@ -532,7 +532,7 @@ if an error occurred. The possible return codes are given in -.. c:function:: int ARKBraid_BraidInit(MPI_Comm comm_w, MPI_Comm comm_t, realtype tstart, realtype tstop, sunindextype ntime, braid_App app, braid_Core *core) +.. c:function:: int ARKBraid_BraidInit(MPI_Comm comm_w, MPI_Comm comm_t, sunrealtype tstart, sunrealtype tstop, sunindextype ntime, braid_App app, braid_Core *core) This function wraps the XBraid ``braid_Init()`` function to create the XBraid core memory structure and initializes XBraid with the ARKBraid and @@ -771,7 +771,7 @@ error occurred. The possible return codes are given in * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. -.. c:function:: int ARKBraid_GetSolution(braid_App app, realtype *tout, N_Vector yout) +.. c:function:: int ARKBraid_GetSolution(braid_App app, sunrealtype *tout, N_Vector yout) This function returns final time and state stored with the default access function :c:func:`ARKBraid_Access()`. @@ -845,7 +845,7 @@ in :numref:`ARKODE.Usage.ARKStep.SUNBraidReturnCodes.Table`. -.. c:function:: int ARKBraid_Init(braid_App app, realtype t, braid_Vector *u_ptr) +.. c:function:: int ARKBraid_Init(braid_App app, sunrealtype t, braid_Vector *u_ptr) This is the default vector initialization function provided to XBraid. The initialization function is called by XBraid to create a new vector and set @@ -998,7 +998,7 @@ ARKODE and XBraid that requries defining a custom SUNBraidApp implementation. -.. c:function:: int ARKBraid_TakeStep(void *arkode_mem, realtype tstart, realtype tstop, N_Vector y, int *ark_flag) +.. c:function:: int ARKBraid_TakeStep(void *arkode_mem, sunrealtype tstart, sunrealtype tstop, N_Vector y, int *ark_flag) This function advances the vector *y* from *tstart* to *tstop* using a single ARKStep time step with step size *h = tstop - start*. diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst index 5c5a1e869f..76685ec367 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst @@ -58,7 +58,7 @@ referenced. y0 = N_VMake_***(..., ydata); - if the ``realtype`` array ``ydata`` containing the initial values of + if the ``sunrealtype`` array ``ydata`` containing the initial values of :math:`y` already exists. Otherwise, create a new vector by making a call of the form diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst index d8782622a6..9e8d0389f7 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst @@ -41,7 +41,7 @@ ERKStep initialization and deallocation functions ------------------------------------------------------ -.. c:function:: void* ERKStepCreate(ARKRhsFn f, realtype t0, N_Vector y0, SUNContext sunctx) +.. c:function:: void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) This function allocates and initializes memory for a problem to be solved using the ERKStep time-stepping module in ARKODE. @@ -112,7 +112,7 @@ Alternatively, the user may supply a custom function to supply the -.. c:function:: int ERKStepSStolerances(void* arkode_mem, realtype reltol, realtype abstol) +.. c:function:: int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) This function specifies scalar relative and absolute tolerances. @@ -129,7 +129,7 @@ Alternatively, the user may supply a custom function to supply the -.. c:function:: int ERKStepSVtolerances(void* arkode_mem, realtype reltol, N_Vector abstol) +.. c:function:: int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) This function specifies a scalar relative tolerance and a vector absolute tolerance (a potentially different absolute tolerance for @@ -329,7 +329,7 @@ has requested rootfinding. -.. c:function:: int ERKStepEvolve(void* arkode_mem, realtype tout, N_Vector yout, realtype *tret, int itask) +.. c:function:: int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) Integrates the ODE over an interval in :math:`t`. @@ -697,7 +697,7 @@ Optional inputs for ERKStep -.. c:function:: int ERKStepSetFixedStep(void* arkode_mem, realtype hfixed) +.. c:function:: int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) Disabled time step adaptivity within ERKStep, and specifies the fixed time step size to use for the following internal step(s). @@ -753,7 +753,7 @@ Optional inputs for ERKStep -.. c:function:: int ERKStepSetInitStep(void* arkode_mem, realtype hin) +.. c:function:: int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin) Specifies the initial time step size ERKStep should use after initialization, re-initialization, or resetting. @@ -826,7 +826,7 @@ Optional inputs for ERKStep -.. c:function:: int ERKStepSetMaxStep(void* arkode_mem, realtype hmax) +.. c:function:: int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) Specifies the upper bound on the magnitude of the time step size. @@ -844,7 +844,7 @@ Optional inputs for ERKStep -.. c:function:: int ERKStepSetMinStep(void* arkode_mem, realtype hmin) +.. c:function:: int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) Specifies the lower bound on the magnitude of the time step size. @@ -862,7 +862,7 @@ Optional inputs for ERKStep -.. c:function:: int ERKStepSetStopTime(void* arkode_mem, realtype tstop) +.. c:function:: int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) Specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -1211,7 +1211,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, realtype* adapt_params) +.. c:function:: int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, sunrealtype* adapt_params) Specifies the method (and associated parameters) used for time step adaptivity. @@ -1244,7 +1244,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetCFLFraction(void* arkode_mem, realtype cfl_frac) +.. c:function:: int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) Specifies the fraction of the estimated explicitly stable step to use. @@ -1263,7 +1263,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetErrorBias(void* arkode_mem, realtype bias) +.. c:function:: int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) Specifies the bias to be applied to the error estimates within accuracy-based adaptivity strategies. @@ -1283,7 +1283,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetFixedStepBounds(void* arkode_mem, realtype lb, realtype ub) +.. c:function:: int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) Specifies the step growth interval in which the step size will remain unchanged. @@ -1302,7 +1302,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetMaxEFailGrowth(void* arkode_mem, realtype etamxf) +.. c:function:: int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) Specifies the maximum step size growth factor upon multiple successive accuracy-based error failures in the solver. @@ -1321,7 +1321,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetMaxFirstGrowth(void* arkode_mem, realtype etamx1) +.. c:function:: int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) Specifies the maximum allowed growth factor in step size following the very first integration step. @@ -1341,7 +1341,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetMaxGrowth(void* arkode_mem, realtype mx_growth) +.. c:function:: int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) Specifies the maximum allowed growth factor in step size between consecutive steps in the integration process. @@ -1361,7 +1361,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetMinReduction(void* arkode_mem, realtype eta_min) +.. c:function:: int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) Specifies the minimum allowed reduction factor in step size between step attempts, resulting from a temporal error failure in the integration @@ -1383,7 +1383,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. -.. c:function:: int ERKStepSetSafetyFactor(void* arkode_mem, realtype safety) +.. c:function:: int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) Specifies the safety factor to be applied to the accuracy-based estimated step. @@ -1542,7 +1542,7 @@ derivatives of the polynomial model may be evaluated upon request. -.. c:function:: int ERKStepGetDky(void* arkode_mem, realtype t, int k, N_Vector dky) +.. c:function:: int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) Computes the *k*-th derivative of the function :math:`y` at the time *t*, @@ -1684,7 +1684,7 @@ Main solver optional output functions **Arguments:** * *arkode_mem* -- pointer to the ERKStep memory block. - * *lenrw* -- the number of ``realtype`` values in the ERKStep workspace. + * *lenrw* -- the number of ``sunrealtype`` values in the ERKStep workspace. * *leniw* -- the number of integer values in the ERKStep workspace. **Return value:** @@ -1708,7 +1708,7 @@ Main solver optional output functions -.. c:function:: int ERKStepGetActualInitStep(void* arkode_mem, realtype* hinused) +.. c:function:: int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) Returns the value of the integration step size used on the first step. @@ -1730,7 +1730,7 @@ Main solver optional output functions -.. c:function:: int ERKStepGetLastStep(void* arkode_mem, realtype* hlast) +.. c:function:: int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) Returns the integration step size taken on the last successful internal step. @@ -1745,7 +1745,7 @@ Main solver optional output functions -.. c:function:: int ERKStepGetCurrentStep(void* arkode_mem, realtype* hcur) +.. c:function:: int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) Returns the integration step size to be attempted on the next internal step. @@ -1759,7 +1759,7 @@ Main solver optional output functions -.. c:function:: int ERKStepGetCurrentTime(void* arkode_mem, realtype* tcur) +.. c:function:: int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) Returns the current internal time reached by the solver. @@ -1773,7 +1773,7 @@ Main solver optional output functions -.. c:function:: int ERKStepGetTolScaleFactor(void* arkode_mem, realtype* tolsfac) +.. c:function:: int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) Returns a suggested factor by which the user's tolerances should be scaled when too much accuracy has been @@ -1807,7 +1807,7 @@ Main solver optional output functions -.. c:function:: int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, realtype* hinused, realtype* hlast, realtype* hcur, realtype* tcur) +.. c:function:: int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) Returns many of the most useful optional outputs in a single call. @@ -1963,10 +1963,10 @@ Main solver optional output functions int q; /* method order of accuracy */ int p; /* embedding order of accuracy */ int stages; /* number of stages */ - realtype **A; /* Butcher table coefficients */ - realtype *c; /* canopy node coefficients */ - realtype *b; /* root node coefficients */ - realtype *d; /* embedding coefficients */ + sunrealtype **A; /* Butcher table coefficients */ + sunrealtype *c; /* canopy node coefficients */ + sunrealtype *b; /* root node coefficients */ + sunrealtype *d; /* embedding coefficients */ } *ARKodeButcherTable; @@ -2233,7 +2233,7 @@ comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int ERKStepReInit(void* arkode_mem, ARKRhsFn f, realtype t0, N_Vector y0) +.. c:function:: int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) Provides required problem specifications and re-initializes the ERKStep time-stepper module. @@ -2301,7 +2301,7 @@ restarted problem uses the new values (which have jumped). Similar comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int ERKStepReset(void* arkode_mem, realtype tR, N_Vector yR) +.. c:function:: int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) Resets the current ERKStep time-stepper module state to the provided independent variable value and dependent variable vector. @@ -2367,7 +2367,7 @@ rescale the upcoming time step by the specified factor. If a value -.. c:function:: int ERKStepResize(void* arkode_mem, N_Vector yR, realtype hscale, realtype tR, ARKVecResizeFn resize, void* resize_data) +.. c:function:: int ERKStepResize(void* arkode_mem, N_Vector yR, sunrealtype hscale, sunrealtype tR, ARKVecResizeFn resize, void* resize_data) Re-sizes ERKStep with a different state vector but with comparable dynamical time scale. diff --git a/doc/arkode/guide/source/Usage/General.rst b/doc/arkode/guide/source/Usage/General.rst index ea741b89ee..89806f267b 100644 --- a/doc/arkode/guide/source/Usage/General.rst +++ b/doc/arkode/guide/source/Usage/General.rst @@ -66,7 +66,7 @@ function prototypes, and include the shared ``arkode/arkode.h`` and ``arkode/arkode_ls.h`` header files. Note that ``arkode.h`` includes ``sundials_types.h`` directly, which -defines the types ``realtype``, ``sunindextype``, and ``booleantype`` +defines the types ``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``, so a user program does not need to include ``sundials_types.h`` directly. diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst index 4fd6f14b53..0a79678347 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst @@ -253,7 +253,7 @@ this section can be used to either apply the inner (fast) forcing or access the data necessary to construct the inner (fast) forcing polynomial. -.. c:function:: int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, realtype t, N_Vector ff) +.. c:function:: int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, sunrealtype t, N_Vector ff) This function computes the forcing term :eq:`ARKODE_MRI_forcing_poly` at the input time *t* and adds it to input vector *ff*, i.e., the inner (fast) right-hand @@ -279,7 +279,7 @@ data necessary to construct the inner (fast) forcing polynomial. * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` -.. c:function:: int MRIStepInnerStepper_GetForcingData(MRIStepInnerStepper stepper, realtype *tshift, realtype *tscale, N_Vector **forcing, int *nforcing) +.. c:function:: int MRIStepInnerStepper_GetForcingData(MRIStepInnerStepper stepper, sunrealtype *tshift, sunrealtype *tscale, N_Vector **forcing, int *nforcing) This function provides access to data necessary to compute the forcing term :eq:`ARKODE_MRI_forcing_poly`. This includes the shift and scaling factors for the @@ -345,7 +345,7 @@ An :c:type:`MRIStepInnerStepper` *must* provide implementations of the following member functions: -.. c:type:: int (*MRIStepInnerEvolveFn)(MRIStepInnerStepper stepper, realtype t0, realtype tout, N_Vector v) +.. c:type:: int (*MRIStepInnerEvolveFn)(MRIStepInnerStepper stepper, sunrealtype t0, sunrealtype tout, N_Vector v) This function advances the state vector *v* for the inner (fast) ODE system from time *t0* to time *tout*. @@ -366,7 +366,7 @@ member functions: * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` -.. c:type:: int (*MRIStepInnerFullRhsFn)(MRIStepInnerStepper stepper, realtype t, N_Vector v, N_Vector f, int mode) +.. c:type:: int (*MRIStepInnerFullRhsFn)(MRIStepInnerStepper stepper, sunrealtype t, N_Vector v, N_Vector f, int mode) This function computes the full right-hand side function of the inner (fast) ODE, :math:`f^F(t,v)` in :eq:`ARKODE_MRI_IVP` for a given value of the independent @@ -399,7 +399,7 @@ Optional Member Functions An :c:type:`MRIStepInnerStepper` *may* provide implementations of any of the following member functions: -.. c:type:: int (*MRIStepInnerResetFn)(MRIStepInnerStepper stepper, realtype tR, N_Vector vR) +.. c:type:: int (*MRIStepInnerResetFn)(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector vR) This function resets the inner (fast) stepper state to the provided independent variable value and dependent variable vector. diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst index 3143b304e3..10c5df3f48 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst @@ -43,9 +43,9 @@ where ``MRIStepCouplingMem`` is the structure int stages; int q; int p; - realtype ***G; - realtype ***W; - realtype *c; + sunrealtype ***G; + sunrealtype ***W; + sunrealtype *c; }; and the members of the strucutre are: @@ -165,7 +165,7 @@ are defined ``arkode/arkode_mristep.h``. allocated. -.. c:function:: MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, realtype *W, realtype *G, realtype *c) +.. c:function:: MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, sunrealtype *W, sunrealtype *G, sunrealtype *c) Allocates a coupling table and fills it with the given values. @@ -244,7 +244,7 @@ are defined ``arkode/arkode_mristep.h``. **Arguments:** * ``C`` -- the coupling table. - * ``lenrw`` -- the number of ``realtype`` values in the coupling table + * ``lenrw`` -- the number of ``sunrealtype`` values in the coupling table workspace. * ``leniw`` -- the number of integer values in the coupling table workspace. diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst index 57d05b4650..e823b52548 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst @@ -61,7 +61,7 @@ specific name of the function to be called or macro to be referenced. y0 = N_VMake_***(..., ydata); - if the ``realtype`` array ``ydata`` containing the initial values of + if the ``sunrealtype`` array ``ydata`` containing the initial values of :math:`y` already exists. Otherwise, create a new vector by making a call of the form diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst index 2daf213487..42b9caf359 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst @@ -42,7 +42,7 @@ MRIStep initialization and deallocation functions ------------------------------------------------------ -.. c:function:: void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, realtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx) +.. c:function:: void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx) This function allocates and initializes memory for a problem to be solved using the MRIStep time-stepping module in ARKODE. @@ -152,7 +152,7 @@ Alternatively, the user may supply a custom function to supply the -.. c:function:: int MRIStepSStolerances(void* arkode_mem, realtype reltol, realtype abstol) +.. c:function:: int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) This function specifies scalar relative and absolute tolerances. @@ -169,7 +169,7 @@ Alternatively, the user may supply a custom function to supply the -.. c:function:: int MRIStepSVtolerances(void* arkode_mem, realtype reltol, N_Vector abstol) +.. c:function:: int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) This function specifies a scalar relative tolerance and a vector absolute tolerance (a potentially different absolute tolerance for @@ -523,7 +523,7 @@ the user has set a stop time (with a call to the optional input function :c:func:`MRIStepSetStopTime()`) or has requested rootfinding. -.. c:function:: int MRIStepEvolve(void* arkode_mem, realtype tout, N_Vector yout, realtype *tret, int itask) +.. c:function:: int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) Integrates the ODE over an interval in :math:`t`. @@ -920,7 +920,7 @@ Optional inputs for MRIStep -.. c:function:: int MRIStepSetFixedStep(void* arkode_mem, realtype hs) +.. c:function:: int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hs) Set the slow step size used within MRIStep for the following internal step(s). @@ -946,7 +946,7 @@ Optional inputs for MRIStep .. - .. c:function:: int MRIStepSetInitStep(void* arkode_mem, realtype hin) + .. c:function:: int MRIStepSetInitStep(void* arkode_mem, sunrealtype hin) Specifies the initial time step size MRIStep should use after initialization or re-initialization. @@ -1031,7 +1031,7 @@ Optional inputs for MRIStep .. - .. c:function:: int MRIStepSetMaxStep(void* arkode_mem, realtype hmax) + .. c:function:: int MRIStepSetMaxStep(void* arkode_mem, sunrealtype hmax) Specifies the upper bound on the magnitude of the time step size. @@ -1054,7 +1054,7 @@ Optional inputs for MRIStep .. - .. c:function:: int MRIStepSetMinStep(void* arkode_mem, realtype hmin) + .. c:function:: int MRIStepSetMinStep(void* arkode_mem, sunrealtype hmin) Specifies the lower bound on the magnitude of the time step size. @@ -1075,7 +1075,7 @@ Optional inputs for MRIStep **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. -.. c:function:: int MRIStepSetStopTime(void* arkode_mem, realtype tstop) +.. c:function:: int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop) Specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -1432,7 +1432,7 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe -.. c:function:: int MRIStepSetNonlinConvCoef(void* arkode_mem, realtype nlscoef) +.. c:function:: int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) Specifies the safety factor used within the nonlinear solver convergence test. @@ -1450,7 +1450,7 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe -.. c:function:: int MRIStepSetNonlinCRDown(void* arkode_mem, realtype crdown) +.. c:function:: int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) Specifies the constant used in estimating the nonlinear solver convergence rate. @@ -1467,7 +1467,7 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe -.. c:function:: int MRIStepSetNonlinRDiv(void* arkode_mem, realtype rdiv) +.. c:function:: int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) Specifies the nonlinear correction threshold beyond which the iteration will be declared divergent. @@ -1626,7 +1626,7 @@ Jacobian / preconditioner update frequency :c:func:`MRIStepSetJacEvalFrequen ============================================= ========================================= ============ -.. c:function:: int MRIStepSetDeltaGammaMax(void* arkode_mem, realtype dgmax) +.. c:function:: int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) Specifies a scaled step size ratio tolerance, beyond which the linear solver setup routine will be signaled. @@ -2009,7 +2009,7 @@ the user through the :c:func:`MRIStepSetEpsLin()` function. :numref:`ARKODE.Usage.UserSupplied`. -.. c:function:: int MRIStepSetEpsLin(void* arkode_mem, realtype eplifac) +.. c:function:: int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) Specifies the factor by which the tolerance on the nonlinear iteration is multiplied to get a tolerance on the linear @@ -2033,7 +2033,7 @@ the user through the :c:func:`MRIStepSetEpsLin()` function. :c:func:`MRIStepSetLinearSolver()`. -.. c:function:: int MRIStepSetLSNormFactor(void* arkode_mem, realtype nrmfac) +.. c:function:: int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) Specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system @@ -2147,7 +2147,7 @@ polynomial model may be evaluated upon request. -.. c:function:: int MRIStepGetDky(void* arkode_mem, realtype t, int k, N_Vector dky) +.. c:function:: int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) Computes the *k*-th derivative of the function :math:`y` at the time *t*, @@ -2315,7 +2315,7 @@ Main solver optional output functions * *arkode_mem* -- pointer to the MRIStep memory block. - * *lenrw* -- the number of ``realtype`` values in the MRIStep workspace. + * *lenrw* -- the number of ``sunrealtype`` values in the MRIStep workspace. * *leniw* -- the number of integer values in the MRIStep workspace. @@ -2347,7 +2347,7 @@ Main solver optional output functions .. - .. c:function:: int MRIStepGetActualInitStep(void* arkode_mem, realtype* hinused) + .. c:function:: int MRIStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) Returns the value of the integration step size used on the first step. @@ -2364,7 +2364,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` -.. c:function:: int MRIStepGetLastStep(void* arkode_mem, realtype* hlast) +.. c:function:: int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast) Returns the integration step size taken on the last successful internal step. @@ -2383,7 +2383,7 @@ Main solver optional output functions .. - .. c:function:: int MRIStepGetCurrentStep(void* arkode_mem, realtype* hcur) + .. c:function:: int MRIStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) Returns the integration step size to be attempted on the next internal step. @@ -2400,7 +2400,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` -.. c:function:: int MRIStepGetCurrentTime(void* arkode_mem, realtype* tcur) +.. c:function:: int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) Returns the current internal time reached by the solver. @@ -2438,7 +2438,7 @@ Main solver optional output functions on the particular use case and on when this routine is called. -.. c:function:: int MRIStepGetCurrentGamma(void *arkode_mem, realtype *gamma) +.. c:function:: int MRIStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) Returns the current internal value of :math:`\gamma` used in the implicit solver Newton matrix (see equation :eq:`ARKODE_NewtonMatrix`). @@ -2457,7 +2457,7 @@ Main solver optional output functions -.. c:function:: int MRIStepGetTolScaleFactor(void* arkode_mem, realtype* tolsfac) +.. c:function:: int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) Returns a suggested factor by which the user's tolerances should be scaled when too much accuracy has been @@ -2497,7 +2497,7 @@ Main solver optional output functions .. - .. c:function:: int MRIStepGetStepStats(void* arkode_mem, long int* nssteps, long int* nfsteps, realtype* hlast, realtype* tcur) + .. c:function:: int MRIStepGetStepStats(void* arkode_mem, long int* nssteps, long int* nfsteps, sunrealtype* hlast, sunrealtype* tcur) Returns many of the most useful optional outputs in a single call. @@ -2702,8 +2702,8 @@ Main solver optional output functions int stages; /* size of coupling matrices (stages * stages) */ int q; /* method order of accuracy */ int p; /* embedding order of accuracy */ - realtype ***G; /* coupling matrices [nmat][stages][stages] */ - realtype *c; /* abscissae */ + sunrealtype ***G; /* coupling matrices [nmat][stages][stages] */ + sunrealtype *c; /* abscissae */ }; typedef MRIStepCouplingMem *MRIStepCoupling; @@ -3080,7 +3080,7 @@ Linear Solver) has been added here (e.g. *lenrwLS*). * *arkode_mem* -- pointer to the MRIStep memory block. - * *lenrwLS* -- the number of ``realtype`` values in the ARKLS workspace. + * *lenrwLS* -- the number of ``sunrealtype`` values in the ARKLS workspace. * *leniwLS* -- the number of integer values in the ARKLS workspace. @@ -3484,7 +3484,7 @@ comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, realtype t0, N_Vector y0) +.. c:function:: int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0) Provides required problem specifications and re-initializes the MRIStep outer (slow) stepper. @@ -3571,7 +3571,7 @@ comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int MRIStepReset(void* arkode_mem, realtype tR, N_Vector yR) +.. c:function:: int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) Resets the current MRIStep outer (slow) time-stepper module state to the provided independent variable value and dependent variable vector. @@ -3633,7 +3633,7 @@ internal to MRIStep will be destroyed and re-cloned from the new input vector. -.. c:function:: int MRIStepResize(void* arkode_mem, N_Vector yR, realtype tR, ARKVecResizeFn resize, void* resize_data) +.. c:function:: int MRIStepResize(void* arkode_mem, N_Vector yR, sunrealtype tR, ARKVecResizeFn resize, void* resize_data) Re-initializes MRIStep with a different state vector. diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst index fdc5f03545..6b0100d14e 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst @@ -55,7 +55,7 @@ referenced. y0 = N_VMake_***(..., ydata); - if the ``realtype`` array ``ydata`` containing the initial values of + if the ``sunrealtype`` array ``ydata`` containing the initial values of :math:`y` already exists. For some GPU-enabled vectors, a similar constructor can be used to provide host and device data pointers. If the data array does not already exist, create a new vector by making a call of the form diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst index 1450ea2c64..c09c1094e6 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst @@ -39,7 +39,7 @@ SPRKStep initialization and deallocation functions ------------------------------------------------------ -.. c:function:: void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, realtype t0,\ +.. c:function:: void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0,\ N_Vector y0, SUNContext sunctx) This function allocates and initializes memory for a problem to @@ -131,7 +131,7 @@ has requested rootfinding. -.. c:function:: int SPRKStepEvolve(void* arkode_mem, realtype tout, N_Vector yout, realtype *tret, int itask) +.. c:function:: int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) Integrates the ODE over an interval in :math:`t`. @@ -425,7 +425,7 @@ Optional inputs for SPRKStep ``NULL`` will always be directed to ``stderr``. -.. c:function:: int SPRKStepSetFixedStep(void* arkode_mem, realtype hfixed) +.. c:function:: int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) Sets the time step size used within SPRKStep. @@ -456,7 +456,7 @@ Optional inputs for SPRKStep :retval ARK_ILL_INPUT: if an argument has an illegal value -.. c:function:: int SPRKStepSetStopTime(void* arkode_mem, realtype tstop) +.. c:function:: int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) Specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -678,7 +678,7 @@ by :c:func:`SPRKStepEvolve()`. -.. c:function:: int SPRKStepGetDky(void* arkode_mem, realtype t, int k, N_Vector dky) +.. c:function:: int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) Computes the *k*-th derivative of the function :math:`y` at the time *t*, i.e., :math:`y^{(k)}(t)`, for values of the independent variable satisfying @@ -809,7 +809,7 @@ Main solver optional output functions :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` -.. c:function:: int SPRKStepGetLastStep(void* arkode_mem, realtype* hlast) +.. c:function:: int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) Returns the integration step size taken on the last successful internal step. @@ -821,7 +821,7 @@ Main solver optional output functions :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` -.. c:function:: int SPRKStepGetCurrentStep(void* arkode_mem, realtype* hcur) +.. c:function:: int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) Returns the integration step size to be attempted on the next internal step. @@ -832,7 +832,7 @@ Main solver optional output functions :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` -.. c:function:: int SPRKStepGetCurrentTime(void* arkode_mem, realtype* tcur) +.. c:function:: int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) Returns the current internal time reached by the solver. @@ -860,7 +860,7 @@ Main solver optional output functions on the particular use case and on when this routine is called. -.. c:function:: int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, realtype* hinused, realtype* hlast, realtype* hcur, realtype* tcur) +.. c:function:: int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) Returns many of the most useful optional outputs in a single call. @@ -1085,7 +1085,7 @@ this routine. We note that for the solution to retain temporal accuracy, the RHS function should not incorporate the discontinuity. -.. c:function:: int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, realtype t0, N_Vector y0) +.. c:function:: int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0) Provides required problem specifications and re-initializes the SPRKStep time-stepper module. @@ -1129,7 +1129,7 @@ solving the problem. By default the next call to :c:func:`SPRKStepEvolve()` will use the step size computed by SPRKStep prior to calling :c:func:`SPRKStepReset()`. -.. c:function:: int SPRKStepReset(void* arkode_mem, realtype tR, N_Vector yR) +.. c:function:: int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) Resets the current SPRKStep time-stepper module state to the provided independent variable value and dependent variable vector. diff --git a/doc/arkode/guide/source/Usage/User_supplied.rst b/doc/arkode/guide/source/Usage/User_supplied.rst index becfdd3775..96463b73e9 100644 --- a/doc/arkode/guide/source/Usage/User_supplied.rst +++ b/doc/arkode/guide/source/Usage/User_supplied.rst @@ -79,7 +79,7 @@ the ODE system function to ERKStep, or the "slow" right-hand side of the ODE system to MRIStep: -.. c:type:: int (*ARKRhsFn)(realtype t, N_Vector y, N_Vector ydot, void* user_data) +.. c:type:: int (*ARKRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) These functions compute the ODE right-hand side for a given value of the independent variable :math:`t` and state vector :math:`y`. @@ -257,7 +257,7 @@ such that the error estimate for the next time step remains below 1. -.. c:type:: int (*ARKAdaptFn)(N_Vector y, realtype t, realtype h1, realtype h2, realtype h3, realtype e1, realtype e2, realtype e3, int q, int p, realtype* hnew, void* user_data) +.. c:type:: int (*ARKAdaptFn)(N_Vector y, sunrealtype t, sunrealtype h1, sunrealtype h2, sunrealtype h3, sunrealtype e1, sunrealtype e2, sunrealtype e3, int q, int p, sunrealtype* hnew, void* user_data) This function implements a time step adaptivity algorithm that chooses :math:`h` to satisfy the error tolerances. @@ -305,7 +305,7 @@ step, and the accuracy-based time step. -.. c:type:: int (*ARKExpStabFn)(N_Vector y, realtype t, realtype* hstab, void* user_data) +.. c:type:: int (*ARKExpStabFn)(N_Vector y, sunrealtype t, sunrealtype* hstab, void* user_data) This function predicts the maximum stable step size for the explicit portion of the ODE system. @@ -350,7 +350,7 @@ recommended that the user *not* call :c:func:`ARKStepSetPredictorMethod` or -.. c:type:: int (*ARKStagePredictFn)(realtype t, N_Vector zpred, void* user_data) +.. c:type:: int (*ARKStagePredictFn)(sunrealtype t, N_Vector zpred, void* user_data) This function updates the prediction for the implicit stage solution. @@ -388,7 +388,7 @@ ODE system, the user must supply a function of type :c:type:`ARKRootFn`. -.. c:type:: int (*ARKRootFn)(realtype t, N_Vector y, realtype* gout, void* user_data) +.. c:type:: int (*ARKRootFn)(sunrealtype t, N_Vector y, sunrealtype* gout, void* user_data) This function implements a vector-valued function :math:`g(t,y)` such that roots are sought for the components @@ -425,7 +425,7 @@ object was supplied to :c:func:`ARKStepSetLinearSolver` or -.. c:type:: int (*ARKLsJacFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*ARKLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the Jacobian matrix :math:`J(t,y) = \dfrac{\partial f^I}{\partial y}(t,y)` (or an approximation to it). @@ -513,7 +513,7 @@ object was supplied to :c:func:`ARKStepSetLinearSolver` or -.. c:type:: int (*ARKLsLinSysFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, booleantype jok, booleantype *jcur, realtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*ARKLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the linear system matrix :math:`\mathcal{A}(t,y) = M(t) - \gamma J(t,y)` (or an approximation to it). @@ -568,7 +568,7 @@ matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*ARKLsJacTimesVecFn)(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, void* user_data, N_Vector tmp) +.. c:type:: int (*ARKLsJacTimesVecFn)(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void* user_data, N_Vector tmp) This function computes the product :math:`Jv` where :math:`J(t,y) \approx \dfrac{\partial f^I}{\partial y}(t,y)` (or an approximation to it). @@ -617,7 +617,7 @@ user-supplied function of type :c:type:`ARKLsJacTimesSetupFn`, defined as follows: -.. c:type:: int (*ARKLsJacTimesSetupFn)(realtype t, N_Vector y, N_Vector fy, void* user_data) +.. c:type:: int (*ARKLsJacTimesSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, void* user_data) This function preprocesses and/or evaluates any Jacobian-related data needed by the Jacobian-times-vector routine. @@ -675,7 +675,7 @@ preconditioner matrices should approximate :math:`\mathcal{A}`. -.. c:type:: int (*ARKLsPrecSolveFn)(realtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, realtype gamma, realtype delta, int lr, void* user_data) +.. c:type:: int (*ARKLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void* user_data) This function solves the preconditioner system :math:`Pz=r`. @@ -721,7 +721,7 @@ preprocessed or evaluated, then these actions need to occur within a user-supplied function of type :c:type:`ARKLsPrecSetupFn`. -.. c:type:: int (*ARKLsPrecSetupFn)(realtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype* jcurPtr, realtype gamma, void* user_data) +.. c:type:: int (*ARKLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype* jcurPtr, sunrealtype gamma, void* user_data) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. @@ -799,7 +799,7 @@ the mass matrix approximation. -.. c:type:: int (*ARKLsMassFn)(realtype t, SUNMatrix M, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*ARKLsMassFn)(sunrealtype t, SUNMatrix M, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the mass matrix :math:`M(t)` (or an approximation to it). @@ -870,7 +870,7 @@ compute matrix-vector products :math:`M(t)\, v`. -.. c:type:: int (*ARKLsMassTimesVecFn)(N_Vector v, N_Vector Mv, realtype t, void* mtimes_data) +.. c:type:: int (*ARKLsMassTimesVecFn)(N_Vector v, N_Vector Mv, sunrealtype t, void* mtimes_data) This function computes the product :math:`M(t)\, v` (or an approximation to it). @@ -901,7 +901,7 @@ be done in a user-supplied function of type -.. c:type:: int (*ARKLsMassTimesSetupFn)(realtype t, void* mtimes_data) +.. c:type:: int (*ARKLsMassTimesSetupFn)(sunrealtype t, void* mtimes_data) This function preprocesses and/or evaluates any mass-matrix-related data needed by the mass-matrix-times-vector routine. @@ -934,7 +934,7 @@ both sides, the product of the two preconditioner matrices should approximate :math:`M(t)`. -.. c:type:: int (*ARKLsMassPrecSolveFn)(realtype t, N_Vector r, N_Vector z, realtype delta, int lr, void* user_data) +.. c:type:: int (*ARKLsMassPrecSolveFn)(sunrealtype t, N_Vector r, N_Vector z, sunrealtype delta, int lr, void* user_data) This function solves the preconditioner system :math:`Pz=r`. @@ -977,7 +977,7 @@ occur within a user-supplied function of type -.. c:type:: int (*ARKLsMassPrecSetupFn)(realtype t, void* user_data) +.. c:type:: int (*ARKLsMassPrecSetupFn)(sunrealtype t, void* user_data) This function preprocesses and/or evaluates mass-matrix-related data needed by the preconditioner. @@ -1067,7 +1067,7 @@ memory transfers of forcing data supplied by the outer integrator to the inner integrator for the inner integration. -.. c:type:: int (*MRIStepPreInnerFn)(realtype t, N_Vector* f, int num_vecs, void* user_data) +.. c:type:: int (*MRIStepPreInnerFn)(sunrealtype t, N_Vector* f, int num_vecs, void* user_data) **Arguments:** * *t* -- the current value of the independent variable. @@ -1098,7 +1098,7 @@ memory transfers of state data supplied by the inner integrator to the outer integrator for the outer integration. -.. c:type:: int (*MRIStepPostInnerFn)(realtype t, N_Vector y, void* user_data) +.. c:type:: int (*MRIStepPostInnerFn)(sunrealtype t, N_Vector y, void* user_data) **Arguments:** * *t* -- the current value of the independent variable. @@ -1122,7 +1122,7 @@ outer integrator for the outer integration. Relaxation function ------------------- -.. c:type:: int (*ARKRelaxFn)(N_Vector y, realtype* r, void* user_data) +.. c:type:: int (*ARKRelaxFn)(N_Vector y, sunrealtype* r, void* user_data) When applying relaxation, an :c:func:`ARKRelaxFn` function is required to compute the conservative or dissipative function :math:`\xi(y)`. diff --git a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst index bb9466bf35..67dd93512d 100644 --- a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst @@ -107,7 +107,7 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. -.. c:function:: int ARKStepGetNonlinearSystemData(void* arkode_mem, realtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, realtype *gamma, N_Vector *sdata, void **user_data) +.. c:function:: int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, sunrealtype *gamma, N_Vector *sdata, void **user_data) Returns all internal data required to construct the current nonlinear implicit system :eq:`ARKODE_Residual_corrector` or :eq:`ARKODE_FixedPt_corrector`: @@ -203,7 +203,7 @@ Additional advanced output functions that are provided to aid in the constructio of user-supplied SUNNonlinSol modules are as follows. -.. c:function:: int MRIStepGetNonlinearSystemData(void* arkode_mem, realtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, realtype *gamma, N_Vector *sdata, void **user_data) +.. c:function:: int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, sunrealtype *gamma, N_Vector *sdata, void **user_data) Returns all internal data required to construct the current nonlinear implicit system :eq:`ARKODE_Residual_corrector` or :eq:`ARKODE_FixedPt_corrector`: diff --git a/doc/cvode/cv_ex_serial.tex b/doc/cvode/cv_ex_serial.tex index d011a0a14f..35d62d5f79 100644 --- a/doc/cvode/cv_ex_serial.tex +++ b/doc/cvode/cv_ex_serial.tex @@ -33,8 +33,8 @@ \subsection{A dense example: cvRoberts\_dns}\label{ss:cvRoberts} Following the initial comment block, this program has a number of \id{\#include} lines, which allow access to useful items in {\cvode} header files. The \id{sundials\_types.h} file provides the definition of the -type \id{realtype} (see \ugref{s:types} for details). -For now, it suffices to read \id{realtype} as \id{double}. +type \id{sunrealtype} (see \ugref{s:types} for details). +For now, it suffices to read \id{sunrealtype} as \id{double}. The \id{cvode.h} file provides prototypes for the {\cvode} functions to be called (excluding the linear solver selection function), and also a number of constants that are to be used in @@ -407,7 +407,7 @@ \subsection{A Krylov example: cvDiurnal\_kry}\label{ss:cvDiurnal} contains constants and function prototypes associated with the {\sunlinsolspgmr} module, including the values of the \id{pretype} argument to \id{SUNLinSol\_SPGMR}. The inclusion of \id{sundials\_math.h} is -done to access the \id{SUNSQR} macro for the square of a \id{realtype} +done to access the \id{SUNSQR} macro for the square of a \id{sunrealtype} number. The \id{main} program calls \id{CVodeCreate} specifying the \id{CV\_BDF} method @@ -474,7 +474,7 @@ \subsection{A Krylov example: cvDiurnal\_kry}\label{ss:cvDiurnal} this program. While the generic {\sunlinsoldense} linear solver module serves as the interface to dense matrix solves for the main {\sundials} solvers, the underlying algebraic operations operate on -dense matrices with \id{realtype **} as the underlying dense matrix +dense matrices with \id{sunrealtype **} as the underlying dense matrix type. To avoid the extra layer of function calls and dense matrix and linear solver data structures, \id{cvDiurnal\_kry.c} uses underling small dense functions for all operations on the $2 \times 2$ preconditioner blocks. diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 1bfd789b52..71afaafce1 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -101,7 +101,7 @@ required is: * ``cvode/cvode.h`` the main header file for CVODE, which defines the several types and various constants, and includes function prototypes. This includes the header file for CVLS, ``cvode/cvode_ls.h``. -Note that ``cvode.h`` includes ``sundials_types.h``, which defines the types, ``realtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. +Note that ``cvode.h`` includes ``sundials_types.h``, which defines the types, ``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation header file, of the form ``nvector/nvector_*.h``. See :numref:`NVectors` for the appropriate name. This file in turn includes the header file ``sundials_nvector.h`` which defines the abstract data type. @@ -325,7 +325,7 @@ calls. :c:func:`CVodeSetNonlinearSolver`. -.. c:function:: int CVodeInit(void* cvode_mem, CVRhsFn f, realtype t0, N_Vector y0) +.. c:function:: int CVodeInit(void* cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0) The function ``CVodeInit`` provides required problem and solution specifications, allocates internal memory, and initializes CVODE. @@ -369,7 +369,7 @@ integration tolerances (or directly specify the weights used in evaluating WRMS vector norms). Note that this call must be made after the call to :c:func:`CVodeInit` -.. c:function:: int CVodeSStolerances(void* cvode_mem, realtype reltol, realtype abstol) +.. c:function:: int CVodeSStolerances(void* cvode_mem, sunrealtype reltol, sunrealtype abstol) The function ``CVodeSStolerances`` specifies scalar relative and absolute tolerances. @@ -384,7 +384,7 @@ the call to :c:func:`CVodeInit` * ``CV_NO_MALLOC`` -- The allocation function returned ``NULL`` * ``CV_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int CVodeSVtolerances(void* cvode_mem, realtype reltol, N_Vector abstol) +.. c:function:: int CVodeSVtolerances(void* cvode_mem, sunrealtype reltol, N_Vector abstol) The function ``CVodeSVtolerances`` specifies scalar relative tolerance and vector absolute tolerances. @@ -713,7 +713,7 @@ of two modes as to where CVODE is to return a solution. But these modes are modified if the user has set a stop time (with :c:func:`CVodeSetStopTime`) or requested rootfinding. -.. c:function:: int CVode(void* cvode_mem, realtype tout, N_Vector yout, realtype* tret, int itask) +.. c:function:: int CVode(void* cvode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask) The function ``CVode`` integrates the ODE over an interval in t. @@ -1026,7 +1026,7 @@ Main solver optional input functions **Notes:** The default value is ``SUNFALSE``. If ``stldet = SUNTRUE`` when BDF is used and the method order is greater than or equal to 3, then an internal function, ``CVsldet``, is called to detect a possible stability limit. If such a limit is detected, then the order is reduced. -.. c:function:: int CVodeSetInitStep(void* cvode_mem, realtype hin) +.. c:function:: int CVodeSetInitStep(void* cvode_mem, sunrealtype hin) The function ``CVodeSetInitStep`` specifies the initial step size. @@ -1041,7 +1041,7 @@ Main solver optional input functions **Notes:** By default, CVODE estimates the initial step size to be the solution :math:`h` of the equation :math:`0.5 h^2 \ddot{y} = 1`, where :math:`\ddot{y}` is an estimated second derivative of the solution at :math:`t_0`. -.. c:function:: int CVodeSetMinStep(void* cvode_mem, realtype hmin) +.. c:function:: int CVodeSetMinStep(void* cvode_mem, sunrealtype hmin) The function ``CVodeSetMinStep`` specifies a lower bound on the magnitude of the step size. @@ -1057,7 +1057,7 @@ Main solver optional input functions **Notes:** The default value is 0.0. -.. c:function:: int CVodeSetMaxStep(void* cvode_mem, realtype hmax) +.. c:function:: int CVodeSetMaxStep(void* cvode_mem, sunrealtype hmax) The function ``CVodeSetMaxStep`` specifies an upper bound on the magnitude of the step size. @@ -1073,7 +1073,7 @@ Main solver optional input functions **Notes:** Pass ``hmax`` = 0.0 to obtain the default value :math:`\infty`. -.. c:function:: int CVodeSetStopTime(void* cvode_mem, realtype tstop) +.. c:function:: int CVodeSetStopTime(void* cvode_mem, sunrealtype tstop) The function ``CVodeSetStopTime`` specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -1281,7 +1281,7 @@ difference approximation or a call to the :ref:`user-supplied Jacobian function :math:`M(t,y) \approx I - \gamma J(t,y)` is recomputed using the current :math:`\gamma` value. -.. c:function:: int CVodeSetDeltaGammaMaxLSetup(void* cvode_mem, realtype dgmax_lsetup) +.. c:function:: int CVodeSetDeltaGammaMaxLSetup(void* cvode_mem, sunrealtype dgmax_lsetup) The function ``CVodeSetDeltaGammaMaxLSetup`` specifies the maximum allowed :math:`\gamma` change that does not require a linear solver setup call. If @@ -1301,7 +1301,7 @@ difference approximation or a call to the :ref:`user-supplied Jacobian function .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetDeltaGammaMaxBadJac(void* cvode_mem, realtype dgmax_jbad) +.. c:function:: int CVodeSetDeltaGammaMaxBadJac(void* cvode_mem, sunrealtype dgmax_jbad) The function ``CVodeSetDeltaGammaMaxBadJac`` specifies the maximum allowed :math:`\gamma` change after a NLS failure that requires updating the Jacobian @@ -1601,7 +1601,7 @@ the :c:func:`CVodeSetEpsLin` function. The previous routine ``CVSpilsSetPreconditioner`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. -.. c:function:: int CVodeSetEpsLin(void* cvode_mem, realtype eplifac) +.. c:function:: int CVodeSetEpsLin(void* cvode_mem, sunrealtype eplifac) The function ``CVodeSetEpsLin`` specifies the factor by which the Krylov linear solver's convergence test constant is reduced from the nonlinear solver test constant. @@ -1625,7 +1625,7 @@ the :c:func:`CVodeSetEpsLin` function. The previous routine ``CVSpilsSetEpsLin`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. -.. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, realtype nrmfac) +.. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) The function ``CVodeSetLSNormFactor`` specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. @@ -1706,7 +1706,7 @@ nonlinear solver. **Notes:** The default value is 10. -.. c:function:: int CVodeSetNonlinConvCoef(void* cvode_mem, realtype nlscoef) +.. c:function:: int CVodeSetNonlinConvCoef(void* cvode_mem, sunrealtype nlscoef) The function ``CVodeSetNonlinConvCoef`` specifies the safety factor used in the nonlinear convergence test (see :numref:`CVODE.Mathematics.ivp_sol`). @@ -1804,7 +1804,7 @@ step size adaptivity. make changes gradually and with testing to determine their effectiveness. -.. c:function:: int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, realtype eta_max_fx) +.. c:function:: int CVodeSetEtaFixedStepBounds(void* cvode_mem, sunrealtype eta_min_fx, sunrealtype eta_max_fx) The function ``CVodeSetEtaFixedStepBounds`` specifies the interval lower (:math:`\eta_{\mathrm{min\_fx}}`) and upper (:math:`\eta_{\mathrm{max\_fx}}`) @@ -1830,7 +1830,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs) +.. c:function:: int CVodeSetEtaMaxFirstStep(void* cvode_mem, sunrealtype eta_max_fs) The function ``CVodeSetEtaMaxFirstStep`` specifies the maximum step size factor after the first time step, :math:`\eta_{\mathrm{max\_fs}}`. @@ -1849,7 +1849,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMaxEarlyStep(void* cvode_mem, realtype eta_max_es) +.. c:function:: int CVodeSetEtaMaxEarlyStep(void* cvode_mem, sunrealtype eta_max_es) The function ``CVodeSetEtaMaxEarlyStepEtaMax`` specifies the maximum step size factor for steps early in the integration, @@ -1906,7 +1906,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs) +.. c:function:: int CVodeSetEtaMax(void* cvode_mem, sunrealtype eta_max_gs) The function ``CVodeSetEtaMax`` specifies the maximum step size factor, :math:`\eta_{\mathrm{max\_gs}}`. @@ -1933,7 +1933,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMin(void* cvode_mem, realtype eta_min) +.. c:function:: int CVodeSetEtaMin(void* cvode_mem, sunrealtype eta_min) The function ``CVodeSetEtaMin`` specifies the minimum step size factor, :math:`\eta_{\mathrm{min}}`. @@ -1952,7 +1952,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMinErrFail(void *cvode_mem, realtype eta_min_ef) +.. c:function:: int CVodeSetEtaMinErrFail(void *cvode_mem, sunrealtype eta_min_ef) The function ``CVodeSetEtaMinErrFail`` specifies the minimum step size factor after an error test failure, :math:`\eta_{\mathrm{min\_ef}}`. @@ -1972,7 +1972,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMaxErrFail(void* cvode_mem, realtype eta_max_ef) +.. c:function:: int CVodeSetEtaMaxErrFail(void* cvode_mem, sunrealtype eta_max_ef) The function ``CVodeSetEtaMaxErrFail`` specifies the maximum step size factor after multiple error test failures, :math:`\eta_{\mathrm{max\_ef}}`. @@ -2025,7 +2025,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf) +.. c:function:: int CVodeSetEtaConvFail(void* cvode_mem, sunrealtype eta_cf) The function ``CVodeSetEtaConvFail`` specifies the step size factor after a nonlinear solver failure :math:`\eta_{\mathrm{cf}}`. @@ -2172,7 +2172,7 @@ the projection when solving an IVP with constraints. .. versionadded:: 5.3.0 -.. c:function:: int CVodeSetEpsProj(void* cvode_mem, realtype eps) +.. c:function:: int CVodeSetEpsProj(void* cvode_mem, sunrealtype eps) The function ``CVodeSetEpsProj`` specifies the tolerance for the nonlinear constrained least squares problem solved by the projection function. @@ -2187,7 +2187,7 @@ the projection when solving an IVP with constraints. .. versionadded:: 5.3.0 -.. c:function:: int CVodeSetProjFailEta(void* cvode_mem, realtype eta) +.. c:function:: int CVodeSetProjFailEta(void* cvode_mem, sunrealtype eta) The function ``CVodeSetProjFailEta`` specifies the time step reduction factor to apply on a projection function failure. @@ -2216,7 +2216,7 @@ value of :math:`t` in the last internal step taken by CVODE. The call to the function has the following form: -.. c:function:: int CVodeGetDky(void* cvode_mem, realtype t, int k, N_Vector dky) +.. c:function:: int CVodeGetDky(void* cvode_mem, sunrealtype t, int k, N_Vector dky) The function ``CVodeGetDky`` computes the ``k``-th derivative of the function ``y`` at time ``t``, i.e. :math:`\dfrac{\mathrm d^{k}y}{\mathrm dt^{k}}(t)`, where :math:`t_n - h_u \leq t \leq t_n`, :math:`t_n` denotes the current internal time reached, and :math:`h_u` is the last internal step size successfully used by the solver. The user may request ``k`` = :math:`0, 1, \ldots, q_u`, where :math:`q_u` is the current order (optional output ``qlast``). @@ -2394,7 +2394,7 @@ described next. **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``lenrw`` -- the number of ``realtype`` values in the CVODE workspace. + * ``lenrw`` -- the number of ``sunrealtype`` values in the CVODE workspace. * ``leniw`` -- the number of integer values in the CVODE workspace. **Return value:** @@ -2402,7 +2402,7 @@ described next. * ``CV_MEM_NULL`` -- The CVODE memory block was not initialized through a previous call to :c:func:`CVodeCreate`. **Notes:** - In terms of the problem size :math:`N`, the maximum method order :math:`\texttt{maxord}`, and the number :math:`\texttt{nrtfn}` of root functions (see :numref:`CVODE.Usage.CC.cvrootinit`) the actual size of the real workspace, in ``realtype`` words, is given by the following: + In terms of the problem size :math:`N`, the maximum method order :math:`\texttt{maxord}`, and the number :math:`\texttt{nrtfn}` of root functions (see :numref:`CVODE.Usage.CC.cvrootinit`) the actual size of the real workspace, in ``sunrealtype`` words, is given by the following: * base value: :math:`\texttt{lenrw} = 96 + ( \texttt{maxord} + 5) N_r + 3\texttt{nrtfn}`; @@ -2531,7 +2531,7 @@ described next. -.. c:function:: int CVodeGetLastStep(void* cvode_mem, realtype *hlast) +.. c:function:: int CVodeGetLastStep(void* cvode_mem, sunrealtype *hlast) The function ``CVodeGetLastStep`` returns the integration step size taken on the last internal step. @@ -2545,7 +2545,7 @@ described next. -.. c:function:: int CVodeGetCurrentStep(void* cvode_mem, realtype *hcur) +.. c:function:: int CVodeGetCurrentStep(void* cvode_mem, sunrealtype *hcur) The function ``CVodeGetCurrentStep`` returns the integration step size to be attempted on the next internal step. @@ -2559,7 +2559,7 @@ described next. -.. c:function:: int CVodeGetActualInitStep(void* cvode_mem, realtype *hinused) +.. c:function:: int CVodeGetActualInitStep(void* cvode_mem, sunrealtype *hinused) The function ``CVodeGetActualInitStep`` returns the value of the integration step size used on the first step. @@ -2576,7 +2576,7 @@ described next. -.. c:function:: int CVodeGetCurrentTime(void* cvode_mem, realtype *tcur) +.. c:function:: int CVodeGetCurrentTime(void* cvode_mem, sunrealtype *tcur) The function ``CVodeGetCurrentTime`` returns the current internal time reached by the solver. @@ -2607,7 +2607,7 @@ described next. -.. c:function:: int CVodeGetTolScaleFactor(void* cvode_mem, realtype *tolsfac) +.. c:function:: int CVodeGetTolScaleFactor(void* cvode_mem, sunrealtype *tolsfac) The function ``CVodeGetTolScaleFactor`` returns a suggested factor by which the user's tolerances should be scaled when too much accuracy has been requested for some internal step. @@ -2661,7 +2661,7 @@ described next. -.. c:function:: int CVodeGetIntegratorStats(void* cvode_mem, long int *nsteps, long int *nfevals, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, realtype *hinused, realtype *hlast, realtype *hcur, realtype *tcur) +.. c:function:: int CVodeGetIntegratorStats(void* cvode_mem, long int *nsteps, long int *nfevals, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, sunrealtype *hinused, sunrealtype *hlast, sunrealtype *hcur, sunrealtype *tcur) The function ``CVodeGetIntegratorStats`` returns the CVODE integrator statistics as a group. @@ -2936,7 +2936,7 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``lenrwLS`` -- the number of ``realtype`` values in the CVLS workspace. + * ``lenrwLS`` -- the number of ``sunrealtype`` values in the CVLS workspace. * ``leniwLS`` -- the number of integer values in the CVLS workspace. **Return value:** @@ -3156,7 +3156,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``lenrwLS`` -- the number of ``realtype`` values in the CVDIAG workspace. + * ``lenrwLS`` -- the number of ``sunrealtype`` values in the CVDIAG workspace. * ``leniwLS`` -- the number of integer values in the CVDIAG workspace. **Return value:** @@ -3165,7 +3165,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). * ``CVDIAG_LMEM_NULL`` -- The CVDIAG linear solver has not been initialized. **Notes:** - In terms of the problem size :math:`N`, the actual size of the real workspace is roughly :math:`3 N` ``realtype`` words. + In terms of the problem size :math:`N`, the actual size of the real workspace is roughly :math:`3 N` ``sunrealtype`` words. .. c:function:: int CVDiagGetNumRhsEvals(void* cvode_mem, long int *nfevalsLS) @@ -3256,7 +3256,7 @@ comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int CVodeReInit(void* cvode_mem, realtype t0, N_Vector y0) +.. c:function:: int CVodeReInit(void* cvode_mem, sunrealtype t0, N_Vector y0) The function ``CVodeReInit`` provides required problem specifications and reinitializes CVODE. @@ -3299,7 +3299,7 @@ ODE right-hand side The user must provide a function of type defined as follows: -.. c:type:: int (*CVRhsFn)(realtype t, N_Vector y, N_Vector ydot, void *user_data); +.. c:type:: int (*CVRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); This function computes the ODE right-hand side for a given value of the independent variable :math:`t` and state vector :math:`y`. @@ -3439,7 +3439,7 @@ If a rootfinding problem is to be solved during the integration of the ODE system, the user must supply a C function of type ``CVRootFn``, defined as follows: -.. c:type:: int (*CVRootFn)(realtype t, N_Vector y, realtype *gout, void *user_data); +.. c:type:: int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); This function implements a vector-valued function :math:`g(t,y)` such that the roots of the ``nrtfn`` components :math:`g_i(t,y)` are sought. @@ -3465,7 +3465,7 @@ When solving an IVP with a constraint equation and providing a user-defined projection operation the projection function must have type ``CVProjFn``, defined as follows: -.. c:type:: int (*CVProjFn)(realtype t, N_Vector ycur, N_Vector corr, realtype epsProj, N_Vector err, void *user_data); +.. c:type:: int (*CVProjFn)(sunrealtype t, N_Vector ycur, N_Vector corr, sunrealtype epsProj, N_Vector err, void *user_data); This function computes the projection of the solution and, if enabled, the error on to the constraint manifold. @@ -3507,7 +3507,7 @@ a function of type ``CVLsJacFn`` for evaluating the Jacobian of the ODE right-ha side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: -.. c:type:: int (*CVLsJacFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +.. c:type:: int (*CVLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); This function computes the Jacobian matrix :math:`J = \dfrac{\partial f}{\partial y}` (or an approximation to it). @@ -3591,7 +3591,7 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: :math:`\le m-n \le` ``mlower``. Alternatively, ``SM_COLUMN_B(J, j)`` returns a pointer to the diagonal element of the :math:`j`-th column of ``Jac``, and if we assign this address - to ``realtype *col_j``, then the :math:`i`-th element of the + to ``sunrealtype *col_j``, then the :math:`i`-th element of the :math:`j`-th column is given by ``SM_COLUMN_ELEMENT_B(col_j, i, j)``, counting from 0. Thus, for :math:`(m,n)` within the band, :math:`J(m,n)` can be loaded by setting @@ -3637,7 +3637,7 @@ side function, the user may optionally supply a function of type ``CVLsLinSysFn` for evaluating the linear system, :math:`M = I - \gamma J` (or an approximation of it). ``CVLsLinSysFn`` is defined as follows: -.. c:type:: int (*CVLsLinSysFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix M, booleantype jok, booleantype *jcur, realtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +.. c:type:: int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix M, booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); This function computes the linear system matrix :math:`M = I - \gamma J` (or an approximation to it). @@ -3667,7 +3667,7 @@ provide a function of type :c:type:`CVLsJacTimesVecFn` in the following form, to compute matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); +.. c:type:: int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); This function computes the product :math:`Jv = \dfrac{\partial f(t,y)}{\partial y} v` (or an approximation to it). @@ -3710,7 +3710,7 @@ If the user’s Jacobian-times-vector routine requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`CVLsJacTimesSetupFn`, defined as follows: -.. c:type:: int (*CVLsJacTimesSetupFn)(realtype t, N_Vector y, N_Vector fy, void *user_data); +.. c:type:: int (*CVLsJacTimesSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, void *user_data); This function preprocesses and/or evaluates Jacobian-related data needed by the Jacobian-times-vector routine. @@ -3761,7 +3761,7 @@ crudely) the matrix :math:`M = I - \gamma J`, where sides, the product of the two preconditioner matrices should approximate :math:`M`. This function must be of type :c:type:`CVLsPrecSolveFn`, defined as follows: -.. c:type:: int (*CVLsPrecSolveFn)(realtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, realtype gamma, realtype delta, int lr, void *user_data); +.. c:type:: int (*CVLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); This function solves the preconditioned system :math:`Pz = r`. @@ -3798,7 +3798,7 @@ If the user’s preconditioner requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type , defined as follows: -.. c:type:: int (*CVLsPrecSetupFn)(realtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, realtype gamma, void *user_data); +.. c:type:: int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, sunrealtype gamma, void *user_data); This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. @@ -3985,7 +3985,7 @@ the CVBANDPRE module: **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``lenrwBP`` -- the number of ``realtype`` values in teh CVBANDPRE workspace. + * ``lenrwBP`` -- the number of ``sunrealtype`` values in teh CVBANDPRE workspace. * ``leniwBP`` -- the number of integer values in the CVBANDPRE workspace. **Return value:** @@ -4117,7 +4117,7 @@ The user is responsible for providing space (presumably within ``user_data``) for components of :math:`y` that are communicated between processes by ``cfn``, and that are then used by ``gloc``, which should not do any communication. -.. c:type:: int (*CVLocalFn)(sunindextype Nlocal, realtype t, N_Vector y, N_Vector glocal, void *user_data); +.. c:type:: int (*CVLocalFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector glocal, void *user_data); This ``gloc`` function computes :math:`g(t,y)`. It loads the vector ``glocal`` as a function of ``t`` and ``y``. @@ -4142,7 +4142,7 @@ that are then used by ``gloc``, which should not do any communication. The case where :math:`g` is mathematically identical to :math:`f` is allowed. -.. c:type:: int (*CVCommFn)(sunindextype Nlocal, realtype t, N_Vector y, void *user_data); +.. c:type:: int (*CVCommFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, void *user_data); This ``cfn`` function performs all interprocess communication necessary for the execution of the ``gloc`` function above, using the input vector ``y``. @@ -4254,7 +4254,7 @@ The user-callable functions that initialize or re-initialize the CVBBDPRE preconditioner module are described next. -.. c:function:: int CVBBDPrecInit(void* cvode_mem, sunindextype local_N, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, realtype dqrely, CVLocalFn gloc, CVCommFn cfn) +.. c:function:: int CVBBDPrecInit(void* cvode_mem, sunindextype local_N, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dqrely, CVLocalFn gloc, CVCommFn cfn) The function ``CVBBDPrecInit`` initializes and allocates (internal) memory for the CVBBDPRE preconditioner. @@ -4308,7 +4308,7 @@ one or more of the corresponding CVLS "set" functions, must also be made (in the proper order). -.. c:function:: int CVBBDPrecReInit(void* cvode_mem, sunindextype mudq, sunindextype mldq, realtype dqrely) +.. c:function:: int CVBBDPrecReInit(void* cvode_mem, sunindextype mudq, sunindextype mldq, sunrealtype dqrely) The function ``CVBBDPrecReInit`` re-initializes the CVBBDPRE preconditioner. @@ -4338,7 +4338,7 @@ the CVBBDPRE module: **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``lenrwBBDP`` -- local number of ``realtype`` values in the CVBBDPRE workspace. + * ``lenrwBBDP`` -- local number of ``sunrealtype`` values in the CVBBDPRE workspace. * ``leniwBBDP`` -- local number of integer values in the CVBBDPRE workspace. **Return value:** diff --git a/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst b/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst index de10a67328..7e4dffc28f 100644 --- a/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst +++ b/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst @@ -57,7 +57,7 @@ users, but might be useful for users who choose to provide their own implementation of the :c:type:`SUNNonlinearSolver` API. For example, such a user might need access to the current value of :math:`\gamma` to compute Jacobian data. -.. c:function:: int CVodeGetCurrentGamma(void* cvode_mem, realtype* gamma) +.. c:function:: int CVodeGetCurrentGamma(void* cvode_mem, sunrealtype* gamma) The function ``CVodeGetCurrentGamma`` returns the current value of the scalar :math:`gamma`. @@ -81,7 +81,7 @@ might need access to the current value of :math:`\gamma` to compute Jacobian dat * ``CV_SUCCESS`` -- The optional output value has been successfully set. * ``CV_MEM_NULL`` -- The CVODE memory block was ``NULL``. -.. c:function:: int CVodeGetNonlinearSystemData(void *cvode_mem, realtype *tcur, N_Vector *ypred, N_Vector *yn, N_Vector *fn, realtype *gamma, realtype *rl1, N_Vector *zn1, void **user_data) +.. c:function:: int CVodeGetNonlinearSystemData(void *cvode_mem, sunrealtype *tcur, N_Vector *ypred, N_Vector *yn, N_Vector *fn, sunrealtype *gamma, sunrealtype *rl1, N_Vector *zn1, void **user_data) The function ``CVodeGetNonlinearSystemData`` returns all internal data required to construct the current nonlinear system :eq:`CVODE_res_corrector` or :eq:`CVODE_fp_corrector`. diff --git a/doc/cvodes/cvs_ex_adj.tex b/doc/cvodes/cvs_ex_adj.tex index f63ca32a2d..00269acf6f 100644 --- a/doc/cvodes/cvs_ex_adj.tex +++ b/doc/cvodes/cvs_ex_adj.tex @@ -73,7 +73,7 @@ \subsection{A serial dense example: cvsRoberts\_ASAi\_dns}\label{ss:cvsRoberts_A of the {\nvector} module, {\nvecs}, the header files \id{sunmatrix\_dense.h} and \id{sunlinsol\_dense.h} for the dense {\sunmatrix} and {\sunlinsol} modules, the header file -\id{sundials\_types.h} for the definition of \id{realtype} and \id{sunindextype}, +\id{sundials\_types.h} for the definition of \id{sunrealtype} and \id{sunindextype}, and the file \id{sundials\_math.h} for the definition of the \id{SUNRabs} macro. %% diff --git a/doc/cvodes/cvs_ex_fwd.tex b/doc/cvodes/cvs_ex_fwd.tex index bcd3e5909d..ec8f23fa9e 100644 --- a/doc/cvodes/cvs_ex_fwd.tex +++ b/doc/cvodes/cvs_ex_fwd.tex @@ -79,7 +79,7 @@ \subsection{A serial nonstiff example: cvsAdvDiff\_FSA\_non} The \id{cvsAdvDiff\_FSA\_non.c} file begins by including several header files, including the main {\cvodes} header file, the \id{sundials\_types.h} header file for the -definition of the \id{realtype} type, and the {\nvecs} header file +definition of the \id{sunrealtype} type, and the {\nvecs} header file for the definitions of the serial \id{N\_Vector} type and operations on such vectors. Following that are definitions of problem constants and a data block for communication with the \id{f} routine. That block includes the problem parameters and the mesh @@ -203,7 +203,7 @@ \subsection{A serial dense example: cvsRoberts\_FSA\_dns} {\cvodes} to communicate parameter values to the right-hand side function \id{f}. In the \id{cvsRoberts\_FSA\_dns} example this is done by defining \id{data} to be of type \id{UserData}, i.e. a pointer to a structure which contains -an array of \id{NP} \id{realtype} values. +an array of \id{NP} \id{sunrealtype} values. Four user-supplied functions are defined. The function \id{f}, passed to \id{CVodeInit}, computes the right-hand side of the ODE (\ref{e:cvsRoberts_FSA_dns_ode}), while diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index 80e567f024..86063c03f1 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -383,7 +383,7 @@ use in Forward Sensitivity Analysis; for that, see :numref:`CVODES.Usage.FSA`. The call to this function has the form -.. c:function:: int CVodeF(void * cvode_mem, realtype tout, N_Vector yret, realtype* tret, int itask, int* ncheck) +.. c:function:: int CVodeF(void * cvode_mem, sunrealtype tout, N_Vector yret, sunrealtype* tret, int itask, int* ncheck) The function :c:func:`CVodeF` integrates the forward problem over an interval in :math:`t` and saves checkpointing data. @@ -466,7 +466,7 @@ case when the backward problem does not depend on the forward sensitivities, and one for the case when it does. These two functions are described next. -.. c:function:: int CVodeInitB(void * cvode_mem, int which, CVRhsFnB rhsB, realtype tB0, N_Vector yB0) +.. c:function:: int CVodeInitB(void * cvode_mem, int which, CVRhsFnB rhsB, sunrealtype tB0, N_Vector yB0) The function :c:func:`CVodeInitB` provides problem specification, allocates internal memory, and initializes the backward problem. @@ -501,7 +501,7 @@ user must call :c:func:`CVodeInitBS` instead of :c:func:`CVodeInitB`. Only the third argument of each function differs between these two functions. -.. c:function:: int CVodeInitBS(void * cvode_mem, int which, CVRhsFnBS rhsBS, realtype tB0, N_Vector yB0) +.. c:function:: int CVodeInitBS(void * cvode_mem, int which, CVRhsFnBS rhsBS, sunrealtype tB0, N_Vector yB0) The function :c:func:`CVodeInitBS` provides problem specification, allocates internal memory, and initializes the backward problem. @@ -538,7 +538,7 @@ associated with the previous backward problem. The call to the :c:func:`CVodeReInitB` function has the form -.. c:function:: int CVodeReInitB(void * cvode_mem, int which, realtype tB0, N_Vector yB0) +.. c:function:: int CVodeReInitB(void * cvode_mem, int which, sunrealtype tB0, N_Vector yB0) The function :c:func:`CVodeReInitB` reinitializes a CVODES backward problem. @@ -567,7 +567,7 @@ tolerances for the backward problem. Note that this call must be made after the call to :c:func:`CVodeInitB` or :c:func:`CVodeInitBS`. -.. c:function:: int CVodeSStolerancesB(void * cvode_mem, int which, realtype reltolB, realtype abstolB) +.. c:function:: int CVodeSStolerancesB(void * cvode_mem, int which, sunrealtype reltolB, sunrealtype abstolB) The function :c:func:`CVodeSStolerancesB` specifies scalar relative and absolute tolerances. @@ -741,7 +741,7 @@ sake of efficiency, it should be disabled for :c:func:`CVodeB` by first calling The call to :c:func:`CVodeB` has the form -.. c:function:: int CVodeB(void * cvode_mem, realtype tBout, int itaskB) +.. c:function:: int CVodeB(void * cvode_mem, sunrealtype tBout, int itaskB) The function :c:func:`CVodeB` integrates the backward ODE problem. @@ -786,7 +786,7 @@ repeated calls will eventually advance all problems to ``tBout``. To obtain the solution ``yB`` to the backward problem, call the function :c:func:`CVodeGetB` as follows: -.. c:function:: int CVodeGetB(void * cvode_mem, int which, realtype* tret, N_Vector yB) +.. c:function:: int CVodeGetB(void * cvode_mem, int which, sunrealtype* tret, N_Vector yB) The function :c:func:`CVodeGetB` provides the solution ``yB`` of the backward ODE problem. @@ -1124,7 +1124,7 @@ potentially non-differentiable factor. :c:type:`CVSpilsSetPrecSolveFnBS` is now deprecated. -.. c:function:: int CVodeSetEpsLinB(void * cvode_mem, int which, realtype eplifacB) +.. c:function:: int CVodeSetEpsLinB(void * cvode_mem, int which, sunrealtype eplifacB) The function :c:func:`CVodeSetEpsLinB` specifies the factor by which the Krylov linear solver's convergence test constant is reduced from the @@ -1150,7 +1150,7 @@ potentially non-differentiable factor. ``CVSpilsSetEpsLinB`` is now deprecated. -.. c:function:: int CVodeSetLSNormFactorB(void * cvode_mem, int which, realtype nrmfac) +.. c:function:: int CVodeSetLSNormFactorB(void * cvode_mem, int which, sunrealtype nrmfac) The function :c:func:`CVodeSetLSNormFactor` specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver @@ -1212,7 +1212,7 @@ which the backward solution has just been obtained with :c:func:`CVodeGetB`. In any case, it must be within the last checkpoint interval used by :c:func:`CVodeB`. -.. c:function:: int CVodeGetAdjY(void * cvode_mem, realtype t, N_Vector y) +.. c:function:: int CVodeGetAdjY(void * cvode_mem, sunrealtype t, N_Vector y) The function :c:func:`CVodeGetAdjY` returns the interpolated value of the forward solution :math:`y` during a backward integration. @@ -1246,11 +1246,11 @@ any case, it must be within the last checkpoint interval used by * ``ckpnt[i].my_addr`` (``void *``) -- address of current checkpoint in ``cvode_mem->cv_adj_mem`` * ``ckpnt[i].next_addr`` (``void *``) -- address of next checkpoint - * ``ckpnt[i].t0`` (``realtype``) -- start of checkpoint interval - * ``ckpnt[i].t1`` (``realtype``) -- end of checkpoint interval + * ``ckpnt[i].t0`` (``sunrealtype``) -- start of checkpoint interval + * ``ckpnt[i].t1`` (``sunrealtype``) -- end of checkpoint interval * ``ckpnt[i].nstep`` (``long int``) -- step counter at ckeckpoint ``t0`` * ``ckpnt[i].order`` (``int``) -- method order at checkpoint ``t0`` - * ``ckpnt[i].step`` (``realtype``) -- step size at checkpoint ``t0`` + * ``ckpnt[i].step`` (``sunrealtype``) -- step size at checkpoint ``t0`` Backward integration of quadrature equations @@ -1353,7 +1353,7 @@ To extract the values of the quadrature variables at the last return time of :c:func:`CVodeGetQuad`. -.. c:function:: int CVodeGetQuadB(void * cvode_mem, int which, realtype* tret, N_Vector yQB) +.. c:function:: int CVodeGetQuadB(void * cvode_mem, int which, sunrealtype* tret, N_Vector yQB) The function :c:func:`CVodeGetQuadB` returns the quadrature solution vector after a successful return from :c:func:`CVodeB`. @@ -1432,7 +1432,7 @@ ODE right-hand side for the backward problem If the backward problem does not depend on the forward sensitivities, the user must provide a ``rhsB`` function of type :c:type:`CVRhsFnB` defined as follows: -.. c:type:: int (*CVRhsFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) +.. c:type:: int (*CVRhsFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) This function evaluates the right-hand side :math:`f_B(t,y,y_B)` of the backward problem ODE system. This could be either :eq:`CVODES_adj_eqns` or :eq:`CVODES_adj1_eqns`. @@ -1480,7 +1480,7 @@ ODE right-hand side for the backward problem depending on the forward sensitivit If the backward problem does depend on the forward sensitivities, the user must provide a ``rhsBS`` function of type :c:type:`CVRhsFnBS` defined as follows: -.. c:type:: int (*CVRhsFnBS)(realtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector yBdot, void *user_dataB) +.. c:type:: int (*CVRhsFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector yBdot, void *user_dataB) This function evaluates the right-hand side :math:`f_B(t, y, y_B, s)` of the backward problem ODE system. This could be either :eq:`CVODES_adj_eqns` or @@ -1531,7 +1531,7 @@ Quadrature right-hand side for the backward problem The user must provide an ``fQB`` function of type :c:type:`CVQuadRhsFnB` defined by -.. c:type:: int (*CVQuadRhsFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB) +.. c:type:: int (*CVQuadRhsFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB) This function computes the quadrature equation right-hand side for the backward problem. @@ -1580,7 +1580,7 @@ Sensitivity-dependent quadrature right-hand side for the backward problem The user must provide an ``fQBS`` function of type :c:type:`CVQuadRhsFnBS` defined by -.. c:type:: int (*CVQuadRhsFnBS)(realtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector qBdot, void *user_dataB) +.. c:type:: int (*CVQuadRhsFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector qBdot, void *user_dataB) This function computes the quadrature equation right-hand side for the backward problem. @@ -1632,7 +1632,7 @@ non-``NULL`` ``SUNMatrix`` object was supplied to :c:func:`CVodeSetLinearSolverB`), the user may provide a function of type :c:type:`CVLsJacFnB` or :c:type:`CVLsJacFnBS`, defined as follows: -.. c:type:: int (*CVLsJacFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) +.. c:type:: int (*CVLsJacFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) This function computes the Jacobian of the backward problem (or an approximation to it). @@ -1681,7 +1681,7 @@ non-``NULL`` ``SUNMatrix`` object was supplied to that users transition to the new function type name soon. -.. c:type:: int (*CVLsJacFnBS)(realtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) +.. c:type:: int (*CVLsJacFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) This function computes the Jacobian of the backward problem (or an approximation to it), in the case where the backward problem depends on the @@ -1746,7 +1746,7 @@ function, the user may optionally supply a function of type :c:type:`CVLsLinSysF :c:type:`CVLsLinSysFnBS` for evaluating the linear system, :math:`M_B = I - \gamma_B J_B` (or an approximation of it) for the backward problem. -.. c:type:: int (*CVLsLinSysFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, realtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); +.. c:type:: int (*CVLsLinSysFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); This function computes the linear system of the backward problem (or an approximation to it). @@ -1787,7 +1787,7 @@ J_B` (or an approximation of it) for the backward problem. ``CVLS_JACFUNC_UNRECVR``). -.. c:type:: int (*CVLsLinSysFnBS)(realtype t, N_Vector y, N_Vector* yS, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, realtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); +.. c:type:: int (*CVLsLinSysFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); This function computes the linear system of the backward problem (or an approximation to it), in the case where the backward problem depends on the @@ -1844,7 +1844,7 @@ provide a function of type :c:type:`CVLsJacTimesVecFnB` or products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*CVLsJacTimesVecFnB)(N_Vector vB, N_Vector JvB, realtype t, N_Vector y, N_Vector yB, N_Vector fyB, void *jac_dataB, N_Vector tmpB); +.. c:type:: int (*CVLsJacTimesVecFnB)(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, void *jac_dataB, N_Vector tmpB); This function computes the action of the Jacobian ``JB`` for the backward problem on a given vector ``vB``. @@ -1877,7 +1877,7 @@ difference quotient approximation to these products. :c:type:`CVSpilsJacTimesVecFnB` is deprecated. -.. c:type:: int (*CVLsJacTimesVecFnBS)(N_Vector vB, N_Vector JvB, realtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *user_dataB, N_Vector tmpB); +.. c:type:: int (*CVLsJacTimesVecFnBS)(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *user_dataB, N_Vector tmpB); This function computes the action of the Jacobian ``JB`` for the backward problem on a given vector ``vB``, in the case where the backward problem @@ -1920,7 +1920,7 @@ data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`CVLsJacTimesSetupFnB` or :c:type:`CVLsJacTimesSetupFnBS`, defined as follows: -.. c:type:: int (*CVLsJacTimesSetupFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, void *user_dataB) +.. c:type:: int (*CVLsJacTimesSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, void *user_dataB) This function preprocesses and/or evaluates Jacobian data needed by the Jacobian-times-vector routine for the backward problem. @@ -1958,7 +1958,7 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or name soon. -.. c:type:: int (*CVLsJacTimesSetupFnBS)(realtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *user_dataB) +.. c:type:: int (*CVLsJacTimesSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *user_dataB) This function preprocesses and/or evaluates Jacobian data needed by the Jacobian-times-vector routine for the backward problem, in the case that the @@ -2012,7 +2012,7 @@ If preconditioning is done on both sides, the product of the two preconditioner matrices should approximate :math:`M_B`. This function must be of one of the following two types: -.. c:type:: int (*CVLsPrecSolveFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, N_Vector rvecB, N_Vector zvecB, realtype gammaB, realtype deltaB, void *user_dataB) +.. c:type:: int (*CVLsPrecSolveFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, N_Vector rvecB, N_Vector zvecB, sunrealtype gammaB, sunrealtype deltaB, void *user_dataB) This function solves the preconditioning system :math:`Pz = r` for the backward problem. @@ -2038,7 +2038,7 @@ following two types: The previous function type :c:type:`CVSpilsPrecSolveFnB` is deprecated. -.. c:type:: int (*CVLsPrecSolveFnBS)(realtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, N_Vector rvecB, N_Vector zvecB, realtype gammaB, realtype deltaB, void *user_dataB) +.. c:type:: int (*CVLsPrecSolveFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, N_Vector rvecB, N_Vector zvecB, sunrealtype gammaB, sunrealtype deltaB, void *user_dataB) This function solves the preconditioning system :math:`Pz = r` for the backward problem, in the case where the backward problem depends on the forward sensitivities. @@ -2074,7 +2074,7 @@ If the user’s preconditioner requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of one of the following two types: -.. c:type:: int (*CVLsPrecSetupFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, realtype gammaB, void *user_dataB) +.. c:type:: int (*CVLsPrecSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner for the backward problem. @@ -2103,7 +2103,7 @@ function of one of the following two types: name soon. -.. c:type:: int (*CVLsPrecSetupFnBS)(realtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, realtype gammaB, void *user_dataB) +.. c:type:: int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner for the backward problem, in the case where the backward @@ -2203,7 +2203,7 @@ iterative ``SUNLinearSolver`` object has been attached to CVODES via a call to :c:func:`CVodeSetLinearSolverB`. -.. c:function:: int CVBBDPrecInitB(void * cvode_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, realtype dqrelyB, CVBBDLocalFnB glocB, CVBBDCommFnB gcommB) +.. c:function:: int CVBBDPrecInitB(void * cvode_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, sunrealtype dqrelyB, CVBBDLocalFnB glocB, CVBBDCommFnB gcommB) The function :c:func:`CVBBDPrecInitB` initializes and allocates memory for the CVBBDPRE preconditioner for the backward problem. It creates, allocates, and @@ -2230,7 +2230,7 @@ iterative ``SUNLinearSolver`` object has been attached to CVODES via a call to * ``CVLS_ILL_INPUT`` -- An invalid parameter has been passed. -.. c:function:: int CVBBDPrecReInitB(void * cvode_mem, int which, sunindextype mudqB, sunindextype mldqB, realtype dqrelyB) +.. c:function:: int CVBBDPrecReInitB(void * cvode_mem, int which, sunindextype mudqB, sunindextype mldqB, sunrealtype dqrelyB) The function :c:func:`CVBBDPrecReInitB` reinitializes the CVBBDPRE preconditioner for the backward problem. @@ -2266,7 +2266,7 @@ communication necessary to evaluate this approximate right-hand side. The prototypes for these two functions are described below. -.. c:type:: int (*CVBBDLocalFnB)(sunindextype NlocalB, realtype t, N_Vector y, N_Vector yB, N_Vector gB, void *user_dataB) +.. c:type:: int (*CVBBDLocalFnB)(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yB, N_Vector gB, void *user_dataB) This ``glocB`` function loads the vector ``gB``, an approximation to the right-hand side :math:`f_B` of the backward problem, as a function of ``t``, @@ -2301,7 +2301,7 @@ prototypes for these two functions are described below. ``CV_LSETUP_FAIL``). -.. c:type:: int (*CVBBDCommFnB)(sunindextype NlocalB, realtype t, N_Vector y, N_Vector yB, void *user_dataB) +.. c:type:: int (*CVBBDCommFnB)(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yB, void *user_dataB) This ``gcommB`` function must perform all interprocess communications necessary for the execution of the ``glocB`` function above, using the input diff --git a/doc/cvodes/guide/source/Usage/FSA.rst b/doc/cvodes/guide/source/Usage/FSA.rst index 205dabf7bb..3cb13575eb 100644 --- a/doc/cvodes/guide/source/Usage/FSA.rst +++ b/doc/cvodes/guide/source/Usage/FSA.rst @@ -234,7 +234,7 @@ sensitivity analysis beyond those for IVP solution Upon completion of the integration, deallocate memory for the vectors ``yS0`` using ``N_VDestroyVectorArray(yS0, Ns);`` - If ``yS`` was created from ``realtype`` arrays ``yS_i``, it is the user’s + If ``yS`` was created from ``sunrealtype`` arrays ``yS_i``, it is the user’s responsibility to also free the space for the arrays ``yS0_i``. #. :silver:`Finalize MPI, if used` @@ -429,7 +429,7 @@ One of the following three functions must be called to specify the integration tolerances for sensitivities. Note that this call must be made after the call to :c:func:`CVodeSensInit` or :c:func:`CVodeSensInit1`. -.. c:function:: int CVodeSensSStolerances(void * cvode_mem, realtype reltolS, realtype* abstolS) +.. c:function:: int CVodeSensSStolerances(void * cvode_mem, sunrealtype reltolS, sunrealtype* abstolS) The function :c:func:`CVodeSensSStolerances` specifies scalar relative and absolute tolerances. @@ -446,7 +446,7 @@ the call to :c:func:`CVodeSensInit` or :c:func:`CVodeSensInit1`. * ``CV_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int CVodeSensSVtolerances(void * cvode_mem, realtype reltolS, N_Vector* abstolS) +.. c:function:: int CVodeSensSVtolerances(void * cvode_mem, sunrealtype reltolS, N_Vector* abstolS) The function :c:func:`CVodeSensSVtolerances` specifies scalar relative tolerance and vector absolute tolerances. @@ -617,7 +617,7 @@ solution :math:`y` in ``yout``. Solution sensitivities can be obtained through one of the following functions: -.. c:function:: int CVodeGetSens(void * cvode_mem, realtype * tret, N_Vector * yS) +.. c:function:: int CVodeGetSens(void * cvode_mem, sunrealtype * tret, N_Vector * yS) The function :c:func:`CVodeGetSens` returns the sensitivity solution vectors after a successful return from :c:func:`CVode`. @@ -644,7 +644,7 @@ function is called by :c:func:`CVodeGetSens` with ``k`` :math:`= 0`, but may als called directly by the user. -.. c:function:: int CVodeGetSensDky(void * cvode_mem, realtype t, int k, N_Vector * dkyS) +.. c:function:: int CVodeGetSensDky(void * cvode_mem, sunrealtype t, int k, N_Vector * dkyS) The function :c:func:`CVodeGetSensDky` returns derivatives of the sensitivity solution vectors after a successful return from :c:func:`CVode`. @@ -669,7 +669,7 @@ parameter in turn through the functions :c:func:`CVodeGetSens1` and :c:func:`CVodeGetSensDky1`, defined as follows: -.. c:function:: int CVodeGetSens1(void * cvode_mem, realtype * tret, int is, N_Vector yS) +.. c:function:: int CVodeGetSens1(void * cvode_mem, sunrealtype * tret, int is, N_Vector yS) The function :c:func:`CVodeGetSens1` returns the ``is``-th sensitivity solution vector after a successful return from :c:func:`CVode`. @@ -693,7 +693,7 @@ parameter in turn through the functions :c:func:`CVodeGetSens1` and will be the same as that returned at the last :c:func:`CVode` call. -.. c:function:: int CVodeGetSensDky1(void * cvode_mem, realtype t, int k, int is, N_Vector dkyS) +.. c:function:: int CVodeGetSensDky1(void * cvode_mem, sunrealtype t, int k, int is, N_Vector dkyS) The function :c:func:`CVodeGetSensDky1` returns the ``k``-th derivative of the ``is``-th sensitivity solution vector after a successful return from @@ -747,7 +747,7 @@ time and, if successful, takes effect immediately. =================================== ==================================== ============ -.. c:function:: int CVodeSetSensParams(void * cvode_mem, realtype * p, realtype * pbar, int * plist) +.. c:function:: int CVodeSetSensParams(void * cvode_mem, sunrealtype * p, sunrealtype * pbar, int * plist) The function :c:func:`CVodeSetSensParams` specifies problem parameter information for sensitivity calculations. @@ -776,7 +776,7 @@ time and, if successful, takes effect immediately. :c:func:`CVodeSensInit1`. -.. c:function:: int CVodeSetSensDQMethod(void * cvode_mem, int DQtype, realtype DQrhomax) +.. c:function:: int CVodeSetSensDQMethod(void * cvode_mem, int DQtype, sunrealtype DQrhomax) The function :c:func:`CVodeSetSensDQMethod` specifies the difference quotient strategy in the case in which the right-hand side of the sensitivity @@ -1177,7 +1177,7 @@ right-hand sides of the sensitivity equations :eq:`CVODES_sens_eqns`, for all sensitivity parameters at once, through a function of type :c:type:`CVSensRhsFn` defined by: -.. c:type:: int (*CVSensRhsFn)(int Ns, realtype t, N_Vector y, N_Vector ydot, N_Vector *yS, N_Vector *ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) +.. c:type:: int (*CVSensRhsFn)(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, N_Vector *yS, N_Vector *ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) This function computes the sensitivity right-hand side for all sensitivity equations at once. It must compute the vectors @@ -1227,7 +1227,7 @@ sensitivity parameter at a time, through a function of type :c:func:`CVodeSensInit1`. The type :c:type:`CVSensRhs1Fn` is defined by -.. c:type:: int (*CVSensRhs1Fn)(int Ns, realtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) +.. c:type:: int (*CVSensRhs1Fn)(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) This function computes the sensitivity right-hand side for one sensitivity equation at a time. It must compute the vector @@ -1471,7 +1471,7 @@ vectors, and quadratures depending on sensitivities at time ``t``. However, Sensitivity-dependent quadratures can be obtained using one of the following functions: -.. c:function:: int CVodeGetQuadSens(void * cvode_mem, realtype tret, N_Vector * yQS) +.. c:function:: int CVodeGetQuadSens(void * cvode_mem, sunrealtype tret, N_Vector * yQS) The function :c:func:`CVodeGetQuadSens` returns the quadrature sensitivities solution vectors after a successful return from :c:func:`CVode`. @@ -1494,7 +1494,7 @@ the interpolating polynomials for the sensitivity-dependent quadrature variables at time ``t``. This function is called by :c:func:`CVodeGetQuadSens` with ``k = 0``, but may also be called directly by the user. -.. c:function:: int CVodeGetQuadSensDky(void* cvode_mem, realtype t, int k, N_Vector* dkyQS) +.. c:function:: int CVodeGetQuadSensDky(void* cvode_mem, sunrealtype t, int k, N_Vector* dkyQS) The function :c:func:`CVodeGetQuadSensDky` returns derivatives of the quadrature sensitivities solution vectors after a successful return from @@ -1520,7 +1520,7 @@ Quadrature sensitivity solution vectors can also be extracted separately for each parameter in turn through the functions :c:func:`CVodeGetQuadSens1` and :c:func:`CVodeGetQuadSensDky1`, defined as follows: -.. c:function:: int CVodeGetQuadSens1(void * cvode_mem, realtype tret, int is, N_Vector yQS) +.. c:function:: int CVodeGetQuadSens1(void * cvode_mem, sunrealtype tret, int is, N_Vector yQS) The function :c:func:`CVodeGetQuadSens1` returns the ``is``-th sensitivity of quadratures after a successful return from :c:func:`CVode`. @@ -1540,7 +1540,7 @@ each parameter in turn through the functions :c:func:`CVodeGetQuadSens1` and * ``CV_BAD_DKY`` -- ``yQS`` is ``NULL``. -.. c:function:: int CVodeGetQuadSensDky1(void * cvode_mem, realtype t, int k, int is, N_Vector dkyQS) +.. c:function:: int CVodeGetQuadSensDky1(void * cvode_mem, sunrealtype t, int k, int is, N_Vector dkyQS) The function :c:func:`CVodeGetQuadSensDky1` returns the ``k``-th derivative of the ``is``-th sensitivity solution vector after a successful return from @@ -1600,7 +1600,7 @@ integration of sensitivity-dependent quadrature equations. to :c:func:`CVodeQuadSensInit`. -.. c:function:: int CVodeQuadSensSStolerances(void * cvode_mem, realtype reltolQS, realtype* abstolQS) +.. c:function:: int CVodeQuadSensSStolerances(void * cvode_mem, sunrealtype reltolQS, sunrealtype* abstolQS) The function :c:func:`CVodeQuadSensSStolerances` specifies scalar relative and absolute tolerances. @@ -1617,7 +1617,7 @@ integration of sensitivity-dependent quadrature equations. * ``CV_NO_QUADSENS`` -- Quadratures depending on the sensitivities were not activated. * ``CV_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int CVodeQuadSensSVtolerances(void * cvode_mem, realtype reltolQS, N_Vector* abstolQS) +.. c:function:: int CVodeQuadSensSVtolerances(void * cvode_mem, sunrealtype reltolQS, N_Vector* abstolQS) The function :c:func:`CVodeQuadSensSVtolerances` specifies scalar relative and vector absolute tolerances. @@ -1745,7 +1745,7 @@ integrand :math:`q`, the appropriate right-hand side functions are given by: :math:`\bar{q}_i = q_y s_i + q_{p_i}`. This user function must be of type ``CVQuadSensRhsFn`` defined as follows: -.. c:type:: int (*CVQuadSensRhsFn)(int Ns, realtype t, N_Vector y, N_Vector *yS, N_Vector yQdot, N_Vector *yQSdot, void *user_data, N_Vector tmp, N_Vector tmpQ) +.. c:type:: int (*CVQuadSensRhsFn)(int Ns, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yQdot, N_Vector *yQSdot, void *user_data, N_Vector tmp, N_Vector tmpQ) This function computes the sensitivity quadrature equation right-hand side for a given value of the independent variable :math:`t`` and state vector diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index 539f521ea7..d2c549e06a 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -109,7 +109,7 @@ required is: * ``cvodes/cvodes.h`` the main header file for CVODES, which defines the several types and various constants, and includes function prototypes. This includes the header file for CVLS, ``cvodes/cvodes_ls.h``. -Note that ``cvodes.h`` includes ``sundials_types.h``, which defines the types, ``realtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. +Note that ``cvodes.h`` includes ``sundials_types.h``, which defines the types, ``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation header file, of the form ``nvector/nvector_*.h``. See :numref:`NVectors` for the appropriate name. This file in turn includes the header file ``sundials_nvector.h`` which defines the abstract data type. @@ -328,7 +328,7 @@ calls. :c:func:`CVodeSetNonlinearSolver`. -.. c:function:: int CVodeInit(void* cvode_mem, CVRhsFn f, realtype t0, N_Vector y0) +.. c:function:: int CVodeInit(void* cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0) The function ``CVodeInit`` provides required problem and solution specifications, allocates internal memory, and initializes CVODES. @@ -372,7 +372,7 @@ integration tolerances (or directly specify the weights used in evaluating WRMS vector norms). Note that this call must be made after the call to :c:func:`CVodeInit`. -.. c:function:: int CVodeSStolerances(void* cvode_mem, realtype reltol, realtype abstol) +.. c:function:: int CVodeSStolerances(void* cvode_mem, sunrealtype reltol, sunrealtype abstol) The function ``CVodeSStolerances`` specifies scalar relative and absolute tolerances. @@ -387,7 +387,7 @@ the call to :c:func:`CVodeInit`. * ``CV_NO_MALLOC`` -- The allocation function returned ``NULL``. * ``CV_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int CVodeSVtolerances(void* cvode_mem, realtype reltol, N_Vector abstol) +.. c:function:: int CVodeSVtolerances(void* cvode_mem, sunrealtype reltol, N_Vector abstol) The function ``CVodeSVtolerances`` specifies scalar relative tolerance and vector absolute tolerances. @@ -721,7 +721,7 @@ of two modes as to where CVODES is to return a solution. But these modes are modified if the user has set a stop time (with :c:func:`CVodeSetStopTime`) or requested rootfinding. -.. c:function:: int CVode(void* cvode_mem, realtype tout, N_Vector yout, realtype* tret, int itask) +.. c:function:: int CVode(void* cvode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask) The function ``CVode`` integrates the ODE over an interval in t. @@ -1030,7 +1030,7 @@ Main solver optional input functions **Notes:** The default value is ``SUNFALSE``. If ``stldet = SUNTRUE`` when BDF is used and the method order is greater than or equal to 3, then an internal function, ``CVsldet``, is called to detect a possible stability limit. If such a limit is detected, then the order is reduced. -.. c:function:: int CVodeSetInitStep(void* cvode_mem, realtype hin) +.. c:function:: int CVodeSetInitStep(void* cvode_mem, sunrealtype hin) The function ``CVodeSetInitStep`` specifies the initial step size. @@ -1045,7 +1045,7 @@ Main solver optional input functions **Notes:** By default, CVODES estimates the initial step size to be the solution :math:`h` of the equation :math:`0.5 h^2 \ddot{y} = 1`, where :math:`\ddot{y}` is an estimated second derivative of the solution at :math:`t_0`. -.. c:function:: int CVodeSetMinStep(void* cvode_mem, realtype hmin) +.. c:function:: int CVodeSetMinStep(void* cvode_mem, sunrealtype hmin) The function ``CVodeSetMinStep`` specifies a lower bound on the magnitude of the step size. @@ -1061,7 +1061,7 @@ Main solver optional input functions **Notes:** The default value is 0.0. -.. c:function:: int CVodeSetMaxStep(void* cvode_mem, realtype hmax) +.. c:function:: int CVodeSetMaxStep(void* cvode_mem, sunrealtype hmax) The function ``CVodeSetMaxStep`` specifies an upper bound on the magnitude of the step size. @@ -1077,7 +1077,7 @@ Main solver optional input functions **Notes:** Pass ``hmax`` = 0.0 to obtain the default value :math:`\infty`. -.. c:function:: int CVodeSetStopTime(void* cvode_mem, realtype tstop) +.. c:function:: int CVodeSetStopTime(void* cvode_mem, sunrealtype tstop) The function ``CVodeSetStopTime`` specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -1277,7 +1277,7 @@ difference approximation or a call to the user-supplied Jacobian function is reused and the system matrix :math:`M(t,y) \approx I - \gamma J(t,y)` is recomputed using the current :math:`\gamma` value. -.. c:function:: int CVodeSetDeltaGammaMaxLSetup(void* cvode_mem, realtype dgmax_lsetup) +.. c:function:: int CVodeSetDeltaGammaMaxLSetup(void* cvode_mem, sunrealtype dgmax_lsetup) The function ``CVodeSetDeltaGammaMaxLSetup`` specifies the maximum allowed :math:`\gamma` change that does not require a linear solver setup call. If @@ -1297,7 +1297,7 @@ using the current :math:`\gamma` value. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetDeltaGammaMaxBadJac(void* cvode_mem, realtype dgmax_jbad) +.. c:function:: int CVodeSetDeltaGammaMaxBadJac(void* cvode_mem, sunrealtype dgmax_jbad) The function ``CVodeSetDeltaGammaMaxBadJac`` specifies the maximum allowed :math:`\gamma` change after a NLS failure that requires updating the Jacobian @@ -1597,7 +1597,7 @@ the :c:func:`CVodeSetEpsLin` function. The previous routine ``CVSpilsSetPreconditioner`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. -.. c:function:: int CVodeSetEpsLin(void* cvode_mem, realtype eplifac) +.. c:function:: int CVodeSetEpsLin(void* cvode_mem, sunrealtype eplifac) The function ``CVodeSetEpsLin`` specifies the factor by which the Krylov linear solver's convergence test constant is reduced from the nonlinear solver test constant. @@ -1621,7 +1621,7 @@ the :c:func:`CVodeSetEpsLin` function. The previous routine ``CVSpilsSetEpsLin`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. -.. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, realtype nrmfac) +.. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) The function ``CVodeSetLSNormFactor`` specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. @@ -1702,7 +1702,7 @@ nonlinear solver. **Notes:** The default value is 10. -.. c:function:: int CVodeSetNonlinConvCoef(void* cvode_mem, realtype nlscoef) +.. c:function:: int CVodeSetNonlinConvCoef(void* cvode_mem, sunrealtype nlscoef) The function ``CVodeSetNonlinConvCoef`` specifies the safety factor used in the nonlinear convergence test (see :numref:`CVODES.Mathematics.ivp_sol`). @@ -1800,7 +1800,7 @@ step size adaptivity. make changes gradually and with testing to determine their effectiveness. -.. c:function:: int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, realtype eta_max_fx) +.. c:function:: int CVodeSetEtaFixedStepBounds(void* cvode_mem, sunrealtype eta_min_fx, sunrealtype eta_max_fx) The function ``CVodeSetEtaFixedStepBounds`` specifies the interval lower (:math:`\eta_{\mathrm{min\_fx}}`) and upper (:math:`\eta_{\mathrm{max\_fx}}`) @@ -1826,7 +1826,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs) +.. c:function:: int CVodeSetEtaMaxFirstStep(void* cvode_mem, sunrealtype eta_max_fs) The function ``CVodeSetEtaMaxFirstStep`` specifies the maximum step size factor after the first time step, :math:`\eta_{\mathrm{max\_fs}}`. @@ -1845,7 +1845,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMaxEarlyStep(void* cvode_mem, realtype eta_max_es) +.. c:function:: int CVodeSetEtaMaxEarlyStep(void* cvode_mem, sunrealtype eta_max_es) The function ``CVodeSetEtaMaxEarlyStepEtaMax`` specifies the maximum step size factor for steps early in the integration, @@ -1902,7 +1902,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs) +.. c:function:: int CVodeSetEtaMax(void* cvode_mem, sunrealtype eta_max_gs) The function ``CVodeSetEtaMax`` specifies the maximum step size factor, :math:`\eta_{\mathrm{max\_gs}}`. @@ -1929,7 +1929,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMin(void* cvode_mem, realtype eta_min) +.. c:function:: int CVodeSetEtaMin(void* cvode_mem, sunrealtype eta_min) The function ``CVodeSetEtaMin`` specifies the minimum step size factor, :math:`\eta_{\mathrm{min}}`. @@ -1948,7 +1948,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMinErrFail(void *cvode_mem, realtype eta_min_ef) +.. c:function:: int CVodeSetEtaMinErrFail(void *cvode_mem, sunrealtype eta_min_ef) The function ``CVodeSetEtaMinErrFail`` specifies the minimum step size factor after an error test failure, :math:`\eta_{\mathrm{min\_ef}}`. @@ -1968,7 +1968,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaMaxErrFail(void* cvode_mem, realtype eta_max_ef) +.. c:function:: int CVodeSetEtaMaxErrFail(void* cvode_mem, sunrealtype eta_max_ef) The function ``CVodeSetEtaMaxErrFail`` specifies the maximum step size factor after multiple error test failures, :math:`\eta_{\mathrm{max\_ef}}`. @@ -2021,7 +2021,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf) +.. c:function:: int CVodeSetEtaConvFail(void* cvode_mem, sunrealtype eta_cf) The function ``CVodeSetEtaConvFail`` specifies the step size factor after a nonlinear solver failure :math:`\eta_{\mathrm{cf}}`. @@ -2168,7 +2168,7 @@ the projection when solving an IVP with constraints. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetEpsProj(void* cvode_mem, realtype eps) +.. c:function:: int CVodeSetEpsProj(void* cvode_mem, sunrealtype eps) The function ``CVodeSetEpsProj`` specifies the tolerance for the nonlinear constrained least squares problem solved by the projection function. @@ -2183,7 +2183,7 @@ the projection when solving an IVP with constraints. .. versionadded:: 6.2.0 -.. c:function:: int CVodeSetProjFailEta(void* cvode_mem, realtype eta) +.. c:function:: int CVodeSetProjFailEta(void* cvode_mem, sunrealtype eta) The function ``CVodeSetProjFailEta`` specifies the time step reduction factor to apply on a projection function failure. @@ -2212,7 +2212,7 @@ value of :math:`t` in the last internal step taken by CVODES. The call to the function has the following form: -.. c:function:: int CVodeGetDky(void* cvode_mem, realtype t, int k, N_Vector dky) +.. c:function:: int CVodeGetDky(void* cvode_mem, sunrealtype t, int k, N_Vector dky) The function ``CVodeGetDky`` computes the ``k``-th derivative of the function ``y`` at time ``t``, i.e. :math:`\dfrac{\mathrm d^{k}y}{\mathrm dt^{k}}(t)`, where :math:`t_n - h_u \leq t \leq t_n`, :math:`t_n` denotes the current internal time reached, and :math:`h_u` is the last internal step size successfully used by the solver. The user may request ``k`` = :math:`0, 1, \ldots, q_u`, where :math:`q_u` is the current order (optional output ``qlast``). @@ -2390,7 +2390,7 @@ described next. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. - * ``lenrw`` -- the number of ``realtype`` values in the CVODES workspace. + * ``lenrw`` -- the number of ``sunrealtype`` values in the CVODES workspace. * ``leniw`` -- the number of integer values in the CVODES workspace. **Return value:** @@ -2398,7 +2398,7 @@ described next. * ``CV_MEM_NULL`` -- The CVODES memory block was not initialized through a previous call to :c:func:`CVodeCreate`. **Notes:** - In terms of the problem size :math:`N`, the maximum method order :math:`\texttt{maxord}`, and the number :math:`\texttt{nrtfn}` of root functions (see :numref:`CVODES.Usage.SIM.cvrootinit`) the actual size of the real workspace, in ``realtype`` words, is given by the following: + In terms of the problem size :math:`N`, the maximum method order :math:`\texttt{maxord}`, and the number :math:`\texttt{nrtfn}` of root functions (see :numref:`CVODES.Usage.SIM.cvrootinit`) the actual size of the real workspace, in ``sunrealtype`` words, is given by the following: * base value: :math:`\texttt{lenrw} = 96 + ( \texttt{maxord} + 5) N_r + 3\texttt{nrtfn}`; @@ -2530,7 +2530,7 @@ described next. -.. c:function:: int CVodeGetLastStep(void* cvode_mem, realtype *hlast) +.. c:function:: int CVodeGetLastStep(void* cvode_mem, sunrealtype *hlast) The function ``CVodeGetLastStep`` returns the integration step size taken on the last internal step. @@ -2544,7 +2544,7 @@ described next. -.. c:function:: int CVodeGetCurrentStep(void* cvode_mem, realtype *hcur) +.. c:function:: int CVodeGetCurrentStep(void* cvode_mem, sunrealtype *hcur) The function ``CVodeGetCurrentStep`` returns the integration step size to be attempted on the next internal step. @@ -2558,7 +2558,7 @@ described next. -.. c:function:: int CVodeGetActualInitStep(void* cvode_mem, realtype *hinused) +.. c:function:: int CVodeGetActualInitStep(void* cvode_mem, sunrealtype *hinused) The function ``CVodeGetActualInitStep`` returns the value of the integration step size used on the first step. @@ -2575,7 +2575,7 @@ described next. -.. c:function:: int CVodeGetCurrentTime(void* cvode_mem, realtype *tcur) +.. c:function:: int CVodeGetCurrentTime(void* cvode_mem, sunrealtype *tcur) The function ``CVodeGetCurrentTime`` returns the current internal time reached by the solver. @@ -2606,7 +2606,7 @@ described next. -.. c:function:: int CVodeGetTolScaleFactor(void* cvode_mem, realtype *tolsfac) +.. c:function:: int CVodeGetTolScaleFactor(void* cvode_mem, sunrealtype *tolsfac) The function ``CVodeGetTolScaleFactor`` returns a suggested factor by which the user's tolerances should be scaled when too much accuracy has been requested for some internal step. @@ -2660,7 +2660,7 @@ described next. -.. c:function:: int CVodeGetIntegratorStats(void* cvode_mem, long int *nsteps, long int *nfevals, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, realtype *hinused, realtype *hlast, realtype *hcur, realtype *tcur) +.. c:function:: int CVodeGetIntegratorStats(void* cvode_mem, long int *nsteps, long int *nfevals, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, sunrealtype *hinused, sunrealtype *hlast, sunrealtype *hcur, sunrealtype *tcur) The function ``CVodeGetIntegratorStats`` returns the CVODES integrator statistics as a group. @@ -2930,7 +2930,7 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. - * ``lenrwLS`` -- the number of ``realtype`` values in the CVLS workspace. + * ``lenrwLS`` -- the number of ``sunrealtype`` values in the CVLS workspace. * ``leniwLS`` -- the number of integer values in the CVLS workspace. **Return value:** @@ -3150,7 +3150,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. - * ``lenrwLS`` -- the number of ``realtype`` values in the CVDIAG workspace. + * ``lenrwLS`` -- the number of ``sunrealtype`` values in the CVDIAG workspace. * ``leniwLS`` -- the number of integer values in the CVDIAG workspace. **Return value:** @@ -3159,7 +3159,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). * ``CVDIAG_LMEM_NULL`` -- The CVDIAG linear solver has not been initialized. **Notes:** - In terms of the problem size :math:`N`, the actual size of the real workspace is roughly :math:`3 N` ``realtype`` words. + In terms of the problem size :math:`N`, the actual size of the real workspace is roughly :math:`3 N` ``sunrealtype`` words. .. c:function:: int CVDiagGetNumRhsEvals(void* cvode_mem, long int *nfevalsLS) @@ -3250,7 +3250,7 @@ comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int CVodeReInit(void* cvode_mem, realtype t0, N_Vector y0) +.. c:function:: int CVodeReInit(void* cvode_mem, sunrealtype t0, N_Vector y0) The function ``CVodeReInit`` provides required problem specifications and reinitializes CVODES. @@ -3292,7 +3292,7 @@ ODE right-hand side The user must provide a function of type defined as follows: -.. c:type:: int (*CVRhsFn)(realtype t, N_Vector y, N_Vector ydot, void *user_data); +.. c:type:: int (*CVRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); This function computes the ODE right-hand side for a given value of the independent variable :math:`t` and state vector :math:`y`. @@ -3441,7 +3441,7 @@ If a rootfinding problem is to be solved during the integration of the ODE system, the user must supply a C function of type ``CVRootFn``, defined as follows: -.. c:type:: int (*CVRootFn)(realtype t, N_Vector y, realtype *gout, void *user_data); +.. c:type:: int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); This function implements a vector-valued function :math:`g(t,y)` such that the roots of the ``nrtfn`` components :math:`g_i(t,y)` are sought. @@ -3467,7 +3467,7 @@ When solving an IVP with a constraint equation and providing a user-defined projection operation the projection function must have type ``CVProjFn``, defined as follows: -.. c:type:: int (*CVProjFn)(realtype t, N_Vector ycur, N_Vector corr, realtype epsProj, N_Vector err, void *user_data); +.. c:type:: int (*CVProjFn)(sunrealtype t, N_Vector ycur, N_Vector corr, sunrealtype epsProj, N_Vector err, void *user_data); This function computes the projection of the solution and, if enabled, the error on to the constraint manifold. @@ -3509,7 +3509,7 @@ a function of type ``CVLsJacFn`` for evaluating the Jacobian of the ODE right-ha side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: -.. c:type:: int (*CVLsJacFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +.. c:type:: int (*CVLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); This function computes the Jacobian matrix :math:`J = \dfrac{\partial f}{\partial y}` (or an approximation to it). @@ -3593,7 +3593,7 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: :math:`\le m-n \le` ``mlower``. Alternatively, ``SM_COLUMN_B(J, j)`` returns a pointer to the diagonal element of the :math:`j`-th column of ``Jac``, and if we assign this address - to ``realtype *col_j``, then the :math:`i`-th element of the + to ``sunrealtype *col_j``, then the :math:`i`-th element of the :math:`j`-th column is given by ``SM_COLUMN_ELEMENT_B(col_j, i, j)``, counting from 0. Thus, for :math:`(m,n)` within the band, :math:`J(m,n)` can be loaded by setting @@ -3639,7 +3639,7 @@ side function, the user may optionally supply a function of type ``CVLsLinSysFn` for evaluating the linear system, :math:`M = I - \gamma J` (or an approximation of it). ``CVLsLinSysFn`` is defined as follows: -.. c:type:: int (*CVLsLinSysFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix M, booleantype jok, booleantype *jcur, realtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +.. c:type:: int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix M, booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); This function computes the linear system matrix :math:`M = I - \gamma J` (or an approximation to it). @@ -3669,7 +3669,7 @@ provide a function of type :c:type:`CVLsJacTimesVecFn` in the following form, to compute matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); +.. c:type:: int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); This function computes the product :math:`Jv = \dfrac{\partial f(t,y)}{\partial y} v` (or an approximation to it). @@ -3712,7 +3712,7 @@ If the user’s Jacobian-times-vector routine requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`CVLsJacTimesSetupFn`, defined as follows: -.. c:type:: int (*CVLsJacTimesSetupFn)(realtype t, N_Vector y, N_Vector fy, void *user_data); +.. c:type:: int (*CVLsJacTimesSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, void *user_data); This function preprocesses and/or evaluates Jacobian-related data needed by the Jacobian-times-vector routine. @@ -3763,7 +3763,7 @@ crudely) the matrix :math:`M = I - \gamma J`, where sides, the product of the two preconditioner matrices should approximate :math:`M`. This function must be of type :c:type:`CVLsPrecSolveFn`, defined as follows: -.. c:type:: int (*CVLsPrecSolveFn)(realtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, realtype gamma, realtype delta, int lr, void *user_data); +.. c:type:: int (*CVLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); This function solves the preconditioned system :math:`Pz = r`. @@ -3800,7 +3800,7 @@ If the user’s preconditioner requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type , defined as follows: -.. c:type:: int (*CVLsPrecSetupFn)(realtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, realtype gamma, void *user_data); +.. c:type:: int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, sunrealtype gamma, void *user_data); This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. @@ -4042,7 +4042,7 @@ solution and quadratures at time ``t``. However, :c:func:`CVode` will still retu only the solution :math:`y` in ``yout``. Solution quadratures can be obtained using the following function: -.. c:function:: int CVodeGetQuad(void * cvode_mem, realtype* tret, N_Vector yQ) +.. c:function:: int CVodeGetQuad(void * cvode_mem, sunrealtype* tret, N_Vector yQ) The function ``CVodeGetQuad`` returns the quadrature solution vector after a successful return from ``CVode``. @@ -4066,7 +4066,7 @@ interpolating polynomials for the quadrature variables at time ``t``. This function is called by :c:func:`CVodeGetQuad` with ``k = 0`` and with the current time at which :c:func:`CVode` has returned, but may also be called directly by the user. -.. c:function:: int CVodeGetQuadDky(void * cvode_mem, realtype t, int k, N_Vector dkyQ) +.. c:function:: int CVodeGetQuadDky(void * cvode_mem, sunrealtype t, int k, N_Vector dkyQ) The function ``CVodeGetQuadDky`` returns derivatives of the quadrature solution vector after a successful return from :c:func:`CVode`. @@ -4122,7 +4122,7 @@ If the quadrature variables are part of the step size control mechanism, one of the following functions must be called to specify the integration tolerances for quadrature variables. -.. c:function:: int CVodeQuadSStolerances(void *cvode_mem, realtype reltolQ, realtype abstolQ) +.. c:function:: int CVodeQuadSStolerances(void *cvode_mem, sunrealtype reltolQ, sunrealtype abstolQ) The function ``CVodeQuadSStolerances`` specifies scalar relative and absolute tolerances. @@ -4138,7 +4138,7 @@ integration tolerances for quadrature variables. * ``CV_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int CVodeQuadSVtolerances(void * cvode_mem, realtype reltolQ, N_Vector abstolQ) +.. c:function:: int CVodeQuadSVtolerances(void * cvode_mem, sunrealtype reltolQ, N_Vector abstolQ) The function ``CVodeQuadSVtolerances`` specifies scalar relative and vector absolute tolerances. @@ -4232,7 +4232,7 @@ that defines the right-hand side of the quadrature equations (in other words, the integrand function of the integral that must be evaluated). This function must be of type :c:type:`CVQuadRhsFn` defined as follows: -.. c:type:: int (*CVQuadRhsFn)(realtype t, N_Vector y, N_Vector yQdot, void *user_data) +.. c:type:: int (*CVQuadRhsFn)(sunrealtype t, N_Vector y, N_Vector yQdot, void *user_data) This function computes the quadrature equation right-hand side for a given value of the independent variable :math:`t` and state vector :math:`y`. @@ -4399,7 +4399,7 @@ the CVBANDPRE module: **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. - * ``lenrwBP`` -- the number of ``realtype`` values in the CVBANDPRE workspace. + * ``lenrwBP`` -- the number of ``sunrealtype`` values in the CVBANDPRE workspace. * ``leniwBP`` -- the number of integer values in the CVBANDPRE workspace. **Return value:** @@ -4531,7 +4531,7 @@ The user is responsible for providing space (presumably within ``user_data``) for components of :math:`y` that are communicated between processes by ``cfn``, and that are then used by ``gloc``, which should not do any communication. -.. c:type:: int (*CVLocalFn)(sunindextype Nlocal, realtype t, N_Vector y, N_Vector glocal, void *user_data); +.. c:type:: int (*CVLocalFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector glocal, void *user_data); This ``gloc`` function computes :math:`g(t,y)`. It loads the vector ``glocal`` as a function of ``t`` and ``y``. @@ -4556,7 +4556,7 @@ that are then used by ``gloc``, which should not do any communication. The case where :math:`g` is mathematically identical to :math:`f` is allowed. -.. c:type:: int (*CVCommFn)(sunindextype Nlocal, realtype t, N_Vector y, void *user_data); +.. c:type:: int (*CVCommFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, void *user_data); This ``cfn`` function performs all interprocess communication necessary for the execution of the ``gloc`` function above, using the input vector ``y``. @@ -4660,7 +4660,7 @@ The user-callable functions that initialize or re-initialize the CVBBDPRE preconditioner module are described next. -.. c:function:: int CVBBDPrecInit(void* cvode_mem, sunindextype local_N, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, realtype dqrely, CVLocalFn gloc, CVCommFn cfn) +.. c:function:: int CVBBDPrecInit(void* cvode_mem, sunindextype local_N, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dqrely, CVLocalFn gloc, CVCommFn cfn) The function ``CVBBDPrecInit`` initializes and allocates (internal) memory for the CVBBDPRE preconditioner. @@ -4713,7 +4713,7 @@ one or more of the corresponding CVLS "set" functions, must also be made (in the proper order). -.. c:function:: int CVBBDPrecReInit(void* cvode_mem, sunindextype mudq, sunindextype mldq, realtype dqrely) +.. c:function:: int CVBBDPrecReInit(void* cvode_mem, sunindextype mudq, sunindextype mldq, sunrealtype dqrely) The function ``CVBBDPrecReInit`` re-initializes the CVBBDPRE preconditioner. @@ -4743,7 +4743,7 @@ the CVBBDPRE module: **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. - * ``lenrwBBDP`` -- local number of ``realtype`` values in the CVBBDPRE workspace. + * ``lenrwBBDP`` -- local number of ``sunrealtype`` values in the CVBBDPRE workspace. * ``leniwBBDP`` -- local number of integer values in the CVBBDPRE workspace. **Return value:** diff --git a/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst b/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst index 19a115306c..74f850423b 100644 --- a/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst +++ b/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst @@ -60,7 +60,7 @@ users, but might be useful for users who choose to provide their own implementation of the ``SUNNonlinearSolver`` API. For example, such a user might need access to the current value of :math:`\gamma` to compute Jacobian data. -.. c:function:: int CVodeGetCurrentGamma(void* cvode_mem, realtype* gamma) +.. c:function:: int CVodeGetCurrentGamma(void* cvode_mem, sunrealtype* gamma) The function :c:func:`CVodeGetCurrentGamma` returns the current value of the scalar :math:`\gamma`. @@ -91,7 +91,7 @@ need access to the current value of :math:`\gamma` to compute Jacobian data. * ``CV_MEM_NULL`` -- The CVODES memory block was ``NULL``. -.. c:function:: int CVodeGetNonlinearSystemData(void *cvode_mem, realtype *tcur, N_Vector *ypred, N_Vector *yn, N_Vector *fn, realtype *gamma, realtype *rl1, N_Vector *zn1, void **user_data) +.. c:function:: int CVodeGetNonlinearSystemData(void *cvode_mem, sunrealtype *tcur, N_Vector *ypred, N_Vector *yn, N_Vector *fn, sunrealtype *gamma, sunrealtype *rl1, N_Vector *zn1, void **user_data) The function :c:func:`CVodeGetNonlinearSystemData` returns all internal data required to construct the current nonlinear system :eq:`CVODES_res_corrector` or diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index c6fca6bcee..3e8d0031b7 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -97,7 +97,7 @@ data types can be used. The header file that is always required is: header file for IDALS, ``ida/ida_ls.h``. Note that ``ida.h`` includes ``sundials_types.h``, which defines the types, -``realtype``, ``sunindextype``, and ``booleantype`` and the constants +``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation @@ -347,7 +347,7 @@ IDA initialization and deallocation functions **Return value:** * ``void*`` pointer the IDA solver object. -.. c:function:: int IDAInit(void* ida_mem, IDAResFn res, realtype t0, N_Vector y0, N_Vector yp0) +.. c:function:: int IDAInit(void* ida_mem, IDAResFn res, sunrealtype t0, N_Vector y0, N_Vector yp0) The function ``IDAInit`` provides required problem and solution specifications, allocates internal memory, and initializes IDA. @@ -393,7 +393,7 @@ One of the following three functions must be called to specify the integration tolerances (or directly specify the weights used in evaluating WRMS vector norms). Note that this call must be made after the call to :c:func:`IDAInit`. -.. c:function:: int IDASStolerances(void* ida_mem, realtype reltol, realtype abstol) +.. c:function:: int IDASStolerances(void* ida_mem, sunrealtype reltol, sunrealtype abstol) The function ``IDASStolerances`` specifies scalar relative and absolute tolerances. @@ -410,7 +410,7 @@ norms). Note that this call must be made after the call to :c:func:`IDAInit`. called. * ``IDA_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int IDASVtolerances(void* ida_mem, realtype reltol, N_Vector abstol) +.. c:function:: int IDASVtolerances(void* ida_mem, sunrealtype reltol, N_Vector abstol) The function ``IDASVtolerances`` specifies scalar relative tolerance and vector absolute tolerances. @@ -685,7 +685,7 @@ successful call to the linear system solver specification function. The call to :c:func:`IDACalcIC` should precede the call(s) to :c:func:`IDASolve` for the given problem. -.. c:function:: int IDACalcIC(void* ida_mem, int icopt, realtype tout1) +.. c:function:: int IDACalcIC(void* ida_mem, int icopt, sunrealtype tout1) The function ``IDACalcIC`` corrects the initial values ``y0`` and ``yp0`` at time ``t0``. @@ -792,7 +792,7 @@ the user has set a stop time (with :c:func:`IDASetStopTime`) or requested rootfinding (with :c:func:`IDARootInit`). -.. c:function:: int IDASolve(void * ida_mem, realtype tout, realtype* tret, N_Vector yret, N_Vector ypret, int itask) +.. c:function:: int IDASolve(void * ida_mem, sunrealtype tout, sunrealtype* tret, N_Vector yret, N_Vector ypret, int itask) The function ``IDASolve`` integrates the DAE over an interval in t. @@ -1078,7 +1078,7 @@ Main solver optional input functions Passing ``mxsteps`` = 0 results in IDA using the default value (500). Passing ``mxsteps`` < 0 disables the test (not recommended). -.. c:function:: int IDASetInitStep(void * ida_mem, realtype hin) +.. c:function:: int IDASetInitStep(void * ida_mem, sunrealtype hin) The function ``IDASetInitStep`` specifies the initial step size. @@ -1096,7 +1096,7 @@ Main solver optional input functions :math:`\|h \dot{y} \|_{{\scriptsize WRMS}} = 1/2`, with an added restriction that :math:`|h| \leq .001|t_{\text{out}} - t_0|`. -.. c:function:: int IDASetMinStep(void * ida_mem, realtype hmin) +.. c:function:: int IDASetMinStep(void * ida_mem, sunrealtype hmin) The function ``IDASetMinStep`` specifies the minimum absolute value of the step size. @@ -1114,7 +1114,7 @@ Main solver optional input functions .. versionadded:: 6.2.0 -.. c:function:: int IDASetMaxStep(void * ida_mem, realtype hmax) +.. c:function:: int IDASetMaxStep(void * ida_mem, sunrealtype hmax) The function ``IDASetMaxStep`` specifies the maximum absolute value of the step size. @@ -1132,7 +1132,7 @@ Main solver optional input functions **Notes:** Pass ``hmax = 0`` to obtain the default value :math:`\infty`. -.. c:function:: int IDASetStopTime(void * ida_mem, realtype tstop) +.. c:function:: int IDASetStopTime(void * ida_mem, sunrealtype tstop) The function ``IDASetStopTime`` specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -1356,7 +1356,7 @@ more details. The function :c:func:`IDASetLinearSolutionScaling` can be used to disable this scaling when necessary, e.g., when providing a custom linear solver that updates the matrix using the current :math:`\alpha` as part of the solve. -.. c:function:: int IDASetDeltaCjLSetup(void* ida_mem, realtype dcj) +.. c:function:: int IDASetDeltaCjLSetup(void* ida_mem, sunrealtype dcj) The function ``IDASetDeltaCjLSetup`` specifies the parameter that determines the bounds on a change in :math:`c_j` that require a linear solver setup @@ -1461,7 +1461,7 @@ When using the default difference-quotient approximation to the Jacobian-vector product, the user may specify the factor to use in setting increments for the finite-difference approximation, via a call to :c:func:`IDASetIncrementFactor`. -.. c:function:: int IDASetIncrementFactor(void * ida_mem, realtype dqincfac) +.. c:function:: int IDASetIncrementFactor(void * ida_mem, sunrealtype dqincfac) The function ``IDASetIncrementFactor`` specifies the increment factor to be used in the difference-quotient approximation to the product :math:`Jv`. @@ -1596,7 +1596,7 @@ where :math:`\epsilon` is the nonlinear solver tolerance, and the default :math:`\epsilon_L = 0.05`; this value may be modified by the user through the :c:func:`IDASetEpsLin` function. -.. c:function:: int IDASetEpsLin(void * ida_mem, realtype eplifac) +.. c:function:: int IDASetEpsLin(void * ida_mem, sunrealtype eplifac) The function ``IDASetEpsLin`` specifies the factor by which the Krylov linear solver's convergence test constant is reduced from the nonlinear iteration @@ -1625,7 +1625,7 @@ where :math:`\epsilon` is the nonlinear solver tolerance, and the default will be deprecated in future releases, so we recommend that users transition to the new routine name soon. -.. c:function:: int IDASetLSNormFactor(void * ida_mem, realtype nrmfac) +.. c:function:: int IDASetLSNormFactor(void * ida_mem, sunrealtype nrmfac) The function ``IDASetLSNormFactor`` specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver @@ -1716,7 +1716,7 @@ nonlinear solver. The default value is 10. -.. c:function:: int IDASetNonlinConvCoef(void * ida_mem, realtype nlscoef) +.. c:function:: int IDASetNonlinConvCoef(void * ida_mem, sunrealtype nlscoef) The function ``IDASetNonlinConvCoef`` specifies the safety factor in the nonlinear convergence test; see :eq:`IDA_DAE_nls_test`. @@ -1787,7 +1787,7 @@ Initial condition calculation optional input functions The following functions can be called just prior to calling :c:func:`IDACalcIC` to set optional inputs controlling the initial condition calculation. -.. c:function:: int IDASetNonlinConvCoefIC(void * ida_mem, realtype epiccon) +.. c:function:: int IDASetNonlinConvCoefIC(void * ida_mem, sunrealtype epiccon) The function ``IDASetNonlinConvCoefIC`` specifies the positive constant in the Newton iteration convergence test within the initial condition @@ -1962,7 +1962,7 @@ step size adaptivity. make changes gradually and with testing to determine their effectiveness. -.. c:function:: int IDASetEtaFixedStepBounds(void* ida_mem, realtype eta_min_fx, realtype eta_max_fx) +.. c:function:: int IDASetEtaFixedStepBounds(void* ida_mem, sunrealtype eta_min_fx, sunrealtype eta_max_fx) The function ``IDASetEtaFixedStepBounds`` specifies the bounds :math:`\eta_{\mathrm{min\_fx}}` and :math:`\eta_{\mathrm{max\_fx}}`. If step size @@ -1987,7 +1987,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int IDASetEtaMax(void* ida_mem, realtype eta_max) +.. c:function:: int IDASetEtaMax(void* ida_mem, sunrealtype eta_max) The function ``IDASetEtaMax`` specifies the maximum step size growth factor :math:`\eta_{\mathrm{max}}`. @@ -2004,7 +2004,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int IDASetEtaMin(void* ida_mem, realtype eta_min) +.. c:function:: int IDASetEtaMin(void* ida_mem, sunrealtype eta_min) The function ``IDASetEtaMin`` specifies the minimum step size reduction factor :math:`\eta_{\mathrm{min}}`. @@ -2024,7 +2024,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int IDASetEtaLow(void* ida_mem, realtype eta_low) +.. c:function:: int IDASetEtaLow(void* ida_mem, sunrealtype eta_low) The function ``IDASetEtaLow`` specifies the maximum step size reduction factor :math:`\eta_{\mathrm{low}}`. @@ -2044,7 +2044,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int IDASetEtaMinErrFail(void* ida_mem, realtype eta_min_ef) +.. c:function:: int IDASetEtaMinErrFail(void* ida_mem, sunrealtype eta_min_ef) The function ``IDASetEtaMinErrFail`` specifies the minimum step size reduction factor :math:`\eta_{\mathrm{min\_ef}}` after an error test failure. @@ -2064,7 +2064,7 @@ step size adaptivity. .. versionadded:: 6.2.0 -.. c:function:: int IDASetEtaConvFail(void* ida_mem, realtype eta_cf) +.. c:function:: int IDASetEtaConvFail(void* ida_mem, sunrealtype eta_cf) The function ``IDASetEtaConvFail`` specifies the step size reduction factor :math:`\eta_{\mathrm{cf}}` after a nonlinear solver convergence failure. @@ -2166,7 +2166,7 @@ output values. This function must be called after a successful return from derivatives of order up to the last internal order used for any value of :math:`t` in the last internal step taken by IDA. -.. c:function:: int IDAGetDky(void * ida_mem, realtype t, int k, N_Vector dky) +.. c:function:: int IDAGetDky(void * ida_mem, sunrealtype t, int k, N_Vector dky) The function ``IDAGetDky`` computes the interpolated values of the :math:`k^{th}` derivative of :math:`y` for any value of :math:`t` in the last @@ -2352,7 +2352,7 @@ described next. In terms of the problem size :math:`N`, the maximum method order ``maxord``, and the number of root functions ``nrtfn`` (see :numref:`IDA.Usage.CC.idarootinit`), the actual size of the real workspace, in - :c:type:`realtype` words, is given by the following: + :c:type:`sunrealtype` words, is given by the following: * base value: :math:`\mathtt{lenrw} = 55 + (m + 6) * N_r + 3 * \mathtt{nrtfn}`; @@ -2478,7 +2478,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetLastStep(void * ida_mem, realtype * hlast) +.. c:function:: int IDAGetLastStep(void * ida_mem, sunrealtype * hlast) The function ``IDAGetLastStep`` returns the integration step size taken on the last internal step (if from :c:func:`IDASolve`), or the last value of the @@ -2494,7 +2494,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetCurrentStep(void * ida_mem, realtype * hcur) +.. c:function:: int IDAGetCurrentStep(void * ida_mem, sunrealtype * hcur) The function ``IDAGetCurrentStep`` returns the integration step size to be attempted on the next internal step. @@ -2507,7 +2507,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetActualInitStep(void * ida_mem, realtype * hinused) +.. c:function:: int IDAGetActualInitStep(void * ida_mem, sunrealtype * hinused) The function ``IDAGetActualInitStep`` returns the value of the integration step size used on the first step. @@ -2527,7 +2527,7 @@ described next. changed by IDA to ensure that the step size is within the prescribed bounds :math:`(h_{min} \le h_0 \le h_{max})`, or to meet the local error test. -.. c:function:: int IDAGetCurrentTime(void * ida_mem, realtype * tcur) +.. c:function:: int IDAGetCurrentTime(void * ida_mem, sunrealtype * tcur) The function ``IDAGetCurrentTime`` returns the current internal time reached by the solver. @@ -2540,7 +2540,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetTolScaleFactor(void * ida_mem, realtype * tolsfac) +.. c:function:: int IDAGetTolScaleFactor(void * ida_mem, sunrealtype * tolsfac) The function ``IDAGetTolScaleFactor`` returns a suggested factor by which the user's tolerances should be scaled when too much accuracy has been requested @@ -2600,7 +2600,7 @@ described next. causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. -.. c:function:: int IDAGetIntegratorStats(void *ida_mem, long int *nsteps, long int *nrevals, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, realtype *hinused, realtype *hlast, realtype *hcur, realtype *tcur) +.. c:function:: int IDAGetIntegratorStats(void *ida_mem, long int *nsteps, long int *nrevals, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, sunrealtype *hinused, sunrealtype *hlast, sunrealtype *hcur, sunrealtype *tcur) The function ``IDAGetIntegratorStats`` returns the IDA integrator stats in one function call. @@ -3194,7 +3194,7 @@ integration and the restart, so that the restarted problem uses the new values (which have jumped). Similar comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int IDAReInit(void * ida_mem, realtype t0, N_Vector y0, N_Vector yp0) +.. c:function:: int IDAReInit(void * ida_mem, sunrealtype t0, N_Vector y0, N_Vector yp0) The function ``IDAReInit`` provides required problem specifications and reinitializes IDA. @@ -3241,7 +3241,7 @@ DAE residual function The user must provide a function of type :c:type:`IDAResFn` defined as follows: -.. c:type:: int (*IDAResFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +.. c:type:: int (*IDAResFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) This function computes the problem residual for given values of the independent variable :math:`t`, state vector :math:`y`, and derivative @@ -3349,7 +3349,7 @@ If a rootfinding problem is to be solved during the integration of the DAE system, the user must supply a function of type :c:type:`IDARootFn`, defined as follows: -.. c:type:: int (*IDARootFn)(realtype t, N_Vector y, N_Vector yp, realtype *gout, void *user_data) +.. c:type:: int (*IDARootFn)(sunrealtype t, N_Vector y, N_Vector yp, sunrealtype *gout, void *user_data) This function computes a vector-valued function :math:`g(t,y,\dot{y})` such that the roots of the ``nrtfn`` components :math:`g_i(t,y,\dot{y})` are to be @@ -3383,7 +3383,7 @@ If a matrix-based linear solver module is used (i.e. a non-``NULL`` ``SUNMatrix`` object was supplied to :c:func:`IDASetLinearSolver`), the user may provide a function of type :c:type:`IDALsJacFn` defined as follows: -.. c:type:: int (*IDALsJacFn)(realtype t, realtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*IDALsJacFn)(sunrealtype t, sunrealtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the Jacobian matrix :math:`J` of the DAE system (or an approximation to it), defined by :eq:`IDA_DAE_Jacobian`. @@ -3485,7 +3485,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: elements within the band are those with ``-mupper`` :math:`\le` ``m-n`` :math:`\le` ``mlower``. Alternatively, ``SM_COLUMN_B(J, j)`` returns a pointer to the diagonal element of the ``j``-th column of ``Jac``, and if we - assign this address to ``realtype *col_j``, then the ``i``-th element of the + assign this address to ``sunrealtype *col_j``, then the ``i``-th element of the ``j``-th column is given by ``SM_COLUMN_ELEMENT_B(col_j, i, j)``, counting from :math:`0`. Thus, for :math:`(m,n)` within the band, :math:`J_{m,n}` can be loaded by setting ``col_n = SM_COLUMN_B(J, n-1);`` and @@ -3532,7 +3532,7 @@ provide a function of type :c:type:`IDALsJacTimesVecFn` in the following form, t compute matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*IDALsJacTimesVecFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, realtype cj, void *user_data, N_Vector tmp1, N_Vector tmp2) +.. c:type:: int (*IDALsJacTimesVecFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, sunrealtype cj, void *user_data, N_Vector tmp1, N_Vector tmp2) This function computes the product :math:`Jv` of the DAE system Jacobian :math:`J` (or an approximation to it) and a given vector ``v``, where @@ -3592,7 +3592,7 @@ Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`IDALsJacTimesSetupFn`, defined as follows: -.. c:type:: int (*IDALsJacTimesSetupFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, ealtype cj, void *user_data); +.. c:type:: int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, ealtype cj, void *user_data); This function setups any data needed by :math:`Jv` product function (see :c:type:`IDALsJacTimesVecFn`). @@ -3652,7 +3652,7 @@ approximates (at least crudely) the Jacobian matrix :math:`J = must be of type :c:type:`IDALsPrecSolveFn`, defined as follows: -.. c:type:: int (*IDALsPrecSolveFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, realtype cj, realtype delta, void *user_data) +.. c:type:: int (*IDALsPrecSolveFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, sunrealtype cj, sunrealtype delta, void *user_data) This function solves the preconditioning system :math:`Pz = r`. @@ -3693,7 +3693,7 @@ If the user’s preconditioner requires that any Jacobian-related data be evaluated or preprocessed, then this needs to be done in a user-supplied function of type :c:type:`IDALsPrecSetupFn`, defined as follows: -.. c:type:: int (*IDALsPrecSetupFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, realtype cj, void *user_data) +.. c:type:: int (*IDALsPrecSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, sunrealtype cj, void *user_data) This function solves the preconditioning system :math:`Pz = r`. @@ -3851,7 +3851,7 @@ space (presumably within ``user_data``) for components of ``yy`` and ``yp`` that are communicated by ``Gcomm`` from the other processors, and that are then used by ``Gres``, which should not do any communication. -.. c:type:: int (*IDABBDLocalFn)(sunindextype Nlocal, realtype tt, N_Vector yy, N_Vector yp, N_Vector gval, void *user_data) +.. c:type:: int (*IDABBDLocalFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector gval, void *user_data) This ``Gres`` function computes :math:`G(t,y,\dot{y})`. It loads the vector ``gval`` as a function of ``tt``, ``yy``, and ``yp``. @@ -3876,7 +3876,7 @@ by ``Gres``, which should not do any communication. The case where :math:`G` is mathematically identical to :math:`F` is allowed. -.. c:type:: int (*IDABBDCommFn)(sunindextype Nlocal, realtype tt, N_Vector yy, N_Vector yp, void *user_data) +.. c:type:: int (*IDABBDCommFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, void *user_data) This ``Gcomm`` function performs all inter-processor communications necessary for the execution of the ``Gres`` function above, using the input vectors @@ -3971,7 +3971,7 @@ user main program presented in :numref:`IDA.Usage.CC.skeleton_sim` are not bold. The user-callable functions that initialize or re-initialize the IDABBDPRE preconditioner module are described next. -.. c:function:: int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, realtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm); +.. c:function:: int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm); The function ``IDABBDPrecInit`` initializes and allocates (internal) memory for the IDABBDPRE preconditioner. @@ -4030,7 +4030,7 @@ there is a change in any of the linear solver inputs, an additional call to the the corresponding ``IDASet***`` functions, must also be made (in the proper order). -.. c:function:: int IDABBDPrecReInit(void * ida_mem, sunindextype mudq, sunindextype mldq, realtype dq_rel_yy) +.. c:function:: int IDABBDPrecReInit(void * ida_mem, sunindextype mudq, sunindextype mldq, sunrealtype dq_rel_yy) The function ``IDABBDPrecReInit`` reinitializes the IDABBDPRE preconditioner. diff --git a/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst b/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst index 513b183512..367fe5cb2c 100644 --- a/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst +++ b/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst @@ -47,7 +47,7 @@ the ``SUNNonlinearSolver`` API. For example, such a user might need access to the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. -.. c:function:: int IDAGetCurrentCj(void *ida_mem, realtype *cj) +.. c:function:: int IDAGetCurrentCj(void *ida_mem, sunrealtype *cj) The function ``IDAGetCurrentCj`` returns the scalar :math:`c_j` which is proportional to the inverse of the step size (:math:`\alpha` in @@ -88,7 +88,7 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. * ``IDA_MEM_NULL`` -- The IDA memory block is ``NULL``. -.. c:function:: int IDAGetNonlinearSystemData(void *ida_mem, realtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, N_Vector *res, realtype *cj, void **user_data) +.. c:function:: int IDAGetNonlinearSystemData(void *ida_mem, sunrealtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, N_Vector *res, sunrealtype *cj, void **user_data) The function ``IDAGetNonlinearSystemData`` returns all internal data required to construct the current nonlinear system :eq:`IDA_res_corrector`. diff --git a/doc/ida/ida_ex_serial.tex b/doc/ida/ida_ex_serial.tex index a3579b690f..fb9e8fd934 100644 --- a/doc/ida/ida_ex_serial.tex +++ b/doc/ida/ida_ex_serial.tex @@ -28,8 +28,8 @@ \subsection{A dense example: idaRoberts\_dns}\label{ss:idaRoberts} Following the initial comment block, this program has a number of \id{\#include} lines, which allow access to useful items in {\ida} header files. The \id{sundials\_types.h} file provides the definition of the -type \id{realtype} (see \ugref{s:types} in the user guide \cite{ida_ug} -for details). For now, it suffices to read \id{realtype} as \id{double}. +type \id{sunrealtype} (see \ugref{s:types} in the user guide \cite{ida_ug} +for details). For now, it suffices to read \id{sunrealtype} as \id{double}. The \id{ida.h} file provides prototypes for the {\ida} functions to be called (excluding the linear solver selection function), and also a number of constants that are to be used in diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index 8996217cce..57384a09b6 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -414,7 +414,7 @@ Adjoint Sensitivity Analysis. It is not for use in Forward Sensitivity Analysis; for that, see :numref:`IDAS.Usage.FSA`. The call to this function has the form -.. c:function:: int IDASolveF(void * ida_mem, realtype tout, realtype * tret, N_Vector yret, N_Vector ypret, int itask, int * ncheck) +.. c:function:: int IDASolveF(void * ida_mem, sunrealtype tout, sunrealtype * tret, N_Vector yret, N_Vector ypret, int itask, int * ncheck) The function :c:func:`IDASolveF` integrates the forward problem over an interval in :math:`t` and saves checkpointing data. @@ -512,7 +512,7 @@ not depend on the forward sensitivities. It is essentially wrapper for IDAInit with some particularization for backward integration, as described below. -.. c:function:: int IDAInitB(void * ida_mem, int which, IDAResFnB resB, realtype tB0, N_Vector yB0, N_Vector ypB0) +.. c:function:: int IDAInitB(void * ida_mem, int which, IDAResFnB resB, sunrealtype tB0, N_Vector yB0, N_Vector ypB0) The function :c:func:`IDAInitB` provides problem specification, allocates internal memory, and initializes the backward problem. @@ -542,7 +542,7 @@ user must call :c:func:`IDAInitBS` instead of :c:func:`IDAInitB`. Only the third argument of each function differs between these functions. -.. c:function:: int IDAInitBS(void * ida_mem, int which, IDAResFnBS resBS, realtype tB0, N_Vector yB0, N_Vector ypB0) +.. c:function:: int IDAInitBS(void * ida_mem, int which, IDAResFnBS resBS, sunrealtype tB0, N_Vector yB0, N_Vector ypB0) The function :c:func:`IDAInitBS` provides problem specification, allocates internal memory, and initializes the backward problem. @@ -579,7 +579,7 @@ extraction functions ``IDAGet**`` associated with the previous backward problem. The call to the :c:func:`IDAReInitB` function has the form -.. c:function:: int IDAReInitB(void * ida_mem, int which, realtype tB0, N_Vector yB0, N_Vector ypB0) +.. c:function:: int IDAReInitB(void * ida_mem, int which, sunrealtype tB0, N_Vector yB0, N_Vector ypB0) The function :c:func:`IDAReInitB` reinitializes an IDAS backward problem. @@ -608,7 +608,7 @@ One of the following two functions must be called to specify the integration tolerances for the backward problem. Note that this call must be made after the call to :c:func:`IDAInitB` or :c:func:`IDAInitBS`. -.. c:function:: int IDASStolerancesB(void * ida_mem, int which, realtype reltolB, realtype abstolB) +.. c:function:: int IDASStolerancesB(void * ida_mem, int which, sunrealtype reltolB, sunrealtype abstolB) The function :c:func:`IDASStolerancesB` specifies scalar relative and absolute tolerances. @@ -627,7 +627,7 @@ call to :c:func:`IDAInitB` or :c:func:`IDAInitBS`. * ``IDA_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int IDASVtolerancesB(void * ida_mem, int which, realtype reltolB, N_Vector abstolB) +.. c:function:: int IDASVtolerancesB(void * ida_mem, int which, sunrealtype reltolB, N_Vector abstolB) The function :c:func:`IDASVtolerancesB` specifies scalar relative tolerance and vector absolute tolerances. @@ -755,7 +755,7 @@ Both functions require forward solutions at the final time ``tB0``. :c:func:`IDACalcICBS` also needs forward sensitivities at the final time ``tB0``. -.. c:function:: int IDACalcICB(void * ida_mem, int which, realtype tBout1, N_Vector yfin, N_Vector ypfin) +.. c:function:: int IDACalcICB(void * ida_mem, int which, sunrealtype tBout1, N_Vector yfin, N_Vector ypfin) The function :c:func:`IDACalcICB` corrects the initial values ``yB0`` and ``ypB0`` at time ``tB0`` for the backward problem. @@ -791,7 +791,7 @@ In the case where the backward problem also depends on the forward sensitivities, user must call the following function to correct the initial conditions: -.. c:function:: int IDACalcICBS(void * ida_mem, int which, realtype tBout1, N_Vector yfin, N_Vector ypfin, N_Vector ySfin, N_Vector ypSfin) +.. c:function:: int IDACalcICBS(void * ida_mem, int which, sunrealtype tBout1, N_Vector yfin, N_Vector ypfin, N_Vector ySfin, N_Vector ypSfin) The function :c:func:`IDACalcICBS` corrects the initial values ``yB0`` and ``ypB0`` at time ``tB0`` for the backward problem. @@ -850,7 +850,7 @@ should be disabled for :c:func:`IDASolveB` by first calling :c:func:`IDARootInit The call to :c:func:`IDASolveB` has the form -.. c:function:: int IDASolveB(void * ida_mem, realtype tBout, int itaskB) +.. c:function:: int IDASolveB(void * ida_mem, sunrealtype tBout, int itaskB) The function :c:func:`IDASolveB` integrates the backward DAE problem. @@ -891,7 +891,7 @@ The call to :c:func:`IDASolveB` has the form To obtain the solution ``yB`` to the backward problem, call the function :c:func:`IDAGetB` as follows: -.. c:function:: int IDAGetB(void * ida_mem, int which, realtype * tret, N_Vector yB, N_Vector ypB) +.. c:function:: int IDAGetB(void * ida_mem, int which, sunrealtype * tret, N_Vector yB, N_Vector ypB) The function :c:func:`IDAGetB` provides the solution ``yB`` of the backward DAE problem. @@ -1108,7 +1108,7 @@ product for the backward problem, the user may specify the factor to use in setting increments for the finite-difference approximation, via a call to :c:func:`IDASetIncrementFactorB`. -.. c:function:: int IDASetIncrementFactorB(void * ida_mem, int which, realtype dqincfacB) +.. c:function:: int IDASetIncrementFactorB(void * ida_mem, int which, sunrealtype dqincfacB) The function :c:func:`IDASetIncrementFactorB` specifies the factor in the increments used in the difference quotient approximations to matrix-vector @@ -1236,7 +1236,7 @@ These may be accomplished through calling the following functions: The previous routine ``IDASpilsSetPreconditionerBS`` is now deprecated. -.. c:function:: int IDASetEpsLinB(void * ida_mem, int which, realtype eplifacB) +.. c:function:: int IDASetEpsLinB(void * ida_mem, int which, sunrealtype eplifacB) The function :c:func:`IDASetEpsLinB` specifies the factor by which the Krylov linear solver's convergence test constant is reduced from the @@ -1266,7 +1266,7 @@ These may be accomplished through calling the following functions: The previous routine ``IDASpilsSetEpsLinB`` is now deprecated. -.. c:function:: int IDASetLSNormFactorB(void * ida_mem, int which, realtype nrmfac) +.. c:function:: int IDASetLSNormFactorB(void * ida_mem, int which, sunrealtype nrmfac) The function :c:func:`IDASetLSNormFactorB` specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver @@ -1341,7 +1341,7 @@ which the backward solution has just been obtained with :c:func:`IDAGetB`. In any case, it must be within the last checkpoint interval used by :c:func:`IDASolveB`. -.. c:function:: int IDAGetAdjY(void * ida_mem, realtype t, N_Vector y, N_Vector yp) +.. c:function:: int IDAGetAdjY(void * ida_mem, sunrealtype t, N_Vector y, N_Vector yp) The function :c:func:`IDAGetAdjY` returns the interpolated value of the forward solution :math:`y` and its derivative during a backward integration. @@ -1381,15 +1381,15 @@ any case, it must be within the last checkpoint interval used by - ``ckpnt[i].next_addr`` (``void *``) address of next checkpoint - - ``ckpnt[i].t0`` (``realtype``) start of checkpoint interval + - ``ckpnt[i].t0`` (``sunrealtype``) start of checkpoint interval - - ``ckpnt[i].t1`` (``realtype``) end of checkpoint interval + - ``ckpnt[i].t1`` (``sunrealtype``) end of checkpoint interval - ``ckpnt[i].nstep`` (``long int``) step counter at ckeckpoint ``t0`` - ``ckpnt[i].order`` (``int``) method order at checkpoint ``t0`` - - ``ckpnt[i].step`` (``realtype``) step size at checkpoint ``t0`` + - ``ckpnt[i].step`` (``sunrealtype``) step size at checkpoint ``t0`` .. _IDAS.Usage.ADJ.user_callable.optional_ouput_b.iccalcB: @@ -1523,7 +1523,7 @@ To extract the values of the quadrature variables at the last return time of :c:func:`IDAGetQuad`. The call to this function has the form -.. c:function:: int IDAGetQuadB(void * ida_mem, int which, realtype * tret, N_Vector yQB) +.. c:function:: int IDAGetQuadB(void * ida_mem, int which, sunrealtype * tret, N_Vector yQB) The function :c:func:`IDAGetQuadB` returns the quadrature solution vector after a successful return from :c:func:`IDASolveB`. @@ -1603,7 +1603,7 @@ DAE residual for the backward problem The user must provide a ``resB`` function of type ``IDAResFnB`` defined as follows: -.. c:type:: int (*IDAResFnB)(realtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, void *user_dataB) +.. c:type:: int (*IDAResFnB)(sunrealtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, void *user_dataB) This function evaluates the residual of the backward problem DAE system. This could be :eq:`IDAS_adj_eqns` or :eq:`IDAS_adj1_eqns`. @@ -1650,7 +1650,7 @@ DAE residual for the backward problem depending on the forward sensitivities The user must provide a ``resBS`` function of type ``IDAResFnBS`` defined as follows: -.. c:type:: int (*IDAResFnBS)(realtype t, N_Vector y, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, void *user_dataB) +.. c:type:: int (*IDAResFnBS)(sunrealtype t, N_Vector y, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, void *user_dataB) This function evaluates the residual of the backward problem DAE system. This could be :eq:`IDAS_adj_eqns` or :eq:`IDAS_adj1_eqns`. @@ -1699,7 +1699,7 @@ Quadrature right-hand side for the backward problem The user must provide an ``fQB`` function of type ``IDAQuadRhsFnB`` defined by -.. c:type:: int (*IDAQuadRhsFnB)(realtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector rhsvalBQ, void *user_dataB) +.. c:type:: int (*IDAQuadRhsFnB)(sunrealtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector rhsvalBQ, void *user_dataB) This function computes the quadrature equation right-hand side for the backward problem. @@ -1750,7 +1750,7 @@ Sensitivity-dependent quadrature right-hand side for the backward problem The user must provide an ``fQBS`` function of type ``IDAQuadRhsFnBS`` defined by -.. c:type:: int (*IDAQuadRhsFnBS)(realtype t, N_Vector y, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector rhsvalBQS, void *user_dataB) +.. c:type:: int (*IDAQuadRhsFnBS)(sunrealtype t, N_Vector y, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector rhsvalBQS, void *user_dataB) This function computes the quadrature equation residual for the backward problem. @@ -1803,7 +1803,7 @@ argument in the step described in :numref:`IDAS.Usage.ADJ.skeleton_adj`), the user may provide a function of type ``IDALsJacFnB`` or :c:type:`IDALsJacFnBS`, defined as follows: -.. c:type:: int (*IDALsJacFnB)(realtype tt, realtype c_jB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) +.. c:type:: int (*IDALsJacFnB)(sunrealtype tt, sunrealtype c_jB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) This function computes the Jacobian of the backward problem (or an approximation to it). @@ -1857,7 +1857,7 @@ as follows: the new function type name soon. -.. c:type:: int (*IDALsJacFnBS)(realtype tt, realtype c_jB, N_Vector yy, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); +.. c:type:: int (*IDALsJacFnBS)(sunrealtype tt, sunrealtype c_jB, N_Vector yy, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); This function computes the Jacobian of the backward problem (or an approximation to it), in the case where the backward problem depends on the @@ -1928,7 +1928,7 @@ in the following form, to compute matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*IDALsJacTimesVecFnB)(realtype t, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector vB, N_Vector JvB, realtype cjB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B) +.. c:type:: int (*IDALsJacTimesVecFnB)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector vB, N_Vector JvB, sunrealtype cjB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B) This function computes the action of the backward problem Jacobian ``JB`` on a given vector ``vB``. @@ -1971,7 +1971,7 @@ these products. name soon. -.. c:type:: int (*IDALsJacTimesVecFnBS)(realtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector vB, N_Vector JvB, realtype cjB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B) +.. c:type:: int (*IDALsJacTimesVecFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector vB, N_Vector JvB, sunrealtype cjB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B) This function computes the action of the backward problem Jacobian ``JB`` on a given vector ``vB``, in the case where the backward problem depends on the @@ -2025,7 +2025,7 @@ preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`IDALsJacTimesSetupFnB` or :c:type:`IDALsJacTimesSetupFnBS`, defined as follows: -.. c:type:: int (*IDALsJacTimesSetupFnB)(realtype tt, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, realtype cjB, void *user_dataB) +.. c:type:: int (*IDALsJacTimesSetupFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, sunrealtype cjB, void *user_dataB) This function preprocesses and/or evaluates Jacobian data needed by the Jacobian-times-vector routine for the backward problem. @@ -2069,7 +2069,7 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or name soon. -.. c:type:: int (*IDALsJacTimesSetupFnBS)(realtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, realtype cjB, void *user_dataB) +.. c:type:: int (*IDALsJacTimesSetupFnBS)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, sunrealtype cjB, void *user_dataB) This function preprocesses and/or evaluates Jacobian data needed by the Jacobian-times-vector routine for the backward problem, in the case that the backward problem depends on the forward sensitivities. @@ -2124,7 +2124,7 @@ user must provide a function to solve the linear system :math:`Pz = r`, where :math:`P` is a left preconditioner matrix. This function must have one of the following two forms: -.. c:type:: int (*IDALsPrecSolveFnB)(realtype t, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector rvecB, N_Vector zvecB, realtype cjB, realtype deltaB, void *user_dataB) +.. c:type:: int (*IDALsPrecSolveFnB)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector rvecB, N_Vector zvecB, sunrealtype cjB, sunrealtype deltaB, void *user_dataB) This function solves the preconditioning system :math:`Pz = r` for the backward problem. @@ -2154,7 +2154,7 @@ following two forms: ``IDALsPrecSolveFnB``, and is deprecated. -.. c:type:: int (*IDALsPrecSolveFnBS)(realtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector rvecB, N_Vector zvecB, realtype cjB, realtype deltaB, void *user_dataB) +.. c:type:: int (*IDALsPrecSolveFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector rvecB, N_Vector zvecB, sunrealtype cjB, sunrealtype deltaB, void *user_dataB) This function solves the preconditioning system :math:`Pz = r` for the backward problem, for the case in which the backward problem depends on the @@ -2196,7 +2196,7 @@ If the user’s preconditioner requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of one of the following two types: -.. c:type:: int (*IDALsPrecSetupFnB)(realtype t, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, realtype cjB, void *user_dataB) +.. c:type:: int (*IDALsPrecSetupFnB)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector resvalB, sunrealtype cjB, void *user_dataB) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner for the backward problem. @@ -2223,7 +2223,7 @@ function of one of the following two types: ``IDALsPrecSetupFnB``, and is deprecated. -.. c:type:: int (*IDALsPrecSetupFnBS)(realtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, realtype cjB, void *user_dataB) +.. c:type:: int (*IDALsPrecSetupFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, sunrealtype cjB, void *user_dataB) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner for the backward problem, in the case where the backward @@ -2280,7 +2280,7 @@ The IDABBDPRE module is initialized by calling the following function, *after* an iterative linear solver for the backward problem has been attached to IDAS by calling :c:func:`IDASetLinearSolverB` (see :numref:`IDAS.Usage.ADJ.user_callable.lin_solv_b`). -.. c:function:: int IDABBDPrecInitB(void * ida_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, realtype dqrelyB, IDABBDLocalFnB GresB, IDABBDCommFnB GcommB) +.. c:function:: int IDABBDPrecInitB(void * ida_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, sunrealtype dqrelyB, IDABBDLocalFnB GresB, IDABBDCommFnB GcommB) The function :c:func:`IDABBDPrecInitB` initializes and allocates memory for the IDABBDPRE preconditioner for the backward problem. @@ -2311,7 +2311,7 @@ To reinitialize the IDABBDPRE preconditioner module for the backward problem, possibly with a change in ``mudqB``, ``mldqB``, or ``dqrelyB``, call the following function: -.. c:function:: int IDABBDPrecReInitB(void * ida_mem, int which, sunindextype mudqB, sunindextype mldqB, realtype dqrelyB) +.. c:function:: int IDABBDPrecReInitB(void * ida_mem, int which, sunindextype mudqB, sunindextype mldqB, sunrealtype dqrelyB) The function :c:func:`IDABBDPrecReInitB` reinitializes the IDABBDPRE preconditioner for the backward problem. @@ -2345,7 +2345,7 @@ necessary to evaluate this approximate residual (see are described below. -.. c:type:: int (*IDABBDLocalFnB)(sunindextype NlocalB, realtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector gB, void *user_dataB) +.. c:type:: int (*IDABBDLocalFnB)(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, N_Vector gB, void *user_dataB) This ``GresB`` function loads the vector ``gB``, an approximation to the residual of the backward problem, as a function of ``t``, ``y``, ``yp``, and @@ -2381,7 +2381,7 @@ are described below. halt the integration (:c:func:`IDASolveB` returns ``IDA_LSETUP_FAIL``). -.. c:type:: int (*IDABBDCommFnB)(sunindextype NlocalB, realtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, void *user_dataB) +.. c:type:: int (*IDABBDCommFnB)(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yp, N_Vector yB, N_Vector ypB, void *user_dataB) This ``GcommB`` function performs all interprocess communications necessary for the execution of the ``GresB`` function above, using the input vectors diff --git a/doc/idas/guide/source/Usage/FSA.rst b/doc/idas/guide/source/Usage/FSA.rst index d6472c3f76..1dd9e33d54 100644 --- a/doc/idas/guide/source/Usage/FSA.rst +++ b/doc/idas/guide/source/Usage/FSA.rst @@ -365,7 +365,7 @@ One of the following three functions must be called to specify the integration tolerances for sensitivities. Note that this call must be made after the call to :c:func:`IDASensInit`. -.. c:function:: int IDASensSStolerances(void * ida_mem, realtype reltolS, realtype* abstolS) +.. c:function:: int IDASensSStolerances(void * ida_mem, sunrealtype reltolS, sunrealtype* abstolS) The function :c:func:`IDASensSStolerances` specifies scalar relative and absolute tolerances. @@ -382,7 +382,7 @@ the call to :c:func:`IDASensInit`. * ``IDA_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int IDASensSVtolerances(void * ida_mem, realtype reltolS, N_Vector* abstolS) +.. c:function:: int IDASensSVtolerances(void * ida_mem, sunrealtype reltolS, N_Vector* abstolS) The function :c:func:`IDASensSVtolerances` specifies scalar relative tolerance and vector absolute tolerances. @@ -541,7 +541,7 @@ then IDAS computes both a solution and sensitivities at time ``t``. However, Solution sensitivities can be obtained through one of the following functions: -.. c:function:: int IDAGetSens(void * ida_mem, realtype * tret, N_Vector * yS) +.. c:function:: int IDAGetSens(void * ida_mem, sunrealtype * tret, N_Vector * yS) The function :c:func:`IDAGetSens` returns the sensitivity solution vectors after a successful return from :c:func:`IDASolve`. @@ -568,7 +568,7 @@ function is called by :c:func:`IDAGetSens` with ``k`` :math:`= 0`, but may also called directly by the user. -.. c:function:: int IDAGetSensDky(void * ida_mem, realtype t, int k, N_Vector * dkyS) +.. c:function:: int IDAGetSensDky(void * ida_mem, sunrealtype t, int k, N_Vector * dkyS) The function :c:func:`IDAGetSensDky` returns derivatives of the sensitivity solution vectors after a successful return from :c:func:`IDASolve`. @@ -593,7 +593,7 @@ parameter in turn through the functions :c:func:`IDAGetSens1` and :c:func:`IDAGetSensDky1`, defined as follows: -.. c:function:: int IDAGetSens1(void * ida_mem, realtype * tret, int is, N_Vector yS) +.. c:function:: int IDAGetSens1(void * ida_mem, sunrealtype * tret, int is, N_Vector yS) The function ``IDAGetSens1`` returns the ``is``-th sensitivity solution vector after a successful return from :c:func:`IDASolve`. @@ -617,7 +617,7 @@ parameter in turn through the functions :c:func:`IDAGetSens1` and will be the same as that returned at the last :c:func:`IDASolve` call. -.. c:function:: int IDAGetSensDky1(void * ida_mem, realtype t, int k, int is, N_Vector dkyS) +.. c:function:: int IDAGetSensDky1(void * ida_mem, sunrealtype t, int k, int is, N_Vector dkyS) The function ``IDAGetSensDky1`` returns the ``k``-th derivative of the ``is``-th sensitivity solution vector after a successful return from @@ -671,7 +671,7 @@ time and, if successful, takes effect immediately. =================================== ==================================== ============ -.. c:function:: int IDASetSensParams(void * ida_mem, realtype * p, realtype * pbar, int * plist) +.. c:function:: int IDASetSensParams(void * ida_mem, sunrealtype * p, sunrealtype * pbar, int * plist) The function :c:func:`IDASetSensParams` specifies problem parameter information for sensitivity calculations. @@ -729,7 +729,7 @@ time and, if successful, takes effect immediately. The array ``p`` *must* also be attached to the user data structure. For example, ``user_data->p = p;``. -.. c:function:: int IDASetSensDQMethod(void * ida_mem, int DQtype, realtype DQrhomax) +.. c:function:: int IDASetSensDQMethod(void * ida_mem, int DQtype, sunrealtype DQrhomax) The function :c:func:`IDASetSensDQMethod` specifies the difference quotient strategy in the case in which the residual of the sensitivity @@ -1069,7 +1069,7 @@ for all sensitivity parameters at once, through a function of type :c:type:`IDASensResFn` defined by: -.. c:type:: int (*IDASensResFn)(int Ns, realtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*IDASensResFn)(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the sensitivity residual for all sensitivity equations. It must compute the vectors @@ -1322,7 +1322,7 @@ at time ``t``. However, :c:func:`IDASolve` will still return only the solutions Sensitivity-dependent quadratures can be obtained using one of the following functions: -.. c:function:: int IDAGetQuadSens(void * ida_mem, realtype * tret, N_Vector * yQS) +.. c:function:: int IDAGetQuadSens(void * ida_mem, sunrealtype * tret, N_Vector * yQS) The function :c:func:`IDAGetQuadSens` returns the quadrature sensitivity solution vectors after a successful return from :c:func:`IDASolve`. @@ -1344,7 +1344,7 @@ the interpolating polynomials for the sensitivity-dependent quadrature variables at time ``t``. This function is called by :c:func:`IDAGetQuadSens` with ``k = 0``, but may also be called directly by the user. -.. c:function:: int IDAGetQuadSensDky(void * ida_mem, realtype t, int k, N_Vector* dkyQS) +.. c:function:: int IDAGetQuadSensDky(void * ida_mem, sunrealtype t, int k, N_Vector* dkyQS) The function :c:func:`IDAGetQuadSensDky` returns derivatives of the quadrature sensitivities solution vectors after a successful return from :c:func:`IDASolve`. @@ -1368,7 +1368,7 @@ Quadrature sensitivity solution vectors can also be extracted separately for each parameter in turn through the functions ``IDAGetQuadSens1`` and ``IDAGetQuadSensDky1``, defined as follows: -.. c:function:: int IDAGetQuadSens1(void * ida_mem, realtype * tret, int is, N_Vector yQS) +.. c:function:: int IDAGetQuadSens1(void * ida_mem, sunrealtype * tret, int is, N_Vector yQS) The function ``IDAGetQuadSens1`` returns the ``is``-th sensitivity of quadratures after a successful return from :c:func:`IDASolve`. @@ -1387,7 +1387,7 @@ each parameter in turn through the functions ``IDAGetQuadSens1`` and * ``IDA_BAD_DKY`` -- ``yQS`` is ``NULL``. -.. c:function:: int IDAGetQuadSensDky1(void * ida_mem, realtype t, int k, int is, N_Vector dkyQS) +.. c:function:: int IDAGetQuadSensDky1(void * ida_mem, sunrealtype t, int k, int is, N_Vector dkyQS) The function ``IDAGetQuadSensDky1`` returns the ``k``-th derivative of the ``is``-th sensitivity solution vector after a successful return from :c:func:`IDASolve`. @@ -1442,7 +1442,7 @@ If the quadrature variables are part of the step size control mechanism, one of the following functions must be called to specify the integration tolerances for quadrature variables. -.. c:function:: int IDAQuadSensSStolerances(void * ida_mem, realtype reltolQS, realtype* abstolQS) +.. c:function:: int IDAQuadSensSStolerances(void * ida_mem, sunrealtype reltolQS, sunrealtype* abstolQS) The function :c:func:`IDAQuadSensSStolerances` specifies scalar relative and absolute tolerances. @@ -1459,7 +1459,7 @@ quadrature variables. * ``IDA_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int IDAQuadSensSVtolerances(void * ida_mem, realtype reltolQS, N_Vector* abstolQS) +.. c:function:: int IDAQuadSensSVtolerances(void * ida_mem, sunrealtype reltolQS, N_Vector* abstolQS) The function :c:func:`IDAQuadSensSVtolerances` specifies scalar relative and vector absolute tolerances. @@ -1590,7 +1590,7 @@ q}/{\partial y} s_i + {\partial q}/{\partial \dot{y}} \dot{s}_i + {\partial q}{\partial p_i}`. This user function must be of type :c:type:`IDAQuadSensRhsFn` defined as follows: -.. c:type:: int (*IDAQuadSensRhsFn)(int Ns, realtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *rhsvalQS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*IDAQuadSensRhsFn)(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *rhsvalQS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the sensitivity quadrature equation right-hand side for a given value of the independent variable :math:`t` and state vector diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index 4bd1ac2738..feb34ab1f5 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -101,7 +101,7 @@ data types can be used. The header file that is always required is: header file for IDALS, ``idas/idas_ls.h``. Note that ``idas.h`` includes ``sundials_types.h``, which defines the types, -``realtype``, ``sunindextype``, and ``booleantype`` and the constants +``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation @@ -350,7 +350,7 @@ IDAS initialization and deallocation functions **Return value:** * ``void*`` pointer the IDAS solver object. -.. c:function:: int IDAInit(void* ida_mem, IDAResFn res, realtype t0, N_Vector y0, N_Vector yp0) +.. c:function:: int IDAInit(void* ida_mem, IDAResFn res, sunrealtype t0, N_Vector y0, N_Vector yp0) The function :c:func:`IDAInit` provides required problem and solution specifications, allocates internal memory, and initializes IDAS. @@ -396,7 +396,7 @@ One of the following three functions must be called to specify the integration tolerances (or directly specify the weights used in evaluating WRMS vector norms). Note that this call must be made after the call to :c:func:`IDAInit`. -.. c:function:: int IDASStolerances(void* ida_mem, realtype reltol, realtype abstol) +.. c:function:: int IDASStolerances(void* ida_mem, sunrealtype reltol, sunrealtype abstol) The function :c:func:`IDASStolerances` specifies scalar relative and absolute tolerances. @@ -413,7 +413,7 @@ norms). Note that this call must be made after the call to :c:func:`IDAInit`. called. * ``IDA_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int IDASVtolerances(void* ida_mem, realtype reltol, N_Vector abstol) +.. c:function:: int IDASVtolerances(void* ida_mem, sunrealtype reltol, N_Vector abstol) The function :c:func:`IDASVtolerances` specifies scalar relative tolerance and vector absolute tolerances. @@ -694,7 +694,7 @@ successful call to the linear system solver specification function. The call to :c:func:`IDACalcIC` should precede the call(s) to :c:func:`IDASolve` for the given problem. -.. c:function:: int IDACalcIC(void* ida_mem, int icopt, realtype tout1) +.. c:function:: int IDACalcIC(void* ida_mem, int icopt, sunrealtype tout1) The function :c:func:`IDACalcIC` corrects the initial values ``y0`` and ``yp0`` at time ``t0``. @@ -801,7 +801,7 @@ the user has set a stop time (with :c:func:`IDASetStopTime`) or requested rootfinding (with :c:func:`IDARootInit`). -.. c:function:: int IDASolve(void* ida_mem, realtype tout, realtype* tret, \ +.. c:function:: int IDASolve(void* ida_mem, sunrealtype tout, sunrealtype* tret, \ N_Vector yret, N_Vector ypret, int itask) The function :c:func:`IDASolve` integrates the DAE over an interval in t. @@ -1088,7 +1088,7 @@ Main solver optional input functions Passing ``mxsteps`` = 0 results in IDAS using the default value (500). Passing ``mxsteps`` < 0 disables the test (not recommended). -.. c:function:: int IDASetInitStep(void * ida_mem, realtype hin) +.. c:function:: int IDASetInitStep(void * ida_mem, sunrealtype hin) The function :c:func:`IDASetInitStep` specifies the initial step size. @@ -1106,7 +1106,7 @@ Main solver optional input functions :math:`\|h \dot{y} \|_{{\scriptsize WRMS}} = 1/2`, with an added restriction that :math:`|h| \leq .001|t_{\text{out}} - t_0|`. -.. c:function:: int IDASetMinStep(void * ida_mem, realtype hmin) +.. c:function:: int IDASetMinStep(void * ida_mem, sunrealtype hmin) The function :c:func:`IDASetMinStep` specifies the minimum absolute value of the step size. @@ -1124,7 +1124,7 @@ Main solver optional input functions .. versionadded:: 5.2.0 -.. c:function:: int IDASetMaxStep(void * ida_mem, realtype hmax) +.. c:function:: int IDASetMaxStep(void * ida_mem, sunrealtype hmax) The function :c:func:`IDASetMaxStep` specifies the maximum absolute value of the step size. @@ -1142,7 +1142,7 @@ Main solver optional input functions **Notes:** Pass ``hmax = 0`` to obtain the default value :math:`\infty`. -.. c:function:: int IDASetStopTime(void * ida_mem, realtype tstop) +.. c:function:: int IDASetStopTime(void * ida_mem, sunrealtype tstop) The function :c:func:`IDASetStopTime` specifies the value of the independent variable :math:`t` past which the solution is not to proceed. @@ -1373,7 +1373,7 @@ more details. The function :c:func:`IDASetLinearSolutionScaling` can be used to disable this scaling when necessary, e.g., when providing a custom linear solver that updates the matrix using the current :math:`\alpha` as part of the solve. -.. c:function:: int IDASetDeltaCjLSetup(void* ida_mem, realtype dcj) +.. c:function:: int IDASetDeltaCjLSetup(void* ida_mem, sunrealtype dcj) The function ``IDASetDeltaCjLSetup`` specifies the parameter that determines the bounds on a change in :math:`c_j` that require a linear solver setup @@ -1478,7 +1478,7 @@ When using the default difference-quotient approximation to the Jacobian-vector product, the user may specify the factor to use in setting increments for the finite-difference approximation, via a call to :c:func:`IDASetIncrementFactor`. -.. c:function:: int IDASetIncrementFactor(void * ida_mem, realtype dqincfac) +.. c:function:: int IDASetIncrementFactor(void * ida_mem, sunrealtype dqincfac) The function :c:func:`IDASetIncrementFactor` specifies the increment factor to be used in the difference-quotient approximation to the product :math:`Jv`. @@ -1613,7 +1613,7 @@ where :math:`\epsilon` is the nonlinear solver tolerance, and the default :math:`\epsilon_L = 0.05`; this value may be modified by the user through the :c:func:`IDASetEpsLin` function. -.. c:function:: int IDASetEpsLin(void * ida_mem, realtype eplifac) +.. c:function:: int IDASetEpsLin(void * ida_mem, sunrealtype eplifac) The function :c:func:`IDASetEpsLin` specifies the factor by which the Krylov linear solver's convergence test constant is reduced from the nonlinear iteration @@ -1642,7 +1642,7 @@ where :math:`\epsilon` is the nonlinear solver tolerance, and the default will be deprecated in future releases, so we recommend that users transition to the new routine name soon. -.. c:function:: int IDASetLSNormFactor(void * ida_mem, realtype nrmfac) +.. c:function:: int IDASetLSNormFactor(void * ida_mem, sunrealtype nrmfac) The function :c:func:`IDASetLSNormFactor` specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver @@ -1733,7 +1733,7 @@ nonlinear solver. The default value is 10. -.. c:function:: int IDASetNonlinConvCoef(void * ida_mem, realtype nlscoef) +.. c:function:: int IDASetNonlinConvCoef(void * ida_mem, sunrealtype nlscoef) The function :c:func:`IDASetNonlinConvCoef` specifies the safety factor in the nonlinear convergence test; see :eq:`IDAS_DAE_nls_test`. @@ -1808,7 +1808,7 @@ Initial condition calculation optional input functions The following functions can be called just prior to calling :c:func:`IDACalcIC` to set optional inputs controlling the initial condition calculation. -.. c:function:: int IDASetNonlinConvCoefIC(void * ida_mem, realtype epiccon) +.. c:function:: int IDASetNonlinConvCoefIC(void * ida_mem, sunrealtype epiccon) The function :c:func:`IDASetNonlinConvCoefIC` specifies the positive constant in the Newton iteration convergence test within the initial condition @@ -1988,7 +1988,7 @@ step size adaptivity. make changes gradually and with testing to determine their effectiveness. -.. c:function:: int IDASetEtaFixedStepBounds(void* ida_mem, realtype eta_min_fx, realtype eta_max_fx) +.. c:function:: int IDASetEtaFixedStepBounds(void* ida_mem, sunrealtype eta_min_fx, sunrealtype eta_max_fx) The function ``IDASetEtaFixedStepBounds`` specifies the bounds :math:`\eta_{\mathrm{min\_fx}}` and :math:`\eta_{\mathrm{max\_fx}}`. If step size @@ -2013,7 +2013,7 @@ step size adaptivity. .. versionadded:: 5.2.0 -.. c:function:: int IDASetEtaMax(void* ida_mem, realtype eta_max) +.. c:function:: int IDASetEtaMax(void* ida_mem, sunrealtype eta_max) The function ``IDASetEtaMax`` specifies the maximum step size growth factor :math:`\eta_{\mathrm{max}}`. @@ -2030,7 +2030,7 @@ step size adaptivity. .. versionadded:: 5.2.0 -.. c:function:: int IDASetEtaMin(void* ida_mem, realtype eta_min) +.. c:function:: int IDASetEtaMin(void* ida_mem, sunrealtype eta_min) The function ``IDASetEtaMin`` specifies the minimum step size reduction factor :math:`\eta_{\mathrm{min}}`. @@ -2050,7 +2050,7 @@ step size adaptivity. .. versionadded:: 5.2.0 -.. c:function:: int IDASetEtaLow(void* ida_mem, realtype eta_low) +.. c:function:: int IDASetEtaLow(void* ida_mem, sunrealtype eta_low) The function ``IDASetEtaLow`` specifies the maximum step size reduction factor :math:`\eta_{\mathrm{low}}`. @@ -2070,7 +2070,7 @@ step size adaptivity. .. versionadded:: 5.2.0 -.. c:function:: int IDASetEtaMinErrFail(void* ida_mem, realtype eta_min_ef) +.. c:function:: int IDASetEtaMinErrFail(void* ida_mem, sunrealtype eta_min_ef) The function ``IDASetEtaMinErrFail`` specifies the minimum step size reduction factor :math:`\eta_{\mathrm{min\_ef}}` after an error test failure. @@ -2090,7 +2090,7 @@ step size adaptivity. .. versionadded:: 5.2.0 -.. c:function:: int IDASetEtaConvFail(void* ida_mem, realtype eta_cf) +.. c:function:: int IDASetEtaConvFail(void* ida_mem, sunrealtype eta_cf) The function ``IDASetEtaConvFail`` specifies the step size reduction factor :math:`\eta_{\mathrm{cf}}` after a nonlinear solver convergence failure. @@ -2192,7 +2192,7 @@ output values. This function must be called after a successful return from derivatives of order up to the last internal order used for any value of :math:`t` in the last internal step taken by IDAS. -.. c:function:: int IDAGetDky(void * ida_mem, realtype t, int k, N_Vector dky) +.. c:function:: int IDAGetDky(void * ida_mem, sunrealtype t, int k, N_Vector dky) The function :c:func:`IDAGetDky` computes the interpolated values of the :math:`k^{th}` derivative of :math:`y` for any value of :math:`t` in the last @@ -2378,7 +2378,7 @@ described next. In terms of the problem size :math:`N`, the maximum method order ``maxord``, and the number of root functions ``nrtfn`` (see :numref:`IDAS.Usage.SIM.user_callable.idarootinit`), the actual size of the real workspace, in - :c:type:`realtype` words, is given by the following: + :c:type:`sunrealtype` words, is given by the following: * base value: :math:`\mathtt{lenrw} = 55 + (m + 6) * N_r + 3 * \mathtt{nrtfn}`; @@ -2509,7 +2509,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetLastStep(void * ida_mem, realtype * hlast) +.. c:function:: int IDAGetLastStep(void * ida_mem, sunrealtype * hlast) The function :c:func:`IDAGetLastStep` returns the integration step size taken on the last internal step (if from :c:func:`IDASolve`), or the last value of the @@ -2525,7 +2525,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetCurrentStep(void * ida_mem, realtype * hcur) +.. c:function:: int IDAGetCurrentStep(void * ida_mem, sunrealtype * hcur) The function :c:func:`IDAGetCurrentStep` returns the integration step size to be attempted on the next internal step. @@ -2538,7 +2538,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetActualInitStep(void * ida_mem, realtype * hinused) +.. c:function:: int IDAGetActualInitStep(void * ida_mem, sunrealtype * hinused) The function :c:func:`IDAGetActualInitStep` returns the value of the integration step size used on the first step. @@ -2558,7 +2558,7 @@ described next. changed by IDAS to ensure that the step size is within the prescribed bounds :math:`(h_{min} \le h_0 \le h_{max})`, or to meet the local error test. -.. c:function:: int IDAGetCurrentTime(void * ida_mem, realtype * tcur) +.. c:function:: int IDAGetCurrentTime(void * ida_mem, sunrealtype * tcur) The function :c:func:`IDAGetCurrentTime` returns the current internal time reached by the solver. @@ -2571,7 +2571,7 @@ described next. * ``IDA_SUCCESS`` -- The optional output value has been successfully set. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetTolScaleFactor(void * ida_mem, realtype * tolsfac) +.. c:function:: int IDAGetTolScaleFactor(void * ida_mem, sunrealtype * tolsfac) The function :c:func:`IDAGetTolScaleFactor` returns a suggested factor by which the user's tolerances should be scaled when too much accuracy has been requested @@ -2633,8 +2633,8 @@ described next. .. c:function:: int IDAGetIntegratorStats(void *ida_mem, long int *nsteps, \ long int *nrevals, long int *nlinsetups, long int *netfails, \ - int *klast, int *kcur, realtype *hinused, realtype *hlast, \ - realtype *hcur, realtype *tcur) + int *klast, int *kcur, sunrealtype *hinused, sunrealtype *hlast, \ + sunrealtype *hcur, sunrealtype *tcur) The function :c:func:`IDAGetIntegratorStats` returns the IDAS integrator stats in one function call. @@ -3225,7 +3225,7 @@ integration and the restart, so that the restarted problem uses the new values (which have jumped). Similar comments apply if there is to be a jump in the dependent variable vector. -.. c:function:: int IDAReInit(void * ida_mem, realtype t0, N_Vector y0, N_Vector yp0) +.. c:function:: int IDAReInit(void * ida_mem, sunrealtype t0, N_Vector y0, N_Vector yp0) The function :c:func:`IDAReInit` provides required problem specifications and reinitializes IDAS. @@ -3272,7 +3272,7 @@ DAE residual function The user must provide a function of type :c:type:`IDAResFn` defined as follows: -.. c:type:: int (*IDAResFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +.. c:type:: int (*IDAResFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) This function computes the problem residual for given values of the independent variable :math:`t`, state vector :math:`y`, and derivative @@ -3389,7 +3389,7 @@ If a rootfinding problem is to be solved during the integration of the DAE system, the user must supply a function of type :c:type:`IDARootFn`, defined as follows: -.. c:type:: int (*IDARootFn)(realtype t, N_Vector y, N_Vector yp, realtype *gout, void *user_data) +.. c:type:: int (*IDARootFn)(sunrealtype t, N_Vector y, N_Vector yp, sunrealtype *gout, void *user_data) This function computes a vector-valued function :math:`g(t,y,\dot{y})` such that the roots of the ``nrtfn`` components :math:`g_i(t,y,\dot{y})` are to be @@ -3423,7 +3423,7 @@ If a matrix-based linear solver module is used (i.e. a non-``NULL`` ``SUNMatrix`` object was supplied to :c:func:`IDASetLinearSolver`), the user may provide a function of type :c:type:`IDALsJacFn` defined as follows: -.. c:type:: int (*IDALsJacFn)(realtype t, realtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*IDALsJacFn)(sunrealtype t, sunrealtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the Jacobian matrix :math:`J` of the DAE system (or an approximation to it), defined by :eq:`IDAS_DAE_Jacobian`. @@ -3525,7 +3525,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: elements within the band are those with ``-mupper`` :math:`\le` ``m-n`` :math:`\le` ``mlower``. Alternatively, ``SM_COLUMN_B(J, j)`` returns a pointer to the diagonal element of the ``j``-th column of ``Jac``, and if we - assign this address to ``realtype *col_j``, then the ``i``-th element of the + assign this address to ``sunrealtype *col_j``, then the ``i``-th element of the ``j``-th column is given by ``SM_COLUMN_ELEMENT_B(col_j, i, j)``, counting from :math:`0`. Thus, for :math:`(m,n)` within the band, :math:`J_{m,n}` can be loaded by setting ``col_n = SM_COLUMN_B(J, n-1);`` and @@ -3572,7 +3572,7 @@ provide a function of type :c:type:`IDALsJacTimesVecFn` in the following form, t compute matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*IDALsJacTimesVecFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, realtype cj, void *user_data, N_Vector tmp1, N_Vector tmp2) +.. c:type:: int (*IDALsJacTimesVecFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, sunrealtype cj, void *user_data, N_Vector tmp1, N_Vector tmp2) This function computes the product :math:`Jv` of the DAE system Jacobian :math:`J` (or an approximation to it) and a given vector ``v``, where @@ -3632,7 +3632,7 @@ Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`IDALsJacTimesSetupFn`, defined as follows: -.. c:type:: int (*IDALsJacTimesSetupFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, ealtype cj, void *user_data); +.. c:type:: int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, ealtype cj, void *user_data); This function setups any data needed by :math:`Jv` product function (see :c:type:`IDALsJacTimesVecFn`). @@ -3692,7 +3692,7 @@ approximates (at least crudely) the Jacobian matrix :math:`J = function must be of type :c:type:`IDALsPrecSolveFn`, defined as follows: -.. c:type:: int (*IDALsPrecSolveFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, realtype cj, realtype delta, void *user_data) +.. c:type:: int (*IDALsPrecSolveFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, sunrealtype cj, sunrealtype delta, void *user_data) This function solves the preconditioning system :math:`Pz = r`. @@ -3733,7 +3733,7 @@ If the user’s preconditioner requires that any Jacobian-related data be evaluated or preprocessed, then this needs to be done in a user-supplied function of type :c:type:`IDALsPrecSetupFn`, defined as follows: -.. c:type:: int (*IDALsPrecSetupFn)(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, realtype cj, void *user_data) +.. c:type:: int (*IDALsPrecSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, sunrealtype cj, void *user_data) This function solves the preconditioning system :math:`Pz = r`. @@ -3970,7 +3970,7 @@ then IDAS computes both a solution and quadratures at time ``t``. However, :c:func:`IDASolve` will still return only the solution :math:`y` in ``y``. Solution quadratures can be obtained using the following function: -.. c:function:: int IDAGetQuad(void * ida_mem, realtype* tret, N_Vector yQ) +.. c:function:: int IDAGetQuad(void * ida_mem, sunrealtype* tret, N_Vector yQ) The function :c:func:`IDAGetQuad` returns the quadrature solution vector after a successful return from :c:func:`IDASolve`. @@ -3992,7 +3992,7 @@ function is called by :c:func:`IDAGetQuad` with ``k = 0`` and with the current time at which :c:func:`IDASolve` has returned, but may also be called directly by the user. -.. c:function:: int IDAGetQuadDky(void * ida_mem, realtype t, int k, N_Vector dkyQ) +.. c:function:: int IDAGetQuadDky(void * ida_mem, sunrealtype t, int k, N_Vector dkyQ) The function :c:func:`IDAGetQuadDky` returns derivatives of the quadrature solution vector after a successful return from ``IDA``. @@ -4051,7 +4051,7 @@ If the quadrature variables are part of the step size control mechanism, one of the following functions must be called to specify the integration tolerances for quadrature variables. -.. c:function:: int IDAQuadSStolerances(void * ida_mem, realtype reltolQ, realtype abstolQ) +.. c:function:: int IDAQuadSStolerances(void * ida_mem, sunrealtype reltolQ, sunrealtype abstolQ) The function :c:func:`IDAQuadSStolerances` specifies scalar relative and absolute tolerances. @@ -4067,7 +4067,7 @@ quadrature variables. * ``IDA_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int IDAQuadSVtolerances(void * ida_mem, realtype reltolQ, N_Vector abstolQ) +.. c:function:: int IDAQuadSVtolerances(void * ida_mem, sunrealtype reltolQ, N_Vector abstolQ) The function :c:func:`IDAQuadSVtolerances` specifies scalar relative and vector absolute tolerances. @@ -4165,7 +4165,7 @@ defines the right-hand side of the quadrature equations (in other words, the integrand function of the integral that must be evaluated). This function must be of type :c:func:`IDAQuadRhsFn` defined as follows: -.. c:type:: int (*IDAQuadRhsFn)(realtype tres, N_Vector yy, N_Vector yp, N_Vector rrQ, void *user_data) +.. c:type:: int (*IDAQuadRhsFn)(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rrQ, void *user_data) This function computes the quadrature equation right-hand side for a given value of the independent variable :math:`t` and state vectors :math:`y` and @@ -4311,7 +4311,7 @@ space (presumably within ``user_data``) for components of ``yy`` and ``yp`` that are communicated by ``Gcomm`` from the other processors, and that are then used by ``Gres``, which should not do any communication. -.. c:type:: int (*IDABBDLocalFn)(sunindextype Nlocal, realtype tt, N_Vector yy, N_Vector yp, N_Vector gval, void *user_data) +.. c:type:: int (*IDABBDLocalFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector gval, void *user_data) This ``Gres`` function computes :math:`G(t,y,\dot{y})`. It loads the vector ``gval`` as a function of ``tt``, ``yy``, and ``yp``. @@ -4338,7 +4338,7 @@ by ``Gres``, which should not do any communication. The case where :math:`G` is mathematically identical to :math:`F` is allowed. -.. c:type:: int (*IDABBDCommFn)(sunindextype Nlocal, realtype tt, N_Vector yy, N_Vector yp, void *user_data) +.. c:type:: int (*IDABBDCommFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, void *user_data) This ``Gcomm`` function performs all inter-processor communications necessary for the execution of the ``Gres`` function above, using the input vectors @@ -4438,7 +4438,7 @@ out and new or modified steps are in bold. The user-callable functions that initialize or re-initialize the IDABBDPRE preconditioner module are described next. -.. c:function:: int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, realtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm); +.. c:function:: int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm); The function :c:func:`IDABBDPrecInit` initializes and allocates (internal) memory for the IDABBDPRE preconditioner. @@ -4503,7 +4503,7 @@ there is a change in any of the linear solver inputs, an additional call to the the corresponding ``IDASet***`` functions, must also be made (in the proper order). -.. c:function:: int IDABBDPrecReInit(void * ida_mem, sunindextype mudq, sunindextype mldq, realtype dq_rel_yy) +.. c:function:: int IDABBDPrecReInit(void * ida_mem, sunindextype mudq, sunindextype mldq, sunrealtype dq_rel_yy) The function :c:func:`IDABBDPrecReInit` reinitializes the IDABBDPRE preconditioner. diff --git a/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst b/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst index 643de50494..ca45f40d99 100644 --- a/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst +++ b/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst @@ -50,7 +50,7 @@ the ``SUNNonlinearSolver`` API. For example, such a user might need access to the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. -.. c:function:: int IDAGetCurrentCj(void *ida_mem, realtype *cj) +.. c:function:: int IDAGetCurrentCj(void *ida_mem, sunrealtype *cj) The function :c:func:`IDAGetCurrentCj` returns the scalar :math:`c_j` which is proportional to the inverse of the step size (:math:`\alpha` in @@ -120,7 +120,7 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. * ``IDA_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. -.. c:function:: int IDAGetNonlinearSystemData(void *ida_mem, realtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, N_Vector *res, realtype *cj, void **user_data) +.. c:function:: int IDAGetNonlinearSystemData(void *ida_mem, sunrealtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, N_Vector *res, sunrealtype *cj, void **user_data) The function :c:func:`IDAGetNonlinearSystemData` returns all internal data required to construct the current nonlinear system :eq:`IDAS_res_corrector`. @@ -179,7 +179,7 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. evaluation of the nonlinear system function. -.. c:function:: int IDAGetNonlinearSystemDataSens(void * ida_mem, realtype* tcur, N_Vector** yySpred, N_Vector** ypSpred, N_Vector** yySn, N_Vector** ypSn, realtype* cj, void** user_data) +.. c:function:: int IDAGetNonlinearSystemDataSens(void * ida_mem, sunrealtype* tcur, N_Vector** yySpred, N_Vector** ypSpred, N_Vector** yySn, N_Vector** ypSn, sunrealtype* cj, void** user_data) The function :c:func:`IDAGetNonlinearSystemDataSens` returns all internal sensitivity data required to construct the current nonlinear system diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index c55d695dc8..f35ad45c83 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -98,7 +98,7 @@ data types can be used. The header file that is always required is: header file for KINLS, ``kinsol/kinsol_ls.h``. Note that ``kinsol.h`` includes ``sundials_types.h``, which defines the types, -``realtype``, ``sunindextype``, and ``booleantype`` and the constants +``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation @@ -859,7 +859,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. where :math:`\eta_{\text{min}} = 10^{-4}` and :math:`\eta_{\text{max}} = 0.9`. -.. c:function:: int KINSetEtaConstValue(void * kin_mem, realtype eta) +.. c:function:: int KINSetEtaConstValue(void * kin_mem, sunrealtype eta) The function :c:func:`KINSetEtaConstValue` specifies the constant value for :math:`\eta` in the case ``etachoice = KIN_ETACONSTANT``. @@ -878,7 +878,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. :math:`0.0 <` ``eta`` :math:`\le 1.0`. -.. c:function:: int KINSetEtaParams(void * kin_mem, realtype egamma, realtype ealpha) +.. c:function:: int KINSetEtaParams(void * kin_mem, sunrealtype egamma, sunrealtype ealpha) The function :c:func:`KINSetEtaParams` specifies the parameters :math:`\gamma` and :math:`\alpha` in the formula for :math:`\eta`, in the @@ -900,7 +900,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. :math:`\le 1.0` and :math:`1.0<` ``ealpha`` :math:`\le 2.0`. -.. c:function:: int KINSetResMonConstValue(void * kin_mem, realtype omegaconst) +.. c:function:: int KINSetResMonConstValue(void * kin_mem, sunrealtype omegaconst) The function :c:func:`KINSetResMonConstValue` specifies the constant value for :math:`\omega` when using residual monitoring. @@ -919,7 +919,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. :math:`0.0 <` ``omegaconst`` :math:`< 1.0`. -.. c:function:: int KINSetResMonParams(void * kin_mem, realtype omegamin, realtype omegamax) +.. c:function:: int KINSetResMonParams(void * kin_mem, sunrealtype omegamin, sunrealtype omegamax) The function :c:func:`KINSetResMonParams` specifies the parameters :math:`\omega_{min}` and :math:`\omega_{max}` in the formula :eq:`KIN_resmon_omega` for @@ -965,7 +965,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. :math:`\epsilon` (see :c:func:`KINSetFuncNormTol` below). -.. c:function:: int KINSetMaxNewtonStep(void * kin_mem, realtype mxnewtstep) +.. c:function:: int KINSetMaxNewtonStep(void * kin_mem, sunrealtype mxnewtstep) The function :c:func:`KINSetMaxNewtonStep` specifies the maximum allowable scaled length of the Newton step. @@ -985,7 +985,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. where :math:`u_0` is the initial guess. -.. c:function:: int KINSetMaxBetaFails(void * kin_mem, realtype mxnbcf) +.. c:function:: int KINSetMaxBetaFails(void * kin_mem, sunrealtype mxnbcf) The function :c:func:`KINSetMaxBetaFails` specifies the maximum number of :math:`\beta`-condition failures in the linesearch algorithm. @@ -1004,7 +1004,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. The default value of ``mxnbcf`` is ``MXNBCF_DEFAULT`` :math:`=10`. -.. c:function:: int KINSetRelErrFunc(void * kin_mem, realtype relfunc) +.. c:function:: int KINSetRelErrFunc(void * kin_mem, sunrealtype relfunc) The function :c:func:`KINSetRelErrFunc` specifies the relative error in computing :math:`F(u)`, which is used in the difference quotient @@ -1026,7 +1026,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. The default value for ``relfunc`` is :math:`U` = unit roundoff. -.. c:function:: int KINSetFuncNormTol(void * kin_mem, realtype fnormtol) +.. c:function:: int KINSetFuncNormTol(void * kin_mem, sunrealtype fnormtol) The function :c:func:`KINSetFuncNormTol` specifies the scalar used as a stopping tolerance on the scaled maximum norm of the system function @@ -1046,7 +1046,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. The default value for ``fnormtol`` is (unit roundoff) :math:`^{1/3}`. -.. c:function:: int KINSetScaledStepTol(void * kin_mem, realtype scsteptol) +.. c:function:: int KINSetScaledStepTol(void * kin_mem, sunrealtype scsteptol) The function :c:func:`KINSetScaledStepTol` specifies the scalar used as a stopping tolerance on the minimum scaled step length. @@ -1134,7 +1134,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. The default value of ``ret_newest`` is ``SUNFALSE``. -.. c:function:: int KINSetDamping(void * kin_mem, realtype beta) +.. c:function:: int KINSetDamping(void * kin_mem, sunrealtype beta) The function :c:func:`KINSetDamping` specifies the value of the damping parameter in the fixed point or Picard iteration. @@ -1186,7 +1186,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. value of ``mxiter``. -.. c:function:: int KINSetDampingAA(void * kin_mem, realtype beta) +.. c:function:: int KINSetDampingAA(void * kin_mem, sunrealtype beta) The function :c:func:`KINSetDampingAA` specifies the value of the Anderson acceleration damping paramter. @@ -1499,7 +1499,7 @@ functions are described next. **Arguments:** * ``kin_mem`` -- pointer to the KINSOL memory block. - * ``lenrw`` -- the number of ``realtype`` values in the KINSOL workspace. + * ``lenrw`` -- the number of ``sunrealtype`` values in the KINSOL workspace. * ``leniw`` -- the number of integer values in the KINSOL workspace. **Return value:** @@ -1508,7 +1508,7 @@ functions are described next. **Notes:** KINSOL solver In terms of the problem size :math:`N`, the actual size of - the real workspace is :math:`17 + 5 N` ``realtype`` words. The real workspace + the real workspace is :math:`17 + 5 N` ``sunrealtype`` words. The real workspace is increased by an additional :math:`N` words if constraint checking is enabled (see :c:func:`KINSetConstraints`). @@ -1573,7 +1573,7 @@ functions are described next. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. -.. c:function:: int KINGetFuncNorm(void * kin_mem, realtype fnorm) +.. c:function:: int KINGetFuncNorm(void * kin_mem, sunrealtype fnorm) The function :c:func:`KINGetFuncNorm` returns the scaled Euclidean :math:`\ell_2` norm of the nonlinear system function :math:`F(u)` evaluated @@ -1588,7 +1588,7 @@ functions are described next. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. -.. c:function:: int KINGetStepLength(void * kin_mem, realtype steplength) +.. c:function:: int KINGetStepLength(void * kin_mem, sunrealtype steplength) The function :c:func:`KINGetStepLength` returns the scaled Euclidean :math:`\ell_2` norm of the step used during the previous iteration. @@ -2116,7 +2116,7 @@ provide a function of type :c:type:`KINLsJacFn` defined as follows: :math:`J_{m,n}`. The elements within the band are those with ``-mupper`` :math:`\le` ``m-n`` :math:`\le` ``mlower``. Alternatively, ``SM_COLUMN_B(J, j)`` returns a pointer to the diagonal element of the - ``j``-th column of ``J``, and if we assign this address to ``realtype + ``j``-th column of ``J``, and if we assign this address to ``sunrealtype *col_j``, then the ``i``-th element of the ``j``-th column is given by ``SM_COLUMN_ELEMENT_B(col_j, i, j)``, counting from :math:`0`. Thus, for :math:`(m,n)` within the band, :math:`J_{m,n}` can be loaded by setting @@ -2457,7 +2457,7 @@ user main program presented in :numref:`KINSOL.Usage.CC.skeleton_sim` are not bo The user-callable functions that initialize or re-initialize the KINBBDPRE preconditioner module are described next. -.. c:function:: int KINBBDPrecInit(void* kin_mem, sunindextype Nlocal, sunindextype mudq, sunindexype mldq, sunindextype mukeep, sunindextype mlkeep, realtype dq_rel_u, KINBBDLocalFn Gloc, KINBBDCommFn Gcomm) +.. c:function:: int KINBBDPrecInit(void* kin_mem, sunindextype Nlocal, sunindextype mudq, sunindexype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dq_rel_u, KINBBDLocalFn Gloc, KINBBDCommFn Gcomm) The function :c:func:`KINBBDPrecInit` initializes and allocates memory for the KINBBDPRE preconditioner. diff --git a/doc/kinsol/kin_ex_c.tex b/doc/kinsol/kin_ex_c.tex index 5471fb208d..74fd91f289 100644 --- a/doc/kinsol/kin_ex_c.tex +++ b/doc/kinsol/kin_ex_c.tex @@ -58,8 +58,8 @@ \subsection{A serial dense example: kinFerTron\_dns}\label{ss:kinFerTron_dns} The \id{sunlinsol\_dense.h} file provides the prototype for the \id{SUNLinSol\_Dense} function. %% The \id{sundials\_types.h} file provides the definition of the -type \id{realtype} (see \ugref{s:types} for details). -For now, it suffices to read \id{realtype} as \id{double}. +type \id{sunrealtype} (see \ugref{s:types} for details). +For now, it suffices to read \id{sunrealtype} as \id{double}. %% Finally, \id{sundials\_math.h} is included for the definition of the exponential function \id{RExp}. @@ -211,7 +211,7 @@ \subsection{A serial Krylov example: kinFoodWeb\_kry}\label{ss:kinFoodWeb_kry} constants and function prototypes associated with the {\spgmr} solver module. The inclusion of \id{sundials\_math.h} is done to access the \id{SUNMAX} and \id{SUNRabs} macros, and the \id{SUNRsqrt} function to compute the square root -of a \id{realtype} number. +of a \id{sunrealtype} number. The \id{main} program calls \id{KINCreate} and then calls \id{KINInit} with the name of the user-supplied system function \id{func} and solution vector as diff --git a/doc/kinsol/kin_ex_fortran.tex b/doc/kinsol/kin_ex_fortran.tex index 87bb6a2cda..2c7b263144 100644 --- a/doc/kinsol/kin_ex_fortran.tex +++ b/doc/kinsol/kin_ex_fortran.tex @@ -16,7 +16,7 @@ \section{Fortran example problems}\label{s:ex_fortran} where {\em n} denotes the number of bytes in the corresponding {\CC} type ({\tt long int} or {\tt int}). Floating-point variable declarations remain unchanged if double precision is used, but are changed to {\tt REAL*}{\em n}, -where {\em n} denotes the number of bytes in the {\sundials} type {\tt realtype}, +where {\em n} denotes the number of bytes in the {\sundials} type {\tt sunrealtype}, if using single precision. Also, if using single precision, declarations of floating-point constants are appropriately modified, e.g. {\tt 0.5D-4} is changed to {\tt 0.5E-4}. diff --git a/doc/shared/Types.rst b/doc/shared/Types.rst index 9c26c7a20d..b78bd866a4 100644 --- a/doc/shared/Types.rst +++ b/doc/shared/Types.rst @@ -17,7 +17,7 @@ Data Types The header file ``sundials_types.h`` contains the definition of the types: -* :c:type:`realtype` -- the floating-point type used by the SUNDIALS packages +* :c:type:`sunrealtype` -- the floating-point type used by the SUNDIALS packages * :c:type:`sunindextype` -- the integer type used for vector and matrix indices @@ -28,22 +28,22 @@ The header file ``sundials_types.h`` contains the definition of the types: Floating point types ~~~~~~~~~~~~~~~~~~~~ -.. c:type:: realtype +.. c:type:: sunrealtype - The type ``realtype`` can be ``float``, ``double``, or ``long double``, with + The type ``sunrealtype`` can be ``float``, ``double``, or ``long double``, with the default being ``double``. The user can change the precision of the arithmetic used in the SUNDIALS solvers at the configuration stage (see :cmakeop:`SUNDIALS_PRECISION`). Additionally, based on the current precision, ``sundials_types.h`` defines -``BIG_REAL`` to be the largest value representable as a ``realtype``, -``SMALL_REAL`` to be the smallest value representable as a ``realtype``, and +``BIG_REAL`` to be the largest value representable as a ``sunrealtype``, +``SMALL_REAL`` to be the smallest value representable as a ``sunrealtype``, and ``UNIT_ROUNDOFF`` to be the difference between :math:`1.0` and the minimum -``realtype`` greater than :math:`1.0`. +``sunrealtype`` greater than :math:`1.0`. Within SUNDIALS, real constants are set by way of a macro called ``RCONST``. It is this macro that needs the ability to branch on the definition of -``realtype``. In ANSI C, a floating-point constant with no suffix is stored as a +``sunrealtype``. In ANSI C, a floating-point constant with no suffix is stored as a ``double``. Placing the suffix "``F``" at the end of a floating point constant makes it a ``float``, whereas using the suffix "``L``" makes it a ``long double``. For example, @@ -57,25 +57,25 @@ double``. For example, defines ``A`` to be a ``double`` constant equal to :math:`1.0`, ``B`` to be a ``float`` constant equal to :math:`1.0`, and ``C`` to be a ``long double`` constant equal to :math:`1.0`. The macro call ``RCONST(1.0)`` automatically -expands to ``1.0`` if ``realtype`` is ``double``, to ``1.0F`` if ``realtype`` is -``float``, or to ``1.0L`` if ``realtype`` is ``long double``. SUNDIALS uses the +expands to ``1.0`` if ``sunrealtype`` is ``double``, to ``1.0F`` if ``sunrealtype`` is +``float``, or to ``1.0L`` if ``sunrealtype`` is ``long double``. SUNDIALS uses the ``RCONST`` macro internally to declare all of its floating-point constants. Additionally, SUNDIALS defines several macros for common mathematical functions *e.g.*, ``fabs``, ``sqrt``, ``exp``, etc. in ``sundials_math.h``. The macros are prefixed with ``SUNR`` and expand to the appropriate ``C`` function based on the -``realtype``. For example, the macro ``SUNRabs`` expands to the ``C`` function -``fabs`` when ``realtype`` is ``double``, ``fabsf`` when ``realtype`` is -``float``, and ``fabsl`` when ``realtype`` is ``long double``. +``sunrealtype``. For example, the macro ``SUNRabs`` expands to the ``C`` function +``fabs`` when ``sunrealtype`` is ``double``, ``fabsf`` when ``sunrealtype`` is +``float``, and ``fabsl`` when ``sunrealtype`` is ``long double``. -A user program which uses the type ``realtype``, the ``RCONST`` macro, and the +A user program which uses the type ``sunrealtype``, the ``RCONST`` macro, and the ``SUNR`` mathematical function macros is precision-independent except for any calls to precision-specific library functions. Our example programs use -``realtype``, ``RCONST``, and the ``SUNR`` macros. Users can, however, use the +``sunrealtype``, ``RCONST``, and the ``SUNR`` macros. Users can, however, use the type ``double``, ``float``, or ``long double`` in their code (assuming that this -usage is consistent with the typedef for ``realtype``) and call the appropriate +usage is consistent with the typedef for ``sunrealtype``) and call the appropriate math library functions directly. Thus, a previously existing piece of C or C++ -code can use SUNDIALS without modifying the code to use ``realtype``, +code can use SUNDIALS without modifying the code to use ``sunrealtype``, ``RCONST``, or the ``SUNR`` macros so long as the SUNDIALS libraries are built to use the corresponding precision (see :numref:`Installation.CMake.Options`). diff --git a/doc/shared/nvectors/NVector_CUDA.rst b/doc/shared/nvectors/NVector_CUDA.rst index 53eec3ef68..454f197575 100644 --- a/doc/shared/nvectors/NVector_CUDA.rst +++ b/doc/shared/nvectors/NVector_CUDA.rst @@ -72,12 +72,12 @@ provide macros to access its member variables. Instead, user should use the accessor functions: -.. c:function:: realtype* N_VGetHostArrayPointer_Cuda(N_Vector v) +.. c:function:: sunrealtype* N_VGetHostArrayPointer_Cuda(N_Vector v) This function returns pointer to the vector data on the host. -.. c:function:: realtype* N_VGetDeviceArrayPointer_Cuda(N_Vector v) +.. c:function:: sunrealtype* N_VGetDeviceArrayPointer_Cuda(N_Vector v) This function returns pointer to the vector data on the device. @@ -132,14 +132,14 @@ following additional user-callable routines: the other constructors to create a new vector. -.. c:function:: N_Vector N_VMake_Cuda(sunindextype vec_length, realtype *h_vdata, realtype *d_vdata, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_Cuda(sunindextype vec_length, sunrealtype *h_vdata, sunrealtype *d_vdata, SUNContext sunctx) This function creates a CUDA ``N_Vector`` with user-supplied vector data arrays for the host and the device. -.. c:function:: N_Vector N_VMakeManaged_Cuda(sunindextype vec_length, realtype *vdata, SUNContext sunctx) +.. c:function:: N_Vector N_VMakeManaged_Cuda(sunindextype vec_length, sunrealtype *vdata, SUNContext sunctx) This function creates a CUDA ``N_Vector`` with a user-supplied managed memory data array. @@ -180,12 +180,12 @@ The module NVECTOR_CUDA also provides the following user-callable routines: policies across vectors -.. c:function:: realtype* N_VCopyToDevice_Cuda(N_Vector v) +.. c:function:: sunrealtype* N_VCopyToDevice_Cuda(N_Vector v) This function copies host vector data to the device. -.. c:function:: realtype* N_VCopyFromDevice_Cuda(N_Vector v) +.. c:function:: sunrealtype* N_VCopyFromDevice_Cuda(N_Vector v) This function copies vector data from the device to the host. diff --git a/doc/shared/nvectors/NVector_Description.rst b/doc/shared/nvectors/NVector_Description.rst index 5f634a684c..96218bc84b 100644 --- a/doc/shared/nvectors/NVector_Description.rst +++ b/doc/shared/nvectors/NVector_Description.rst @@ -54,56 +54,56 @@ defined as N_Vector (*nvcloneempty)(N_Vector); void (*nvdestroy)(N_Vector); void (*nvspace)(N_Vector, sunindextype *, sunindextype *); - realtype* (*nvgetarraypointer)(N_Vector); - realtype* (*nvgetdevicearraypointer)(N_Vector); - void (*nvsetarraypointer)(realtype *, N_Vector); + sunrealtype* (*nvgetarraypointer)(N_Vector); + sunrealtype* (*nvgetdevicearraypointer)(N_Vector); + void (*nvsetarraypointer)(sunrealtype *, N_Vector); void* (*nvgetcommunicator)(N_Vector); sunindextype (*nvgetlength)(N_Vector); sunindextype (*nvgetlocallength)(N_Vector); - void (*nvlinearsum)(realtype, N_Vector, realtype, N_Vector, N_Vector); - void (*nvconst)(realtype, N_Vector); + void (*nvlinearsum)(sunrealtype, N_Vector, sunrealtype, N_Vector, N_Vector); + void (*nvconst)(sunrealtype, N_Vector); void (*nvprod)(N_Vector, N_Vector, N_Vector); void (*nvdiv)(N_Vector, N_Vector, N_Vector); - void (*nvscale)(realtype, N_Vector, N_Vector); + void (*nvscale)(sunrealtype, N_Vector, N_Vector); void (*nvabs)(N_Vector, N_Vector); void (*nvinv)(N_Vector, N_Vector); - void (*nvaddconst)(N_Vector, realtype, N_Vector); - realtype (*nvdotprod)(N_Vector, N_Vector); - realtype (*nvmaxnorm)(N_Vector); - realtype (*nvwrmsnorm)(N_Vector, N_Vector); - realtype (*nvwrmsnormmask)(N_Vector, N_Vector, N_Vector); - realtype (*nvmin)(N_Vector); - realtype (*nvwl2norm)(N_Vector, N_Vector); - realtype (*nvl1norm)(N_Vector); - void (*nvcompare)(realtype, N_Vector, N_Vector); + void (*nvaddconst)(N_Vector, sunrealtype, N_Vector); + sunrealtype (*nvdotprod)(N_Vector, N_Vector); + sunrealtype (*nvmaxnorm)(N_Vector); + sunrealtype (*nvwrmsnorm)(N_Vector, N_Vector); + sunrealtype (*nvwrmsnormmask)(N_Vector, N_Vector, N_Vector); + sunrealtype (*nvmin)(N_Vector); + sunrealtype (*nvwl2norm)(N_Vector, N_Vector); + sunrealtype (*nvl1norm)(N_Vector); + void (*nvcompare)(sunrealtype, N_Vector, N_Vector); booleantype (*nvinvtest)(N_Vector, N_Vector); booleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector); - realtype (*nvminquotient)(N_Vector, N_Vector); - int (*nvlinearcombination)(int, realtype *, N_Vector *, N_Vector); - int (*nvscaleaddmulti)(int, realtype *, N_Vector, N_Vector *, N_Vector *); - int (*nvdotprodmulti)(int, N_Vector, N_Vector *, realtype *); - int (*nvlinearsumvectorarray)(int, realtype, N_Vector *, realtype, + sunrealtype (*nvminquotient)(N_Vector, N_Vector); + int (*nvlinearcombination)(int, sunrealtype *, N_Vector *, N_Vector); + int (*nvscaleaddmulti)(int, sunrealtype *, N_Vector, N_Vector *, N_Vector *); + int (*nvdotprodmulti)(int, N_Vector, N_Vector *, sunrealtype *); + int (*nvlinearsumvectorarray)(int, sunrealtype, N_Vector *, sunrealtype, N_Vector *, N_Vector *); - int (*nvscalevectorarray)(int, realtype *, N_Vector *, N_Vector *); - int (*nvconstvectorarray)(int, realtype, N_Vector *); - int (*nvwrmsnomrvectorarray)(int, N_Vector *, N_Vector *, realtype *); + int (*nvscalevectorarray)(int, sunrealtype *, N_Vector *, N_Vector *); + int (*nvconstvectorarray)(int, sunrealtype, N_Vector *); + int (*nvwrmsnomrvectorarray)(int, N_Vector *, N_Vector *, sunrealtype *); int (*nvwrmsnomrmaskvectorarray)(int, N_Vector *, N_Vector *, N_Vector, - realtype *); - int (*nvscaleaddmultivectorarray)(int, int, realtype *, N_Vector *, + sunrealtype *); + int (*nvscaleaddmultivectorarray)(int, int, sunrealtype *, N_Vector *, N_Vector **, N_Vector **); - int (*nvlinearcombinationvectorarray)(int, int, realtype *, N_Vector **, + int (*nvlinearcombinationvectorarray)(int, int, sunrealtype *, N_Vector **, N_Vector *); - realtype (*nvdotprodlocal)(N_Vector, N_Vector); - realtype (*nvmaxnormlocal)(N_Vector); - realtype (*nvminlocal)(N_Vector); - realtype (*nvl1normlocal)(N_Vector); + sunrealtype (*nvdotprodlocal)(N_Vector, N_Vector); + sunrealtype (*nvmaxnormlocal)(N_Vector); + sunrealtype (*nvminlocal)(N_Vector); + sunrealtype (*nvl1normlocal)(N_Vector); booleantype (*nvinvtestlocal)(N_Vector, N_Vector); booleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector); - realtype (*nvminquotientlocal)(N_Vector, N_Vector); - realtype (*nvwsqrsumlocal)(N_Vector, N_Vector); - realtype (*nvwsqrsummasklocal(N_Vector, N_Vector, N_Vector); - int (*nvdotprodmultilocal)(int, N_Vector, N_Vector *, realtype *); - int (*nvdotprodmultiallreduce)(int, N_Vector, realtype *); + sunrealtype (*nvminquotientlocal)(N_Vector, N_Vector); + sunrealtype (*nvwsqrsumlocal)(N_Vector, N_Vector); + sunrealtype (*nvwsqrsummasklocal(N_Vector, N_Vector, N_Vector); + int (*nvdotprodmultilocal)(int, N_Vector, N_Vector *, sunrealtype *); + int (*nvdotprodmultiallreduce)(int, N_Vector, sunrealtype *); int (*nvbufsize)(N_Vector, sunindextype *); int (*nvbufpack)(N_Vector, void*); int (*nvbufunpack)(N_Vector, void*); @@ -121,7 +121,7 @@ for vectors :math:`x` and :math:`z` and a scalar :math:`c`: .. code-block:: c - void N_VScale(realtype c, N_Vector x, N_Vector z) { + void N_VScale(sunrealtype c, N_Vector x, N_Vector z) { z->ops->nvscale(c, x, z); } @@ -419,7 +419,7 @@ provide the following guidance: * :c:func:`N_VDotProd()` should mathematically return a complex number for complex-valued vectors; as this is not possible with - SUNDIALS' current ``realtype``, this routine should + SUNDIALS' current ``sunrealtype``, this routine should be set to ``NULL`` in the custom NVECTOR implementation. * :c:func:`N_VCompare()`, :c:func:`N_VConstrMask()`, :c:func:`N_VMinQuotient()`, diff --git a/doc/shared/nvectors/NVector_HIP.rst b/doc/shared/nvectors/NVector_HIP.rst index 50548ad01f..8d63b61988 100644 --- a/doc/shared/nvectors/NVector_HIP.rst +++ b/doc/shared/nvectors/NVector_HIP.rst @@ -69,12 +69,12 @@ provide macros to access its member variables. Instead, user should use the accessor functions: -.. c:function:: realtype* N_VGetHostArrayPointer_Hip(N_Vector v) +.. c:function:: sunrealtype* N_VGetHostArrayPointer_Hip(N_Vector v) This function returns pointer to the vector data on the host. -.. c:function:: realtype* N_VGetDeviceArrayPointer_Hip(N_Vector v) +.. c:function:: sunrealtype* N_VGetDeviceArrayPointer_Hip(N_Vector v) This function returns pointer to the vector data on the device. @@ -122,14 +122,14 @@ following additional user-callable routines: other constructors to create a new vector. -.. c:function:: N_Vector N_VMake_Hip(sunindextype vec_length, realtype *h_vdata, realtype *d_vdata, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_Hip(sunindextype vec_length, sunrealtype *h_vdata, sunrealtype *d_vdata, SUNContext sunctx) This function creates a HIP ``N_Vector`` with user-supplied vector data arrays for the host and the device. -.. c:function:: N_Vector N_VMakeManaged_Hip(sunindextype vec_length, realtype *vdata, SUNContext sunctx) +.. c:function:: N_Vector N_VMakeManaged_Hip(sunindextype vec_length, sunrealtype *vdata, SUNContext sunctx) This function creates a HIP ``N_Vector`` with a user-supplied managed memory data array. @@ -163,12 +163,12 @@ The module NVECTOR_HIP also provides the following user-callable routines: policies across vectors* -.. c:function:: realtype* N_VCopyToDevice_Hip(N_Vector v) +.. c:function:: sunrealtype* N_VCopyToDevice_Hip(N_Vector v) This function copies host vector data to the device. -.. c:function:: realtype* N_VCopyFromDevice_Hip(N_Vector v) +.. c:function:: sunrealtype* N_VCopyFromDevice_Hip(N_Vector v) This function copies vector data from the device to the host. diff --git a/doc/shared/nvectors/NVector_MPIManyVector.rst b/doc/shared/nvectors/NVector_MPIManyVector.rst index bb4907569c..b322703dd1 100644 --- a/doc/shared/nvectors/NVector_MPIManyVector.rst +++ b/doc/shared/nvectors/NVector_MPIManyVector.rst @@ -209,7 +209,7 @@ the following additional user-callable routines: local_length = N_VGetSubvectorLocalLength_MPIManyVector(v, 0); -.. c:function:: realtype *N_VGetSubvectorArrayPointer_MPIManyVector(N_Vector v, sunindextype vec_num) +.. c:function:: sunrealtype *N_VGetSubvectorArrayPointer_MPIManyVector(N_Vector v, sunindextype vec_num) This function returns the data array pointer for the *vec_num* subvector from the NVECTOR array. @@ -219,7 +219,7 @@ the following additional user-callable routines: returned. -.. c:function:: int N_VSetSubvectorArrayPointer_MPIManyVector(realtype *v_data, N_Vector v, sunindextype vec_num) +.. c:function:: int N_VSetSubvectorArrayPointer_MPIManyVector(sunrealtype *v_data, N_Vector v, sunindextype vec_num) This function sets the data array pointer for the *vec_num* subvector from the NVECTOR array. diff --git a/doc/shared/nvectors/NVector_MPIPlusX.rst b/doc/shared/nvectors/NVector_MPIPlusX.rst index 17869cb067..d43e721b0a 100644 --- a/doc/shared/nvectors/NVector_MPIPlusX.rst +++ b/doc/shared/nvectors/NVector_MPIPlusX.rst @@ -105,7 +105,7 @@ user-callable routines: local_length = N_VGetLocalLength_MPIPlusX(v); -.. c:function:: realtype *N_VGetArrayPointer_MPIPlusX(N_Vector v) +.. c:function:: sunrealtype *N_VGetArrayPointer_MPIPlusX(N_Vector v) This function returns the data array pointer for the local vector. @@ -113,7 +113,7 @@ user-callable routines: operation, then ``NULL`` is returned. -.. c:function:: void N_VSetArrayPointer_MPIPlusX(realtype *v_data, N_Vector v) +.. c:function:: void N_VSetArrayPointer_MPIPlusX(sunrealtype *v_data, N_Vector v) This function sets the data array pointer for the local vector if the local vector implements the :c:func:`N_VSetArrayPointer` operation. diff --git a/doc/shared/nvectors/NVector_ManyVector.rst b/doc/shared/nvectors/NVector_ManyVector.rst index 5f2557aea9..9af406774e 100644 --- a/doc/shared/nvectors/NVector_ManyVector.rst +++ b/doc/shared/nvectors/NVector_ManyVector.rst @@ -149,7 +149,7 @@ the following additional user-callable routines: local_length = N_VGetSubvectorLocalLength_ManyVector(v, 0); -.. c:function:: realtype *N_VGetSubvectorArrayPointer_ManyVector(N_Vector v, sunindextype vec_num) +.. c:function:: sunrealtype *N_VGetSubvectorArrayPointer_ManyVector(N_Vector v, sunindextype vec_num) This function returns the data array pointer for the *vec_num* subvector from the NVECTOR array. @@ -159,7 +159,7 @@ the following additional user-callable routines: returned. -.. c:function:: int N_VSetSubvectorArrayPointer_ManyVector(realtype *v_data, N_Vector v, sunindextype vec_num) +.. c:function:: int N_VSetSubvectorArrayPointer_ManyVector(sunrealtype *v_data, N_Vector v, sunindextype vec_num) This function sets the data array pointer for the *vec_num* subvector from the NVECTOR array. diff --git a/doc/shared/nvectors/NVector_OpenMP.rst b/doc/shared/nvectors/NVector_OpenMP.rst index dcd63c0709..a6a954b554 100644 --- a/doc/shared/nvectors/NVector_OpenMP.rst +++ b/doc/shared/nvectors/NVector_OpenMP.rst @@ -38,7 +38,7 @@ supplied argument in the vector constructor. struct _N_VectorContent_OpenMP { sunindextype length; booleantype own_data; - realtype *data; + sunrealtype *data; int num_threads; }; @@ -180,7 +180,7 @@ The module NVECTOR_OPENMP provides the following additional user-callable routin (``NULL``) data array. -.. c:function:: N_Vector N_VMake_OpenMP(sunindextype vec_length, realtype* v_data, int num_threads, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_OpenMP(sunindextype vec_length, sunrealtype* v_data, int num_threads, SUNContext sunctx) This function creates and allocates memory for a OpenMP vector with user-provided data array, *v_data*. diff --git a/doc/shared/nvectors/NVector_OpenMPDEV.rst b/doc/shared/nvectors/NVector_OpenMPDEV.rst index 8415431485..1ff136cec2 100644 --- a/doc/shared/nvectors/NVector_OpenMPDEV.rst +++ b/doc/shared/nvectors/NVector_OpenMPDEV.rst @@ -33,8 +33,8 @@ the ownership of host and device data arrays. { sunindextype length; booleantype own_data; - realtype *host_data; - realtype *dev_data; + sunrealtype *host_data; + sunrealtype *dev_data; }; The header file to include when using this module is ``nvector_openmpdev.h``. @@ -144,19 +144,19 @@ user-callable routines: (``NULL``) data array. -.. c:function:: N_Vector N_VMake_OpenMPDEV(sunindextype vec_length, realtype *h_vdata, realtype *d_vdata, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_OpenMPDEV(sunindextype vec_length, sunrealtype *h_vdata, sunrealtype *d_vdata, SUNContext sunctx) This function creates an NVECTOR_OPENMPDEV vector with user-supplied vector data arrays ``h_vdata`` and ``d_vdata``. This function does not allocate memory for data itself. -.. c:function:: realtype *N_VGetHostArrayPointer_OpenMPDEV(N_Vector v) +.. c:function:: sunrealtype *N_VGetHostArrayPointer_OpenMPDEV(N_Vector v) This function returns a pointer to the host data array. -.. c:function:: realtype *N_VGetDeviceArrayPointer_OpenMPDEV(N_Vector v) +.. c:function:: sunrealtype *N_VGetDeviceArrayPointer_OpenMPDEV(N_Vector v) This function returns a pointer to the device data array. diff --git a/doc/shared/nvectors/NVector_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index 6ef842fdc0..48b5daa4b0 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -84,7 +84,7 @@ operations below. Returns storage requirements for the ``N_Vector`` *v*: - * *lrw* contains the number of ``realtype`` words + * *lrw* contains the number of ``sunrealtype`` words * *liw* contains the number of integer words. This function is advisory only, for use in @@ -99,11 +99,11 @@ operations below. N_VSpace(nvSpec, &lrw, &liw); -.. c:function:: realtype* N_VGetArrayPointer(N_Vector v) +.. c:function:: sunrealtype* N_VGetArrayPointer(N_Vector v) - Returns a pointer to a ``realtype`` array from the ``N_Vector`` + Returns a pointer to a ``sunrealtype`` array from the ``N_Vector`` *v*. Note that this assumes that the internal data in the - ``N_Vector`` is a contiguous array of ``realtype`` and is + ``N_Vector`` is a contiguous array of ``sunrealtype`` and is accesible from the CPU. This routine is @@ -119,11 +119,11 @@ operations below. vdata = N_VGetArrayPointer(v); -.. c:function:: realtype* N_VGetDeviceArrayPointer(N_Vector v) +.. c:function:: sunrealtype* N_VGetDeviceArrayPointer(N_Vector v) - Returns a device pointer to a ``realtype`` array from the ``N_Vector`` + Returns a device pointer to a ``sunrealtype`` array from the ``N_Vector`` ``v``. Note that this assumes that the internal data in ``N_Vector`` is a - contiguous array of ``realtype`` and is accessible from the device (e.g., + contiguous array of ``sunrealtype`` and is accessible from the device (e.g., GPU). This operation is *optional* except when using the GPU-enabled direct @@ -136,12 +136,12 @@ operations below. vdata = N_VGetArrayPointer(v); -.. c:function:: void N_VSetArrayPointer(realtype* vdata, N_Vector v) +.. c:function:: void N_VSetArrayPointer(sunrealtype* vdata, N_Vector v) Replaces the data array pointer in an ``N_Vector`` with a given - array of ``realtype``. Note that this assumes that the internal + array of ``sunrealtype``. Note that this assumes that the internal data in the ``N_Vector`` is a contiguous array of - ``realtype``. This routine is only used in the interfaces to the + ``sunrealtype``. This routine is only used in the interfaces to the dense (serial) linear solver, hence need not exist in a user-supplied NVECTOR module. @@ -193,10 +193,10 @@ operations below. local_length = N_VGetLocalLength(v); -.. c:function:: void N_VLinearSum(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +.. c:function:: void N_VLinearSum(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) Performs the operation *z = ax + by*, where *a* and *b* are - ``realtype`` scalars and *x* and *y* are of type ``N_Vector``: + ``sunrealtype`` scalars and *x* and *y* are of type ``N_Vector``: .. math:: z_i = a x_i + b y_i, \quad i=0,\ldots,n-1. @@ -211,9 +211,9 @@ operations below. N_VLinearSum(a, x, b, y, z); -.. c:function:: void N_VConst(realtype c, N_Vector z) +.. c:function:: void N_VConst(sunrealtype c, N_Vector z) - Sets all components of the ``N_Vector`` *z* to ``realtype`` *c*: + Sets all components of the ``N_Vector`` *z* to ``sunrealtype`` *c*: .. math:: z_i = c, \quad i=0,\ldots,n-1. @@ -258,9 +258,9 @@ operations below. N_VDiv(x, y, z); -.. c:function:: void N_VScale(realtype c, N_Vector x, N_Vector z) +.. c:function:: void N_VScale(sunrealtype c, N_Vector x, N_Vector z) - Scales the ``N_Vector`` *x* by the ``realtype`` scalar *c* and + Scales the ``N_Vector`` *x* by the ``sunrealtype`` scalar *c* and returns the result in *z*: .. math:: @@ -306,9 +306,9 @@ operations below. N_VInv(x, z); -.. c:function:: void N_VAddConst(N_Vector x, realtype b, N_Vector z) +.. c:function:: void N_VAddConst(N_Vector x, sunrealtype b, N_Vector z) - Adds the ``realtype`` scalar *b* to all components of *x* and + Adds the ``sunrealtype`` scalar *b* to all components of *x* and returns the result in the ``N_Vector`` *z*: .. math:: @@ -321,7 +321,7 @@ operations below. N_VAddConst(x, b, z); -.. c:function:: realtype N_VDotProd(N_Vector x, N_Vector z) +.. c:function:: sunrealtype N_VDotProd(N_Vector x, N_Vector z) Returns the value of the dot-product of the ``N_Vectors`` *x* and *y*: @@ -335,7 +335,7 @@ operations below. d = N_VDotProd(x, y); -.. c:function:: realtype N_VMaxNorm(N_Vector x) +.. c:function:: sunrealtype N_VMaxNorm(N_Vector x) Returns the value of the :math:`l_{\infty}` norm of the ``N_Vector`` *x*: @@ -350,10 +350,10 @@ operations below. m = N_VMaxNorm(x); -.. c:function:: realtype N_VWrmsNorm(N_Vector x, N_Vector w) +.. c:function:: sunrealtype N_VWrmsNorm(N_Vector x, N_Vector w) Returns the weighted root-mean-square norm of the ``N_Vector`` *x* - with (positive) ``realtype`` weight vector *w*: + with (positive) ``sunrealtype`` weight vector *w*: .. math:: m = \sqrt{\left( \sum_{i=0}^{n-1} (x_i w_i)^2 \right) / n} @@ -365,10 +365,10 @@ operations below. m = N_VWrmsNorm(x, w); -.. c:function:: realtype N_VWrmsNormMask(N_Vector x, N_Vector w, N_Vector id) +.. c:function:: sunrealtype N_VWrmsNormMask(N_Vector x, N_Vector w, N_Vector id) Returns the weighted root mean square norm of the ``N_Vector`` *x* - with ``realtype`` weight vector *w* built using only the + with ``sunrealtype`` weight vector *w* built using only the elements of *x* corresponding to positive elements of the ``N_Vector`` *id*: @@ -383,7 +383,7 @@ operations below. m = N_VWrmsNormMask(x, w, id); -.. c:function:: realtype N_VMin(N_Vector x) +.. c:function:: sunrealtype N_VMin(N_Vector x) Returns the smallest element of the ``N_Vector`` *x*: @@ -396,10 +396,10 @@ operations below. m = N_VMin(x); -.. c:function:: realtype N_VWl2Norm(N_Vector x, N_Vector w) +.. c:function:: sunrealtype N_VWl2Norm(N_Vector x, N_Vector w) Returns the weighted Euclidean :math:`l_2` norm of the ``N_Vector`` - *x* with ``realtype`` weight vector *w*: + *x* with ``sunrealtype`` weight vector *w*: .. math:: m = \sqrt{\sum_{i=0}^{n-1}\left(x_i w_i\right)^2}. @@ -410,7 +410,7 @@ operations below. m = N_VWL2Norm(x, w); -.. c:function:: realtype N_VL1Norm(N_Vector x) +.. c:function:: sunrealtype N_VL1Norm(N_Vector x) Returns the :math:`l_1` norm of the ``N_Vector`` *x*: @@ -424,9 +424,9 @@ operations below. m = N_VL1Norm(x); -.. c:function:: void N_VCompare(realtype c, N_Vector x, N_Vector z) +.. c:function:: void N_VCompare(sunrealtype c, N_Vector x, N_Vector z) - Compares the components of the ``N_Vector`` *x* to the ``realtype`` + Compares the components of the ``N_Vector`` *x* to the ``sunrealtype`` scalar *c* and returns an ``N_Vector`` *z* such that for all :math:`0\le i< n`, @@ -485,7 +485,7 @@ operations below. t = N_VConstrMask(c, x, m); -.. c:function:: realtype N_VMinQuotient(N_Vector num, N_Vector denom) +.. c:function:: sunrealtype N_VMinQuotient(N_Vector num, N_Vector denom) This routine returns the minimum of the quotients obtained by termwise dividing the elements of *n* by the elements in *d*: @@ -521,7 +521,7 @@ the name, usage of the function, and a description of its mathematical operations below. -.. c:function:: int N_VLinearCombination(int nv, realtype* c, N_Vector* X, N_Vector z) +.. c:function:: int N_VLinearCombination(int nv, sunrealtype* c, N_Vector* X, N_Vector z) This routine computes the linear combination of *nv* vectors with :math:`n` elements: @@ -541,7 +541,7 @@ operations below. retval = N_VLinearCombination(nv, c, X, z); -.. c:function:: int N_VScaleAddMulti(int nv, realtype* c, N_Vector x, N_Vector* Y, N_Vector* Z) +.. c:function:: int N_VScaleAddMulti(int nv, sunrealtype* c, N_Vector x, N_Vector* Y, N_Vector* Z) This routine scales and adds one vector to *nv* vectors with :math:`n` elements: @@ -560,7 +560,7 @@ operations below. retval = N_VScaleAddMulti(nv, c, x, Y, Z); -.. c:function:: int N_VDotProdMulti(int nv, N_Vector x, N_Vector* Y, realtype* d) +.. c:function:: int N_VDotProdMulti(int nv, N_Vector x, N_Vector* Y, sunrealtype* d) This routine computes the dot product of a vector with *nv* vectors having :math:`n` elements: @@ -596,7 +596,7 @@ operation, we give the name, usage of the function, and a description of its mathematical operations below. -.. c:function:: int N_VLinearSumVectorArray(int nv, realtype a, N_Vector X, realtype b, N_Vector* Y, N_Vector* Z) +.. c:function:: int N_VLinearSumVectorArray(int nv, sunrealtype a, N_Vector X, sunrealtype b, N_Vector* Y, N_Vector* Z) This routine computes the linear sum of two vector arrays of *nv* vectors with :math:`n` elements: @@ -615,7 +615,7 @@ of its mathematical operations below. retval = N_VLinearSumVectorArray(nv, a, X, b, Y, Z); -.. c:function:: int N_VScaleVectorArray(int nv, realtype* c, N_Vector* X, N_Vector* Z) +.. c:function:: int N_VScaleVectorArray(int nv, sunrealtype* c, N_Vector* X, N_Vector* Z) This routine scales each element in a vector of :math:`n` elements in a vector array of *nv* vectors by a potentially different constant: @@ -634,7 +634,7 @@ of its mathematical operations below. retval = N_VScaleVectorArray(nv, c, X, Z); -.. c:function:: int N_VConstVectorArray(int nv, realtype c, N_Vector* Z) +.. c:function:: int N_VConstVectorArray(int nv, sunrealtype c, N_Vector* Z) This routine sets each element in a vector of :math:`n` elements in a vector array of *nv* vectors to the same value: @@ -652,7 +652,7 @@ of its mathematical operations below. retval = N_VConstVectorArray(nv, c, Z); -.. c:function:: int N_VWrmsNormVectorArray(int nv, N_Vector* X, N_Vector* W, realtype* m) +.. c:function:: int N_VWrmsNormVectorArray(int nv, N_Vector* X, N_Vector* W, sunrealtype* m) This routine computes the weighted root mean square norm of each vector in a vector array: @@ -672,7 +672,7 @@ of its mathematical operations below. retval = N_VWrmsNormVectorArray(nv, X, W, m); -.. c:function:: int N_VWrmsNormMaskVectorArray(int nv, N_Vector* X, N_Vector* W, N_Vector id, realtype* m) +.. c:function:: int N_VWrmsNormMaskVectorArray(int nv, N_Vector* X, N_Vector* W, N_Vector id, sunrealtype* m) This routine computes the masked weighted root mean square norm of each vector in a vector array: @@ -694,7 +694,7 @@ of its mathematical operations below. retval = N_VWrmsNormMaskVectorArray(nv, X, W, id, m); -.. c:function:: int N_VScaleAddMultiVectorArray(int nv, int nsum, realtype* c, N_Vector* X, N_Vector** YY, N_Vector** ZZ) +.. c:function:: int N_VScaleAddMultiVectorArray(int nv, int nsum, sunrealtype* c, N_Vector* X, N_Vector** YY, N_Vector** ZZ) This routine scales and adds a vector array of *nv* vectors to *nsum* other vector arrays: @@ -715,7 +715,7 @@ of its mathematical operations below. retval = N_VScaleAddMultiVectorArray(nv, nsum, c, x, YY, ZZ); -.. c:function:: int N_VLinearCombinationVectorArray(int nv, int nsum, realtype* c, N_Vector** XX, N_Vector* Z) +.. c:function:: int N_VLinearCombinationVectorArray(int nv, int nsum, sunrealtype* c, N_Vector** XX, N_Vector* Z) This routine computes the linear combination of *nsum* vector arrays containing *nv* vectors: @@ -752,7 +752,7 @@ the name, usage of the function, and a description of its mathematical operations below. -.. c:function:: realtype N_VDotProdLocal(N_Vector x, N_Vector y) +.. c:function:: sunrealtype N_VDotProdLocal(N_Vector x, N_Vector y) This routine computes the MPI task-local portion of the ordinary dot product of *x* and *y*: @@ -771,7 +771,7 @@ operations below. d = N_VDotProdLocal(x, y); -.. c:function:: realtype N_VMaxNormLocal(N_Vector x) +.. c:function:: sunrealtype N_VMaxNormLocal(N_Vector x) This routine computes the MPI task-local portion of the maximum norm of the NVECTOR *x*: @@ -790,7 +790,7 @@ operations below. m = N_VMaxNormLocal(x); -.. c:function:: realtype N_VMinLocal(N_Vector x) +.. c:function:: sunrealtype N_VMinLocal(N_Vector x) This routine computes the smallest element of the MPI task-local portion of the NVECTOR *x*: @@ -809,7 +809,7 @@ operations below. m = N_VMinLocal(x); -.. c:function:: realtype N_VL1NormLocal(N_Vector x) +.. c:function:: sunrealtype N_VL1NormLocal(N_Vector x) This routine computes the MPI task-local portion of the :math:`l_1` norm of the ``N_Vector`` *x*: @@ -828,7 +828,7 @@ operations below. n = N_VL1NormLocal(x); -.. c:function:: realtype N_VWSqrSumLocal(N_Vector x, N_Vector w) +.. c:function:: sunrealtype N_VWSqrSumLocal(N_Vector x, N_Vector w) This routine computes the MPI task-local portion of the weighted squared sum of the NVECTOR *x* with weight vector *w*: @@ -847,7 +847,7 @@ operations below. s = N_VWSqrSumLocal(x, w); -.. c:function:: realtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id) +.. c:function:: sunrealtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id) This routine computes the MPI task-local portion of the weighted squared sum of the NVECTOR *x* with weight vector *w* built using @@ -922,7 +922,7 @@ operations below. t = N_VConstrMaskLocal(c, x, m); -.. c:function:: realtype N_VMinQuotientLocal(N_Vector num, N_Vector denom) +.. c:function:: sunrealtype N_VMinQuotientLocal(N_Vector num, N_Vector denom) This routine returns the minimum of the quotients obtained by term-wise dividing :math:`num_i` by :math:`denom_i`, for all MPI @@ -950,7 +950,7 @@ orthogonalization methods to reduce the number of MPI ``Allreduce`` calls. If a particular NVECTOR implementation does not define these operations additional communication will be required. -.. c:function:: int N_VDotProdMultiLocal(int nv, N_Vector x, N_Vector* Y, realtype* d) +.. c:function:: int N_VDotProdMultiLocal(int nv, N_Vector x, N_Vector* Y, sunrealtype* d) This routine computes the MPI task-local portion of the dot product of a vector :math:`x` with *nv* vectors :math:`y_j`: @@ -971,7 +971,7 @@ communication will be required. retval = N_VDotProdMultiLocal(nv, x, Y, d); -.. c:function:: int N_VDotProdMultiAllReduce(int nv, N_Vector x, realtype* d) +.. c:function:: int N_VDotProdMultiAllReduce(int nv, N_Vector x, sunrealtype* d) This routine combines the MPI task-local portions of the dot product of a vector :math:`x` with *nv* vectors: diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index 92b881bbd6..600e37537b 100644 --- a/doc/shared/nvectors/NVector_ParHyp.rst +++ b/doc/shared/nvectors/NVector_ParHyp.rst @@ -35,7 +35,7 @@ HYPRE parallel vector object *x*. sunindextype global_length; booleantype own_data; booleantype own_parvector; - realtype *data; + sunrealtype *data; MPI_Comm comm; hypre_ParVector *x; }; diff --git a/doc/shared/nvectors/NVector_Parallel.rst b/doc/shared/nvectors/NVector_Parallel.rst index 0b9b2ae8f7..cf5ec0412a 100644 --- a/doc/shared/nvectors/NVector_Parallel.rst +++ b/doc/shared/nvectors/NVector_Parallel.rst @@ -30,7 +30,7 @@ ownership of the data array *data*. sunindextype local_length; sunindextype global_length; booleantype own_data; - realtype *data; + sunrealtype *data; MPI_Comm comm; }; @@ -173,7 +173,7 @@ the following additional user-callable routines: (``NULL``) data array. -.. c:function:: N_Vector N_VMake_Parallel(MPI_Comm comm, sunindextype local_length, sunindextype global_length, realtype* v_data, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_Parallel(MPI_Comm comm, sunindextype local_length, sunindextype global_length, sunrealtype* v_data, SUNContext sunctx) This function creates and allocates memory for a parallel vector with user-provided data array. diff --git a/doc/shared/nvectors/NVector_Pthreads.rst b/doc/shared/nvectors/NVector_Pthreads.rst index fc78cfa323..6960e8f095 100644 --- a/doc/shared/nvectors/NVector_Pthreads.rst +++ b/doc/shared/nvectors/NVector_Pthreads.rst @@ -37,7 +37,7 @@ threaded using POSIX threads (Pthreads). struct _N_VectorContent_Pthreads { sunindextype length; booleantype own_data; - realtype *data; + sunrealtype *data; int num_threads; }; @@ -176,7 +176,7 @@ user-callable routines: (``NULL``) data array. -.. c:function:: N_Vector N_VMake_Pthreads(sunindextype vec_length, realtype* v_data, int num_threads, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_Pthreads(sunindextype vec_length, sunrealtype* v_data, int num_threads, SUNContext sunctx) This function creates and allocates memory for a Pthreads vector with user-provided data array, *v_data*. diff --git a/doc/shared/nvectors/NVector_RAJA.rst b/doc/shared/nvectors/NVector_RAJA.rst index 38990e034a..6a24972d6f 100644 --- a/doc/shared/nvectors/NVector_RAJA.rst +++ b/doc/shared/nvectors/NVector_RAJA.rst @@ -40,8 +40,8 @@ The vector content layout is as follows: { sunindextype length; booleantype own_data; - realtype* host_data; - realtype* device_data; + sunrealtype* host_data; + sunrealtype* device_data; void* priv; /* 'private' data */ }; @@ -74,12 +74,12 @@ accessor functions: -.. c:function:: realtype* N_VGetHostArrayPointer_Raja(N_Vector v) +.. c:function:: sunrealtype* N_VGetHostArrayPointer_Raja(N_Vector v) This function returns pointer to the vector data on the host. -.. c:function:: realtype* N_VGetDeviceArrayPointer_Raja(N_Vector v) +.. c:function:: sunrealtype* N_VGetDeviceArrayPointer_Raja(N_Vector v) This function returns pointer to the vector data on the device. @@ -125,13 +125,13 @@ NVECTOR_RAJA provides the following additional user-callable routines: The vector data array is allocated in managed memory. -.. c:function:: N_Vector N_VMake_Raja(sunindextype length, realtype *h_data, realtype *v_data, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_Raja(sunindextype length, sunrealtype *h_data, sunrealtype *v_data, SUNContext sunctx) This function creates an NVECTOR_RAJA with user-supplied host and device data arrays. This function does not allocate memory for data itself. -.. c:function:: N_Vector N_VMakeManaged_Raja(sunindextype length, realtype *vdata, SUNContext sunctx) +.. c:function:: N_Vector N_VMakeManaged_Raja(sunindextype length, sunrealtype *vdata, SUNContext sunctx) This function creates an NVECTOR_RAJA with a user-supplied managed memory data array. This function does not allocate memory for data itself. diff --git a/doc/shared/nvectors/NVector_SYCL.rst b/doc/shared/nvectors/NVector_SYCL.rst index aaab5035bd..c2f378cd05 100644 --- a/doc/shared/nvectors/NVector_SYCL.rst +++ b/doc/shared/nvectors/NVector_SYCL.rst @@ -96,14 +96,14 @@ constructors for creating a new NVECTOR_SYCL: operation are launched in the provided queue. -.. cpp:function:: N_Vector N_VMake_Sycl(sunindextype length, realtype *h_vdata, realtype *d_vdata, sycl::queue* Q, SUNContext sunctx) +.. cpp:function:: N_Vector N_VMake_Sycl(sunindextype length, sunrealtype *h_vdata, sunrealtype *d_vdata, sycl::queue* Q, SUNContext sunctx) This function creates an NVECTOR_SYCL with user-supplied host and device data arrays. This function does not allocate memory for data itself. All operation are launched in the provided queue. -.. cpp:function:: N_Vector N_VMakeManaged_Sycl(sunindextype length, realtype *vdata, sycl::queue *Q, SUNContext sunctx) +.. cpp:function:: N_Vector N_VMakeManaged_Sycl(sunindextype length, sunrealtype *vdata, sycl::queue *Q, SUNContext sunctx) This function creates an NVECTOR_SYCL with a user-supplied managed (shared) data array. This function does not allocate memory for data itself. All @@ -133,22 +133,22 @@ functions given below. To ensure memory coherency, a user will need to call the host and device, unless managed (shared) memory is used. -.. cpp:function:: realtype* N_VGetHostArrayPointer_Sycl(N_Vector v) +.. cpp:function:: sunrealtype* N_VGetHostArrayPointer_Sycl(N_Vector v) This function returns a pointer to the vector host data array. -.. cpp:function:: realtype* N_VGetDeviceArrayPointer_Sycl(N_Vector v) +.. cpp:function:: sunrealtype* N_VGetDeviceArrayPointer_Sycl(N_Vector v) This function returns a pointer to the vector device data array. -.. cpp:function:: void N_VSetHostArrayPointer_Sycl(realtype* h_vdata, N_Vector v) +.. cpp:function:: void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) This function sets the host array pointer in the vector ``v``. -.. cpp:function:: void N_VSetDeviceArrayPointer_Sycl(realtype* d_vdata, N_Vector v) +.. cpp:function:: void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) This function sets the device array pointer in the vector ``v``. diff --git a/doc/shared/nvectors/NVector_Serial.rst b/doc/shared/nvectors/NVector_Serial.rst index 53194e0569..024c6a6d7e 100644 --- a/doc/shared/nvectors/NVector_Serial.rst +++ b/doc/shared/nvectors/NVector_Serial.rst @@ -28,7 +28,7 @@ flag *own_data* which specifies the ownership of data. struct _N_VectorContent_Serial { sunindextype length; booleantype own_data; - realtype *data; + sunrealtype *data; }; The header file to be included when using this module is ``nvector_serial.h``. @@ -154,7 +154,7 @@ user-callable routines: (``NULL``) data array. -.. c:function:: N_Vector N_VMake_Serial(sunindextype vec_length, realtype* v_data, SUNContext sunctx) +.. c:function:: N_Vector N_VMake_Serial(sunindextype vec_length, sunrealtype* v_data, SUNContext sunctx) This function creates and allocates memory for a serial vector with user-provided data array, *v_data*. diff --git a/doc/shared/nvectors/NVector_Trilinos.rst b/doc/shared/nvectors/NVector_Trilinos.rst index 861ffcacbf..3ee406e87c 100644 --- a/doc/shared/nvectors/NVector_Trilinos.rst +++ b/doc/shared/nvectors/NVector_Trilinos.rst @@ -36,9 +36,9 @@ is not deleted for as long as the ``N_Vector`` object exists. The Tpetra vector type in the ``sundials::trilinos::nvector_tpetra::TpetraVectorInterface`` class is defined as: -.. cpp:type:: Tpetra::Vector vector_type; +.. cpp:type:: Tpetra::Vector vector_type; -The Tpetra vector will use the SUNDIALS-specified ``realtype`` as its scalar +The Tpetra vector will use the SUNDIALS-specified ``sunrealtype`` as its scalar type, ``int`` as the local ordinal type, and ``sunindextype`` as the global ordinal type. This type definition will use Tpetra's default node type. Available Kokkos node types as of the Trilinos 12.14 release are serial (single thread), OpenMP, Pthread, diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index bef4eb5aca..8a8b730d98 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -169,7 +169,7 @@ equivalencies with the parameter direction in mind. .. warning:: Currently, the Fortran 2003 interfaces are only compatible with SUNDIALS - builds where the ``realtype`` is double-precision the ``sunindextype`` size + builds where the ``sunrealtype`` is double-precision the ``sunindextype`` size is 64-bits. .. _SUNDIALS.Fortran.DataTypes.Table: @@ -186,7 +186,7 @@ equivalencies with the parameter direction in mind. +-------------------------+-------------------------------+-------------------------------------------+ |``booleantype`` | in, inout, out, return | ``integer(c_int)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``realtype`` | in, inout, out, return | ``real(c_double)`` | + |``sunrealtype`` | in, inout, out, return | ``real(c_double)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype`` | in, inout, out, return | ``integer(c_long)`` | +-------------------------+-------------------------------+-------------------------------------------+ @@ -202,15 +202,15 @@ equivalencies with the parameter direction in mind. +-------------------------+-------------------------------+-------------------------------------------+ |``long*`` | return | ``real(c_long), pointer, dimension(:)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``realtype*`` | in, inout, out | ``real(c_double), dimension(*)`` | + |``sunrealtype*`` | in, inout, out | ``real(c_double), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``realtype*`` | return | ``real(c_double), pointer, dimension(:)`` | + |``sunrealtype*`` | return | ``real(c_double), pointer, dimension(:)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype*`` | in, inout, out | ``real(c_long), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype*`` | return | ``real(c_long), pointer, dimension(:)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``realtype[]`` | in, inout, out | ``real(c_double), dimension(*)`` | + |``sunrealtype[]`` | in, inout, out | ``real(c_double), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype[]`` | in, inout, out | ``integer(c_long), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ @@ -302,7 +302,7 @@ C code: .. sourcecode:: c N_Vector x; - realtype* xdata; + sunrealtype* xdata; long int leniw, lenrw; /* create a new serial vector */ diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index 0d734904ff..0093a97951 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -157,7 +157,7 @@ set up the linear solver object to utilize an updated matrix :math:`A` retval = SUNLinSolSetup(LS, A); -.. c:function:: int SUNLinSolSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, N_Vector b, realtype tol) +.. c:function:: int SUNLinSolSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol) This *required* function solves a linear system :math:`Ax = b`. @@ -357,7 +357,7 @@ linear solve. *All routines are optional.* its = SUNLinSolNumIters(LS); -.. c:function:: realtype SUNLinSolResNorm(SUNLinearSolver LS) +.. c:function:: sunrealtype SUNLinSolResNorm(SUNLinearSolver LS) This *optional* routine should return the final residual norm from the most-recent "solve" call. @@ -412,7 +412,7 @@ linear solve. *All routines are optional.* This *optional* routine should return the storage requirements for the linear solver *LS*: - * *lrw* is a ``long int`` containing the number of realtype words + * *lrw* is a ``long int`` containing the number of sunrealtype words * *liw* is a ``long int`` containing the number of integer words. The return value is an integer flag denoting success/failure of the operation. @@ -469,7 +469,7 @@ these routines are defined in the header file Zero for a successful call, and non-zero upon failure. -.. c:type:: int (*SUNPSolveFn)(void *P_data, N_Vector r, N_Vector z, realtype tol, int lr) +.. c:type:: int (*SUNPSolveFn)(void *P_data, N_Vector r, N_Vector z, sunrealtype tol, int lr) Solves the preconditioner equation :math:`Pz = r` for the vector :math:`z`. Memory for *z* will already be allocated prior to calling this function. @@ -624,9 +624,9 @@ structure is defined as int (*initialize)(SUNLinearSolver); int (*setup)(SUNLinearSolver, SUNMatrix); int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, - N_Vector, realtype); + N_Vector, sunrealtype); int (*numiters)(SUNLinearSolver); - realtype (*resnorm)(SUNLinearSolver); + sunrealtype (*resnorm)(SUNLinearSolver); sunindextype (*lastflag)(SUNLinearSolver); int (*space)(SUNLinearSolver, long int*, long int*); N_Vector (*resid)(SUNLinearSolver); diff --git a/doc/shared/sunlinsol/SUNLinSol_KLU.rst b/doc/shared/sunlinsol/SUNLinSol_KLU.rst index 1975ac9c74..4c505492e9 100644 --- a/doc/shared/sunlinsol/SUNLinSol_KLU.rst +++ b/doc/shared/sunlinsol/SUNLinSol_KLU.rst @@ -233,7 +233,7 @@ that SUNDIALS has been configured appropriately to link with KLU (see :numref:`Installation.CMake.ExternalLibraries` for details). Additionally, this wrapper only supports double-precision calculations, and therefore cannot be compiled if SUNDIALS is -configured to have :c:type:`realtype` set to either ``extended`` or +configured to have :c:type:`sunrealtype` set to either ``extended`` or ``single`` (see :ref:`Usage.CC.DataTypes` for details). Since the KLU library supports both 32-bit and 64-bit integers, this interface will be compiled for either of the available diff --git a/doc/shared/sunlinsol/SUNLinSol_LapackBand.rst b/doc/shared/sunlinsol/SUNLinSol_LapackBand.rst index 661412b169..a253b3b669 100644 --- a/doc/shared/sunlinsol/SUNLinSol_LapackBand.rst +++ b/doc/shared/sunlinsol/SUNLinSol_LapackBand.rst @@ -108,7 +108,7 @@ information: The SUNLinSol_LapackBand module is a ``SUNLinearSolver`` wrapper for the LAPACK band matrix factorization and solve routines, ``*GBTRF`` and ``*GBTRS``, where ``*`` is either ``D`` or ``S``, depending on -whether SUNDIALS was configured to have :c:type:`realtype` set to +whether SUNDIALS was configured to have :c:type:`sunrealtype` set to ``double`` or ``single``, respectively (see :numref:`Usage.CC.DataTypes` for details). In order to use the SUNLinSol_LapackBand module it is assumed @@ -118,7 +118,7 @@ link with LAPACK (see :numref:`Installation.CMake.ExternalLibraries` for details). We note that since there do not exist 128-bit floating-point factorization and solve routines in LAPACK, this interface cannot be compiled when -using ``extended`` precision for :c:type:`realtype`. Similarly, since +using ``extended`` precision for :c:type:`sunrealtype`. Similarly, since there do not exist 64-bit integer LAPACK routines, the SUNLinSol_LapackBand module also cannot be compiled when using ``int64_t`` for the :c:type:`sunindextype`. diff --git a/doc/shared/sunlinsol/SUNLinSol_LapackDense.rst b/doc/shared/sunlinsol/SUNLinSol_LapackDense.rst index 7052fbeaee..ef152f6350 100644 --- a/doc/shared/sunlinsol/SUNLinSol_LapackDense.rst +++ b/doc/shared/sunlinsol/SUNLinSol_LapackDense.rst @@ -104,7 +104,7 @@ information: The SUNLinSol_LapackDense module is a ``SUNLinearSolver`` wrapper for the LAPACK dense matrix factorization and solve routines, ``*GETRF`` and ``*GETRS``, where ``*`` is either ``D`` or ``S``, depending on -whether SUNDIALS was configured to have :c:type:`realtype` set to +whether SUNDIALS was configured to have :c:type:`sunrealtype` set to ``double`` or ``single``, respectively (see :numref:`Usage.CC.DataTypes` for details). In order to use the SUNLinSol_LapackDense module it is assumed that LAPACK has been @@ -114,7 +114,7 @@ link with LAPACK (see :numref:`Installation.CMake.ExternalLibraries` for details). We note that since there do not exist 128-bit floating-point factorization and solve routines in LAPACK, this interface cannot be -compiled when using ``extended`` precision for :c:type:`realtype`. +compiled when using ``extended`` precision for :c:type:`sunrealtype`. Similarly, since there do not exist 64-bit integer LAPACK routines, the SUNLinSol_LapackDense module also cannot be compiled when using ``int64_t`` for the :c:type:`sunindextype`. diff --git a/doc/shared/sunlinsol/SUNLinSol_PCG.rst b/doc/shared/sunlinsol/SUNLinSol_PCG.rst index 017004e609..0a90307073 100644 --- a/doc/shared/sunlinsol/SUNLinSol_PCG.rst +++ b/doc/shared/sunlinsol/SUNLinSol_PCG.rst @@ -270,7 +270,7 @@ The SUNLinSol_PCG module defines the *content* field of a int pretype; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; void* ATData; diff --git a/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst b/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst index 160bcf0292..e9d7dfd1ac 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst @@ -214,7 +214,7 @@ The SUNLinSol_SPBCGS module defines the *content* field of a int pretype; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; void* ATData; diff --git a/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst index 3ef26b7557..64f74aeb77 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst @@ -245,7 +245,7 @@ The SUNLinSol_SPFGMR module defines the *content* field of a int max_restarts; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; void* ATData; @@ -256,10 +256,10 @@ The SUNLinSol_SPFGMR module defines the *content* field of a N_Vector s2; N_Vector *V; N_Vector *Z; - realtype **Hes; - realtype *givens; + sunrealtype **Hes; + sunrealtype *givens; N_Vector xcor; - realtype *yg; + sunrealtype *yg; N_Vector vtemp; int print_level; FILE* info_file; @@ -338,7 +338,7 @@ information: * ``xcor`` - a vector which holds the scaled, preconditioned correction to the initial guess, -* ``yg`` - a length :math:`(\text{maxl}+1)` array of ``realtype`` +* ``yg`` - a length :math:`(\text{maxl}+1)` array of ``sunrealtype`` values used to hold "short" vectors (e.g. :math:`y` and :math:`g`), * ``vtemp`` - temporary vector storage. diff --git a/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst index 184c723daa..20f440ece0 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst @@ -232,7 +232,7 @@ The SUNLinSol_SPGMR module defines the *content* field of a int max_restarts; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; void* ATData; @@ -242,10 +242,10 @@ The SUNLinSol_SPGMR module defines the *content* field of a N_Vector s1; N_Vector s2; N_Vector *V; - realtype **Hes; - realtype *givens; + sunrealtype **Hes; + sunrealtype *givens; N_Vector xcor; - realtype *yg; + sunrealtype *yg; N_Vector vtemp; int print_level; FILE* info_file; @@ -322,7 +322,7 @@ information: * ``xcor`` - a vector which holds the scaled, preconditioned correction to the initial guess, -* ``yg`` - a length :math:`(\text{maxl}+1)` array of ``realtype`` +* ``yg`` - a length :math:`(\text{maxl}+1)` array of ``sunrealtype`` values used to hold "short" vectors (e.g. :math:`y` and :math:`g`), * ``vtemp`` - temporary vector storage. diff --git a/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst index 83eea40cc2..898325a4cd 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst @@ -216,7 +216,7 @@ The SUNLinSol_SPTFQMR module defines the *content* field of a int pretype; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; void* ATData; diff --git a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst index aa5c86e2e4..20f333c92b 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst @@ -81,11 +81,11 @@ The module SUNLinSol_SuperLUDIST provides the following user-callable routines: is modified in the setup and solve routines. -.. c:function:: realtype SUNLinSol_SuperLUDIST_GetBerr(SUNLinearSolver LS) +.. c:function:: sunrealtype SUNLinSol_SuperLUDIST_GetBerr(SUNLinearSolver LS) This function returns the componentwise relative backward error of the computed solution. It takes one argument, the ``SUNLinearSolver`` object. - The return type is ``realtype``. + The return type is ``sunrealtype``. .. c:function:: gridinfo_t* SUNLinSol_SuperLUDIST_GetGridinfo(SUNLinearSolver LS) @@ -143,7 +143,7 @@ The SUNLinSol_SuperLUDIST module defines the *content* field of a struct _SUNLinearSolverContent_SuperLUDIST { booleantype first_factorize; int last_flag; - realtype berr; + sunrealtype berr; gridinfo_t *grid; xLUstruct_t *lu; superlu_dist_options_t *options; diff --git a/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst b/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst index e313e94e4e..ebc6c07a1f 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst @@ -133,7 +133,7 @@ The SUNLinSol_SuperLUMT module defines the *content* field of a sunindextype *perm_r, *perm_c; sunindextype N; int num_threads; - realtype diag_pivot_thresh; + sunrealtype diag_pivot_thresh; int ordering; superlumt_options_t *options; }; @@ -177,7 +177,7 @@ appropriately to link with SuperLU_MT (see :numref:`Installation.CMake.ExternalLibraries` for details). Additionally, this wrapper only supports single- and double-precision calculations, and therefore cannot be compiled if -SUNDIALS is configured to have :c:type:`realtype` set to ``extended`` +SUNDIALS is configured to have :c:type:`sunrealtype` set to ``extended`` (see :numref:`Usage.CC.DataTypes` for details). Moreover, since the SuperLU_MT library may be installed to support either 32-bit or 64-bit integers, it is assumed that the SuperLU_MT library is diff --git a/doc/shared/sunmatrix/SUNMatrix_Band.rst b/doc/shared/sunmatrix/SUNMatrix_Band.rst index 1f428cf8c3..f9503cbd2f 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Band.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Band.rst @@ -29,9 +29,9 @@ defines the *content* field of ``SUNMatrix`` to be the following structure: sunindextype ml; sunindextype smu; sunindextype ldim; - realtype *data; + sunrealtype *data; sunindextype ldata; - realtype **cols; + sunrealtype **cols; }; A diagram of the underlying data representation in a banded matrix is @@ -57,7 +57,7 @@ complete description of the parts of this *content* field is given below: * ``ldim`` - leading dimension (:math:`\text{ldim} \ge smu + ml + 1`) -* ``data`` - pointer to a contiguous block of ``realtype`` variables. +* ``data`` - pointer to a contiguous block of ``sunrealtype`` variables. The elements of the banded matrix are stored columnwise (i.e. columns are stored one on top of the other in memory). Only elements within the specified half-bandwidths are stored. ``data`` @@ -251,7 +251,7 @@ the *banded* version. The assignment ``col_j = SM_COLUMN_B(A,j)`` sets ``col_j`` to be a pointer to the diagonal element of the j-th column of the :math:`N \times N` band matrix ``A``, :math:`0 \le j \le N-1`. - The type of the expression ``SM_COLUMN_B(A,j)`` is ``realtype *``. + The type of the expression ``SM_COLUMN_B(A,j)`` is ``sunrealtype *``. The pointer returned by the call ``SM_COLUMN_B(A,j)`` can be treated as an array which is indexed from ``-mu`` to ``ml``. @@ -381,17 +381,17 @@ following additional user-callable routines: This function returns the length of the data array for the banded ``SUNMatrix``. -.. c:function:: realtype* SUNBandMatrix_Data(SUNMatrix A) +.. c:function:: sunrealtype* SUNBandMatrix_Data(SUNMatrix A) This function returns a pointer to the data array for the banded ``SUNMatrix``. -.. c:function:: realtype** SUNBandMatrix_Cols(SUNMatrix A) +.. c:function:: sunrealtype** SUNBandMatrix_Cols(SUNMatrix A) This function returns a pointer to the cols array for the band ``SUNMatrix``. -.. c:function:: realtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j) +.. c:function:: sunrealtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j) This function returns a pointer to the diagonal entry of the j-th column of the banded ``SUNMatrix``. The resulting pointer should diff --git a/doc/shared/sunmatrix/SUNMatrix_Dense.rst b/doc/shared/sunmatrix/SUNMatrix_Dense.rst index daec69d2ba..2639a10552 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Dense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Dense.rst @@ -25,9 +25,9 @@ defines the *content* field of ``SUNMatrix`` to be the following structure: struct _SUNMatrixContent_Dense { sunindextype M; sunindextype N; - realtype *data; + sunrealtype *data; sunindextype ldata; - realtype **cols; + sunrealtype **cols; }; These entries of the *content* field contain the following information: @@ -36,7 +36,7 @@ These entries of the *content* field contain the following information: * ``N`` - number of columns -* ``data`` - pointer to a contiguous block of ``realtype`` variables. +* ``data`` - pointer to a contiguous block of ``sunrealtype`` variables. The elements of the dense matrix are stored columnwise, i.e. the :math:`(i,j)` element of a dense ``SUNMatrix`` object (with :math:`0 \le i < M` and :math:`0 \le j < N`) may be accessed @@ -169,7 +169,7 @@ these macros are for *SUNMatrix* implementations, and the suffix The assignment ``col_j = SM_COLUMN_D(A,j)`` sets ``col_j`` to be a pointer to the first entry of the ``j``-th column of the :math:`M \times N` dense matrix ``A`` (with :math:`0 \le j < N`). The type of the - expression ``SM_COLUMN_D(A,j)`` is ``realtype *``. The pointer + expression ``SM_COLUMN_D(A,j)`` is ``sunrealtype *``. The pointer returned by the call ``SM_COLUMN_D(A,j)`` can be treated as an array which is indexed from 0 to ``M-1``. @@ -235,17 +235,17 @@ following additional user-callable routines: This function returns the length of the data array for the dense ``SUNMatrix``. -.. c:function:: realtype* SUNDenseMatrix_Data(SUNMatrix A) +.. c:function:: sunrealtype* SUNDenseMatrix_Data(SUNMatrix A) This function returns a pointer to the data array for the dense ``SUNMatrix``. -.. c:function:: realtype** SUNDenseMatrix_Cols(SUNMatrix A) +.. c:function:: sunrealtype** SUNDenseMatrix_Cols(SUNMatrix A) This function returns a pointer to the cols array for the dense ``SUNMatrix``. -.. c:function:: realtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j) +.. c:function:: sunrealtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j) This function returns a pointer to the first entry of the jth column of the dense ``SUNMatrix``. The resulting pointer should diff --git a/doc/shared/sunmatrix/SUNMatrix_Description.rst b/doc/shared/sunmatrix/SUNMatrix_Description.rst index 1da83aea02..1febfd7124 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Description.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Description.rst @@ -59,8 +59,8 @@ defined as void (*destroy)(SUNMatrix); int (*zero)(SUNMatrix); int (*copy)(SUNMatrix, SUNMatrix); - int (*scaleadd)(realtype, SUNMatrix, SUNMatrix); - int (*scaleaddi)(realtype, SUNMatrix); + int (*scaleadd)(sunrealtype, SUNMatrix, SUNMatrix); + int (*scaleaddi)(sunrealtype, SUNMatrix); int (*matvecsetup)(SUNMatrix); int (*matvec)(SUNMatrix, N_Vector, N_Vector); int (*space)(SUNMatrix, long int*, long int*); diff --git a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst index 64dba58996..8d9dcbaae0 100644 --- a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst @@ -189,7 +189,7 @@ implementation specific functions: ``SUNMATRIX_ILL_INPUT``. -.. c:function:: realtype* SUNMatrix_MagmaDense_Data(SUNMatrix A) +.. c:function:: sunrealtype* SUNMatrix_MagmaDense_Data(SUNMatrix A) This function returns the ``SUNMatrix`` data array. @@ -200,7 +200,7 @@ implementation specific functions: If successful, the ``SUNMatrix`` data array otherwise ``NULL``. -.. c:function:: realtype** SUNMatrix_MagmaDense_BlockData(SUNMatrix A) +.. c:function:: sunrealtype** SUNMatrix_MagmaDense_BlockData(SUNMatrix A) This function returns an array of pointers that point to the start of the data array for each block in the ``SUNMatrix``. @@ -213,7 +213,7 @@ implementation specific functions: blocks otherwise ``NULL``. -.. c:function:: realtype* SUNMatrix_MagmaDense_Block(SUNMatrix A, sunindextype k) +.. c:function:: sunrealtype* SUNMatrix_MagmaDense_Block(SUNMatrix A, sunindextype k) This function returns a pointer to the data array for block *k* in the ``SUNMatrix``. @@ -232,7 +232,7 @@ implementation specific functions: less than *nblocks*. -.. c:function:: realtype* SUNMatrix_MagmaDense_Column(SUNMatrix A, sunindextype j) +.. c:function:: sunrealtype* SUNMatrix_MagmaDense_Column(SUNMatrix A, sunindextype j) This function returns a pointer to the data array for column *j* in the ``SUNMatrix``. @@ -251,7 +251,7 @@ implementation specific functions: less than :math:`nblocks * N_{\text{block}}`. -.. c:function:: realtype* SUNMatrix_MagmaDense_BlockColumn(SUNMatrix A, sunindextype k, sunindextype j) +.. c:function:: sunrealtype* SUNMatrix_MagmaDense_BlockColumn(SUNMatrix A, sunindextype k, sunindextype j) This function returns a pointer to the data array for column *j* of block *k* in the ``SUNMatrix``. @@ -273,7 +273,7 @@ implementation specific functions: -.. c:function:: int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix A, realtype* h_data) +.. c:function:: int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data) This function copies the matrix data to the GPU device from the provided host array. @@ -289,7 +289,7 @@ implementation specific functions: * ``SUNMAT_MEM_FAIL`` -- if the copy fails. -.. c:function:: int SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix A, realtype* h_data) +.. c:function:: int SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data) This function copies the matrix data from the GPU device to the provided host array. diff --git a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst index 4a0fe1a53e..b900f7a62d 100644 --- a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst @@ -199,7 +199,7 @@ Access Matrix Data ``SUNMATRIX_ILL_INPUT``. -.. c:function:: realtype* SUNMatrix_OneMklDense_Data(SUNMatrix A) +.. c:function:: sunrealtype* SUNMatrix_OneMklDense_Data(SUNMatrix A) This function returns the ``SUNMatrix`` data array. @@ -210,7 +210,7 @@ Access Matrix Data If successful, the ``SUNMatrix`` data array otherwise ``NULL``. -.. c:function:: realtype* SUNMatrix_OneMklDense_Column(SUNMatrix A, sunindextype j) +.. c:function:: sunrealtype* SUNMatrix_OneMklDense_Column(SUNMatrix A, sunindextype j) This function returns a pointer to the data array for column *j* in the ``SUNMatrix``. @@ -246,7 +246,7 @@ Access Matrix Block Data otherwise ``SUNMATRIX_ILL_INPUT``. -.. c:function:: realtype** SUNMatrix_OneMklDense_BlockData(SUNMatrix A) +.. c:function:: sunrealtype** SUNMatrix_OneMklDense_BlockData(SUNMatrix A) This function returns an array of pointers that point to the start of the data array for each block in the ``SUNMatrix``. @@ -259,7 +259,7 @@ Access Matrix Block Data blocks otherwise ``NULL``. -.. c:function:: realtype* SUNMatrix_OneMklDense_Block(SUNMatrix A, sunindextype k) +.. c:function:: sunrealtype* SUNMatrix_OneMklDense_Block(SUNMatrix A, sunindextype k) This function returns a pointer to the data array for block *k* in the ``SUNMatrix``. @@ -278,7 +278,7 @@ Access Matrix Block Data less than *nblocks*. -.. c:function:: realtype* SUNMatrix_OneMklDense_BlockColumn(SUNMatrix A, sunindextype k, sunindextype j) +.. c:function:: sunrealtype* SUNMatrix_OneMklDense_BlockColumn(SUNMatrix A, sunindextype k, sunindextype j) This function returns a pointer to the data array for column *j* of block *k* in the ``SUNMatrix``. @@ -303,7 +303,7 @@ Copy Data ^^^^^^^^^ -.. c:function:: int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, realtype* h_data) +.. c:function:: int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data) This function copies the matrix data to the GPU device from the provided host array. @@ -319,7 +319,7 @@ Copy Data * ``SUNMAT_MEM_FAIL`` -- if the copy fails. -.. c:function:: int SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, realtype* h_data) +.. c:function:: int SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data) This function copies the matrix data from the GPU device to the provided host array. diff --git a/doc/shared/sunmatrix/SUNMatrix_Operations.rst b/doc/shared/sunmatrix/SUNMatrix_Operations.rst index 7834f3f5a9..7f6c51c0d2 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Operations.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Operations.rst @@ -65,7 +65,7 @@ below. .. c:function:: int SUNMatSpace(SUNMatrix A, long int *lrw, long int *liw) Returns the storage requirements for the matrix *A*. *lrw* - contains the number of realtype words and *liw* contains the number + contains the number of sunrealtype words and *liw* contains the number of integer words. The return value denotes success/failure of the operation. @@ -111,7 +111,7 @@ below. retval = SUNMatCopy(A,B); -.. c:function:: int SUNMatScaleAdd(realtype c, SUNMatrix A, SUNMatrix B) +.. c:function:: int SUNMatScaleAdd(sunrealtype c, SUNMatrix A, SUNMatrix B) Performs the operation *A \gets cA + B*. The return value is an integer flag denoting success/failure of the operation: @@ -126,7 +126,7 @@ below. retval = SUNMatScaleAdd(c, A, B); -.. c:function:: int SUNMatScaleAddI(realtype c, SUNMatrix A) +.. c:function:: int SUNMatScaleAddI(sunrealtype c, SUNMatrix A) Performs the operation *A \gets cA + I*. The return value is an integer flag denoting success/failure of the operation: diff --git a/doc/shared/sunmatrix/SUNMatrix_Sparse.rst b/doc/shared/sunmatrix/SUNMatrix_Sparse.rst index e60d6e8431..c2458fa33b 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Sparse.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Sparse.rst @@ -30,7 +30,7 @@ structure: sunindextype N; sunindextype NNZ; sunindextype NP; - realtype *data; + sunrealtype *data; int sparsetype; sunindextype *indexvals; sunindextype *indexptrs; @@ -58,7 +58,7 @@ complete description of the parts of this *content* field is given below: ``NP=M``. This value is set automatically at construction based the input choice for ``sparsetype``. -* ``data`` - pointer to a contiguous block of ``realtype`` +* ``data`` - pointer to a contiguous block of ``sunrealtype`` variables (of length ``NNZ``), containing the values of the nonzero entries in the matrix @@ -337,7 +337,7 @@ following additional user-callable routines: -.. c:function:: SUNMatrix SUNSparseFromDenseMatrix(SUNMatrix A, realtype droptol, int sparsetype) +.. c:function:: SUNMatrix SUNSparseFromDenseMatrix(SUNMatrix A, sunrealtype droptol, int sparsetype) This constructor function creates a new sparse matrix from an existing SUNMATRIX_DENSE object by copying all values with @@ -356,7 +356,7 @@ following additional user-callable routines: -.. c:function:: SUNMatrix SUNSparseFromBandMatrix(SUNMatrix A, realtype droptol, int sparsetype) +.. c:function:: SUNMatrix SUNSparseFromBandMatrix(SUNMatrix A, sunrealtype droptol, int sparsetype) This constructor function creates a new sparse matrix from an existing SUNMATRIX_BAND object by copying all values with @@ -422,7 +422,7 @@ following additional user-callable routines: or ``CSC_MAT``) for the sparse ``SUNMatrix``. -.. c:function:: realtype* SUNSparseMatrix_Data(SUNMatrix A) +.. c:function:: sunrealtype* SUNSparseMatrix_Data(SUNMatrix A) This function returns a pointer to the data array for the sparse ``SUNMatrix``. diff --git a/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst b/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst index aa63289dd5..071cfaf83a 100644 --- a/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst +++ b/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst @@ -110,7 +110,7 @@ functions: ``blockrows == blockcols``. -.. c:function:: SUNMatrix SUNMatrix_cuSparse_MakeCSR(cusparseMatDescr_t mat_descr, int M, int N, int NNZ, int *rowptrs , int *colind , realtype *data, cusparseHandle_t cusp, SUNContext sunctx) +.. c:function:: SUNMatrix SUNMatrix_cuSparse_MakeCSR(cusparseMatDescr_t mat_descr, int M, int N, int NNZ, int *rowptrs , int *colind , sunrealtype *data, cusparseHandle_t cusp, SUNContext sunctx) This constructor function creates a SUNMATRIX_CUSPARSE ``SUNMatrix`` object from user provided pointers. Its arguments are a ``cusparseMatDescr_t`` @@ -141,7 +141,7 @@ functions: or ``SUNMAT_CUSPARSE_BCSR``) for the sparse ``SUNMatrix``. -.. c:function:: realtype* SUNMatrix_cuSparse_Data(SUNMatrix A) +.. c:function:: sunrealtype* SUNMatrix_cuSparse_Data(SUNMatrix A) This function returns a pointer to the data array for the sparse ``SUNMatrix``. @@ -185,7 +185,7 @@ functions: matrix block. -.. c:function:: realtype* SUNMatrix_cuSparse_BlockData(SUNMatrix A, int blockidx) +.. c:function:: sunrealtype* SUNMatrix_cuSparse_BlockData(SUNMatrix A, int blockidx) This function returns a pointer to the location in the ``data`` array where the data for the block, ``blockidx``, begins. Thus, ``blockidx`` @@ -199,7 +199,7 @@ functions: the matrix. -.. c:function:: int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix A, realtype* h_data, int* h_idxptrs, int* h_idxvals) +.. c:function:: int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix A, sunrealtype* h_data, int* h_idxptrs, int* h_idxvals) This functions copies the matrix information to the GPU device from the provided host arrays. A user may provide ``NULL`` for any of ``h_data``, ``h_idxptrs``, or @@ -208,13 +208,13 @@ functions: The function returns ``SUNMAT_SUCCESS`` if the copy operation(s) were successful, or a nonzero error code otherwise. -.. c:function:: int SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix A, realtype* h_data, int* h_idxptrs, int* h_idxvals) +.. c:function:: int SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix A, sunrealtype* h_data, int* h_idxptrs, int* h_idxvals) This functions copies the matrix information from the GPU device to the provided host arrays. A user may provide ``NULL`` for any of ``h_data``, ``h_idxptrs``, or ``h_idxvals`` to avoid copying that information. Otherwise: - * The ``h_data`` array must be at least ``SUNMatrix_cuSparse_NNZ(A)*sizeof(realtype)`` + * The ``h_data`` array must be at least ``SUNMatrix_cuSparse_NNZ(A)*sizeof(sunrealtype)`` bytes. * The ``h_idxptrs`` array must be at least diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index c89db9b7e7..14bc52aee8 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -99,7 +99,7 @@ initialization (:c:func:`SUNNonlinSolInitialization`), setup require setup may set this operation to ``NULL``. -.. c:function:: int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, realtype tol, booleantype callLSetup, void *mem) +.. c:function:: int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, booleantype callLSetup, void *mem) This *required* function solves the nonlinear system :math:`F(y)=0` or :math:`G(y)=y`. @@ -439,7 +439,7 @@ module have types defined in the header file solution). -.. c:type:: int (*SUNNonlinSolConvTestFn)(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, realtype tol, N_Vector ewt, void* ctest_data) +.. c:type:: int (*SUNNonlinSolConvTestFn)(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ctest_data) These functions are SUNDIALS integrator-specific convergence tests for nonlinear solvers and are typically supplied by each SUNDIALS integrator, @@ -547,7 +547,7 @@ structure is defined as int (*initialize)(SUNNonlinearSolver); int (*setup)(SUNNonlinearSolver, N_Vector, void*); int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, - N_Vector, realtype, booleantype, void*); + N_Vector, sunrealtype, booleantype, void*); int (*free)(SUNNonlinearSolver); int (*setsysfn)(SUNNonlinearSolver, SUNNonlinSolSysFn); int (*setlsetupfn)(SUNNonlinearSolver, SUNNonlinSolLSetupFn); @@ -575,7 +575,7 @@ system and returns a flag denoting a successful or failed solve: int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem) { return((int) NLS->ops->solve(NLS, y0, y, w, tol, callLSetup, mem)); diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst index 2c4f924323..b275eac221 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst @@ -172,7 +172,7 @@ user-callable functions. calls to *SysFn*. -.. c:function:: int SUNNonlinSolSetDamping_FixedPoint(SUNNonlinearSolver NLS, realtype beta) +.. c:function:: int SUNNonlinSolSetDamping_FixedPoint(SUNNonlinearSolver NLS, sunrealtype beta) This sets the damping parameter :math:`\beta` to use with Anderson acceleration. By default damping is disabled i.e., :math:`\beta = 1.0`. @@ -271,11 +271,11 @@ following structure. int m; int *imap; - realtype *R; + sunrealtype *R; booleantype damping - realtype beta - realtype *gamma; - realtype *cvals; + sunrealtype beta + sunrealtype *gamma; + sunrealtype *cvals; N_Vector *df; N_Vector *dg; N_Vector *q; diff --git a/doc/sundials_developers/source/benchmarks/advection_reaction.rst b/doc/sundials_developers/source/benchmarks/advection_reaction.rst index c67b26d699..a5c4ce846d 100644 --- a/doc/sundials_developers/source/benchmarks/advection_reaction.rst +++ b/doc/sundials_developers/source/benchmarks/advection_reaction.rst @@ -105,17 +105,17 @@ listed in :numref:`Table.3D_advection_reaction_options`. | ``--npxyz `` | Number of MPI tasks in each | 0 0 0 | | | direction (0 forces MPI to decide) | | +-------------------------------+------------------------------------+---------------+ - | ``--xmax `` | Maximum value of :math:`x`, | 1.0 | + | ``--xmax `` | Maximum value of :math:`x`, | 1.0 | | | :math:`y`, and :math:`z` in | | | | :math:`\textbf{x}_{\text{max}}` | | +-------------------------------+------------------------------------+---------------+ - | ``--A `` | Constant concentration of species | 1.0 | + | ``--A `` | Constant concentration of species | 1.0 | | | :math:`A` | | +-------------------------------+------------------------------------+---------------+ - | ``--B `` | Constant concentration of species | 3.5 | + | ``--B `` | Constant concentration of species | 3.5 | | | :math:`B` | | +-------------------------------+------------------------------------+---------------+ - | ``--c `` | Advection speed :math:`c` | 0.01 | + | ``--c `` | Advection speed :math:`c` | 0.01 | +-------------------------------+------------------------------------+---------------+ | ``--order `` | Integration method order | 3 | +-------------------------------+------------------------------------+---------------+ @@ -132,11 +132,11 @@ listed in :numref:`Table.3D_advection_reaction_options`. +-------------------------------+------------------------------------+---------------+ | ``--fused`` | Enabled fused operations | Off | +-------------------------------+------------------------------------+---------------+ - | ``--tf `` | Final integration time :math:`t_f` | 10.0 | + | ``--tf `` | Final integration time :math:`t_f` | 10.0 | +-------------------------------+------------------------------------+---------------+ - | ``--rtol `` | Relative tolerance | 1.0e-6 | + | ``--rtol `` | Relative tolerance | 1.0e-6 | +-------------------------------+------------------------------------+---------------+ - | ``--atol `` | Absolute tolerance | 1.0e-9 | + | ``--atol `` | Absolute tolerance | 1.0e-9 | +-------------------------------+------------------------------------+---------------+ diff --git a/doc/sundials_developers/source/benchmarks/diffusion.rst b/doc/sundials_developers/source/benchmarks/diffusion.rst index 5c35ac4ec2..301cf8209e 100644 --- a/doc/sundials_developers/source/benchmarks/diffusion.rst +++ b/doc/sundials_developers/source/benchmarks/diffusion.rst @@ -109,19 +109,19 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. | ``--ny `` | Number of mesh points in the | 32 | | | y-direction | | +-------------------------------+--------------------------------------+---------------+ - | ``--xu `` | The domain upper bound in the | 1.0 | + | ``--xu `` | The domain upper bound in the | 1.0 | | | x-direction (:math:`x_\text{max}`) | | +-------------------------------+--------------------------------------+---------------+ - | ``--yu `` | The domain upper bound in the | 1.0 | + | ``--yu `` | The domain upper bound in the | 1.0 | | | y-direction :math:`y_\text{max}` | | +-------------------------------+--------------------------------------+---------------+ - | ``--kx `` | Diffusion coefficient in the | 1.0 | + | ``--kx `` | Diffusion coefficient in the | 1.0 | | | x-direction :math:`k_x` | | +-------------------------------+--------------------------------------+---------------+ - | ``--ky `` | Diffusion coefficient in the | 1.0 | + | ``--ky `` | Diffusion coefficient in the | 1.0 | | | y-direction :math:`k_y` | | +-------------------------------+--------------------------------------+---------------+ - | ``--tf `` | The final time :math:`t_f` | 1.0 | + | ``--tf `` | The final time :math:`t_f` | 1.0 | +-------------------------------+--------------------------------------+---------------+ | ``--noforcing`` | Disable the forcing term | Enabled | +-------------------------------+--------------------------------------+---------------+ @@ -135,9 +135,9 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. +-------------------------------+--------------------------------------+---------------+ | Common Integrator and Solver Options | +-------------------------------+--------------------------------------+---------------+ - | ``--rtol `` | Relative tolerance | 1e-5 | + | ``--rtol `` | Relative tolerance | 1e-5 | +-------------------------------+--------------------------------------+---------------+ - | ``--atol `` | Absolute tolerance | 1e-10 | + | ``--atol `` | Absolute tolerance | 1e-10 | +-------------------------------+--------------------------------------+---------------+ | ``--maxsteps `` | Max number of steps between outputs | 0 | | | (0 uses the integrator default) | | @@ -153,7 +153,7 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. +-------------------------------+--------------------------------------+---------------+ | ``--liniters `` | Number of linear iterations | 20 | +-------------------------------+--------------------------------------+---------------+ - | ``--epslin `` | Linear solve tolerance factor | 0 | + | ``--epslin `` | Linear solve tolerance factor | 0 | | | (0 uses the integrator default) | | +-------------------------------+--------------------------------------+---------------+ | ``--msbp `` | The linear solver setup frequency | 0 | diff --git a/doc/sundials_developers/source/testing/Local.rst b/doc/sundials_developers/source/testing/Local.rst index d3a98b188a..68a49d2d9d 100644 --- a/doc/sundials_developers/source/testing/Local.rst +++ b/doc/sundials_developers/source/testing/Local.rst @@ -33,7 +33,7 @@ The ``exec`` command can then be used to execute the test script: .. code-block:: shell - docker exec -w /sundials/test sundialsci-int32-double-latest ./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --realtype double --indexsize 32 + docker exec -w /sundials/test sundialsci-int32-double-latest ./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --sunrealtype double --indexsize 32 Alternatively, you can drop into a bash shell inside the container to run specific examples: diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 15fac77098..1b04cfd410 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -85,7 +85,7 @@ #define NSPECIES 2 -#define WIDTH (10 + numeric_limits::digits10) +#define WIDTH (10 + numeric_limits::digits10) // Macro to access each species at an (x,y) location in a 1D array #define UIDX(x,y,nx) (NSPECIES * ((nx) * (y) + (x))) @@ -112,20 +112,20 @@ class Timer end_ = MPI_Wtime(); total_ += (end_-start_); } - realtype total() const + sunrealtype total() const { return total_; } - realtype max(MPI_Comm comm) + sunrealtype max(MPI_Comm comm) { double maxtime = 0.0; MPI_Reduce(&total_, &maxtime, 1, MPI_DOUBLE, MPI_MAX, 0, comm); return maxtime; } private: - realtype total_; - realtype start_; - realtype end_; + sunrealtype total_; + sunrealtype start_; + sunrealtype end_; }; @@ -141,23 +141,23 @@ struct UserData // ------------------ // Diffusion coefficients for u and v - realtype Dux = RCONST(1.0e-3); - realtype Duy = RCONST(1.0e-3); - realtype Dvx = RCONST(1.0e-3); - realtype Dvy = RCONST(1.0e-3); + sunrealtype Dux = RCONST(1.0e-3); + sunrealtype Duy = RCONST(1.0e-3); + sunrealtype Dvx = RCONST(1.0e-3); + sunrealtype Dvy = RCONST(1.0e-3); // Feed and reaction rates - realtype A = RCONST(1.0); - realtype B = RCONST(3.0); + sunrealtype A = RCONST(1.0); + sunrealtype B = RCONST(3.0); // Final simulation time - realtype tf = RCONST(10.0); + sunrealtype tf = RCONST(10.0); // Domain boundaries in x and y directions - realtype xl = RCONST(-0.5); - realtype xu = RCONST(0.5); - realtype yl = RCONST(-0.5); - realtype yu = RCONST(0.5); + sunrealtype xl = RCONST(-0.5); + sunrealtype xu = RCONST(0.5); + sunrealtype yl = RCONST(-0.5); + sunrealtype yu = RCONST(0.5); // Enable/disable RHS terms bool diffusion = true; @@ -174,8 +174,8 @@ struct UserData sunindextype ny_loc = 0; // Mesh spacing in the x and y directions - realtype dx = (xu - xl) / nx; - realtype dy = (yu - yl) / ny; + sunrealtype dx = (xu - xl) / nx; + sunrealtype dy = (yu - yl) / ny; // Global and local number of equations sunindextype neq = NSPECIES * nx * ny; @@ -220,18 +220,18 @@ struct UserData int ybufcount = 0; // Receive and send buffers - realtype *Wrecv = NULL; - realtype *Erecv = NULL; - realtype *Srecv = NULL; - realtype *Nrecv = NULL; + sunrealtype *Wrecv = NULL; + sunrealtype *Erecv = NULL; + sunrealtype *Srecv = NULL; + sunrealtype *Nrecv = NULL; - realtype *Wsend = NULL; - realtype *Esend = NULL; - realtype *Ssend = NULL; - realtype *Nsend = NULL; + sunrealtype *Wsend = NULL; + sunrealtype *Esend = NULL; + sunrealtype *Ssend = NULL; + sunrealtype *Nsend = NULL; - realtype *SWsend = NULL; - realtype *NErecv = NULL; + sunrealtype *SWsend = NULL; + sunrealtype *NErecv = NULL; // Recieve and send requests MPI_Request reqRW, reqRE, reqRS, reqRN; @@ -254,11 +254,11 @@ struct UserData // ------------- // Relative and absolute tolerances - realtype rtol_imex = RCONST(1.e-4); - realtype atol_imex = RCONST(1.e-8); + sunrealtype rtol_imex = RCONST(1.e-4); + sunrealtype atol_imex = RCONST(1.e-8); // Step size selection (ZERO = adaptive steps) - realtype h_imex = ZERO; + sunrealtype h_imex = ZERO; // Method order int order_imex = 3; @@ -268,14 +268,14 @@ struct UserData // ------------ // Relative and absolute tolerances (slow and fast) - realtype rtol_slow = RCONST(1.e-4); - realtype atol_slow = RCONST(1.e-8); - realtype rtol_fast = RCONST(1.e-5); - realtype atol_fast = RCONST(1.e-9); + sunrealtype rtol_slow = RCONST(1.e-4); + sunrealtype atol_slow = RCONST(1.e-8); + sunrealtype rtol_fast = RCONST(1.e-5); + sunrealtype atol_fast = RCONST(1.e-9); // Fixed step size (slow and fast) - realtype h_slow = RCONST(-1.0); // use multiple of CFL - realtype h_fast = ZERO; // use adaptive stepping + sunrealtype h_slow = RCONST(-1.0); // use multiple of CFL + sunrealtype h_fast = ZERO; // use adaptive stepping // Inner ARKODE method order int order_fast = 3; @@ -309,7 +309,7 @@ struct UserData bool lsinfo = false; // output residual history int liniters = 5; // number of linear iterations int msbp = 0; // preconditioner setup frequency (0 = default) - realtype epslin = ZERO; // linear solver tolerance factor (ZERO = default) + sunrealtype epslin = ZERO; // linear solver tolerance factor (ZERO = default) N_Vector diag = NULL; // inverse of Jacobian diagonal // --------------- @@ -360,12 +360,12 @@ struct InnerStepperContent }; static int CVodeInnerStepper_Evolve(MRIStepInnerStepper stepper, - realtype t0, realtype tout, N_Vector y); + sunrealtype t0, sunrealtype tout, N_Vector y); static int CVodeInnerStepper_FullRhs(MRIStepInnerStepper stepper, - realtype t, N_Vector y, N_Vector f, + sunrealtype t, N_Vector y, N_Vector f, int mode); static int CVodeInnerStepper_Reset(MRIStepInnerStepper stepper, - realtype tR, N_Vector yR); + sunrealtype tR, N_Vector yR); // ----------------------------------------------------------------------------- @@ -374,12 +374,12 @@ static int CVodeInnerStepper_Reset(MRIStepInnerStepper stepper, // ODE right hand side functions -static int diffusion(realtype t, N_Vector u, N_Vector f, void *user_data); -static int reaction(realtype t, N_Vector u, N_Vector f, void *user_data); +static int diffusion(sunrealtype t, N_Vector u, N_Vector f, void *user_data); +static int reaction(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner solve function -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -437,7 +437,7 @@ static int PrintUserData(UserData *udata); // Output solution static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -623,9 +623,9 @@ int main(int argc, char* argv[]) } // Initial time, time between outputs, output time - realtype t = ZERO; - realtype dTout = udata.tf / udata.nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / udata.nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(&udata); @@ -862,19 +862,19 @@ static int SetupDecomp(UserData *udata) // Allocate exchange buffers if necessary udata->ybufcount = NSPECIES * udata->ny_loc; - udata->Wrecv = new realtype[udata->ybufcount]; - udata->Wsend = new realtype[udata->ybufcount]; - udata->Erecv = new realtype[udata->ybufcount]; - udata->Esend = new realtype[udata->ybufcount]; + udata->Wrecv = new sunrealtype[udata->ybufcount]; + udata->Wsend = new sunrealtype[udata->ybufcount]; + udata->Erecv = new sunrealtype[udata->ybufcount]; + udata->Esend = new sunrealtype[udata->ybufcount]; udata->xbufcount = NSPECIES * udata->nx_loc; - udata->Srecv = new realtype[udata->xbufcount]; - udata->Ssend = new realtype[udata->xbufcount]; - udata->Nrecv = new realtype[udata->xbufcount]; - udata->Nsend = new realtype[udata->xbufcount]; + udata->Srecv = new sunrealtype[udata->xbufcount]; + udata->Ssend = new sunrealtype[udata->xbufcount]; + udata->Nrecv = new sunrealtype[udata->xbufcount]; + udata->Nsend = new sunrealtype[udata->xbufcount]; - udata->SWsend = new realtype[NSPECIES]; - udata->NErecv = new realtype[NSPECIES]; + udata->SWsend = new sunrealtype[NSPECIES]; + udata->NErecv = new sunrealtype[NSPECIES]; // MPI neighborhood information int nbcoords[2]; @@ -1336,10 +1336,10 @@ static int SetupMRICVODE(SUNContext ctx, UserData *udata, N_Vector y, static int CVodeInnerStepper_Evolve(MRIStepInnerStepper stepper, - realtype t0, realtype tout, N_Vector y) + sunrealtype t0, sunrealtype tout, N_Vector y) { int flag; - realtype tret; + sunrealtype tret; void* inner_content = NULL; flag = MRIStepInnerStepper_GetContent(stepper, &inner_content); @@ -1370,7 +1370,7 @@ static int CVodeInnerStepper_Evolve(MRIStepInnerStepper stepper, static int CVodeInnerStepper_FullRhs(MRIStepInnerStepper stepper, - realtype t, N_Vector y, N_Vector f, + sunrealtype t, N_Vector y, N_Vector f, int mode) { int flag; @@ -1397,7 +1397,7 @@ static int CVodeInnerStepper_FullRhs(MRIStepInnerStepper stepper, static int CVodeInnerStepper_Reset(MRIStepInnerStepper stepper, - realtype tR, N_Vector yR) + sunrealtype tR, N_Vector yR) { int flag; void* inner_content = NULL; @@ -1454,7 +1454,7 @@ static int CVodeInnerStepper_Reset(MRIStepInnerStepper stepper, // Routine to compute the ODE diffusion RHS function -static int diffusion(realtype t, N_Vector y, N_Vector f, void *user_data) +static int diffusion(sunrealtype t, N_Vector y, N_Vector f, void *user_data) { int flag; @@ -1469,19 +1469,19 @@ static int diffusion(realtype t, N_Vector y, N_Vector f, void *user_data) if (check_flag(&flag, "StartExchange", 1)) return -1; // Constants for computing diffusion term - realtype cxu = udata->Dux / (udata->dx * udata->dx); - realtype cyu = udata->Duy / (udata->dy * udata->dy); - realtype ccu = -TWO * (cxu + cyu); + sunrealtype cxu = udata->Dux / (udata->dx * udata->dx); + sunrealtype cyu = udata->Duy / (udata->dy * udata->dy); + sunrealtype ccu = -TWO * (cxu + cyu); - realtype cxv = udata->Dvx / (udata->dx * udata->dx); - realtype cyv = udata->Dvy / (udata->dy * udata->dy); - realtype ccv = -TWO * (cxv + cyv); + sunrealtype cxv = udata->Dvx / (udata->dx * udata->dx); + sunrealtype cyv = udata->Dvy / (udata->dy * udata->dy); + sunrealtype ccv = -TWO * (cxv + cyv); // Access data arrays - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); if (check_flag((void *) ydata, "N_VGetArrayPointer", 0)) return -1; - realtype *fdata = N_VGetArrayPointer(f); + sunrealtype *fdata = N_VGetArrayPointer(f); if (check_flag((void *) fdata, "N_VGetArrayPointer", 0)) return -1; // Shortcuts to array indices (center, west, east, south, north) @@ -1523,10 +1523,10 @@ static int diffusion(realtype t, N_Vector y, N_Vector f, void *user_data) flag = EndExchange(udata); if (check_flag(&flag, "EndExchange", 1)) return -1; - realtype *Wdata = udata->Wrecv; - realtype *Edata = udata->Erecv; - realtype *Sdata = udata->Srecv; - realtype *Ndata = udata->Nrecv; + sunrealtype *Wdata = udata->Wrecv; + sunrealtype *Edata = udata->Erecv; + sunrealtype *Sdata = udata->Srecv; + sunrealtype *Ndata = udata->Nrecv; sunindextype i, j; @@ -1721,7 +1721,7 @@ static int diffusion(realtype t, N_Vector y, N_Vector f, void *user_data) // Routine to compute the ODE reaction RHS function -static int reaction(realtype t, N_Vector y, N_Vector f, void *user_data) +static int reaction(sunrealtype t, N_Vector y, N_Vector f, void *user_data) { // Access problem data UserData *udata = (UserData *) user_data; @@ -1730,10 +1730,10 @@ static int reaction(realtype t, N_Vector y, N_Vector f, void *user_data) udata->rhsR.start(); // Access data arrays - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); if (check_flag((void *) ydata, "N_VGetArrayPointer", 0)) return -1; - realtype *fdata = N_VGetArrayPointer(f); + sunrealtype *fdata = N_VGetArrayPointer(f); if (check_flag((void *) fdata, "N_VGetArrayPointer", 0)) return -1; // Shortcuts to local number of nodes @@ -1741,7 +1741,7 @@ static int reaction(realtype t, N_Vector y, N_Vector f, void *user_data) sunindextype nx_loc = udata->nx_loc; // Compute reaction term on the subdomain - realtype u, v; + sunrealtype u, v; for (sunindextype j = 0; j < ny_loc; j++) { @@ -1770,7 +1770,7 @@ static int reaction(realtype t, N_Vector y, N_Vector f, void *user_data) else if (udata->integrator == 3) { int nforcing; - realtype tshift, tscale; + sunrealtype tshift, tscale; N_Vector *forcing; // With a local inner stepper the RHS vector f is a serial vector and the @@ -1782,8 +1782,8 @@ static int reaction(realtype t, N_Vector y, N_Vector f, void *user_data) if (flag != 0) return flag; N_Vector forcing_loc; - realtype tau = (t - tshift) / tscale; - realtype taui = ONE; + sunrealtype tau = (t - tshift) / tscale; + sunrealtype taui = ONE; for (int i = 0; i < nforcing; i++) { @@ -1808,8 +1808,8 @@ static int reaction(realtype t, N_Vector y, N_Vector f, void *user_data) // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { // Access user_data structure @@ -1819,19 +1819,19 @@ static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, udata->psolve.start(); // Constants for computing diffusion - realtype cxu = udata->Dux / (udata->dx * udata->dx); - realtype cyu = udata->Duy / (udata->dy * udata->dy); - realtype ccu = -TWO * (cxu + cyu); + sunrealtype cxu = udata->Dux / (udata->dx * udata->dx); + sunrealtype cyu = udata->Duy / (udata->dy * udata->dy); + sunrealtype ccu = -TWO * (cxu + cyu); - realtype cxv = udata->Dvx / (udata->dx * udata->dx); - realtype cyv = udata->Dvy / (udata->dy * udata->dy); - realtype ccv = -TWO * (cxv + cyv); + sunrealtype cxv = udata->Dvx / (udata->dx * udata->dx); + sunrealtype cyv = udata->Dvy / (udata->dy * udata->dy); + sunrealtype ccv = -TWO * (cxv + cyv); // Access data arrays - realtype *rdata = N_VGetArrayPointer(r); + sunrealtype *rdata = N_VGetArrayPointer(r); if (check_flag((void *) rdata, "N_VGetArrayPointer", 0)) return -1; - realtype *zdata = N_VGetArrayPointer(z); + sunrealtype *zdata = N_VGetArrayPointer(z); if (check_flag((void *) zdata, "N_VGetArrayPointer", 0)) return -1; // Shortcuts to local number of nodes @@ -1839,8 +1839,8 @@ static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, sunindextype nx_loc = udata->nx_loc; // Set all entries of diag to the inverse diagonal values - realtype du = ONE / (ONE - gamma * ccu); - realtype dv = ONE / (ONE - gamma * ccv); + sunrealtype du = ONE / (ONE - gamma * ccu); + sunrealtype dv = ONE / (ONE - gamma * ccv); for (sunindextype j = 0; j < ny_loc; j++) { @@ -1913,7 +1913,7 @@ static int StartExchange(N_Vector y, UserData *udata) sunindextype nx_loc = udata->nx_loc; // Access data array - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); if (check_flag((void *) ydata, "N_VGetArrayPointer", 0)) return -1; // Send West face data to neighbor's East face @@ -2097,7 +2097,7 @@ static int ExchangeBC(N_Vector y, UserData *udata) } } - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); if (check_flag((void *) ydata, "N_VGetArrayPointer", 0)) return -1; // Send West face data @@ -2460,9 +2460,9 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata) // Compute slow step size based on CFL if not set by input if (udata->h_slow < ZERO) { - realtype cfl_u = RCONST(0.5) / ((udata->Dux / (udata->dx * udata->dx)) + + sunrealtype cfl_u = RCONST(0.5) / ((udata->Dux / (udata->dx * udata->dx)) + (udata->Duy / (udata->dy * udata->dy))); - realtype cfl_v = RCONST(0.5) / ((udata->Dvx / (udata->dx * udata->dx)) + + sunrealtype cfl_v = RCONST(0.5) / ((udata->Dvx / (udata->dx * udata->dx)) + (udata->Dvy / (udata->dy * udata->dy))); udata->h_slow = RCONST(5.0) * min(cfl_u, cfl_v); } @@ -2480,7 +2480,7 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata) // Compute the initial condition static int SetIC(N_Vector u, UserData *udata) { - realtype x, y, a, b; + sunrealtype x, y, a, b; // Shortcuts to local number of nodes sunindextype ny_loc = udata->ny_loc; @@ -2490,7 +2490,7 @@ static int SetIC(N_Vector u, UserData *udata) default_random_engine generator; normal_distribution dist(RCONST(0.0), RCONST(0.001)); - realtype *data = N_VGetArrayPointer(u); + sunrealtype *data = N_VGetArrayPointer(u); if (check_flag((void *) data, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = 0; j < ny_loc; j++) @@ -2640,7 +2640,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && udata->outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " ||u||_rms " << endl; cout << " ---------------------"; @@ -2657,7 +2657,7 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); // Add 1 to the total number of nodes in the x and y directions and to the // end indices in the x and y direction at the North and East boundary to @@ -2692,14 +2692,14 @@ static int OpenOutput(UserData *udata) // Write output -static int WriteOutput(realtype t, N_Vector y, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector y, UserData *udata) { int flag; if (udata->output > 0) { // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(y, y) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(y, y) / udata->nx / udata->ny); // Output current status if (udata->outproc) cout << setw(22) << t << setw(25) << urms << endl; @@ -2714,7 +2714,7 @@ static int WriteOutput(realtype t, N_Vector y, UserData *udata) flag = ExchangeBC(y, udata); if (check_flag(&flag, "ExchangeBC", 1)) return -1; - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); if (check_flag((void *) ydata, "N_VGetArrayPointer", 0)) return -1; udata->uout << t; @@ -2835,8 +2835,8 @@ static int OutputStatsIMEX(void *arkode_mem, UserData* udata) if (udata->diffusion) { // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; @@ -2904,8 +2904,8 @@ static int OutputStatsMRI(void *arkode_mem, MRIStepInnerStepper stepper, cout << endl; // Compute average nls iters per step and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nsts; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nsts; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; @@ -2994,8 +2994,8 @@ static int OutputStatsMRICVODE(void *arkode_mem, cout << endl; // Compute average nls iters per step and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nsts; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nsts; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 32623f530c..c73c2e8ec4 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -78,18 +78,18 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -99,8 +99,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -137,10 +137,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -149,10 +149,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -161,9 +161,9 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance - realtype hfixed; // fixed step size + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance + sunrealtype hfixed; // fixed step size int order; // ARKode method order int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs @@ -176,7 +176,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // Inverse of Jacobian diagonal for preconditioner N_Vector d; @@ -202,14 +202,14 @@ struct UserData // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -242,10 +242,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -255,7 +255,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -439,7 +439,7 @@ int main(int argc, char* argv[]) else { // Use implicit Euler (requires fixed step size) - realtype c[1], A[1], b[1]; + sunrealtype c[1], A[1], b[1]; ARKodeButcherTable B = NULL; // Create implicit Euler Butcher table @@ -494,9 +494,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata->tf / udata->nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata); @@ -551,12 +551,12 @@ int main(int argc, char* argv[]) flag = SolutionError(t, u, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } } @@ -695,23 +695,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -778,7 +778,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -808,15 +808,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -825,15 +825,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -873,10 +873,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -977,8 +977,8 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Start timer double t1 = MPI_Wtime(); @@ -987,17 +987,17 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, UserData *udata = (UserData *) user_data; // Access data array - realtype *diag = N_VGetArrayPointer(udata->d); + sunrealtype *diag = N_VGetArrayPointer(udata->d); if (check_flag((void *) diag, "N_VGetArrayPointer", 0)) return -1; // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Set all entries of d to the inverse diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE / (ONE - gamma * cc); + sunrealtype c = ONE / (ONE - gamma * cc); N_VConst(c, udata->d); // Stop timer @@ -1011,8 +1011,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { // Start timer @@ -1112,7 +1112,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -1563,11 +1563,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -1582,7 +1582,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -1603,7 +1603,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -1706,7 +1706,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); if (udata->forcing) { cout << " t "; @@ -1757,7 +1757,7 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); if (udata->forcing) { @@ -1768,7 +1768,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } } @@ -1776,10 +1776,10 @@ static int OpenOutput(UserData *udata) } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { int flag; - realtype max; + sunrealtype max; bool outproc = (udata->myid_c == 0); if (udata->output > 0) @@ -1795,7 +1795,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) } // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -1813,7 +1813,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution and error to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -1826,7 +1826,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (udata->forcing) { // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -1922,8 +1922,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index f4b27d9bf8..451ac37cca 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -80,18 +80,18 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -101,8 +101,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -139,10 +139,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -151,10 +151,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -163,9 +163,9 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance - realtype hfixed; // fixed step size + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance + sunrealtype hfixed; // fixed step size int order; // ARKode method order int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs @@ -177,7 +177,7 @@ struct UserData bool prec; // preconditioner on/off int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // hypre PFMG settings (hypre defaults) HYPRE_Int pfmg_relax; // type of relaxation: @@ -244,7 +244,7 @@ SUNMatrix_ID Hypre5ptMatrix_GetID(SUNMatrix A); SUNMatrix Hypre5ptMatrix_Clone(SUNMatrix A); void Hypre5ptMatrix_Destroy(SUNMatrix A); int Hypre5ptMatrix_Copy(SUNMatrix A, SUNMatrix B); -int Hypre5ptMatrix_ScaleAddI(realtype c, SUNMatrix A); +int Hypre5ptMatrix_ScaleAddI(sunrealtype c, SUNMatrix A); // ----------------------------------------------------------------------------- // Custom hypre linear solver definition @@ -280,7 +280,7 @@ SUNLinearSolver_Type HypreLS_GetType(SUNLinearSolver S); int HypreLS_Initialize(SUNLinearSolver S); int HypreLS_Setup(SUNLinearSolver S, SUNMatrix A); int HypreLS_Solve(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); int HypreLS_NumIters(SUNLinearSolver S); int HypreLS_Free(SUNLinearSolver S); @@ -289,10 +289,10 @@ int HypreLS_Free(SUNLinearSolver S); // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Jacobian evaluation function -static int Jac(realtype t, N_Vector u, N_Vector f, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector u, N_Vector f, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // ----------------------------------------------------------------------------- @@ -325,10 +325,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -338,7 +338,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -489,7 +489,7 @@ int main(int argc, char* argv[]) else { // Use implicit Euler (requires fixed step size) - realtype c[1], A[1], b[1]; + sunrealtype c[1], A[1], b[1]; ARKodeButcherTable B = NULL; // Create implicit Euler Butcher table @@ -544,9 +544,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata->tf / udata->nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata); @@ -601,12 +601,12 @@ int main(int argc, char* argv[]) flag = SolutionError(t, u, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } } @@ -746,23 +746,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -829,7 +829,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -859,15 +859,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -876,15 +876,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -924,10 +924,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -1028,7 +1028,7 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Jac function to compute the ODE RHS function Jacobian, (df/dy)(t,y). -static int Jac(realtype t, N_Vector y, N_Vector ydot, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector ydot, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Shortcuts to hypre matrix and grid extents, work array, etc. @@ -1077,9 +1077,9 @@ static int Jac(realtype t, N_Vector y, N_Vector ydot, SUNMatrix J, (ilower[1] <= iupper[1])) { // Jacobian values - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // -------------------------------- // Set matrix values for all nodes @@ -1422,7 +1422,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -1872,11 +1872,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -1891,7 +1891,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -1912,7 +1912,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -2018,7 +2018,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); if (udata->forcing) { cout << " t "; @@ -2069,7 +2069,7 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); if (udata->forcing) { @@ -2080,7 +2080,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } } @@ -2088,10 +2088,10 @@ static int OpenOutput(UserData *udata) } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { int flag; - realtype max; + sunrealtype max; bool outproc = (udata->myid_c == 0); if (udata->output > 0) @@ -2107,7 +2107,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) } // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -2125,7 +2125,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution and error to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -2138,7 +2138,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (udata->forcing) { // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -2231,8 +2231,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; @@ -2486,7 +2486,7 @@ int Hypre5ptMatrix_Copy(SUNMatrix A, SUNMatrix B) return(SUNMAT_SUCCESS); } -int Hypre5ptMatrix_ScaleAddI(realtype c, SUNMatrix A) +int Hypre5ptMatrix_ScaleAddI(sunrealtype c, SUNMatrix A) { int flag; @@ -2732,7 +2732,7 @@ int HypreLS_Setup(SUNLinearSolver LS, SUNMatrix A) } int HypreLS_Solve(SUNLinearSolver LS, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol) + N_Vector x, N_Vector b, sunrealtype tol) { int flag; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index b9468dfc3f..45c2063d09 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -80,18 +80,18 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -101,8 +101,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -139,10 +139,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -151,10 +151,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -163,9 +163,9 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance - realtype hfixed; // fixed step size + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance + sunrealtype hfixed; // fixed step size int order; // ARKode method order int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs @@ -179,7 +179,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // hypre objects HYPRE_StructGrid grid; @@ -234,18 +234,18 @@ struct UserData // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Jacobian-vector product function -static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, +static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -265,7 +265,7 @@ static int SetupHypre(UserData *udata); // Fill Jacobian and A = I - gamma * J static int Jac(UserData *udata); -static int ScaleAddI(UserData *udata, realtype gamma); +static int ScaleAddI(UserData *udata, sunrealtype gamma); // ----------------------------------------------------------------------------- // UserData and input functions @@ -285,10 +285,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -298,7 +298,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -492,7 +492,7 @@ int main(int argc, char* argv[]) else { // Use implicit Euler (requires fixed step size) - realtype c[1], A[1], b[1]; + sunrealtype c[1], A[1], b[1]; ARKodeButcherTable B = NULL; // Create implicit Euler Butcher table @@ -547,9 +547,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata->tf / udata->nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata); @@ -604,12 +604,12 @@ int main(int argc, char* argv[]) flag = SolutionError(t, u, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } } @@ -748,23 +748,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -831,7 +831,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -861,15 +861,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -878,15 +878,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -926,10 +926,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -1030,7 +1030,7 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Jacobian-vector product function -static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, +static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { int flag; @@ -1082,8 +1082,8 @@ static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; @@ -1171,8 +1171,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { int flag; @@ -1450,9 +1450,9 @@ static int Jac(UserData *udata) (ilower[1] <= iupper[1])) { // Jacobian values - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // -------------------------------- // Set matrix values for all nodes @@ -1718,7 +1718,7 @@ static int Jac(UserData *udata) } // Fill A = I - gamma * J matrix -static int ScaleAddI(UserData *udata, realtype gamma) +static int ScaleAddI(UserData *udata, sunrealtype gamma) { int flag; @@ -1847,7 +1847,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -2345,11 +2345,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -2364,7 +2364,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -2385,7 +2385,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -2494,7 +2494,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); if (udata->forcing) { cout << " t "; @@ -2545,7 +2545,7 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); if (udata->forcing) { @@ -2556,7 +2556,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } } @@ -2564,10 +2564,10 @@ static int OpenOutput(UserData *udata) } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { int flag; - realtype max; + sunrealtype max; bool outproc = (udata->myid_c == 0); if (udata->output > 0) @@ -2583,7 +2583,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) } // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -2601,7 +2601,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution and error to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -2614,7 +2614,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (udata->forcing) { // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -2710,8 +2710,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp index ecbd9b44c1..5cdc91c7f1 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -82,22 +82,22 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Advection coefficients in the x and y directions - realtype ax; - realtype ay; + sunrealtype ax; + sunrealtype ay; // Reactions coefficient - realtype r; + sunrealtype r; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -107,8 +107,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -145,10 +145,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -157,10 +157,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -169,18 +169,18 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance bool linear; // enable/disable linearly implicit option int order; // ARKode method order - realtype hf; // fixed step size + sunrealtype hf; // fixed step size int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs // Linear solver and preconditioner settings int liniters; // number of linear iterations - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor int prectype; // preconditioner type (NONE or LEFT) int msbp; // max number of steps between preconditioner setups @@ -240,17 +240,17 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata); // ----------------------------------------------------------------------------- // ODE right hand side functions -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); -static int fi(realtype t, N_Vector u, N_Vector f, void *user_data); -static int fe(realtype t, N_Vector u, N_Vector f, void *user_data); -static int ffeval(realtype *fval, realtype uval, realtype rval); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); +static int fi(sunrealtype t, N_Vector u, N_Vector f, void *user_data); +static int fe(sunrealtype t, N_Vector u, N_Vector f, void *user_data); +static int ffeval(sunrealtype *fval, sunrealtype uval, sunrealtype rval); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -261,7 +261,7 @@ static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, static int HyprePFMG(UserData *udata); // Fill A = I - gamma * J matrix -static int FillMatrix(UserData *udata, realtype gamma); +static int FillMatrix(UserData *udata, sunrealtype gamma); // Perform neighbor exchange static int PostRecv(UserData *udata); @@ -282,7 +282,7 @@ static int FreeUserData(UserData *udata); static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // Compute the initial condition -static int InitSolution(realtype t, N_Vector u, UserData *udata); +static int InitSolution(sunrealtype t, N_Vector u, UserData *udata); // ----------------------------------------------------------------------------- // Output and utility functions @@ -296,7 +296,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -472,9 +472,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata.tf / udata.nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / udata.nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(&udata); @@ -656,23 +656,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -738,11 +738,11 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Functions called by the integrator // ----------------------------------------------------------------------------- // f routine to compute the full ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; - realtype ftemp; + sunrealtype ftemp; // Start timer double t1 = MPI_Wtime(); @@ -755,10 +755,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny_loc = udata->ny_loc; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Open exchange receives @@ -770,18 +770,18 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "SendData", 1)) return -1; // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Constants for computing advection - realtype cxp = -SUNMAX(udata->ax, ZERO) / (udata->dx); - realtype cxm = -SUNMIN(udata->ax, ZERO) / (udata->dx); - realtype cyp = -SUNMAX(udata->ay, ZERO) / (udata->dy); - realtype cym = -SUNMIN(udata->ay, ZERO) / (udata->dy); + sunrealtype cxp = -SUNMAX(udata->ax, ZERO) / (udata->dx); + sunrealtype cxm = -SUNMIN(udata->ax, ZERO) / (udata->dx); + sunrealtype cyp = -SUNMAX(udata->ay, ZERO) / (udata->dy); + sunrealtype cym = -SUNMIN(udata->ay, ZERO) / (udata->dy); // Shortcut to reaction coefficient - realtype rval = udata->r; + sunrealtype rval = udata->r; // Initialize rhs to zero (handles boundary conditions) N_VConst(ZERO, f); @@ -808,10 +808,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries (if not at overall domain boundary) - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face if (udata->HaveNbrW) @@ -960,11 +960,11 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // fi routine to compute the implicit part of ODE RHS function fi(t,u). -static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) +static int fi(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; - realtype ftemp; + sunrealtype ftemp; // Start timer double t1 = MPI_Wtime(); @@ -977,10 +977,10 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny_loc = udata->ny_loc; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Open exchange receives @@ -992,12 +992,12 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "SendData", 1)) return -1; // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Shortcut to reaction coefficient - realtype rval = udata->r; + sunrealtype rval = udata->r; // Initialize rhs to zero (handles boundary conditions) N_VConst(ZERO, f); @@ -1020,10 +1020,10 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries (if not at overall domain boundary) - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face if (udata->HaveNbrW) @@ -1140,7 +1140,7 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) } // fe routine to compute the explicit part of ODE RHS function. -static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) +static int fe(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -1156,10 +1156,10 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny_loc = udata->ny_loc; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Open exchange receives @@ -1171,10 +1171,10 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "SendData", 1)) return -1; // Constants for computing advection - realtype cxp = -SUNMAX(udata->ax, ZERO) / (udata->dx); - realtype cxm = -SUNMIN(udata->ax, ZERO) / (udata->dx); - realtype cyp = -SUNMAX(udata->ay, ZERO) / (udata->dy); - realtype cym = -SUNMIN(udata->ay, ZERO) / (udata->dy); + sunrealtype cxp = -SUNMAX(udata->ax, ZERO) / (udata->dx); + sunrealtype cxm = -SUNMIN(udata->ax, ZERO) / (udata->dx); + sunrealtype cyp = -SUNMAX(udata->ay, ZERO) / (udata->dy); + sunrealtype cym = -SUNMIN(udata->ay, ZERO) / (udata->dy); // Initialize rhs to zero (handles boundary conditions) N_VConst(ZERO, f); @@ -1197,10 +1197,10 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries (if not at overall domain boundary) - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face if (udata->HaveNbrW) @@ -1317,15 +1317,15 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) } // ff helper function -static int ffeval(realtype *fval, realtype uval, realtype rval) { +static int ffeval(sunrealtype *fval, sunrealtype uval, sunrealtype rval) { *fval = rval * (uval - uval*uval*uval); return 0; } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; @@ -1375,8 +1375,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { int flag; @@ -1586,7 +1586,7 @@ static int HyprePFMG(UserData *udata) } // Fill A = I - gamma * J matrix -static int FillMatrix(UserData *udata, realtype gamma) +static int FillMatrix(UserData *udata, sunrealtype gamma) { // Variable shortcuts HYPRE_Int ilower[2]; @@ -1630,14 +1630,14 @@ static int FillMatrix(UserData *udata, realtype gamma) (ilower[1] <= iupper[1])) { // Jacobian values - realtype c1 = udata->kx / (udata->dx * udata->dx); - realtype c2 = udata->ky / (udata->dy * udata->dy); - realtype c3 = -TWO * (c1 + c2); + sunrealtype c1 = udata->kx / (udata->dx * udata->dx); + sunrealtype c2 = udata->ky / (udata->dy * udata->dy); + sunrealtype c3 = -TWO * (c1 + c2); // Linear system values - realtype cx = -gamma * c1; - realtype cy = -gamma * c2; - realtype cc = ONE - gamma * c3; + sunrealtype cx = -gamma * c1; + sunrealtype cy = -gamma * c2; + sunrealtype cc = ONE - gamma * c3; // -------------------------------- // Set matrix values for all nodes @@ -1978,7 +1978,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -2454,11 +2454,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int InitSolution(realtype t, N_Vector u, UserData *udata) +static int InitSolution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -2473,7 +2473,7 @@ static int InitSolution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -2579,7 +2579,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " ||u||_rms " << endl; cout << " ---------------------"; @@ -2618,14 +2618,14 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); } return 0; } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { bool outproc = (udata->myid_c == 0); @@ -2633,7 +2633,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) { // Compute rms norm - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -2644,7 +2644,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -2726,8 +2726,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp index 8b1d75c513..739ada3b02 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -81,22 +81,22 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Advection coefficients in the x and y directions - realtype ax; - realtype ay; + sunrealtype ax; + sunrealtype ay; // Reactions coefficient - realtype r; + sunrealtype r; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -106,8 +106,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -144,10 +144,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -156,10 +156,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -168,20 +168,20 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance bool linear; // enable/disable linearly implicit option int sorder; // slow method order int forder; // fast ARKode method order - realtype hf; // fast fixed step size - realtype hs; // slow timestep fixed + sunrealtype hf; // fast fixed step size + sunrealtype hs; // slow timestep fixed int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs // Linear solver and preconditioner settings int liniters; // number of linear iterations - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor int prectype; // preconditioner type (NONE or LEFT) int msbp; // max number of steps between preconditioner setups @@ -242,17 +242,17 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata); // ----------------------------------------------------------------------------- // ODE right hand side functions -static int fi(realtype t, N_Vector u, N_Vector f, void *user_data); -static int fe(realtype t, N_Vector u, N_Vector f, void *user_data); -static int ff(realtype t, N_Vector u, N_Vector f, void *user_data); -static int ffeval(realtype *fval, realtype uval, realtype rval); +static int fi(sunrealtype t, N_Vector u, N_Vector f, void *user_data); +static int fe(sunrealtype t, N_Vector u, N_Vector f, void *user_data); +static int ff(sunrealtype t, N_Vector u, N_Vector f, void *user_data); +static int ffeval(sunrealtype *fval, sunrealtype uval, sunrealtype rval); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -263,7 +263,7 @@ static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, static int HyprePFMG(UserData *udata); // Fill A = I - gamma * J matrix -static int FillMatrix(UserData *udata, realtype gamma); +static int FillMatrix(UserData *udata, sunrealtype gamma); // Perform neighbor exchange static int PostRecv(UserData *udata); @@ -284,7 +284,7 @@ static int FreeUserData(UserData *udata); static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // Compute the initial condition -static int InitSolution(realtype t, N_Vector u, UserData *udata); +static int InitSolution(sunrealtype t, N_Vector u, UserData *udata); // ----------------------------------------------------------------------------- // Output and utility functions @@ -298,7 +298,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -532,9 +532,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata.tf / udata.nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / udata.nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(&udata); @@ -725,23 +725,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -808,7 +808,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // ----------------------------------------------------------------------------- // fi routine to compute the slow-implicit part of ODE RHS function. -static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) +static int fi(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -824,10 +824,10 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny_loc = udata->ny_loc; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Open exchange receives @@ -839,9 +839,9 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "SendData", 1)) return -1; // Constants for computing diffusion and forcing - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Initialize rhs to zero (handles boundary conditions) N_VConst(ZERO, f); @@ -863,10 +863,10 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries (if not at overall domain boundary) - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face if (udata->HaveNbrW) @@ -975,7 +975,7 @@ static int fi(realtype t, N_Vector u, N_Vector f, void *user_data) } // fe routine to compute the slow-explicit part of ODE RHS function f(t,y). -static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) +static int fe(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -991,10 +991,10 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny_loc = udata->ny_loc; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Open exchange receives @@ -1006,10 +1006,10 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "SendData", 1)) return -1; // Constants for computing advection - realtype cxp = -SUNMAX(udata->ax, ZERO) / (udata->dx); - realtype cxm = -SUNMIN(udata->ax, ZERO) / (udata->dx); - realtype cyp = -SUNMAX(udata->ay, ZERO) / (udata->dy); - realtype cym = -SUNMIN(udata->ay, ZERO) / (udata->dy); + sunrealtype cxp = -SUNMAX(udata->ax, ZERO) / (udata->dx); + sunrealtype cxm = -SUNMIN(udata->ax, ZERO) / (udata->dx); + sunrealtype cyp = -SUNMAX(udata->ay, ZERO) / (udata->dy); + sunrealtype cym = -SUNMIN(udata->ay, ZERO) / (udata->dy); // Initialize rhs to zero (handles boundary conditions) N_VConst(ZERO, f); @@ -1032,10 +1032,10 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries (if not at overall domain boundary) - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face if (udata->HaveNbrW) @@ -1152,14 +1152,14 @@ static int fe(realtype t, N_Vector u, N_Vector f, void *user_data) } // ff helper function -static int ffeval(realtype *fval, realtype uval, realtype rval) { +static int ffeval(sunrealtype *fval, sunrealtype uval, sunrealtype rval) { *fval = rval * (uval - uval*uval*uval); return 0; } // f routine to compute the ODE RHS function f(t,y). -static int ff(realtype t, N_Vector u, N_Vector f, void *user_data) +static int ff(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { sunindextype i, j; @@ -1174,13 +1174,13 @@ static int ff(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny_loc = udata->ny_loc; // Shortcut to reaction coefficient - realtype rval = udata->r; + sunrealtype rval = udata->r; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs to zero (handles boundary conditions) @@ -1278,8 +1278,8 @@ static int ff(realtype t, N_Vector u, N_Vector f, void *user_data) // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; @@ -1329,8 +1329,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { int flag; @@ -1540,7 +1540,7 @@ static int HyprePFMG(UserData *udata) } // Fill A = I - gamma * J matrix -static int FillMatrix(UserData *udata, realtype gamma) +static int FillMatrix(UserData *udata, sunrealtype gamma) { // Variable shortcuts HYPRE_Int ilower[2]; @@ -1584,14 +1584,14 @@ static int FillMatrix(UserData *udata, realtype gamma) (ilower[1] <= iupper[1])) { // Jacobian values - realtype c1 = udata->kx / (udata->dx * udata->dx); - realtype c2 = udata->ky / (udata->dy * udata->dy); - realtype c3 = -TWO * (c1 + c2); + sunrealtype c1 = udata->kx / (udata->dx * udata->dx); + sunrealtype c2 = udata->ky / (udata->dy * udata->dy); + sunrealtype c3 = -TWO * (c1 + c2); // Linear system values - realtype cx = -gamma * c1; - realtype cy = -gamma * c2; - realtype cc = ONE - gamma * c3; + sunrealtype cx = -gamma * c1; + sunrealtype cy = -gamma * c2; + sunrealtype cc = ONE - gamma * c3; // -------------------------------- // Set matrix values for all nodes @@ -1932,7 +1932,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -2426,11 +2426,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int InitSolution(realtype t, N_Vector u, UserData *udata) +static int InitSolution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -2445,7 +2445,7 @@ static int InitSolution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -2560,7 +2560,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " ||u||_rms " << endl; cout << " ---------------------"; @@ -2599,14 +2599,14 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); } return 0; } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { bool outproc = (udata->myid_c == 0); @@ -2614,7 +2614,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) { // Compute rms norm - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -2625,7 +2625,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -2707,8 +2707,8 @@ static int OutputFastStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; @@ -2769,7 +2769,7 @@ static int OutputSlowStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp index dfb312466b..b32e4ed674 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp @@ -219,9 +219,9 @@ int main(int argc, char* argv[]) // ---------------------- // Initial time, time between outputs, output time - realtype t = ZERO; - realtype dTout = udata.tf / uopts.nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / uopts.nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata, uopts); @@ -1090,8 +1090,8 @@ int SetupMRICVODE(SUNContext ctx, UserData &udata, UserOptions &uopts, // Advance the fast ODE in time -int CVodeInnerStepper_Evolve(MRIStepInnerStepper fast_mem, realtype t0, - realtype tout, N_Vector y) +int CVodeInnerStepper_Evolve(MRIStepInnerStepper fast_mem, sunrealtype t0, + sunrealtype tout, N_Vector y) { void* inner_content = nullptr; int flag = MRIStepInnerStepper_GetContent(fast_mem, &inner_content); @@ -1116,7 +1116,7 @@ int CVodeInnerStepper_Evolve(MRIStepInnerStepper fast_mem, realtype t0, flag = CVodeSetStopTime(content->cvode_mem, tout); if (check_flag(flag, "CVodeSetStopTime")) return -1; - realtype tret; + sunrealtype tret; flag = CVode(content->cvode_mem, tout, y, &tret, CV_NORMAL); if (flag < 0) return -1; @@ -1139,7 +1139,7 @@ int CVodeInnerStepper_Evolve(MRIStepInnerStepper fast_mem, realtype t0, // Compute the RHS of the fast ODE -int CVodeInnerStepper_FullRhs(MRIStepInnerStepper fast_mem, realtype t, +int CVodeInnerStepper_FullRhs(MRIStepInnerStepper fast_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { void* inner_content = nullptr; @@ -1156,7 +1156,7 @@ int CVodeInnerStepper_FullRhs(MRIStepInnerStepper fast_mem, realtype t, // Reset the fast integrator to the given time and state -int CVodeInnerStepper_Reset(MRIStepInnerStepper fast_mem, realtype tR, +int CVodeInnerStepper_Reset(MRIStepInnerStepper fast_mem, sunrealtype tR, N_Vector yR) { void* inner_content = nullptr; @@ -1183,24 +1183,24 @@ int CVodeInnerStepper_Reset(MRIStepInnerStepper fast_mem, realtype tR, // Advection RHS function -int f_advection(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_advection(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; // Access data arrays - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); if (check_ptr(ydata, "N_VGetArrayPointer")) return -1; - realtype* fdata = N_VGetArrayPointer(f); + sunrealtype* fdata = N_VGetArrayPointer(f); if (check_ptr(fdata, "N_VGetArrayPointer")) return -1; // Compute advection RHS - realtype ul, ur; - realtype vl, vr; - realtype wl, wr; + sunrealtype ul, ur; + sunrealtype vl, vr; + sunrealtype wl, wr; - realtype c = -ONE * udata->c / (TWO * udata->dx); + sunrealtype c = -ONE * udata->c / (TWO * udata->dx); fdata[0] = fdata[1] = fdata[2] = ZERO; @@ -1227,14 +1227,14 @@ int f_advection(realtype t, N_Vector y, N_Vector f, void* user_data) // Advection Jacobian function -int J_advection(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_advection(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Access problem data UserData* udata = (UserData*) user_data; - realtype c = -ONE * udata->c / (TWO * udata->dx); + sunrealtype c = -ONE * udata->c / (TWO * udata->dx); for (sunindextype i = 1; i < udata->nx - 1; i++) { @@ -1253,24 +1253,24 @@ int J_advection(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Diffusion RHS function -int f_diffusion(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_diffusion(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; // Access data arrays - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); if (check_ptr(ydata, "N_VGetArrayPointer")) return -1; - realtype* fdata = N_VGetArrayPointer(f); + sunrealtype* fdata = N_VGetArrayPointer(f); if (check_ptr(fdata, "N_VGetArrayPointer")) return -1; // Compute diffusion RHS - realtype ul, uc, ur; - realtype vl, vc, vr; - realtype wl, wc, wr; + sunrealtype ul, uc, ur; + sunrealtype vl, vc, vr; + sunrealtype wl, wc, wr; - realtype d = udata->d / (udata->dx * udata->dx); + sunrealtype d = udata->d / (udata->dx * udata->dx); fdata[0] = fdata[1] = fdata[2] = ZERO; @@ -1300,14 +1300,14 @@ int f_diffusion(realtype t, N_Vector y, N_Vector f, void* user_data) // Diffusion Jacobian function -int J_diffusion(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_diffusion(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Access problem data UserData* udata = (UserData*) user_data; - realtype d = udata->d / (udata->dx * udata->dx); + sunrealtype d = udata->d / (udata->dx * udata->dx); for (sunindextype i = 1; i < udata->nx - 1; i++) { @@ -1329,20 +1329,20 @@ int J_diffusion(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Reaction RHS function -int f_reaction(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_reaction(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; // Access data arrays - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); if (check_ptr(ydata, "N_VGetArrayPointer")) return -1; - realtype* fdata = N_VGetArrayPointer(f); + sunrealtype* fdata = N_VGetArrayPointer(f); if (check_ptr(fdata, "N_VGetArrayPointer")) return -1; // Compute reaction RHS - realtype u, v, w; + sunrealtype u, v, w; fdata[0] = fdata[1] = fdata[2] = ZERO; @@ -1364,7 +1364,7 @@ int f_reaction(realtype t, N_Vector y, N_Vector f, void* user_data) // Diffusion Jacobian function -int J_reaction(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_reaction(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -1372,10 +1372,10 @@ int J_reaction(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, UserData* udata = (UserData*) user_data; // Access data array - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); if (check_ptr(ydata, "N_VGetArrayPointer")) return 1; - realtype u, v, w; + sunrealtype u, v, w; for (sunindextype i = 1; i < udata->nx - 1; i++) { @@ -1403,7 +1403,7 @@ int J_reaction(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Advection-diffusion RHS function -int f_adv_diff(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_adv_diff(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; @@ -1424,7 +1424,7 @@ int f_adv_diff(realtype t, N_Vector y, N_Vector f, void* user_data) // Advection-diffusion Jacobian function -int J_adv_diff(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_adv_diff(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Access problem data @@ -1450,7 +1450,7 @@ int J_adv_diff(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Advection-reaction RHS function -int f_adv_react(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_adv_react(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; @@ -1471,7 +1471,7 @@ int f_adv_react(realtype t, N_Vector y, N_Vector f, void* user_data) // Diffusion-reaction Jacobian function -int J_adv_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_adv_react(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Access problem data @@ -1497,7 +1497,7 @@ int J_adv_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Diffusion-reaction RHS function -int f_diff_react(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_diff_react(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; @@ -1518,7 +1518,7 @@ int f_diff_react(realtype t, N_Vector y, N_Vector f, void* user_data) // Diffusion-reaction Jacobian function -int J_diff_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_diff_react(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Access problem data @@ -1544,7 +1544,7 @@ int J_diff_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Advection-diffusion-reaction RHS function -int f_adv_diff_react(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_adv_diff_react(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; @@ -1572,7 +1572,7 @@ int f_adv_diff_react(realtype t, N_Vector y, N_Vector f, void* user_data) // Diffusion-reaction Jacobian function -int J_adv_diff_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_adv_diff_react(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Access problem data @@ -1609,7 +1609,7 @@ int J_adv_diff_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, // Reaction RHS function with MRI forcing -int f_react_forcing(realtype t, N_Vector y, N_Vector f, void* user_data) +int f_react_forcing(sunrealtype t, N_Vector y, N_Vector f, void* user_data) { // Access problem data UserData* udata = (UserData*) user_data; @@ -1629,10 +1629,10 @@ int f_react_forcing(realtype t, N_Vector y, N_Vector f, void* user_data) // Compute the initial condition int SetIC(N_Vector y, UserData &udata) { - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); if (check_ptr(ydata, "N_VGetArrayPointer")) return -1; - realtype x, p; + sunrealtype x, p; for (sunindextype i = 0; i < udata.nx; i++) { diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp index f4c2a56146..92d5f16d6b 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp @@ -42,7 +42,7 @@ #define NSPECIES 3 -#define WIDTH (10 + numeric_limits::digits10) +#define WIDTH (10 + numeric_limits::digits10) // Macro to access each species at an x location #define UIDX(i) (NSPECIES * (i)) @@ -65,28 +65,28 @@ struct UserData int splitting = 3; // Advection and diffusion coefficients - realtype c = RCONST(1.0e-3); - realtype d = RCONST(1.0e-2); + sunrealtype c = RCONST(1.0e-3); + sunrealtype d = RCONST(1.0e-2); // Feed and reaction rates - realtype A = RCONST(0.6); - realtype B = RCONST(2.0); + sunrealtype A = RCONST(0.6); + sunrealtype B = RCONST(2.0); // Stiffness parameter - realtype eps = RCONST(1.0e-2); + sunrealtype eps = RCONST(1.0e-2); // Final simulation time - realtype tf = RCONST(3.0); + sunrealtype tf = RCONST(3.0); // Domain boundaries - realtype xl = ZERO; - realtype xu = ONE; + sunrealtype xl = ZERO; + sunrealtype xu = ONE; // Number of nodes sunindextype nx = 512; // Mesh spacing - realtype dx = (xu - xl) / (nx - 1); + sunrealtype dx = (xu - xl) / (nx - 1); // Number of equations sunindextype neq = NSPECIES * nx; @@ -132,17 +132,17 @@ struct UserOptions bool ark_dirk = false; // Relative and absolute tolerances - realtype rtol = RCONST(1.e-4); - realtype atol = RCONST(1.e-9); - realtype rtol_fast = RCONST(1.e-4); - realtype atol_fast = RCONST(1.e-9); + sunrealtype rtol = RCONST(1.e-4); + sunrealtype atol = RCONST(1.e-9); + sunrealtype rtol_fast = RCONST(1.e-4); + sunrealtype atol_fast = RCONST(1.e-9); // Step size selection (ZERO = adaptive steps) - realtype fixed_h = ZERO; - realtype fixed_h_fast = ZERO; + sunrealtype fixed_h = ZERO; + sunrealtype fixed_h_fast = ZERO; // First step growth factor - realtype etamx1_fast = ZERO; + sunrealtype etamx1_fast = ZERO; int maxsteps = 10000; // max steps between outputs int controller = -1; // step size adaptivity method @@ -159,7 +159,7 @@ struct UserOptions bool save_hinit = false; bool save_hcur = false; - realtype hcur_factor = RCONST(0.7); + sunrealtype hcur_factor = RCONST(0.7); int output = 1; // 0 = none, 1 = stats, 2 = disk, 3 = disk with tstop int nout = 10; // number of output times @@ -179,10 +179,10 @@ struct CVodeInnerStepperContent bool save_hinit = false; bool save_hcur = false; - realtype hcur_factor = ONE; + sunrealtype hcur_factor = ONE; - realtype hinit = ZERO; // initial step size - realtype hcur = ZERO; // current step size + sunrealtype hinit = ZERO; // initial step size + sunrealtype hcur = ZERO; // current step size // saved integrator stats long int nst = 0; // time steps @@ -194,13 +194,13 @@ struct CVodeInnerStepperContent long int nje = 0; // Jacobian evals }; -int CVodeInnerStepper_Evolve(MRIStepInnerStepper fast_mem, realtype t0, - realtype tout, N_Vector y); +int CVodeInnerStepper_Evolve(MRIStepInnerStepper fast_mem, sunrealtype t0, + sunrealtype tout, N_Vector y); -int CVodeInnerStepper_FullRhs(MRIStepInnerStepper fast_mem, realtype t, +int CVodeInnerStepper_FullRhs(MRIStepInnerStepper fast_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int CVodeInnerStepper_Reset(MRIStepInnerStepper fast_mem, realtype tR, +int CVodeInnerStepper_Reset(MRIStepInnerStepper fast_mem, sunrealtype tR, N_Vector yR); // ----------------------------------------------------------------------------- @@ -208,37 +208,37 @@ int CVodeInnerStepper_Reset(MRIStepInnerStepper fast_mem, realtype tR, // ----------------------------------------------------------------------------- // ODE right hand side (RHS) functions -int f_advection(realtype t, N_Vector y, N_Vector f, void* user_data); -int f_diffusion(realtype t, N_Vector y, N_Vector f, void* user_data); -int f_reaction(realtype t, N_Vector y, N_Vector f, void* user_data); +int f_advection(sunrealtype t, N_Vector y, N_Vector f, void* user_data); +int f_diffusion(sunrealtype t, N_Vector y, N_Vector f, void* user_data); +int f_reaction(sunrealtype t, N_Vector y, N_Vector f, void* user_data); -int f_adv_diff(realtype t, N_Vector y, N_Vector f, void* user_data); -int f_adv_react(realtype t, N_Vector y, N_Vector f, void* user_data); -int f_diff_react(realtype t, N_Vector y, N_Vector f, void* user_data); -int f_adv_diff_react(realtype t, N_Vector y, N_Vector f, void* user_data); +int f_adv_diff(sunrealtype t, N_Vector y, N_Vector f, void* user_data); +int f_adv_react(sunrealtype t, N_Vector y, N_Vector f, void* user_data); +int f_diff_react(sunrealtype t, N_Vector y, N_Vector f, void* user_data); +int f_adv_diff_react(sunrealtype t, N_Vector y, N_Vector f, void* user_data); -int f_react_forcing(realtype t, N_Vector y, N_Vector f, void* user_data); +int f_react_forcing(sunrealtype t, N_Vector y, N_Vector f, void* user_data); // Jacobian of RHS functions -int J_advection(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_advection(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int J_diffusion(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_diffusion(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int J_reaction(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_reaction(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int J_adv_diff(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_adv_diff(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int J_adv_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_adv_react(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int J_diff_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_diff_react(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int J_adv_diff_react(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int J_adv_diff_react(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -359,8 +359,8 @@ int OutputStatsARK(void* arkode_mem, UserData &udata) cout << " J evals = " << nje << endl; cout << endl; - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgls = (realtype) nsetups / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgls = (sunrealtype) nsetups / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS setups per NLS iter = " << avgls << endl; } @@ -410,8 +410,8 @@ int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, cout << endl; // Compute average nls iters per step and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst; - realtype avgls = (realtype) nsetups / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst; + sunrealtype avgls = (sunrealtype) nsetups / (sunrealtype) nni; cout << " Avg NLS iters per slow step = " << avgnli << endl; cout << " Avg LS setups per NLS iter = " << avgls << endl; } @@ -459,8 +459,8 @@ int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, cout << " J evals = " << nje << endl; cout << endl; - realtype avgnli = (realtype) nni / (realtype) nst; - realtype avgls = (realtype) nsetups / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst; + sunrealtype avgls = (sunrealtype) nsetups / (sunrealtype) nni; cout << " Avg NLS iters per fast step = " << avgnli << endl; cout << " Avg LS setups per NLS iter = " << avgls << endl; } @@ -545,8 +545,8 @@ int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, cout << endl; // Compute average nls iters per step and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nsts; - realtype avgls = (realtype) nsetups / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nsts; + sunrealtype avgls = (sunrealtype) nsetups / (sunrealtype) nni; cout << " Avg NLS iters per slow step = " << avgnli << endl; cout << " Avg LS setups per NLS iter = " << avgls << endl; cout << endl; @@ -571,8 +571,8 @@ int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, cout << " J evals = " << content->nje << endl; cout << endl; - avgnli = (realtype) content->nni / (realtype) content->nst; - avgls = (realtype) content->nsetups / (realtype) content->nni; + avgnli = (sunrealtype) content->nni / (sunrealtype) content->nst; + avgls = (sunrealtype) content->nsetups / (sunrealtype) content->nni; cout << " Avg NLS iters per fast step = " << avgnli << endl; cout << " Avg LS setups per NLS iter = " << avgls << endl; cout << endl; @@ -626,7 +626,7 @@ void InputHelp() } -inline void find_arg(vector &args, const string key, realtype &dest) +inline void find_arg(vector &args, const string key, sunrealtype &dest) { auto it = find(args.begin(), args.end(), key); if (it != args.end()) @@ -1153,7 +1153,7 @@ int OpenOutput(UserData &udata, UserOptions &uopts) if (uopts.output) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " ||y||_rms " << endl; cout << " ---------------------"; @@ -1169,7 +1169,7 @@ int OpenOutput(UserData &udata, UserOptions &uopts) uopts.uout.open(fname.str()); uopts.uout << scientific; - uopts.uout << setprecision(numeric_limits::digits10); + uopts.uout << setprecision(numeric_limits::digits10); uopts.uout << "# title Advection-Diffusion-Reaction (Brusselator)" << endl; uopts.uout << "# nvar 3" << endl; uopts.uout << "# vars u v w" << endl; @@ -1184,18 +1184,18 @@ int OpenOutput(UserData &udata, UserOptions &uopts) // Write output -int WriteOutput(realtype t, N_Vector y, UserData &udata, UserOptions &uopts) +int WriteOutput(sunrealtype t, N_Vector y, UserData &udata, UserOptions &uopts) { if (uopts.output) { // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(y, y) / udata.nx); + sunrealtype urms = sqrt(N_VDotProd(y, y) / udata.nx); cout << setw(22) << t << setw(25) << urms << endl; // Write solution to disk if (uopts.output >= 2) { - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); if (check_ptr(ydata, "N_VGetArrayPointer")) return -1; uopts.uout << t; diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.cpp b/examples/arkode/CXX_serial/ark_analytic_sys.cpp index 83153a67d3..281120a68c 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.cpp +++ b/examples/arkode/CXX_serial/ark_analytic_sys.cpp @@ -49,7 +49,7 @@ #include // access to serial N_Vector #include // access to dense SUNMatrix #include // access to dense SUNLinearSolver -#include // def. of type 'realtype' +#include // def. of type 'sunrealtype' #include #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -65,8 +65,8 @@ using namespace std; // User-supplied Functions Called by the Solver -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Private function to perform matrix-matrix product @@ -79,13 +79,13 @@ static int check_flag(void *flagvalue, const string funcname, int opt); int main() { // general problem parameters - realtype T0 = RCONST(0.0); // initial time - realtype Tf = RCONST(0.05); // final time - realtype dTout = RCONST(0.005); // time between outputs + sunrealtype T0 = RCONST(0.0); // initial time + sunrealtype Tf = RCONST(0.05); // final time + sunrealtype dTout = RCONST(0.005); // time between outputs sunindextype NEQ = 3; // number of dependent vars. - realtype reltol = RCONST(1.0e-6); // tolerances - realtype abstol = RCONST(1.0e-10); - realtype lamda = RCONST(-100.0); // stiffness parameter + sunrealtype reltol = RCONST(1.0e-6); // tolerances + sunrealtype abstol = RCONST(1.0e-10); + sunrealtype lamda = RCONST(-100.0); // stiffness parameter // general problem variables int flag; // reusable error-checking flag @@ -195,8 +195,8 @@ int main() /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then prints results. Stops when the final time has been reached */ - realtype t = T0; - realtype tout = T0+dTout; + sunrealtype t = T0; + sunrealtype tout = T0+dTout; cout << " t y0 y1 y2\n"; cout << " --------------------------------------\n"; while (Tf - t > 1.0e-15) { @@ -263,14 +263,14 @@ int main() *-------------------------------*/ // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; // cast user_data to realtype - realtype lam = rdata[0]; // set shortcut for stiffness parameter - realtype y0 = NV_Ith_S(y,0); // access current solution values - realtype y1 = NV_Ith_S(y,1); - realtype y2 = NV_Ith_S(y,2); - realtype yd0, yd1, yd2; + sunrealtype *rdata = (sunrealtype *) user_data; // cast user_data to sunrealtype + sunrealtype lam = rdata[0]; // set shortcut for stiffness parameter + sunrealtype y0 = NV_Ith_S(y,0); // access current solution values + sunrealtype y1 = NV_Ith_S(y,1); + sunrealtype y2 = NV_Ith_S(y,2); + sunrealtype yd0, yd1, yd2; // fill in the RHS function: f(t,y) = V*D*Vi*y yd0 = 0.25*(5.0*y0 + 1.0*y1 - 3.0*y2); // yd = Vi*y @@ -290,12 +290,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } // Jacobian routine to compute J(t,y) = df/dy. -static int Jac(realtype t, N_Vector y, N_Vector fy, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rdata = (realtype *) user_data; // cast user_data to realtype - realtype lam = rdata[0]; // set shortcut for stiffness parameter + sunrealtype *rdata = (sunrealtype *) user_data; // cast user_data to sunrealtype + sunrealtype lam = rdata[0]; // set shortcut for stiffness parameter // Get Jacobian context SUNContext sunctx = J->sunctx; @@ -371,9 +371,9 @@ static int SUNDlsMat_dense_MM(SUNMatrix A, SUNMatrix B, SUNMatrix C) return 1; } - realtype **adata = SUNDenseMatrix_Cols(A); // access data and extents - realtype **bdata = SUNDenseMatrix_Cols(B); - realtype **cdata = SUNDenseMatrix_Cols(C); + sunrealtype **adata = SUNDenseMatrix_Cols(A); // access data and extents + sunrealtype **bdata = SUNDenseMatrix_Cols(B); + sunrealtype **cdata = SUNDenseMatrix_Cols(C); sunindextype m = SUNDenseMatrix_Rows(C); sunindextype n = SUNDenseMatrix_Columns(C); sunindextype l = SUNDenseMatrix_Columns(A); diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index 3a78042a25..df9850f7d3 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -78,18 +78,18 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Number of nodes in the x and y directions sunindextype nx; @@ -99,13 +99,13 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance - realtype hfixed; // fixed step size + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance + sunrealtype hfixed; // fixed step size int order; // ARKode method order int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs @@ -118,7 +118,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // Inverse of Jacobian diagonal for preconditioner N_Vector d; @@ -143,14 +143,14 @@ struct UserData // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -171,10 +171,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -184,7 +184,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -347,7 +347,7 @@ int main(int argc, char* argv[]) else { // Use implicit Euler (requires fixed step size) - realtype c[1], A[1], b[1]; + sunrealtype c[1], A[1], b[1]; ARKodeButcherTable B = NULL; // Create implicit Euler Butcher table @@ -402,9 +402,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata->tf / udata->nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata); @@ -459,10 +459,10 @@ int main(int argc, char* argv[]) flag = SolutionError(t, u, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } @@ -494,7 +494,7 @@ int main(int argc, char* argv[]) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { // Timing variables chrono::time_point t1; @@ -511,15 +511,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny = udata->ny; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -528,15 +528,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over domain interior and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (sunindextype j = 1; j < ny - 1; j++) { @@ -582,8 +582,8 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Timing variables chrono::time_point t1; @@ -596,17 +596,17 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, UserData *udata = (UserData *) user_data; // Access data array - realtype *diag = N_VGetArrayPointer(udata->d); + sunrealtype *diag = N_VGetArrayPointer(udata->d); if (check_flag((void *) diag, "N_VGetArrayPointer", 0)) return -1; // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Set all entries of d to the inverse diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE / (ONE - gamma * cc); + sunrealtype c = ONE / (ONE - gamma * cc); N_VConst(c, udata->d); // Stop timer @@ -620,8 +620,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { // Timing variables @@ -883,11 +883,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -895,7 +895,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, u); - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = 1; j < udata->ny - 1; j++) @@ -916,7 +916,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -1010,7 +1010,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); if (udata->forcing) { cout << " t "; @@ -1045,13 +1045,13 @@ static int OpenOutput(UserData *udata) // Open output streams for solution and error udata->uout.open("heat2d_solution.txt"); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); if (udata->forcing) { udata->eout.open("heat2d_error.txt"); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } } @@ -1059,14 +1059,14 @@ static int OpenOutput(UserData *udata) } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { int flag; if (udata->output > 0) { // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (udata->forcing) @@ -1076,7 +1076,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (check_flag(&flag, "SolutionError", 1)) return 1; // Compute max error - realtype max = N_VMaxNorm(udata->e); + sunrealtype max = N_VMaxNorm(udata->e); cout << setw(22) << t << setw(25) << urms << setw(25) << max << endl; } @@ -1088,7 +1088,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution and error to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -1101,7 +1101,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (udata->forcing) { // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -1195,8 +1195,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp index 53a6e56ec5..3743b2292d 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp +++ b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp @@ -81,7 +81,7 @@ #include // serial N_Vector type, fcts., macros #include // dense matrix type, fcts., macros #include // dense linear solver -#include // def. math fcns, 'realtype' +#include // def. math fcns, 'sunrealtype' #include // Newton nonlinear solver #include // fixed-point nonlinear solver @@ -105,53 +105,53 @@ using namespace std; // User data structure struct UserData { - realtype G; - realtype g; - realtype e; + sunrealtype G; + sunrealtype g; + sunrealtype e; booleantype M_timedep; }; // User-supplied functions called by the solver -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fn(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Ji(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Jn(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int MassMatrix(realtype t, SUNMatrix M, void *user_data, +static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Private utility functions -static int adaptive_run(void *arkode_mem, N_Vector y, realtype T0, realtype Tf, - realtype dTout, realtype reltol, realtype abstol, +static int adaptive_run(void *arkode_mem, N_Vector y, sunrealtype T0, sunrealtype Tf, + sunrealtype dTout, sunrealtype reltol, sunrealtype abstol, int rk_type, int nls_type, UserData &udata); -static int check_order(void *arkode_mem, N_Vector y, realtype T0, - realtype Tf, int order, int rk_type, UserData &udata); -static realtype r(realtype t); -static realtype s(realtype t); -static realtype rdot(realtype t); -static realtype sdot(realtype t); -static realtype utrue(realtype t); -static realtype vtrue(realtype t); -static int Ytrue(realtype t, N_Vector y); +static int check_order(void *arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int order, int rk_type, UserData &udata); +static sunrealtype r(sunrealtype t); +static sunrealtype s(sunrealtype t); +static sunrealtype rdot(sunrealtype t); +static sunrealtype sdot(sunrealtype t); +static sunrealtype utrue(sunrealtype t); +static sunrealtype vtrue(sunrealtype t); +static int Ytrue(sunrealtype t, N_Vector y); static int check_retval(void *returnvalue, const char *funcname, int opt); // Main Program int main(int argc, char *argv[]) { // general problem parameters - realtype T0 = RCONST(-3.0); // initial time - realtype Tf = RCONST(7.0); // final time - realtype dTout = RCONST(0.1); // time between outputs + sunrealtype T0 = RCONST(-3.0); // initial time + sunrealtype Tf = RCONST(7.0); // final time + sunrealtype dTout = RCONST(0.1); // time between outputs sunindextype NEQ = 2; // number of dependent vars. int rk_type = 0; // type of RK method [ARK=0, DIRK=1, ERK=2] int nls_type = 0; // type of nonlinear solver [Newton=0, FP=1] int order = 4; // order of accuracy for RK method booleantype deduce = SUNFALSE; // deduce fi after a nonlinear solve booleantype adaptive = SUNTRUE; // adaptive run vs convergence order - realtype reltol = RCONST(1e-5); // relative tolerance - realtype abstol = RCONST(1e-11); // absolute tolerance + sunrealtype reltol = RCONST(1e-5); // relative tolerance + sunrealtype abstol = RCONST(1e-11); // absolute tolerance // general problem variables int retval; // reusable error-checking flag @@ -176,9 +176,9 @@ int main(int argc, char *argv[]) if (argc > 1) rk_type = (int) atoi(argv[1]); if (argc > 2) order = (int) atoi(argv[2]); if (argc > 3) nls_type = (int) atoi(argv[3]); - if (argc > 4) udata.G = (realtype) atof(argv[4]); + if (argc > 4) udata.G = (sunrealtype) atof(argv[4]); if (argc > 5) udata.M_timedep = (int) atoi(argv[5]); - if (argc > 6) udata.g = (realtype) atof(argv[6]); + if (argc > 6) udata.g = (sunrealtype) atof(argv[6]); if (argc > 7) deduce = (int) atoi(argv[7]); // Check arguments for validity @@ -343,12 +343,12 @@ int main(int argc, char *argv[]) //------------------------------ // fe routine to compute the explicit portion of the ODE RHS. -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData *udata = (UserData *) user_data; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype gcos, gsin, tmp1, tmp2; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype gcos, gsin, tmp1, tmp2; // fill in the RHS function: // g*[ cos(t) sin(t)] * [rdot(t)/(2u)] @@ -365,12 +365,12 @@ static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data) } // fi routine to compute the implicit portion of the ODE RHS. -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData *udata = (UserData *) user_data; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype gcos, gsin, tmp1, tmp2, tmp3, tmp4; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype gcos, gsin, tmp1, tmp2, tmp3, tmp4; // fill in the RHS function: // g*[ cos(t) sin(t)]*[G e]*[(-1+u^2-r(t))/(2*u)] @@ -388,12 +388,12 @@ static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) return 0; } -static int fn(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData *udata = (UserData *) user_data; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype gcos, gsin, tmp1, tmp2, tmp3, tmp4; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype gcos, gsin, tmp1, tmp2, tmp3, tmp4; // fill in the RHS function: // g*[ cos(t) sin(t)]*( [G e]*[(-1+u^2-r(t))/(2*u)] + [rdot(t)/(2u)] @@ -411,13 +411,13 @@ static int fn(realtype t, N_Vector y, N_Vector ydot, void *user_data) return 0; } -static int Ji(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData *udata = (UserData *) user_data; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype gcos, gsin, t11, t12, t21, t22, m11, m12, m21, m22; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype gcos, gsin, t11, t12, t21, t22, m11, m12, m21, m22; // fill in the Jacobian: // g*[ cos(t) sin(t)]*[G e]*[1-(u^2-r(t)-1)/(2*u^2), 0] @@ -441,13 +441,13 @@ static int Ji(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, return 0; } -static int Jn(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData *udata = (UserData *) user_data; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype gcos, gsin, t11, t12, t21, t22, m11, m12, m21, m22; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype gcos, gsin, t11, t12, t21, t22, m11, m12, m21, m22; // fill in the Jacobian: // g*[ cos(t) sin(t)]*( [G e]*[1-(u^2-r(t)-1)/(2*u^2), 0] + [-r'(t)/(2*u^2), 0]) @@ -472,7 +472,7 @@ static int Jn(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } // Routine to compute the mass matrix multiplying y_t. -static int MassMatrix(realtype t, SUNMatrix M, void *user_data, +static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData *udata = (UserData *) user_data; @@ -493,8 +493,8 @@ static int MassMatrix(realtype t, SUNMatrix M, void *user_data, // Private helper functions //------------------------------ -static int adaptive_run(void *arkode_mem, N_Vector y, realtype T0, realtype Tf, - realtype dTout, realtype reltol, realtype abstol, +static int adaptive_run(void *arkode_mem, N_Vector y, sunrealtype T0, sunrealtype Tf, + sunrealtype dTout, sunrealtype reltol, sunrealtype abstol, int rk_type, int nls_type, UserData &udata) { // reused variables @@ -519,13 +519,13 @@ static int adaptive_run(void *arkode_mem, N_Vector y, realtype T0, realtype Tf, // Main time-stepping loop: calls ARKStepEvolve to perform integration, // then prints results. Stops when the final time has been reached int Nt = (int) ceil((Tf-T0)/dTout); - realtype t = T0; - realtype tout = T0+dTout; - realtype uerr = ZERO; - realtype verr = ZERO; - realtype uerrtot = ZERO; - realtype verrtot = ZERO; - realtype errtot = ZERO; + sunrealtype t = T0; + sunrealtype tout = T0+dTout; + sunrealtype uerr = ZERO; + sunrealtype verr = ZERO; + sunrealtype uerrtot = ZERO; + sunrealtype verrtot = ZERO; + sunrealtype errtot = ZERO; cout << "\n t u v uerr verr\n"; cout << " ------------------------------------------------------\n"; printf(" %10.6" FSYM" %10.6" FSYM" %10.6" FSYM" %.2" ESYM" %.2" ESYM"\n", @@ -606,15 +606,15 @@ static int adaptive_run(void *arkode_mem, N_Vector y, realtype T0, realtype Tf, return(0); } -static int check_order(void *arkode_mem, N_Vector y, realtype T0, - realtype Tf, int order, int rk_type, UserData &udata) +static int check_order(void *arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int order, int rk_type, UserData &udata) { // local variables int retval; size_t Nout = 20; - realtype reltol = RCONST(1.e-9); - realtype abstol = RCONST(1.e-12); - realtype a11, a12, a21, a22, b1, b2; + sunrealtype reltol = RCONST(1.e-9); + sunrealtype abstol = RCONST(1.e-12); + sunrealtype a11, a12, a21, a22, b1, b2; a11 = a12 = a21 = a22 = b1 = b2 = ZERO; // Tighten implicit solver to accommodate fixed step sizes @@ -634,13 +634,13 @@ static int check_order(void *arkode_mem, N_Vector y, realtype T0, } // Set array of fixed step sizes to use, storage for corresponding errors/orders - realtype hmax = Tf - T0; + sunrealtype hmax = Tf - T0; if (rk_type == 2) hmax = ONE/SUNRabs(udata.G); - realtype Nmin = SUNMAX((realtype) Nout, (realtype) ceil((Tf-T0)/hmax)); - vector hvals = {(Tf-T0)/Nmin, (Tf-T0)/2/Nmin, (Tf-T0)/4/Nmin, (Tf-T0)/8/Nmin, + sunrealtype Nmin = SUNMAX((sunrealtype) Nout, (sunrealtype) ceil((Tf-T0)/hmax)); + vector hvals = {(Tf-T0)/Nmin, (Tf-T0)/2/Nmin, (Tf-T0)/4/Nmin, (Tf-T0)/8/Nmin, (Tf-T0)/16/Nmin, (Tf-T0)/32/Nmin, (Tf-T0)/64/Nmin, (Tf-T0)/128/Nmin}; - vector errs(hvals.size()); - vector orders(hvals.size()-1); + vector errs(hvals.size()); + vector orders(hvals.size()-1); // Loop over fixed step sizes cout << "\n Fixed-step runs:\n"; @@ -656,11 +656,11 @@ static int check_order(void *arkode_mem, N_Vector y, realtype T0, if (check_retval(&retval, "ARKStepSetFixedStep", 1)) return 1; // Main time-stepping loop: run for Nout periods, accumulating overall error - realtype t = T0; - realtype dTout = (Tf-T0)/((realtype) Nout); - realtype tout = T0+dTout; - realtype uerr = ZERO; - realtype verr = ZERO; + sunrealtype t = T0; + sunrealtype dTout = (Tf-T0)/((sunrealtype) Nout); + sunrealtype tout = T0+dTout; + sunrealtype uerr = ZERO; + sunrealtype verr = ZERO; errs[ih] = ZERO; for (size_t iout=0; iout::digits10); + std::cout << std::setprecision(std::numeric_limits::digits10); std::cout << std::setw(swidth) << 0 << std::setw(rwidth) << t << std::setw(rwidth) << ydata[0] << std::setw(rwidth) << ydata[1] << std::setw(rwidth) << eng0 << std::setw(rwidth) diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp index 75df158b1a..6e4ae2a20a 100644 --- a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp +++ b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp @@ -67,7 +67,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to SuperLU SLU_NR_loc SUNMatrix */ #include /* access to SuperLU_DIST SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -110,25 +110,25 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype *x; /* mesh node locations */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype du; /* diffusion coeff for u */ - realtype dv; /* diffusion coeff for v */ - realtype dw; /* diffusion coeff for w */ - realtype ep; /* stiffness parameter */ + sunrealtype *x; /* mesh node locations */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype du; /* diffusion coeff for u */ + sunrealtype dv; /* diffusion coeff for v */ + sunrealtype dw; /* diffusion coeff for w */ + sunrealtype ep; /* stiffness parameter */ N_Vector tmp; /* temporary vector */ SUNMatrix R; /* temporary storage */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f_diff(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f_rx(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int MassMatrix(realtype t, SUNMatrix M, void *user_data, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f_diff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f_rx(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private helper functions */ @@ -142,24 +142,24 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; - realtype *data; - realtype *Mdata, *Adata, *Rdata; /* CSR matrix data for solver and mass matrix */ + sunrealtype *data; + sunrealtype *Mdata, *Adata, *Rdata; /* CSR matrix data for solver and mass matrix */ sunindextype *Acolind, *Mcolind, *Rcolind; /* CSR matrix column indices */ sunindextype *Arowptr, *Mrowptr, *Rrowptr; /* CSR matrix row pointers */ sunindextype N = 201; /* spatial mesh size */ - realtype a = RCONST(0.6); /* problem parameters */ - realtype b = RCONST(2.0); - realtype du = RCONST(0.025); - realtype dv = RCONST(0.025); - realtype dw = RCONST(0.025); - realtype ep = RCONST(1.0e-5); /* stiffness parameter */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); + sunrealtype a = RCONST(0.6); /* problem parameters */ + sunrealtype b = RCONST(2.0); + sunrealtype du = RCONST(0.025); + sunrealtype dv = RCONST(0.025); + sunrealtype dw = RCONST(0.025); + sunrealtype ep = RCONST(1.0e-5); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); sunindextype i, NEQ, NNZ; int npes, my_pe; @@ -185,7 +185,7 @@ int main(int argc, char *argv[]) { void *arkode_mem = NULL; FILE *FID, *UFID, *VFID, *WFID; - realtype h, z, t, dTout, tout, u, v, w, pi; + sunrealtype h, z, t, dTout, tout, u, v, w, pi; int iout; long int nst, nst_a, nfe, nfi, nsetups, nje, nni, ncfn; long int netf, nmset, nms, nMv; @@ -262,7 +262,7 @@ int main(int argc, char *argv[]) { /* allocate and set up spatial mesh; this [arbitrarily] clusters more intervals near the end points of the interval */ - udata->x = (realtype *) malloc(N*sizeof(realtype)); + udata->x = (sunrealtype *) malloc(N*sizeof(sunrealtype)); if (check_retval((void *)udata->x, "malloc", 2)) MPI_Abort(grid.comm, 1); h = RCONST(10.0)/(N-1); for (i=0; iN; - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; /* local variables */ sunindextype i; - realtype ul, ur, vl, vr, wl, wr; - realtype xl, xr, f1; + sunrealtype ul, ur, vl, vr, wl, wr; + sunrealtype xl, xr, f1; booleantype left, right; - realtype *Ydata, *RHSdata; + sunrealtype *Ydata, *RHSdata; /* access data arrays */ Ydata = N_VGetArrayPointer(y); @@ -645,23 +645,23 @@ static int f_diff(realtype t, N_Vector y, N_Vector ydot, void *user_data) { /* Routine to compute the reaction portion of the ODE RHS function f(t,y). */ -static int f_rx(realtype t, N_Vector y, N_Vector ydot, void *user_data) { +static int f_rx(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { /* problem data */ UserData udata = (UserData) user_data; /* shortcuts to number of intervals, background values */ sunindextype N = udata->N; - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; /* local variables */ sunindextype i; - realtype ul, ur, vl, vr, wl, wr; - realtype u, v, w, xl, xr, f1, f2, f3; + sunrealtype ul, ur, vl, vr, wl, wr; + sunrealtype u, v, w, xl, xr, f1, f2, f3; booleantype left, right; - realtype *Ydata, *RHSdata; + sunrealtype *Ydata, *RHSdata; /* access data arrays */ Ydata = N_VGetArrayPointer(y); @@ -791,7 +791,7 @@ static int f_rx(realtype t, N_Vector y, N_Vector ydot, void *user_data) { /* Interface routine to compute the Jacobian of the full RHS function, f(y) */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* temporary variables */ @@ -838,7 +838,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, /* Routine to compute the mass matrix multiplying y_t. */ -static int MassMatrix(realtype t, SUNMatrix M, void *user_data, +static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* user data structure */ @@ -850,12 +850,12 @@ static int MassMatrix(realtype t, SUNMatrix M, void *user_data, NRformat_loc *Mstore = (NRformat_loc *) Msuper->Store; sunindextype *rowptrs = Mstore->rowptr; sunindextype *colinds = Mstore->colind; - realtype *Mdata = (realtype *) Mstore->nzval; - realtype *Xdata = udata->x; + sunrealtype *Mdata = (sunrealtype *) Mstore->nzval; + sunrealtype *Xdata = udata->x; /* local data */ sunindextype i, nz=0; - realtype xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; + sunrealtype xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; booleantype left, right, interior; /* check that vector/matrix dimensions match up */ @@ -1068,14 +1068,14 @@ static int LaplaceMatrix(SUNMatrix L, UserData udata) sunindextype N = udata->N; sunindextype *rowptrs = Lstore->rowptr; sunindextype *colinds = Lstore->colind; - realtype *Ldata = (realtype *) Lstore->nzval; - realtype *Xdata = udata->x; - realtype du = udata->du, dv = udata->dv, dw = udata->dw; + sunrealtype *Ldata = (sunrealtype *) Lstore->nzval; + sunrealtype *Xdata = udata->x; + sunrealtype du = udata->du, dv = udata->dv, dw = udata->dw; /* set local variables */ sunindextype i, j, nz=0; - realtype xl, xc, xr; - realtype Lu[9], Lv[9], Lw[9]; + sunrealtype xl, xc, xr; + sunrealtype Lu[9], Lv[9], Lw[9]; /* initialize all local variables to zero (to avoid uninitialized variable warnings) */ xl = xc = xr = ZERO; @@ -1311,20 +1311,20 @@ static int ReactionJac(N_Vector y, SUNMatrix Jac, UserData udata) sunindextype N = udata->N; sunindextype *rowptrs = Jstore->rowptr; sunindextype *colinds = Jstore->colind; - realtype *Jdata = (realtype *) Jstore->nzval; - realtype *Xdata = udata->x; + sunrealtype *Jdata = (sunrealtype *) Jstore->nzval; + sunrealtype *Xdata = udata->x; /* set local variables */ sunindextype i, j, nz=0; - realtype ep = udata->ep; - realtype ul, uc, ur, vl, vc, vr, wl, wc, wr, xl, xc, xr; - realtype u1, u2, u3, v1, v2, v3, w1, w2, w3; - realtype df1, df2, df3, dQdf1, dQdf2, dQdf3; - realtype ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; - realtype Ju[9], Jv[9], Jw[9]; + sunrealtype ep = udata->ep; + sunrealtype ul, uc, ur, vl, vc, vr, wl, wc, wr, xl, xc, xr; + sunrealtype u1, u2, u3, v1, v2, v3, w1, w2, w3; + sunrealtype df1, df2, df3, dQdf1, dQdf2, dQdf3; + sunrealtype ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; + sunrealtype Ju[9], Jv[9], Jw[9]; /* access data arrays */ - realtype *Ydata = N_VGetArrayPointer(y); + sunrealtype *Ydata = N_VGetArrayPointer(y); if (check_retval((void *) Ydata, "N_VGetArrayPointer", 0)) return(1); /* initialize all local variables to zero (to avoid uninitialized variable warnings) */ diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index 9aae281556..d39154966d 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -85,18 +85,18 @@ struct UserData SUNContext ctx; // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -106,8 +106,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -149,10 +149,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -161,10 +161,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -173,8 +173,8 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option bool diagnostics; // output diagnostics @@ -186,7 +186,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // hypre objects HYPRE_StructGrid grid; @@ -237,7 +237,7 @@ struct UserData double accesstime; // XBraid settings - realtype x_tol; // Xbraid stopping tolerance + sunrealtype x_tol; // Xbraid stopping tolerance int x_nt; // number of fine grid time points int x_skip; // skip all work on first down cycle int x_max_levels; // max number of levels @@ -265,7 +265,7 @@ struct UserData // Functions provided to XBraid // ----------------------------------------------------------------------------- -int MyInit(braid_App app, realtype t, braid_Vector *u_ptr); +int MyInit(braid_App app, sunrealtype t, braid_Vector *u_ptr); int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); // ----------------------------------------------------------------------------- @@ -273,18 +273,18 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Jacobian-vector product function -static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, +static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -304,7 +304,7 @@ static int SetupHypre(UserData *udata); // Fill Jacobian and A = I - gamma * J static int Jac(UserData *udata); -static int ScaleAddI(UserData *udata, realtype gamma); +static int ScaleAddI(UserData *udata, sunrealtype gamma); // ----------------------------------------------------------------------------- // UserData and input functions @@ -324,10 +324,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -533,7 +533,7 @@ int main(int argc, char* argv[]) else { // Use implicit Euler (XBraid temporal refinement must be disabled) - realtype c[1], A[1], b[1]; + sunrealtype c[1], A[1], b[1]; ARKodeButcherTable B = NULL; // Create implicit Euler Butcher table @@ -616,7 +616,7 @@ int main(int argc, char* argv[]) { // Since we are using the Euclidean 2-norm in space, scale the tolerance so // it approximates to L2-norm. - realtype tolfactor; + sunrealtype tolfactor; if (udata->x_tnorm == 3) { // Infinity norm in time @@ -880,23 +880,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -964,7 +964,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Create and initialize vectors -int MyInit(braid_App app, realtype t, braid_Vector *u_ptr) +int MyInit(braid_App app, sunrealtype t, braid_Vector *u_ptr) { int flag; void *user_data; @@ -1001,7 +1001,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) int iter; // current iteration number int level; // current level int done; // has XBraid finished - realtype t; // current time + sunrealtype t; // current time void *user_data; UserData *udata; @@ -1077,7 +1077,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); fname.str(""); fname.clear(); @@ -1087,14 +1087,14 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); // Compute the error flag = SolutionError(t, y, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; // Output solution to disk - realtype *yarray = N_VGetArrayPointer(y); + sunrealtype *yarray = N_VGetArrayPointer(y); if (check_flag((void *) yarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -1105,7 +1105,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->uout << endl; // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -1128,12 +1128,12 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) flag = SolutionError(t, y, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (udata->myid_c == 0) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl << endl; } } @@ -1153,7 +1153,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -1183,15 +1183,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -1200,15 +1200,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -1248,10 +1248,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -1352,7 +1352,7 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Jacobian-vector product function -static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, +static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { int flag; @@ -1404,8 +1404,8 @@ static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; @@ -1493,8 +1493,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { int flag; @@ -1772,9 +1772,9 @@ static int Jac(UserData *udata) (ilower[1] <= iupper[1])) { // Jacobian values - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // -------------------------------- // Set matrix values for all nodes @@ -2040,7 +2040,7 @@ static int Jac(UserData *udata) } // Fill A = I - gamma * J matrix -static int ScaleAddI(UserData *udata, realtype gamma) +static int ScaleAddI(UserData *udata, sunrealtype gamma) { int flag; @@ -2169,7 +2169,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -2782,11 +2782,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -2801,7 +2801,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -2822,7 +2822,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -3013,8 +3013,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index 938562ce40..a130710d06 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -83,18 +83,18 @@ struct UserData SUNContext ctx; // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -104,8 +104,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -147,10 +147,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -159,10 +159,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -171,8 +171,8 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option bool diagnostics; // output diagnostics @@ -183,7 +183,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // Inverse of Jacobian diagonal for preconditioner N_Vector d; @@ -205,7 +205,7 @@ struct UserData double accesstime; // XBraid settings - realtype x_tol; // Xbraid stopping tolerance + sunrealtype x_tol; // Xbraid stopping tolerance int x_nt; // number of fine grid time points int x_skip; // skip all work on first down cycle int x_max_levels; // max number of levels @@ -233,7 +233,7 @@ struct UserData // Functions provided to XBraid // ----------------------------------------------------------------------------- -int MyInit(braid_App app, realtype t, braid_Vector *u_ptr); +int MyInit(braid_App app, sunrealtype t, braid_Vector *u_ptr); int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); // ----------------------------------------------------------------------------- @@ -241,14 +241,14 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -281,10 +281,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -480,7 +480,7 @@ int main(int argc, char* argv[]) else { // Use implicit Euler (XBraid temporal refinement must be disabled) - realtype c[1], A[1], b[1]; + sunrealtype c[1], A[1], b[1]; ARKodeButcherTable B = NULL; // Create implicit Euler Butcher table @@ -563,7 +563,7 @@ int main(int argc, char* argv[]) { // Since we are using the Euclidean 2-norm in space, scale the tolerance so // it approximates to L2-norm. - realtype tolfactor; + sunrealtype tolfactor; if (udata->x_tnorm == 3) { // Infinity norm in time @@ -827,23 +827,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -911,7 +911,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Create and initialize vectors -int MyInit(braid_App app, realtype t, braid_Vector *u_ptr) +int MyInit(braid_App app, sunrealtype t, braid_Vector *u_ptr) { int flag; void *user_data; @@ -948,7 +948,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) int iter; // current iteration number int level; // current level int done; // has XBraid finished - realtype t; // current time + sunrealtype t; // current time void *user_data; UserData *udata; @@ -1024,7 +1024,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); fname.str(""); fname.clear(); @@ -1034,14 +1034,14 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); // Compute the error flag = SolutionError(t, y, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; // Output solution to disk - realtype *yarray = N_VGetArrayPointer(y); + sunrealtype *yarray = N_VGetArrayPointer(y); if (check_flag((void *) yarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -1052,7 +1052,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->uout << endl; // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -1075,12 +1075,12 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) flag = SolutionError(t, y, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (udata->myid_c == 0) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl << endl; } } @@ -1100,7 +1100,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -1130,15 +1130,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -1147,15 +1147,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -1195,10 +1195,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -1299,8 +1299,8 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Start timer double t1 = MPI_Wtime(); @@ -1309,17 +1309,17 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, UserData *udata = (UserData *) user_data; // Access data array - realtype *diag = N_VGetArrayPointer(udata->d); + sunrealtype *diag = N_VGetArrayPointer(udata->d); if (check_flag((void *) diag, "N_VGetArrayPointer", 0)) return -1; // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Set all entries of d to the inverse diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE / (ONE - gamma * cc); + sunrealtype c = ONE / (ONE - gamma * cc); N_VConst(c, udata->d); // Stop timer @@ -1333,8 +1333,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { // Start timer @@ -1434,7 +1434,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -2000,11 +2000,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -2019,7 +2019,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -2040,7 +2040,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -2225,8 +2225,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 5e4a0b9104..eaff0de164 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -84,18 +84,18 @@ struct UserData SUNContext ctx; // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Number of nodes in the x and y directions sunindextype nx; @@ -105,8 +105,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // MPI variables MPI_Comm comm_w; // world communicator @@ -116,8 +116,8 @@ struct UserData int myid_w; // process ID in space and time // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option bool diagnostics; // output diagnostics @@ -128,7 +128,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // Inverse of Jacobian diagonal for preconditioner N_Vector d; @@ -149,7 +149,7 @@ struct UserData double accesstime; // XBraid settings - realtype x_tol; // Xbraid stopping tolerance + sunrealtype x_tol; // Xbraid stopping tolerance int x_nt; // number of fine grid time points int x_skip; // skip all work on first down cycle int x_max_levels; // max number of levels @@ -177,7 +177,7 @@ struct UserData // Functions provided to XBraid // ----------------------------------------------------------------------------- -int MyInit(braid_App app, realtype t, braid_Vector *u_ptr); +int MyInit(braid_App app, sunrealtype t, braid_Vector *u_ptr); int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); // ----------------------------------------------------------------------------- @@ -185,14 +185,14 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -213,10 +213,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -418,7 +418,7 @@ int main(int argc, char* argv[]) else { // Use implicit Euler (XBraid temporal refinement must be disabled) - realtype c[1], A[1], b[1]; + sunrealtype c[1], A[1], b[1]; ARKodeButcherTable B = NULL; // Create implicit Euler Butcher table @@ -501,7 +501,7 @@ int main(int argc, char* argv[]) { // Since we are using the Euclidean 2-norm in space, scale the tolerance so // it approximates to L2-norm. - realtype tolfactor; + sunrealtype tolfactor; if (udata->x_tnorm == 3) { // Infinity norm in time @@ -645,7 +645,7 @@ int main(int argc, char* argv[]) // Create and initialize vectors -int MyInit(braid_App app, realtype t, braid_Vector *u_ptr) +int MyInit(braid_App app, sunrealtype t, braid_Vector *u_ptr) { int flag; void *user_data; @@ -681,7 +681,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) int iter; // current iteration number int level; // current level int done; // has XBraid finished - realtype t; // current time + sunrealtype t; // current time void *user_data; UserData *udata; @@ -744,7 +744,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); fname.str(""); fname.clear(); @@ -753,14 +753,14 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); // Compute the error flag = SolutionError(t, y, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; // Output solution to disk - realtype *yarray = N_VGetArrayPointer(y); + sunrealtype *yarray = N_VGetArrayPointer(y); if (check_flag((void *) yarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -771,7 +771,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) udata->uout << endl; // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -794,10 +794,10 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) flag = SolutionError(t, y, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl << endl; } } @@ -816,7 +816,7 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { // Timing variables chrono::time_point t1; @@ -833,15 +833,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype ny = udata->ny; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -850,15 +850,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over domain interior and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (sunindextype j = 1; j < ny - 1; j++) { @@ -904,8 +904,8 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Timing variables chrono::time_point t1; @@ -918,17 +918,17 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, UserData *udata = (UserData *) user_data; // Access data array - realtype *diag = N_VGetArrayPointer(udata->d); + sunrealtype *diag = N_VGetArrayPointer(udata->d); if (check_flag((void *) diag, "N_VGetArrayPointer", 0)) return -1; // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Set all entries of d to the inverse diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE / (ONE - gamma * cc); + sunrealtype c = ONE / (ONE - gamma * cc); N_VConst(c, udata->d); // Stop timer @@ -942,8 +942,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { // Timing variables @@ -1315,11 +1315,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -1327,7 +1327,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, u); - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = 1; j < udata->ny - 1; j++) @@ -1348,7 +1348,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -1527,8 +1527,8 @@ static int OutputStats(void *arkode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst_a; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst_a; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step attempt = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c index bc3c434f77..5bf22f7c47 100644 --- a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c +++ b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c @@ -58,7 +58,7 @@ #include /* manyvector N_Vector types, fcts. etc */ #include /* serial N_Vector types, fcts., macros */ #include /* access to SPGMR SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -70,7 +70,7 @@ #define FSYM "f" #endif -/* realtype constant macros */ +/* sunrealtype constant macros */ #define ZERO RCONST(0.0) #define ONE RCONST(1.0) #define TWO RCONST(2.0) @@ -78,19 +78,19 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype du; /* diffusion coeff for u */ - realtype dv; /* diffusion coeff for v */ - realtype dw; /* diffusion coeff for w */ - realtype ep; /* stiffness parameter */ + sunrealtype dx; /* mesh spacing */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype du; /* diffusion coeff for u */ + sunrealtype dv; /* diffusion coeff for v */ + sunrealtype dw; /* diffusion coeff for w */ + sunrealtype ep; /* stiffness parameter */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int JacVI(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int JacVI(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp1); /* Private function to check function return values */ @@ -100,21 +100,21 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = ZERO; /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = ZERO; /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData userdata = NULL; - realtype *udata, *vdata, *wdata; + sunrealtype *udata, *vdata, *wdata; sunindextype N = 201; /* spatial mesh size */ - realtype a = RCONST(0.6); /* problem parameters */ - realtype b = RCONST(2.0); - realtype du = RCONST(0.001); - realtype dv = RCONST(0.001); - realtype dw = RCONST(0.001); - realtype ep = RCONST(1.0e-5); /* stiffness parameter */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); + sunrealtype a = RCONST(0.6); /* problem parameters */ + sunrealtype b = RCONST(2.0); + sunrealtype du = RCONST(0.001); + sunrealtype dv = RCONST(0.001); + sunrealtype dw = RCONST(0.001); + sunrealtype ep = RCONST(1.0e-5); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); sunindextype i; /* general problem variables */ @@ -126,7 +126,7 @@ int main() N_Vector uvw[3]; /* vector array composed of u,v,w component vectors */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ - realtype pi, t, dTout, tout, unorm, vnorm, wnorm; + sunrealtype pi, t, dTout, tout, unorm, vnorm, wnorm; FILE *FID, *UFID, *VFID, *WFID; int iout; long int nst, nst_a, nfe, nfi, nsetups, nli, nlcf, nJv, nfeLS, nni, ncfn, netf; @@ -326,17 +326,17 @@ int main() *-------------------------------*/ /* fe routine to compute the diffusion portion of the ODE RHS. */ -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData userdata = (UserData) user_data; /* access problem data */ sunindextype N = userdata->N; /* set variable shortcuts */ - realtype du = userdata->du; - realtype dv = userdata->dv; - realtype dw = userdata->dw; - realtype dx = userdata->dx; - realtype *y_u=NULL, *y_v=NULL, *y_w=NULL; - realtype *f_u=NULL, *f_v=NULL, *f_w=NULL; - realtype uconst, vconst, wconst; + sunrealtype du = userdata->du; + sunrealtype dv = userdata->dv; + sunrealtype dw = userdata->dw; + sunrealtype dx = userdata->dx; + sunrealtype *y_u=NULL, *y_v=NULL, *y_w=NULL; + sunrealtype *f_u=NULL, *f_v=NULL, *f_w=NULL; + sunrealtype uconst, vconst, wconst; sunindextype i; y_u = N_VGetArrayPointer(N_VGetSubvector_ManyVector(y, 0)); @@ -379,15 +379,15 @@ static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fi routine to compute the reaction portion of the ODE RHS. */ -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData userdata = (UserData) user_data; /* access problem data */ sunindextype N = userdata->N; /* set variable shortcuts */ - realtype a = userdata->a; - realtype b = userdata->b; - realtype ep = userdata->ep; - realtype *y_u=NULL, *y_v=NULL, *y_w=NULL; - realtype *f_u=NULL, *f_v=NULL, *f_w=NULL; + sunrealtype a = userdata->a; + sunrealtype b = userdata->b; + sunrealtype ep = userdata->ep; + sunrealtype *y_u=NULL, *y_v=NULL, *y_w=NULL; + sunrealtype *f_u=NULL, *f_v=NULL, *f_w=NULL; sunindextype i; y_u = N_VGetArrayPointer(N_VGetSubvector_ManyVector(y, 0)); @@ -427,15 +427,15 @@ static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian-vector product routine (implicit portion only) */ -static int JacVI(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int JacVI(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp1) { UserData userdata = (UserData) user_data; /* access problem data */ sunindextype N = userdata->N; /* set variable shortcuts */ - realtype ep = userdata->ep; - realtype *y_u=NULL, *y_v=NULL, *y_w=NULL; - realtype *v_u=NULL, *v_v=NULL, *v_w=NULL; - realtype *Ju_v=NULL, *Jv_v=NULL, *Jw_v=NULL; + sunrealtype ep = userdata->ep; + sunrealtype *y_u=NULL, *y_v=NULL, *y_w=NULL; + sunrealtype *v_u=NULL, *v_v=NULL, *v_w=NULL; + sunrealtype *Ju_v=NULL, *Jv_v=NULL, *Jw_v=NULL; sunindextype i; y_u = N_VGetArrayPointer(N_VGetSubvector_ManyVector(y, 0)); diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.c b/examples/arkode/C_openmp/ark_brusselator1D_omp.c index 2ab76f583d..789b065b71 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.c +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.c @@ -52,7 +52,7 @@ #include /* access to OpenMP N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #ifdef _OPENMP #include /* OpenMP functions */ @@ -75,25 +75,25 @@ typedef struct { sunindextype N; /* number of intervals */ int nthreads; /* number of OpenMP threads */ - realtype dx; /* mesh spacing */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype du; /* diffusion coeff for u */ - realtype dv; /* diffusion coeff for v */ - realtype dw; /* diffusion coeff for w */ - realtype ep; /* stiffness parameter */ + sunrealtype dx; /* mesh spacing */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype du; /* diffusion coeff for u */ + sunrealtype dv; /* diffusion coeff for v */ + sunrealtype dw; /* diffusion coeff for w */ + sunrealtype ep; /* stiffness parameter */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private helper functions */ -static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata); -static int ReactionJac(realtype c, N_Vector y, SUNMatrix Jac, UserData udata); +static int LaplaceMatrix(sunrealtype c, SUNMatrix Jac, UserData udata); +static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); @@ -102,21 +102,21 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - realtype a = 0.6; /* problem parameters */ - realtype b = 2.0; - realtype du = 0.025; - realtype dv = 0.025; - realtype dw = 0.025; - realtype ep = 1.0e-5; /* stiffness parameter */ - realtype reltol = 1.0e-6; /* tolerances */ - realtype abstol = 1.0e-10; + sunrealtype a = 0.6; /* problem parameters */ + sunrealtype b = 2.0; + sunrealtype du = 0.025; + sunrealtype dv = 0.025; + sunrealtype dw = 0.025; + sunrealtype ep = 1.0e-5; /* stiffness parameter */ + sunrealtype reltol = 1.0e-6; /* tolerances */ + sunrealtype abstol = 1.0e-10; sunindextype NEQ, i; /* general problem variables */ @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) SUNMatrix A = NULL; /* empty matrix for linear solver */ SUNLinearSolver LS = NULL; /* empty linear solver structure */ void *arkode_mem = NULL; /* empty ARKode memory structure */ - realtype pi, t, dTout, tout, u, v, w; + sunrealtype pi, t, dTout, tout, u, v, w; FILE *FID, *UFID, *VFID, *WFID; int iout, num_threads; long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, ncfn, netf; @@ -350,19 +350,19 @@ int main(int argc, char *argv[]) *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; - realtype dx = udata->dx; - realtype *Ydata=NULL, *dYdata=NULL; - realtype uconst, vconst, wconst, u, ul, ur, v, vl, vr, w, wl, wr; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; + sunrealtype dx = udata->dx; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype uconst, vconst, wconst, u, ul, ur, v, vl, vr, w, wl, wr; sunindextype i = 0; /* clear out ydot (to be careful) */ @@ -406,7 +406,7 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -434,14 +434,14 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, /* Routine to compute the stiffness matrix from (L*y), scaled by the factor c. We add the result into Jac and do not erase what was already there */ -static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata) +static int LaplaceMatrix(sunrealtype c, SUNMatrix Jac, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ - realtype dx = udata->dx; + sunrealtype dx = udata->dx; sunindextype i = 0; - realtype uconst = c*udata->du/dx/dx; - realtype vconst = c*udata->dv/dx/dx; - realtype wconst = c*udata->dw/dx/dx; + sunrealtype uconst = c*udata->du/dx/dx; + sunrealtype vconst = c*udata->dv/dx/dx; + sunrealtype wconst = c*udata->dw/dx/dx; /* iterate over intervals, filling in Jacobian entries */ #pragma omp parallel for default(shared) private(i) schedule(static) num_threads(udata->nthreads) @@ -466,13 +466,13 @@ static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata) /* Routine to compute the Jacobian matrix from R(y), scaled by the factor c. We add the result into Jac and do not erase what was already there */ -static int ReactionJac(realtype c, N_Vector y, SUNMatrix Jac, UserData udata) +static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ - realtype ep = udata->ep; + sunrealtype ep = udata->ep; sunindextype i = 0; - realtype u, v, w; - realtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ + sunrealtype u, v, w; + sunrealtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ if (check_flag((void *)Ydata, "N_VGetArrayPointer", 0)) return 1; /* iterate over nodes, filling in Jacobian entries */ diff --git a/examples/arkode/C_openmp/ark_heat1D_omp.c b/examples/arkode/C_openmp/ark_heat1D_omp.c index 225471029c..80fdb4835a 100644 --- a/examples/arkode/C_openmp/ark_heat1D_omp.c +++ b/examples/arkode/C_openmp/ark_heat1D_omp.c @@ -45,7 +45,7 @@ #include /* prototypes for ARKStep fcts., consts */ #include /* OpenMP N_Vector types, fcts., macros */ #include /* access to PCG SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #ifdef _OPENMP #include /* OpenMP function defs. */ @@ -65,13 +65,13 @@ typedef struct { sunindextype N; /* number of intervals */ int nthreads; /* number of OpenMP threads */ - realtype dx; /* mesh spacing */ - realtype k; /* diffusion coefficient */ + sunrealtype dx; /* mesh spacing */ + sunrealtype k; /* diffusion coefficient */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); /* Private function to check function return values */ @@ -81,15 +81,15 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ int Nt = 10; /* total number of output times */ - realtype rtol = 1.e-6; /* relative tolerance */ - realtype atol = 1.e-10; /* absolute tolerance */ + sunrealtype rtol = 1.e-6; /* relative tolerance */ + sunrealtype atol = 1.e-10; /* absolute tolerance */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - realtype k = 0.5; /* heat conductivity */ + sunrealtype k = 0.5; /* heat conductivity */ sunindextype i; /* general problem variables */ @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) { SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKStep memory structure */ FILE *FID, *UFID; - realtype t, dTout, tout; + sunrealtype t, dTout, tout; int iout, num_threads; long int nst, nst_a, nfe, nfi, nsetups, nli, nJv, nlcf, nni, ncfn, netf; @@ -247,14 +247,14 @@ int main(int argc, char *argv[]) { *--------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype k = udata->k; - realtype dx = udata->dx; - realtype *Y=NULL, *Ydot=NULL; - realtype c1, c2; + sunrealtype k = udata->k; + sunrealtype dx = udata->dx; + sunrealtype *Y=NULL, *Ydot=NULL; + sunrealtype c1, c2; sunindextype i = 0; sunindextype isource; @@ -279,15 +279,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { UserData udata = (UserData) user_data; /* variable shortcuts */ sunindextype N = udata->N; - realtype k = udata->k; - realtype dx = udata->dx; - realtype *V=NULL, *JV=NULL; - realtype c1, c2; + sunrealtype k = udata->k; + sunrealtype dx = udata->dx; + sunrealtype *V=NULL, *JV=NULL; + sunrealtype c1, c2; sunindextype i = 0; V = N_VGetArrayPointer(v); /* access data arrays */ diff --git a/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c b/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c index 3bc3571627..7114414e25 100644 --- a/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c @@ -33,7 +33,7 @@ #include #include /* prototypes for ERKStep fcts., consts */ #include /* OpenMPDEV N_Vector types, fcts., macros */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #include /* def. of SUNRsqrt, etc. */ #ifdef _OPENMP @@ -51,7 +51,7 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); @@ -60,21 +60,21 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - realtype reltol = 1.0e-6; /* tolerances */ - realtype abstol = 1.0e-10; + sunrealtype reltol = 1.0e-6; /* tolerances */ + sunrealtype abstol = 1.0e-10; /* general problem variables */ int flag; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *UFID; - realtype t, tout; + sunrealtype t, tout; long int nst, nst_a, nfe, netf; - realtype *y_data = NULL; + sunrealtype *y_data = NULL; /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -159,11 +159,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { int dev; - realtype *y_data = N_VGetDeviceArrayPointer_OpenMPDEV(y); - realtype *ydot_data = N_VGetDeviceArrayPointer_OpenMPDEV(ydot); + sunrealtype *y_data = N_VGetDeviceArrayPointer_OpenMPDEV(y); + sunrealtype *ydot_data = N_VGetDeviceArrayPointer_OpenMPDEV(ydot); dev = omp_get_default_device(); diff --git a/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c b/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c index 82b50d1a4d..f4a576efe9 100644 --- a/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c @@ -45,7 +45,7 @@ #include /* prototypes for ARKStep fcts., consts */ #include /* OpenMPDEV N_Vector types, fcts., macros */ #include /* access to PCG SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #include /* def. of SUNRsqrt, etc. */ #ifdef _OPENMP @@ -79,37 +79,37 @@ /* user data structure */ typedef struct { sunindextype N; /* current number of intervals */ - realtype *x_host; /* current mesh on host */ - realtype *x_dev; /* current mesh on device */ - realtype k; /* diffusion coefficient */ - realtype refine_tol; /* adaptivity tolerance */ + sunrealtype *x_host; /* current mesh on host */ + sunrealtype *x_dev; /* current mesh on device */ + sunrealtype k; /* diffusion coefficient */ + sunrealtype refine_tol; /* adaptivity tolerance */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); /* Private function to check function return values */ -realtype * adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata); -static int project(sunindextype Nold, realtype *xold, N_Vector yold, - sunindextype Nnew, realtype *xnew, N_Vector ynew); +sunrealtype * adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata); +static int project(sunindextype Nold, sunrealtype *xold, N_Vector yold, + sunindextype Nnew, sunrealtype *xnew, N_Vector ynew); static int check_flag(void *flagvalue, const char *funcname, int opt); /* Main Program */ int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ - realtype rtol = RCONST(1.e-3); /* relative tolerance */ - realtype atol = RCONST(1.e-10); /* absolute tolerance */ - realtype hscale = RCONST(1.0); /* time step change factor on resizes */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ + sunrealtype rtol = RCONST(1.e-3); /* relative tolerance */ + sunrealtype atol = RCONST(1.e-10); /* absolute tolerance */ + sunrealtype hscale = RCONST(1.0); /* time step change factor on resizes */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 21; /* initial spatial mesh size */ - realtype refine = RCONST(3.0e-3); /* adaptivity refinement tolerance */ - realtype k = RCONST(0.5); /* heat conductivity */ + sunrealtype refine = RCONST(3.0e-3); /* adaptivity refinement tolerance */ + sunrealtype k = RCONST(0.5); /* heat conductivity */ sunindextype i; long int nni, nni_tot=0, nli, nli_tot=0; int iout=0; @@ -122,9 +122,9 @@ int main() { SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *XFID, *UFID; - realtype t, olddt, newdt; - realtype *xnew_host = NULL; - realtype *xnew_dev = NULL; + sunrealtype t, olddt, newdt; + sunrealtype *xnew_host = NULL; + sunrealtype *xnew_dev = NULL; sunindextype Nnew; int dev, host; @@ -142,10 +142,10 @@ int main() { udata->N = N; udata->k = k; udata->refine_tol = refine; - udata->x_host = malloc(N * sizeof(realtype)); + udata->x_host = malloc(N * sizeof(sunrealtype)); for (i=0; ix_host[i] = ONE*i/(N-1); - udata->x_dev = omp_target_alloc(N * sizeof(realtype), dev); - omp_target_memcpy(udata->x_dev, udata->x_host, N * sizeof(realtype), 0, 0, dev, host); + udata->x_dev = omp_target_alloc(N * sizeof(sunrealtype), dev); + omp_target_memcpy(udata->x_dev, udata->x_host, N * sizeof(sunrealtype), 0, 0, dev, host); /* Initial problem output */ printf("\n1D adaptive Heat PDE test problem:\n"); @@ -260,8 +260,8 @@ int main() { if (check_flag((void *) y2, "N_VNew_OpenMPDEV", 0)) return 1; /* copy new mesh from host array to device array */ - xnew_dev = omp_target_alloc(Nnew * sizeof(realtype), dev); - omp_target_memcpy(xnew_dev, xnew_host, Nnew*sizeof(realtype), 0, 0, dev, host); + xnew_dev = omp_target_alloc(Nnew * sizeof(sunrealtype), dev); + omp_target_memcpy(xnew_dev, xnew_host, Nnew*sizeof(sunrealtype), 0, 0, dev, host); /* project solution onto new mesh */ flag = project(udata->N, udata->x_dev, y, Nnew, xnew_dev, y2); @@ -325,14 +325,14 @@ int main() { *--------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype k = udata->k; - realtype *x = udata->x_dev; - realtype *Y=NULL, *Ydot=NULL; - realtype dxL, dxR; + sunrealtype k = udata->k; + sunrealtype *x = udata->x_dev; + sunrealtype *Y=NULL, *Ydot=NULL; + sunrealtype dxL, dxR; sunindextype i; int dev; @@ -366,15 +366,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { UserData udata = (UserData) user_data; /* variable shortcuts */ sunindextype N = udata->N; - realtype k = udata->k; - realtype *x = udata->x_dev; - realtype *V=NULL, *JV=NULL; - realtype dxL, dxR; + sunrealtype k = udata->k; + sunrealtype *x = udata->x_dev; + sunrealtype *V=NULL, *JV=NULL; + sunrealtype dxL, dxR; sunindextype i; int dev; @@ -415,11 +415,11 @@ static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, Nnew [output] -- the size of the new mesh udata [input] -- the current system information The return for this function is a pointer to the new mesh. */ -realtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) +sunrealtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) { sunindextype i, j; int *marks=NULL; - realtype ydd, *xold=NULL, *Y=NULL, *xnew=NULL; + sunrealtype ydd, *xold=NULL, *Y=NULL, *xnew=NULL; sunindextype num_refine, N_new; /* Access current solution and mesh arrays */ @@ -452,7 +452,7 @@ realtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) if (marks[i] == 1) num_refine++; N_new = udata->N + num_refine; *Nnew = N_new; /* Store new array length */ - xnew = malloc((N_new) * sizeof(realtype)); + xnew = malloc((N_new) * sizeof(sunrealtype)); /* fill new mesh */ @@ -497,11 +497,11 @@ realtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) xnew [input] -- the new mesh ynew [output] -- the vector defined over the new mesh (allocated prior to calling project) */ -static int project(sunindextype Nold, realtype *xold, N_Vector yold, - sunindextype Nnew, realtype *xnew, N_Vector ynew) +static int project(sunindextype Nold, sunrealtype *xold, N_Vector yold, + sunindextype Nnew, sunrealtype *xnew, N_Vector ynew) { sunindextype iv, i, j; - realtype *Yold=NULL, *Ynew=NULL; + sunrealtype *Yold=NULL, *Ynew=NULL; int dev = omp_get_default_device(); diff --git a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c index 54abdb2318..5e1e71a3da 100644 --- a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c @@ -45,7 +45,7 @@ #include /* prototypes for ARKStep fcts., consts. */ #include /* OpenMPDEV N_Vector types, fcts., macros */ #include /* access to PCG SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #include /* def. of SUNRsqrt, etc. */ #ifdef _OPENMP @@ -65,13 +65,13 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype k; /* diffusion coefficient */ + sunrealtype dx; /* mesh spacing */ + sunrealtype k; /* diffusion coefficient */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); /* Private function to check function return values */ @@ -81,15 +81,15 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ int Nt = 10; /* total number of output times */ - realtype rtol = 1.e-6; /* relative tolerance */ - realtype atol = 1.e-10; /* absolute tolerance */ + sunrealtype rtol = 1.e-6; /* relative tolerance */ + sunrealtype atol = 1.e-10; /* absolute tolerance */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - realtype k = 0.5; /* heat conductivity */ + sunrealtype k = 0.5; /* heat conductivity */ sunindextype i; /* general problem variables */ @@ -98,7 +98,7 @@ int main() { SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKStep memory structure */ FILE *FID, *UFID; - realtype t, dTout, tout; + sunrealtype t, dTout, tout; int iout; long int nst, nst_a, nfe, nfi, nsetups, nli, nJv, nlcf, nni, ncfn, netf; @@ -245,14 +245,14 @@ int main() { *--------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype k = udata->k; - realtype dx = udata->dx; - realtype *Y=NULL, *Ydot=NULL; - realtype c1, c2; + sunrealtype k = udata->k; + sunrealtype dx = udata->dx; + sunrealtype *Y=NULL, *Ydot=NULL; + sunrealtype c1, c2; sunindextype i, isource; int dev; @@ -283,15 +283,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { UserData udata = (UserData) user_data; /* variable shortcuts */ sunindextype N = udata->N; - realtype k = udata->k; - realtype dx = udata->dx; - realtype *V=NULL, *JV=NULL; - realtype c1, c2; + sunrealtype k = udata->k; + sunrealtype dx = udata->dx; + sunrealtype *V=NULL, *JV=NULL; + sunrealtype c1, c2; sunindextype i; int dev; diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c index 7c8bba1278..465a6009ad 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c @@ -114,8 +114,8 @@ contains problem constants, extended dependent variable array, grid constants, processor indices, MPI communicator */ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmxsub2, Nlocal; MPI_Comm comm; @@ -128,27 +128,27 @@ static void SetInitialProfiles(N_Vector u, UserData data); static void PrintIntro(int npes, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep); static void PrintOutput(void *arkode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *arkode_mem); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uarray[]); + sunrealtype uarray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]); -static void fucomm(realtype t, N_Vector u, void *user_data); + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]); +static void fucomm(sunrealtype t, N_Vector u, void *user_data); /* Prototype of function called by the solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Prototype of functions called by the ARKBBDPRE module */ -static int flocal(sunindextype Nlocal, realtype t, N_Vector u, +static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) UserData data; SUNLinearSolver LS; void *arkode_mem; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; int iout, my_pe, npes, flag, jpre; sunindextype neq, local_N, mudq, mldq, mukeep, mlkeep; @@ -312,8 +312,8 @@ static void InitUserData(int my_pe, sunindextype local_N, MPI_Comm comm, /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -338,8 +338,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) int isubx, isuby; int lx, ly, jx, jy; sunindextype offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *uarray; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *uarray; /* Set pointer to data array in vector u */ uarray = N_VGetArrayPointer(u); @@ -387,12 +387,12 @@ static void PrintIntro(int npes, sunindextype mudq, sunindextype mldq, /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *arkode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int flag, npelast; sunindextype i0, i1; long int nst; - realtype hu, *uarray, tempu[2]; + sunrealtype hu, *uarray, tempu[2]; MPI_Status status; npelast = NPEX*NPEY - 1; @@ -499,11 +499,11 @@ static void PrintFinalStats(void *arkode_mem) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uarray[]) + sunrealtype uarray[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -540,18 +540,18 @@ static void BSend(MPI_Comm comm, /* Routine to start receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -580,18 +580,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], /* Routine to finish receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -633,10 +633,10 @@ static void BRecvWait(MPI_Request request[], /* fucomm routine. This routine performs all inter-processor communication of data in u needed to calculate f. */ -static void fucomm(realtype t, N_Vector u, void *user_data) +static void fucomm(sunrealtype t, N_Vector u, void *user_data) { UserData data; - realtype *uarray, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *uarray, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -666,7 +666,7 @@ static void fucomm(realtype t, N_Vector u, void *user_data) /* f routine. Evaluate f(t,y). First call fucomm to do communication of subgrid boundary data into uext. Then calculate f by a call to flocal. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { UserData data; @@ -686,19 +686,19 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* flocal routine. Compute f(t,y). This routine assumes that all inter-processor communication of data needed to calculate f has already been done, and this data is in the work array uext. */ -static int flocal(sunindextype Nlocal, realtype t, N_Vector u, +static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy; int isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; UserData data; - realtype *uarray, *duarray; + sunrealtype *uarray, *duarray; uarray = N_VGetArrayPointer(u); duarray = N_VGetArrayPointer(udot); diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index 1946966c76..c58ecb228d 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -113,7 +113,7 @@ IJth is defined in order to write code which indexes into dense matrices with a (row,column) pair, where 1 <= row,column <= NVARS. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NVARS. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -125,14 +125,14 @@ for the preconditiner */ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; int nvmxsub, nvmxsub2; MPI_Comm comm; /* For preconditioner */ - realtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; + sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; } *UserData; @@ -142,33 +142,33 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector u, UserData data); static void PrintOutput(void *arkode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *arkode_mem); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype udata[]); + sunrealtype udata[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]); -static void ucomm(realtype t, N_Vector u, UserData data); -static void fcalc(realtype t, realtype udata[], realtype dudata[], + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]); +static void ucomm(sunrealtype t, N_Vector u, UserData data); +static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *user_data); + sunrealtype gamma, void *user_data); +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt, int id); @@ -177,7 +177,7 @@ static int check_flag(void *flagvalue, const char *funcname, int opt, int id); /***************************** Main Program ******************************/ int main(int argc, char *argv[]) { - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -297,8 +297,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -346,8 +346,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) { int isubx, isuby, lx, ly, jx, jy; sunindextype offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *udata; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *udata; /* Set pointer to data array in vector u */ udata = N_VGetArrayPointer(u); @@ -381,10 +381,10 @@ static void SetInitialProfiles(N_Vector u, UserData data) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *arkode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int flag; - realtype hu, *udata, tempu[2]; + sunrealtype hu, *udata, tempu[2]; int npelast; sunindextype i0, i1; long int nst; @@ -485,11 +485,11 @@ static void PrintFinalStats(void *arkode_mem) /* Routine to send boundary data to neighboring PEs */ static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, - sunindextype dsizey, realtype udata[]) + sunindextype dsizey, sunrealtype udata[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -526,7 +526,7 @@ static void BSend(MPI_Comm comm, int my_pe, int isubx, /* Routine to start receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ @@ -534,11 +534,11 @@ static void BSend(MPI_Comm comm, int my_pe, int isubx, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -567,19 +567,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], /* Routine to finish receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -622,10 +622,10 @@ static void BRecvWait(MPI_Request request[], /* ucomm routine. This routine performs all communication between processors of data needed to calculate f. */ -static void ucomm(realtype t, N_Vector u, UserData data) +static void ucomm(sunrealtype t, N_Vector u, UserData data) { - realtype *udata, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *udata, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -655,14 +655,14 @@ static void ucomm(realtype t, N_Vector u, UserData data) between processors of data needed to calculate f has already been done, and this data is in the work array uext. */ -static void fcalc(realtype t, realtype udata[], - realtype dudata[], UserData data) +static void fcalc(sunrealtype t, sunrealtype udata[], + sunrealtype dudata[], UserData data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy; int isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; @@ -787,9 +787,9 @@ static void fcalc(realtype t, realtype udata[], /* f routine. Evaluate f(t,y). First call ucomm to do communication of subgrid boundary data into uext. Then calculate f by a call to fcalc. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *udata, *dudata; + sunrealtype *udata, *dudata; UserData data; udata = N_VGetArrayPointer(u); @@ -807,17 +807,17 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data) + sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; int nvmxsub, offset; sunindextype ier; sunindextype *(*pivot)[MYSUB]; int lx, ly, jy, isuby; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; /* Make local copies of pointers in user_data, pointer to u's data, @@ -896,16 +896,16 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MYSUB]; + sunrealtype **(*P)[MYSUB]; int nvmxsub; sunindextype *(*pivot)[MYSUB]; int lx, ly; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data */ diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c index 1241dc161c..986289fe8a 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c @@ -60,7 +60,7 @@ #include /* declaration of N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* prototypes for small dense fcts. */ -#include /* definitions of realtype, booleantype */ +#include /* definitions of sunrealtype, booleantype */ #include /* definition of macros SUNSQR and EXP */ #include /* MPI constants and types */ @@ -113,7 +113,7 @@ IJth is defined in order to write code which indexes into dense matrices with a (row,column) pair, where 1 <= row,column <= NVARS. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NVARS. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -125,14 +125,14 @@ for the preconditiner */ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; int nvmxsub, nvmxsub2; MPI_Comm comm; /* For preconditioner */ - realtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; + sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; } *UserData; @@ -144,33 +144,33 @@ static void SetInitialProfiles(HYPRE_IJVector Uij, UserData data, sunindextype local_length, sunindextype my_base); static void PrintOutput(void *arkode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *arkode_mem); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype udata[]); + sunrealtype udata[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]); -static void ucomm(realtype t, N_Vector u, UserData data); -static void fcalc(realtype t, realtype udata[], realtype dudata[], + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]); +static void ucomm(sunrealtype t, N_Vector u, UserData data); +static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, + sunrealtype gamma, void *user_data); +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* Private function to check function return values */ @@ -181,7 +181,7 @@ static int check_flag(void *flagvalue, const char *funcname, int opt, int id); int main(int argc, char *argv[]) { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -309,8 +309,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SUNSQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SUNSQR(data->dy))*KV0; @@ -360,12 +360,12 @@ static void SetInitialProfiles(HYPRE_IJVector Uij, UserData data, { int isubx, isuby, lx, ly, jx, jy; sunindextype offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *udata; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *udata; HYPRE_Int *iglobal; /* Set pointer to data array in vector u */ - udata = (realtype*) malloc(local_length*sizeof(realtype)); + udata = (sunrealtype*) malloc(local_length*sizeof(sunrealtype)); iglobal = (HYPRE_Int*) malloc(local_length*sizeof(HYPRE_Int)); @@ -402,10 +402,10 @@ static void SetInitialProfiles(HYPRE_IJVector Uij, UserData data, /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *arkode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int flag; - realtype hu, *udata, tempu[2]; + sunrealtype hu, *udata, tempu[2]; int npelast; sunindextype i0, i1; long int nst; @@ -509,11 +509,11 @@ static void PrintFinalStats(void *arkode_mem) /* Routine to send boundary data to neighboring PEs */ static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, - sunindextype dsizey, realtype udata[]) + sunindextype dsizey, sunrealtype udata[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -550,7 +550,7 @@ static void BSend(MPI_Comm comm, int my_pe, int isubx, /* Routine to start receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ @@ -558,11 +558,11 @@ static void BSend(MPI_Comm comm, int my_pe, int isubx, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -591,19 +591,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], /* Routine to finish receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -646,10 +646,10 @@ static void BRecvWait(MPI_Request request[], /* ucomm routine. This routine performs all communication between processors of data needed to calculate f. */ -static void ucomm(realtype t, N_Vector u, UserData data) +static void ucomm(sunrealtype t, N_Vector u, UserData data) { - realtype *udata, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *udata, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -681,14 +681,14 @@ static void ucomm(realtype t, N_Vector u, UserData data) between processors of data needed to calculate f has already been done, and this data is in the work array uext. */ -static void fcalc(realtype t, realtype udata[], - realtype dudata[], UserData data) +static void fcalc(sunrealtype t, sunrealtype udata[], + sunrealtype dudata[], UserData data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy; int isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; @@ -813,9 +813,9 @@ static void fcalc(realtype t, realtype udata[], /* f routine. Evaluate f(t,y). First call ucomm to do communication of subgrid boundary data into uext. Then calculate f by a call to fcalc. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *udata, *udotdata; + sunrealtype *udata, *udotdata; UserData data; HYPRE_ParVector uhyp; HYPRE_ParVector udothyp; @@ -842,16 +842,16 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data) + sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; int nvmxsub, ier, offset; sunindextype *(*pivot)[MYSUB]; int lx, ly, jy, isuby; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; HYPRE_ParVector uhyp; UserData data; @@ -933,16 +933,16 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MYSUB]; + sunrealtype **(*P)[MYSUB]; int nvmxsub; sunindextype *(*pivot)[MYSUB]; int lx, ly; - realtype *zdata, *v; + sunrealtype *zdata, *v; HYPRE_ParVector zhyp; UserData data; diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index e6041f6f7e..fb71dd39fd 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -103,7 +103,7 @@ #include /* access to SPGMR SUNLinearSolver */ #include /* serial N_Vector types, fct. and macros */ #include /* use generic DENSE solver in preconditioning */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -149,8 +149,8 @@ #define MXNS (MX*NS) #define AX ONE #define AY ONE -#define DX (AX/(realtype)(MX-1)) -#define DY (AY/(realtype)(MY-1)) +#define DX (AX/(sunrealtype)(MX-1)) +#define DY (AY/(sunrealtype)(MY-1)) #define MP NS #define MQ (MX*MY) #define MXMP (MX*MP) @@ -185,15 +185,15 @@ /* Structure for user data */ typedef struct { - realtype **P[NGRP]; + sunrealtype **P[NGRP]; sunindextype *pivot[NGRP]; int ns, mxns; int mp, mq, mx, my, ngrp, ngx, ngy, mxmp; int jgx[NGX+1], jgy[NGY+1], jigx[MX], jigy[MY]; int jxr[NGX], jyr[NGY]; - realtype acoef[NS][NS], bcoef[NS], diff[NS]; - realtype cox[NS], coy[NS], dx, dy, srur; - realtype fsave[NEQ]; + sunrealtype acoef[NS][NS], bcoef[NS], diff[NS]; + sunrealtype cox[NS], coy[NS], dx, dy, srur; + sunrealtype fsave[NEQ]; N_Vector tmp; N_Vector rewt; void *arkode_mem; @@ -207,33 +207,33 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]); static void CInit(N_Vector c, WebData wdata); static void PrintIntro(void); static void PrintHeader(int jpre, int gstype); -static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t); -static void PrintOutput(void *arkode_mem, realtype t); +static void PrintAllSpecies(N_Vector c, int ns, int mxns, sunrealtype t); +static void PrintOutput(void *arkode_mem, sunrealtype t); static void PrintFinalStats(void *arkode_mem); static void FreeUserData(WebData wdata); -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata); -static void fblock (realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata); -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata); +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata); +static void fblock (sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata); +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata); /* Small Vector Kernels */ -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_sum_prods(realtype u[], realtype p[], realtype q[], realtype v[], - realtype w[], int n); -static void v_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_zero(realtype u[], int n); +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], sunrealtype v[], + sunrealtype w[], int n); +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_zero(sunrealtype u[], int n); /* Functions Called By The Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(realtype tn, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data); +static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* Private function to check function return values */ @@ -243,7 +243,7 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main(int argc, char* argv[]) { - realtype abstol=ATOL, reltol=RTOL, t, tout; + sunrealtype abstol=ATOL, reltol=RTOL, t, tout; N_Vector c = NULL; WebData wdata = NULL; SUNLinearSolver LS = NULL; @@ -252,7 +252,7 @@ int main(int argc, char* argv[]) int jpre, gstype, flag; int ns, mxns, iout; int nrmfactor = 0; /* LS norm conversion factor flag */ - realtype nrmfac; /* LS norm conversion factor */ + sunrealtype nrmfac; /* LS norm conversion factor */ /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -323,7 +323,7 @@ int main(int argc, char* argv[]) case(1): /* use the square root of the vector length */ - nrmfac = SQRT((realtype)NEQ); + nrmfac = SQRT((sunrealtype)NEQ); break; case(2): /* compute with dot product */ @@ -399,8 +399,8 @@ static WebData AllocUserData(SUNContext ctx) static void InitUserData(WebData wdata) { int i, j, ns; - realtype *bcoef, *diff, *cox, *coy, dx, dy; - realtype (*acoef)[NS]; + sunrealtype *bcoef, *diff, *cox, *coy, dx, dy; + sunrealtype (*acoef)[NS]; acoef = wdata->acoef; bcoef = wdata->bcoef; @@ -480,7 +480,7 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]) static void CInit(N_Vector c, WebData wdata) { int jx, jy, ns, mxns, ioff, iyoff, i, ici; - realtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; + sunrealtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; cdata = N_VGetArrayPointer(c); ns = wdata->ns; @@ -569,10 +569,10 @@ static void PrintHeader(int jpre, int gstype) printf("\nGram-Schmidt method type is gstype = %s\n\n\n", "SUN_CLASSICAL_GS"); } -static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t) +static void PrintAllSpecies(N_Vector c, int ns, int mxns, sunrealtype t) { int i, jx ,jy; - realtype *cdata; + sunrealtype *cdata; cdata = N_VGetArrayPointer(c); #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -600,11 +600,11 @@ static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t) } } -static void PrintOutput(void *arkode_mem, realtype t) +static void PrintOutput(void *arkode_mem, sunrealtype t) { long int nst, nfe, nfi, nni; int flag; - realtype hu; + sunrealtype hu; flag = ARKStepGetNumSteps(arkode_mem, &nst); check_flag(&flag, "ARKStepGetNumSteps", 1); @@ -634,7 +634,7 @@ static void PrintFinalStats(void *arkode_mem) long int nst, nfe, nfi, nsetups, nni, ncfn, netf; long int nli, npe, nps, ncfl, nfeLS; int flag; - realtype avdim; + sunrealtype avdim; flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); check_flag(&flag, "ARKStepGetWorkSpace", 1); @@ -682,7 +682,7 @@ static void PrintFinalStats(void *arkode_mem) printf(" Number of error test failures = %4ld \n", netf); printf(" Number of nonlinear conv. failures = %4ld \n", ncfn); printf(" Number of linear convergence failures = %4ld \n", ncfl); - avdim = (nni > 0) ? ((realtype)nli)/((realtype)nni) : ZERO; + avdim = (nni > 0) ? ((sunrealtype)nli)/((sunrealtype)nni) : ZERO; #if defined(SUNDIALS_EXTENDED_PRECISION) printf(" Average Krylov subspace dimension = %.3Lf \n", avdim); #else @@ -713,11 +713,11 @@ static void FreeUserData(WebData wdata) returns it in cdot. The interaction rates are computed by calls to WebRates, and these are saved in fsave for use in preconditioning. */ -static int f(realtype t, N_Vector c, N_Vector cdot,void *user_data) +static int f(sunrealtype t, N_Vector c, N_Vector cdot,void *user_data) { int i, ic, ici, idxl, idxu, jx, ns, mxns, iyoff, jy, idyu, idyl; - realtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; - realtype *cdata, *cdotdata; + sunrealtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; + sunrealtype *cdata, *cdotdata; WebData wdata; wdata = (WebData) user_data; @@ -768,12 +768,12 @@ static int f(realtype t, N_Vector c, N_Vector cdot,void *user_data) c_1, ... ,c_ns (stored in c[0],...,c[ns-1]), at one spatial point and at time t. */ -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata) +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata) { int i, j, ns; - realtype fac, *bcoef; - realtype (*acoef)[NS]; + sunrealtype fac, *bcoef; + sunrealtype (*acoef)[NS]; ns = wdata->ns; acoef = wdata->acoef; @@ -804,16 +804,16 @@ static void WebRates(realtype x, realtype y, realtype t, realtype c[], of a block-diagonal preconditioner. The blocks are of size mp, and there are ngrp=ngx*ngy blocks computed in the block-grouping scheme. */ -static int Precond(realtype t, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype ier; sunindextype **pivot; int i, if0, if00, ig, igx, igy, j, jj, jx, jy; int *jxr, *jyr, ngrp, ngx, ngy, mxmp, mp, flag; - realtype uround, fac, r, r0, save, srur; - realtype *f1, *fsave, *cdata, *rewtdata; + sunrealtype uround, fac, r, r0, save, srur; + sunrealtype *f1, *fsave, *cdata, *rewtdata; WebData wdata; void *arkode_mem; N_Vector rewt; @@ -891,11 +891,11 @@ static int Precond(realtype t, N_Vector c, N_Vector fc, booleantype jok, system, namely block (jx,jy), for use in preconditioning. Here jx and jy count from 0. */ -static void fblock(realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata) +static void fblock(sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata) { int iblok, ic; - realtype x, y; + sunrealtype x, y; iblok = jx + jy*(wdata->mx); y = jy*(wdata->dy); @@ -914,10 +914,10 @@ static void fblock(realtype t, realtype cdata[], int jx, int jy, Then it computes ((I - gamma*Jr)-inverse)*z, using LU factors of the blocks in P, and pivot information in pivot, and returns the result in z. */ -static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data) +static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int jx, jy, igx, igy, iv, ig, *jigx, *jigy, mx, my, ngx, mp; WebData wdata; @@ -964,12 +964,12 @@ static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, Some inner loops of length ns are implemented with the small vector kernels v_sum_prods, v_prod, v_inc_by_prod. */ -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) { int jx, jy, mx, my, x_loc, y_loc; int ns, mxns, i, iyoff, ic, iter; - realtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; - realtype temp, *cox, *coy, *xd, *zd; + sunrealtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; + sunrealtype temp, *cox, *coy, *xd, *zd; xd = N_VGetArrayPointer(x); zd = N_VGetArrayPointer(z); @@ -1135,26 +1135,26 @@ static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) } } -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] += v[i]*w[i]; } -static void v_sum_prods(realtype u[], realtype p[], realtype q[], - realtype v[], realtype w[], int n) +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], + sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = p[i]*q[i] + v[i]*w[i]; } -static void v_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = v[i]*w[i]; } -static void v_zero(realtype u[], int n) +static void v_zero(sunrealtype u[], int n) { int i; for (i=0; i < n; i++) u[i] = ZERO; diff --git a/examples/arkode/C_serial/ark_analytic.c b/examples/arkode/C_serial/ark_analytic.c index 3b1766d492..8ee87a548a 100644 --- a/examples/arkode/C_serial/ark_analytic.c +++ b/examples/arkode/C_serial/ark_analytic.c @@ -37,7 +37,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -50,27 +50,27 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Main Program */ int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); - realtype lamda = RCONST(-100.0); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); + sunrealtype lamda = RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int flag; /* reusable error-checking flag */ @@ -79,7 +79,7 @@ int main() SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *UFID; - realtype t, tout; + sunrealtype t, tout; long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, ncfn, netf; /* Create the SUNDIALS context object for this simulation */ @@ -205,11 +205,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype u = NV_Ith_S(y,0); /* access current solution value */ + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ NV_Ith_S(ydot,0) = lamda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lamda*atan(t); @@ -218,12 +218,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype *Jdata = SUNDenseMatrix_Data(J); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype *Jdata = SUNDenseMatrix_Data(J); /* Fill in Jacobian of f: set the first entry of the data array to set the (0,0) entry */ Jdata[0] = lamda; @@ -271,10 +271,10 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) } /* check the computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ - realtype ans, err, ewt; /* answer data, error, and error weight */ + sunrealtype ans, err, ewt; /* answer data, error, and error weight */ /* compute solution error */ ans = atan(t); diff --git a/examples/arkode/C_serial/ark_analytic_mels.c b/examples/arkode/C_serial/ark_analytic_mels.c index f1758db3ef..ba0b5304ec 100644 --- a/examples/arkode/C_serial/ark_analytic_mels.c +++ b/examples/arkode/C_serial/ark_analytic_mels.c @@ -34,7 +34,7 @@ #include #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -47,39 +47,39 @@ #endif /* User-supplied functions called by ARKStep */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Custom linear solver data structure, accessor macros, and routines */ static SUNLinearSolver MatrixEmbeddedLS(void *arkode_mem, SUNContext ctx); static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S); static int MatrixEmbeddedLSSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol); + N_Vector b, sunrealtype tol); static int MatrixEmbeddedLSFree(SUNLinearSolver S); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Main Program */ int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); - realtype lamda = RCONST(-100.0); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); + sunrealtype lamda = RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKODE memory structure */ - realtype t, tout; + sunrealtype t, tout; long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, ncfn, netf; /* Create the SUNDIALS context object for this simulation */ @@ -189,11 +189,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype u = NV_Ith_S(y,0); /* access current solution value */ + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ NV_Ith_S(ydot,0) = lamda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lamda*atan(t); @@ -232,15 +232,15 @@ static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S) /* linear solve routine */ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { /* temporary variables */ int retval; N_Vector z, zpred, Fi, sdata; - realtype tcur, gamma; + sunrealtype tcur, gamma; void *user_data; - realtype *rdata; - realtype lamda; + sunrealtype *rdata; + sunrealtype lamda; /* retrieve implicit system data from ARKStep */ retval = ARKStepGetNonlinearSystemData(LS->content, &tcur, &zpred, &z, &Fi, @@ -249,7 +249,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, return(-1); /* extract stiffness parameter from user_data */ - rdata = (realtype *) user_data; + rdata = (sunrealtype *) user_data; lamda = rdata[0]; /* perform linear solve: (1-gamma*lamda)*x = b */ @@ -308,10 +308,10 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) } /* check the computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ - realtype ans, err, ewt; /* answer data, error, and error weight */ + sunrealtype ans, err, ewt; /* answer data, error, and error weight */ /* compute solution error */ ans = atan(t); diff --git a/examples/arkode/C_serial/ark_analytic_nonlin.c b/examples/arkode/C_serial/ark_analytic_nonlin.c index e6d6cde481..f55d2079bc 100644 --- a/examples/arkode/C_serial/ark_analytic_nonlin.c +++ b/examples/arkode/C_serial/ark_analytic_nonlin.c @@ -30,7 +30,7 @@ #include #include /* prototypes for ERKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #include /* def. of SUNRsqrt, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -44,7 +44,7 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); @@ -53,19 +53,19 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - realtype reltol = 1.0e-6; /* tolerances */ - realtype abstol = 1.0e-10; + sunrealtype reltol = 1.0e-6; /* tolerances */ + sunrealtype abstol = 1.0e-10; /* general problem variables */ int flag; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *UFID, *FID; - realtype t, tout; + sunrealtype t, tout; /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -144,7 +144,7 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { NV_Ith_S(ydot,0) = (t+1.0)*SUNRexp(-NV_Ith_S(y,0)); return 0; diff --git a/examples/arkode/C_serial/ark_brusselator.c b/examples/arkode/C_serial/ark_brusselator.c index b0b69028fb..c24db60087 100644 --- a/examples/arkode/C_serial/ark_brusselator.c +++ b/examples/arkode/C_serial/ark_brusselator.c @@ -60,7 +60,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -73,8 +73,8 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ @@ -84,15 +84,15 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ int test = 2; /* test problem to run */ - realtype reltol = 1.0e-6; /* tolerances */ - realtype abstol = 1.0e-10; - realtype a, b, ep, u0, v0, w0; + sunrealtype reltol = 1.0e-6; /* tolerances */ + sunrealtype abstol = 1.0e-10; + sunrealtype a, b, ep, u0, v0, w0; /* general problem variables */ int flag; /* reusable error-checking flag */ @@ -100,9 +100,9 @@ int main() SUNMatrix A = NULL; /* empty matrix for solver */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ - realtype rdata[3]; + sunrealtype rdata[3]; FILE *UFID; - realtype t, tout; + sunrealtype t, tout; int iout; long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, nnf, ncfn, netf; @@ -264,15 +264,15 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype a = rdata[0]; /* access data entries */ - realtype b = rdata[1]; - realtype ep = rdata[2]; - realtype u = NV_Ith_S(y,0); /* access solution values */ - realtype v = NV_Ith_S(y,1); - realtype w = NV_Ith_S(y,2); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype a = rdata[0]; /* access data entries */ + sunrealtype b = rdata[1]; + sunrealtype ep = rdata[2]; + sunrealtype u = NV_Ith_S(y,0); /* access solution values */ + sunrealtype v = NV_Ith_S(y,1); + sunrealtype w = NV_Ith_S(y,2); /* fill in the RHS function */ NV_Ith_S(ydot,0) = a - (w+1.0)*u + v*u*u; @@ -283,14 +283,14 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype ep = rdata[2]; /* access data entries */ - realtype u = NV_Ith_S(y,0); /* access solution values */ - realtype v = NV_Ith_S(y,1); - realtype w = NV_Ith_S(y,2); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype ep = rdata[2]; /* access data entries */ + sunrealtype u = NV_Ith_S(y,0); /* access solution values */ + sunrealtype v = NV_Ith_S(y,1); + sunrealtype w = NV_Ith_S(y,2); /* fill in the Jacobian via SUNDenseMatrix macro, SM_ELEMENT_D (see sunmatrix_dense.h) */ SM_ELEMENT_D(J,0,0) = -(w+1.0) + 2.0*u*v; diff --git a/examples/arkode/C_serial/ark_brusselator1D.c b/examples/arkode/C_serial/ark_brusselator1D.c index 86d157e802..2a91891d61 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.c +++ b/examples/arkode/C_serial/ark_brusselator1D.c @@ -50,7 +50,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -68,23 +68,23 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype du; /* diffusion coeff for u */ - realtype dv; /* diffusion coeff for v */ - realtype dw; /* diffusion coeff for w */ - realtype ep; /* stiffness parameter */ + sunrealtype dx; /* mesh spacing */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype du; /* diffusion coeff for u */ + sunrealtype dv; /* diffusion coeff for v */ + sunrealtype dw; /* diffusion coeff for w */ + sunrealtype ep; /* stiffness parameter */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private helper functions */ -static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata); -static int ReactionJac(realtype c, N_Vector y, SUNMatrix Jac, UserData udata); +static int LaplaceMatrix(sunrealtype c, SUNMatrix Jac, UserData udata); +static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); @@ -93,21 +93,21 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - realtype a = 0.6; /* problem parameters */ - realtype b = 2.0; - realtype du = 0.025; - realtype dv = 0.025; - realtype dw = 0.025; - realtype ep = 1.0e-5; /* stiffness parameter */ - realtype reltol = 1.0e-6; /* tolerances */ - realtype abstol = 1.0e-10; + sunrealtype a = 0.6; /* problem parameters */ + sunrealtype b = 2.0; + sunrealtype du = 0.025; + sunrealtype dv = 0.025; + sunrealtype dw = 0.025; + sunrealtype ep = 1.0e-5; /* stiffness parameter */ + sunrealtype reltol = 1.0e-6; /* tolerances */ + sunrealtype abstol = 1.0e-10; sunindextype NEQ, i; /* general problem variables */ @@ -119,7 +119,7 @@ int main() SUNMatrix A = NULL; /* empty matrix object for solver */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ - realtype pi, t, dTout, tout, u, v, w; + sunrealtype pi, t, dTout, tout, u, v, w; FILE *FID, *UFID, *VFID, *WFID; int iout; long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, ncfn, netf; @@ -328,19 +328,19 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; - realtype dx = udata->dx; - realtype *Ydata=NULL, *dYdata=NULL; - realtype uconst, vconst, wconst, u, ul, ur, v, vl, vr, w, wl, wr; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; + sunrealtype dx = udata->dx; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype uconst, vconst, wconst, u, ul, ur, v, vl, vr, w, wl, wr; sunindextype i; Ydata = N_VGetArrayPointer(y); /* access data arrays */ @@ -377,7 +377,7 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; /* access problem data */ @@ -398,10 +398,10 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, /* Routine to compute the stiffness matrix from (L*y), scaled by the factor c. We add the result into Jac and do not erase what was already there */ -static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata) +static int LaplaceMatrix(sunrealtype c, SUNMatrix Jac, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ - realtype dx = udata->dx; + sunrealtype dx = udata->dx; sunindextype i; /* iterate over intervals, filling in Jacobian of (L*y) using SM_ELEMENT_B @@ -423,13 +423,13 @@ static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata) /* Routine to compute the Jacobian matrix from R(y), scaled by the factor c. We add the result into Jac and do not erase what was already there */ -static int ReactionJac(realtype c, N_Vector y, SUNMatrix Jac, UserData udata) +static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ - realtype ep = udata->ep; + sunrealtype ep = udata->ep; sunindextype i; - realtype u, v, w; - realtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ + sunrealtype u, v, w; + sunrealtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ if (check_flag((void *)Ydata, "N_VGetArrayPointer", 0)) return 1; /* iterate over nodes, filling in Jacobian of reaction terms */ diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c index 14d767a109..3960bed4dc 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -65,7 +65,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLU_MT SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -108,25 +108,25 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype *x; /* mesh node locations */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype du; /* diffusion coeff for u */ - realtype dv; /* diffusion coeff for v */ - realtype dw; /* diffusion coeff for w */ - realtype ep; /* stiffness parameter */ + sunrealtype *x; /* mesh node locations */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype du; /* diffusion coeff for u */ + sunrealtype dv; /* diffusion coeff for v */ + sunrealtype dw; /* diffusion coeff for w */ + sunrealtype ep; /* stiffness parameter */ N_Vector tmp; /* temporary vector */ SUNMatrix R; /* temporary storage */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f_diff(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f_rx(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int MassMatrix(realtype t, SUNMatrix M, void *user_data, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f_diff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f_rx(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private helper functions */ @@ -140,21 +140,21 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - realtype a = RCONST(0.6); /* problem parameters */ - realtype b = RCONST(2.0); - realtype du = RCONST(0.025); - realtype dv = RCONST(0.025); - realtype dw = RCONST(0.025); - realtype ep = RCONST(1.0e-5); /* stiffness parameter */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); + sunrealtype a = RCONST(0.6); /* problem parameters */ + sunrealtype b = RCONST(2.0); + sunrealtype du = RCONST(0.025); + sunrealtype dv = RCONST(0.025); + sunrealtype dw = RCONST(0.025); + sunrealtype ep = RCONST(1.0e-5); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); sunindextype i, NEQ, NNZ; int num_threads; @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { SUNLinearSolver MLS = NULL; /* empty mass matrix solver object */ void *arkode_mem = NULL; FILE *FID, *UFID, *VFID, *WFID; - realtype h, z, t, dTout, tout, u, v, w, pi; + sunrealtype h, z, t, dTout, tout, u, v, w, pi; int iout; long int nst, nst_a, nfe, nfi, nsetups, nje, nni, ncfn; long int netf, nmset, nms, nMv; @@ -236,7 +236,7 @@ int main(int argc, char *argv[]) { data = N_VGetArrayPointer(y); /* Access data array for new NVector y */ if (check_retval((void *)data, "N_VGetArrayPointer", 0)) return(1); - udata->x = (realtype *) malloc(N*sizeof(realtype)); + udata->x = (sunrealtype *) malloc(N*sizeof(sunrealtype)); if (check_retval((void *)udata->x, "malloc", 2)) return(1); h = RCONST(10.0)/(N-1); for (i=0; iN; - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; /* local variables */ sunindextype i; - realtype ul, ur, vl, vr, wl, wr; - realtype xl, xr, f1; + sunrealtype ul, ur, vl, vr, wl, wr; + sunrealtype xl, xr, f1; booleantype left, right; - realtype *Ydata, *RHSdata; + sunrealtype *Ydata, *RHSdata; /* access data arrays */ Ydata = N_VGetArrayPointer(y); @@ -552,23 +552,23 @@ static int f_diff(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* Routine to compute the reaction portion of the ODE RHS function f(t,y). */ -static int f_rx(realtype t, N_Vector y, N_Vector ydot, void *user_data) { +static int f_rx(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { /* problem data */ UserData udata = (UserData) user_data; /* shortcuts to number of intervals, background values */ sunindextype N = udata->N; - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; /* local variables */ sunindextype i; - realtype ul, ur, vl, vr, wl, wr; - realtype u, v, w, xl, xr, f1, f2, f3; + sunrealtype ul, ur, vl, vr, wl, wr; + sunrealtype u, v, w, xl, xr, f1, f2, f3; booleantype left, right; - realtype *Ydata, *RHSdata; + sunrealtype *Ydata, *RHSdata; /* access data arrays */ Ydata = N_VGetArrayPointer(y); @@ -698,7 +698,7 @@ static int f_rx(realtype t, N_Vector y, N_Vector ydot, void *user_data) { /* Interface routine to compute the Jacobian of the full RHS function, f(y) */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* temporary variables */ @@ -752,7 +752,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, /* Routine to compute the mass matrix multiplying y_t. */ -static int MassMatrix(realtype t, SUNMatrix M, void *user_data, +static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* user data structure */ @@ -762,12 +762,12 @@ static int MassMatrix(realtype t, SUNMatrix M, void *user_data, sunindextype N = udata->N, NEQ = 3*N; sunindextype *rowptrs = SUNSparseMatrix_IndexPointers(M); sunindextype *colinds = SUNSparseMatrix_IndexValues(M); - realtype *Mdata = SUNSparseMatrix_Data(M); - realtype *Xdata = udata->x; + sunrealtype *Mdata = SUNSparseMatrix_Data(M); + sunrealtype *Xdata = udata->x; /* local data */ sunindextype i, nz=0; - realtype xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; + sunrealtype xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; booleantype left, right; /* check that vector/matrix dimensions match up */ @@ -891,14 +891,14 @@ static int LaplaceMatrix(SUNMatrix L, UserData udata) sunindextype N = udata->N; sunindextype *rowptrs = SUNSparseMatrix_IndexPointers(L); sunindextype *colinds = SUNSparseMatrix_IndexValues(L); - realtype *Ldata = SUNSparseMatrix_Data(L); - realtype *Xdata = udata->x; - realtype du = udata->du, dv = udata->dv, dw = udata->dw; + sunrealtype *Ldata = SUNSparseMatrix_Data(L); + sunrealtype *Xdata = udata->x; + sunrealtype du = udata->du, dv = udata->dv, dw = udata->dw; /* set local variables */ sunindextype i, j, nz=0; - realtype xl, xc, xr; - realtype Lu[9], Lv[9], Lw[9]; + sunrealtype xl, xc, xr; + sunrealtype Lu[9], Lv[9], Lw[9]; /* initialize all local variables to zero (to avoid uninitialized variable warnings) */ xl = xc = xr = 0.0; @@ -1079,20 +1079,20 @@ static int ReactionJac(N_Vector y, SUNMatrix Jac, UserData udata) sunindextype N = udata->N; sunindextype *rowptrs = SUNSparseMatrix_IndexPointers(Jac); sunindextype *colinds = SUNSparseMatrix_IndexValues(Jac); - realtype *Jdata = SUNSparseMatrix_Data(Jac); - realtype *Xdata = udata->x; + sunrealtype *Jdata = SUNSparseMatrix_Data(Jac); + sunrealtype *Xdata = udata->x; /* set local variables */ sunindextype i, j, nz=0; - realtype ep = udata->ep; - realtype ul, uc, ur, vl, vc, vr, wl, wc, wr, xl, xc, xr; - realtype u1, u2, u3, v1, v2, v3, w1, w2, w3; - realtype df1, df2, df3, dQdf1, dQdf2, dQdf3; - realtype ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; - realtype Ju[9], Jv[9], Jw[9]; + sunrealtype ep = udata->ep; + sunrealtype ul, uc, ur, vl, vc, vr, wl, wc, wr, xl, xc, xr; + sunrealtype u1, u2, u3, v1, v2, v3, w1, w2, w3; + sunrealtype df1, df2, df3, dQdf1, dQdf2, dQdf3; + sunrealtype ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; + sunrealtype Ju[9], Jv[9], Jw[9]; /* access data arrays */ - realtype *Ydata = N_VGetArrayPointer(y); + sunrealtype *Ydata = N_VGetArrayPointer(y); if (check_retval((void *) Ydata, "N_VGetArrayPointer", 0)) return(1); /* initialize all local variables to zero (to avoid uninitialized variable warnings) */ diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index 7b8f22c88f..c37c5cfe64 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c @@ -72,7 +72,7 @@ #include /* access to Serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #include /* def. of SUNRsqrt, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -96,40 +96,40 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype pi; /* value of pi */ - realtype du; /* diffusion coeff for u */ - realtype dv; /* diffusion coeff for v */ - realtype dw; /* diffusion coeff for w */ - realtype au; /* advection coeff for u */ - realtype av; /* advection coeff for v */ - realtype aw; /* advection coeff for w */ - realtype ep; /* stiffness parameter */ + sunrealtype dx; /* mesh spacing */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype pi; /* value of pi */ + sunrealtype du; /* diffusion coeff for u */ + sunrealtype dv; /* diffusion coeff for v */ + sunrealtype dw; /* diffusion coeff for w */ + sunrealtype au; /* advection coeff for u */ + sunrealtype av; /* advection coeff for v */ + sunrealtype aw; /* advection coeff for w */ + sunrealtype ep; /* stiffness parameter */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fse(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fsi(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jf(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jf(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Jsi(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Js(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private helper functions */ static int SetIC(N_Vector y, void *user_data); -static int AdvectionJac(realtype c, SUNMatrix Jac, UserData udata); -static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata); -static int ReactionJac(realtype c, N_Vector y, SUNMatrix Jac, UserData udata); +static int AdvectionJac(sunrealtype c, SUNMatrix Jac, UserData udata); +static int LaplaceMatrix(sunrealtype c, SUNMatrix Jac, UserData udata); +static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -138,28 +138,28 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - realtype T0 = ZERO; /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = ZERO; /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 10; /* total number of output times */ - realtype dTout = (Tf-T0)/Nt; /* time between outputs */ + sunrealtype dTout = (Tf-T0)/Nt; /* time between outputs */ int Nvar = 3; /* number of solution fields */ sunindextype N = 101; /* spatial mesh size */ - realtype hs; /* slow step size */ - realtype m = RCONST(10.0); /* time-scale separation factor */ + sunrealtype hs; /* slow step size */ + sunrealtype m = RCONST(10.0); /* time-scale separation factor */ int solve_type; /* solver configuration */ - realtype dx = ONE/(N-1); /* set spatial mesh spacing */ - realtype a = 0.6; /* problem parameters */ - realtype b = 2.0; - realtype pi = RCONST(4.0)*atan(ONE); - realtype du = 0.01; - realtype dv = 0.01; - realtype dw = 0.01; - realtype au = -0.001; - realtype av = -0.001; - realtype aw = -0.001; - realtype ep = 1.0e-2; /* stiffness parameter */ - realtype reltol = 1.0e-12; /* tolerances */ - realtype abstol = 1.0e-14; + sunrealtype dx = ONE/(N-1); /* set spatial mesh spacing */ + sunrealtype a = 0.6; /* problem parameters */ + sunrealtype b = 2.0; + sunrealtype pi = RCONST(4.0)*atan(ONE); + sunrealtype du = 0.01; + sunrealtype dv = 0.01; + sunrealtype dw = 0.01; + sunrealtype au = -0.001; + sunrealtype av = -0.001; + sunrealtype aw = -0.001; + sunrealtype ep = 1.0e-2; /* stiffness parameter */ + sunrealtype reltol = 1.0e-12; /* tolerances */ + sunrealtype abstol = 1.0e-14; /* general problem variables */ int retval; /* reusable return flag */ @@ -178,9 +178,9 @@ int main(int argc, char *argv[]) N_Vector umask = NULL; /* empty mask vectors */ N_Vector vmask = NULL; N_Vector wmask = NULL; - realtype t, tout; /* current/output time data */ - realtype hf; /* fast time step */ - realtype u, v, w; /* temp data values */ + sunrealtype t, tout; /* current/output time data */ + sunrealtype hf; /* fast time step */ + sunrealtype u, v, w; /* temp data values */ FILE *FID, *UFID, *VFID, *WFID; /* output file pointers */ int iout; /* output counter */ long int nsts, nstf; /* step stats */ @@ -189,8 +189,8 @@ int main(int argc, char *argv[]) sunindextype NEQ; /* number of equations */ sunindextype i; /* counter */ UserData udata = NULL; /* user data pointer */ - realtype* data = NULL; /* array for vector data */ - realtype gamma, beta; + sunrealtype* data = NULL; /* array for vector data */ + sunrealtype gamma, beta; char ofname[50]=""; /* Create the SUNDIALS context object for this simulation. */ @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) return(-1); } solve_type = (sunindextype) atol(argv[1]); - hs = (realtype) atof(argv[2]); + hs = (sunrealtype) atof(argv[2]); /* Check arguments for validity */ @@ -819,15 +819,15 @@ int main(int argc, char *argv[]) *------------------------------------*/ /* ff routine to compute the fast portion of the ODE RHS. */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; - realtype *Ydata=NULL, *dYdata=NULL; - realtype u, v, w; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype u, v, w; sunindextype i; Ydata = N_VGetArrayPointer(y); /* access data arrays */ @@ -862,16 +862,16 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fse routine to compute the slow-explicit portion of the ODE RHS function. */ -static int fse(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype au = udata->au; - realtype av = udata->av; - realtype aw = udata->aw; - realtype dx = udata->dx; - realtype *Ydata=NULL, *dYdata=NULL; - realtype auconst, avconst, awconst, ul, ur, vl, vr, wl, wr; + sunrealtype au = udata->au; + sunrealtype av = udata->av; + sunrealtype aw = udata->aw; + sunrealtype dx = udata->dx; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype auconst, avconst, awconst, ul, ur, vl, vr, wl, wr; sunindextype i; Ydata = N_VGetArrayPointer(y); /* access data arrays */ @@ -909,16 +909,16 @@ static int fse(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fsi routine to compute the slow-implicit portion of the ODE RHS. */ -static int fsi(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; - realtype dx = udata->dx; - realtype *Ydata=NULL, *dYdata=NULL; - realtype duconst, dvconst, dwconst, u, ul, ur, v, vl, vr, w, wl, wr; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; + sunrealtype dx = udata->dx; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype duconst, dvconst, dwconst, u, ul, ur, v, vl, vr, w, wl, wr; sunindextype i; Ydata = N_VGetArrayPointer(y); /* access data arrays */ @@ -956,19 +956,19 @@ static int fsi(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fs routine to compute the slow portion of the ODE RHS. */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; - realtype au = udata->au; - realtype av = udata->av; - realtype aw = udata->aw; - realtype dx = udata->dx; - realtype *Ydata=NULL, *dYdata=NULL; - realtype duconst, dvconst, dwconst, auconst, avconst, awconst, u, ul, ur, v, vl, vr, w, wl, wr; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; + sunrealtype au = udata->au; + sunrealtype av = udata->av; + sunrealtype aw = udata->aw; + sunrealtype dx = udata->dx; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype duconst, dvconst, dwconst, auconst, avconst, awconst, u, ul, ur, v, vl, vr, w, wl, wr; sunindextype i; Ydata = N_VGetArrayPointer(y); /* access data arrays */ @@ -1009,22 +1009,22 @@ static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* f routine to compute the full ODE RHS function. */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; - realtype au = udata->au; - realtype av = udata->av; - realtype aw = udata->aw; - realtype dx = udata->dx; - realtype *Ydata=NULL, *dYdata=NULL; - realtype duconst, dvconst, dwconst, auconst, avconst, awconst, u, ul, ur, v, vl, vr, w, wl, wr; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; + sunrealtype au = udata->au; + sunrealtype av = udata->av; + sunrealtype aw = udata->aw; + sunrealtype dx = udata->dx; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype duconst, dvconst, dwconst, auconst, avconst, awconst, u, ul, ur, v, vl, vr, w, wl, wr; sunindextype i; Ydata = N_VGetArrayPointer(y); /* access data arrays */ @@ -1065,14 +1065,14 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Placeholder function of zeroes */ -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { N_VConst(ZERO,ydot); return(0); } /* Jf routine to compute Jacobian of the fast portion of the ODE RHS */ -static int Jf(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jf(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; /* access problem data */ @@ -1086,7 +1086,7 @@ static int Jf(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } /* Jsi routine to compute the Jacobian of the slow-implicit portion of the ODE RHS. */ -static int Jsi(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; /* access problem data */ @@ -1100,7 +1100,7 @@ static int Jsi(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } /* Js routine to compute the Jacobian of the slow portion of ODE RHS. */ -static int Js(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; /* access problem data */ @@ -1117,7 +1117,7 @@ static int Js(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } /* Jac routine to compute the Jacobian of the full ODE RHS. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; /* access problem data */ @@ -1147,11 +1147,11 @@ static int SetIC(N_Vector y, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype dx = udata->dx; - realtype pi = udata->pi; - realtype* data = NULL; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype dx = udata->dx; + sunrealtype pi = udata->pi; + sunrealtype* data = NULL; sunindextype i; /* Access data array from NVector y */ @@ -1170,16 +1170,16 @@ static int SetIC(N_Vector y, void *user_data) /* Routine to compute the Jacobian matrix from fse(t,y), scaled by the factor c. We add the result into Jac and do not erase what was already there */ -static int AdvectionJac(realtype c, SUNMatrix Jac, UserData udata) +static int AdvectionJac(sunrealtype c, SUNMatrix Jac, UserData udata) { /* Set shortcuts */ sunindextype N = udata->N; - realtype dx = udata->dx; - realtype au = udata->au; - realtype av = udata->av; - realtype aw = udata->aw; + sunrealtype dx = udata->dx; + sunrealtype au = udata->au; + sunrealtype av = udata->av; + sunrealtype aw = udata->aw; sunindextype i; - realtype auconst, avconst, awconst; + sunrealtype auconst, avconst, awconst; auconst = -au/TWO/dx; avconst = -av/TWO/dx; awconst = -aw/TWO/dx; @@ -1201,10 +1201,10 @@ static int AdvectionJac(realtype c, SUNMatrix Jac, UserData udata) /* Routine to compute the stiffness matrix from (L*y), scaled by the factor c. We add the result into Jac and do not erase what was already there */ -static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata) +static int LaplaceMatrix(sunrealtype c, SUNMatrix Jac, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ - realtype dx = udata->dx; + sunrealtype dx = udata->dx; sunindextype i; /* iterate over intervals, filling in Jacobian of (L*y) using SM_ELEMENT_B @@ -1227,13 +1227,13 @@ static int LaplaceMatrix(realtype c, SUNMatrix Jac, UserData udata) /* Routine to compute the Jacobian matrix from R(y), scaled by the factor c. We add the result into Jac and do not erase what was already there */ -static int ReactionJac(realtype c, N_Vector y, SUNMatrix Jac, UserData udata) +static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ - realtype ep = udata->ep; + sunrealtype ep = udata->ep; sunindextype i; - realtype u, v, w; - realtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ + sunrealtype u, v, w; + sunrealtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ if (check_retval((void *)Ydata, "N_VGetArrayPointer", 0)) return 1; /* iterate over nodes, filling in Jacobian of reaction terms */ diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.c b/examples/arkode/C_serial/ark_brusselator1D_klu.c index 10bd50c840..f47bdf3d9e 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.c @@ -55,7 +55,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to sparse SUNMatrix */ #include /* access to KLU SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #include /* def. of SUNRsqrt, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -78,20 +78,20 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype du; /* diffusion coeff for u */ - realtype dv; /* diffusion coeff for v */ - realtype dw; /* diffusion coeff for w */ - realtype ep; /* stiffness parameter */ + sunrealtype dx; /* mesh spacing */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype du; /* diffusion coeff for u */ + sunrealtype dv; /* diffusion coeff for v */ + sunrealtype dw; /* diffusion coeff for w */ + sunrealtype ep; /* stiffness parameter */ SUNMatrix R; /* temporary storage */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ @@ -106,21 +106,21 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 10; /* total number of output times */ int Nvar = 3; UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - realtype a = 0.6; /* problem parameters */ - realtype b = 2.0; - realtype du = 0.025; - realtype dv = 0.025; - realtype dw = 0.025; - realtype ep = 1.0e-5; /* stiffness parameter */ - realtype reltol = 1.0e-6; /* tolerances */ - realtype abstol = 1.0e-10; + sunrealtype a = 0.6; /* problem parameters */ + sunrealtype b = 2.0; + sunrealtype du = 0.025; + sunrealtype dv = 0.025; + sunrealtype dw = 0.025; + sunrealtype ep = 1.0e-5; /* stiffness parameter */ + sunrealtype reltol = 1.0e-6; /* tolerances */ + sunrealtype abstol = 1.0e-10; sunindextype NEQ, i, NNZ; /* general problem variables */ @@ -132,12 +132,12 @@ int main() SUNMatrix A = NULL; /* empty matrix object for solver */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; - realtype pi; + sunrealtype pi; FILE *FID, *UFID, *VFID, *WFID; - realtype t = T0; - realtype dTout = (Tf-T0)/Nt; - realtype tout = T0+dTout; - realtype u, v, w; + sunrealtype t = T0; + sunrealtype dTout = (Tf-T0)/Nt; + sunrealtype tout = T0+dTout; + sunrealtype u, v, w; int iout; long int nst, nst_a, nfe, nfi, nsetups, nje, nni, ncfn, netf; @@ -346,19 +346,19 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; - realtype du = udata->du; - realtype dv = udata->dv; - realtype dw = udata->dw; - realtype dx = udata->dx; - realtype *Ydata=NULL, *dYdata=NULL; - realtype uconst, vconst, wconst, u, ul, ur, v, vl, vr, w, wl, wr; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; + sunrealtype du = udata->du; + sunrealtype dv = udata->dv; + sunrealtype dw = udata->dw; + sunrealtype dx = udata->dx; + sunrealtype *Ydata=NULL, *dYdata=NULL; + sunrealtype uconst, vconst, wconst, u, ul, ur, v, vl, vr, w, wl, wr; sunindextype i; Ydata = N_VGetArrayPointer(y); /* access data arrays */ @@ -398,7 +398,7 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* problem data */ @@ -457,10 +457,10 @@ static int LaplaceMatrix(SUNMatrix Lap, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ sunindextype i, nz=0; - realtype uconst, uconst2, vconst, vconst2, wconst, wconst2; + sunrealtype uconst, uconst2, vconst, vconst2, wconst, wconst2; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(Lap); sunindextype *rowvals = SUNSparseMatrix_IndexValues(Lap); - realtype *data = SUNSparseMatrix_Data(Lap); + sunrealtype *data = SUNSparseMatrix_Data(Lap); /* clear out matrix */ SUNMatZero(Lap); @@ -544,12 +544,12 @@ static int ReactionJac(N_Vector y, SUNMatrix Jac, UserData udata) { sunindextype N = udata->N; /* set shortcuts */ sunindextype i, nz=0; - realtype u, v, w; - realtype ep = udata->ep; + sunrealtype u, v, w; + sunrealtype ep = udata->ep; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(Jac); sunindextype *rowvals = SUNSparseMatrix_IndexValues(Jac); - realtype *data = SUNSparseMatrix_Data(Jac); - realtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ + sunrealtype *data = SUNSparseMatrix_Data(Jac); + sunrealtype *Ydata = N_VGetArrayPointer(y); /* access solution array */ if (check_flag((void *) Ydata, "N_VGetArrayPointer", 0)) return 1; /* clear out matrix */ diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.c b/examples/arkode/C_serial/ark_brusselator_1D_mri.c index 1070cd72df..ed4c50971c 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.c @@ -60,7 +60,7 @@ #include /* access to Serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #include /* def. of SUNRsqrt, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -84,17 +84,17 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype a; /* constant forcing on u */ - realtype b; /* steady-state value of w */ - realtype c; /* advection coefficient */ - realtype ep; /* stiffness parameter */ + sunrealtype dx; /* mesh spacing */ + sunrealtype a; /* constant forcing on u */ + sunrealtype b; /* steady-state value of w */ + sunrealtype c; /* advection coefficient */ + sunrealtype ep; /* stiffness parameter */ } *UserData; /* user-provided functions called by the integrator */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jf(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jf(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* function for setting initial condition */ @@ -108,20 +108,20 @@ static int check_retval(void *flagvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ sunindextype N = 200; /* spatial mesh size (N intervals) */ - realtype a = RCONST(1.0); /* problem parameters */ - realtype b = RCONST(3.5); - realtype c = RCONST(0.25); - realtype ep = RCONST(1.0e-6); /* stiffness parameter */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); + sunrealtype a = RCONST(1.0); /* problem parameters */ + sunrealtype b = RCONST(3.5); + sunrealtype c = RCONST(0.25); + sunrealtype ep = RCONST(1.0e-6); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); /* general problem variables */ - realtype hs; /* slow step size */ + sunrealtype hs; /* slow step size */ int retval; /* reusable return flag */ N_Vector y = NULL; /* empty solution vector */ N_Vector umask = NULL; /* empty mask vectors */ @@ -132,8 +132,8 @@ int main(int argc, char *argv[]) void *arkode_mem = NULL; /* empty ARKode memory structure */ void *inner_arkode_mem = NULL; /* empty ARKode memory structure */ MRIStepInnerStepper inner_stepper = NULL; /* inner stepper */ - realtype t, dTout, tout; /* current/output time data */ - realtype u, v, w; /* temp data values */ + sunrealtype t, dTout, tout; /* current/output time data */ + sunrealtype u, v, w; /* temp data values */ FILE *FID, *UFID, *VFID, *WFID; /* output file pointers */ int iout; /* output counter */ long int nsts, nstf, nstf_a, netf; /* step stats */ @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) sunindextype NEQ; /* number of equations */ sunindextype i; /* counter */ UserData udata = NULL; /* user data pointer */ - realtype* data = NULL; /* array for vector data */ + sunrealtype* data = NULL; /* array for vector data */ /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -401,16 +401,16 @@ int main(int argc, char *argv[]) /* ff routine to compute the fast portion of the ODE RHS. */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype ep = udata->ep; - realtype* Ydata = NULL; - realtype* dYdata = NULL; - realtype u, v, w; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype ep = udata->ep; + sunrealtype* Ydata = NULL; + sunrealtype* dYdata = NULL; + sunrealtype u, v, w; sunindextype i; /* access data arrays */ @@ -445,15 +445,15 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* fs routine to compute the slow portion of the ODE RHS. */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype c = udata->c; - realtype dx = udata->dx; - realtype* Ydata = NULL; - realtype* dYdata = NULL; - realtype tmp; + sunrealtype c = udata->c; + sunrealtype dx = udata->dx; + sunrealtype* Ydata = NULL; + sunrealtype* dYdata = NULL; + sunrealtype tmp; sunindextype i; /* access data arrays */ @@ -510,15 +510,15 @@ static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* Js routine to compute the Jacobian of the fast portion of the ODE RHS. */ -static int Jf(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, +static int Jf(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set shortcuts */ - realtype ep = udata->ep; + sunrealtype ep = udata->ep; sunindextype i; - realtype u, v, w; - realtype* Ydata = NULL; + sunrealtype u, v, w; + sunrealtype* Ydata = NULL; /* access solution array */ Ydata = N_VGetArrayPointer(y); @@ -563,12 +563,12 @@ static int SetIC(N_Vector y, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype a = udata->a; - realtype b = udata->b; - realtype dx = udata->dx; - realtype* data = NULL; + sunrealtype a = udata->a; + sunrealtype b = udata->b; + sunrealtype dx = udata->dx; + sunrealtype* data = NULL; - realtype x, p; + sunrealtype x, p; sunindextype i; /* Access data array from NVector y */ diff --git a/examples/arkode/C_serial/ark_brusselator_fp.c b/examples/arkode/C_serial/ark_brusselator_fp.c index 3c99f2d8de..c00bf1e29a 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -58,7 +58,7 @@ #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ #include /* access to FP nonlinear solver */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #include #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -72,8 +72,8 @@ #endif /* User-supplied Functions Called by the Solver */ -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); @@ -82,18 +82,18 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ int test = 3; /* test problem to run */ - realtype reltol = 1.0e-6; /* tolerances */ - realtype abstol = 1.0e-10; + sunrealtype reltol = 1.0e-6; /* tolerances */ + sunrealtype abstol = 1.0e-10; int fp_m = 3; /* dimension of acceleration subspace */ int maxcor = 10; /* maximum # of nonlinear iterations/step */ - realtype a, b, ep, u0, v0, w0; - realtype rdata[3]; + sunrealtype a, b, ep, u0, v0, w0; + sunrealtype rdata[3]; int monitor = 0; /* turn on/off monitoring */ /* general problem variables */ @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *UFID; - realtype t, tout; + sunrealtype t, tout; int iout; long int nst, nst_a, nfe, nfi, nni, ncfn, netf; @@ -261,12 +261,12 @@ int main(int argc, char *argv[]) *-------------------------------*/ /* fi routine to compute the implicit portion of the ODE RHS. */ -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype b = rdata[1]; /* access data entries */ - realtype ep = rdata[2]; - realtype w = NV_Ith_S(y,2); /* access solution values */ + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype b = rdata[1]; /* access data entries */ + sunrealtype ep = rdata[2]; + sunrealtype w = NV_Ith_S(y,2); /* access solution values */ /* fill in the RHS function */ NV_Ith_S(ydot,0) = 0.0; @@ -277,13 +277,13 @@ static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fe routine to compute the explicit portion of the ODE RHS. */ -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype a = rdata[0]; /* access data entries */ - realtype u = NV_Ith_S(y,0); /* access solution values */ - realtype v = NV_Ith_S(y,1); - realtype w = NV_Ith_S(y,2); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype a = rdata[0]; /* access data entries */ + sunrealtype u = NV_Ith_S(y,0); /* access solution values */ + sunrealtype v = NV_Ith_S(y,1); + sunrealtype w = NV_Ith_S(y,2); /* fill in the RHS function */ NV_Ith_S(ydot,0) = a - (w+1.0)*u + v*u*u; diff --git a/examples/arkode/C_serial/ark_brusselator_mri.c b/examples/arkode/C_serial/ark_brusselator_mri.c index 9ce6c623ac..7e98ad8512 100644 --- a/examples/arkode/C_serial/ark_brusselator_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_mri.c @@ -38,7 +38,7 @@ #include /* prototypes for MRIStep fcts., consts */ #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -51,8 +51,8 @@ #endif /* User-supplied functions called by the solver */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -61,16 +61,16 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(2.0); /* final time */ - realtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(2.0); /* final time */ + sunrealtype dTout = RCONST(0.1); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ - realtype hs = RCONST(0.025); /* slow step size */ - realtype hf = RCONST(0.001); /* fast step size */ - realtype a, b, ep; /* ODE parameters */ - realtype u0, v0, w0; /* initial conditions */ - realtype rdata[3]; /* user data */ + sunrealtype hs = RCONST(0.025); /* slow step size */ + sunrealtype hf = RCONST(0.001); /* fast step size */ + sunrealtype a, b, ep; /* ODE parameters */ + sunrealtype u0, v0, w0; /* initial conditions */ + sunrealtype rdata[3]; /* user data */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -79,7 +79,7 @@ int main() void *inner_arkode_mem = NULL; /* empty ARKode memory structure */ MRIStepInnerStepper inner_stepper = NULL; /* inner stepper */ FILE *UFID; - realtype t, tout; + sunrealtype t, tout; int iout; long int nsts, nstf, nfse, nfsi, nff, tmp; @@ -242,12 +242,12 @@ int main() * ------------------------------*/ /* ff routine to compute the fast portion of the ODE RHS. */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype b = rdata[1]; /* access data entries */ - realtype ep = rdata[2]; - realtype w = NV_Ith_S(y,2); /* access solution values */ + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype b = rdata[1]; /* access data entries */ + sunrealtype ep = rdata[2]; + sunrealtype w = NV_Ith_S(y,2); /* access solution values */ /* fill in the RHS function */ NV_Ith_S(ydot,0) = 0.0; @@ -259,13 +259,13 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fs routine to compute the slow portion of the ODE RHS. */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype a = rdata[0]; /* access data entries */ - realtype u = NV_Ith_S(y,0); /* access solution values */ - realtype v = NV_Ith_S(y,1); - realtype w = NV_Ith_S(y,2); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype a = rdata[0]; /* access data entries */ + sunrealtype u = NV_Ith_S(y,0); /* access solution values */ + sunrealtype v = NV_Ith_S(y,1); + sunrealtype w = NV_Ith_S(y,2); /* fill in the RHS function */ NV_Ith_S(ydot,0) = a - (w+1.0)*u + v*u*u; diff --git a/examples/arkode/C_serial/ark_heat1D.c b/examples/arkode/C_serial/ark_heat1D.c index 544d1e1ea0..7ce4d54e91 100644 --- a/examples/arkode/C_serial/ark_heat1D.c +++ b/examples/arkode/C_serial/ark_heat1D.c @@ -42,7 +42,7 @@ #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ #include /* access to PCG SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -57,13 +57,13 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype k; /* diffusion coefficient */ + sunrealtype dx; /* mesh spacing */ + sunrealtype k; /* diffusion coefficient */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); /* Private function to check function return values */ @@ -73,15 +73,15 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ int Nt = 10; /* total number of output times */ - realtype rtol = 1.e-6; /* relative tolerance */ - realtype atol = 1.e-10; /* absolute tolerance */ + sunrealtype rtol = 1.e-6; /* relative tolerance */ + sunrealtype atol = 1.e-10; /* absolute tolerance */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - realtype k = 0.5; /* heat conductivity */ + sunrealtype k = 0.5; /* heat conductivity */ sunindextype i; /* general problem variables */ @@ -90,7 +90,7 @@ int main() { SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *FID, *UFID; - realtype t, dTout, tout; + sunrealtype t, dTout, tout; int iout; long int nst, nst_a, nfe, nfi, nsetups, nli, nJv, nlcf, nni, ncfn, netf; @@ -235,14 +235,14 @@ int main() { *--------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype k = udata->k; - realtype dx = udata->dx; - realtype *Y=NULL, *Ydot=NULL; - realtype c1, c2; + sunrealtype k = udata->k; + sunrealtype dx = udata->dx; + sunrealtype *Y=NULL, *Ydot=NULL; + sunrealtype c1, c2; sunindextype i, isource; Y = N_VGetArrayPointer(y); /* access data arrays */ @@ -265,15 +265,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { UserData udata = (UserData) user_data; /* variable shortcuts */ sunindextype N = udata->N; - realtype k = udata->k; - realtype dx = udata->dx; - realtype *V=NULL, *JV=NULL; - realtype c1, c2; + sunrealtype k = udata->k; + sunrealtype dx = udata->dx; + sunrealtype *V=NULL, *JV=NULL; + sunrealtype c1, c2; sunindextype i; V = N_VGetArrayPointer(v); /* access data arrays */ diff --git a/examples/arkode/C_serial/ark_heat1D_adapt.c b/examples/arkode/C_serial/ark_heat1D_adapt.c index 28447942b6..7795a38ca9 100644 --- a/examples/arkode/C_serial/ark_heat1D_adapt.c +++ b/examples/arkode/C_serial/ark_heat1D_adapt.c @@ -42,7 +42,7 @@ #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ #include /* access to PCG SUNLinearSolver */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -71,36 +71,36 @@ /* user data structure */ typedef struct { sunindextype N; /* current number of intervals */ - realtype *x; /* current mesh */ - realtype k; /* diffusion coefficient */ - realtype refine_tol; /* adaptivity tolerance */ + sunrealtype *x; /* current mesh */ + sunrealtype k; /* diffusion coefficient */ + sunrealtype refine_tol; /* adaptivity tolerance */ } *UserData; /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); /* Private function to check function return values */ -realtype * adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata); -static int project(sunindextype Nold, realtype *xold, N_Vector yold, - sunindextype Nnew, realtype *xnew, N_Vector ynew); +sunrealtype * adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata); +static int project(sunindextype Nold, sunrealtype *xold, N_Vector yold, + sunindextype Nnew, sunrealtype *xnew, N_Vector ynew); static int check_flag(void *flagvalue, const char *funcname, int opt); /* Main Program */ int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ - realtype rtol = RCONST(1.e-3); /* relative tolerance */ - realtype atol = RCONST(1.e-10); /* absolute tolerance */ - realtype hscale = RCONST(1.0); /* time step change factor on resizes */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ + sunrealtype rtol = RCONST(1.e-3); /* relative tolerance */ + sunrealtype atol = RCONST(1.e-10); /* absolute tolerance */ + sunrealtype hscale = RCONST(1.0); /* time step change factor on resizes */ UserData udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N = 21; /* initial spatial mesh size */ - realtype refine = RCONST(3.0e-3); /* adaptivity refinement tolerance */ - realtype k = RCONST(0.5); /* heat conductivity */ + sunrealtype refine = RCONST(3.0e-3); /* adaptivity refinement tolerance */ + sunrealtype k = RCONST(0.5); /* heat conductivity */ sunindextype i; long int nni, nni_tot=0, nli, nli_tot=0; int iout=0; @@ -113,8 +113,8 @@ int main() { SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *XFID, *UFID; - realtype t, olddt, newdt; - realtype *xnew = NULL; + sunrealtype t, olddt, newdt; + sunrealtype *xnew = NULL; sunindextype Nnew; /* Create the SUNDIALS context object for this simulation */ @@ -127,7 +127,7 @@ int main() { udata->N = N; udata->k = k; udata->refine_tol = refine; - udata->x = malloc(N * sizeof(realtype)); + udata->x = malloc(N * sizeof(sunrealtype)); for (i=0; ix[i] = ONE*i/(N-1); /* Initial problem output */ @@ -296,14 +296,14 @@ int main() { *--------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype k = udata->k; - realtype *x = udata->x; - realtype *Y=NULL, *Ydot=NULL; - realtype dxL, dxR; + sunrealtype k = udata->k; + sunrealtype *x = udata->x; + sunrealtype *Y=NULL, *Ydot=NULL; + sunrealtype dxL, dxR; sunindextype i; /* access data arrays */ @@ -332,15 +332,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, +static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { UserData udata = (UserData) user_data; /* variable shortcuts */ sunindextype N = udata->N; - realtype k = udata->k; - realtype *x = udata->x; - realtype *V=NULL, *JV=NULL; - realtype dxL, dxR; + sunrealtype k = udata->k; + sunrealtype *x = udata->x; + sunrealtype *V=NULL, *JV=NULL; + sunrealtype dxL, dxR; sunindextype i; /* access data arrays */ @@ -376,11 +376,11 @@ static int Jac(N_Vector v, N_Vector Jv, realtype t, N_Vector y, Nnew [output] -- the size of the new mesh udata [input] -- the current system information The return for this function is a pointer to the new mesh. */ -realtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) +sunrealtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) { sunindextype i, j; int *marks=NULL; - realtype ydd, *xold=NULL, *Y=NULL, *xnew=NULL; + sunrealtype ydd, *xold=NULL, *Y=NULL, *xnew=NULL; sunindextype num_refine, N_new; /* Access current solution and mesh arrays */ @@ -413,7 +413,7 @@ realtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) if (marks[i] == 1) num_refine++; N_new = udata->N + num_refine; *Nnew = N_new; /* Store new array length */ - xnew = malloc((N_new) * sizeof(realtype)); + xnew = malloc((N_new) * sizeof(sunrealtype)); /* fill new mesh */ @@ -458,11 +458,11 @@ realtype* adapt_mesh(N_Vector y, sunindextype *Nnew, UserData udata) xnew [input] -- the new mesh ynew [output] -- the vector defined over the new mesh (allocated prior to calling project) */ -static int project(sunindextype Nold, realtype *xold, N_Vector yold, - sunindextype Nnew, realtype *xnew, N_Vector ynew) +static int project(sunindextype Nold, sunrealtype *xold, N_Vector yold, + sunindextype Nnew, sunrealtype *xnew, N_Vector ynew) { sunindextype iv, i, j; - realtype *Yold=NULL, *Ynew=NULL; + sunrealtype *Yold=NULL, *Ynew=NULL; /* Access data arrays */ Yold = N_VGetArrayPointer(yold); /* access data arrays */ diff --git a/examples/arkode/C_serial/ark_kepler.h b/examples/arkode/C_serial/ark_kepler.h index c78ec86d42..f91d6b1e04 100644 --- a/examples/arkode/C_serial/ark_kepler.h +++ b/examples/arkode/C_serial/ark_kepler.h @@ -53,7 +53,7 @@ int ComputeConvergence(int num_dt, sunrealtype* orders, *ord_avg += orders[i - 1]; *ord_max = SUNMAX(*ord_max, orders[i - 1]); } - *ord_avg = *ord_avg / ((realtype)num_dt - 1); + *ord_avg = *ord_avg / ((sunrealtype)num_dt - 1); det = a11 * a22 - a12 * a21; *ord_est = (a11 * b2 - a21 * b1) / det; return 0; diff --git a/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index 6b7752c0c8..6e9902bfaa 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.c +++ b/examples/arkode/C_serial/ark_kpr_mri.c @@ -80,7 +80,7 @@ #include /* serial N_Vector type, fcts., macros */ #include /* dense matrix type, fcts., macros */ #include /* dense linear solver */ -#include /* def. math fcns, 'realtype' */ +#include /* def. math fcns, 'sunrealtype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM ".20Lg" @@ -97,27 +97,27 @@ #define TWO RCONST(2.0) /* User-supplied functions called by the solver */ -static int fse(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fsi(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fn(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Js(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Jsi(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Jn(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ -static realtype r(realtype t, void *user_data); -static realtype s(realtype t, void *user_data); -static realtype rdot(realtype t, void *user_data); -static realtype sdot(realtype t, void *user_data); -static realtype utrue(realtype t, void *user_data); -static realtype vtrue(realtype t, void *user_data); -static int Ytrue(realtype t, N_Vector y, void *user_data); +static sunrealtype r(sunrealtype t, void *user_data); +static sunrealtype s(sunrealtype t, void *user_data); +static sunrealtype rdot(sunrealtype t, void *user_data); +static sunrealtype sdot(sunrealtype t, void *user_data); +static sunrealtype utrue(sunrealtype t, void *user_data); +static sunrealtype vtrue(sunrealtype t, void *user_data); +static int Ytrue(sunrealtype t, N_Vector y, void *user_data); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -127,18 +127,18 @@ int main(int argc, char *argv[]) SUNContext ctx; /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(5.0); /* final time */ - realtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(5.0); /* final time */ + sunrealtype dTout = RCONST(0.1); /* time between outputs */ sunindextype NEQ = 2; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ int solve_type = 0; /* problem configuration type */ - realtype hs = RCONST(0.01); /* slow step size */ - realtype e = RCONST(0.5); /* fast/slow coupling strength */ - realtype G = RCONST(-100.0); /* stiffness at slow time scale */ - realtype w = RCONST(100.0); /* time-scale separation factor */ - realtype reltol = RCONST(0.01); - realtype abstol = 1e-11; + sunrealtype hs = RCONST(0.01); /* slow step size */ + sunrealtype e = RCONST(0.5); /* fast/slow coupling strength */ + sunrealtype G = RCONST(-100.0); /* stiffness at slow time scale */ + sunrealtype w = RCONST(100.0); /* time-scale separation factor */ + sunrealtype reltol = RCONST(0.01); + sunrealtype abstol = 1e-11; /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -156,8 +156,8 @@ int main(int argc, char *argv[]) booleantype imex_slow = SUNFALSE; booleantype deduce = SUNFALSE; FILE *UFID; - realtype hf, gamma, beta, t, tout, rpar[3]; - realtype uerr, verr, uerrtot, verrtot, errtot; + sunrealtype hf, gamma, beta, t, tout, rpar[3]; + sunrealtype uerr, verr, uerrtot, verrtot, errtot; int iout; long int nsts, nstf, nfse, nfsi, nff, nnif, nncf, njef, nnis, nncs, njes, tmp; @@ -680,13 +680,13 @@ int main(int argc, char *argv[]) * ------------------------------*/ /* ff routine to compute the fast portion of the ODE RHS. */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rpar = (realtype *) user_data; - const realtype e = rpar[2]; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype tmp1, tmp2; + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype tmp1, tmp2; /* fill in the RHS function: [0 0]*[(-1+u^2-r(t))/(2*u)] + [ 0 ] @@ -701,14 +701,14 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fs routine to compute the slow portion of the ODE RHS. */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rpar = (realtype *) user_data; - const realtype G = rpar[0]; - const realtype e = rpar[2]; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype tmp1, tmp2; + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype G = rpar[0]; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype tmp1, tmp2; /* fill in the RHS function: [G e]*[(-1+u^2-r(t))/(2*u))] + [rdot(t)/(2*u)] @@ -723,10 +723,10 @@ static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fse routine to compute the slow portion of the ODE RHS. */ -static int fse(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rpar = (realtype *) user_data; - const realtype u = NV_Ith_S(y,0); + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype u = NV_Ith_S(y,0); /* fill in the slow explicit RHS function: [rdot(t)/(2*u)] @@ -739,14 +739,14 @@ static int fse(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fsi routine to compute the slow portion of the ODE RHS.(currently same as fse) */ -static int fsi(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rpar = (realtype *) user_data; - const realtype G = rpar[0]; - const realtype e = rpar[2]; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype tmp1, tmp2; + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype G = rpar[0]; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype tmp1, tmp2; /* fill in the slow implicit RHS function: [G e]*[(-1+u^2-r(t))/(2*u))] @@ -760,14 +760,14 @@ static int fsi(realtype t, N_Vector y, N_Vector ydot, void *user_data) return 0; } -static int fn(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rpar = (realtype *) user_data; - const realtype G = rpar[0]; - const realtype e = rpar[2]; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); - realtype tmp1, tmp2; + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype G = rpar[0]; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); + sunrealtype tmp1, tmp2; /* fill in the RHS function: [G e]*[(-1+u^2-r(t))/(2*u))] + [rdot(t)/(2*u)] @@ -781,20 +781,20 @@ static int fn(realtype t, N_Vector y, N_Vector ydot, void *user_data) return 0; } -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { N_VConst(ZERO, ydot); return(0); } -static int Js(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rpar = (realtype *) user_data; - const realtype G = rpar[0]; - const realtype e = rpar[2]; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype G = rpar[0]; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); /* fill in the Jacobian: [G/2 + (G*(1+r(t))-rdot(t))/(2*u^2) e/2+e*(2+s(t))/(2*v^2)] @@ -808,14 +808,14 @@ static int Js(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, return 0; } -static int Jsi(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rpar = (realtype *) user_data; - const realtype G = rpar[0]; - const realtype e = rpar[2]; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype G = rpar[0]; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); /* fill in the Jacobian: [G/2 + (G*(1+r(t)))/(2*u^2) e/2 + e*(2+s(t))/(2*v^2)] @@ -829,14 +829,14 @@ static int Jsi(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data return 0; } -static int Jn(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rpar = (realtype *) user_data; - const realtype G = rpar[0]; - const realtype e = rpar[2]; - const realtype u = NV_Ith_S(y,0); - const realtype v = NV_Ith_S(y,1); + sunrealtype *rpar = (sunrealtype *) user_data; + const sunrealtype G = rpar[0]; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y,0); + const sunrealtype v = NV_Ith_S(y,1); /* fill in the Jacobian: [G/2 + (G*(1+r(t))-rdot(t))/(2*u^2) e/2 + e*(2+s(t))/(2*v^2)] @@ -855,33 +855,33 @@ static int Jn(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, * Private helper functions * ------------------------------*/ -static realtype r(realtype t, void *user_data) +static sunrealtype r(sunrealtype t, void *user_data) { return( RCONST(0.5)*cos(t) ); } -static realtype s(realtype t, void *user_data) +static sunrealtype s(sunrealtype t, void *user_data) { - realtype *rpar = (realtype *) user_data; + sunrealtype *rpar = (sunrealtype *) user_data; return( cos(rpar[1]*t) ); } -static realtype rdot(realtype t, void *user_data) +static sunrealtype rdot(sunrealtype t, void *user_data) { return( -RCONST(0.5)*sin(t) ); } -static realtype sdot(realtype t, void *user_data) +static sunrealtype sdot(sunrealtype t, void *user_data) { - realtype *rpar = (realtype *) user_data; + sunrealtype *rpar = (sunrealtype *) user_data; return( -rpar[1]*sin(rpar[1]*t) ); } -static realtype utrue(realtype t, void *user_data) +static sunrealtype utrue(sunrealtype t, void *user_data) { return( SUNRsqrt(ONE+r(t,user_data)) ); } -static realtype vtrue(realtype t, void *user_data) +static sunrealtype vtrue(sunrealtype t, void *user_data) { return( SUNRsqrt(TWO+s(t,user_data)) ); } -static int Ytrue(realtype t, N_Vector y, void *user_data) +static int Ytrue(sunrealtype t, N_Vector y, void *user_data) { NV_Ith_S(y,0) = utrue(t,user_data); NV_Ith_S(y,1) = vtrue(t,user_data); diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.c b/examples/arkode/C_serial/ark_onewaycouple_mri.c index 6f3bd3845b..859ea14f64 100644 --- a/examples/arkode/C_serial/ark_onewaycouple_mri.c +++ b/examples/arkode/C_serial/ark_onewaycouple_mri.c @@ -46,7 +46,7 @@ #include /* prototypes for MRIStep fcts., consts */ #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -59,14 +59,14 @@ #endif /* User-supplied functions called by the solver */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to compute the analytic solution */ -static int ans(realtype t, N_Vector ytrue, void *user_data); +static int ans(sunrealtype t, N_Vector ytrue, void *user_data); /* Private function to compute the max error in the solution */ -static int err(N_Vector y, N_Vector ytrue, realtype* e); +static int err(N_Vector y, N_Vector ytrue, sunrealtype* e); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -75,14 +75,14 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ - realtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ + sunrealtype dTout = RCONST(0.1); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ - realtype hs = RCONST(0.001); /* slow step size */ - realtype hf = RCONST(0.0001); /* fast step size */ - realtype u0, v0, w0; /* initial conditions */ + sunrealtype hs = RCONST(0.001); /* slow step size */ + sunrealtype hf = RCONST(0.0001); /* fast step size */ + sunrealtype u0, v0, w0; /* initial conditions */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -92,8 +92,8 @@ int main() void *inner_arkode_mem = NULL; /* empty ARKode memory structure */ MRIStepInnerStepper inner_stepper = NULL; /* inner stepper */ FILE *UFID; - realtype t, tout; - realtype error = RCONST(0.0); + sunrealtype t, tout; + sunrealtype error = RCONST(0.0); int iout; long int nsts, nstf, nfse, nfsi, nff, tmp; @@ -250,9 +250,9 @@ int main() * ------------------------------*/ /* ff routine to compute the fast portion of the ODE RHS. */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype w = NV_Ith_S(y,2); /* access solution values */ + sunrealtype w = NV_Ith_S(y,2); /* access solution values */ /* fill in the RHS function */ NV_Ith_S(ydot,0) = RCONST(0.0); @@ -264,11 +264,11 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fs routine to compute the slow portion of the ODE RHS. */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype c1 = RCONST(50.0); /* problem constant */ - realtype u = NV_Ith_S(y,0); /* access solution values */ - realtype v = NV_Ith_S(y,1); + sunrealtype c1 = RCONST(50.0); /* problem constant */ + sunrealtype u = NV_Ith_S(y,0); /* access solution values */ + sunrealtype v = NV_Ith_S(y,1); /* fill in the RHS function */ NV_Ith_S(ydot,0) = -c1*v; @@ -284,12 +284,12 @@ static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) * ------------------------------------*/ /* function to compute the analytic solution of the ODE */ -static int ans(realtype t, N_Vector ytrue, void *user_data) +static int ans(sunrealtype t, N_Vector ytrue, void *user_data) { - realtype c1 = RCONST(50.0); - realtype c2 = RCONST(5051.0)/RCONST(2501.0); - realtype c3 = RCONST(49.0)/RCONST(2501.0); - realtype c4 = RCONST(51.0)/RCONST(2501.0); + sunrealtype c1 = RCONST(50.0); + sunrealtype c2 = RCONST(5051.0)/RCONST(2501.0); + sunrealtype c3 = RCONST(49.0)/RCONST(2501.0); + sunrealtype c4 = RCONST(51.0)/RCONST(2501.0); /* fill in the solution vector */ NV_Ith_S(ytrue,0) = cos(c1*t); @@ -301,7 +301,7 @@ static int ans(realtype t, N_Vector ytrue, void *user_data) } /* function to compute the max error in the solution */ -static int err(N_Vector y, N_Vector ytrue, realtype* e) +static int err(N_Vector y, N_Vector ytrue, sunrealtype* e) { /* compute the error and store it in ytrue */ N_VLinearSum(RCONST(1.0), y, RCONST(-1.0), ytrue, ytrue); diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c index 86a65f42d3..682da3be53 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c @@ -47,7 +47,7 @@ #include /* prototypes for MRIStep fcts., consts */ #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ -#include /* defs. of realtype, sunindextype, etc */ +#include /* defs. of sunrealtype, sunindextype, etc */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -62,14 +62,14 @@ /* user data structure */ typedef struct { sunindextype N; /* number of intervals */ - realtype dx; /* mesh spacing */ - realtype k; /* diffusion coefficient */ - realtype lam; + sunrealtype dx; /* mesh spacing */ + sunrealtype k; /* diffusion coefficient */ + sunrealtype lam; } *UserData; /* User-supplied Functions Called by the Solver */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to set initial condition */ static int SetInitialCondition(N_Vector y, UserData udata); @@ -81,18 +81,18 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(3.0); /* final time */ - realtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(3.0); /* final time */ + sunrealtype dTout = RCONST(0.1); /* time between outputs */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ - realtype hs = RCONST(0.001); /* slow step size */ - realtype hf = RCONST(0.00002); /* fast step size */ + sunrealtype hs = RCONST(0.001); /* slow step size */ + sunrealtype hf = RCONST(0.00002); /* fast step size */ UserData udata = NULL; /* user data */ - realtype *data; /* array for solution output */ - realtype L = RCONST(5.0); /* domain length */ + sunrealtype *data; /* array for solution output */ + sunrealtype L = RCONST(5.0); /* domain length */ sunindextype N = 1001; /* number of mesh points */ - realtype ep = RCONST(1e-2); + sunrealtype ep = RCONST(1e-2); sunindextype i; /* general problem variables */ @@ -102,7 +102,7 @@ int main() { void *inner_arkode_mem = NULL; /* empty ARKode memory structure */ MRIStepInnerStepper inner_stepper = NULL; /* inner stepper */ FILE *FID, *UFID; - realtype t, tout; + sunrealtype t, tout; int iout; /* Create the SUNDIALS context object for this simulation */ @@ -255,11 +255,11 @@ int main() { * ------------------------------*/ /* ff routine to compute the fast portion of the ODE RHS. */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype *Y=NULL, *Ydot=NULL; + sunrealtype *Y=NULL, *Ydot=NULL; sunindextype i; /* access state array data */ @@ -280,14 +280,14 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* fs routine to compute the slow portion of the ODE RHS. */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype k = udata->k; - realtype dx = udata->dx; - realtype *Y=NULL, *Ydot=NULL; - realtype c1, c2; + sunrealtype k = udata->k; + sunrealtype dx = udata->dx; + sunrealtype *Y=NULL, *Ydot=NULL; + sunrealtype c1, c2; sunindextype i; /* access state array data */ @@ -324,9 +324,9 @@ static int SetInitialCondition(N_Vector y, UserData user_data) { UserData udata = (UserData) user_data; /* access problem data */ sunindextype N = udata->N; /* set variable shortcuts */ - realtype lam = udata->lam; - realtype dx = udata->dx; - realtype *Y=NULL; + sunrealtype lam = udata->lam; + sunrealtype dx = udata->dx; + sunrealtype *Y=NULL; sunindextype i; /* access state array data */ diff --git a/examples/arkode/C_serial/ark_robertson.c b/examples/arkode/C_serial/ark_robertson.c index 299b90e661..264a56eefd 100644 --- a/examples/arkode/C_serial/ark_robertson.c +++ b/examples/arkode/C_serial/ark_robertson.c @@ -39,7 +39,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of 'realtype', 'sunindextype' */ +#include /* defs. of 'sunrealtype', 'sunindextype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -52,23 +52,23 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Main Program */ int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.e11); /* final time */ - realtype dTout = (Tf-T0)/100; /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.e11); /* final time */ + sunrealtype dTout = (Tf-T0)/100; /* time between outputs */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ sunindextype NEQ = 3; /* number of dependent vars. */ @@ -79,16 +79,16 @@ int main() SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *UFID, *FID; - realtype t, tout; + sunrealtype t, tout; int iout; /* set up the initial conditions, tolerances, initial time step size */ - realtype u0 = RCONST(1.0); - realtype v0 = RCONST(0.0); - realtype w0 = RCONST(0.0); - realtype reltol = RCONST(1.0e-4); - realtype abstol = RCONST(1.0e-11); - realtype h0 = RCONST(1.0e-4) * reltol; + sunrealtype u0 = RCONST(1.0); + sunrealtype v0 = RCONST(0.0); + sunrealtype w0 = RCONST(0.0); + sunrealtype reltol = RCONST(1.0e-4); + sunrealtype abstol = RCONST(1.0e-11); + sunrealtype h0 = RCONST(1.0e-4) * reltol; /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -203,11 +203,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype u = NV_Ith_S(y,0); /* access current solution */ - realtype v = NV_Ith_S(y,1); - realtype w = NV_Ith_S(y,2); + sunrealtype u = NV_Ith_S(y,0); /* access current solution */ + sunrealtype v = NV_Ith_S(y,1); + sunrealtype w = NV_Ith_S(y,2); /* Fill in ODE RHS function */ NV_Ith_S(ydot,0) = -0.04*u + 1.e4*v*w; @@ -218,11 +218,11 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype v = NV_Ith_S(y,1); /* access current solution */ - realtype w = NV_Ith_S(y,2); + sunrealtype v = NV_Ith_S(y,1); /* access current solution */ + sunrealtype w = NV_Ith_S(y,2); SUNMatZero(J); /* initialize Jacobian to zero */ /* Fill in the Jacobian of the ODE RHS function */ @@ -280,14 +280,14 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* compare the solution at the final time 1e11s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ - realtype ZERO=RCONST(0.0); - realtype ONE=RCONST(1.0); + sunrealtype err; /* wrms error */ + sunrealtype ZERO=RCONST(0.0); + sunrealtype ONE=RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/arkode/C_serial/ark_robertson_constraints.c b/examples/arkode/C_serial/ark_robertson_constraints.c index 827e890e2b..22d9d0bbba 100644 --- a/examples/arkode/C_serial/ark_robertson_constraints.c +++ b/examples/arkode/C_serial/ark_robertson_constraints.c @@ -40,7 +40,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of 'realtype', 'sunindextype' */ +#include /* defs. of 'sunrealtype', 'sunindextype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -53,25 +53,25 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Main Program */ int main() { - realtype ONE = RCONST(1.0); + sunrealtype ONE = RCONST(1.0); /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.e11); /* final time */ - realtype dTout = (Tf-T0)/100; /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.e11); /* final time */ + sunrealtype dTout = (Tf-T0)/100; /* time between outputs */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ sunindextype NEQ = 3; /* number of dependent vars. */ @@ -83,17 +83,17 @@ int main() SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *UFID; - realtype t, tout; + sunrealtype t, tout; int iout; long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, nnf, ncfn, netf, nctf; /* set up the initial conditions, tolerances, initial time step size */ - realtype u0 = RCONST(1.0); - realtype v0 = RCONST(0.0); - realtype w0 = RCONST(0.0); - realtype reltol = RCONST(1.0e-3); - realtype abstol = RCONST(1.0e-7); - realtype h0 = RCONST(1.0e-4) * reltol; + sunrealtype u0 = RCONST(1.0); + sunrealtype v0 = RCONST(0.0); + sunrealtype w0 = RCONST(0.0); + sunrealtype reltol = RCONST(1.0e-3); + sunrealtype abstol = RCONST(1.0e-7); + sunrealtype h0 = RCONST(1.0e-4) * reltol; /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -244,11 +244,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype u = NV_Ith_S(y,0); /* access current solution */ - realtype v = NV_Ith_S(y,1); - realtype w = NV_Ith_S(y,2); + sunrealtype u = NV_Ith_S(y,0); /* access current solution */ + sunrealtype v = NV_Ith_S(y,1); + sunrealtype w = NV_Ith_S(y,2); /* Fill in ODE RHS function */ NV_Ith_S(ydot,0) = -0.04*u + 1.e4*v*w; @@ -259,11 +259,11 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype v = NV_Ith_S(y,1); /* access current solution */ - realtype w = NV_Ith_S(y,2); + sunrealtype v = NV_Ith_S(y,1); /* access current solution */ + sunrealtype w = NV_Ith_S(y,2); SUNMatZero(J); /* initialize Jacobian to zero */ /* Fill in the Jacobian of the ODE RHS function */ @@ -321,14 +321,14 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* compare the solution at the final time 1e11s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ - realtype ZERO=RCONST(0.0); - realtype ONE=RCONST(1.0); + sunrealtype err; /* wrms error */ + sunrealtype ZERO=RCONST(0.0); + sunrealtype ONE=RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/arkode/C_serial/ark_robertson_root.c b/examples/arkode/C_serial/ark_robertson_root.c index f2c4331d3b..6682db8606 100644 --- a/examples/arkode/C_serial/ark_robertson_root.c +++ b/examples/arkode/C_serial/ark_robertson_root.c @@ -42,7 +42,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of 'realtype', 'sunindextype' */ +#include /* defs. of 'sunrealtype', 'sunindextype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -55,10 +55,10 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); @@ -67,9 +67,9 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype T1 = RCONST(0.4); /* first output time */ - realtype TMult = RCONST(10.0); /* output time multiplication factor */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype T1 = RCONST(0.4); /* first output time */ + sunrealtype TMult = RCONST(10.0); /* output time multiplication factor */ int Nt = 12; /* total number of output times */ sunindextype NEQ = 3; /* number of dependent vars. */ @@ -85,15 +85,15 @@ int main() SUNLinearSolver LS = NULL; /* empty linear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ FILE *UFID; - realtype t, tout; + sunrealtype t, tout; int iout; long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, nnf, ncfn, netf, nge; /* set up the initial conditions */ - realtype u0 = RCONST(1.0); - realtype v0 = RCONST(0.0); - realtype w0 = RCONST(0.0); - realtype reltol = RCONST(1.0e-4); + sunrealtype u0 = RCONST(1.0); + sunrealtype v0 = RCONST(0.0); + sunrealtype w0 = RCONST(0.0); + sunrealtype reltol = RCONST(1.0e-4); /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -252,11 +252,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype u = NV_Ith_S(y,0); /* access current solution */ - realtype v = NV_Ith_S(y,1); - realtype w = NV_Ith_S(y,2); + sunrealtype u = NV_Ith_S(y,0); /* access current solution */ + sunrealtype v = NV_Ith_S(y,1); + sunrealtype w = NV_Ith_S(y,2); /* Fill in ODE RHS function */ NV_Ith_S(ydot,0) = -0.04*u + 1.e4*v*w; @@ -267,11 +267,11 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype v = NV_Ith_S(y,1); /* access current solution */ - realtype w = NV_Ith_S(y,2); + sunrealtype v = NV_Ith_S(y,1); /* access current solution */ + sunrealtype w = NV_Ith_S(y,2); SUNMatZero(J); /* initialize Jacobian to zero */ /* Fill in the Jacobian of the ODE RHS function */ @@ -289,10 +289,10 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } /* g routine to compute the root-finding function g(t,y). */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype u = NV_Ith_S(y,0); /* access current solution */ - realtype w = NV_Ith_S(y,2); + sunrealtype u = NV_Ith_S(y,0); /* access current solution */ + sunrealtype w = NV_Ith_S(y,2); gout[0] = u - RCONST(0.0001); /* check for u == 1e-4 */ gout[1] = w - RCONST(0.01); /* check for w == 1e-2 */ diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.c b/examples/arkode/C_serial/ark_twowaycouple_mri.c index e9151211fd..88b738fcc7 100644 --- a/examples/arkode/C_serial/ark_twowaycouple_mri.c +++ b/examples/arkode/C_serial/ark_twowaycouple_mri.c @@ -37,7 +37,7 @@ #include /* prototypes for MRIStep fcts., consts */ #include /* prototypes for ARKStep fcts., consts */ #include /* serial N_Vector types, fcts., macros */ -#include /* def. of type 'realtype' */ +#include /* def. of type 'sunrealtype' */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -50,8 +50,8 @@ #endif /* User-supplied functions called by the solver */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -60,14 +60,14 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(2.0); /* final time */ - realtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(2.0); /* final time */ + sunrealtype dTout = RCONST(0.1); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ - realtype hs = RCONST(0.001); /* slow step size */ - realtype hf = RCONST(0.00002); /* fast step size */ - realtype u0, v0, w0; /* initial conditions */ + sunrealtype hs = RCONST(0.001); /* slow step size */ + sunrealtype hf = RCONST(0.00002); /* fast step size */ + sunrealtype u0, v0, w0; /* initial conditions */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -76,7 +76,7 @@ int main() void *inner_arkode_mem = NULL; /* ARKode memory structure */ MRIStepInnerStepper inner_stepper = NULL; /* inner stepper */ FILE *UFID; - realtype t, tout; + sunrealtype t, tout; int iout; long int nsts, nstf, nfse, nfsi, nff, tmp; @@ -220,11 +220,11 @@ int main() * ------------------------------*/ /* ff routine to compute the fast portion of the ODE RHS. */ -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype c1 = RCONST(100.0); /* problem constant */ - realtype u = NV_Ith_S(y,0); /* access solution values */ - realtype v = NV_Ith_S(y,1); + sunrealtype c1 = RCONST(100.0); /* problem constant */ + sunrealtype u = NV_Ith_S(y,0); /* access solution values */ + sunrealtype v = NV_Ith_S(y,1); /* fill in the RHS function */ NV_Ith_S(ydot,0) = c1 * v; @@ -236,9 +236,9 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* fs routine to compute the slow portion of the ODE RHS. */ -static int fs(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype w = NV_Ith_S(y,2); /* access solution values */ + sunrealtype w = NV_Ith_S(y,2); /* access solution values */ /* fill in the RHS function */ NV_Ith_S(ydot,0) = w; diff --git a/examples/arkode/F77_parallel/fark_diag_kry_bbd_p.f b/examples/arkode/F77_parallel/fark_diag_kry_bbd_p.f index c4f50a8a80..9cdc56f94d 100644 --- a/examples/arkode/F77_parallel/fark_diag_kry_bbd_p.f +++ b/examples/arkode/F77_parallel/fark_diag_kry_bbd_p.f @@ -16,7 +16,7 @@ C Solves problem twice -- with left and right preconditioning. C C Note that this problem should only work with SUNDIALS configured -C to use 'realtype' as 'double' and 'sunindextype' as '64bit' +C to use 'sunrealtype' as 'double' and 'sunindextype' as '64bit' C ---------------------------------------------------------------- C C Include MPI-Fortran header file for MPI_COMM_WORLD, MPI types. diff --git a/examples/arkode/F77_serial/fark_diurnal_kry_bp.f b/examples/arkode/F77_serial/fark_diurnal_kry_bp.f index 11725b79e6..e9e4212122 100644 --- a/examples/arkode/F77_serial/fark_diurnal_kry_bp.f +++ b/examples/arkode/F77_serial/fark_diurnal_kry_bp.f @@ -36,7 +36,7 @@ C using the FARKBP banded preconditioner. C C Note that this problem should only work with SUNDIALS configured -C to use 'realtype' as 'double' and 'sunindextype' as '64bit' +C to use 'sunrealtype' as 'double' and 'sunindextype' as '64bit' C C The second and third dimensions of U here must match the values of C MX and MY, for consistency with the output statements below. diff --git a/examples/arkode/F77_serial/fark_roberts_dnsL.f b/examples/arkode/F77_serial/fark_roberts_dnsL.f index 1dd337dbe7..1af62b6224 100644 --- a/examples/arkode/F77_serial/fark_roberts_dnsL.f +++ b/examples/arkode/F77_serial/fark_roberts_dnsL.f @@ -38,7 +38,7 @@ C various counters of interest are printed. C C Note that this problem should only work with SUNDIALS configured -C to use 'realtype' as 'double' and 'sunindextype' as '32bit' +C to use 'sunrealtype' as 'double' and 'sunindextype' as '32bit' C ---------------------------------------------------------------- C IMPLICIT NONE diff --git a/examples/arkode/F90_parallel/fark_heat2D.f90 b/examples/arkode/F90_parallel/fark_heat2D.f90 index 78b7ed0cf6..1978c161ff 100644 --- a/examples/arkode/F90_parallel/fark_heat2D.f90 +++ b/examples/arkode/F90_parallel/fark_heat2D.f90 @@ -74,20 +74,20 @@ module UserData real*8 :: dy ! y-directional mesh spacing real*8 :: kx ! x-directional diffusion coefficient real*8 :: ky ! y-directional diffusion coefficient - real(kind=REALTYPE), dimension(:,:), allocatable :: h ! heat source vector - real(kind=REALTYPE), dimension(:,:), allocatable :: d ! inverse of Jacobian diagonal + real(kind=sunrealtype), dimension(:,:), allocatable :: h ! heat source vector + real(kind=sunrealtype), dimension(:,:), allocatable :: d ! inverse of Jacobian diagonal integer :: comm ! communicator object integer :: myid ! MPI process ID integer :: nprocs ! total number of MPI processes logical :: HaveNbor(2,2) ! flags denoting neighbor on boundary - real(kind=REALTYPE), dimension(:), allocatable :: Erecv ! receive buffers for neighbor exchange - real(kind=REALTYPE), dimension(:), allocatable :: Wrecv - real(kind=REALTYPE), dimension(:), allocatable :: Nrecv - real(kind=REALTYPE), dimension(:), allocatable :: Srecv - real(kind=REALTYPE), dimension(:), allocatable :: Esend ! send buffers for neighbor exchange - real(kind=REALTYPE), dimension(:), allocatable :: Wsend - real(kind=REALTYPE), dimension(:), allocatable :: Nsend - real(kind=REALTYPE), dimension(:), allocatable :: Ssend + real(kind=sunrealtype), dimension(:), allocatable :: Erecv ! receive buffers for neighbor exchange + real(kind=sunrealtype), dimension(:), allocatable :: Wrecv + real(kind=sunrealtype), dimension(:), allocatable :: Nrecv + real(kind=sunrealtype), dimension(:), allocatable :: Srecv + real(kind=sunrealtype), dimension(:), allocatable :: Esend ! send buffers for neighbor exchange + real(kind=sunrealtype), dimension(:), allocatable :: Wsend + real(kind=sunrealtype), dimension(:), allocatable :: Nsend + real(kind=sunrealtype), dimension(:), allocatable :: Ssend contains @@ -224,7 +224,7 @@ subroutine Exchange(y, ierr) ! declarations implicit none include "mpif.h" - real(kind=REALTYPE), intent(in) :: y(nxl,nyl) + real(kind=sunrealtype), intent(in) :: y(nxl,nyl) integer, intent(out) :: ierr integer :: reqSW, reqSE, reqSS, reqSN, reqRW, reqRE, reqRS, reqRN; integer :: stat(MPI_STATUS_SIZE) @@ -439,9 +439,9 @@ subroutine PRMS(y,yrms,ierr) implicit none include "mpif.h" integer, intent(out) :: ierr - real(kind=REALTYPE), intent(in) :: y(nxl,nyl) - real(kind=REALTYPE), intent(out) :: yrms - real(kind=REALTYPE) :: lsum, gsum + real(kind=sunrealtype), intent(in) :: y(nxl,nyl) + real(kind=sunrealtype), intent(out) :: yrms + real(kind=sunrealtype) :: lsum, gsum ! internals lsum = sum(y**2) @@ -480,17 +480,17 @@ program driver integer*8, parameter :: ny_ = 120 integer, parameter :: PCGpretype = 1 ! enable preconditioner integer, parameter :: PCGmaxl = 20 ! max num. PCG iterations - real(kind=REALTYPE), parameter :: T0 = 0.d0 ! initial time - real(kind=REALTYPE), parameter :: Tf = 0.3d0 ! final time - real(kind=REALTYPE), parameter :: rtol = 1.d-5 ! relative and absolute tolerances - real(kind=REALTYPE), parameter :: atol = 1.d-10 - real(kind=REALTYPE), parameter :: kx_ = 0.5d0 ! heat conductivity coefficients - real(kind=REALTYPE), parameter :: ky_ = 0.75d0 - real(kind=REALTYPE), parameter :: nlscoef = 1.d-7 ! nonlinear solver tolerance factor + real(kind=sunrealtype), parameter :: T0 = 0.d0 ! initial time + real(kind=sunrealtype), parameter :: Tf = 0.3d0 ! final time + real(kind=sunrealtype), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(kind=sunrealtype), parameter :: atol = 1.d-10 + real(kind=sunrealtype), parameter :: kx_ = 0.5d0 ! heat conductivity coefficients + real(kind=sunrealtype), parameter :: ky_ = 0.75d0 + real(kind=sunrealtype), parameter :: nlscoef = 1.d-7 ! nonlinear solver tolerance factor ! solution vector and other local variables - real(kind=REALTYPE), allocatable :: y(:,:) - real(kind=REALTYPE) :: rout(6), rpar, t, dTout, tout, urms + real(kind=sunrealtype), allocatable :: y(:,:) + real(kind=sunrealtype) :: rout(6), rpar, t, dTout, tout, urms integer*8 :: iout(35), ipar, N, Ntot, i, j integer :: flag, ioutput logical :: outproc @@ -712,11 +712,11 @@ subroutine farkifun(t, y, ydot, ipar, rpar, ierr) use UserData implicit none include "mpif.h" - real(kind=REALTYPE), intent(in) :: t, rpar - real(kind=REALTYPE), intent(in) :: y(nxl,nyl) - real(kind=REALTYPE), intent(out) :: ydot(nxl,nyl) + real(kind=sunrealtype), intent(in) :: t, rpar + real(kind=sunrealtype), intent(in) :: y(nxl,nyl) + real(kind=sunrealtype), intent(out) :: ydot(nxl,nyl) integer*8, intent(in) :: ipar - real(kind=REALTYPE) :: c1, c2, c3 + real(kind=sunrealtype) :: c1, c2, c3 integer, intent(out) :: ierr integer*8 :: i, j @@ -803,10 +803,10 @@ subroutine farkefun(t, y, ydot, ipar, rpar, ierr) ! declarations use UserData implicit none - real(kind=REALTYPE), intent(in) :: t, rpar + real(kind=sunrealtype), intent(in) :: t, rpar integer*8, intent(in) :: ipar - real(kind=REALTYPE), intent(in) :: y(nxl,nyl) - real(kind=REALTYPE), intent(out) :: ydot(nxl,nyl) + real(kind=sunrealtype), intent(in) :: y(nxl,nyl) + real(kind=sunrealtype), intent(out) :: ydot(nxl,nyl) integer, intent(out) :: ierr ! internals @@ -827,12 +827,12 @@ subroutine farkpset(t, y, fy, jok, jcur, gamma, hcur, ipar, & ! declarations use UserData implicit none - real(kind=REALTYPE), intent(in) :: t, gamma, hcur, rpar - real(kind=REALTYPE), intent(in) :: y(nxl,nyl), fy(nxl,nyl) + real(kind=sunrealtype), intent(in) :: t, gamma, hcur, rpar + real(kind=sunrealtype), intent(in) :: y(nxl,nyl), fy(nxl,nyl) integer*8, intent(in) :: ipar integer, intent(in) :: jok integer, intent(out) :: jcur, ierr - real(kind=REALTYPE) :: c + real(kind=sunrealtype) :: c ! internals c = 1.d0 + gamma*2.d0*(kx/dx/dx + ky/dy/dy) @@ -855,10 +855,10 @@ subroutine farkpsol(t, y, fy, r, z, gamma, delta, lr, & ! declarations use UserData implicit none - real(kind=REALTYPE), intent(in) :: t, gamma, delta, rpar + real(kind=sunrealtype), intent(in) :: t, gamma, delta, rpar integer*8, intent(in) :: ipar - real(kind=REALTYPE), intent(in) :: y(nxl,nyl), fy(nxl,nyl), r(nxl,nyl) - real(kind=REALTYPE), intent(out) :: z(nxl,nyl) + real(kind=sunrealtype), intent(in) :: y(nxl,nyl), fy(nxl,nyl), r(nxl,nyl) + real(kind=sunrealtype), intent(out) :: z(nxl,nyl) integer, intent(in) :: lr integer, intent(out) :: ierr diff --git a/examples/arkode/F90_serial/ark_bruss.f90 b/examples/arkode/F90_serial/ark_bruss.f90 index a5e989745d..580cd21e4e 100644 --- a/examples/arkode/F90_serial/ark_bruss.f90 +++ b/examples/arkode/F90_serial/ark_bruss.f90 @@ -48,11 +48,11 @@ program driver ! general problem variables integer*8, parameter :: NEQ=3 - real(kind=REALTYPE), parameter :: T0=0.d0, Tf=10.d0 - real(kind=REALTYPE) :: dTout, Tout, Tcur, rtol, atol, rout(6) + real(kind=sunrealtype), parameter :: T0=0.d0, Tf=10.d0 + real(kind=sunrealtype) :: dTout, Tout, Tcur, rtol, atol, rout(6) integer :: it, Nt, ier integer*8 :: iout(35) - real(kind=REALTYPE), dimension(NEQ) :: y + real(kind=sunrealtype), dimension(NEQ) :: y ! real/integer parameters to pass through to supplied functions ! ipar(1) -> unused @@ -60,12 +60,12 @@ program driver ! rpar(2) -> "b" parameter ! rpar(3) -> "ep" parameter integer*8 :: ipar - real(kind=REALTYPE) :: rpar(3) + real(kind=sunrealtype) :: rpar(3) ! solver parameters integer :: adapt_method integer*8 :: order - real(kind=REALTYPE) :: nlscoef, adapt_params + real(kind=sunrealtype) :: nlscoef, adapt_params !----------------------- ! set some solver parameters @@ -205,10 +205,10 @@ subroutine farkifun(t, y, ydot, ipar, rpar, ier) include "sundials/sundials_fconfig.h" ! Arguments - real(kind=REALTYPE), intent(in) :: t, rpar(3) + real(kind=sunrealtype), intent(in) :: t, rpar(3) integer*8, intent(in) :: ipar(1) - real(kind=REALTYPE), intent(in) :: y(3) - real(kind=REALTYPE), intent(out) :: ydot(3) + real(kind=sunrealtype), intent(in) :: y(3) + real(kind=sunrealtype), intent(out) :: ydot(3) integer, intent(out) :: ier ! temporary variables @@ -241,10 +241,10 @@ subroutine farkefun(t, y, ydot, ipar, rpar, ier) include "sundials/sundials_fconfig.h" ! Arguments - real(kind=REALTYPE), intent(in) :: t, rpar(3) + real(kind=sunrealtype), intent(in) :: t, rpar(3) integer*8, intent(in) :: ipar(1) - real(kind=REALTYPE), intent(in) :: y(3) - real(kind=REALTYPE), intent(out) :: ydot(3) + real(kind=sunrealtype), intent(in) :: y(3) + real(kind=sunrealtype), intent(out) :: ydot(3) integer, intent(out) :: ier ! temporary variables @@ -277,12 +277,12 @@ subroutine farkdjac(neq,t,y,fy,DJac,h,ipar,rpar,wk1,wk2,wk3,ier) include "sundials/sundials_fconfig.h" ! Arguments - real(kind=REALTYPE), intent(in) :: t, h, rpar(3) + real(kind=sunrealtype), intent(in) :: t, h, rpar(3) integer*8, intent(in) :: ipar(1) integer*8, intent(in) :: neq integer, intent(out) :: ier - real(kind=REALTYPE), intent(in), dimension(neq) :: y, fy, wk1, wk2, wk3 - real(kind=REALTYPE), intent(out) :: DJac(neq,neq) + real(kind=sunrealtype), intent(in), dimension(neq) :: y, fy, wk1, wk2, wk3 + real(kind=sunrealtype), intent(out) :: DJac(neq,neq) ! temporary variables real*8 :: u, v, w, a, b, ep diff --git a/examples/arkode/F90_serial/ark_bruss1D_FEM_klu.f90 b/examples/arkode/F90_serial/ark_bruss1D_FEM_klu.f90 index 2c54b42ec7..d80ebbca2c 100644 --- a/examples/arkode/F90_serial/ark_bruss1D_FEM_klu.f90 +++ b/examples/arkode/F90_serial/ark_bruss1D_FEM_klu.f90 @@ -177,17 +177,17 @@ program driver ! Declarations ! general problem variables - real(kind=REALTYPE), parameter :: T0=0.d0, Tf=10.d0 - real(kind=REALTYPE) :: rtol, atol, rout(6), Tout, Tcur + real(kind=sunrealtype), parameter :: T0=0.d0, Tf=10.d0 + real(kind=sunrealtype) :: rtol, atol, rout(6), Tout, Tcur real*8 :: dTout, pi, h, z integer :: i, it, Nt, ier, ordering, sparsetype, time_dep integer*8 :: iout(35), NEQ, nnz, Iinput - real(kind=REALTYPE), allocatable :: y(:,:), umask(:,:) - real(kind=REALTYPE), allocatable :: vmask(:,:), wmask(:,:) + real(kind=sunrealtype), allocatable :: y(:,:), umask(:,:) + real(kind=sunrealtype), allocatable :: vmask(:,:), wmask(:,:) ! dummy real/integer parameters to pass through to supplied functions integer*8 :: ipar - real(kind=REALTYPE) :: rpar + real(kind=sunrealtype) :: rpar !----------------------- @@ -375,11 +375,11 @@ subroutine FARKIFun(t, y, ydot, ipar, rpar, ier) implicit none ! Arguments - real(kind=REALTYPE), intent(in) :: t, rpar(1) + real(kind=sunrealtype), intent(in) :: t, rpar(1) integer*8, intent(in) :: ipar(1) integer, intent(out) :: ier - real(kind=REALTYPE), intent(in) :: y(3,N) - real(kind=REALTYPE), intent(out) :: ydot(3,N) + real(kind=sunrealtype), intent(in) :: y(3,N) + real(kind=sunrealtype), intent(out) :: ydot(3,N) ! Local data integer :: ix @@ -554,10 +554,10 @@ subroutine farkefun(t, y, ydot, ipar, rpar, ier) implicit none ! Arguments - real(kind=REALTYPE), intent(in) :: t, rpar(1) + real(kind=sunrealtype), intent(in) :: t, rpar(1) integer*8, intent(in) :: ipar(1) - real(kind=REALTYPE), intent(in) :: y(3,N) - real(kind=REALTYPE), intent(out) :: ydot(3,N) + real(kind=sunrealtype), intent(in) :: y(3,N) + real(kind=sunrealtype), intent(out) :: ydot(3,N) integer, intent(out) :: ier ! return with success (since fully implicit) @@ -582,9 +582,9 @@ subroutine farkspjac(t, y, fy, neq, nnz, Jdata, Jcolvals, & implicit none ! Arguments - real(kind=REALTYPE), intent(in) :: t, h, rpar(1) - real(kind=REALTYPE), intent(in), dimension(3,N) :: y, fy, wk1, wk2, wk3 - real(kind=REALTYPE), intent(out) :: Jdata(nnz) + real(kind=sunrealtype), intent(in) :: t, h, rpar(1) + real(kind=sunrealtype), intent(in), dimension(3,N) :: y, fy, wk1, wk2, wk3 + real(kind=sunrealtype), intent(out) :: Jdata(nnz) integer*8, intent(in) :: ipar(1), neq, nnz integer(kind=SUNINDEXTYPE), intent(out) :: Jcolvals(nnz) integer(kind=SUNINDEXTYPE), intent(out) :: Jrowptrs(neq+1) @@ -1019,9 +1019,9 @@ subroutine farkspmass(t, neq, nnz, Mdata, Mcolvals, Mrowptrs, & implicit none ! Arguments - real(kind=REALTYPE), intent(in) :: t, rpar(1) - real(kind=REALTYPE), intent(in), dimension(3,N) :: wk1, wk2, wk3 - real(kind=REALTYPE), intent(out) :: Mdata(nnz) + real(kind=sunrealtype), intent(in) :: t, rpar(1) + real(kind=sunrealtype), intent(in), dimension(3,N) :: wk1, wk2, wk3 + real(kind=sunrealtype), intent(out) :: Mdata(nnz) integer*8, intent(in) :: ipar(1), neq, nnz integer(kind=SUNINDEXTYPE), intent(out) :: Mcolvals(nnz) integer(kind=SUNINDEXTYPE), intent(out) :: Mrowptrs(neq+1) diff --git a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp index 45eae942b2..37e8f960cf 100644 --- a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp +++ b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp @@ -76,17 +76,17 @@ using namespace std; #define ONE RCONST(1.0) // Functions Called by the Solver -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // Private function to output results -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); // Private function to print final statistics static void PrintFinalStats(void *cvode_mem, bool direct); @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) if (check_retval((void *)abstol, "N_VClone", 0)) return 1; // Initialize y - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); for (sunindextype groupj = 0; groupj < neq; groupj += GROUPSIZE) { ydata[groupj] = Y1; @@ -174,10 +174,10 @@ int main(int argc, char *argv[]) N_VCopyToDevice_Sycl(y); // Set the scalar relative tolerance - realtype reltol = RTOL; + sunrealtype reltol = RTOL; // Set the vector absolute tolerance - realtype* abstol_data = N_VGetArrayPointer(abstol); + sunrealtype* abstol_data = N_VGetArrayPointer(abstol); for (sunindextype groupj = 0; groupj < neq; groupj += GROUPSIZE) { abstol_data[groupj] = ATOL1; @@ -254,8 +254,8 @@ int main(int argc, char *argv[]) printf(" output disabled\n"); int iout = 0; - realtype tout = T1; - realtype t; + sunrealtype tout = T1; + sunrealtype t; // Start timer chrono::time_point tstart = chrono::steady_clock::now(); @@ -316,11 +316,11 @@ int main(int argc, char *argv[]) // Compute the right-hand side function, ydot = f(t, y). -static int f(realtype t, N_Vector y, N_Vector ydot, void* user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { UserData* udata = (UserData*) user_data; - realtype* ydata = N_VGetDeviceArrayPointer(y); - realtype* ydotdata = N_VGetDeviceArrayPointer(ydot); + sunrealtype* ydata = N_VGetDeviceArrayPointer(y); + sunrealtype* ydotdata = N_VGetDeviceArrayPointer(ydot); const size_t ngroups = static_cast(udata->ngroups); const sunindextype N = GROUPSIZE; @@ -331,12 +331,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void* user_data) { sunindextype groupj = idx[0]; - realtype y1 = ydata[N * groupj]; - realtype y2 = ydata[N * groupj + 1]; - realtype y3 = ydata[N * groupj + 2]; + sunrealtype y1 = ydata[N * groupj]; + sunrealtype y2 = ydata[N * groupj + 1]; + sunrealtype y3 = ydata[N * groupj + 2]; - realtype yd1 = RCONST(-0.04) * y1 + RCONST(1.0e4) * y2 * y3; - realtype yd3 = RCONST(3.0e7) * y2 * y2; + sunrealtype yd1 = RCONST(-0.04) * y1 + RCONST(1.0e4) * y2 * y3; + sunrealtype yd3 = RCONST(3.0e7) * y2 * y2; ydotdata[N * groupj] = yd1; ydotdata[N * groupj + 1] = -yd1 - yd3; @@ -351,12 +351,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void* user_data) // Compute the right-hand side Jacobian, J(t,y) = df/dy. -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData* udata = (UserData*) user_data; - realtype* Jdata = SUNMatrix_OneMklDense_Data(J); - realtype* ydata = N_VGetDeviceArrayPointer(y); + sunrealtype* Jdata = SUNMatrix_OneMklDense_Data(J); + sunrealtype* ydata = N_VGetDeviceArrayPointer(y); const size_t ngroups = static_cast(udata->ngroups); const sunindextype N = GROUPSIZE; @@ -369,8 +369,8 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, sunindextype groupj = idx[0]; // get y values - realtype y2 = ydata[N * groupj + 1]; - realtype y3 = ydata[N * groupj + 2]; + sunrealtype y2 = ydata[N * groupj + 1]; + sunrealtype y3 = ydata[N * groupj + 2]; // first col of block Jdata[NN * groupj] = RCONST(-0.04); @@ -395,14 +395,14 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } -static int PSolve(realtype t, N_Vector y, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector y, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { UserData* udata = (UserData*) user_data; - realtype* ydata = N_VGetDeviceArrayPointer(y); - realtype* rdata = N_VGetDeviceArrayPointer(r); - realtype* zdata = N_VGetDeviceArrayPointer(z); + sunrealtype* ydata = N_VGetDeviceArrayPointer(y); + sunrealtype* rdata = N_VGetDeviceArrayPointer(r); + sunrealtype* zdata = N_VGetDeviceArrayPointer(z); const size_t ngroups = static_cast(udata->ngroups); const sunindextype N = GROUPSIZE; @@ -423,14 +423,14 @@ static int PSolve(realtype t, N_Vector y, N_Vector f, N_Vector r, // [ 0 -d 1 ] [ z2 ] [ r2 ] // get y values - realtype y2 = ydata[i1]; - realtype y3 = ydata[i2]; + sunrealtype y2 = ydata[i1]; + sunrealtype y3 = ydata[i2]; // set matrix values - realtype a = gamma * RCONST(0.04); - realtype b = gamma * RCONST(1.0e4) * y3; - realtype c = gamma * RCONST(1.0e4) * y2; - realtype d = gamma * RCONST(6.0e7) * y2; + sunrealtype a = gamma * RCONST(0.04); + sunrealtype b = gamma * RCONST(1.0e4) * y3; + sunrealtype c = gamma * RCONST(1.0e4) * y2; + sunrealtype d = gamma * RCONST(6.0e7) * y2; // Initial Jacobi iteration with zero guess @@ -447,9 +447,9 @@ static int PSolve(realtype t, N_Vector y, N_Vector f, N_Vector r, for (int i = 1; i < 10; ++i) { - realtype z0 = zdata[i0]; - realtype z1 = zdata[i1]; - realtype z2 = zdata[i2]; + sunrealtype z0 = zdata[i0]; + sunrealtype z1 = zdata[i1]; + sunrealtype z2 = zdata[i2]; // z0 = (r0 + b * z1 + x * z2 / (1 + a) zdata[i0] = (rdata[i0] + b * z1 + c * z2) / (ONE + a); @@ -472,7 +472,7 @@ static int PSolve(realtype t, N_Vector y, N_Vector f, N_Vector r, // Output solution -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index 547f6cd342..922fab48ce 100644 --- a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp +++ b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp @@ -78,18 +78,18 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -99,8 +99,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -137,10 +137,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -149,10 +149,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -161,8 +161,8 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance int maxsteps; // max number of steps between outputs // Linear solver and preconditioner settings @@ -171,7 +171,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // Inverse of Jacobian diagonal for preconditioner N_Vector d; @@ -197,14 +197,14 @@ struct UserData // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -237,10 +237,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -250,7 +250,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -442,9 +442,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata->tf / udata->nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata); @@ -499,12 +499,12 @@ int main(int argc, char* argv[]) flag = SolutionError(t, u, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } } @@ -644,23 +644,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -727,7 +727,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -757,15 +757,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -774,15 +774,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -822,10 +822,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -926,8 +926,8 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Start timer double t1 = MPI_Wtime(); @@ -936,17 +936,17 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, UserData *udata = (UserData *) user_data; // Access data array - realtype *diag = N_VGetArrayPointer(udata->d); + sunrealtype *diag = N_VGetArrayPointer(udata->d); if (check_flag((void *) diag, "N_VGetArrayPointer", 0)) return -1; // Constants for computing diffusion - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Set all entries of d to the inverse diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE / (ONE - gamma * cc); + sunrealtype c = ONE / (ONE - gamma * cc); N_VConst(c, udata->d); // Stop timer @@ -960,8 +960,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { // Start timer @@ -1061,7 +1061,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -1480,11 +1480,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -1499,7 +1499,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -1520,7 +1520,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -1614,7 +1614,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); if (udata->forcing) { cout << " t "; @@ -1665,7 +1665,7 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); if (udata->forcing) { @@ -1676,7 +1676,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } } @@ -1684,10 +1684,10 @@ static int OpenOutput(UserData *udata) } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { int flag; - realtype max; + sunrealtype max; bool outproc = (udata->myid_c == 0); if (udata->output > 0) @@ -1703,7 +1703,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) } // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -1721,7 +1721,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution and error to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -1734,7 +1734,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (udata->forcing) { // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -1827,8 +1827,8 @@ static int OutputStats(void *cvode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp index 2558368073..86350c0046 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp @@ -85,18 +85,18 @@ struct UserData sundials::Context& sunctx; // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -106,8 +106,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -144,10 +144,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -156,10 +156,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -168,8 +168,8 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance int maxsteps; // max number of steps between outputs // Linear solver and preconditioner settings @@ -177,7 +177,7 @@ struct UserData bool prec; // preconditioner on/off int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // hypre PFMG settings (hypre defaults) HYPRE_Int pfmg_relax; // type of relaxation: @@ -244,7 +244,7 @@ SUNMatrix_ID Hypre5ptMatrix_GetID(SUNMatrix A); SUNMatrix Hypre5ptMatrix_Clone(SUNMatrix A); void Hypre5ptMatrix_Destroy(SUNMatrix A); int Hypre5ptMatrix_Copy(SUNMatrix A, SUNMatrix B); -int Hypre5ptMatrix_ScaleAddI(realtype c, SUNMatrix A); +int Hypre5ptMatrix_ScaleAddI(sunrealtype c, SUNMatrix A); // ----------------------------------------------------------------------------- // Custom hypre linear solver definition @@ -280,7 +280,7 @@ SUNLinearSolver_Type HypreLS_GetType(SUNLinearSolver S); int HypreLS_Initialize(SUNLinearSolver S); int HypreLS_Setup(SUNLinearSolver S, SUNMatrix A); int HypreLS_Solve(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); int HypreLS_NumIters(SUNLinearSolver S); int HypreLS_Free(SUNLinearSolver S); @@ -289,10 +289,10 @@ int HypreLS_Free(SUNLinearSolver S); // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Jacobian evaluation function -static int Jac(realtype t, N_Vector u, N_Vector f, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector u, N_Vector f, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // ----------------------------------------------------------------------------- @@ -319,10 +319,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -332,7 +332,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -481,9 +481,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata->tf / udata->nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata); @@ -538,12 +538,12 @@ int main(int argc, char* argv[]) flag = SolutionError(t, u, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } } @@ -681,23 +681,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -764,7 +764,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -794,15 +794,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -811,15 +811,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -859,10 +859,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -963,7 +963,7 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Jac function to compute the ODE RHS function Jacobian, (df/dy)(t,y). -static int Jac(realtype t, N_Vector y, N_Vector ydot, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector ydot, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { // Shortcuts to hypre matrix and grid extents, work array, etc. @@ -1012,9 +1012,9 @@ static int Jac(realtype t, N_Vector y, N_Vector ydot, SUNMatrix J, (ilower[1] <= iupper[1])) { // Jacobian values - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // -------------------------------- // Set matrix values for all nodes @@ -1357,7 +1357,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -1770,11 +1770,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -1789,7 +1789,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -1810,7 +1810,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -1907,7 +1907,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); if (udata->forcing) { cout << " t "; @@ -1958,7 +1958,7 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); if (udata->forcing) { @@ -1969,7 +1969,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } } @@ -1977,10 +1977,10 @@ static int OpenOutput(UserData *udata) } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { int flag; - realtype max; + sunrealtype max; bool outproc = (udata->myid_c == 0); if (udata->output > 0) @@ -1996,7 +1996,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) } // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -2014,7 +2014,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution and error to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -2027,7 +2027,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (udata->forcing) { // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -2117,8 +2117,8 @@ static int OutputStats(void *cvode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; @@ -2372,7 +2372,7 @@ int Hypre5ptMatrix_Copy(SUNMatrix A, SUNMatrix B) return(SUNMAT_SUCCESS); } -int Hypre5ptMatrix_ScaleAddI(realtype c, SUNMatrix A) +int Hypre5ptMatrix_ScaleAddI(sunrealtype c, SUNMatrix A) { int flag; @@ -2618,7 +2618,7 @@ int HypreLS_Setup(SUNLinearSolver LS, SUNMatrix A) } int HypreLS_Solve(SUNLinearSolver LS, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol) + N_Vector x, N_Vector b, sunrealtype tol) { int flag; diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index 255520260f..aeb7b84878 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -85,18 +85,18 @@ struct UserData sundials::Context& sunctx; // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Final time - realtype tf; + sunrealtype tf; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -106,8 +106,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -144,10 +144,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -156,10 +156,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -168,8 +168,8 @@ struct UserData MPI_Request reqSN; // Integrator settings - realtype rtol; // relative tolerance - realtype atol; // absolute tolerance + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance int maxsteps; // max number of steps between outputs // Linear solver and preconditioner settings @@ -179,7 +179,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // hypre objects HYPRE_StructGrid grid; @@ -234,18 +234,18 @@ struct UserData // ----------------------------------------------------------------------------- // ODE right hand side function -static int f(realtype t, N_Vector u, N_Vector f, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Jacobian-vector product function -static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, +static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); // Preconditioner setup and solve functions -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // ----------------------------------------------------------------------------- @@ -265,7 +265,7 @@ static int SetupHypre(UserData *udata); // Fill Jacobian and A = I - gamma * J static int Jac(UserData *udata); -static int ScaleAddI(UserData *udata, realtype gamma); +static int ScaleAddI(UserData *udata, sunrealtype gamma); // ----------------------------------------------------------------------------- // UserData and input functions @@ -279,10 +279,10 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc); // ----------------------------------------------------------------------------- // Compute the true solution -static int Solution(realtype t, N_Vector u, UserData *udata); +static int Solution(sunrealtype t, N_Vector u, UserData *udata); // Compute the solution error solution -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata); +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata); // Print the command line options static void InputHelp(); @@ -292,7 +292,7 @@ static int PrintUserData(UserData *udata); // Output solution and error static int OpenOutput(UserData *udata); -static int WriteOutput(realtype t, N_Vector u, UserData *udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata); static int CloseOutput(UserData *udata); // Print integration statistics @@ -492,9 +492,9 @@ int main(int argc, char* argv[]) // Loop over output times // ----------------------- - realtype t = ZERO; - realtype dTout = udata->tf / udata->nout; - realtype tout = dTout; + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; // Inital output flag = OpenOutput(udata); @@ -549,12 +549,12 @@ int main(int argc, char* argv[]) flag = SolutionError(t, u, udata->e, udata); if (check_flag(&flag, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } } @@ -693,23 +693,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -776,7 +776,7 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // ----------------------------------------------------------------------------- // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector u, N_Vector f, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) { int flag; sunindextype i, j; @@ -806,15 +806,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_flag((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -823,15 +823,15 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) // Iterate over subdomain and compute rhs forcing term if (udata->forcing) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; - realtype sin_t_cos_t = sin(PI * t) * cos(PI * t); - realtype cos_sqr_t = cos(PI * t) * cos(PI * t); + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); for (j = jstart; j < jend; j++) { @@ -871,10 +871,10 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) if (check_flag(&flag, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -975,7 +975,7 @@ static int f(realtype t, N_Vector u, N_Vector f, void *user_data) } // Jacobian-vector product function -static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, +static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { int flag; @@ -1027,8 +1027,8 @@ static int JTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, } // Preconditioner setup routine -static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; @@ -1116,8 +1116,8 @@ static int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, } // Preconditioner solve routine for Pz = r -static int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { int flag; @@ -1395,9 +1395,9 @@ static int Jac(UserData *udata) (ilower[1] <= iupper[1])) { // Jacobian values - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // -------------------------------- // Set matrix values for all nodes @@ -1663,7 +1663,7 @@ static int Jac(UserData *udata) } // Fill A = I - gamma * J matrix -static int ScaleAddI(UserData *udata, realtype gamma) +static int ScaleAddI(UserData *udata, sunrealtype gamma) { int flag; @@ -1792,7 +1792,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -2253,11 +2253,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // ----------------------------------------------------------------------------- // Compute the exact solution -static int Solution(realtype t, N_Vector u, UserData *udata) +static int Solution(sunrealtype t, N_Vector u, UserData *udata) { - realtype x, y; - realtype cos_sqr_t; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; // Constants for computing solution cos_sqr_t = cos(PI * t) * cos(PI * t); @@ -2272,7 +2272,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -2293,7 +2293,7 @@ static int Solution(realtype t, N_Vector u, UserData *udata) } // Compute the solution error -static int SolutionError(realtype t, N_Vector u, N_Vector e, UserData *udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData *udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -2393,7 +2393,7 @@ static int OpenOutput(UserData *udata) if (udata->output > 0 && outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); if (udata->forcing) { cout << " t "; @@ -2444,7 +2444,7 @@ static int OpenOutput(UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); if (udata->forcing) { @@ -2455,7 +2455,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } } @@ -2463,10 +2463,10 @@ static int OpenOutput(UserData *udata) } // Write output -static int WriteOutput(realtype t, N_Vector u, UserData *udata) +static int WriteOutput(sunrealtype t, N_Vector u, UserData *udata) { int flag; - realtype max; + sunrealtype max; bool outproc = (udata->myid_c == 0); if (udata->output > 0) @@ -2482,7 +2482,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) } // Compute rms norm of the state - realtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); // Output current status if (outproc) @@ -2500,7 +2500,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) // Write solution and error to disk if (udata->output == 2) { - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_flag((void *) uarray, "N_VGetArrayPointer", 0)) return -1; udata->uout << t << " "; @@ -2513,7 +2513,7 @@ static int WriteOutput(realtype t, N_Vector u, UserData *udata) if (udata->forcing) { // Output error to disk - realtype *earray = N_VGetArrayPointer(udata->e); + sunrealtype *earray = N_VGetArrayPointer(udata->e); if (check_flag((void *) earray, "N_VGetArrayPointer", 0)) return -1; udata->eout << t << " "; @@ -2606,8 +2606,8 @@ static int OutputStats(void *cvode_mem, UserData* udata) cout << endl; // Compute average nls iters per step attempt and ls iters per nls iter - realtype avgnli = (realtype) nni / (realtype) nst; - realtype avgli = (realtype) nli / (realtype) nni; + sunrealtype avgnli = (sunrealtype) nni / (sunrealtype) nst; + sunrealtype avgli = (sunrealtype) nli / (sunrealtype) nni; cout << " Avg NLS iters per step = " << avgnli << endl; cout << " Avg LS iters per NLS iter = " << avgli << endl; cout << endl; diff --git a/examples/cvode/CXX_serial/cv_heat2D.cpp b/examples/cvode/CXX_serial/cv_heat2D.cpp index 5c839e3281..c89f297c34 100644 --- a/examples/cvode/CXX_serial/cv_heat2D.cpp +++ b/examples/cvode/CXX_serial/cv_heat2D.cpp @@ -61,9 +61,9 @@ int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data); // Preconditioner Setup and Solve functions -int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, booleantype* jcurPtr, realtype gamma, void* user_data); +int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, booleantype* jcurPtr, sunrealtype gamma, void* user_data); -int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, realtype gamma, realtype delta, int lr, +int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void* user_data); // ----------------------------------------------------------------------------- @@ -352,7 +352,7 @@ int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data) } // Preconditioner setup routine -int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, booleantype* jcurPtr, realtype gamma, void* user_data) +int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, booleantype* jcurPtr, sunrealtype gamma, void* user_data) { // Access problem data auto udata = static_cast(user_data); @@ -376,7 +376,7 @@ int PSetup(realtype t, N_Vector u, N_Vector f, booleantype jok, booleantype* jcu } // Preconditioner solve routine for Pz = r -int PSolve(realtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, realtype gamma, realtype delta, int lr, +int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void* user_data) { // Access user_data structure diff --git a/examples/cvode/CXX_serial/cv_kpr.cpp b/examples/cvode/CXX_serial/cv_kpr.cpp index 4065b6fe35..0a8847c19e 100644 --- a/examples/cvode/CXX_serial/cv_kpr.cpp +++ b/examples/cvode/CXX_serial/cv_kpr.cpp @@ -40,10 +40,10 @@ // ----------------------------------------------------------------------------- // ODE right-hand side function -int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); // Jacobian of RHS function -int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // ----------------------------------------------------------------------------- @@ -66,11 +66,11 @@ int main(int argc, char* argv[]) N_Vector y = N_VNew_Serial(2, sunctx); if (check_ptr(y, "N_VNew_Serial")) return 1; - realtype utrue, vtrue; + sunrealtype utrue, vtrue; flag = true_sol(ZERO, &utrue, &vtrue); if (check_flag(flag, "true_sol")) return 1; - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); ydata[0] = utrue; ydata[1] = vtrue; @@ -105,17 +105,17 @@ int main(int argc, char* argv[]) } // Attach user data pointer - realtype udata[4] = {-TWO, HALF, HALF, -ONE}; + sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; flag = CVodeSetUserData(cvode_mem, udata); if (check_flag(flag, "CVodeSetUserData")) return 1; // Initial time and fist output time - realtype tret = ZERO; - realtype tout = tret + opts.dtout; + sunrealtype tret = ZERO; + sunrealtype tout = tret + opts.dtout; // Output initial contion std::cout << std::scientific; - std::cout << std::setprecision(std::numeric_limits::digits10); + std::cout << std::setprecision(std::numeric_limits::digits10); std::cout << " t "; std::cout << " u "; std::cout << " v "; @@ -172,22 +172,22 @@ int main(int argc, char* argv[]) * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; - const realtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); - const realtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); + const sunrealtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); + const sunrealtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); - realtype* fdata = N_VGetArrayPointer(ydot); + sunrealtype* fdata = N_VGetArrayPointer(ydot); fdata[0] = a * tmp1 + b * tmp2 + rdot(t) / (TWO * u); fdata[1] = c * tmp1 + d * tmp2 + sdot(t) / (TWO * v); @@ -200,20 +200,20 @@ int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - realtype* Jdata = SUNDenseMatrix_Data(J); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; Jdata[0] = a / TWO + (a * (ONE + r(t)) - rdot(t)) / (TWO * u * u); Jdata[1] = c / TWO + c * (ONE + r(t)) / (TWO * u * u); diff --git a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp index 44fe80d7b7..22cb760ec6 100644 --- a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp +++ b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp @@ -82,25 +82,25 @@ struct UserData sunindextype MX = 10; // interior nodes in the x-direction sunindextype MY = 5; // interior nodes in the y-direction sunindextype NEQ = MX * MY; // number of equations - realtype xmax = RCONST(2.0); // x-domain boundary - realtype ymax = RCONST(1.0); // y-domain boundary - realtype dx = xmax / (MX + 1); // x-direction mesh spacing - realtype dy = ymax / (MY + 1); // y-directino mesh spacing - realtype hdcoef = ONE / (dx * dx); // x-diffusion - realtype vdcoef = ONE / (dy * dy); // y-diffusion - realtype hacoef = HALF / (TWO * dx); // x-advection + sunrealtype xmax = RCONST(2.0); // x-domain boundary + sunrealtype ymax = RCONST(1.0); // y-domain boundary + sunrealtype dx = xmax / (MX + 1); // x-direction mesh spacing + sunrealtype dy = ymax / (MY + 1); // y-directino mesh spacing + sunrealtype hdcoef = ONE / (dx * dx); // x-diffusion + sunrealtype vdcoef = ONE / (dy * dy); // y-diffusion + sunrealtype hacoef = HALF / (TWO * dx); // x-advection }; // Functions Called by the Solver -static int f(realtype t, N_Vector u, N_Vector udot, void* user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void* user_data); +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void* user_data, N_Vector tmp); // Private Helper Functions -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData* data); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void* cvode_mem); // Private function to check function return values @@ -142,7 +142,7 @@ int main(int argc, char** argv) if (check_retval((void*)u, "N_VNew_Sycl", 0)) return 1; // Extract host pointer to solution vector data on the host - realtype* udata = N_VGetArrayPointer(u); + sunrealtype* udata = N_VGetArrayPointer(u); // Load initial profile into u vector for (sunindextype tid = 0; tid < data.NEQ; tid++) @@ -150,8 +150,8 @@ int main(int argc, char** argv) sunindextype i = tid / data.MY; // x-node index sunindextype j = tid % data.MY; // y-node index - realtype x = (i + 1) * data.dx; // x location - realtype y = (j + 1) * data.dy; // y location + sunrealtype x = (i + 1) * data.dx; // x location + sunrealtype y = (j + 1) * data.dy; // y location udata[tid] = x * (data.xmax - x) * y * (data.ymax - y) * std::exp(FIVE * x * y); @@ -169,8 +169,8 @@ int main(int argc, char** argv) if (check_retval(&retval, "CVodeInit", 1)) return 1; // Specify the scalar relative tolerance and scalar absolute tolerance - realtype reltol = ZERO; - realtype abstol = ATOL; + sunrealtype reltol = ZERO; + sunrealtype abstol = ATOL; retval = CVodeSStolerances(cvode_mem, reltol, abstol); if (check_retval(&retval, "CVodeSStolerances", 1)) return 1; @@ -191,11 +191,11 @@ int main(int argc, char** argv) if (check_retval(&retval, "CVodeSetJacTimesVecFn", 1)) return 1; // In loop over output points: call CVODE, print results, test for errors - realtype umax = N_VMaxNorm(u); + sunrealtype umax = N_VMaxNorm(u); PrintHeader(reltol, abstol, umax, &data); - realtype tout = T1; // output time - realtype t; // CVODE return time + sunrealtype tout = T1; // output time + sunrealtype t; // CVODE return time long int nst; // number of time steps for (int iout = 0; iout < NOUT; iout++) @@ -230,20 +230,20 @@ int main(int argc, char** argv) * ---------------------------------------------------------------------------*/ // Compute the ODE right-hand side function f(t,u). -static int f(realtype t, N_Vector u, N_Vector udot, void* user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void* user_data) { UserData* data = static_cast(user_data); // Extract needed constants from data const size_t MX = static_cast(data->MX); const size_t MY = static_cast(data->MY); - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; // Extract pointers to vector data - const realtype* udata = N_VGetDeviceArrayPointer(u); - realtype* dudata = N_VGetDeviceArrayPointer(udot); + const sunrealtype* udata = N_VGetDeviceArrayPointer(u); + sunrealtype* dudata = N_VGetDeviceArrayPointer(udot); data->myQueue->submit([&](sycl::handler& h) { @@ -253,16 +253,16 @@ static int f(realtype t, N_Vector u, N_Vector udot, void* user_data) sunindextype j = idx[1]; sunindextype tid = i * MY + j; - realtype uij = udata[tid]; - realtype udn = (j == 0) ? ZERO : udata[tid - 1]; - realtype uup = (j == MY - 1) ? ZERO : udata[tid + 1]; - realtype ult = (i == 0) ? ZERO : udata[tid - MY]; - realtype urt = (i == MX - 1) ? ZERO : udata[tid + MY]; + sunrealtype uij = udata[tid]; + sunrealtype udn = (j == 0) ? ZERO : udata[tid - 1]; + sunrealtype uup = (j == MY - 1) ? ZERO : udata[tid + 1]; + sunrealtype ult = (i == 0) ? ZERO : udata[tid - MY]; + sunrealtype urt = (i == MX - 1) ? ZERO : udata[tid + MY]; // Set diffusion and advection terms and load into udot - realtype hdiff = hordc * (ult - TWO * uij + urt); - realtype vdiff = verdc * (uup - TWO * uij + udn); - realtype hadv = horac * (urt - ult); + sunrealtype hdiff = hordc * (ult - TWO * uij + urt); + sunrealtype vdiff = verdc * (uup - TWO * uij + udn); + sunrealtype hadv = horac * (urt - ult); dudata[tid] = hdiff + vdiff + hadv; }); @@ -273,7 +273,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void* user_data) // Jacobian-times-vector routine. -static int jtv(N_Vector v, N_Vector Jv, realtype t, N_Vector u, N_Vector fu, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void* user_data, N_Vector tmp) { UserData* data = static_cast(user_data); @@ -281,13 +281,13 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, N_Vector u, N_Vector fu, // Extract needed constants from data const size_t MX = static_cast(data->MX); const size_t MY = static_cast(data->MY); - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; // Extract pointers to vector data - const realtype *vdata = N_VGetDeviceArrayPointer(v); - realtype *Jvdata = N_VGetDeviceArrayPointer(Jv); + const sunrealtype *vdata = N_VGetDeviceArrayPointer(v); + sunrealtype *Jvdata = N_VGetDeviceArrayPointer(Jv); data->myQueue->submit([&](sycl::handler& h) { @@ -315,7 +315,7 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, N_Vector u, N_Vector fu, * ---------------------------------------------------------------------------*/ // Print first lines of output (problem description) -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData* data) { std::cout << "\n2-D Advection-Diffusion Equation" << std::endl; @@ -328,7 +328,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax, } // Print current value -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { std::cout << "At t = " << t << " max.norm(u) = "<< umax << " nst = " << nst << std::endl; diff --git a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c index 3130ea284e..1385ec8bf7 100644 --- a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c +++ b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c @@ -66,7 +66,7 @@ #include /* access to MPI-parallel N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* prototypes for small dense fcts. */ -#include /* definitions of realtype, booleantype */ +#include /* definitions of sunrealtype, booleantype */ /* helpful macros */ @@ -121,7 +121,7 @@ /* IJth is defined in order to write code which indexes into dense matrices with a (row,column) pair, where 1 <= row,column <= NVARS. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NVARS. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -135,24 +135,24 @@ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype c1ext[(MXSUB+2)*(MYSUB+2)]; - realtype c2ext[(MXSUB+2)*(MYSUB+2)]; - realtype SendBufferE[NVARS*MYSUB]; - realtype SendBufferW[NVARS*MYSUB]; - realtype SendBufferN[NVARS*MXSUB]; - realtype SendBufferS[NVARS*MXSUB]; - realtype RecvBufferE[NVARS*MYSUB]; - realtype RecvBufferW[NVARS*MYSUB]; - realtype RecvBufferN[NVARS*MXSUB]; - realtype RecvBufferS[NVARS*MXSUB]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype c1ext[(MXSUB+2)*(MYSUB+2)]; + sunrealtype c2ext[(MXSUB+2)*(MYSUB+2)]; + sunrealtype SendBufferE[NVARS*MYSUB]; + sunrealtype SendBufferW[NVARS*MYSUB]; + sunrealtype SendBufferN[NVARS*MXSUB]; + sunrealtype SendBufferS[NVARS*MXSUB]; + sunrealtype RecvBufferE[NVARS*MYSUB]; + sunrealtype RecvBufferW[NVARS*MYSUB]; + sunrealtype RecvBufferN[NVARS*MXSUB]; + sunrealtype RecvBufferS[NVARS*MXSUB]; int my_pe, isubx, isuby; int nvmxsub2; MPI_Comm comm; MPI_Request request[8]; /* For preconditioner */ - realtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; + sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; } *UserData; @@ -163,26 +163,26 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector u, UserData data); static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); -static void BSend(realtype c1data[], realtype c2data[], UserData data); +static void BSend(sunrealtype c1data[], sunrealtype c2data[], UserData data); static void BRecvPost(UserData data); static void BRecvWait(UserData data); static void PrepareExt(N_Vector u, UserData data); -static void fcalc(realtype t, N_Vector udot, UserData data); +static void fcalc(sunrealtype t, N_Vector udot, UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -196,7 +196,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u, c[2]; UserData data; SUNLinearSolver LS; @@ -328,8 +328,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -378,8 +378,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) { int lx, ly, jx, jy; sunindextype offset; - realtype x, y, cx, cy, xmid, ymid; - realtype *c1data, *c2data; + sunrealtype x, y, cx, cy, xmid, ymid; + sunrealtype *c1data, *c2data; /* Set pointer to data array in vector u */ c1data = N_VGetSubvectorArrayPointer_MPIManyVector(u,0); @@ -411,10 +411,10 @@ static void SetInitialProfiles(N_Vector u, UserData data) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int qu, retval; - realtype hu, *c1data, *c2data, tempu[2]; + sunrealtype hu, *c1data, *c2data, tempu[2]; int npelast; long int nst; MPI_Status status; @@ -552,7 +552,7 @@ static void BRecvPost(UserData data) /* Routine to send boundary data to neighboring PEs */ -static void BSend(realtype c1data[], realtype c2data[], UserData data) +static void BSend(sunrealtype c1data[], sunrealtype c2data[], UserData data) { int ly, lx, retval; sunindextype offsetu; @@ -663,7 +663,7 @@ static void BRecvWait(UserData data) static void PrepareExt(N_Vector u, UserData data) { - realtype *c1data, *c2data; + sunrealtype *c1data, *c2data; int lx, ly; /* Access data arrays from u, and extended work arrays c1ext and c2ext */ @@ -724,13 +724,13 @@ static void PrepareExt(N_Vector u, UserData data) } -static void fcalc(realtype t, N_Vector udot, UserData data) +static void fcalc(sunrealtype t, N_Vector udot, UserData data) { - realtype *c1dot, *c2dot; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef; + sunrealtype *c1dot, *c2dot; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef; int lx, ly, jy; sunindextype offset; @@ -810,7 +810,7 @@ static void fcalc(realtype t, N_Vector udot, UserData data) subgrid boundary data and to copy data from u into uext. Then calculate f by a call to fcalc. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { /* Call PrepareExt to set up work arrays for calculation of RHS (includes inter-processor communication) */ @@ -823,15 +823,15 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) } /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup; - realtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup; + sunrealtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; sunindextype retval; sunindextype *(*pivot)[MYSUB]; sunindextype lx, ly, jy; - realtype *c1data, *c2data, **a, **j; + sunrealtype *c1data, *c2data, **a, **j; UserData data; /* Make local copies of pointers in user_data, pointer to u's data, @@ -898,13 +898,13 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, } /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data) +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MYSUB]; + sunrealtype **(*P)[MYSUB]; sunindextype *(*pivot)[MYSUB]; int lx, ly; - realtype *z1data, *z2data, v[2]; + sunrealtype *z1data, *z2data, v[2]; UserData data; /* Extract the P and pivot arrays from user_data */ diff --git a/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c b/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c index d10c14b32d..bb067d63ed 100644 --- a/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c +++ b/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c @@ -58,7 +58,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #ifdef _OPENMP #include @@ -99,15 +99,15 @@ /* Type : UserData (contains grid constants) */ typedef struct { - realtype dx, dy, hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, hdcoef, hacoef, vdcoef; int nthreads; } *UserData; /* Private Helper Functions */ static void SetIC(N_Vector u, UserData data); -static void PrintHeader(realtype reltol, realtype abstol, realtype umax); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -116,8 +116,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* @@ -129,7 +129,7 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, int main(int argc, char *argv[]) { SUNContext sunctx; - realtype dx, dy, reltol, abstol, t, tout, umax; + sunrealtype dx, dy, reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNMatrix A; @@ -248,10 +248,10 @@ int main(int argc, char *argv[]) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u,N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; - realtype *udata, *dudata; + sunrealtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; + sunrealtype *udata, *dudata; sunindextype i, j; UserData data; @@ -295,12 +295,12 @@ static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) /* Jacobian routine. Compute J(t,u). */ -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunindextype i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* @@ -350,8 +350,8 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, static void SetIC(N_Vector u, UserData data) { sunindextype i, j; - realtype x, y, dx, dy; - realtype *udata; + sunrealtype x, y, dx, dy; + sunrealtype *udata; i = j = 0; @@ -377,7 +377,7 @@ static void SetIC(N_Vector u, UserData data) /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -400,7 +400,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax) /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvode/C_openmpdev/cvAdvDiff_kry_ompdev.c b/examples/cvode/C_openmpdev/cvAdvDiff_kry_ompdev.c index d051c7e967..4d00b68039 100644 --- a/examples/cvode/C_openmpdev/cvAdvDiff_kry_ompdev.c +++ b/examples/cvode/C_openmpdev/cvAdvDiff_kry_ompdev.c @@ -44,7 +44,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* access to SPGMR SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ #include /* OpenMPDEV N_Vector types, fcts., macros */ @@ -69,8 +69,8 @@ /* Type : _UserData (contains model and discretization parameters) */ typedef struct { sunindextype MX, MY, NEQ; - realtype dx, dy, XMAX, YMAX; - realtype hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, XMAX, YMAX; + sunrealtype hdcoef, hacoef, vdcoef; } *UserData; /*typedef _UserData *UserData;*/ @@ -80,14 +80,14 @@ static UserData SetUserData(int argc, char** argv); static void SetIC(N_Vector u, UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp); /* Private Helper Functions */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserData data); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -103,7 +103,7 @@ static int check_retval(void *flagvalue, const char *funcname, int opt); int main(int argc, char** argv) { SUNContext sunctx; - realtype reltol, abstol, t, tout, umax; + sunrealtype reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNLinearSolver LS; @@ -201,8 +201,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const realtype XMAX = RCONST(2.0); /* domain boundaries */ - const realtype YMAX = RCONST(1.0); + const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); @@ -228,18 +228,18 @@ static void SetIC(N_Vector u, UserData data) { /* Extract needed constants from data */ - const realtype dx = data->dx; - const realtype dy = data->dy; - const realtype xmax = data->XMAX; - const realtype ymax = data->YMAX; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; + const sunrealtype xmax = data->XMAX; + const sunrealtype ymax = data->YMAX; const sunindextype MY = data->MY; const sunindextype NEQ = data->NEQ; /* Extract pointer to solution vector data on the host */ - realtype *udata = N_VGetHostArrayPointer_OpenMPDEV(u); + sunrealtype *udata = N_VGetHostArrayPointer_OpenMPDEV(u); sunindextype i, j, tid; - realtype x, y; + sunrealtype x, y; /* Load initial profile into u vector */ @@ -265,9 +265,9 @@ static void SetIC(N_Vector u, UserData data) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; + sunrealtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; sunindextype i, j, k; int dev; @@ -276,13 +276,13 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *udata = N_VGetDeviceArrayPointer_OpenMPDEV(u); - realtype *dudata = N_VGetDeviceArrayPointer_OpenMPDEV(udot); + const sunrealtype *udata = N_VGetDeviceArrayPointer_OpenMPDEV(u); + sunrealtype *dudata = N_VGetDeviceArrayPointer_OpenMPDEV(udot); /* Get device */ dev = omp_get_default_device(); @@ -314,7 +314,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian-times-vector routine. */ -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp) { @@ -326,13 +326,13 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *vdata = N_VGetDeviceArrayPointer_OpenMPDEV(v); - realtype *Jvdata = N_VGetDeviceArrayPointer_OpenMPDEV(Jv); + const sunrealtype *vdata = N_VGetDeviceArrayPointer_OpenMPDEV(v); + sunrealtype *Jvdata = N_VGetDeviceArrayPointer_OpenMPDEV(Jv); N_VConst(ZERO, Jv); @@ -364,7 +364,7 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserData data) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %ld X %ld\n", (long int) data->MX, (long int) data->MY); @@ -387,7 +387,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserDat /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu b/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu index ad84004e37..140aea7b53 100644 --- a/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu +++ b/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu @@ -47,7 +47,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* prototypes for CVODE diagonal solver */ #include /* access to cuda N_Vector */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -66,24 +66,24 @@ contains mesh spacing and problem parameters. */ typedef struct { - realtype dx; - realtype hdcoef; - realtype hacoef; + sunrealtype dx; + sunrealtype hdcoef; + sunrealtype hacoef; } *UserData; /* Private Helper Functions */ -static void SetIC(N_Vector u, realtype dx); +static void SetIC(N_Vector u, sunrealtype dx); static void PrintIntro(int toltype, int usefused); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -94,7 +94,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { SUNContext sunctx; - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; N_Vector u; UserData data; void *cvode_mem; @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) reltol = ZERO; /* Set the tolerances */ abstol = ATOL; - dx = data->dx = XMAX/((realtype)(MX+1)); /* Set grid coefficients in data */ + dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ data->hdcoef = RCONST(1.0)/(dx*dx); data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); @@ -203,12 +203,12 @@ int main(int argc, char *argv[]) /* Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx) +static void SetIC(N_Vector u, sunrealtype dx) { int i; sunindextype N; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetHostArrayPointer_Cuda(u); @@ -241,7 +241,7 @@ static void PrintIntro(int toltype, int usefused) /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -284,11 +284,11 @@ static void PrintFinalStats(void *cvode_mem) __global__ static void f_kernel(sunindextype N, - realtype hordc, realtype horac, - const realtype* u, realtype* udot) + sunrealtype hordc, sunrealtype horac, + const sunrealtype* u, sunrealtype* udot) { sunindextype i = blockDim.x*blockIdx.x + threadIdx.x; - realtype ui, ult, urt, hdiff, hadv; + sunrealtype ui, ult, urt, hdiff, hadv; if (i < N) { /* Extract u at x_i and two neighboring points */ @@ -303,10 +303,10 @@ static void f_kernel(sunindextype N, } } -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype hordc, horac; - realtype *udata, *dudata; + sunrealtype hordc, horac; + sunrealtype *udata, *dudata; sunindextype N; size_t grid, block; UserData data; diff --git a/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu b/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu index d05254584a..381e111402 100644 --- a/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu +++ b/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu @@ -45,7 +45,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* access to SPGMR SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ #include @@ -85,11 +85,11 @@ * CUDA kernels */ -__global__ void fKernel(const realtype *u, realtype *udot, +__global__ void fKernel(const sunrealtype *u, sunrealtype *udot, sunindextype MX, sunindextype MY, - realtype hordc, realtype horac, realtype verdc) + sunrealtype hordc, sunrealtype horac, sunrealtype verdc) { - realtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; + sunrealtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; sunindextype i, j, tid; /* Loop over all grid points. */ @@ -115,9 +115,9 @@ __global__ void fKernel(const realtype *u, realtype *udot, } -__global__ void jtvKernel(const realtype *vdata, realtype *Jvdata, +__global__ void jtvKernel(const sunrealtype *vdata, sunrealtype *Jvdata, sunindextype MX, sunindextype MY, - realtype hordc, realtype horac, realtype verdc) + sunrealtype hordc, sunrealtype horac, sunrealtype verdc) { sunindextype i, j, tid; @@ -145,8 +145,8 @@ __global__ void jtvKernel(const realtype *vdata, realtype *Jvdata, /* Type : _UserData (contains model and discretization parameters) */ struct _UserData { sunindextype MX, MY, NEQ; - realtype dx, dy, XMAX, YMAX; - realtype hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, XMAX, YMAX; + sunrealtype hdcoef, hacoef, vdcoef; }; typedef _UserData *UserData; @@ -156,14 +156,14 @@ static UserData SetUserData(int argc, char** argv); static void SetIC(N_Vector u, UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp); /* Private Helper Functions */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserData data); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -178,7 +178,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char** argv) { - realtype reltol, abstol, t, tout, umax; + sunrealtype reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNLinearSolver LS; @@ -296,8 +296,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const realtype XMAX = RCONST(2.0); /* domain boundaries */ - const realtype YMAX = RCONST(1.0); + const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); @@ -323,18 +323,18 @@ static void SetIC(N_Vector u, UserData data) { /* Extract needed constants from data */ - const realtype dx = data->dx; - const realtype dy = data->dy; - const realtype xmax = data->XMAX; - const realtype ymax = data->YMAX; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; + const sunrealtype xmax = data->XMAX; + const sunrealtype ymax = data->YMAX; const sunindextype MY = data->MY; const sunindextype NEQ = data->NEQ; /* Extract pointer to solution vector data on the host */ - realtype *udata = N_VGetHostArrayPointer_Cuda(u); + sunrealtype *udata = N_VGetHostArrayPointer_Cuda(u); sunindextype i, j, tid; - realtype x, y; + sunrealtype x, y; /* Load initial profile into u vector */ @@ -360,20 +360,20 @@ static void SetIC(N_Vector u, UserData data) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { UserData data = (UserData) user_data; /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *udata = N_VGetDeviceArrayPointer_Cuda(u); - realtype *dudata = N_VGetDeviceArrayPointer_Cuda(udot); + const sunrealtype *udata = N_VGetDeviceArrayPointer_Cuda(u); + sunrealtype *dudata = N_VGetDeviceArrayPointer_Cuda(udot); unsigned block = 256; unsigned grid = (MX*MY + block - 1) / block; @@ -386,7 +386,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian-times-vector routine. */ -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp) { @@ -395,13 +395,13 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *vdata = N_VGetDeviceArrayPointer_Cuda(v); - realtype *Jvdata = N_VGetDeviceArrayPointer_Cuda(Jv); + const sunrealtype *vdata = N_VGetDeviceArrayPointer_Cuda(v); + sunrealtype *Jvdata = N_VGetDeviceArrayPointer_Cuda(Jv); unsigned block = 256; unsigned grid = (MX*MY + block - 1) / block; @@ -421,7 +421,7 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data) { printf("\n2-D Advection-Diffusion Equation\n"); @@ -435,7 +435,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax, /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { printf("At t = %4.2" FSYM " max.norm(u) =%14.6" ESYM " nst = %4ld\n", t, umax, nst); return; diff --git a/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu b/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu index a88d9180b8..c6b95d389a 100644 --- a/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu +++ b/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu @@ -45,7 +45,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* access to SPGMR SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ #include @@ -85,11 +85,11 @@ * CUDA kernels */ -__global__ void fKernel(const realtype *u, realtype *udot, +__global__ void fKernel(const sunrealtype *u, sunrealtype *udot, sunindextype MX, sunindextype MY, - realtype hordc, realtype horac, realtype verdc) + sunrealtype hordc, sunrealtype horac, sunrealtype verdc) { - realtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; + sunrealtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; sunindextype i, j, tid; /* Loop over all grid points. */ @@ -115,9 +115,9 @@ __global__ void fKernel(const realtype *u, realtype *udot, } -__global__ void jtvKernel(const realtype *vdata, realtype *Jvdata, +__global__ void jtvKernel(const sunrealtype *vdata, sunrealtype *Jvdata, sunindextype MX, sunindextype MY, - realtype hordc, realtype horac, realtype verdc) + sunrealtype hordc, sunrealtype horac, sunrealtype verdc) { sunindextype i, j, tid; @@ -145,8 +145,8 @@ __global__ void jtvKernel(const realtype *vdata, realtype *Jvdata, /* Type : _UserData (contains model and discretization parameters) */ struct _UserData { sunindextype MX, MY, NEQ; - realtype dx, dy, XMAX, YMAX; - realtype hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, XMAX, YMAX; + sunrealtype hdcoef, hacoef, vdcoef; }; typedef _UserData *UserData; @@ -156,14 +156,14 @@ static UserData SetUserData(int argc, char** argv); static void SetIC(N_Vector u, UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp); /* Private Helper Functions */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserData data); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -179,7 +179,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char** argv) { SUNContext sunctx; - realtype reltol, abstol, t, tout, umax; + sunrealtype reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNLinearSolver LS; @@ -300,8 +300,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const realtype XMAX = RCONST(2.0); /* domain boundaries */ - const realtype YMAX = RCONST(1.0); + const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); @@ -327,18 +327,18 @@ static void SetIC(N_Vector u, UserData data) { /* Extract needed constants from data */ - const realtype dx = data->dx; - const realtype dy = data->dy; - const realtype xmax = data->XMAX; - const realtype ymax = data->YMAX; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; + const sunrealtype xmax = data->XMAX; + const sunrealtype ymax = data->YMAX; const sunindextype MY = data->MY; const sunindextype NEQ = data->NEQ; /* Extract pointer to solution vector data on the host */ - realtype *udata = N_VGetHostArrayPointer_Cuda(u); + sunrealtype *udata = N_VGetHostArrayPointer_Cuda(u); sunindextype i, j, tid; - realtype x, y; + sunrealtype x, y; /* Load initial profile into u vector */ @@ -363,20 +363,20 @@ static void SetIC(N_Vector u, UserData data) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { UserData data = (UserData) user_data; /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *udata = N_VGetDeviceArrayPointer_Cuda(u); - realtype *dudata = N_VGetDeviceArrayPointer_Cuda(udot); + const sunrealtype *udata = N_VGetDeviceArrayPointer_Cuda(u); + sunrealtype *dudata = N_VGetDeviceArrayPointer_Cuda(udot); unsigned block = 256; unsigned grid = (MX*MY + block - 1) / block; @@ -389,7 +389,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian-times-vector routine. */ -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp) { @@ -398,13 +398,13 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *vdata = N_VGetDeviceArrayPointer_Cuda(v); - realtype *Jvdata = N_VGetDeviceArrayPointer_Cuda(Jv); + const sunrealtype *vdata = N_VGetDeviceArrayPointer_Cuda(v); + sunrealtype *Jvdata = N_VGetDeviceArrayPointer_Cuda(Jv); unsigned block = 256; unsigned grid = (MX*MY + block - 1) / block; @@ -424,7 +424,7 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data) { printf("\n2-D Advection-Diffusion Equation\n"); @@ -438,7 +438,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax, /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { printf("At t = %4.2" FSYM " max.norm(u) =%14.6" ESYM " nst = %4ld\n", t, umax, nst); return; diff --git a/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu b/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu index 666f10bfb3..ddd3101f08 100644 --- a/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu +++ b/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu @@ -43,7 +43,7 @@ #include /* access to cuda N_Vector */ #include /* access to cusparse SUNMatrix */ #include /* access to cuSolverSp batch QR SUNLinearSolver */ -#include /* defs. of realtype, int */ +#include /* defs. of sunrealtype, int */ /* Problem Constants */ @@ -64,24 +64,24 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); __global__ -static void f_kernel(realtype t, realtype* y, realtype* ydot, +static void f_kernel(sunrealtype t, sunrealtype* y, sunrealtype* ydot, int neq, int ngroups); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); __global__ -static void j_kernel(int ngroups, int nnzper, realtype* ydata, realtype *Jdata); +static void j_kernel(int ngroups, int nnzper, sunrealtype* ydata, sunrealtype *Jdata); /* Private function to initialize the Jacobian sparsity pattern */ static int JacInit(SUNMatrix J); /* Private function to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); /* Private function to print final statistics */ @@ -106,8 +106,8 @@ typedef struct { int main(int argc, char *argv[]) { SUNContext sunctx; - realtype reltol, t, tout; - realtype *ydata, *abstol_data; + sunrealtype reltol, t, tout; + sunrealtype *ydata, *abstol_data; N_Vector y, abstol; SUNMatrix A; SUNLinearSolver LS; @@ -275,10 +275,10 @@ int main(int argc, char *argv[]) to do the actual computation. At the very least, doing this saves moving the vector data in y and ydot to/from the device every evaluation of f. */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData *udata; - realtype *ydata, *ydotdata; + sunrealtype *ydata, *ydotdata; udata = (UserData*) user_data; ydata = N_VGetDeviceArrayPointer_Cuda(y); @@ -302,10 +302,10 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* Right hand side function evalutation kernel. */ __global__ -static void f_kernel(realtype t, realtype* ydata, realtype* ydotdata, +static void f_kernel(sunrealtype t, sunrealtype* ydata, sunrealtype* ydotdata, int neq, int ngroups) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; int i = blockIdx.x*blockDim.x + threadIdx.x; int groupj = i*GROUPSIZE; @@ -365,12 +365,12 @@ static int JacInit(SUNMatrix J) * This is done on the GPU. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData *udata = (UserData*) user_data; int nnzper; - realtype *Jdata, *ydata; + sunrealtype *Jdata, *ydata; unsigned block_size, grid_size; nnzper = GROUPSIZE * GROUPSIZE; @@ -395,10 +395,10 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, /* Jacobian evaluation GPU kernel */ __global__ -static void j_kernel(int ngroups, int nnzper, realtype* ydata, realtype *Jdata) +static void j_kernel(int ngroups, int nnzper, sunrealtype* ydata, sunrealtype *Jdata) { int groupj; - realtype y2, y3; + sunrealtype y2, y3; for (groupj = blockIdx.x*blockDim.x + threadIdx.x; groupj < ngroups; @@ -431,7 +431,7 @@ static void j_kernel(int ngroups, int nnzper, realtype* ydata, realtype *Jdata) *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/fcmix_serial/fcvRoberts_dnsL.f b/examples/cvode/fcmix_serial/fcvRoberts_dnsL.f index b952682760..d63c761800 100644 --- a/examples/cvode/fcmix_serial/fcvRoberts_dnsL.f +++ b/examples/cvode/fcmix_serial/fcvRoberts_dnsL.f @@ -36,7 +36,7 @@ C various counters of interest are printed. C C Note that this problem should only work with SUNDIALS configured -C to use 'realtype' as 'double' and 'sunindextype' as '32bit' +C to use 'sunrealtype' as 'double' and 'sunindextype' as '32bit' C -------------------------------------------------------------------- C IMPLICIT NONE diff --git a/examples/cvode/ginkgo/cv_kpr_ginkgo.cpp b/examples/cvode/ginkgo/cv_kpr_ginkgo.cpp index 7452dbdefb..f700ebdb72 100644 --- a/examples/cvode/ginkgo/cv_kpr_ginkgo.cpp +++ b/examples/cvode/ginkgo/cv_kpr_ginkgo.cpp @@ -46,10 +46,10 @@ using SUNGkoSolverType = sundials::ginkgo::LinearSolver::digits10); + std::cout << std::setprecision(std::numeric_limits::digits10); std::cout << " t "; std::cout << " u "; std::cout << " v "; @@ -173,22 +173,22 @@ int main(int argc, char* argv[]) * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(realtype t, N_Vector y, N_Vector ydot, void* user_data) +int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { - realtype* udata = (realtype*)user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; - const realtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); - const realtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); + const sunrealtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); + const sunrealtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); - realtype* fdata = N_VGetArrayPointer(ydot); + sunrealtype* fdata = N_VGetArrayPointer(ydot); fdata[0] = a * tmp1 + b * tmp2 + rdot(t) / (TWO * u); fdata[1] = c * tmp1 + d * tmp2 + sdot(t) / (TWO * v); @@ -201,20 +201,20 @@ int f(realtype t, N_Vector y, N_Vector ydot, void* user_data) * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype* udata = (realtype*)user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); auto J_gko = static_cast(J->content)->GkoMtx(); auto J_data = J_gko->get_values(); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; // Ginkgo dense matrix is stored in row-major format J_data[0] = a / TWO + (a * (ONE + r(t)) - rdot(t)) / (TWO * u * u); diff --git a/examples/cvode/hip/cvAdvDiff_diag_hip.cpp b/examples/cvode/hip/cvAdvDiff_diag_hip.cpp index 82ec667db5..a1bb2ff9f8 100644 --- a/examples/cvode/hip/cvAdvDiff_diag_hip.cpp +++ b/examples/cvode/hip/cvAdvDiff_diag_hip.cpp @@ -45,7 +45,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* prototypes for CVODE diagonal solver */ #include /* access to hip N_Vector */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -64,24 +64,24 @@ contains mesh spacing and problem parameters. */ typedef struct { - realtype dx; - realtype hdcoef; - realtype hacoef; + sunrealtype dx; + sunrealtype hdcoef; + sunrealtype hacoef; } *UserData; /* Private Helper Functions */ -static void SetIC(N_Vector u, realtype dx); +static void SetIC(N_Vector u, sunrealtype dx); static void PrintIntro(int toltype, int usefused); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -92,7 +92,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { sundials::Context sunctx; - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; N_Vector u; UserData data; void *cvode_mem; @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) reltol = ZERO; /* Set the tolerances */ abstol = ATOL; - dx = data->dx = XMAX/((realtype)(MX+1)); /* Set grid coefficients in data */ + dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ data->hdcoef = RCONST(1.0)/(dx*dx); data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); @@ -196,12 +196,12 @@ int main(int argc, char *argv[]) /* Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx) +static void SetIC(N_Vector u, sunrealtype dx) { int i; sunindextype N; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetHostArrayPointer_Hip(u); @@ -234,7 +234,7 @@ static void PrintIntro(int toltype, int usefused) /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -277,11 +277,11 @@ static void PrintFinalStats(void *cvode_mem) __global__ static void f_kernel(sunindextype N, - realtype hordc, realtype horac, - const realtype* u, realtype* udot) + sunrealtype hordc, sunrealtype horac, + const sunrealtype* u, sunrealtype* udot) { sunindextype i = blockDim.x*blockIdx.x + threadIdx.x; - realtype ui, ult, urt, hdiff, hadv; + sunrealtype ui, ult, urt, hdiff, hadv; if (i < N) { /* Extract u at x_i and two neighboring points */ @@ -296,10 +296,10 @@ static void f_kernel(sunindextype N, } } -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype hordc, horac; - realtype *udata, *dudata; + sunrealtype hordc, horac; + sunrealtype *udata, *dudata; sunindextype N; size_t grid, block; UserData data; diff --git a/examples/cvode/hip/cvAdvDiff_kry_hip.cpp b/examples/cvode/hip/cvAdvDiff_kry_hip.cpp index 0539d17f37..e41081a857 100644 --- a/examples/cvode/hip/cvAdvDiff_kry_hip.cpp +++ b/examples/cvode/hip/cvAdvDiff_kry_hip.cpp @@ -43,7 +43,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* access to SPGMR SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ #include @@ -83,11 +83,11 @@ * HIP kernels */ -__global__ void fKernel(const realtype *u, realtype *udot, +__global__ void fKernel(const sunrealtype *u, sunrealtype *udot, sunindextype MX, sunindextype MY, - realtype hordc, realtype horac, realtype verdc) + sunrealtype hordc, sunrealtype horac, sunrealtype verdc) { - realtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; + sunrealtype uij, udn, uup, ult, urt, hdiff, hadv, vdiff; sunindextype i, j, tid; /* Loop over all grid points. */ @@ -113,9 +113,9 @@ __global__ void fKernel(const realtype *u, realtype *udot, } -__global__ void jtvKernel(const realtype *vdata, realtype *Jvdata, +__global__ void jtvKernel(const sunrealtype *vdata, sunrealtype *Jvdata, sunindextype MX, sunindextype MY, - realtype hordc, realtype horac, realtype verdc) + sunrealtype hordc, sunrealtype horac, sunrealtype verdc) { sunindextype i, j, tid; @@ -143,8 +143,8 @@ __global__ void jtvKernel(const realtype *vdata, realtype *Jvdata, /* Type : _UserData (contains model and discretization parameters) */ struct _UserData { sunindextype MX, MY, NEQ; - realtype dx, dy, XMAX, YMAX; - realtype hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, XMAX, YMAX; + sunrealtype hdcoef, hacoef, vdcoef; }; typedef _UserData *UserData; @@ -154,14 +154,14 @@ static UserData SetUserData(int argc, char** argv); static void SetIC(N_Vector u, UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp); /* Private Helper Functions */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserData data); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -177,7 +177,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char** argv) { sundials::Context sunctx; - realtype reltol, abstol, t, tout, umax; + sunrealtype reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNLinearSolver LS; @@ -292,8 +292,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const realtype XMAX = RCONST(2.0); /* domain boundaries */ - const realtype YMAX = RCONST(1.0); + const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); @@ -319,18 +319,18 @@ static void SetIC(N_Vector u, UserData data) { /* Extract needed constants from data */ - const realtype dx = data->dx; - const realtype dy = data->dy; - const realtype xmax = data->XMAX; - const realtype ymax = data->YMAX; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; + const sunrealtype xmax = data->XMAX; + const sunrealtype ymax = data->YMAX; const sunindextype MY = data->MY; const sunindextype NEQ = data->NEQ; /* Extract pointer to solution vector data on the host */ - realtype *udata = N_VGetHostArrayPointer_Hip(u); + sunrealtype *udata = N_VGetHostArrayPointer_Hip(u); sunindextype i, j, tid; - realtype x, y; + sunrealtype x, y; /* Load initial profile into u vector */ @@ -356,20 +356,20 @@ static void SetIC(N_Vector u, UserData data) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { UserData data = (UserData) user_data; /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *udata = N_VGetDeviceArrayPointer_Hip(u); - realtype *dudata = N_VGetDeviceArrayPointer_Hip(udot); + const sunrealtype *udata = N_VGetDeviceArrayPointer_Hip(u); + sunrealtype *dudata = N_VGetDeviceArrayPointer_Hip(udot); unsigned block = 256; unsigned grid = (MX*MY + block - 1) / block; @@ -382,7 +382,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian-times-vector routine. */ -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp) { @@ -391,13 +391,13 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Extract needed constants from data */ const sunindextype MX = data->MX; const sunindextype MY = data->MY; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *vdata = N_VGetDeviceArrayPointer_Hip(v); - realtype *Jvdata = N_VGetDeviceArrayPointer_Hip(Jv); + const sunrealtype *vdata = N_VGetDeviceArrayPointer_Hip(v); + sunrealtype *Jvdata = N_VGetDeviceArrayPointer_Hip(Jv); unsigned block = 256; unsigned grid = (MX*MY + block - 1) / block; @@ -417,7 +417,7 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data) { printf("\n2-D Advection-Diffusion Equation\n"); @@ -431,7 +431,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax, /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { printf("At t = %4.2" FSYM " max.norm(u) =%14.6" ESYM " nst = %4ld\n", t, umax, nst); return; diff --git a/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp b/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp index 58a136a74f..cfe764e1fb 100644 --- a/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp +++ b/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp @@ -102,8 +102,8 @@ using ExecSpace = Kokkos::Serial; using MemSpace = Kokkos::HostSpace; #endif -using Vec1D = Kokkos::View; -using Vec2D = Kokkos::View; +using Vec1D = Kokkos::View; +using Vec2D = Kokkos::View; using Vec2DHost = Vec2D::HostMirror; using VecType = sundials::kokkos::Vector; using MatType = sundials::kokkos::DenseMatrix; diff --git a/examples/cvode/parallel/cvAdvDiff_diag_p.c b/examples/cvode/parallel/cvAdvDiff_diag_p.c index e6e2f74916..aa55dec453 100644 --- a/examples/cvode/parallel/cvAdvDiff_diag_p.c +++ b/examples/cvode/parallel/cvAdvDiff_diag_p.c @@ -44,7 +44,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* prototypes for CVODE diagonal solver */ #include /* access to MPI-parallel N_Vector */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include #include /* MPI constants and types */ @@ -66,26 +66,26 @@ contains grid constants, parallel machine parameters, work array. */ typedef struct { - realtype dx, hdcoef, hacoef; + sunrealtype dx, hdcoef, hacoef; int npes, my_pe; MPI_Comm comm; - realtype z[100]; + sunrealtype z[100]; } *UserData; /* Private Helper Functions */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void PrintIntro(int npes); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) { SUNContext sunctx; SUNLogger logger; - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; N_Vector u; UserData data; void *cvode_mem; @@ -185,7 +185,7 @@ int main(int argc, char *argv[]) reltol = ZERO; /* Set the tolerances */ abstol = ATOL; - dx = data->dx = XMAX/((realtype)(MX+1)); /* Set grid coefficients in data */ + dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ data->hdcoef = RCONST(1.0)/(dx*dx); data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); @@ -251,13 +251,13 @@ int main(int argc, char *argv[]) /* Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i; sunindextype iglobal; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetArrayPointer(u); @@ -284,7 +284,7 @@ static void PrintIntro(int npes) /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -325,10 +325,10 @@ static void PrintFinalStats(void *cvode_mem) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype *udata, *dudata, *z; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype *udata, *dudata, *z; int npes, my_pe, my_pe_m1, my_pe_p1, last_pe; sunindextype i, my_length; UserData data; diff --git a/examples/cvode/parallel/cvAdvDiff_non_p.c b/examples/cvode/parallel/cvAdvDiff_non_p.c index 6ad6d7ddae..bb7622130c 100644 --- a/examples/cvode/parallel/cvAdvDiff_non_p.c +++ b/examples/cvode/parallel/cvAdvDiff_non_p.c @@ -44,7 +44,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* access to MPI-parallel N_Vector */ #include "sunnonlinsol/sunnonlinsol_fixedpoint.h" /* access to the fixed point SUNNonlinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* MPI constants and types */ @@ -65,26 +65,26 @@ contains grid constants, parallel machine parameters, work array. */ typedef struct { - realtype dx, hdcoef, hacoef; + sunrealtype dx, hdcoef, hacoef; int npes, my_pe; MPI_Comm comm; - realtype z[100]; + sunrealtype z[100]; } *UserData; /* Private Helper Functions */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void PrintIntro(int npes); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -94,7 +94,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; N_Vector u; UserData data; void *cvode_mem; @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) reltol = ZERO; /* Set the tolerances */ abstol = ATOL; - dx = data->dx = XMAX/((realtype)(MX+1)); /* Set grid coefficients in data */ + dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ data->hdcoef = RCONST(1.0)/(dx*dx); data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); @@ -210,13 +210,13 @@ int main(int argc, char *argv[]) /* Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i; sunindextype iglobal; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetArrayPointer(u); @@ -242,7 +242,7 @@ static void PrintIntro(int npes) /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -283,10 +283,10 @@ static void PrintFinalStats(void *cvode_mem) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype *udata, *dudata, *z; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype *udata, *dudata, *z; int npes, my_pe, my_pe_m1, my_pe_p1, last_pe; sunindextype i, my_length; UserData data; diff --git a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c index 846c56d198..132e5ef909 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c @@ -66,7 +66,7 @@ #include /* access to MPI-parallel N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* access to CVBBDPRE module */ -#include /* definitions of realtype, booleantype */ +#include /* definitions of sunrealtype, booleantype */ #include /* MPI constants and types */ @@ -124,8 +124,8 @@ grid constants, processor indices, MPI communicator */ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmxsub2, Nlocal; MPI_Comm comm; @@ -139,30 +139,30 @@ static void SetInitialProfiles(N_Vector u, UserData data); static void PrintIntro(int npes, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep); static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uarray[]); + sunrealtype uarray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]); + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]); -static void fucomm(realtype t, N_Vector u, void *user_data); +static void fucomm(sunrealtype t, N_Vector u, void *user_data); /* Prototype of function called by the solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Prototype of functions called by the CVBBDPRE module */ -static int flocal(sunindextype Nlocal, realtype t, N_Vector u, +static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -177,7 +177,7 @@ int main(int argc, char *argv[]) UserData data; SUNLinearSolver LS; void *cvode_mem; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; int iout, my_pe, npes, retval, jpre; sunindextype neq, local_N, mudq, mldq, mukeep, mlkeep; @@ -331,8 +331,8 @@ static void InitUserData(int my_pe, sunindextype local_N, MPI_Comm comm, /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -358,8 +358,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) int isubx, isuby; int lx, ly, jx, jy; sunindextype offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *uarray; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *uarray; /* Set pointer to data array in vector u */ @@ -413,12 +413,12 @@ static void PrintIntro(int npes, sunindextype mudq, sunindextype mldq, /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int qu, retval, npelast; long int nst; sunindextype i0, i1; - realtype hu, *uarray, tempu[2]; + sunrealtype hu, *uarray, tempu[2]; MPI_Status status; npelast = NPEX*NPEY - 1; @@ -529,11 +529,11 @@ static void PrintFinalStats(void *cvode_mem) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uarray[]) + sunrealtype uarray[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ @@ -575,7 +575,7 @@ static void BSend(MPI_Comm comm, /* Routine to start receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ @@ -583,11 +583,11 @@ static void BSend(MPI_Comm comm, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -617,19 +617,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], /* Routine to finish receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -672,10 +672,10 @@ static void BRecvWait(MPI_Request request[], /* fucomm routine. This routine performs all inter-processor communication of data in u needed to calculate f. */ -static void fucomm(realtype t, N_Vector u, void *user_data) +static void fucomm(sunrealtype t, N_Vector u, void *user_data) { UserData data; - realtype *uarray, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *uarray, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -710,7 +710,7 @@ static void fucomm(realtype t, N_Vector u, void *user_data) /* f routine. Evaluate f(t,y). First call fucomm to do communication of subgrid boundary data into uext. Then calculate f by a call to flocal. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { UserData data; @@ -733,19 +733,19 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) inter-processor communication of data needed to calculate f has already been done, and this data is in the work array uext. */ -static int flocal(sunindextype Nlocal, realtype t, N_Vector u, +static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy; int isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; UserData data; - realtype *uarray, *duarray; + sunrealtype *uarray, *duarray; uarray = N_VGetArrayPointer(u); duarray = N_VGetArrayPointer(udot); diff --git a/examples/cvode/parallel/cvDiurnal_kry_p.c b/examples/cvode/parallel/cvDiurnal_kry_p.c index 5dcc94d97f..373a8058d1 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_p.c @@ -63,7 +63,7 @@ #include /* access to MPI-parallel N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* prototypes for small dense fcts. */ -#include /* definitions of realtype, booleantype */ +#include /* definitions of sunrealtype, booleantype */ #include /* MPI constants and types */ @@ -120,7 +120,7 @@ /* IJth is defined in order to write code which indexes into dense matrices with a (row,column) pair, where 1 <= row,column <= NVARS. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NVARS. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -134,14 +134,14 @@ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; int nvmxsub, nvmxsub2; MPI_Comm comm; /* For preconditioner */ - realtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; + sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; } *UserData; @@ -152,36 +152,36 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector u, UserData data); static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype udata[]); + sunrealtype udata[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]); -static void ucomm(realtype t, N_Vector u, UserData data); -static void fcalc(realtype t, realtype udata[], realtype dudata[], + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]); +static void ucomm(sunrealtype t, N_Vector u, UserData data); +static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -195,7 +195,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -316,8 +316,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -369,8 +369,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) { int isubx, isuby, lx, ly, jx, jy; sunindextype offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *udata; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *udata; /* Set pointer to data array in vector u */ udata = N_VGetArrayPointer(u); @@ -405,10 +405,10 @@ static void SetInitialProfiles(N_Vector u, UserData data) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int qu, retval; - realtype hu, *udata, tempu[2]; + sunrealtype hu, *udata, tempu[2]; int npelast; long int nst; sunindextype i0, i1; @@ -514,11 +514,11 @@ static void PrintFinalStats(void *cvode_mem) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype udata[]) + sunrealtype udata[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -555,7 +555,7 @@ static void BSend(MPI_Comm comm, /* Routine to start receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ @@ -563,11 +563,11 @@ static void BSend(MPI_Comm comm, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -596,19 +596,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], /* Routine to finish receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -651,10 +651,10 @@ static void BRecvWait(MPI_Request request[], /* ucomm routine. This routine performs all communication between processors of data needed to calculate f. */ -static void ucomm(realtype t, N_Vector u, UserData data) +static void ucomm(sunrealtype t, N_Vector u, UserData data) { - realtype *udata, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *udata, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -683,14 +683,14 @@ static void ucomm(realtype t, N_Vector u, UserData data) between processors of data needed to calculate f has already been done, and this data is in the work array uext. */ -static void fcalc(realtype t, realtype udata[], - realtype dudata[], UserData data) +static void fcalc(sunrealtype t, sunrealtype udata[], + sunrealtype dudata[], UserData data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy; int isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; @@ -815,9 +815,9 @@ static void fcalc(realtype t, realtype udata[], /* f routine. Evaluate f(t,y). First call ucomm to do communication of subgrid boundary data into uext. Then calculate f by a call to fcalc. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *udata, *dudata; + sunrealtype *udata, *dudata; UserData data; udata = N_VGetArrayPointer(u); @@ -834,17 +834,17 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) } /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data) + sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; int nvmxsub, offset; sunindextype retval; sunindextype *(*pivot)[MYSUB]; int lx, ly, jy, isuby; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; /* Make local copies of pointers in user_data, pointer to u's data, @@ -923,16 +923,16 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, } /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MYSUB]; + sunrealtype **(*P)[MYSUB]; int nvmxsub; sunindextype *(*pivot)[MYSUB]; int lx, ly; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data */ diff --git a/examples/cvode/parhyp/cvAdvDiff_non_ph.c b/examples/cvode/parhyp/cvAdvDiff_non_ph.c index 94dbb72e49..b7ca890d80 100644 --- a/examples/cvode/parhyp/cvAdvDiff_non_ph.c +++ b/examples/cvode/parhyp/cvAdvDiff_non_ph.c @@ -48,7 +48,7 @@ #include #include /* prototypes for CVODE fcts. */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ #include /* definition of EXP */ #include /* nvector implementation */ #include "sunnonlinsol/sunnonlinsol_fixedpoint.h" /* access to the fixed point SUNNonlinearSolver */ @@ -75,26 +75,26 @@ contains grid constants, parhyp machine parameters, work array. */ typedef struct { - realtype dx, hdcoef, hacoef; + sunrealtype dx, hdcoef, hacoef; int npes, my_pe; MPI_Comm comm; - realtype z[100]; + sunrealtype z[100]; } *UserData; /* Private Helper Functions */ -static void SetIC(HYPRE_IJVector Uij, realtype dx, sunindextype my_length, +static void SetIC(HYPRE_IJVector Uij, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void PrintIntro(int npes); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -104,7 +104,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; N_Vector u; UserData data; void *cvode_mem; @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) reltol = ZERO; /* Set the tolerances */ abstol = ATOL; - dx = data->dx = XMAX/((realtype)(MX+1)); /* Set grid coefficients in data */ + dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ data->hdcoef = RCONST(1.0)/(dx*dx); data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); @@ -232,16 +232,16 @@ int main(int argc, char *argv[]) /* Set initial conditions in u vector */ -static void SetIC(HYPRE_IJVector Uij, realtype dx, sunindextype my_length, +static void SetIC(HYPRE_IJVector Uij, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i; HYPRE_Int *iglobal; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ - udata = (realtype*) malloc(my_length*sizeof(realtype)); + udata = (sunrealtype*) malloc(my_length*sizeof(sunrealtype)); iglobal = (HYPRE_Int*) malloc(my_length*sizeof(HYPRE_Int)); /* Load initial profile into u vector */ @@ -267,7 +267,7 @@ static void PrintIntro(int npes) /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -308,10 +308,10 @@ static void PrintFinalStats(void *cvode_mem) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype *udata, *udotdata, *z; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype *udata, *udotdata, *z; int i; int npes, my_pe, my_length, my_pe_m1, my_pe_p1, last_pe; UserData data; diff --git a/examples/cvode/petsc/cvAdvDiff_petsc.c b/examples/cvode/petsc/cvAdvDiff_petsc.c index d70bcc5613..ae7372ac22 100644 --- a/examples/cvode/petsc/cvAdvDiff_petsc.c +++ b/examples/cvode/petsc/cvAdvDiff_petsc.c @@ -49,7 +49,7 @@ #include /* prototypes for CVODE fcts., consts. */ #include /* access to the PETSc N_Vector */ #include "sunnonlinsol/sunnonlinsol_petscsnes.h" /* access to the fixed point SUNNonlinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ /* Problem Constants */ @@ -69,26 +69,26 @@ contains grid constants, parallel machine parameters, work array. */ typedef struct { - realtype dx, hdcoef, hacoef; + sunrealtype dx, hdcoef, hacoef; int npes, my_pe; MPI_Comm comm; - realtype z[100]; + sunrealtype z[100]; } *UserData; /* Private Helper Functions */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void PrintIntro(int npes); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) long int nst; PetscErrorCode ptcerr; sunindextype local_N, nperpe, nrem, my_base; - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; MPI_Comm comm; SNES snes; @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) data->my_pe = my_pe; /* Set grid coefficients */ - dx = data->dx = XMAX/((realtype)(MX+1)); + dx = data->dx = XMAX/((sunrealtype)(MX+1)); data->hdcoef = RCONST(1.0)/(dx*dx); data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); @@ -232,11 +232,11 @@ int main(int argc, char *argv[]) /************************ Private Helper Functions ***********************/ /* Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i, iglobal; - realtype x; + sunrealtype x; Vec uvec; /* Set pointer to data array and get local length of u. */ @@ -260,7 +260,7 @@ static void PrintIntro(int npes) } /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -298,11 +298,11 @@ static void PrintFinalStats(void *cvode_mem) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { PetscErrorCode ptcerr; - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype *udata, *dudata, *z; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype *udata, *dudata, *z; sunindextype my_length; int i, npes, my_pe, my_pe_m1, my_pe_p1, last_pe; UserData data; diff --git a/examples/cvode/raja/cvAdvDiff_kry_raja.cpp b/examples/cvode/raja/cvAdvDiff_kry_raja.cpp index d4ceb02206..6ce984a1fa 100644 --- a/examples/cvode/raja/cvAdvDiff_kry_raja.cpp +++ b/examples/cvode/raja/cvAdvDiff_kry_raja.cpp @@ -82,8 +82,8 @@ /* Type : _UserData (contains model and discretization parameters) */ struct _UserData { sunindextype MX, MY, NEQ; - realtype dx, dy, XMAX, YMAX; - realtype hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, XMAX, YMAX; + sunrealtype hdcoef, hacoef, vdcoef; }; typedef _UserData *UserData; @@ -93,14 +93,14 @@ static UserData SetUserData(int argc, char** argv); static void SetIC(N_Vector u, UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp); /* Private Helper Functions */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserData data); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -116,7 +116,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char** argv) { sundials::Context sunctx; - realtype reltol, abstol, t, tout, umax; + sunrealtype reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNLinearSolver LS; @@ -215,8 +215,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const realtype XMAX = RCONST(2.0); /* domain boundaries */ - const realtype YMAX = RCONST(1.0); + const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); @@ -243,18 +243,18 @@ static void SetIC(N_Vector u, UserData data) { /* Extract needed constants from data */ - const realtype dx = data->dx; - const realtype dy = data->dy; - const realtype xmax = data->XMAX; - const realtype ymax = data->YMAX; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; + const sunrealtype xmax = data->XMAX; + const sunrealtype ymax = data->YMAX; const sunindextype MY = data->MY; const sunindextype NEQ = data->NEQ; /* Extract pointer to solution vector data on the host */ - realtype *udata = N_VGetHostArrayPointer_Raja(u); + sunrealtype *udata = N_VGetHostArrayPointer_Raja(u); sunindextype i, j, tid; - realtype x, y; + sunrealtype x, y; /* Load initial profile into u vector */ @@ -280,7 +280,7 @@ static void SetIC(N_Vector u, UserData data) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { UserData data = (UserData) user_data; @@ -288,13 +288,13 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) const sunindextype MX = data->MX; const sunindextype MY = data->MY; const sunindextype NEQ = data->NEQ; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *udata = N_VGetDeviceArrayPointer_Raja(u); - realtype *dudata = N_VGetDeviceArrayPointer_Raja(udot); + const sunrealtype *udata = N_VGetDeviceArrayPointer_Raja(u); + sunrealtype *dudata = N_VGetDeviceArrayPointer_Raja(udot); const sunindextype zero = 0; @@ -303,18 +303,18 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) sunindextype i = index/MY; sunindextype j = index%MY; - realtype uab = udata[index]; + sunrealtype uab = udata[index]; - realtype udn = (j == 0) ? ZERO : udata[index - 1]; - realtype uup = (j == MY-1) ? ZERO : udata[index + 1]; - realtype ult = (i == 0) ? ZERO : udata[index - MY]; - realtype urt = (i == MX-1) ? ZERO : udata[index + MY]; + sunrealtype udn = (j == 0) ? ZERO : udata[index - 1]; + sunrealtype uup = (j == MY-1) ? ZERO : udata[index + 1]; + sunrealtype ult = (i == 0) ? ZERO : udata[index - MY]; + sunrealtype urt = (i == MX-1) ? ZERO : udata[index + MY]; /* Set diffusion and advection terms and load into udot */ - realtype hdiff = hordc*(ult -TWO*uab + urt); - realtype hadv = horac*(urt - ult); - realtype vdiff = verdc*(udn -TWO*uab + uup); + sunrealtype hdiff = hordc*(ult -TWO*uab + urt); + sunrealtype hadv = horac*(urt - ult); + sunrealtype vdiff = verdc*(udn -TWO*uab + uup); dudata[index] = hdiff + hadv + vdiff; } @@ -326,7 +326,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian-times-vector routine. */ -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp) { @@ -336,13 +336,13 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, const sunindextype MX = data->MX; const sunindextype MY = data->MY; const sunindextype NEQ = data->NEQ; - const realtype hordc = data->hdcoef; - const realtype horac = data->hacoef; - const realtype verdc = data->vdcoef; + const sunrealtype hordc = data->hdcoef; + const sunrealtype horac = data->hacoef; + const sunrealtype verdc = data->vdcoef; /* Extract pointers to vector data */ - const realtype *vdata = N_VGetDeviceArrayPointer_Raja(v); - realtype *Jvdata = N_VGetDeviceArrayPointer_Raja(Jv); + const sunrealtype *vdata = N_VGetDeviceArrayPointer_Raja(v); + sunrealtype *Jvdata = N_VGetDeviceArrayPointer_Raja(Jv); const sunindextype zero = 0; @@ -372,7 +372,7 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserData data) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax, UserData data) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %ld X %ld\n", (long) data->MX, (long) data->MY); @@ -395,7 +395,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax, UserDat /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvode/serial/cvAdvDiff_bnd.c b/examples/cvode/serial/cvAdvDiff_bnd.c index 4a6bfbc9ab..9634730f3b 100644 --- a/examples/cvode/serial/cvAdvDiff_bnd.c +++ b/examples/cvode/serial/cvAdvDiff_bnd.c @@ -44,7 +44,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ /* Problem Constants */ @@ -82,15 +82,15 @@ /* Type : UserData (contains grid constants) */ typedef struct { - realtype dx, dy, hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, hdcoef, hacoef, vdcoef; SUNProfiler profobj; } *UserData; /* Private Helper Functions */ static void SetIC(N_Vector u, UserData data); -static void PrintHeader(realtype reltol, realtype abstol, realtype umax); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -99,8 +99,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -112,7 +112,7 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, int main(void) { - realtype dx, dy, reltol, abstol, t, tout, umax; + sunrealtype dx, dy, reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNMatrix A; @@ -237,10 +237,10 @@ int main(void) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u,N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; - realtype *udata, *dudata; + sunrealtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; + sunrealtype *udata, *dudata; int i, j; UserData data; @@ -286,12 +286,12 @@ static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) /* Jacobian routine. Compute J(t,u). */ -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunindextype i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* @@ -343,8 +343,8 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, static void SetIC(N_Vector u, UserData data) { int i, j; - realtype x, y, dx, dy; - realtype *udata; + sunrealtype x, y, dx, dy; + sunrealtype *udata; /* Extract needed constants from data */ @@ -368,7 +368,7 @@ static void SetIC(N_Vector u, UserData data) /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -389,7 +389,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax) /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvode/serial/cvAdvDiff_bndL.c b/examples/cvode/serial/cvAdvDiff_bndL.c index 278c1d17b6..7cba61b915 100644 --- a/examples/cvode/serial/cvAdvDiff_bndL.c +++ b/examples/cvode/serial/cvAdvDiff_bndL.c @@ -41,7 +41,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ /* Problem Constants */ @@ -79,14 +79,14 @@ /* Type : UserData (contains grid constants) */ typedef struct { - realtype dx, dy, hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, hdcoef, hacoef, vdcoef; } *UserData; /* Private Helper Functions */ static void SetIC(N_Vector u, UserData data); -static void PrintHeader(realtype reltol, realtype abstol, realtype umax); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -95,8 +95,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -109,7 +109,7 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, int main(void) { SUNContext sunctx; - realtype dx, dy, reltol, abstol, t, tout, umax; + sunrealtype dx, dy, reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNMatrix A; @@ -217,10 +217,10 @@ int main(void) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u,N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; - realtype *udata, *dudata; + sunrealtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; + sunrealtype *udata, *dudata; int i, j; UserData data; @@ -262,12 +262,12 @@ static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) /* Jacobian routine. Compute J(t,u). */ -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { int i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* @@ -315,8 +315,8 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, static void SetIC(N_Vector u, UserData data) { int i, j; - realtype x, y, dx, dy; - realtype *udata; + sunrealtype x, y, dx, dy; + sunrealtype *udata; /* Extract needed constants from data */ @@ -340,7 +340,7 @@ static void SetIC(N_Vector u, UserData data) /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -358,7 +358,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax) /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvode/serial/cvAnalytic_mels.c b/examples/cvode/serial/cvAnalytic_mels.c index 8833e9f4f3..9bc50b3f84 100644 --- a/examples/cvode/serial/cvAnalytic_mels.c +++ b/examples/cvode/serial/cvAnalytic_mels.c @@ -33,7 +33,7 @@ #include #include /* prototypes for CVODE fcts., consts. */ #include /* access to serial N_Vector */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -46,17 +46,17 @@ #endif /* User-supplied functions called by CVode */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Custom linear solver data structure, accessor macros, and routines */ static SUNLinearSolver MatrixEmbeddedLS(void *cvode_mem); static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S); static int MatrixEmbeddedLSSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol); + N_Vector b, sunrealtype tol); static int MatrixEmbeddedLSFree(SUNLinearSolver S); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -68,20 +68,20 @@ static SUNContext sunctx = NULL; int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); - realtype lamda = RCONST(-100.0); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); + sunrealtype lamda = RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *cvode_mem = NULL; /* empty CVode memory structure */ - realtype t, tout; + sunrealtype t, tout; long int nst, nfe, nsetups, nje, nfeLS, nni, ncfn, netf; /* Create the SUNDIALS context */ @@ -193,11 +193,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype u = NV_Ith_S(y,0); /* access current solution value */ + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ NV_Ith_S(ydot,0) = lamda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lamda*atan(t); @@ -236,15 +236,15 @@ static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S) /* linear solve routine */ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { /* temporary variables */ int retval; N_Vector y, ypred, fn, zn1; - realtype tcur, gamma, rl1; + sunrealtype tcur, gamma, rl1; void *user_data; - realtype *rdata; - realtype lamda; + sunrealtype *rdata; + sunrealtype lamda; /* retrieve implicit system data from CVode */ retval = CVodeGetNonlinearSystemData(LS->content, &tcur, &ypred, &y, &fn, @@ -253,7 +253,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, return(-1); /* extract stiffness parameter from user_data */ - rdata = (realtype *) user_data; + rdata = (sunrealtype *) user_data; lamda = rdata[0]; /* perform linear solve: (1-gamma*lamda)*x = b */ @@ -312,10 +312,10 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) } /* check the computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ - realtype ans, err, ewt; /* answer data, error, and error weight */ + sunrealtype ans, err, ewt; /* answer data, error, and error weight */ /* compute solution error */ ans = atan(t); diff --git a/examples/cvode/serial/cvDirectDemo_ls.c b/examples/cvode/serial/cvDirectDemo_ls.c index 63387f2a34..f9b80c0d57 100644 --- a/examples/cvode/serial/cvDirectDemo_ls.c +++ b/examples/cvode/serial/cvDirectDemo_ls.c @@ -73,7 +73,7 @@ #include /* access to CVDIAG linear solver */ #include "sunnonlinsol/sunnonlinsol_newton.h" /* access to the newton SUNNonlinearSolver */ #include "sunnonlinsol/sunnonlinsol_fixedpoint.h" /* access to the fixed point SUNNonlinearSolver */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -125,28 +125,28 @@ enum {FUNC, DENSE_USER, DENSE_DQ, DIAG, BAND_USER, BAND_DQ}; static int Problem1(void); static void PrintIntro1(void); static void PrintHeader1(void); -static void PrintOutput1(realtype t, realtype y0, realtype y1, int qu, realtype hu); +static void PrintOutput1(sunrealtype t, sunrealtype y0, sunrealtype y1, int qu, sunrealtype hu); static int Problem2(void); static void PrintIntro2(void); static void PrintHeader2(void); -static void PrintOutput2(realtype t, realtype erm, int qu, realtype hu); -static realtype MaxError(N_Vector y, realtype t); +static void PrintOutput2(sunrealtype t, sunrealtype erm, int qu, sunrealtype hu); +static sunrealtype MaxError(N_Vector y, sunrealtype t); static int PrepareNextRun(SUNContext sunctx, void *cvode_mem, int lmm, int miter, N_Vector y, SUNMatrix* A, sunindextype mu, sunindextype ml, SUNLinearSolver* LS, SUNNonlinearSolver* NLS); -static void PrintErrOutput(realtype tol_factor); -static void PrintFinalStats(void *cvode_mem, int miter, realtype ero); +static void PrintErrOutput(sunrealtype tol_factor); +static void PrintFinalStats(void *cvode_mem, int miter, sunrealtype ero); static void PrintErrInfo(int nerr); /* Functions Called by the Solver */ -static int f1(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac1(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, +static int f1(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac1(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int f2(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac2(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int f2(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac2(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ @@ -168,7 +168,7 @@ int main(void) static int Problem1(void) { - realtype reltol=RTOL, abstol=ATOL, t, tout, ero, er; + sunrealtype reltol=RTOL, abstol=ATOL, t, tout, ero, er; int miter, retval, temp_retval, iout, nerr=0; N_Vector y; SUNMatrix A; @@ -177,7 +177,7 @@ static int Problem1(void) void *cvode_mem; booleantype firstrun; int qu; - realtype hu; + sunrealtype hu; SUNContext sunctx; y = NULL; @@ -347,7 +347,7 @@ static void PrintHeader1(void) return; } -static void PrintOutput1(realtype t, realtype y0, realtype y1, int qu, realtype hu) +static void PrintOutput1(sunrealtype t, sunrealtype y0, sunrealtype y1, int qu, sunrealtype hu) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("%10.5Lf %12.5Le %12.5Le %2d %6.4Le\n", t, y0, y1, qu, hu); @@ -360,9 +360,9 @@ static void PrintOutput1(realtype t, realtype y0, realtype y1, int qu, realtype return; } -static int f1(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f1(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y0, y1; + sunrealtype y0, y1; y0 = NV_Ith_S(y,0); y1 = NV_Ith_S(y,1); @@ -373,10 +373,10 @@ static int f1(realtype t, N_Vector y, N_Vector ydot, void *user_data) return(0); } -static int Jac1(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac1(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y0, y1; + sunrealtype y0, y1; y0 = NV_Ith_S(y,0); y1 = NV_Ith_S(y,1); @@ -390,7 +390,7 @@ static int Jac1(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, static int Problem2(void) { - realtype reltol=RTOL, abstol=ATOL, t, tout, er, erm, ero; + sunrealtype reltol=RTOL, abstol=ATOL, t, tout, er, erm, ero; int miter, retval, temp_retval, nerr=0; N_Vector y; SUNMatrix A; @@ -399,7 +399,7 @@ static int Problem2(void) void *cvode_mem; booleantype firstrun; int qu, iout; - realtype hu; + sunrealtype hu; SUNContext sunctx; y = NULL; @@ -572,7 +572,7 @@ static void PrintHeader2(void) return; } -static void PrintOutput2(realtype t, realtype erm, int qu, realtype hu) +static void PrintOutput2(sunrealtype t, sunrealtype erm, int qu, sunrealtype hu) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("%10.3Lf %12.4Le %2d %12.4Le\n", t, erm, qu, hu); @@ -585,10 +585,10 @@ static void PrintOutput2(realtype t, realtype erm, int qu, realtype hu) return; } -static int f2(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f2(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { sunindextype i, j, k; - realtype d, *ydata, *dydata; + sunrealtype d, *ydata, *dydata; ydata = N_VGetArrayPointer(y); dydata = N_VGetArrayPointer(ydot); @@ -613,11 +613,11 @@ static int f2(realtype t, N_Vector y, N_Vector ydot, void *user_data) return(0); } -static int Jac2(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac2(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { int i, j, k; - realtype *kthCol; + sunrealtype *kthCol; /* The components of f(t,y) which depend on y are @@ -648,10 +648,10 @@ static int Jac2(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, return(0); } -static realtype MaxError(N_Vector y, realtype t) +static sunrealtype MaxError(N_Vector y, sunrealtype t) { sunindextype i, j, k; - realtype *ydata, er, ex=ZERO, yt, maxError=ZERO, ifact_inv, jfact_inv=ONE; + sunrealtype *ydata, er, ex=ZERO, yt, maxError=ZERO, ifact_inv, jfact_inv=ONE; if (t == ZERO) return(ZERO); @@ -815,7 +815,7 @@ static int PrepareNextRun(SUNContext sunctx, void *cvode_mem, int lmm, int miter return(retval); } -static void PrintErrOutput(realtype tol_factor) +static void PrintErrOutput(sunrealtype tol_factor) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("\n\n Error exceeds %Lg * tolerance \n\n", tol_factor); @@ -828,7 +828,7 @@ static void PrintErrOutput(realtype tol_factor) return; } -static void PrintFinalStats(void *cvode_mem, int miter, realtype ero) +static void PrintFinalStats(void *cvode_mem, int miter, sunrealtype ero) { long int lenrw, leniw, lenrwLS, leniwLS; long int nst, nfe, nsetups, nni, ncfn, netf, nje, nfeLS; diff --git a/examples/cvode/serial/cvDisc_dns.c b/examples/cvode/serial/cvDisc_dns.c index d7069318a2..a06fab9d64 100644 --- a/examples/cvode/serial/cvDisc_dns.c +++ b/examples/cvode/serial/cvDisc_dns.c @@ -23,7 +23,7 @@ #include /* access to serial NVector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -43,7 +43,7 @@ /* User provided routine called by the solver to compute * the function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *f_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *f_data); /* Function for checking return values */ static int check_retval(void *flagvalue, const char *funcname, int opt); @@ -57,7 +57,7 @@ int main() N_Vector y; int flag, retval; - realtype reltol, abstol, t0, t1, t2, t; + sunrealtype reltol, abstol, t0, t1, t2, t; long int nst1, nst2, nst; reltol = RCONST(1.0e-3); @@ -335,7 +335,7 @@ int main() * flag = RHS2 -> y' = -5*y */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *f_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *f_data) { int *flag; diff --git a/examples/cvode/serial/cvDiurnal_kry.c b/examples/cvode/serial/cvDiurnal_kry.c index 31a659cec6..599363b897 100644 --- a/examples/cvode/serial/cvDiurnal_kry.c +++ b/examples/cvode/serial/cvDiurnal_kry.c @@ -45,7 +45,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -112,7 +112,7 @@ For each mesh point (j,k), the elements for species i and i+1 are contiguous within vdata. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NUM_SPECIES. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -124,9 +124,9 @@ contains preconditioner blocks, pivot arrays, and problem constants */ typedef struct { - realtype **P[MX][MY], **Jbd[MX][MY]; + sunrealtype **P[MX][MY], **Jbd[MX][MY]; sunindextype *pivot[MX][MY]; - realtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; } *UserData; /* Private Helper Functions */ @@ -134,8 +134,8 @@ typedef struct { static UserData AllocUserData(void); static void InitUserData(UserData data); static void FreeUserData(UserData data); -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy); -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t); +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy); +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -143,17 +143,17 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); -static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data); +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* @@ -165,7 +165,7 @@ static int PSolve(realtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, int main() { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -305,11 +305,11 @@ static void FreeUserData(UserData data) /* Set initial conditions in u */ -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) { int jx, jy; - realtype x, y, cx, cy; - realtype *udata; + sunrealtype x, y, cx, cy; + sunrealtype *udata; /* Set pointer to data array in vector u. */ @@ -333,11 +333,11 @@ static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t) +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; int mxh = MX/2 - 1, myh = MY/2 - 1, mx1 = MX - 1, my1 = MY - 1; udata = N_VGetArrayPointer(u); @@ -465,13 +465,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* f routine. Compute RHS function f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; - realtype *udata, *dudata; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *udata, *dudata; int jx, jy, idn, iup, ileft, iright; UserData data; @@ -558,18 +558,18 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian-times-vector routine. */ -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp) { - realtype c1, c2; - realtype v1, v2, v1dn, v2dn, v1up, v2up, v1lt, v2lt, v1rt, v2rt; - realtype Jv1, Jv2; - realtype cydn, cyup; - realtype s, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype c1, c2; + sunrealtype v1, v2, v1dn, v2dn, v1up, v2up, v1lt, v2lt, v1rt, v2rt; + sunrealtype Jv1, Jv2; + sunrealtype cydn, cyup; + sunrealtype s, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int jx, jy, idn, iup, ileft, iright; - realtype *udata, *vdata, *Jvdata; + sunrealtype *udata, *vdata, *Jvdata; UserData data; data = (UserData) user_data; @@ -695,14 +695,14 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MY], **(*Jbd)[MY]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MY], **(*Jbd)[MY]; sunindextype *(*pivot)[MY], retval; int jx, jy; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; /* Make local copies of pointers in user_data, and of pointer to u's data */ @@ -782,13 +782,13 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data) +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MY]; + sunrealtype **(*P)[MY]; sunindextype *(*pivot)[MY]; int jx, jy; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data. */ diff --git a/examples/cvode/serial/cvDiurnal_kry_bp.c b/examples/cvode/serial/cvDiurnal_kry_bp.c index 0413316242..3ead5dde00 100644 --- a/examples/cvode/serial/cvDiurnal_kry_bp.c +++ b/examples/cvode/serial/cvDiurnal_kry_bp.c @@ -44,7 +44,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* access to CVBANDPRE module */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -111,7 +111,7 @@ For each mesh point (j,k), the elements for species i and i+1 are contiguous within vdata. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NUM_SPECIES. The small matrix routines in cvode_bandpre.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -123,15 +123,15 @@ contains preconditioner blocks, pivot arrays, and problem constants */ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; } *UserData; /* Private Helper Functions */ static void InitUserData(UserData data); -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy); +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy); static void PrintIntro(sunindextype mu, sunindextype ml); -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t); +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -139,7 +139,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Function Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* *------------------------------- @@ -150,7 +150,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); int main() { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -286,11 +286,11 @@ static void InitUserData(UserData data) /* Set initial conditions in u */ -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) { int jx, jy; - realtype x, y, cx, cy; - realtype *udata; + sunrealtype x, y, cx, cy; + sunrealtype *udata; /* Set pointer to data array in vector u. */ @@ -324,11 +324,11 @@ static void PrintIntro(sunindextype mu, sunindextype ml) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t) +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; int mxh = MX/2 - 1, myh = MY/2 - 1, mx1 = MX - 1, my1 = MY - 1; udata = N_VGetArrayPointer(u); @@ -465,13 +465,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* f routine. Compute RHS function f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; - realtype *udata, *dudata; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *udata, *dudata; int jx, jy, idn, iup, ileft, iright; UserData data; diff --git a/examples/cvode/serial/cvHeat2D_klu.c b/examples/cvode/serial/cvHeat2D_klu.c index a4f2eff36e..9c219030fc 100644 --- a/examples/cvode/serial/cvHeat2D_klu.c +++ b/examples/cvode/serial/cvHeat2D_klu.c @@ -45,7 +45,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU sparse direct solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* User-defined vector and matrix accessor macro: Ith */ @@ -86,25 +86,25 @@ typedef struct { sunindextype mm; - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; } *UserData; /* Prototypes of functions called by CVODE */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int jacHeat(realtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, +static int jacHeat(sunrealtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Exact same setup as jacHeat. Function needed for special case MGRID=3 */ -static int jacHeat3(realtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, +static int jacHeat3(sunrealtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector uu); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *cvode_mem); static int SetInitialProfile(UserData data, N_Vector uu, N_Vector res); @@ -126,7 +126,7 @@ int main(void) SUNLinearSolver LS; int retval, iout; sunindextype mu, ml, netf, ncfn; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; int nnz; /* number of non-zeroes */ @@ -265,9 +265,9 @@ int main(void) // How to define f for heat equation like // in Roberts problem? //////////////////////////////////////// -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype u1, ud1; + sunrealtype u1, ud1; u1 = Ith(u,1); @@ -277,11 +277,11 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) } /* -int heatres(realtype tres, N_Vector uu, N_Vector resval, +int heatres(sunrealtype tres, N_Vector uu, N_Vector resval, void *user_data) { sunindextype mm, i, j, offset, loc; - realtype *uv, *resv, coeff; + sunrealtype *uv, *resv, coeff; UserData data; uv = N_VGetArrayPointer(uu); resv = N_VGetArrayPointer(resval); @@ -309,15 +309,15 @@ int heatres(realtype tres, N_Vector uu, N_Vector resval, */ /* Jacobian matrix setup for MGRID=3 */ -static int jacHeat3(realtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, +static int jacHeat3(sunrealtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JacMat); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JacMat); - realtype *data = SUNSparseMatrix_Data(JacMat); - realtype dx = ONE/(MGRID - ONE); - realtype beta = RCONST(4.0)/(dx*dx); + sunrealtype *data = SUNSparseMatrix_Data(JacMat); + sunrealtype dx = ONE/(MGRID - ONE); + sunrealtype beta = RCONST(4.0)/(dx*dx); yval = N_VGetArrayPointer(yy); @@ -382,15 +382,15 @@ static int jacHeat3(realtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, ////////////////////////////////////////////////////////////////// /* Jacobian matrix setup for MGRID>=4 */ -static int jacHeat(realtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, +static int jacHeat(sunrealtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); - realtype *data = SUNSparseMatrix_Data(J); - realtype dx = ONE/(MGRID - ONE); - realtype beta = RCONST(4.0)/(dx*dx); + sunrealtype *data = SUNSparseMatrix_Data(J); + sunrealtype dx = ONE/(MGRID - ONE); + sunrealtype beta = RCONST(4.0)/(dx*dx); int i,j, repeat=0; yval = N_VGetArrayPointer(yy); @@ -637,7 +637,7 @@ static int jacHeat(realtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, static int SetInitialProfile(UserData data, N_Vector uu, N_Vector res) { - realtype xfact, yfact, *udata; + sunrealtype xfact, yfact, *udata; sunindextype mm, mm1, i, j, offset, loc; mm = data->mm; @@ -678,7 +678,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector res) * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\ncvHeat2D_klu: Heat equation, serial example problem for CVODE\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -705,10 +705,10 @@ static void PrintHeader(realtype rtol, realtype atol) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { int retval; - realtype umax, hused; + sunrealtype umax, hused; long int nst, nni, nje, nre, nreLS; int kused; diff --git a/examples/cvode/serial/cvKrylovDemo_ls.c b/examples/cvode/serial/cvKrylovDemo_ls.c index dc89dfc91f..b847e62ad8 100644 --- a/examples/cvode/serial/cvKrylovDemo_ls.c +++ b/examples/cvode/serial/cvKrylovDemo_ls.c @@ -52,7 +52,7 @@ #include /* access to Newton SUNNonlinearSolver */ #include /* serial N_Vector types, fct. and macros */ #include /* use generic DENSE solver in preconditioning */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ #include /* helpful macros */ @@ -137,7 +137,7 @@ For each mesh point (j,k), the elements for species i and i+1 are contiguous within vdata. - IJth(a,i,j) references the (i,j)th entry of the matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the matrix sunrealtype **a, where 1 <= i,j <= NUM_SPECIES. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -150,9 +150,9 @@ solution vector, and linsolver type */ typedef struct { - realtype **P[MX][MY], **Jbd[MX][MY]; + sunrealtype **P[MX][MY], **Jbd[MX][MY]; sunindextype *pivot[MX][MY]; - realtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; N_Vector u; int linsolver; } *UserData; @@ -162,21 +162,21 @@ typedef struct { static UserData AllocUserData(void); static void InitUserData(UserData data, N_Vector u); static void FreeUserData(UserData data); -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy); -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t); +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy); +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t); static void PrintStats(void *cvode_mem, int linsolver, int stats); static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); static int myMonitorFunction(void *cvode_mem, void *user_data); @@ -189,7 +189,7 @@ static int myMonitorFunction(void *cvode_mem, void *user_data); int main(int argc, char* argv[]) { - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -197,7 +197,7 @@ int main(int argc, char* argv[]) void *cvode_mem; int linsolver, iout, retval; int nrmfactor; /* LS norm conversion factor flag */ - realtype nrmfac; /* LS norm conversion factor */ + sunrealtype nrmfac; /* LS norm conversion factor */ int monitor; /* LS resiudal monitoring flag */ SUNContext sunctx; SUNLogger logger; @@ -386,7 +386,7 @@ int main(int argc, char* argv[]) case(1): /* use the square root of the vector length */ - nrmfac = SQRT((realtype)NEQ); + nrmfac = SQRT((sunrealtype)NEQ); break; case(2): /* compute with dot product */ @@ -483,11 +483,11 @@ static void FreeUserData(UserData data) /* Set initial conditions in u */ -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) { int jx, jy; - realtype x, y, cx, cy; - realtype *udata; + sunrealtype x, y, cx, cy; + sunrealtype *udata; /* Set pointer to data array in vector u. */ @@ -511,11 +511,11 @@ static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t) +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; int mxh = MX/2 - 1, myh = MY/2 - 1, mx1 = MX - 1, my1 = MY - 1; udata = N_VGetArrayPointer(u); @@ -640,13 +640,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* f routine. Compute RHS function f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; - realtype *udata, *dudata; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *udata, *dudata; int jx, jy, idn, iup, ileft, iright; UserData data; @@ -732,14 +732,14 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MY], **(*Jbd)[MY]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MY], **(*Jbd)[MY]; sunindextype *(*pivot)[MY], retval; int jx, jy; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; /* Make local copies of pointers in user_data, and of pointer to u's data */ @@ -819,15 +819,15 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MY]; + sunrealtype **(*P)[MY]; sunindextype *(*pivot)[MY]; int jx, jy; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data. */ @@ -858,7 +858,7 @@ static int PSolve(realtype tn, N_Vector u, N_Vector fu, static int myMonitorFunction(void* cvode_mem, void* user_data) { UserData data = (UserData) user_data; - realtype t = 0; + sunrealtype t = 0; CVodeGetCurrentTime(cvode_mem, &t); PrintOutput(cvode_mem, data->u, t); diff --git a/examples/cvode/serial/cvKrylovDemo_prec.c b/examples/cvode/serial/cvKrylovDemo_prec.c index 451d90d99c..727b6ac780 100644 --- a/examples/cvode/serial/cvKrylovDemo_prec.c +++ b/examples/cvode/serial/cvKrylovDemo_prec.c @@ -106,7 +106,7 @@ #include /* access to SPGMR SUNLinearSolver */ #include /* serial N_Vector types, fct. and macros */ #include /* use generic DENSE solver in preconditioning */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -142,8 +142,8 @@ #define MXNS (MX*NS) #define AX ONE #define AY ONE -#define DX (AX/(realtype)(MX-1)) -#define DY (AY/(realtype)(MY-1)) +#define DX (AX/(sunrealtype)(MX-1)) +#define DY (AY/(sunrealtype)(MY-1)) #define MP NS #define MQ (MX*MY) #define MXMP (MX*MP) @@ -178,15 +178,15 @@ /* Structure for user data */ typedef struct { - realtype **P[NGRP]; + sunrealtype **P[NGRP]; sunindextype *pivot[NGRP]; int ns, mxns; int mp, mq, mx, my, ngrp, ngx, ngy, mxmp; int jgx[NGX+1], jgy[NGY+1], jigx[MX], jigy[MY]; int jxr[NGX], jyr[NGY]; - realtype acoef[NS][NS], bcoef[NS], diff[NS]; - realtype cox[NS], coy[NS], dx, dy, srur; - realtype fsave[NEQ]; + sunrealtype acoef[NS][NS], bcoef[NS], diff[NS]; + sunrealtype cox[NS], coy[NS], dx, dy, srur; + sunrealtype fsave[NEQ]; N_Vector tmp; N_Vector rewt; void *cvode_mem; @@ -200,33 +200,33 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]); static void CInit(N_Vector c, WebData wdata); static void PrintIntro(void); static void PrintHeader(int jpre, int gstype); -static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t); -static void PrintOutput(void *cvode_mem, realtype t); +static void PrintAllSpecies(N_Vector c, int ns, int mxns, sunrealtype t); +static void PrintOutput(void *cvode_mem, sunrealtype t); static void PrintFinalStats(void *cvode_mem); static void FreeUserData(WebData wdata); -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata); -static void fblock (realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata); -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata); +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata); +static void fblock (sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata); +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata); /* Small Vector Kernels */ -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_sum_prods(realtype u[], realtype p[], realtype q[], realtype v[], - realtype w[], int n); -static void v_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_zero(realtype u[], int n); +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], sunrealtype v[], + sunrealtype w[], int n); +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_zero(sunrealtype u[], int n); /* Functions Called By The Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(realtype tn, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data); +static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* Private function to check function return values */ @@ -239,7 +239,7 @@ static SUNContext sunctx = NULL; int main() { - realtype abstol=ATOL, reltol=RTOL, t, tout; + sunrealtype abstol=ATOL, reltol=RTOL, t, tout; N_Vector c; WebData wdata; SUNLinearSolver LS; @@ -371,8 +371,8 @@ static WebData AllocUserData(void) static void InitUserData(WebData wdata) { int i, j, ns; - realtype *bcoef, *diff, *cox, *coy, dx, dy; - realtype (*acoef)[NS]; + sunrealtype *bcoef, *diff, *cox, *coy, dx, dy; + sunrealtype (*acoef)[NS]; acoef = wdata->acoef; bcoef = wdata->bcoef; @@ -452,7 +452,7 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]) static void CInit(N_Vector c, WebData wdata) { int jx, jy, ns, mxns, ioff, iyoff, i, ici; - realtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; + sunrealtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; cdata = N_VGetArrayPointer(c); ns = wdata->ns; @@ -541,10 +541,10 @@ static void PrintHeader(int jpre, int gstype) printf("\nGram-Schmidt method type is gstype = %s\n\n\n", "SUN_CLASSICAL_GS"); } -static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t) +static void PrintAllSpecies(N_Vector c, int ns, int mxns, sunrealtype t) { int i, jx ,jy; - realtype *cdata; + sunrealtype *cdata; cdata = N_VGetArrayPointer(c); #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -572,11 +572,11 @@ static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t) } } -static void PrintOutput(void *cvode_mem, realtype t) +static void PrintOutput(void *cvode_mem, sunrealtype t) { long int nst, nfe, nni; int qu, retval; - realtype hu; + sunrealtype hu; retval = CVodeGetNumSteps(cvode_mem, &nst); check_retval(&retval, "CVodeGetNumSteps", 1); @@ -608,7 +608,7 @@ static void PrintFinalStats(void *cvode_mem) long int nst, nfe, nsetups, nni, ncfn, netf; long int nli, npe, nps, ncfl, nfeLS; int retval; - realtype avdim; + sunrealtype avdim; retval = CVodeGetWorkSpace(cvode_mem, &lenrw, &leniw); check_retval(&retval, "CVodeGetWorkSpace", 1); @@ -655,7 +655,7 @@ static void PrintFinalStats(void *cvode_mem) printf(" Number of error test failures = %4ld \n", netf); printf(" Number of nonlinear conv. failures = %4ld \n", ncfn); printf(" Number of linear convergence failures = %4ld \n", ncfl); - avdim = (nni > 0) ? ((realtype)nli)/((realtype)nni) : ZERO; + avdim = (nni > 0) ? ((sunrealtype)nli)/((sunrealtype)nni) : ZERO; #if defined(SUNDIALS_EXTENDED_PRECISION) printf(" Average Krylov subspace dimension = %.3Lf \n", avdim); #else @@ -686,11 +686,11 @@ static void FreeUserData(WebData wdata) returns it in cdot. The interaction rates are computed by calls to WebRates, and these are saved in fsave for use in preconditioning. */ -static int f(realtype t, N_Vector c, N_Vector cdot,void *user_data) +static int f(sunrealtype t, N_Vector c, N_Vector cdot,void *user_data) { int i, ic, ici, idxl, idxu, jx, ns, mxns, iyoff, jy, idyu, idyl; - realtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; - realtype *cdata, *cdotdata; + sunrealtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; + sunrealtype *cdata, *cdotdata; WebData wdata; wdata = (WebData) user_data; @@ -741,12 +741,12 @@ static int f(realtype t, N_Vector c, N_Vector cdot,void *user_data) c_1, ... ,c_ns (stored in c[0],...,c[ns-1]), at one spatial point and at time t. */ -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata) +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata) { int i, j, ns; - realtype fac, *bcoef; - realtype (*acoef)[NS]; + sunrealtype fac, *bcoef; + sunrealtype (*acoef)[NS]; ns = wdata->ns; acoef = wdata->acoef; @@ -777,16 +777,16 @@ static void WebRates(realtype x, realtype y, realtype t, realtype c[], of a block-diagonal preconditioner. The blocks are of size mp, and there are ngrp=ngx*ngy blocks computed in the block-grouping scheme. */ -static int Precond(realtype t, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype ier; sunindextype **pivot; int i, if0, if00, ig, igx, igy, j, jj, jx, jy; int *jxr, *jyr, ngrp, ngx, ngy, mxmp, mp, retval; - realtype uround, fac, r, r0, save, srur; - realtype *f1, *fsave, *cdata, *rewtdata; + sunrealtype uround, fac, r, r0, save, srur; + sunrealtype *f1, *fsave, *cdata, *rewtdata; WebData wdata; void *cvode_mem; N_Vector rewt; @@ -864,11 +864,11 @@ static int Precond(realtype t, N_Vector c, N_Vector fc, booleantype jok, system, namely block (jx,jy), for use in preconditioning. Here jx and jy count from 0. */ -static void fblock(realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata) +static void fblock(sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata) { int iblok, ic; - realtype x, y; + sunrealtype x, y; iblok = jx + jy*(wdata->mx); y = jy*(wdata->dy); @@ -887,10 +887,10 @@ static void fblock(realtype t, realtype cdata[], int jx, int jy, Then it computes ((I - gamma*Jr)-inverse)*z, using LU factors of the blocks in P, and pivot information in pivot, and returns the result in z. */ -static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data) +static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int jx, jy, igx, igy, iv, ig, *jigx, *jigy, mx, my, ngx, mp; WebData wdata; @@ -937,12 +937,12 @@ static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, Some inner loops of length ns are implemented with the small vector kernels v_sum_prods, v_prod, v_inc_by_prod. */ -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) { int jx, jy, mx, my, x_loc, y_loc; int ns, mxns, i, iyoff, ic, iter; - realtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; - realtype temp, *cox, *coy, *xd, *zd; + sunrealtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; + sunrealtype temp, *cox, *coy, *xd, *zd; xd = N_VGetArrayPointer(x); zd = N_VGetArrayPointer(z); @@ -1108,26 +1108,26 @@ static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) } } -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] += v[i]*w[i]; } -static void v_sum_prods(realtype u[], realtype p[], realtype q[], - realtype v[], realtype w[], int n) +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], + sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = p[i]*q[i] + v[i]*w[i]; } -static void v_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = v[i]*w[i]; } -static void v_zero(realtype u[], int n) +static void v_zero(sunrealtype u[], int n) { int i; for (i=0; i < n; i++) u[i] = ZERO; diff --git a/examples/cvode/serial/cvParticle_dns.c b/examples/cvode/serial/cvParticle_dns.c index 5ae77a5b0e..669da03a7d 100644 --- a/examples/cvode/serial/cvParticle_dns.c +++ b/examples/cvode/serial/cvParticle_dns.c @@ -78,13 +78,13 @@ /* User-defined data structure */ typedef struct UserData_ { - realtype alpha; /* particle velocity */ + sunrealtype alpha; /* particle velocity */ int orbits; /* number of orbits */ - realtype torbit; /* orbit time */ + sunrealtype torbit; /* orbit time */ - realtype rtol; /* integration tolerances */ - realtype atol; + sunrealtype rtol; /* integration tolerances */ + sunrealtype atol; int proj; /* enable/disable solution projection */ int projerr; /* enable/disable error projection */ @@ -95,20 +95,20 @@ typedef struct UserData_ } *UserData; /* Functions provided to CVODE */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Proj(realtype t, N_Vector ycur, N_Vector corr, realtype epsProj, +static int Proj(sunrealtype t, N_Vector ycur, N_Vector corr, sunrealtype epsProj, N_Vector err, void *user_data); /* Utility functions */ static int InitUserData(int *argc, char ***argv, UserData udata); static int PrintUserData(UserData udata); static void InputHelp(); -static int ComputeSolution(realtype t, N_Vector y, UserData udata); -static int ComputeError(realtype t, N_Vector y, N_Vector e, realtype *ec, +static int ComputeSolution(sunrealtype t, N_Vector y, UserData udata); +static int ComputeError(sunrealtype t, N_Vector y, N_Vector e, sunrealtype *ec, UserData udata); -static int WriteOutput(realtype t, N_Vector y, N_Vector e, realtype ec, +static int WriteOutput(sunrealtype t, N_Vector y, N_Vector e, sunrealtype ec, int screenfile, FILE *YFID, FILE *EFID); static int PrintStats(void *cvode_mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -123,16 +123,16 @@ int main(int argc, char* argv[]) int retval; /* reusable return flag */ int out = 0; /* output counter */ int totalout = 0; /* output counter */ - realtype t = ZERO; /* current integration time */ - realtype dtout = ZERO; /* output spacing */ - realtype tout = ZERO; /* next output time */ - realtype ec = ZERO; /* constraint error */ + sunrealtype t = ZERO; /* current integration time */ + sunrealtype dtout = ZERO; /* output spacing */ + sunrealtype tout = ZERO; /* next output time */ + sunrealtype ec = ZERO; /* constraint error */ UserData udata = NULL; /* user data structure */ SUNContext sunctx = NULL; /* SUNDIALS context */ void *cvode_mem = NULL; /* CVODE memory */ N_Vector y = NULL; /* solution vector */ - realtype *ydata = NULL; /* solution vector data */ + sunrealtype *ydata = NULL; /* solution vector data */ N_Vector e = NULL; /* error vector */ SUNMatrix A = NULL; /* Jacobian matrix */ SUNLinearSolver LS = NULL; /* linear solver */ @@ -312,11 +312,11 @@ int main(int argc, char* argv[]) /* Compute the right-hand side function, y' = f(t,y) */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; - realtype *ydata = N_VGetArrayPointer(y); - realtype *fdata = N_VGetArrayPointer(ydot); + sunrealtype *ydata = N_VGetArrayPointer(y); + sunrealtype *fdata = N_VGetArrayPointer(ydot); fdata[0] = -(udata->alpha) * ydata[1]; fdata[1] = (udata->alpha) * ydata[0]; @@ -326,11 +326,11 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* Compute the Jacobian of the right-hand side function, J(t,y) = df/dy */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; - realtype *Jdata = SUNDenseMatrix_Data(J); + sunrealtype *Jdata = SUNDenseMatrix_Data(J); Jdata[0] = ZERO; Jdata[1] = -(udata->alpha); @@ -341,16 +341,16 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } /* Project the solution onto the constraint manifold */ -static int Proj(realtype t, N_Vector ycur, N_Vector corr, realtype epsProj, +static int Proj(sunrealtype t, N_Vector ycur, N_Vector corr, sunrealtype epsProj, N_Vector err, void *user_data) { - realtype *ydata = N_VGetArrayPointer(ycur); - realtype *cdata = N_VGetArrayPointer(corr); - realtype *edata = NULL; - realtype x = ydata[0]; - realtype y = ydata[1]; - realtype xp, yp, r; - realtype errxp, erryp; + sunrealtype *ydata = N_VGetArrayPointer(ycur); + sunrealtype *cdata = N_VGetArrayPointer(corr); + sunrealtype *edata = NULL; + sunrealtype x = ydata[0]; + sunrealtype y = ydata[1]; + sunrealtype xp, yp, r; + sunrealtype errxp, erryp; /* project onto the unit circle */ r = SQRT(x * x + y * y); @@ -502,9 +502,9 @@ static void InputHelp() /* Compute the analytical solution */ -static int ComputeSolution(realtype t, N_Vector y, UserData udata) +static int ComputeSolution(sunrealtype t, N_Vector y, UserData udata) { - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); ydata[0] = COS((udata->alpha) * t); ydata[1] = SIN((udata->alpha) * t); @@ -514,10 +514,10 @@ static int ComputeSolution(realtype t, N_Vector y, UserData udata) /* Compute the error in the solution and constraint */ -static int ComputeError(realtype t, N_Vector y, N_Vector e, realtype *ec, +static int ComputeError(sunrealtype t, N_Vector y, N_Vector e, sunrealtype *ec, UserData udata) { - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); int retval; /* solution error */ @@ -532,11 +532,11 @@ static int ComputeError(realtype t, N_Vector y, N_Vector e, realtype *ec, } /* Output the solution to the screen or disk */ -static int WriteOutput(realtype t, N_Vector y, N_Vector e, realtype ec, +static int WriteOutput(sunrealtype t, N_Vector y, N_Vector e, sunrealtype ec, int screenfile, FILE* YFID, FILE* EFID) { - realtype *ydata = N_VGetArrayPointer(y); - realtype *edata = N_VGetArrayPointer(e); + sunrealtype *ydata = N_VGetArrayPointer(y); + sunrealtype *edata = N_VGetArrayPointer(e); if (screenfile == 0) { diff --git a/examples/cvode/serial/cvPendulum_dns.c b/examples/cvode/serial/cvPendulum_dns.c index a090ef2c07..0d420f7976 100644 --- a/examples/cvode/serial/cvPendulum_dns.c +++ b/examples/cvode/serial/cvPendulum_dns.c @@ -101,22 +101,22 @@ #define GRAV RCONST(13.750371636040745654980191559621114395801712) /* Functions provided to CVODE */ -static int fref(realtype t, N_Vector yy, N_Vector fy, void *f_data); +static int fref(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data); -static int f(realtype t, N_Vector yy, N_Vector fy, void *f_data); -static int proj(realtype t, N_Vector yy, N_Vector corr, - realtype epsProj, N_Vector err, void *pdata); +static int f(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data); +static int proj(sunrealtype t, N_Vector yy, N_Vector corr, + sunrealtype epsProj, N_Vector err, void *pdata); /* Functions to integrate the Cartesian and reference solutions */ -int GetSol(void *cvode_mem, N_Vector yy0, realtype rtol, realtype atol, - realtype tf, int nout, booleantype proj, booleantype projerr, +int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, + sunrealtype tf, int nout, booleantype proj, booleantype projerr, N_Vector yref); -int RefSol(realtype tf, N_Vector yref, int nout); +int RefSol(sunrealtype tf, N_Vector yref, int nout); /* Utility functions */ -static int ReadInputs(int *argc, char ***argv, realtype *rtol, realtype *atol, - realtype *tf, int *nout, booleantype *projerr); +static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, + sunrealtype *tf, int *nout, booleantype *projerr); static void InputHelp(); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -132,14 +132,14 @@ int main(int argc, char* argv[]) int i; int retval; /* reusable return flag */ int nout = 1; /* number of outputs */ - realtype rtol = RCONST(1.0e-5); /* base relative tolerance */ - realtype atol = RCONST(1.0e-5); /* base absolute tolerance */ - realtype tf = RCONST(30.0); /* final integration time */ + sunrealtype rtol = RCONST(1.0e-5); /* base relative tolerance */ + sunrealtype atol = RCONST(1.0e-5); /* base absolute tolerance */ + sunrealtype tf = RCONST(30.0); /* final integration time */ booleantype projerr = SUNTRUE; /* enable error projection */ void *cvode_mem = NULL; /* CVODE memory */ N_Vector yy0 = NULL; /* initial condition vector */ - realtype *yy0data = NULL; /* vector data */ + sunrealtype *yy0data = NULL; /* vector data */ N_Vector yref = NULL; /* reference solution vector */ SUNMatrix A = NULL; /* Jacobian matrix */ SUNLinearSolver LS = NULL; /* linear solver */ @@ -238,23 +238,23 @@ int main(int argc, char* argv[]) /* Compute the Cartesian system solution */ -int GetSol(void *cvode_mem, N_Vector yy0, realtype rtol, realtype atol, - realtype tf, int nout, booleantype proj, booleantype projerr, +int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, + sunrealtype tf, int nout, booleantype proj, booleantype projerr, N_Vector yref) { char outname[100]; /* output file name */ FILE *FID = NULL; /* output file */ N_Vector yy = NULL; /* solution vector */ - realtype *yydata = NULL; /* vector data */ + sunrealtype *yydata = NULL; /* vector data */ int retval; /* reusable return flag */ int out; /* output counter */ - realtype dtout; /* output frequency */ - realtype tout; /* output time */ - realtype t; /* return time */ - realtype x, y; /* position values */ - realtype xd, yd; /* velocity values */ - realtype g; /* constraint value */ + sunrealtype dtout; /* output frequency */ + sunrealtype tout; /* output time */ + sunrealtype t; /* return time */ + sunrealtype x, y; /* position values */ + sunrealtype xd, yd; /* velocity values */ + sunrealtype g; /* constraint value */ /* Integrator stats */ long int nst, nfe, nsetups, nje, nfeLS, ncfn, netf; @@ -417,22 +417,22 @@ int GetSol(void *cvode_mem, N_Vector yy0, realtype rtol, realtype atol, /* Compute the reference system solution */ -int RefSol(realtype tf, N_Vector yref, int nout) +int RefSol(sunrealtype tf, N_Vector yref, int nout) { FILE *FID = NULL; /* output file */ void *cvode_mem = NULL; /* CVODE memory */ N_Vector yy = NULL; /* solution vector */ - realtype *yydata = NULL; /* vector data */ + sunrealtype *yydata = NULL; /* vector data */ SUNMatrix A = NULL; /* Jacobian matrix */ SUNLinearSolver LS = NULL; /* linear solver */ int retval; /* reusable return flag */ int out; /* output counter */ - realtype dtout; /* output frequency */ - realtype tout; /* output time */ - realtype t; /* return time */ - realtype th, thd; /* theta and theta dot */ - realtype tol = RCONST(1.0e-14); /* integration tolerance */ + sunrealtype dtout; /* output frequency */ + sunrealtype tout; /* output time */ + sunrealtype t; /* return time */ + sunrealtype th, thd; /* theta and theta dot */ + sunrealtype tol = RCONST(1.0e-14); /* integration tolerance */ /* Create the solution vector */ yy = N_VNew_Serial(2, sunctx); @@ -564,10 +564,10 @@ int RefSol(realtype tf, N_Vector yref, int nout) /* ODE RHS function for the reference system */ -static int fref(realtype t, N_Vector yy, N_Vector fy, void *f_data) +static int fref(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data) { - realtype *yydata = NULL; /* yy vector data */ - realtype *fydata = NULL; /* fy vector data */ + sunrealtype *yydata = NULL; /* yy vector data */ + sunrealtype *fydata = NULL; /* fy vector data */ /* Get vector array pointers */ yydata = N_VGetArrayPointer(yy); @@ -580,14 +580,14 @@ static int fref(realtype t, N_Vector yy, N_Vector fy, void *f_data) /* ODE RHS function for the Cartesian system */ -static int f(realtype t, N_Vector yy, N_Vector fy, void *f_data) +static int f(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data) { - realtype *yydata = NULL; /* yy vector data */ - realtype *fydata = NULL; /* fy vector data */ + sunrealtype *yydata = NULL; /* yy vector data */ + sunrealtype *fydata = NULL; /* fy vector data */ - realtype x, y; /* positions */ - realtype xd, yd; /* velocities */ - realtype tmp; + sunrealtype x, y; /* positions */ + sunrealtype xd, yd; /* velocities */ + sunrealtype tmp; /* Get vector array pointers */ yydata = N_VGetArrayPointer(yy); @@ -613,19 +613,19 @@ static int f(realtype t, N_Vector yy, N_Vector fy, void *f_data) /* Projection function */ -static int proj(realtype t, N_Vector yy, N_Vector corr, - realtype epsProj, N_Vector err, void *pdata) +static int proj(sunrealtype t, N_Vector yy, N_Vector corr, + sunrealtype epsProj, N_Vector err, void *pdata) { - realtype *yydata = NULL; /* yy vector data */ - realtype *cdata = NULL; /* corr vector data */ - realtype *edata = NULL; /* err vector data */ + sunrealtype *yydata = NULL; /* yy vector data */ + sunrealtype *cdata = NULL; /* corr vector data */ + sunrealtype *edata = NULL; /* err vector data */ - realtype x, y, x_new, y_new; /* positions */ - realtype xd, yd, xd_new, yd_new; /* velocities */ + sunrealtype x, y, x_new, y_new; /* positions */ + sunrealtype xd, yd, xd_new, yd_new; /* velocities */ - realtype e1, e2, e3, e4; - realtype e1_new, e2_new, e3_new, e4_new; - realtype R; + sunrealtype e1, e2, e3, e4; + sunrealtype e1_new, e2_new, e3_new, e4_new; + sunrealtype R; /* Get vector array pointers */ @@ -697,8 +697,8 @@ static int proj(realtype t, N_Vector yy, N_Vector corr, /* Read command line unputs */ -static int ReadInputs(int *argc, char ***argv, realtype *rtol, realtype *atol, - realtype *tf, int *nout, booleantype *projerr) +static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, + sunrealtype *tf, int *nout, booleantype *projerr) { int arg_idx = 1; diff --git a/examples/cvode/serial/cvRoberts_block_klu.c b/examples/cvode/serial/cvRoberts_block_klu.c index 44923dad41..0a53a12498 100644 --- a/examples/cvode/serial/cvRoberts_block_klu.c +++ b/examples/cvode/serial/cvRoberts_block_klu.c @@ -43,7 +43,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU sparse direct solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* User-defined vector and matrix accessor macro: Ith */ @@ -77,14 +77,14 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); /* Private function to print final statistics */ @@ -109,7 +109,7 @@ typedef struct { int main(int argc, char *argv[]) { SUNContext sunctx; - realtype reltol, t, tout; + sunrealtype reltol, t, tout; N_Vector y, abstol; SUNMatrix A; SUNLinearSolver LS; @@ -250,11 +250,11 @@ int main(int argc, char *argv[]) * Functions called by the solver *------------------------------- */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData *udata; sunindextype groupj; - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; udata = (UserData*) user_data; @@ -273,15 +273,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData *udata = (UserData*) user_data; sunindextype *rowptrs = SUNSparseMatrix_IndexPointers(J); sunindextype *colvals = SUNSparseMatrix_IndexValues(J); - realtype *data = SUNSparseMatrix_Data(J); - realtype *ydata; - realtype y2, y3; + sunrealtype *data = SUNSparseMatrix_Data(J); + sunrealtype *ydata; + sunrealtype y2, y3; sunindextype groupj, nnzper; ydata = N_VGetArrayPointer(y); @@ -335,7 +335,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/serial/cvRoberts_dns.c b/examples/cvode/serial/cvRoberts_dns.c index 41d792bb3d..36f8b2796b 100644 --- a/examples/cvode/serial/cvRoberts_dns.c +++ b/examples/cvode/serial/cvRoberts_dns.c @@ -87,16 +87,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to check function return values */ @@ -105,7 +105,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol); /* @@ -117,7 +117,7 @@ static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -250,9 +250,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -267,9 +267,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -282,10 +282,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -310,7 +310,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); @@ -369,13 +369,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* compare the solution at the final time 4e10s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ - realtype ONE=RCONST(1.0); + sunrealtype err; /* wrms error */ + sunrealtype ONE=RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/cvode/serial/cvRoberts_dnsL.c b/examples/cvode/serial/cvRoberts_dnsL.c index fb59111012..33d7424810 100644 --- a/examples/cvode/serial/cvRoberts_dnsL.c +++ b/examples/cvode/serial/cvRoberts_dnsL.c @@ -76,16 +76,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -106,7 +106,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -228,9 +228,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -245,9 +245,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -260,10 +260,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -288,7 +288,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/serial/cvRoberts_dns_constraints.c b/examples/cvode/serial/cvRoberts_dns_constraints.c index d70e103fda..cfcf6e053b 100644 --- a/examples/cvode/serial/cvRoberts_dns_constraints.c +++ b/examples/cvode/serial/cvRoberts_dns_constraints.c @@ -90,16 +90,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -112,7 +112,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol); /* @@ -124,7 +124,7 @@ static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; N_Vector constraints; @@ -262,9 +262,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -279,9 +279,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -294,10 +294,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -322,7 +322,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); @@ -420,12 +420,12 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* compare the solution at the final time 4e10s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ + sunrealtype err; /* wrms error */ /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/cvode/serial/cvRoberts_dns_negsol.c b/examples/cvode/serial/cvRoberts_dns_negsol.c index 350fbc84b1..ed825f187e 100644 --- a/examples/cvode/serial/cvRoberts_dns_negsol.c +++ b/examples/cvode/serial/cvRoberts_dns_negsol.c @@ -36,7 +36,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* Problem Constants */ @@ -57,11 +57,11 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); /* Private function to print final statistics */ @@ -81,7 +81,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -206,9 +206,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; booleantype *check_negative; check_negative = (booleantype *)user_data; @@ -231,7 +231,7 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/serial/cvRoberts_dns_uw.c b/examples/cvode/serial/cvRoberts_dns_uw.c index 330354497e..cf13d43e3a 100644 --- a/examples/cvode/serial/cvRoberts_dns_uw.c +++ b/examples/cvode/serial/cvRoberts_dns_uw.c @@ -89,18 +89,18 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); static int ewt(N_Vector y, N_Vector w, void *user_data); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -121,7 +121,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; SUNMatrix A; SUNLinearSolver LS; @@ -231,9 +231,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -248,9 +248,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -263,10 +263,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -292,7 +292,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -315,7 +315,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/serial/cvRoberts_klu.c b/examples/cvode/serial/cvRoberts_klu.c index 55ee6f1ffb..86135f5edd 100644 --- a/examples/cvode/serial/cvRoberts_klu.c +++ b/examples/cvode/serial/cvRoberts_klu.c @@ -73,16 +73,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -103,7 +103,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -225,9 +225,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -242,9 +242,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -257,18 +257,18 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* State at which to evaluate the Jacobian */ - realtype *yval = N_VGetArrayPointer(y); + sunrealtype *yval = N_VGetArrayPointer(y); /* J is stored in CSC format: data = non-zero matrix entries stored column-wise (length NNZ) rowvals = row index for each non-zero matrix entry (length NNZ) colptrs = i-th entry is the index in data where the first non-zero matrix entry of the i-th column is stored (length NEQ + 1) */ - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); @@ -314,7 +314,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/serial/cvRoberts_sps.c b/examples/cvode/serial/cvRoberts_sps.c index 466011df9e..25bac1fe66 100644 --- a/examples/cvode/serial/cvRoberts_sps.c +++ b/examples/cvode/serial/cvRoberts_sps.c @@ -73,16 +73,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -103,7 +103,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -225,9 +225,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -242,9 +242,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -257,18 +257,18 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* State at which to evaluate the Jacobian */ - realtype *yval = N_VGetArrayPointer(y); + sunrealtype *yval = N_VGetArrayPointer(y); /* J is stored in CSC format: data = non-zero matrix entries stored column-wise (length NNZ) rowvals = row index for each non-zero matrix entry (length NNZ) colptrs = i-th entry is the index in data where the first non-zero matrix entry of the i-th column is stored (length NEQ + 1) */ - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); @@ -314,7 +314,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvode/superludist/cvAdvDiff_sludist.cpp b/examples/cvode/superludist/cvAdvDiff_sludist.cpp index 08700e17f4..a743b0f918 100644 --- a/examples/cvode/superludist/cvAdvDiff_sludist.cpp +++ b/examples/cvode/superludist/cvAdvDiff_sludist.cpp @@ -50,7 +50,7 @@ #include /* access to MPI-parallel N_Vector */ #include /* access to the SuperLU-DIST SUNLinearSolver */ #include /* access to the SuperLU SLU_NR_loc SUNMatrix */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* MPI constants and types */ @@ -75,27 +75,27 @@ contains grid constants, parallel machine parameters, work array. */ typedef struct { - realtype dx, hdcoef, hacoef; + sunrealtype dx, hdcoef, hacoef; int npes, my_pe; MPI_Comm comm; - realtype z[100]; + sunrealtype z[100]; } *UserData; /* Private Helper Functions */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void PrintIntro(int npes); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) { MPI_Comm comm; SUNContext sunctx; - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; UserData data; void *cvode_mem; int iout, retval, my_pe, npes, nprow, npcol; @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) superlu_dist_options_t options; SuperMatrix Asuper; sunindextype *rowptr, *colind; - realtype *matdata; + sunrealtype *matdata; N_Vector u; SUNMatrix A; @@ -183,7 +183,7 @@ int main(int argc, char *argv[]) reltol = ZERO; /* Set the tolerances */ abstol = ATOL; - dx = data->dx = XMAX/((realtype)(MX+1)); /* Set grid coefficients in data */ + dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ data->hdcoef = ONE/(dx*dx); data->hacoef = HALF/(TWO*dx); @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) local_NNZ = 3*local_N; /* Create the SuperLU-DIST SuperMatrix which will be wrapped as A */ - matdata = (realtype *) malloc(local_NNZ*sizeof(realtype)); + matdata = (sunrealtype *) malloc(local_NNZ*sizeof(sunrealtype)); colind = (sunindextype *) calloc(local_NNZ, sizeof(sunindextype)); rowptr = (sunindextype *) calloc((local_N+1), sizeof(sunindextype)); dCreate_CompRowLoc_Matrix_dist(&Asuper, NEQ, NEQ, local_NNZ, local_N, my_base, matdata, colind, rowptr, @@ -291,13 +291,13 @@ int main(int argc, char *argv[]) /* Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i; sunindextype iglobal; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetArrayPointer(u); @@ -323,7 +323,7 @@ static void PrintIntro(int npes) /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -364,10 +364,10 @@ static void PrintFinalStats(void *cvode_mem) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype *udata, *dudata, *z; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype *udata, *dudata, *z; int i; int npes, my_pe, my_length, my_pe_m1, my_pe_p1, last_pe; UserData data; @@ -432,12 +432,12 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian routine. Compute J(t,u). */ -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunindextype i, j; - realtype *nzval, hordc, horac; + sunrealtype *nzval, hordc, horac; UserData data; SuperMatrix *Jsuper; NRformat_loc *Jstore; @@ -456,7 +456,7 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, Jsuper = SUNMatrix_SLUNRloc_SuperMatrix(J); Jstore = (NRformat_loc *) Jsuper->Store; - nzval = (realtype *) Jstore->nzval; + nzval = (sunrealtype *) Jstore->nzval; sunindextype *colind = Jstore->colind; sunindextype *rowptr = Jstore->rowptr; diff --git a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c index 942efc38f6..3407267c70 100644 --- a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c +++ b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c @@ -58,7 +58,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #ifdef _OPENMP #include @@ -99,15 +99,15 @@ /* Type : UserData (contains grid constants) */ typedef struct { - realtype dx, dy, hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, hdcoef, hacoef, vdcoef; int nthreads; } *UserData; /* Private Helper Functions */ static void SetIC(N_Vector u, UserData data); -static void PrintHeader(realtype reltol, realtype abstol, realtype umax); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -116,8 +116,8 @@ static int check_retval(void *returnvalue, char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* @@ -129,7 +129,7 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, int main(int argc, char *argv[]) { SUNContext sunctx; - realtype dx, dy, reltol, abstol, t, tout, umax; + sunrealtype dx, dy, reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNMatrix A; @@ -247,10 +247,10 @@ int main(int argc, char *argv[]) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u,N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; - realtype *udata, *dudata; + sunrealtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; + sunrealtype *udata, *dudata; sunindextype i, j; UserData data; @@ -294,11 +294,11 @@ static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) /* Jacobian routine. Compute J(t,u). */ -static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunindextype i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* @@ -348,8 +348,8 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, static void SetIC(N_Vector u, UserData data) { sunindextype i, j; - realtype x, y, dx, dy; - realtype *udata; + sunrealtype x, y, dx, dy; + sunrealtype *udata; i = j = 0; @@ -375,7 +375,7 @@ static void SetIC(N_Vector u, UserData data) /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -398,7 +398,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax) /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c index 70cd075671..f5621c5d56 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c @@ -81,29 +81,29 @@ /* Type : UserData */ typedef struct { - realtype p[2]; /* model parameters */ - realtype dx; /* spatial discretization grid */ - realtype hdcoef, hacoef; /* diffusion and advection coefficients */ + sunrealtype p[2]; /* model parameters */ + sunrealtype dx; /* spatial discretization grid */ + sunrealtype hdcoef, hacoef; /* diffusion and advection coefficients */ sunindextype local_N; int npes, my_pe; /* total number of processes and current ID */ sunindextype nperpe, nrem; MPI_Comm comm; /* MPI communicator */ - realtype *z1, *z2; /* work space */ + sunrealtype *z1, *z2; /* work space */ } *UserData; /* Prototypes of user-supplied funcitons */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int fB(realtype t, N_Vector u, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int fB(sunrealtype t, N_Vector u, N_Vector uB, N_Vector uBdot, void *user_dataB); /* Prototypes of private functions */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, sunindextype my_base); +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void SetICback(N_Vector uB, sunindextype my_base); -static realtype Xintgr(realtype *z, sunindextype l, realtype dx); -static realtype Compute_g(N_Vector u, UserData data); -static void PrintOutput(realtype g_val, N_Vector uB, UserData data); +static sunrealtype Xintgr(sunrealtype *z, sunindextype l, sunrealtype dx); +static sunrealtype Compute_g(N_Vector u, UserData data); +static void PrintOutput(sunrealtype g_val, N_Vector uB, UserData data); static int check_retval(void *returnvalue, const char *funcname, int opt, int id); /* @@ -119,12 +119,12 @@ int main(int argc, char *argv[]) void *cvode_mem; N_Vector u; - realtype reltol, abstol; + sunrealtype reltol, abstol; int indexB; N_Vector uB; - realtype dx, t, g_val; + sunrealtype dx, t, g_val; int retval, my_pe, nprocs, npes, ncheck; sunindextype local_N=0, nperpe, nrem, my_base=-1; @@ -183,7 +183,7 @@ int main(int argc, char *argv[]) if (check_retval((void *)data , "malloc", 2, my_pe)) MPI_Abort(comm, 1); data->p[0] = ONE; data->p[1] = RCONST(0.5); - dx = data->dx = XMAX/((realtype)(MX+1)); + dx = data->dx = XMAX/((sunrealtype)(MX+1)); data->hdcoef = data->p[0]/(dx*dx); data->hacoef = data->p[1]/(TWO*dx); data->comm = comm; @@ -258,9 +258,9 @@ int main(int argc, char *argv[]) } else { /* Allocate work space */ - data->z1 = (realtype *)malloc(local_N*sizeof(realtype)); + data->z1 = (sunrealtype *)malloc(local_N*sizeof(sunrealtype)); if (check_retval((void *)data->z1, "malloc", 2, my_pe)) MPI_Abort(comm, 1); - data->z2 = (realtype *)malloc(local_N*sizeof(realtype)); + data->z2 = (sunrealtype *)malloc(local_N*sizeof(sunrealtype)); if (check_retval((void *)data->z2, "malloc", 2, my_pe)) MPI_Abort(comm, 1); } @@ -332,11 +332,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,u) for forward phase. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype uLeft, uRight, ui, ult, urt; - realtype hordc, horac, hdiff, hadv; - realtype *udata, *dudata; + sunrealtype uLeft, uRight, ui, ult, urt; + sunrealtype hordc, horac, hdiff, hadv; + sunrealtype *udata, *dudata; sunindextype i, my_length; int npes, my_pe, my_pe_m1, my_pe_p1, last_pe; UserData data; @@ -402,18 +402,18 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) * fB routine. Compute right hand side of backward problem */ -static int fB(realtype t, N_Vector u, +static int fB(sunrealtype t, N_Vector u, N_Vector uB, N_Vector uBdot, void *user_dataB) { - realtype *uBdata, *duBdata, *udata; - realtype uBLeft, uBRight, uBi, uBlt, uBrt; - realtype uLeft, uRight, ui, ult, urt; - realtype dx, hordc, horac, hdiff, hadv; - realtype *z1, *z2, intgr1, intgr2; + sunrealtype *uBdata, *duBdata, *udata; + sunrealtype uBLeft, uBRight, uBi, uBlt, uBrt; + sunrealtype uLeft, uRight, ui, ult, urt; + sunrealtype dx, hordc, horac, hdiff, hadv; + sunrealtype *z1, *z2, intgr1, intgr2; sunindextype i, my_length; int j, npes, my_pe, my_pe_m1, my_pe_p1, last_pe; UserData data; - realtype data_in[2], data_out[2]; + sunrealtype data_in[2], data_out[2]; MPI_Status status; MPI_Comm comm; @@ -540,12 +540,12 @@ static int fB(realtype t, N_Vector u, * Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, sunindextype my_base) +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i; sunindextype iglobal; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u */ udata = N_VGetArrayPointer_Parallel(u); @@ -566,7 +566,7 @@ static void SetIC(N_Vector u, realtype dx, sunindextype my_length, sunindextype static void SetICback(N_Vector uB, sunindextype my_base) { int i; - realtype *uBdata; + sunrealtype *uBdata; sunindextype my_length; /* Set pointer to data array and get local length of uB */ @@ -582,9 +582,9 @@ static void SetICback(N_Vector uB, sunindextype my_base) * Compute local value of the space integral int_x z(x) dx */ -static realtype Xintgr(realtype *z, sunindextype l, realtype dx) +static sunrealtype Xintgr(sunrealtype *z, sunindextype l, sunrealtype dx) { - realtype my_intgr; + sunrealtype my_intgr; sunindextype i; my_intgr = RCONST(0.5)*(z[0] + z[l-1]); @@ -599,9 +599,9 @@ static realtype Xintgr(realtype *z, sunindextype l, realtype dx) * Compute value of g(u) */ -static realtype Compute_g(N_Vector u, UserData data) +static sunrealtype Compute_g(N_Vector u, UserData data) { - realtype intgr, my_intgr, dx, *udata; + sunrealtype intgr, my_intgr, dx, *udata; sunindextype my_length; int npes, my_pe, i; MPI_Status status; @@ -634,14 +634,14 @@ static realtype Compute_g(N_Vector u, UserData data) * Print output after backward integration */ -static void PrintOutput(realtype g_val, N_Vector uB, UserData data) +static void PrintOutput(sunrealtype g_val, N_Vector uB, UserData data) { MPI_Comm comm; MPI_Status status; int j, npes, my_pe; sunindextype i, Ni, indx, local_N, nperpe, nrem; - realtype *uBdata; - realtype *mu; + sunrealtype *uBdata; + sunrealtype *mu; comm = data->comm; npes = data->npes; @@ -665,7 +665,7 @@ static void PrintOutput(realtype g_val, N_Vector uB, UserData data) printf("dgdp(tf)\n [ 1]: %8e\n [ 2]: %8e\n\n", -uBdata[0], -uBdata[1]); #endif - mu = (realtype *)malloc(NEQ*sizeof(realtype)); + mu = (sunrealtype *)malloc(NEQ*sizeof(sunrealtype)); if (check_retval((void *)mu, "malloc", 2, my_pe)) MPI_Abort(comm, 1); indx = 0; diff --git a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c index f7b6aec3ee..ff229e148d 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c @@ -86,25 +86,25 @@ contains problem parameters, grid constants, work array. */ typedef struct { - realtype *p; - realtype dx; + sunrealtype *p; + sunrealtype dx; int npes, my_pe; MPI_Comm comm; - realtype z[100]; + sunrealtype z[100]; } *UserData; /* Prototypes of user-supplied functins */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], int my_pe, booleantype *sensi, int *sensi_meth, booleantype *err_con); static void WrongArgs(int my_pe, char *name); -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, sunindextype my_base); -static void PrintOutput(void *cvode_mem, int my_pe, realtype t, N_Vector u); +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); +static void PrintOutput(void *cvode_mem, int my_pe, sunrealtype t, N_Vector u); static void PrintOutputS(int my_pe, N_Vector *uS); static void PrintFinalStats(void *cvode_mem, booleantype sensi, booleantype err_con, int sensi_meth); @@ -118,14 +118,14 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { - realtype dx, reltol, abstol, t, tout; + sunrealtype dx, reltol, abstol, t, tout; N_Vector u; UserData data; void *cvode_mem; int iout, retval, my_pe, npes; sunindextype local_N, nperpe, nrem, my_base; - realtype *pbar; + sunrealtype *pbar; int is, *plist; N_Vector *uS; booleantype sensi, err_con; @@ -171,9 +171,9 @@ int main(int argc, char *argv[]) data->comm = comm; data->npes = npes; data->my_pe = my_pe; - data->p = (realtype *) malloc(NP * sizeof(realtype)); + data->p = (sunrealtype *) malloc(NP * sizeof(sunrealtype)); if(check_retval((void *)data->p, "malloc", 2, my_pe)) MPI_Abort(comm, 1); - dx = data->dx = XMAX/((realtype)(MX+1)); + dx = data->dx = XMAX/((sunrealtype)(MX+1)); data->p[0] = RCONST(1.0); data->p[1] = RCONST(0.5); @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) for(is=0; isp[plist[is]]; @@ -335,11 +335,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype *udata, *dudata, *z; - realtype dx; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype *udata, *dudata, *z; + sunrealtype dx; int npes, my_pe, my_pe_m1, my_pe_p1, last_pe; sunindextype i, my_length; UserData data; @@ -468,13 +468,13 @@ static void WrongArgs(int my_pe, char *name) * Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i; sunindextype iglobal; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetArrayPointer_Parallel(u); @@ -492,11 +492,11 @@ static void SetIC(N_Vector u, realtype dx, sunindextype my_length, * Print current t, step count, order, stepsize, and max norm of solution */ -static void PrintOutput(void *cvode_mem, int my_pe, realtype t, N_Vector u) +static void PrintOutput(void *cvode_mem, int my_pe, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, umax; + sunrealtype hu, umax; retval = CVodeGetNumSteps(cvode_mem, &nst); check_retval(&retval, "CVodeGetNumSteps", 1, my_pe); @@ -537,7 +537,7 @@ static void PrintOutput(void *cvode_mem, int my_pe, realtype t, N_Vector u) static void PrintOutputS(int my_pe, N_Vector *uS) { - realtype smax; + sunrealtype smax; smax = N_VMaxNorm(uS[0]); if (my_pe == 0) { diff --git a/examples/cvodes/parallel/cvsAdvDiff_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_non_p.c index d78e982188..cbfeddf4f2 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_non_p.c @@ -43,7 +43,7 @@ #include /* prototypes for CVODE fcts. */ #include /* definition of N_Vector and macros */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ #include "sunnonlinsol/sunnonlinsol_fixedpoint.h" /* access to the fixed point SUNNonlinearSolver */ #include /* MPI constants and types */ @@ -64,26 +64,26 @@ contains grid constants, parallel machine parameters, work array. */ typedef struct { - realtype dx, hdcoef, hacoef; + sunrealtype dx, hdcoef, hacoef; int npes, my_pe; MPI_Comm comm; - realtype z[100]; + sunrealtype z[100]; } *UserData; /* Private Helper Functions */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void PrintIntro(int npes); -static void PrintData(realtype t, realtype umax, long int nst); +static void PrintData(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -93,7 +93,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { - realtype dx, reltol, abstol, t, tout, umax; + sunrealtype dx, reltol, abstol, t, tout, umax; N_Vector u; UserData data; void *cvode_mem; @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) reltol = ZERO; /* Set the tolerances */ abstol = ATOL; - dx = data->dx = XMAX/((realtype)(MX+1)); /* Set grid coefficients in data */ + dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ data->hdcoef = RCONST(1.0)/(dx*dx); data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); @@ -210,13 +210,13 @@ int main(int argc, char *argv[]) /* Set initial conditions in u vector */ -static void SetIC(N_Vector u, realtype dx, sunindextype my_length, +static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base) { int i; sunindextype iglobal; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetArrayPointer(u); @@ -242,7 +242,7 @@ static void PrintIntro(int npes) /* Print data */ -static void PrintData(realtype t, realtype umax, long int nst) +static void PrintData(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -283,10 +283,10 @@ static void PrintFinalStats(void *cvode_mem) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype *udata, *dudata, *z; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype *udata, *dudata, *z; int npes, my_pe, my_pe_m1, my_pe_p1, last_pe; sunindextype i, my_length; UserData data; diff --git a/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c b/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c index 6efcb730d4..5813d784d3 100644 --- a/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c +++ b/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c @@ -143,11 +143,11 @@ typedef struct { /* Domain */ - realtype xmin[DIM]; /* "left" boundaries */ - realtype xmax[DIM]; /* "right" boundaries */ + sunrealtype xmin[DIM]; /* "left" boundaries */ + sunrealtype xmax[DIM]; /* "right" boundaries */ int m[DIM]; /* number of grid points */ - realtype dx[DIM]; /* grid spacing */ - realtype dOmega; /* differential volume */ + sunrealtype dx[DIM]; /* grid spacing */ + sunrealtype dOmega; /* differential volume */ /* Parallel stuff */ MPI_Comm comm; /* MPI communicator */ @@ -158,9 +158,9 @@ typedef struct { int nbr_right[DIM]; /* MPI ID of "right" neighbor */ int m_start[DIM]; /* "left" index in the global domain */ int l_m[DIM]; /* number of local grid points */ - realtype *y_ext; /* extended data array */ - realtype *buf_send; /* Send buffer */ - realtype *buf_recv; /* Receive buffer */ + sunrealtype *y_ext; /* extended data array */ + sunrealtype *buf_send; /* Send buffer */ + sunrealtype *buf_recv; /* Receive buffer */ int buf_size; /* Buffer size */ /* Source */ @@ -174,20 +174,20 @@ typedef struct { *------------------------------------------------------------------ */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f_local(sunindextype Nlocal, realtype t, N_Vector y, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f_local(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data); +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data); -static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int fB_local(sunindextype NlocalB, realtype t, +static int fB_local(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB); /* @@ -199,8 +199,8 @@ static int fQB(realtype t, N_Vector y, N_Vector yB, static void SetData(ProblemData d, MPI_Comm comm, int npes, int myId, sunindextype *neq, sunindextype *l_neq); static void SetSource(ProblemData d); -static void f_comm(sunindextype Nlocal, realtype t, N_Vector y, void *user_data); -static void Load_yext(realtype *src, ProblemData d); +static void f_comm(sunindextype Nlocal, sunrealtype t, N_Vector y, void *user_data); +static void Load_yext(sunrealtype *src, ProblemData d); static void PrintHeader(); static int PrintFinalStats(void *cvode_mem); static void OutputGradient(int myId, N_Vector qB, ProblemData d); @@ -227,15 +227,15 @@ int main(int argc, char *argv[]) void *cvode_mem; SUNLinearSolver LS; N_Vector y, q; - realtype abstol, reltol, abstolQ, reltolQ; + sunrealtype abstol, reltol, abstolQ, reltolQ; sunindextype mudq, mldq, mukeep, mlkeep; int indexB; N_Vector yB, qB; - realtype abstolB, reltolB, abstolQB, reltolQB; + sunrealtype abstolB, reltolB, abstolQB, reltolQB; sunindextype mudqB, mldqB, mukeepB, mlkeepB; - realtype tret, *qdata, G; + sunrealtype tret, *qdata, G; int ncheckpnt, retval; @@ -561,7 +561,7 @@ static void SetData(ProblemData d, MPI_Comm comm, int npes, int myId, size = 1; FOR_DIM size *= d->l_m[dim]+2; - d->y_ext = (realtype *) malloc( size*sizeof(realtype)); + d->y_ext = (sunrealtype *) malloc( size*sizeof(sunrealtype)); /* Initialize Buffer field. Size of buffer is checked when needed */ @@ -585,8 +585,8 @@ static void SetData(ProblemData d, MPI_Comm comm, int npes, int myId, static void SetSource(ProblemData d) { int *l_m, *m_start; - realtype *xmin, *dx; - realtype x[DIM], g, *pdata; + sunrealtype *xmin, *dx; + sunrealtype x[DIM], g, *pdata; int i[DIM]; l_m = d->l_m; @@ -644,14 +644,14 @@ static void SetSource(ProblemData d) *------------------------------------------------------------------ */ -static void f_comm(sunindextype N_local, realtype t, N_Vector y, void *user_data) +static void f_comm(sunindextype N_local, sunrealtype t, N_Vector y, void *user_data) { int id, n[DIM], proc_cond[DIM], nbr[DIM][2]; ProblemData d; - realtype *yextdata, *ydata; + sunrealtype *yextdata, *ydata; int l_m[DIM], dim; int c, i[DIM], l[DIM-1]; - realtype *buf_send, *buf_recv; + sunrealtype *buf_send, *buf_recv; MPI_Status stat; MPI_Comm comm; int dir, size = 1, small = INT_MAX; @@ -677,8 +677,8 @@ static void f_comm(sunindextype N_local, realtype t, N_Vector y, void *user_data /* Adjust buffer size if necessary */ if( d->buf_size < size ) { - d->buf_send = (realtype*) realloc( d->buf_send, size * sizeof(realtype)); - d->buf_recv = (realtype*) realloc( d->buf_recv, size * sizeof(realtype)); + d->buf_send = (sunrealtype*) realloc( d->buf_send, size * sizeof(sunrealtype)); + d->buf_recv = (sunrealtype*) realloc( d->buf_recv, size * sizeof(sunrealtype)); d->buf_size = size; } @@ -754,7 +754,7 @@ static void f_comm(sunindextype N_local, realtype t, N_Vector y, void *user_data *------------------------------------------------------------------ */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { ProblemData d; sunindextype l_neq=1; @@ -772,13 +772,13 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) return(0); } -static int f_local(sunindextype Nlocal, realtype t, N_Vector y, +static int f_local(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *Ydata, *dydata, *pdata; - realtype dx[DIM], c, v[DIM], cl[DIM], cr[DIM]; - realtype adv[DIM], diff[DIM]; - realtype xmin[DIM], x[DIM], x1; + sunrealtype *Ydata, *dydata, *pdata; + sunrealtype dx[DIM], c, v[DIM], cl[DIM], cr[DIM]; + sunrealtype adv[DIM], diff[DIM]; + sunrealtype xmin[DIM], x[DIM], x1; int i[DIM], l_m[DIM], m_start[DIM], nbr_left[DIM], nbr_right[DIM], id; ProblemData d; int dim; @@ -869,10 +869,10 @@ static int f_local(sunindextype Nlocal, realtype t, N_Vector y, *------------------------------------------------------------------ */ -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data) { ProblemData d; - realtype *dqdata; + sunrealtype *dqdata; d = (ProblemData) user_data; @@ -891,7 +891,7 @@ static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) *------------------------------------------------------------------ */ -static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) { ProblemData d; @@ -910,14 +910,14 @@ static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, return(0); } -static int fB_local(sunindextype NlocalB, realtype t, +static int fB_local(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yB, N_Vector dyB, void *user_dataB) { - realtype *YBdata, *dyBdata, *ydata; - realtype dx[DIM], c, v[DIM], cl[DIM], cr[DIM]; - realtype adv[DIM], diff[DIM]; - realtype xmin[DIM], x[DIM], x1; + sunrealtype *YBdata, *dyBdata, *ydata; + sunrealtype dx[DIM], c, v[DIM], cl[DIM], cr[DIM]; + sunrealtype adv[DIM], diff[DIM]; + sunrealtype xmin[DIM], x[DIM], x1; int i[DIM], l_m[DIM], m_start[DIM], nbr_left[DIM], nbr_right[DIM], id; ProblemData d; int dim; @@ -1008,7 +1008,7 @@ static int fB_local(sunindextype NlocalB, realtype t, *------------------------------------------------------------------ */ -static int fQB(realtype t, N_Vector y, N_Vector yB, N_Vector qBdot, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB) { ProblemData d; @@ -1028,7 +1028,7 @@ static int fQB(realtype t, N_Vector y, N_Vector yB, N_Vector qBdot, *------------------------------------------------------------------ */ -static void Load_yext(realtype *src, ProblemData d) +static void Load_yext(sunrealtype *src, ProblemData d) { int i[DIM], l_m[DIM], dim; @@ -1158,8 +1158,8 @@ static void OutputGradient(int myId, N_Vector qB, ProblemData d) FILE *fid; char filename[20]; int *l_m, *m_start, i[DIM],ip; - realtype *xmin, *dx; - realtype x[DIM], *pdata, p, *qBdata, g; + sunrealtype *xmin, *dx; + sunrealtype x[DIM], *pdata, p, *qBdata, g; sprintf(filename,"grad%03d.m",myId); fid = fopen(filename,"w"); diff --git a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c index 2986dee511..fc3a751473 100644 --- a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c @@ -81,7 +81,7 @@ #include /* defs. for SUNLinSol_SPGMR fcts. and constants */ #include /* defs of par. NVECTOR fcts. and macros */ #include /* generic DENSE solver used in prec. */ -#include /* def. of realtype */ +#include /* def. of sunrealtype */ #include @@ -137,7 +137,7 @@ /* IJth is defined in order to write code which indexes into small dense matrices with a (row,column) pair, where 1 <= row,column <= NVARS. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NVARS. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -151,30 +151,30 @@ typedef struct { - realtype *p; - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype *p; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmxsub2; MPI_Comm comm; /* For preconditioner */ - realtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; + sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; } *UserData; /* Functions Called by the CVODES Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *user_data); +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data); /* Private Helper Functions */ @@ -188,17 +188,17 @@ static void SetInitialProfiles(N_Vector u, UserData data); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, - sunindextype dsizey, realtype udata[]); + sunindextype dsizey, sunrealtype udata[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, - sunindextype dsizey, realtype uext[], realtype buffer[]); + sunindextype dsizey, sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], realtype buffer[]); -static void ucomm(realtype t, N_Vector u, UserData data); -static void fcalc(realtype t, realtype udata[], realtype dudata[], UserData data); + sunindextype dsizex, sunrealtype uext[], sunrealtype buffer[]); +static void ucomm(sunrealtype t, N_Vector u, UserData data); +static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], UserData data); static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - realtype t, N_Vector u); + sunrealtype t, N_Vector u); static void PrintOutputS(int my_pe, MPI_Comm comm, N_Vector *uS); static void PrintFinalStats(void *cvode_mem, booleantype sensi, booleantype err_con, int sensi_meth); @@ -213,7 +213,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -222,7 +222,7 @@ int main(int argc, char *argv[]) sunindextype neq, local_N; MPI_Comm comm; - realtype *pbar; + sunrealtype *pbar; int is, *plist; N_Vector *uS; booleantype sensi, err_con; @@ -268,7 +268,7 @@ int main(int argc, char *argv[]) data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2, my_pe)) MPI_Abort(comm, 1); data->p = NULL; - data->p = (realtype *) malloc(NP*sizeof(realtype)); + data->p = (sunrealtype *) malloc(NP*sizeof(sunrealtype)); if (check_retval((void *)data->p, "malloc", 2, my_pe)) MPI_Abort(comm, 1); InitUserData(my_pe, comm, data); @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) if (check_retval((void *)plist, "malloc", 2, my_pe)) MPI_Abort(comm, 1); for (is=0; isp[plist[is]]; @@ -409,9 +409,9 @@ int main(int argc, char *argv[]) * subgrid boundary data into uext. Then calculate f by a call to fcalc. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *udata, *dudata; + sunrealtype *udata, *dudata; UserData data; udata = N_VGetArrayPointer(u); @@ -431,17 +431,17 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) * Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data) + sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; sunindextype *(*pivot)[MYSUB], retval, nvmxsub, offset; int lx, ly, jy, isuby; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; - realtype Q1, Q2, C3; + sunrealtype Q1, Q2, C3; /* Make local copies of pointers in user_data, pointer to u's data, and PE index pair */ @@ -521,14 +521,14 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, * Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *user_data) +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MYSUB]; + sunrealtype **(*P)[MYSUB]; sunindextype *(*pivot)[MYSUB], nvmxsub; int lx, ly; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data */ @@ -624,7 +624,7 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) { int isubx, isuby; int lx, ly; - realtype KH, VEL, KV0; + sunrealtype KH, VEL, KV0; /* Set problem parameters */ data->p[0] = RCONST(1.63e-16); /* Q1 coeffs. q1, q2, c3 */ @@ -638,8 +638,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -697,8 +697,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) { int isubx, isuby; sunindextype lx, ly, jx, jy, offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *udata; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *udata; /* Set pointer to data array in vector u */ udata = N_VGetArrayPointer(u); @@ -736,11 +736,11 @@ static void SetInitialProfiles(N_Vector u, UserData data) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype udata[]) + sunrealtype udata[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -778,7 +778,7 @@ static void BSend(MPI_Comm comm, int my_pe, int isubx, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in both calls also. @@ -787,12 +787,12 @@ static void BSend(MPI_Comm comm, int my_pe, int isubx, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -822,18 +822,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -879,9 +879,9 @@ static void BRecvWait(MPI_Request request[], int isubx, int isuby, * between processors of data needed to calculate f. */ -static void ucomm(realtype t, N_Vector u, UserData data) +static void ucomm(sunrealtype t, N_Vector u, UserData data) { - realtype *udata, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *udata, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -912,16 +912,16 @@ static void ucomm(realtype t, N_Vector u, UserData data) * and this data is in the work array uext. */ -static void fcalc(realtype t, realtype udata[], realtype dudata[], UserData data) +static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], UserData data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy, isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; - realtype Q1, Q2, C3, A3, A4; + sunrealtype Q1, Q2, C3, A3, A4; /* Get subgrid indices, data sizes, extended work array uext */ isubx = data->isubx; isuby = data->isuby; @@ -1049,11 +1049,11 @@ static void fcalc(realtype t, realtype udata[], realtype dudata[], UserData data */ static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - realtype t, N_Vector u) + sunrealtype t, N_Vector u) { long int nst; int qu, npelast, retval; - realtype hu, *udata, tempu[2]; + sunrealtype hu, *udata, tempu[2]; sunindextype i0, i1; MPI_Status status; @@ -1123,7 +1123,7 @@ static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, static void PrintOutputS(int my_pe, MPI_Comm comm, N_Vector *uS) { - realtype *sdata, temps[2]; + sunrealtype *sdata, temps[2]; int npelast; sunindextype i0, i1; MPI_Status status; diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c index 478fb850a6..ab26a348e1 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c @@ -67,7 +67,7 @@ #include /* prototypes for CVBBDPRE module */ #include /* prototypes and constants for SUNLinSol_SPGMR solver */ #include /* definition N_Vector */ -#include /* definitions of realtype, booleantype */ +#include /* definitions of sunrealtype, booleantype */ #include /* MPI constants and types */ @@ -125,8 +125,8 @@ grid constants, processor indices, MPI communicator */ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmxsub2, Nlocal; MPI_Comm comm; @@ -140,30 +140,30 @@ static void SetInitialProfiles(N_Vector u, UserData data); static void PrintIntro(int npes, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep); static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uarray[]); + sunrealtype uarray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]); + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]); -static void fucomm(realtype t, N_Vector u, void *user_data); +static void fucomm(sunrealtype t, N_Vector u, void *user_data); /* Prototype of function called by the solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Prototype of functions called by the CVBBDPRE module */ -static int flocal(sunindextype Nlocal, realtype t, N_Vector u, +static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private function to check function return values */ @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) UserData data; SUNLinearSolver LS; void *cvode_mem; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; int iout, my_pe, npes, retval, jpre; sunindextype neq, local_N, mudq, mldq, mukeep, mlkeep; @@ -333,8 +333,8 @@ static void InitUserData(int my_pe, sunindextype local_N, MPI_Comm comm, /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -360,8 +360,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) int isubx, isuby; int lx, ly, jx, jy; sunindextype offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *uarray; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *uarray; /* Set pointer to data array in vector u */ @@ -415,12 +415,12 @@ static void PrintIntro(int npes, sunindextype mudq, sunindextype mldq, /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int qu, retval, npelast; sunindextype i0, i1; long int nst; - realtype hu, *uarray, tempu[2]; + sunrealtype hu, *uarray, tempu[2]; MPI_Status status; npelast = NPEX*NPEY - 1; @@ -531,11 +531,11 @@ static void PrintFinalStats(void *cvode_mem) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uarray[]) + sunrealtype uarray[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ @@ -577,7 +577,7 @@ static void BSend(MPI_Comm comm, /* Routine to start receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ @@ -585,11 +585,11 @@ static void BSend(MPI_Comm comm, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -619,19 +619,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], /* Routine to finish receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -674,10 +674,10 @@ static void BRecvWait(MPI_Request request[], /* fucomm routine. This routine performs all inter-processor communication of data in u needed to calculate f. */ -static void fucomm(realtype t, N_Vector u, void *user_data) +static void fucomm(sunrealtype t, N_Vector u, void *user_data) { UserData data; - realtype *uarray, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *uarray, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -712,7 +712,7 @@ static void fucomm(realtype t, N_Vector u, void *user_data) /* f routine. Evaluate f(t,y). First call fucomm to do communication of subgrid boundary data into uext. Then calculate f by a call to flocal. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { UserData data; @@ -735,19 +735,19 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) inter-processor communication of data needed to calculate f has already been done, and this data is in the work array uext. */ -static int flocal(sunindextype Nlocal, realtype t, N_Vector u, +static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy; int isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; UserData data; - realtype *uarray, *duarray; + sunrealtype *uarray, *duarray; uarray = N_VGetArrayPointer_Parallel(u); duarray = N_VGetArrayPointer_Parallel(udot); diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_p.c index ce55ed2ce5..1623001f4f 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_p.c @@ -54,7 +54,7 @@ #include /* prototypes and constants for SUNLinSol_SPGMR solver */ #include /* definition N_Vector */ #include /* prototypes for small dense matrix fcts. */ -#include /* definitions of realtype, booleantype */ +#include /* definitions of sunrealtype, booleantype */ #include /* MPI constants and types */ @@ -111,7 +111,7 @@ /* IJth is defined in order to write code which indexes into dense matrices with a (row,column) pair, where 1 <= row,column <= NVARS. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NVARS. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -125,14 +125,14 @@ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; - realtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype uext[NVARS*(MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmxsub2; MPI_Comm comm; /* For preconditioner */ - realtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; + sunrealtype **P[MXSUB][MYSUB], **Jbd[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; } *UserData; @@ -143,36 +143,36 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector u, UserData data); static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t); + N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype udata[]); + sunrealtype udata[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]); -static void ucomm(realtype t, N_Vector u, UserData data); -static void fcalc(realtype t, realtype udata[], realtype dudata[], + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]); +static void ucomm(sunrealtype t, N_Vector u, UserData data); +static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], UserData data); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *user_data); +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data); /* Private function to check function return values */ @@ -185,7 +185,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id int main(int argc, char *argv[]) { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -306,8 +306,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) /* Set problem constants */ data->om = PI/HALFDAY; - data->dx = (XMAX-XMIN)/((realtype)(MX-1)); - data->dy = (YMAX-YMIN)/((realtype)(MY-1)); + data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); + data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); data->haco = VEL/(RCONST(2.0)*data->dx); data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; @@ -359,8 +359,8 @@ static void SetInitialProfiles(N_Vector u, UserData data) { int isubx, isuby, lx, ly, jx, jy; sunindextype offset; - realtype dx, dy, x, y, cx, cy, xmid, ymid; - realtype *udata; + sunrealtype dx, dy, x, y, cx, cy, xmid, ymid; + sunrealtype *udata; /* Set pointer to data array in vector u */ udata = N_VGetArrayPointer(u); @@ -395,10 +395,10 @@ static void SetInitialProfiles(N_Vector u, UserData data) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, - N_Vector u, realtype t) + N_Vector u, sunrealtype t) { int qu, retval; - realtype hu, *udata, tempu[2]; + sunrealtype hu, *udata, tempu[2]; int npelast; long int nst; sunindextype i0, i1; @@ -504,11 +504,11 @@ static void PrintFinalStats(void *cvode_mem) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype udata[]) + sunrealtype udata[]) { int i, ly; sunindextype offsetu, offsetbuf; - realtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; + sunrealtype bufleft[NVARS*MYSUB], bufright[NVARS*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -545,7 +545,7 @@ static void BSend(MPI_Comm comm, /* Routine to start receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ @@ -553,11 +553,11 @@ static void BSend(MPI_Comm comm, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, sunindextype dsizex, sunindextype dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; /* If isuby > 0, receive data for bottom x-line of uext */ if (isuby != 0) @@ -586,19 +586,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], /* Routine to finish receiving boundary data from neighboring PEs. Notes: - 1) buffer should be able to hold 2*NVARS*MYSUB realtype entries, should be + 1) buffer should be able to hold 2*NVARS*MYSUB sunrealtype entries, should be passed to both the BRecvPost and BRecvWait functions, and should not be manipulated between the two calls. 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, int isuby, - sunindextype dsizex, realtype uext[], - realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int i, ly; sunindextype dsizex2, offsetue, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NVARS*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NVARS; @@ -641,10 +641,10 @@ static void BRecvWait(MPI_Request request[], /* ucomm routine. This routine performs all communication between processors of data needed to calculate f. */ -static void ucomm(realtype t, N_Vector u, UserData data) +static void ucomm(sunrealtype t, N_Vector u, UserData data) { - realtype *udata, *uext, buffer[2*NVARS*MYSUB]; + sunrealtype *udata, *uext, buffer[2*NVARS*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby; sunindextype nvmxsub, nvmysub; @@ -673,14 +673,14 @@ static void ucomm(realtype t, N_Vector u, UserData data) between processors of data needed to calculate f has already been done, and this data is in the work array uext. */ -static void fcalc(realtype t, realtype udata[], - realtype dudata[], UserData data) +static void fcalc(sunrealtype t, sunrealtype udata[], + sunrealtype dudata[], UserData data) { - realtype *uext; - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *uext; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int i, lx, ly, jy; int isubx, isuby; sunindextype nvmxsub, nvmxsub2, offsetu, offsetue; @@ -805,9 +805,9 @@ static void fcalc(realtype t, realtype udata[], /* f routine. Evaluate f(t,y). First call ucomm to do communication of subgrid boundary data into uext. Then calculate f by a call to fcalc. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype *udata, *dudata; + sunrealtype *udata, *dudata; UserData data; udata = N_VGetArrayPointer(u); @@ -824,16 +824,16 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) } /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data) + sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; sunindextype nvmxsub, offset; sunindextype *(*pivot)[MYSUB], retval; int lx, ly, jy, isuby; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; /* Make local copies of pointers in user_data, pointer to u's data, @@ -912,15 +912,15 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, } /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *user_data) +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MYSUB]; + sunrealtype **(*P)[MYSUB]; sunindextype nvmxsub; sunindextype *(*pivot)[MYSUB]; int lx, ly; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data */ diff --git a/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c b/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c index f5da23b9c3..6673d6075b 100644 --- a/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c +++ b/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c @@ -55,7 +55,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of SUNRabs and SUNRexp */ /* Problem Constants */ @@ -95,19 +95,19 @@ contains grid constants */ typedef struct { - realtype dx, dy, hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, hdcoef, hacoef, vdcoef; } *UserData; /* Prototypes of user-supplied functions */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fB(realtype tB, N_Vector u, N_Vector uB, N_Vector uBdot, void *user_dataB); +static int fB(sunrealtype tB, N_Vector u, N_Vector uB, N_Vector uBdot, void *user_dataB); -static int JacB(realtype tB, N_Vector u, N_Vector uB, N_Vector fuB, SUNMatrix JB, +static int JacB(sunrealtype tB, N_Vector u, N_Vector uB, N_Vector fuB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); /* Prototypes of private functions */ @@ -131,12 +131,12 @@ int main(int argc, char *argv[]) SUNMatrix A, AB; SUNLinearSolver LS, LSB; - realtype dx, dy, reltol, abstol, t; + sunrealtype dx, dy, reltol, abstol, t; N_Vector u; int indexB; - realtype reltolB, abstolB; + sunrealtype reltolB, abstolB; N_Vector uB; int retval, ncheck; @@ -294,10 +294,10 @@ int main(int argc, char *argv[]) * f routine. right-hand side of forward ODE. */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; - realtype *udata, *dudata; + sunrealtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; + sunrealtype *udata, *dudata; int i, j; UserData data; @@ -341,11 +341,11 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) * Jac function. Jacobian of forward ODE. */ -static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { int i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* @@ -385,14 +385,14 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, * fB function. Right-hand side of backward ODE. */ -static int fB(realtype tB, N_Vector u, N_Vector uB, N_Vector uBdot, +static int fB(sunrealtype tB, N_Vector u, N_Vector uB, N_Vector uBdot, void *user_dataB) { UserData data; - realtype *uBdata, *duBdata; - realtype hordc, horac, verdc; - realtype uBij, uBdn, uBup, uBlt, uBrt; - realtype hdiffB, hadvB, vdiffB; + sunrealtype *uBdata, *duBdata; + sunrealtype hordc, horac, verdc; + sunrealtype uBij, uBdn, uBup, uBlt, uBrt; + sunrealtype hdiffB, hadvB, vdiffB; int i, j; uBdata = N_VGetArrayPointer(uB); @@ -435,11 +435,11 @@ static int fB(realtype tB, N_Vector u, N_Vector uB, N_Vector uBdot, * JacB function. Jacobian of backward ODE */ -static int JacB(realtype tB, N_Vector u, N_Vector uB, N_Vector fuB, SUNMatrix JB, +static int JacB(sunrealtype tB, N_Vector u, N_Vector uB, N_Vector fuB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { int i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* The Jacobian of the adjoint system is: JB = -J^T */ @@ -480,8 +480,8 @@ static int JacB(realtype tB, N_Vector u, N_Vector uB, N_Vector fuB, SUNMatrix JB static void SetIC(N_Vector u, UserData data) { int i, j; - realtype x, y, dx, dy; - realtype *udata; + sunrealtype x, y, dx, dy; + sunrealtype *udata; /* Extract needed constants from data */ @@ -510,7 +510,7 @@ static void SetIC(N_Vector u, UserData data) static void PrintOutput(N_Vector uB, UserData data) { - realtype *uBdata, uBij, uBmax, x, y, dx, dy; + sunrealtype *uBdata, uBij, uBmax, x, y, dx, dy; int i, j; x = y = ZERO; diff --git a/examples/cvodes/serial/cvsAdvDiff_FSA_non.c b/examples/cvodes/serial/cvsAdvDiff_FSA_non.c index 7d3d5a6207..f82c30dfaa 100644 --- a/examples/cvodes/serial/cvsAdvDiff_FSA_non.c +++ b/examples/cvodes/serial/cvsAdvDiff_FSA_non.c @@ -78,13 +78,13 @@ contains problem parameters, grid constants, work array. */ typedef struct { - realtype *p; - realtype dx; + sunrealtype *p; + sunrealtype dx; } *UserData; /* Functions Called by the CVODES Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private Helper Functions */ @@ -92,8 +92,8 @@ static void ProcessArgs(int argc, char *argv[], booleantype *sensi, int *sensi_meth, booleantype *err_con); static void WrongArgs(char *name); -static void SetIC(N_Vector u, realtype dx); -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u); +static void SetIC(N_Vector u, sunrealtype dx); +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u); static void PrintOutputS(N_Vector *uS); static void PrintFinalStats(void *cvode_mem, booleantype sensi, booleantype err_con, int sensi_meth); @@ -110,11 +110,11 @@ int main(int argc, char *argv[]) { void *cvode_mem; UserData data; - realtype dx, reltol, abstol, t, tout; + sunrealtype dx, reltol, abstol, t, tout; N_Vector u; int iout, retval; - realtype *pbar; + sunrealtype *pbar; int is, *plist; N_Vector *uS; booleantype sensi, err_con; @@ -142,8 +142,8 @@ int main(int argc, char *argv[]) /* Set user data */ data = (UserData) malloc(sizeof *data); /* Allocate data memory */ if(check_retval((void *)data, "malloc", 2)) return(1); - data->p = (realtype *) malloc(NP * sizeof(realtype)); - dx = data->dx = XMAX/((realtype)(MX+1)); + data->p = (sunrealtype *) malloc(NP * sizeof(sunrealtype)); + dx = data->dx = XMAX/((sunrealtype)(MX+1)); data->p[0] = RCONST(1.0); data->p[1] = RCONST(0.5); @@ -187,7 +187,7 @@ int main(int argc, char *argv[]) if(check_retval((void *)plist, "malloc", 2)) return(1); for(is=0; isp[plist[is]]; @@ -293,11 +293,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype ui, ult, urt, hordc, horac, hdiff, hadv; - realtype dx; - realtype *udata, *dudata; + sunrealtype ui, ult, urt, hordc, horac, hdiff, hadv; + sunrealtype dx; + sunrealtype *udata, *dudata; int i; UserData data; @@ -396,11 +396,11 @@ static void WrongArgs(char *name) * Set initial conditions in u vector. */ -static void SetIC(N_Vector u, realtype dx) +static void SetIC(N_Vector u, sunrealtype dx) { int i; - realtype x; - realtype *udata; + sunrealtype x; + sunrealtype *udata; /* Set pointer to data array and get local length of u. */ udata = N_VGetArrayPointer(u); @@ -416,11 +416,11 @@ static void SetIC(N_Vector u, realtype dx) * Print current t, step count, order, stepsize, and max norm of solution */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu; + sunrealtype hu; retval = CVodeGetNumSteps(cvode_mem, &nst); check_retval(&retval, "CVodeGetNumSteps", 1); diff --git a/examples/cvodes/serial/cvsAdvDiff_bnd.c b/examples/cvodes/serial/cvsAdvDiff_bnd.c index 9a611e3e2e..fc32e13d97 100644 --- a/examples/cvodes/serial/cvsAdvDiff_bnd.c +++ b/examples/cvodes/serial/cvsAdvDiff_bnd.c @@ -44,7 +44,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of SUNRabs and SUNRexp */ /* Problem Constants */ @@ -82,14 +82,14 @@ /* Type : UserData (contains grid constants) */ typedef struct { - realtype dx, dy, hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, hdcoef, hacoef, vdcoef; } *UserData; /* Private Helper Functions */ static void SetIC(N_Vector u, UserData data); -static void PrintHeader(realtype reltol, realtype abstol, realtype umax); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -98,8 +98,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* @@ -111,7 +111,7 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, int main(void) { SUNContext sunctx; - realtype dx, dy, reltol, abstol, t, tout, umax; + sunrealtype dx, dy, reltol, abstol, t, tout, umax; N_Vector u; UserData data; void *cvode_mem; @@ -216,10 +216,10 @@ int main(void) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u,N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; - realtype *udata, *dudata; + sunrealtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; + sunrealtype *udata, *dudata; int i, j; UserData data; @@ -261,11 +261,11 @@ static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) /* Jacobian routine. Compute J(t,u). */ -static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunindextype i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* @@ -312,8 +312,8 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, SUNMatrix J, static void SetIC(N_Vector u, UserData data) { int i, j; - realtype x, y, dx, dy; - realtype *udata; + sunrealtype x, y, dx, dy; + sunrealtype *udata; /* Extract needed constants from data */ @@ -337,7 +337,7 @@ static void SetIC(N_Vector u, UserData data) /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -358,7 +358,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax) /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvodes/serial/cvsAdvDiff_bndL.c b/examples/cvodes/serial/cvsAdvDiff_bndL.c index f03b5bece2..dd035c122f 100644 --- a/examples/cvodes/serial/cvsAdvDiff_bndL.c +++ b/examples/cvodes/serial/cvsAdvDiff_bndL.c @@ -41,7 +41,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include /* definition of ABS and EXP */ /* Problem Constants */ @@ -79,14 +79,14 @@ /* Type : UserData (contains grid constants) */ typedef struct { - realtype dx, dy, hdcoef, hacoef, vdcoef; + sunrealtype dx, dy, hdcoef, hacoef, vdcoef; } *UserData; /* Private Helper Functions */ static void SetIC(N_Vector u, UserData data); -static void PrintHeader(realtype reltol, realtype abstol, realtype umax); -static void PrintOutput(realtype t, realtype umax, long int nst); +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax); +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -95,8 +95,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -109,7 +109,7 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, int main(void) { SUNContext sunctx; - realtype dx, dy, reltol, abstol, t, tout, umax; + sunrealtype dx, dy, reltol, abstol, t, tout, umax; N_Vector u; UserData data; SUNMatrix A; @@ -215,10 +215,10 @@ int main(void) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u,N_Vector udot, void *user_data) { - realtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; - realtype *udata, *dudata; + sunrealtype uij, udn, uup, ult, urt, hordc, horac, verdc, hdiff, hadv, vdiff; + sunrealtype *udata, *dudata; int i, j; UserData data; @@ -260,12 +260,12 @@ static int f(realtype t, N_Vector u,N_Vector udot, void *user_data) /* Jacobian routine. Compute J(t,u). */ -static int Jac(realtype t, N_Vector u, N_Vector fu, +static int Jac(sunrealtype t, N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { int i, j, k; - realtype *kthCol, hordc, horac, verdc; + sunrealtype *kthCol, hordc, horac, verdc; UserData data; /* @@ -313,8 +313,8 @@ static int Jac(realtype t, N_Vector u, N_Vector fu, static void SetIC(N_Vector u, UserData data) { int i, j; - realtype x, y, dx, dy; - realtype *udata; + sunrealtype x, y, dx, dy; + sunrealtype *udata; /* Extract needed constants from data */ @@ -338,7 +338,7 @@ static void SetIC(N_Vector u, UserData data) /* Print first lines of output (problem description) */ -static void PrintHeader(realtype reltol, realtype abstol, realtype umax) +static void PrintHeader(sunrealtype reltol, sunrealtype abstol, sunrealtype umax) { printf("\n2-D Advection-Diffusion Equation\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -356,7 +356,7 @@ static void PrintHeader(realtype reltol, realtype abstol, realtype umax) /* Print current value */ -static void PrintOutput(realtype t, realtype umax, long int nst) +static void PrintOutput(sunrealtype t, sunrealtype umax, long int nst) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %4.2Lf max.norm(u) =%14.6Le nst = %4ld\n", t, umax, nst); diff --git a/examples/cvodes/serial/cvsAnalytic_mels.c b/examples/cvodes/serial/cvsAnalytic_mels.c index b4bf5cbc48..2bad181c17 100644 --- a/examples/cvodes/serial/cvsAnalytic_mels.c +++ b/examples/cvodes/serial/cvsAnalytic_mels.c @@ -33,7 +33,7 @@ #include #include /* prototypes for CVODE fcts., consts. */ #include /* access to serial N_Vector */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -46,17 +46,17 @@ #endif /* User-supplied functions called by CVode */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Custom linear solver data structure, accessor macros, and routines */ static SUNLinearSolver MatrixEmbeddedLS(void *cvode_mem); static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S); static int MatrixEmbeddedLSSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol); + N_Vector b, sunrealtype tol); static int MatrixEmbeddedLSFree(SUNLinearSolver S); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -68,20 +68,20 @@ static SUNContext sunctx; int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(10.0); /* final time */ - realtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype dTout = RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - realtype reltol = RCONST(1.0e-6); /* tolerances */ - realtype abstol = RCONST(1.0e-10); - realtype lamda = RCONST(-100.0); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-10); + sunrealtype lamda = RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *cvode_mem = NULL; /* empty CVode memory structure */ - realtype t, tout; + sunrealtype t, tout; long int nst, nfe, nsetups, nje, nfeLS, nni, ncfn, netf; /* Initial diagnostics output */ @@ -193,11 +193,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype u = NV_Ith_S(y,0); /* access current solution value */ + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ NV_Ith_S(ydot,0) = lamda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lamda*atan(t); @@ -236,15 +236,15 @@ static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S) /* linear solve routine */ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { /* temporary variables */ int retval; N_Vector y, ypred, fn, zn1; - realtype tcur, gamma, rl1; + sunrealtype tcur, gamma, rl1; void *user_data; - realtype *rdata; - realtype lamda; + sunrealtype *rdata; + sunrealtype lamda; /* retrieve implicit system data from CVode */ retval = CVodeGetNonlinearSystemData(LS->content, &tcur, &ypred, &y, &fn, @@ -253,7 +253,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, return(-1); /* extract stiffness parameter from user_data */ - rdata = (realtype *) user_data; + rdata = (sunrealtype *) user_data; lamda = rdata[0]; /* perform linear solve: (1-gamma*lamda)*x = b */ @@ -312,10 +312,10 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) } /* check the computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ - realtype ans, err, ewt; /* answer data, error, and error weight */ + sunrealtype ans, err, ewt; /* answer data, error, and error weight */ /* compute solution error */ ans = atan(t); diff --git a/examples/cvodes/serial/cvsDirectDemo_ls.c b/examples/cvodes/serial/cvsDirectDemo_ls.c index 7f0e97858e..1f30b43a4e 100644 --- a/examples/cvodes/serial/cvsDirectDemo_ls.c +++ b/examples/cvodes/serial/cvsDirectDemo_ls.c @@ -73,7 +73,7 @@ #include /* access to CVDIAG linear solver */ #include "sunnonlinsol/sunnonlinsol_newton.h" /* access to the newton SUNNonlinearSolver */ #include "sunnonlinsol/sunnonlinsol_fixedpoint.h" /* access to the fixed point SUNNonlinearSolver */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -125,28 +125,28 @@ enum {FUNC, DENSE_USER, DENSE_DQ, DIAG, BAND_USER, BAND_DQ}; static int Problem1(void); static void PrintIntro1(void); static void PrintHeader1(void); -static void PrintOutput1(realtype t, realtype y0, realtype y1, int qu, realtype hu); +static void PrintOutput1(sunrealtype t, sunrealtype y0, sunrealtype y1, int qu, sunrealtype hu); static int Problem2(void); static void PrintIntro2(void); static void PrintHeader2(void); -static void PrintOutput2(realtype t, realtype erm, int qu, realtype hu); -static realtype MaxError(N_Vector y, realtype t); +static void PrintOutput2(sunrealtype t, sunrealtype erm, int qu, sunrealtype hu); +static sunrealtype MaxError(N_Vector y, sunrealtype t); static int PrepareNextRun(SUNContext sunctx, void *cvode_mem, int lmm, int miter, N_Vector y, SUNMatrix* A, sunindextype mu, sunindextype ml, SUNLinearSolver* LS, SUNNonlinearSolver* NLS); -static void PrintErrOutput(realtype tol_factor); -static void PrintFinalStats(void *cvode_mem, int miter, realtype ero); +static void PrintErrOutput(sunrealtype tol_factor); +static void PrintFinalStats(void *cvode_mem, int miter, sunrealtype ero); static void PrintErrInfo(int nerr); /* Functions Called by the Solver */ -static int f1(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac1(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, +static int f1(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac1(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int f2(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac2(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +static int f2(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac2(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ @@ -168,7 +168,7 @@ int main(void) static int Problem1(void) { - realtype reltol=RTOL, abstol=ATOL, t, tout, ero, er; + sunrealtype reltol=RTOL, abstol=ATOL, t, tout, ero, er; int miter, retval, temp_retval, iout, nerr=0; N_Vector y; SUNMatrix A; @@ -177,7 +177,7 @@ static int Problem1(void) void *cvode_mem; booleantype firstrun; int qu; - realtype hu; + sunrealtype hu; SUNContext sunctx; y = NULL; @@ -346,7 +346,7 @@ static void PrintHeader1(void) return; } -static void PrintOutput1(realtype t, realtype y0, realtype y1, int qu, realtype hu) +static void PrintOutput1(sunrealtype t, sunrealtype y0, sunrealtype y1, int qu, sunrealtype hu) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("%10.5Lf %12.5Le %12.5Le %2d %6.4Le\n", t, y0, y1, qu, hu); @@ -359,9 +359,9 @@ static void PrintOutput1(realtype t, realtype y0, realtype y1, int qu, realtype return; } -static int f1(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f1(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y0, y1; + sunrealtype y0, y1; y0 = NV_Ith_S(y,0); y1 = NV_Ith_S(y,1); @@ -372,10 +372,10 @@ static int f1(realtype t, N_Vector y, N_Vector ydot, void *user_data) return(0); } -static int Jac1(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac1(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y0, y1; + sunrealtype y0, y1; y0 = NV_Ith_S(y,0); y1 = NV_Ith_S(y,1); @@ -389,7 +389,7 @@ static int Jac1(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, static int Problem2(void) { - realtype reltol=RTOL, abstol=ATOL, t, tout, er, erm, ero; + sunrealtype reltol=RTOL, abstol=ATOL, t, tout, er, erm, ero; int miter, retval, temp_retval, nerr=0; N_Vector y; SUNMatrix A; @@ -398,7 +398,7 @@ static int Problem2(void) void *cvode_mem; booleantype firstrun; int qu, iout; - realtype hu; + sunrealtype hu; SUNContext sunctx; y = NULL; @@ -571,7 +571,7 @@ static void PrintHeader2(void) return; } -static void PrintOutput2(realtype t, realtype erm, int qu, realtype hu) +static void PrintOutput2(sunrealtype t, sunrealtype erm, int qu, sunrealtype hu) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("%10.3Lf %12.4Le %2d %12.4Le\n", t, erm, qu, hu); @@ -584,10 +584,10 @@ static void PrintOutput2(realtype t, realtype erm, int qu, realtype hu) return; } -static int f2(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f2(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { sunindextype i, j, k; - realtype d, *ydata, *dydata; + sunrealtype d, *ydata, *dydata; ydata = N_VGetArrayPointer(y); dydata = N_VGetArrayPointer(ydot); @@ -612,11 +612,11 @@ static int f2(realtype t, N_Vector y, N_Vector ydot, void *user_data) return(0); } -static int Jac2(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac2(sunrealtype tn, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { int i, j, k; - realtype *kthCol; + sunrealtype *kthCol; /* The components of f(t,y) which depend on y are @@ -647,10 +647,10 @@ static int Jac2(realtype tn, N_Vector y, N_Vector fy, SUNMatrix J, return(0); } -static realtype MaxError(N_Vector y, realtype t) +static sunrealtype MaxError(N_Vector y, sunrealtype t) { sunindextype i, j, k; - realtype *ydata, er, ex=ZERO, yt, maxError=ZERO, ifact_inv, jfact_inv=ONE; + sunrealtype *ydata, er, ex=ZERO, yt, maxError=ZERO, ifact_inv, jfact_inv=ONE; if (t == ZERO) return(ZERO); @@ -814,7 +814,7 @@ static int PrepareNextRun(SUNContext sunctx, void *cvode_mem, int lmm, int miter return(retval); } -static void PrintErrOutput(realtype tol_factor) +static void PrintErrOutput(sunrealtype tol_factor) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("\n\n Error exceeds %Lg * tolerance \n\n", tol_factor); @@ -827,7 +827,7 @@ static void PrintErrOutput(realtype tol_factor) return; } -static void PrintFinalStats(void *cvode_mem, int miter, realtype ero) +static void PrintFinalStats(void *cvode_mem, int miter, sunrealtype ero) { long int lenrw, leniw, lenrwLS, leniwLS; long int nst, nfe, nsetups, nni, ncfn, netf, nje, nfeLS; diff --git a/examples/cvodes/serial/cvsDiurnal_FSA_kry.c b/examples/cvodes/serial/cvsDiurnal_FSA_kry.c index fb3f4c662b..c974d5977d 100644 --- a/examples/cvodes/serial/cvsDiurnal_FSA_kry.c +++ b/examples/cvodes/serial/cvsDiurnal_FSA_kry.c @@ -61,7 +61,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -122,7 +122,7 @@ For each mesh point (j,k), the elements for species i and i+1 are contiguous within vdata. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NUM_SPECIES. The small matrix routines in dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -135,23 +135,23 @@ problem parameters, and problem constants */ typedef struct { - realtype *p; - realtype **P[MX][MZ], **Jbd[MX][MZ]; + sunrealtype *p; + sunrealtype **P[MX][MZ], **Jbd[MX][MZ]; sunindextype *pivot[MX][MZ]; - realtype q4, om, dx, dz, hdco, haco, vdco; + sunrealtype q4, om, dx, dz, hdco, haco, vdco; } *UserData; /* Prototypes of user-supplied functions */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(realtype tn, N_Vector y, N_Vector fy, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector y, N_Vector fy, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector y, N_Vector fy, +static int PSolve(sunrealtype tn, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* Prototypes of private functions */ @@ -162,8 +162,8 @@ static void WrongArgs(char *name); static UserData AllocUserData(void); static void InitUserData(UserData data); static void FreeUserData(UserData data); -static void SetInitialProfiles(N_Vector y, realtype dx, realtype dz); -static void PrintOutput(void *cvode_mem, realtype t, N_Vector y); +static void SetInitialProfiles(N_Vector y, sunrealtype dx, sunrealtype dz); +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector y); static void PrintOutputS(N_Vector *uS); static void PrintFinalStats(void *cvode_mem, booleantype sensi, booleantype err_con, int sensi_meth); @@ -181,11 +181,11 @@ int main(int argc, char *argv[]) void *cvode_mem; SUNLinearSolver LS; UserData data; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector y; int iout, retval; - realtype *pbar; + sunrealtype *pbar; int is, *plist; N_Vector *uS; booleantype sensi, err_con; @@ -259,7 +259,7 @@ int main(int argc, char *argv[]) if(check_retval((void *)plist, "malloc", 2)) return(1); for(is=0; isp[plist[is]]; @@ -347,16 +347,16 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, czdn, czup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, zdn, zup; - realtype q4coef, delz, verdco, hordco, horaco; - realtype *ydata, *dydata; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, czdn, czup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, zdn, zup; + sunrealtype q4coef, delz, verdco, hordco, horaco; + sunrealtype *ydata, *dydata; int jx, jz, idn, iup, ileft, iright; UserData data; - realtype Q1, Q2, C3, A3, A4; + sunrealtype Q1, Q2, C3, A3, A4; data = (UserData) user_data; ydata = N_VGetArrayPointer(y); @@ -450,17 +450,17 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector y, N_Vector fy, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector y, N_Vector fy, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype c1, c2, czdn, czup, diag, zdn, zup, q4coef, delz, verdco, hordco; - realtype **(*P)[MZ], **(*Jbd)[MZ]; + sunrealtype c1, c2, czdn, czup, diag, zdn, zup, q4coef, delz, verdco, hordco; + sunrealtype **(*P)[MZ], **(*Jbd)[MZ]; sunindextype retval; sunindextype *(*pivot)[MZ]; int jx, jz; - realtype *ydata, **a, **j; + sunrealtype *ydata, **a, **j; UserData data; - realtype Q1, Q2, C3; + sunrealtype Q1, Q2, C3; /* Make local copies of pointers in user_data, and of pointer to y's data */ data = (UserData) user_data; @@ -545,15 +545,15 @@ static int Precond(realtype tn, N_Vector y, N_Vector fy, booleantype jok, * Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector y, N_Vector fy, +static int PSolve(sunrealtype tn, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MZ]; + sunrealtype **(*P)[MZ]; sunindextype *(*pivot)[MZ]; int jx, jz; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data. */ @@ -656,7 +656,7 @@ static UserData AllocUserData(void) } } - data->p = (realtype *) malloc(NP*sizeof(realtype)); + data->p = (sunrealtype *) malloc(NP*sizeof(sunrealtype)); return(data); } @@ -667,7 +667,7 @@ static UserData AllocUserData(void) static void InitUserData(UserData data) { - realtype Q1, Q2, C3, A3, A4, KH, VEL, KV0; + sunrealtype Q1, Q2, C3, A3, A4, KH, VEL, KV0; /* Set problem parameters */ Q1 = RCONST(1.63e-16); /* Q1 coefficients q1, q2, c3 */ @@ -721,11 +721,11 @@ static void FreeUserData(UserData data) * Set initial conditions in y */ -static void SetInitialProfiles(N_Vector y, realtype dx, realtype dz) +static void SetInitialProfiles(N_Vector y, sunrealtype dx, sunrealtype dz) { int jx, jz; - realtype x, z, cx, cz; - realtype *ydata; + sunrealtype x, z, cx, cz; + sunrealtype *ydata; /* Set pointer to data array in vector y. */ @@ -751,12 +751,12 @@ static void SetInitialProfiles(N_Vector y, realtype dx, realtype dz) * Print current t, step count, order, stepsize, and sampled c1,c2 values */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector y) +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector y) { long int nst; int qu, retval; - realtype hu; - realtype *ydata; + sunrealtype hu; + sunrealtype *ydata; ydata = N_VGetArrayPointer(y); @@ -799,7 +799,7 @@ static void PrintOutput(void *cvode_mem, realtype t, N_Vector y) static void PrintOutputS(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); diff --git a/examples/cvodes/serial/cvsDiurnal_kry.c b/examples/cvodes/serial/cvsDiurnal_kry.c index 14e540c656..abd4f01023 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry.c +++ b/examples/cvodes/serial/cvsDiurnal_kry.c @@ -45,7 +45,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -112,7 +112,7 @@ For each mesh point (j,k), the elements for species i and i+1 are contiguous within vdata. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NUM_SPECIES. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -124,9 +124,9 @@ contains preconditioner blocks, pivot arrays, and problem constants */ typedef struct { - realtype **P[MX][MY], **Jbd[MX][MY]; + sunrealtype **P[MX][MY], **Jbd[MX][MY]; sunindextype *pivot[MX][MY]; - realtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; } *UserData; /* Private Helper Functions */ @@ -134,26 +134,26 @@ typedef struct { static UserData AllocUserData(void); static void InitUserData(UserData data); static void FreeUserData(UserData data); -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy); -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t); +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy); +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); -static int Precond(realtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, realtype gamma, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, + booleantype jok, booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -166,7 +166,7 @@ static int PSolve(realtype tn, N_Vector u, N_Vector fu, int main() { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -306,11 +306,11 @@ static void FreeUserData(UserData data) /* Set initial conditions in u */ -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) { int jx, jy; - realtype x, y, cx, cy; - realtype *udata; + sunrealtype x, y, cx, cy; + sunrealtype *udata; /* Set pointer to data array in vector u. */ @@ -334,11 +334,11 @@ static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t) +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; int mxh = MX/2 - 1, myh = MY/2 - 1, mx1 = MX - 1, my1 = MY - 1; udata = N_VGetArrayPointer(u); @@ -466,13 +466,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* f routine. Compute RHS function f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; - realtype *udata, *dudata; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *udata, *dudata; int jx, jy, idn, iup, ileft, iright; UserData data; @@ -559,18 +559,18 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Jacobian-times-vector routine. */ -static int jtv(N_Vector v, N_Vector Jv, realtype t, +static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, void *user_data, N_Vector tmp) { - realtype c1, c2; - realtype v1, v2, v1dn, v2dn, v1up, v2up, v1lt, v2lt, v1rt, v2rt; - realtype Jv1, Jv2; - realtype cydn, cyup; - realtype s, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; + sunrealtype c1, c2; + sunrealtype v1, v2, v1dn, v2dn, v1up, v2up, v1lt, v2lt, v1rt, v2rt; + sunrealtype Jv1, Jv2; + sunrealtype cydn, cyup; + sunrealtype s, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; int jx, jy, idn, iup, ileft, iright; - realtype *udata, *vdata, *Jvdata; + sunrealtype *udata, *vdata, *Jvdata; UserData data; data = (UserData) user_data; @@ -696,15 +696,15 @@ static int jtv(N_Vector v, N_Vector Jv, realtype t, /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, realtype gamma, +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, + booleantype jok, booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MY], **(*Jbd)[MY]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MY], **(*Jbd)[MY]; sunindextype *(*pivot)[MY], retval; int jx, jy; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; /* Make local copies of pointers in user_data, and of pointer to u's data */ @@ -784,15 +784,15 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MY]; + sunrealtype **(*P)[MY]; sunindextype *(*pivot)[MY]; int jx, jy; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data. */ diff --git a/examples/cvodes/serial/cvsDiurnal_kry_bp.c b/examples/cvodes/serial/cvsDiurnal_kry_bp.c index 42da5cceb3..31cfc4e9f9 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry_bp.c +++ b/examples/cvodes/serial/cvsDiurnal_kry_bp.c @@ -45,7 +45,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* access to CVBANDPRE module */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -112,7 +112,7 @@ For each mesh point (j,k), the elements for species i and i+1 are contiguous within vdata. - IJth(a,i,j) references the (i,j)th entry of the small matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the small matrix sunrealtype **a, where 1 <= i,j <= NUM_SPECIES. The small matrix routines in dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -124,15 +124,15 @@ contains problem constants */ typedef struct { - realtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; } *UserData; /* Private Helper Functions */ static void InitUserData(UserData data); -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy); +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy); static void PrintIntro(sunindextype mu, sunindextype ml); -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t); +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem); /* Private function to check function return values */ @@ -140,7 +140,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Function Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* *------------------------------- @@ -151,7 +151,7 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); int main() { SUNContext sunctx; - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -287,11 +287,11 @@ static void InitUserData(UserData data) /* Set initial conditions in u */ -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) { int jx, jy; - realtype x, y, cx, cy; - realtype *udata; + sunrealtype x, y, cx, cy; + sunrealtype *udata; /* Set pointer to data array in vector u. */ @@ -325,11 +325,11 @@ static void PrintIntro(sunindextype mu, sunindextype ml) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ -static void PrintOutput(void *cvode_mem, N_Vector u,realtype t) +static void PrintOutput(void *cvode_mem, N_Vector u,sunrealtype t) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; int mxh = MX/2 - 1, myh = MY/2 - 1, mx1 = MX - 1, my1 = MY - 1; udata = N_VGetArrayPointer(u); @@ -466,13 +466,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* f routine. Compute f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot,void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot,void *user_data) { - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; - realtype *udata, *dudata; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *udata, *dudata; int idn, iup, ileft, iright, jx, jy; UserData data; diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c index 5f882002c6..95bf038125 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c @@ -95,7 +95,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -132,8 +132,8 @@ #define MXNS (MX*NS) #define AX ONE #define AY ONE -#define DX (AX/(realtype)(MX-1)) -#define DY (AY/(realtype)(MY-1)) +#define DX (AX/(sunrealtype)(MX-1)) +#define DY (AY/(sunrealtype)(MY-1)) #define MP NS #define MQ (MX*MY) #define MXMP (MX*MP) @@ -160,15 +160,15 @@ /* Structure for user data */ typedef struct { - realtype **P[NGRP]; + sunrealtype **P[NGRP]; sunindextype *pivot[NGRP]; int ns, mxns, mp, mq, mx, my, ngrp, ngx, ngy, mxmp; int jgx[NGX+1], jgy[NGY+1], jigx[MX], jigy[MY]; int jxr[NGX], jyr[NGY]; - realtype acoef[NS][NS], bcoef[NS], diff[NS]; - realtype cox[NS], coy[NS], dx, dy, srur; - realtype fsave[NEQ]; - realtype fBsave[NEQ]; + sunrealtype acoef[NS][NS], bcoef[NS], diff[NS]; + sunrealtype cox[NS], coy[NS], dx, dy, srur; + sunrealtype fsave[NEQ]; + sunrealtype fBsave[NEQ]; N_Vector rewt; N_Vector vtemp; N_Vector rewtB; @@ -185,29 +185,29 @@ typedef struct { /* Prototypes for user-supplied functions */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(realtype t, N_Vector c, N_Vector fc, +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector c, N_Vector fc, +static int PSolve(sunrealtype t, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); -static int fB(realtype t, N_Vector c, N_Vector cB, +static int fB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector cBdot, void *user_data); -static int PrecondB(realtype t, N_Vector c, +static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, realtype gamma, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolveB(realtype t, N_Vector c, +static int PSolveB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* Prototypes for private functions */ @@ -218,23 +218,23 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]); static void CInit(N_Vector c, WebData wdata); static void PrintOutput(N_Vector c, int ns, int mxns, WebData wdata); static void FreeUserData(WebData wdata); -static void WebRates(realtype x, realtype y, realtype t, realtype c[], realtype rate[], +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], sunrealtype rate[], WebData wdata); -static void WebRatesB(realtype x, realtype y, realtype t, realtype c[], realtype cB[], - realtype rate[], realtype rateB[], WebData wdata); -static void fblock (realtype t, realtype cdata[], int jx, int jy, realtype cdotdata[], +static void WebRatesB(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], sunrealtype cB[], + sunrealtype rate[], sunrealtype rateB[], WebData wdata); +static void fblock (sunrealtype t, sunrealtype cdata[], int jx, int jy, sunrealtype cdotdata[], WebData wdata); -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata); -static realtype doubleIntgr(N_Vector c, int i, WebData wdata); +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata); +static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata); static int check_retval(void *returnvalue, const char *funcname, int opt); /* Small Vector Kernels */ -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_sum_prods(realtype u[], realtype p[], realtype q[], realtype v[], - realtype w[], int n); -static void v_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_zero(realtype u[], int n); +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], sunrealtype v[], + sunrealtype w[], int n); +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_zero(sunrealtype u[], int n); /* SUNDIALS context */ static SUNContext sunctx; @@ -247,7 +247,7 @@ static SUNContext sunctx; int main(int argc, char *argv[]) { - realtype abstol=ATOL, reltol=RTOL, t; + sunrealtype abstol=ATOL, reltol=RTOL, t; N_Vector c; WebData wdata; void *cvode_mem; @@ -257,7 +257,7 @@ int main(int argc, char *argv[]) int indexB; - realtype reltolB=RTOL, abstolB=ATOL; + sunrealtype reltolB=RTOL, abstolB=ATOL; N_Vector cB; c = NULL; @@ -407,11 +407,11 @@ int main(int argc, char *argv[]) * and these are saved in fsave for use in preconditioning. */ -static int f(realtype t, N_Vector c, N_Vector cdot, void *user_data) +static int f(sunrealtype t, N_Vector c, N_Vector cdot, void *user_data) { int i, ic, ici, idxl, idxu, idyl, idyu, iyoff, jx, jy, ns, mxns; - realtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; - realtype *cdata, *cdotdata; + sunrealtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; + sunrealtype *cdata, *cdotdata; WebData wdata; wdata = (WebData) user_data; @@ -477,17 +477,17 @@ static int f(realtype t, N_Vector c, N_Vector cdot, void *user_data) * scheme. */ -static int Precond(realtype t, N_Vector c, N_Vector fc, +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data) + sunrealtype gamma, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int i, if0, if00, ig, igx, igy, j, jj, jx, jy; int *jxr, *jyr, ngrp, ngx, ngy, mxmp, mp, retval; sunindextype denseretval; - realtype uround, fac, r, r0, save, srur; - realtype *f1, *fsave, *cdata, *rewtdata; + sunrealtype uround, fac, r, r0, save, srur; + sunrealtype *f1, *fsave, *cdata, *rewtdata; WebData wdata; N_Vector rewt; @@ -570,12 +570,12 @@ static int Precond(realtype t, N_Vector c, N_Vector fc, * blocks in P, and pivot information in pivot, and returns the result in z. */ -static int PSolve(realtype t, N_Vector c, N_Vector fc, +static int PSolve(sunrealtype t, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int jx, jy, igx, igy, iv, ig, *jigx, *jigy, mx, my, ngx, mp; WebData wdata; @@ -623,15 +623,15 @@ static int PSolve(realtype t, N_Vector c, N_Vector fc, * interaction rates are computed by calls to WebRatesB. */ -static int fB(realtype t, N_Vector c, N_Vector cB, +static int fB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector cBdot, void *user_data) { int i, ic, ici, idxl, idxu, idyl, idyu, iyoff, jx, jy, ns, mxns; - realtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, *fBsave, dx, dy; - realtype *cdata, *cBdata, *cBdotdata; + sunrealtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, *fBsave, dx, dy; + sunrealtype *cdata, *cBdata, *cBdotdata; WebData wdata; - realtype gu[NS]; + sunrealtype gu[NS]; wdata = (WebData) user_data; cdata = N_VGetArrayPointer(c); @@ -687,18 +687,18 @@ static int fB(realtype t, N_Vector c, N_Vector cB, * Preconditioner setup function for the backward problem */ -static int PrecondB(realtype t, N_Vector c, +static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, realtype gamma, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; sunindextype denseretval; int i, if0, if00, ig, igx, igy, j, jj, jx, jy; int *jxr, *jyr, ngrp, ngx, ngy, mxmp, mp, retval; - realtype uround, fac, r, r0, save, srur; - realtype *f1, *fsave, *cdata, *rewtdata; + sunrealtype uround, fac, r, r0, save, srur; + sunrealtype *f1, *fsave, *cdata, *rewtdata; void *cvode_mem; WebData wdata; N_Vector rewt; @@ -776,13 +776,13 @@ static int PrecondB(realtype t, N_Vector c, * Preconditioner solve function for the backward problem */ -static int PSolveB(realtype t, N_Vector c, +static int PSolveB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int jx, jy, igx, igy, iv, ig, *jigx, *jigy, mx, my, ngx, mp; WebData wdata; @@ -856,8 +856,8 @@ static WebData AllocUserData(void) static void InitUserData(WebData wdata) { int i, j, ns; - realtype *bcoef, *diff, *cox, *coy, dx, dy; - realtype (*acoef)[NS]; + sunrealtype *bcoef, *diff, *cox, *coy, dx, dy; + sunrealtype (*acoef)[NS]; acoef = wdata->acoef; bcoef = wdata->bcoef; @@ -941,7 +941,7 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]) static void CInit(N_Vector c, WebData wdata) { int i, ici, ioff, iyoff, jx, jy, ns, mxns; - realtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; + sunrealtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; cdata = N_VGetArrayPointer(c); ns = wdata->ns; @@ -979,12 +979,12 @@ static void CInit(N_Vector c, WebData wdata) * and at time t. */ -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata) +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata) { int i, j, ns; - realtype fac, *bcoef; - realtype (*acoef)[NS]; + sunrealtype fac, *bcoef; + sunrealtype (*acoef)[NS]; ns = wdata->ns; acoef = wdata->acoef; @@ -1006,12 +1006,12 @@ static void WebRates(realtype x, realtype y, realtype t, realtype c[], * This routine computes the interaction rates for the backward problem */ -static void WebRatesB(realtype x, realtype y, realtype t, realtype c[], realtype cB[], - realtype rate[], realtype rateB[], WebData wdata) +static void WebRatesB(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], sunrealtype cB[], + sunrealtype rate[], sunrealtype rateB[], WebData wdata) { int i, j, ns; - realtype fac, *bcoef; - realtype (*acoef)[NS]; + sunrealtype fac, *bcoef; + sunrealtype (*acoef)[NS]; ns = wdata->ns; acoef = wdata->acoef; @@ -1042,11 +1042,11 @@ static void WebRatesB(realtype x, realtype y, realtype t, realtype c[], realtype * Here jx and jy count from 0. */ -static void fblock(realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata) +static void fblock(sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata) { int iblok, ic; - realtype x, y; + sunrealtype x, y; iblok = jx + jy*(wdata->mx); y = jy*(wdata->dy); @@ -1065,11 +1065,11 @@ static void fblock(realtype t, realtype cdata[], int jx, int jy, * vector kernels v_sum_prods, v_prod, v_inc_by_prod. */ -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) { int i, ic, iter, iyoff, jx, jy, ns, mxns, mx, my, x_loc, y_loc; - realtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; - realtype temp, *cox, *coy, *xd, *zd; + sunrealtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; + sunrealtype temp, *cox, *coy, *xd, *zd; xd = N_VGetArrayPointer(x); zd = N_VGetArrayPointer(z); @@ -1217,26 +1217,26 @@ static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) } } -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] += v[i]*w[i]; } -static void v_sum_prods(realtype u[], realtype p[], realtype q[], - realtype v[], realtype w[], int n) +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], + sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = p[i]*q[i] + v[i]*w[i]; } -static void v_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = v[i]*w[i]; } -static void v_zero(realtype u[], int n) +static void v_zero(sunrealtype u[], int n) { int i; for (i=0; i < n; i++) u[i] = ZERO; @@ -1249,7 +1249,7 @@ static void v_zero(realtype u[], int n) static void PrintOutput(N_Vector cB, int ns, int mxns, WebData wdata) { int i, jx, jy; - realtype *cdata, cij, cmax, x, y; + sunrealtype *cdata, cij, cmax, x, y; x = y = ZERO; @@ -1295,12 +1295,12 @@ static void PrintOutput(N_Vector cB, int ns, int mxns, WebData wdata) * Compute double space integral */ -static realtype doubleIntgr(N_Vector c, int i, WebData wdata) +static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) { - realtype *cdata; + sunrealtype *cdata; int ns, mx, my, mxns; - realtype dx, dy; - realtype intgr_xy, intgr_x; + sunrealtype dx, dy; + sunrealtype intgr_xy, intgr_x; int jx, jy; cdata = N_VGetArrayPointer(c); diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c index 72bb2cb225..1b3e3898c3 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c @@ -88,7 +88,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -125,8 +125,8 @@ #define MXNS (MX*NS) #define AX ONE #define AY ONE -#define DX (AX/(realtype)(MX-1)) -#define DY (AY/(realtype)(MY-1)) +#define DX (AX/(sunrealtype)(MX-1)) +#define DY (AY/(sunrealtype)(MY-1)) #define MP NS #define MQ (MX*MY) #define MXMP (MX*MP) @@ -153,15 +153,15 @@ /* Structure for user data */ typedef struct { - realtype **P[NGRP]; + sunrealtype **P[NGRP]; sunindextype *pivot[NGRP]; int ns, mxns, mp, mq, mx, my, ngrp, ngx, ngy, mxmp; int jgx[NGX+1], jgy[NGY+1], jigx[MX], jigy[MY]; int jxr[NGX], jyr[NGY]; - realtype acoef[NS][NS], bcoef[NS], diff[NS]; - realtype cox[NS], coy[NS], dx, dy, srur; - realtype fsave[NEQ]; - realtype fBsave[NEQ]; + sunrealtype acoef[NS][NS], bcoef[NS], diff[NS]; + sunrealtype cox[NS], coy[NS], dx, dy, srur; + sunrealtype fsave[NEQ]; + sunrealtype fBsave[NEQ]; N_Vector rewt; N_Vector vtemp; void *cvode_mem; @@ -176,29 +176,29 @@ typedef struct { /* Prototypes for user-supplied functions */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(realtype t, N_Vector c, N_Vector fc, +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -static int PSolve(realtype t, N_Vector c, N_Vector fc, +static int PSolve(sunrealtype t, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); -static int fB(realtype t, N_Vector c, N_Vector cB, +static int fB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector cBdot, void *user_data); -static int PrecondB(realtype t, N_Vector c, +static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, realtype gamma, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolveB(realtype t, N_Vector c, +static int PSolveB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* Prototypes for private functions */ @@ -210,23 +210,23 @@ static void CInit(N_Vector c, WebData wdata); static void CbInit(N_Vector c, int is, WebData wdata); static void PrintOutput(N_Vector c, int ns, int mxns, WebData wdata); static void FreeUserData(WebData wdata); -static void WebRates(realtype x, realtype y, realtype t, realtype c[], realtype rate[], +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], sunrealtype rate[], WebData wdata); -static void WebRatesB(realtype x, realtype y, realtype t, realtype c[], realtype cB[], - realtype rate[], realtype rateB[], WebData wdata); -static void fblock (realtype t, realtype cdata[], int jx, int jy, realtype cdotdata[], +static void WebRatesB(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], sunrealtype cB[], + sunrealtype rate[], sunrealtype rateB[], WebData wdata); +static void fblock (sunrealtype t, sunrealtype cdata[], int jx, int jy, sunrealtype cdotdata[], WebData wdata); -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata); -static realtype doubleIntgr(N_Vector c, int i, WebData wdata); +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata); +static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata); static int check_retval(void *returnvalue, const char *funcname, int opt); /* Small Vector Kernels */ -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_sum_prods(realtype u[], realtype p[], realtype q[], realtype v[], - realtype w[], int n); -static void v_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_zero(realtype u[], int n); +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], sunrealtype v[], + sunrealtype w[], int n); +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_zero(sunrealtype u[], int n); /* SUNDIALS context */ static SUNContext sunctx; @@ -239,7 +239,7 @@ static SUNContext sunctx; int main(int argc, char *argv[]) { - realtype abstol=ATOL, reltol=RTOL, t; + sunrealtype abstol=ATOL, reltol=RTOL, t; N_Vector c; WebData wdata; void *cvode_mem; @@ -249,7 +249,7 @@ int main(int argc, char *argv[]) int indexB; - realtype reltolB=RTOL, abstolB=ATOL; + sunrealtype reltolB=RTOL, abstolB=ATOL; N_Vector cB; c = NULL; @@ -397,11 +397,11 @@ int main(int argc, char *argv[]) * and these are saved in fsave for use in preconditioning. */ -static int f(realtype t, N_Vector c, N_Vector cdot, void *user_data) +static int f(sunrealtype t, N_Vector c, N_Vector cdot, void *user_data) { int i, ic, ici, idxl, idxu, idyl, idyu, iyoff, jx, jy, ns, mxns; - realtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; - realtype *cdata, *cdotdata; + sunrealtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; + sunrealtype *cdata, *cdotdata; WebData wdata; wdata = (WebData) user_data; @@ -464,17 +464,17 @@ static int f(realtype t, N_Vector c, N_Vector cdot, void *user_data) * scheme. */ -static int Precond(realtype t, N_Vector c, N_Vector fc, +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data) + sunrealtype gamma, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int i, if0, if00, ig, igx, igy, j, jj, jx, jy; int *jxr, *jyr, ngrp, ngx, ngy, mxmp, mp, retval; sunindextype denseretval; - realtype uround, fac, r, r0, save, srur; - realtype *f1, *fsave, *cdata, *rewtdata; + sunrealtype uround, fac, r, r0, save, srur; + sunrealtype *f1, *fsave, *cdata, *rewtdata; WebData wdata; N_Vector rewt; @@ -557,12 +557,12 @@ static int Precond(realtype t, N_Vector c, N_Vector fc, * blocks in P, and pivot information in pivot, and returns the result in z. */ -static int PSolve(realtype t, N_Vector c, N_Vector fc, +static int PSolve(sunrealtype t, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int jx, jy, igx, igy, iv, ig, *jigx, *jigy, mx, my, ngx, mp; WebData wdata; @@ -607,12 +607,12 @@ static int PSolve(realtype t, N_Vector c, N_Vector fc, * interaction rates are computed by calls to WebRatesB. */ -static int fB(realtype t, N_Vector c, N_Vector cB, +static int fB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector cBdot, void *user_data) { int i, ic, ici, idxl, idxu, idyl, idyu, iyoff, jx, jy, ns, mxns; - realtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, *fBsave, dx, dy; - realtype *cdata, *cBdata, *cBdotdata; + sunrealtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, *fBsave, dx, dy; + sunrealtype *cdata, *cBdata, *cBdotdata; WebData wdata; wdata = (WebData) user_data; @@ -665,18 +665,18 @@ static int fB(realtype t, N_Vector c, N_Vector cB, * Preconditioner setup function for the backward problem */ -static int PrecondB(realtype t, N_Vector c, +static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, realtype gamma, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; sunindextype denseretval; int i, if0, if00, ig, igx, igy, j, jj, jx, jy; int *jxr, *jyr, ngrp, ngx, ngy, mxmp, mp, retval; - realtype uround, fac, r, r0, save, srur; - realtype *f1, *fsave, *cdata, *rewtdata; + sunrealtype uround, fac, r, r0, save, srur; + sunrealtype *f1, *fsave, *cdata, *rewtdata; void *cvode_mem; WebData wdata; N_Vector rewt; @@ -754,13 +754,13 @@ static int PrecondB(realtype t, N_Vector c, * Preconditioner solve function for the backward problem */ -static int PSolveB(realtype t, N_Vector c, +static int PSolveB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int jx, jy, igx, igy, iv, ig, *jigx, *jigy, mx, my, ngx, mp; WebData wdata; @@ -832,8 +832,8 @@ static WebData AllocUserData(void) static void InitUserData(WebData wdata) { int i, j, ns; - realtype *bcoef, *diff, *cox, *coy, dx, dy; - realtype (*acoef)[NS]; + sunrealtype *bcoef, *diff, *cox, *coy, dx, dy; + sunrealtype (*acoef)[NS]; acoef = wdata->acoef; bcoef = wdata->bcoef; @@ -917,7 +917,7 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]) static void CInit(N_Vector c, WebData wdata) { int i, ici, ioff, iyoff, jx, jy, ns, mxns; - realtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; + sunrealtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; cdata = N_VGetArrayPointer(c); ns = wdata->ns; @@ -950,9 +950,9 @@ static void CInit(N_Vector c, WebData wdata) static void CbInit(N_Vector c, int is, WebData wdata) { int i, ici, ioff, iyoff, jx, jy, ns, mxns; - realtype *cdata; + sunrealtype *cdata; - realtype gu[NS]; + sunrealtype gu[NS]; cdata = N_VGetArrayPointer(c); ns = wdata->ns; @@ -979,12 +979,12 @@ static void CbInit(N_Vector c, int is, WebData wdata) * and at time t. */ -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata) +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata) { int i, j, ns; - realtype fac, *bcoef; - realtype (*acoef)[NS]; + sunrealtype fac, *bcoef; + sunrealtype (*acoef)[NS]; ns = wdata->ns; acoef = wdata->acoef; @@ -1006,12 +1006,12 @@ static void WebRates(realtype x, realtype y, realtype t, realtype c[], * This routine computes the interaction rates for the backward problem */ -static void WebRatesB(realtype x, realtype y, realtype t, realtype c[], realtype cB[], - realtype rate[], realtype rateB[], WebData wdata) +static void WebRatesB(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], sunrealtype cB[], + sunrealtype rate[], sunrealtype rateB[], WebData wdata) { int i, j, ns; - realtype fac, *bcoef; - realtype (*acoef)[NS]; + sunrealtype fac, *bcoef; + sunrealtype (*acoef)[NS]; ns = wdata->ns; acoef = wdata->acoef; @@ -1042,11 +1042,11 @@ static void WebRatesB(realtype x, realtype y, realtype t, realtype c[], realtype * Here jx and jy count from 0. */ -static void fblock(realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata) +static void fblock(sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata) { int iblok, ic; - realtype x, y; + sunrealtype x, y; iblok = jx + jy*(wdata->mx); y = jy*(wdata->dy); @@ -1065,11 +1065,11 @@ static void fblock(realtype t, realtype cdata[], int jx, int jy, * vector kernels v_sum_prods, v_prod, v_inc_by_prod. */ -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) { int i, ic, iter, iyoff, jx, jy, ns, mxns, mx, my, x_loc, y_loc; - realtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; - realtype temp, *cox, *coy, *xd, *zd; + sunrealtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; + sunrealtype temp, *cox, *coy, *xd, *zd; xd = N_VGetArrayPointer(x); zd = N_VGetArrayPointer(z); @@ -1217,26 +1217,26 @@ static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) } } -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] += v[i]*w[i]; } -static void v_sum_prods(realtype u[], realtype p[], realtype q[], - realtype v[], realtype w[], int n) +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], + sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = p[i]*q[i] + v[i]*w[i]; } -static void v_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = v[i]*w[i]; } -static void v_zero(realtype u[], int n) +static void v_zero(sunrealtype u[], int n) { int i; for (i=0; i < n; i++) u[i] = ZERO; @@ -1249,7 +1249,7 @@ static void v_zero(realtype u[], int n) static void PrintOutput(N_Vector cB, int ns, int mxns, WebData wdata) { int i, jx, jy; - realtype *cdata, cij, cmax, x, y; + sunrealtype *cdata, cij, cmax, x, y; x = y = ZERO; @@ -1295,12 +1295,12 @@ static void PrintOutput(N_Vector cB, int ns, int mxns, WebData wdata) * Compute double space integral */ -static realtype doubleIntgr(N_Vector c, int i, WebData wdata) +static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) { - realtype *cdata; + sunrealtype *cdata; int ns, mx, my, mxns; - realtype dx, dy; - realtype intgr_xy, intgr_x; + sunrealtype dx, dy; + sunrealtype intgr_xy, intgr_x; int jx, jy; cdata = N_VGetArrayPointer(c); diff --git a/examples/cvodes/serial/cvsHessian_ASA_FSA.c b/examples/cvodes/serial/cvsHessian_ASA_FSA.c index 7328a96028..f99b62aad4 100644 --- a/examples/cvodes/serial/cvsHessian_ASA_FSA.c +++ b/examples/cvodes/serial/cvsHessian_ASA_FSA.c @@ -48,31 +48,31 @@ #define ONE RCONST(1.0) typedef struct { - realtype p1, p2; + sunrealtype p1, p2; } *UserData; -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data); -static int fS(int Ns, realtype t, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data); +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, N_Vector *yS, N_Vector *ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2); -static int fQS(int Ns, realtype t, +static int fQS(int Ns, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yQdot, N_Vector *yQSdot, void *user_data, N_Vector tmp, N_Vector tmpQ); -static int fB1(realtype t, N_Vector y, N_Vector *yS, +static int fB1(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int fQB1(realtype t, N_Vector y, N_Vector *yS, +static int fQB1(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector qBdot, void *user_dataB); -static int fB2(realtype t, N_Vector y, N_Vector *yS, +static int fB2(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int fQB2(realtype t, N_Vector y, N_Vector *yS, +static int fQB2(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector qBdot, void *user_dataB); int PrintFwdStats(void *cvode_mem); @@ -100,10 +100,10 @@ int main(int argc, char *argv[]) sunindextype Neq, Np2; int Np; - realtype t0, tf; + sunrealtype t0, tf; - realtype reltol; - realtype abstol, abstolQ, abstolB, abstolQB; + sunrealtype reltol; + sunrealtype abstol, abstolQ, abstolB, abstolQB; N_Vector y, yQ; N_Vector *yS, *yQS; @@ -114,12 +114,12 @@ int main(int argc, char *argv[]) int indexB1, indexB2; int retval; - realtype time; + sunrealtype time; - realtype dp; - realtype G, Gp, Gm; - realtype grdG_fwd[2], grdG_bck[2], grdG_cntr[2]; - realtype H11, H22; + sunrealtype dp; + sunrealtype G, Gp, Gm; + sunrealtype grdG_fwd[2], grdG_bck[2], grdG_cntr[2]; + sunrealtype H11, H22; data = NULL; y = yQ = NULL; @@ -631,11 +631,11 @@ int main(int argc, char *argv[]) */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3; + sunrealtype y1, y2, y3; UserData data; - realtype p1, p2; + sunrealtype p1, p2; data = (UserData) user_data; p1 = data->p1; @@ -652,9 +652,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) return(0); } -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data) { - realtype y1, y2, y3; + sunrealtype y1, y2, y3; y1 = Ith(y,1); y2 = Ith(y,2); @@ -665,17 +665,17 @@ static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) return(0); } -static int fS(int Ns, realtype t, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, N_Vector *yS, N_Vector *ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) { UserData data; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype fys1, fys2, fys3; - realtype p1, p2; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype fys1, fys2, fys3; + sunrealtype p1, p2; data = (UserData) user_data; p1 = data->p1; @@ -716,14 +716,14 @@ static int fS(int Ns, realtype t, return(0); } -static int fQS(int Ns, realtype t, +static int fQS(int Ns, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yQdot, N_Vector *yQSdot, void *user_data, N_Vector tmp, N_Vector tmpQ) { - realtype y1, y2, y3; - realtype s1, s2, s3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; y1 = Ith(y,1); y2 = Ith(y,2); @@ -750,15 +750,15 @@ static int fQS(int Ns, realtype t, return(0); } -static int fB1(realtype t, N_Vector y, N_Vector *yS, +static int fB1(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector yBdot, void *user_dataB) { UserData data; - realtype p1, p2; - realtype y1, y2, y3; /* solution */ - realtype s1, s2, s3; /* sensitivity 1 */ - realtype l1, l2, l3; /* lambda */ - realtype m1, m2, m3; /* mu */ + sunrealtype p1, p2; + sunrealtype y1, y2, y3; /* solution */ + sunrealtype s1, s2, s3; /* sensitivity 1 */ + sunrealtype l1, l2, l3; /* lambda */ + sunrealtype m1, m2, m3; /* mu */ data = (UserData) user_dataB; p1 = data->p1; @@ -792,15 +792,15 @@ static int fB1(realtype t, N_Vector y, N_Vector *yS, return(0); } -static int fQB1(realtype t, N_Vector y, N_Vector *yS, +static int fQB1(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector qBdot, void *user_dataB) { UserData data; - realtype p2; - realtype y1, y2, y3; /* solution */ - realtype s1, s2, s3; /* sensitivity 1 */ - realtype l1, l3; /* lambda */ - realtype m1, m3; /* mu */ + sunrealtype p2; + sunrealtype y1, y2, y3; /* solution */ + sunrealtype s1, s2, s3; /* sensitivity 1 */ + sunrealtype l1, l3; /* lambda */ + sunrealtype m1, m3; /* mu */ data = (UserData) user_dataB; @@ -832,15 +832,15 @@ static int fQB1(realtype t, N_Vector y, N_Vector *yS, -static int fB2(realtype t, N_Vector y, N_Vector *yS, +static int fB2(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector yBdot, void *user_dataB) { UserData data; - realtype p1, p2; - realtype y1, y2, y3; /* solution */ - realtype s1, s2, s3; /* sensitivity 2 */ - realtype l1, l2, l3; /* lambda */ - realtype m1, m2, m3; /* mu */ + sunrealtype p1, p2; + sunrealtype y1, y2, y3; /* solution */ + sunrealtype s1, s2, s3; /* sensitivity 2 */ + sunrealtype l1, l2, l3; /* lambda */ + sunrealtype m1, m2, m3; /* mu */ data = (UserData) user_dataB; p1 = data->p1; @@ -875,15 +875,15 @@ static int fB2(realtype t, N_Vector y, N_Vector *yS, } -static int fQB2(realtype t, N_Vector y, N_Vector *yS, +static int fQB2(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector qBdot, void *user_dataB) { UserData data; - realtype p2; - realtype y1, y2, y3; /* solution */ - realtype s1, s2, s3; /* sensitivity 2 */ - realtype l1, l3; /* lambda */ - realtype m1, m3; /* mu */ + sunrealtype p2; + sunrealtype y1, y2, y3; /* solution */ + sunrealtype s1, s2, s3; /* sensitivity 2 */ + sunrealtype l1, l3; /* lambda */ + sunrealtype m1, m3; /* mu */ data = (UserData) user_dataB; @@ -927,7 +927,7 @@ int PrintFwdStats(void *cvode_mem) long int nfQSe, netfQS; int qlast, qcur; - realtype h0u, hlast, hcur, tcur; + sunrealtype h0u, hlast, hcur, tcur; int retval; @@ -974,7 +974,7 @@ int PrintBckStats(void *cvode_mem, int idx) long int nfQe, netfQ; int qlast, qcur; - realtype h0u, hlast, hcur, tcur; + sunrealtype h0u, hlast, hcur, tcur; int retval; diff --git a/examples/cvodes/serial/cvsKrylovDemo_ls.c b/examples/cvodes/serial/cvsKrylovDemo_ls.c index e76ccfa5dc..f0297ff11c 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_ls.c +++ b/examples/cvodes/serial/cvsKrylovDemo_ls.c @@ -52,7 +52,7 @@ #include /* access to Newton SUNNonlinearSolver */ #include /* serial N_Vector types, fct. and macros */ #include /* use generic DENSE solver in preconditioning */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -136,7 +136,7 @@ For each mesh point (j,k), the elements for species i and i+1 are contiguous within vdata. - IJth(a,i,j) references the (i,j)th entry of the matrix realtype **a, + IJth(a,i,j) references the (i,j)th entry of the matrix sunrealtype **a, where 1 <= i,j <= NUM_SPECIES. The small matrix routines in sundials_dense.h work with matrices stored by column in a 2-dimensional array. In C, arrays are indexed starting at 0, not 1. */ @@ -149,9 +149,9 @@ solution vector, and linsolver type */ typedef struct { - realtype **P[MX][MY], **Jbd[MX][MY]; + sunrealtype **P[MX][MY], **Jbd[MX][MY]; sunindextype *pivot[MX][MY]; - realtype q4, om, dx, dy, hdco, haco, vdco; + sunrealtype q4, om, dx, dy, hdco, haco, vdco; } *UserData; /* Private Helper Functions */ @@ -159,21 +159,21 @@ typedef struct { static UserData AllocUserData(void); static void InitUserData(UserData data); static void FreeUserData(UserData data); -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy); -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t); +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy); +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t); static void PrintFinalStats(void *cvode_mem, int linsolver); static int check_retval(void *returnvalue, const char *funcname, int opt); /* Functions Called by the Solver */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data); +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -185,7 +185,7 @@ static int PSolve(realtype tn, N_Vector u, N_Vector fu, int main(int argc, char* argv[]) { - realtype abstol, reltol, t, tout; + sunrealtype abstol, reltol, t, tout; N_Vector u; UserData data; SUNLinearSolver LS; @@ -193,7 +193,7 @@ int main(int argc, char* argv[]) void *cvode_mem; int linsolver, iout, retval; int nrmfactor; /* LS norm conversion factor flag */ - realtype nrmfac; /* LS norm conversion factor */ + sunrealtype nrmfac; /* LS norm conversion factor */ int monitor; /* LS resiudal monitoring flag */ SUNContext sunctx; SUNLogger logger; @@ -370,7 +370,7 @@ int main(int argc, char* argv[]) case(1): /* use the square root of the vector length */ - nrmfac = SQRT((realtype)NEQ); + nrmfac = SQRT((sunrealtype)NEQ); break; case(2): /* compute with dot product */ @@ -466,11 +466,11 @@ static void FreeUserData(UserData data) /* Set initial conditions in u */ -static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) +static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) { int jx, jy; - realtype x, y, cx, cy; - realtype *udata; + sunrealtype x, y, cx, cy; + sunrealtype *udata; /* Set pointer to data array in vector u. */ @@ -494,11 +494,11 @@ static void SetInitialProfiles(N_Vector u, realtype dx, realtype dy) /* Print current t, step count, order, stepsize, and sampled c1,c2 values */ -static void PrintOutput(void *cvode_mem, N_Vector u, realtype t) +static void PrintOutput(void *cvode_mem, N_Vector u, sunrealtype t) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; int mxh = MX/2 - 1, myh = MY/2 - 1, mx1 = MX - 1, my1 = MY - 1; udata = N_VGetArrayPointer(u); @@ -629,13 +629,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* f routine. Compute RHS function f(t,u). */ -static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) +static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) { - realtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; - realtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; - realtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; - realtype q4coef, dely, verdco, hordco, horaco; - realtype *udata, *dudata; + sunrealtype q3, c1, c2, c1dn, c2dn, c1up, c2up, c1lt, c2lt; + sunrealtype c1rt, c2rt, cydn, cyup, hord1, hord2, horad1, horad2; + sunrealtype qq1, qq2, qq3, qq4, rkin1, rkin2, s, vertd1, vertd2, ydn, yup; + sunrealtype q4coef, dely, verdco, hordco, horaco; + sunrealtype *udata, *dudata; int jx, jy, idn, iup, ileft, iright; UserData data; @@ -721,14 +721,14 @@ static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; - realtype **(*P)[MY], **(*Jbd)[MY]; + sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; + sunrealtype **(*P)[MY], **(*Jbd)[MY]; sunindextype *(*pivot)[MY], retval; int jx, jy; - realtype *udata, **a, **j; + sunrealtype *udata, **a, **j; UserData data; /* Make local copies of pointers in user_data, and of pointer to u's data */ @@ -808,15 +808,15 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, booleantype jok, /* Preconditioner solve routine */ -static int PSolve(realtype tn, N_Vector u, N_Vector fu, +static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype **(*P)[MY]; + sunrealtype **(*P)[MY]; sunindextype *(*pivot)[MY]; int jx, jy; - realtype *zdata, *v; + sunrealtype *zdata, *v; UserData data; /* Extract the P and pivot arrays from user_data. */ diff --git a/examples/cvodes/serial/cvsKrylovDemo_prec.c b/examples/cvodes/serial/cvsKrylovDemo_prec.c index 141bf79ecd..9d43d0e851 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_prec.c +++ b/examples/cvodes/serial/cvsKrylovDemo_prec.c @@ -105,7 +105,7 @@ #include /* access to SPGMR SUNLinearSolver */ #include /* serial N_Vector types, fct. and macros */ #include /* use generic DENSE solver in preconditioning */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -141,8 +141,8 @@ #define MXNS (MX*NS) #define AX ONE #define AY ONE -#define DX (AX/(realtype)(MX-1)) -#define DY (AY/(realtype)(MY-1)) +#define DX (AX/(sunrealtype)(MX-1)) +#define DY (AY/(sunrealtype)(MY-1)) #define MP NS #define MQ (MX*MY) #define MXMP (MX*MP) @@ -177,15 +177,15 @@ /* Structure for user data */ typedef struct { - realtype **P[NGRP]; + sunrealtype **P[NGRP]; sunindextype *pivot[NGRP]; int ns, mxns; int mp, mq, mx, my, ngrp, ngx, ngy, mxmp; int jgx[NGX+1], jgy[NGY+1], jigx[MX], jigy[MY]; int jxr[NGX], jyr[NGY]; - realtype acoef[NS][NS], bcoef[NS], diff[NS]; - realtype cox[NS], coy[NS], dx, dy, srur; - realtype fsave[NEQ]; + sunrealtype acoef[NS][NS], bcoef[NS], diff[NS]; + sunrealtype cox[NS], coy[NS], dx, dy, srur; + sunrealtype fsave[NEQ]; N_Vector tmp; N_Vector rewt; void *cvode_mem; @@ -199,33 +199,33 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]); static void CInit(N_Vector c, WebData wdata); static void PrintIntro(void); static void PrintHeader(int jpre, int gstype); -static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t); -static void PrintOutput(void *cvode_mem, realtype t); +static void PrintAllSpecies(N_Vector c, int ns, int mxns, sunrealtype t); +static void PrintOutput(void *cvode_mem, sunrealtype t); static void PrintFinalStats(void *cvode_mem); static void FreeUserData(WebData wdata); -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata); -static void fblock (realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata); -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata); +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata); +static void fblock (sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata); +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata); /* Small Vector Kernels */ -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_sum_prods(realtype u[], realtype p[], realtype q[], realtype v[], - realtype w[], int n); -static void v_prod(realtype u[], realtype v[], realtype w[], int n); -static void v_zero(realtype u[], int n); +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], sunrealtype v[], + sunrealtype w[], int n); +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n); +static void v_zero(sunrealtype u[], int n); /* Functions Called By The Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(realtype tn, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); -static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data); +static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data); /* Private function to check function return values */ @@ -238,7 +238,7 @@ static SUNContext sunctx; int main() { - realtype abstol=ATOL, reltol=RTOL, t, tout; + sunrealtype abstol=ATOL, reltol=RTOL, t, tout; N_Vector c; WebData wdata; SUNLinearSolver LS; @@ -369,8 +369,8 @@ static WebData AllocUserData(void) static void InitUserData(WebData wdata) { int i, j, ns; - realtype *bcoef, *diff, *cox, *coy, dx, dy; - realtype (*acoef)[NS]; + sunrealtype *bcoef, *diff, *cox, *coy, dx, dy; + sunrealtype (*acoef)[NS]; acoef = wdata->acoef; bcoef = wdata->bcoef; @@ -450,7 +450,7 @@ static void SetGroups(int m, int ng, int jg[], int jig[], int jr[]) static void CInit(N_Vector c, WebData wdata) { int jx, jy, ns, mxns, ioff, iyoff, i, ici; - realtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; + sunrealtype argx, argy, x, y, dx, dy, x_factor, y_factor, *cdata; cdata = N_VGetArrayPointer(c); ns = wdata->ns; @@ -539,10 +539,10 @@ static void PrintHeader(int jpre, int gstype) printf("\nGram-Schmidt method type is gstype = %s\n\n\n", "SUN_CLASSICAL_GS"); } -static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t) +static void PrintAllSpecies(N_Vector c, int ns, int mxns, sunrealtype t) { int i, jx ,jy; - realtype *cdata; + sunrealtype *cdata; cdata = N_VGetArrayPointer(c); #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -570,11 +570,11 @@ static void PrintAllSpecies(N_Vector c, int ns, int mxns, realtype t) } } -static void PrintOutput(void *cvode_mem, realtype t) +static void PrintOutput(void *cvode_mem, sunrealtype t) { long int nst, nfe, nni; int qu, retval; - realtype hu; + sunrealtype hu; retval = CVodeGetNumSteps(cvode_mem, &nst); check_retval(&retval, "CVodeGetNumSteps", 1); @@ -606,7 +606,7 @@ static void PrintFinalStats(void *cvode_mem) long int nst, nfe, nsetups, nni, ncfn, netf; long int nli, npe, nps, ncfl, nfeLS; int retval; - realtype avdim; + sunrealtype avdim; retval = CVodeGetWorkSpace(cvode_mem, &lenrw, &leniw); check_retval(&retval, "CVodeGetWorkSpace", 1); @@ -653,7 +653,7 @@ static void PrintFinalStats(void *cvode_mem) printf(" Number of error test failures = %4ld \n", netf); printf(" Number of nonlinear conv. failures = %4ld \n", ncfn); printf(" Number of linear convergence failures = %4ld \n", ncfl); - avdim = (nni > 0) ? ((realtype)nli)/((realtype)nni) : ZERO; + avdim = (nni > 0) ? ((sunrealtype)nli)/((sunrealtype)nni) : ZERO; #if defined(SUNDIALS_EXTENDED_PRECISION) printf(" Average Krylov subspace dimension = %.3Lf \n", avdim); #else @@ -684,11 +684,11 @@ static void FreeUserData(WebData wdata) returns it in cdot. The interaction rates are computed by calls to WebRates, and these are saved in fsave for use in preconditioning. */ -static int f(realtype t, N_Vector c, N_Vector cdot,void *user_data) +static int f(sunrealtype t, N_Vector c, N_Vector cdot,void *user_data) { int i, ic, ici, idxl, idxu, jx, ns, mxns, iyoff, jy, idyu, idyl; - realtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; - realtype *cdata, *cdotdata; + sunrealtype dcxli, dcxui, dcyli, dcyui, x, y, *cox, *coy, *fsave, dx, dy; + sunrealtype *cdata, *cdotdata; WebData wdata; wdata = (WebData) user_data; @@ -739,12 +739,12 @@ static int f(realtype t, N_Vector c, N_Vector cdot,void *user_data) c_1, ... ,c_ns (stored in c[0],...,c[ns-1]), at one spatial point and at time t. */ -static void WebRates(realtype x, realtype y, realtype t, realtype c[], - realtype rate[], WebData wdata) +static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[], + sunrealtype rate[], WebData wdata) { int i, j, ns; - realtype fac, *bcoef; - realtype (*acoef)[NS]; + sunrealtype fac, *bcoef; + sunrealtype (*acoef)[NS]; ns = wdata->ns; acoef = wdata->acoef; @@ -775,16 +775,16 @@ static void WebRates(realtype x, realtype y, realtype t, realtype c[], of a block-diagonal preconditioner. The blocks are of size mp, and there are ngrp=ngx*ngy blocks computed in the block-grouping scheme. */ -static int Precond(realtype t, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data) +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int i, if0, if00, ig, igx, igy, j, jj, jx, jy; int *jxr, *jyr, ngrp, ngx, ngy, mxmp, mp, retval; sunindextype denseretval; - realtype uround, fac, r, r0, save, srur; - realtype *f1, *fsave, *cdata, *rewtdata; + sunrealtype uround, fac, r, r0, save, srur; + sunrealtype *f1, *fsave, *cdata, *rewtdata; WebData wdata; void *cvode_mem; N_Vector rewt; @@ -862,11 +862,11 @@ static int Precond(realtype t, N_Vector c, N_Vector fc, booleantype jok, system, namely block (jx,jy), for use in preconditioning. Here jx and jy count from 0. */ -static void fblock(realtype t, realtype cdata[], int jx, int jy, - realtype cdotdata[], WebData wdata) +static void fblock(sunrealtype t, sunrealtype cdata[], int jx, int jy, + sunrealtype cdotdata[], WebData wdata) { int iblok, ic; - realtype x, y; + sunrealtype x, y; iblok = jx + jy*(wdata->mx); y = jy*(wdata->dy); @@ -885,10 +885,10 @@ static void fblock(realtype t, realtype cdata[], int jx, int jy, Then it computes ((I - gamma*Jr)-inverse)*z, using LU factors of the blocks in P, and pivot information in pivot, and returns the result in z. */ -static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, - realtype gamma, realtype delta, int lr, void *user_data) +static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, + sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { - realtype ***P; + sunrealtype ***P; sunindextype **pivot; int jx, jy, igx, igy, iv, ig, *jigx, *jigy, mx, my, ngx, mp; WebData wdata; @@ -935,12 +935,12 @@ static int PSolve(realtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, Some inner loops of length ns are implemented with the small vector kernels v_sum_prods, v_prod, v_inc_by_prod. */ -static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) +static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) { int jx, jy, mx, my, x_loc, y_loc; int ns, mxns, i, iyoff, ic, iter; - realtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; - realtype temp, *cox, *coy, *xd, *zd; + sunrealtype beta[NS], beta2[NS], cof1[NS], gam[NS], gam2[NS]; + sunrealtype temp, *cox, *coy, *xd, *zd; xd = N_VGetArrayPointer(x); zd = N_VGetArrayPointer(z); @@ -1106,26 +1106,26 @@ static void GSIter(realtype gamma, N_Vector z, N_Vector x, WebData wdata) } } -static void v_inc_by_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_inc_by_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] += v[i]*w[i]; } -static void v_sum_prods(realtype u[], realtype p[], realtype q[], - realtype v[], realtype w[], int n) +static void v_sum_prods(sunrealtype u[], sunrealtype p[], sunrealtype q[], + sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = p[i]*q[i] + v[i]*w[i]; } -static void v_prod(realtype u[], realtype v[], realtype w[], int n) +static void v_prod(sunrealtype u[], sunrealtype v[], sunrealtype w[], int n) { int i; for (i=0; i < n; i++) u[i] = v[i]*w[i]; } -static void v_zero(realtype u[], int n) +static void v_zero(sunrealtype u[], int n) { int i; for (i=0; i < n; i++) u[i] = ZERO; diff --git a/examples/cvodes/serial/cvsParticle_dns.c b/examples/cvodes/serial/cvsParticle_dns.c index 08b8573fb2..662af010a7 100644 --- a/examples/cvodes/serial/cvsParticle_dns.c +++ b/examples/cvodes/serial/cvsParticle_dns.c @@ -78,13 +78,13 @@ /* User-defined data structure */ typedef struct UserData_ { - realtype alpha; /* particle velocity */ + sunrealtype alpha; /* particle velocity */ int orbits; /* number of orbits */ - realtype torbit; /* orbit time */ + sunrealtype torbit; /* orbit time */ - realtype rtol; /* integration tolerances */ - realtype atol; + sunrealtype rtol; /* integration tolerances */ + sunrealtype atol; int proj; /* enable/disable solution projection */ int projerr; /* enable/disable error projection */ @@ -95,20 +95,20 @@ typedef struct UserData_ } *UserData; /* Functions provided to CVODES */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int Proj(realtype t, N_Vector ycur, N_Vector corr, realtype epsProj, +static int Proj(sunrealtype t, N_Vector ycur, N_Vector corr, sunrealtype epsProj, N_Vector err, void *user_data); /* Utility functions */ static int InitUserData(int *argc, char ***argv, UserData udata); static int PrintUserData(UserData udata); static void InputHelp(); -static int ComputeSolution(realtype t, N_Vector y, UserData udata); -static int ComputeError(realtype t, N_Vector y, N_Vector e, realtype *ec, +static int ComputeSolution(sunrealtype t, N_Vector y, UserData udata); +static int ComputeError(sunrealtype t, N_Vector y, N_Vector e, sunrealtype *ec, UserData udata); -static int WriteOutput(realtype t, N_Vector y, N_Vector e, realtype ec, +static int WriteOutput(sunrealtype t, N_Vector y, N_Vector e, sunrealtype ec, int screenfile, FILE *YFID, FILE *EFID); static int PrintStats(void *cvode_mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -123,16 +123,16 @@ int main(int argc, char* argv[]) int retval; /* reusable return flag */ int out = 0; /* output counter */ int totalout = 0; /* output counter */ - realtype t = ZERO; /* current integration time */ - realtype dtout = ZERO; /* output spacing */ - realtype tout = ZERO; /* next output time */ - realtype ec = ZERO; /* constraint error */ + sunrealtype t = ZERO; /* current integration time */ + sunrealtype dtout = ZERO; /* output spacing */ + sunrealtype tout = ZERO; /* next output time */ + sunrealtype ec = ZERO; /* constraint error */ UserData udata = NULL; /* user data structure */ SUNContext sunctx = NULL; /* SUNDIALS context */ void *cvode_mem = NULL; /* CVODES memory */ N_Vector y = NULL; /* solution vector */ - realtype *ydata = NULL; /* solution vector data */ + sunrealtype *ydata = NULL; /* solution vector data */ N_Vector e = NULL; /* error vector */ SUNMatrix A = NULL; /* Jacobian matrix */ SUNLinearSolver LS = NULL; /* linear solver */ @@ -312,11 +312,11 @@ int main(int argc, char* argv[]) /* Compute the right-hand side function, y' = f(t,y) */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { UserData udata = (UserData) user_data; - realtype *ydata = N_VGetArrayPointer(y); - realtype *fdata = N_VGetArrayPointer(ydot); + sunrealtype *ydata = N_VGetArrayPointer(y); + sunrealtype *fdata = N_VGetArrayPointer(ydot); fdata[0] = -(udata->alpha) * ydata[1]; fdata[1] = (udata->alpha) * ydata[0]; @@ -326,11 +326,11 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) /* Compute the Jacobian of the right-hand side function, J(t,y) = df/dy */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData udata = (UserData) user_data; - realtype *Jdata = SUNDenseMatrix_Data(J); + sunrealtype *Jdata = SUNDenseMatrix_Data(J); Jdata[0] = ZERO; Jdata[1] = -(udata->alpha); @@ -341,16 +341,16 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, } /* Project the solution onto the constraint manifold */ -static int Proj(realtype t, N_Vector ycur, N_Vector corr, realtype epsProj, +static int Proj(sunrealtype t, N_Vector ycur, N_Vector corr, sunrealtype epsProj, N_Vector err, void *user_data) { - realtype *ydata = N_VGetArrayPointer(ycur); - realtype *cdata = N_VGetArrayPointer(corr); - realtype *edata = NULL; - realtype x = ydata[0]; - realtype y = ydata[1]; - realtype xp, yp, r; - realtype errxp, erryp; + sunrealtype *ydata = N_VGetArrayPointer(ycur); + sunrealtype *cdata = N_VGetArrayPointer(corr); + sunrealtype *edata = NULL; + sunrealtype x = ydata[0]; + sunrealtype y = ydata[1]; + sunrealtype xp, yp, r; + sunrealtype errxp, erryp; /* project onto the unit circle */ r = SQRT(x * x + y * y); @@ -502,9 +502,9 @@ static void InputHelp() /* Compute the analytical solution */ -static int ComputeSolution(realtype t, N_Vector y, UserData udata) +static int ComputeSolution(sunrealtype t, N_Vector y, UserData udata) { - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); ydata[0] = COS((udata->alpha) * t); ydata[1] = SIN((udata->alpha) * t); @@ -514,10 +514,10 @@ static int ComputeSolution(realtype t, N_Vector y, UserData udata) /* Compute the error in the solution and constraint */ -static int ComputeError(realtype t, N_Vector y, N_Vector e, realtype *ec, +static int ComputeError(sunrealtype t, N_Vector y, N_Vector e, sunrealtype *ec, UserData udata) { - realtype *ydata = N_VGetArrayPointer(y); + sunrealtype *ydata = N_VGetArrayPointer(y); int retval; /* solution error */ @@ -532,11 +532,11 @@ static int ComputeError(realtype t, N_Vector y, N_Vector e, realtype *ec, } /* Output the solution to the screen or disk */ -static int WriteOutput(realtype t, N_Vector y, N_Vector e, realtype ec, +static int WriteOutput(sunrealtype t, N_Vector y, N_Vector e, sunrealtype ec, int screenfile, FILE* YFID, FILE* EFID) { - realtype *ydata = N_VGetArrayPointer(y); - realtype *edata = N_VGetArrayPointer(e); + sunrealtype *ydata = N_VGetArrayPointer(y); + sunrealtype *edata = N_VGetArrayPointer(e); if (screenfile == 0) { diff --git a/examples/cvodes/serial/cvsPendulum_dns.c b/examples/cvodes/serial/cvsPendulum_dns.c index ce7e5e60d9..dfd045b8e4 100644 --- a/examples/cvodes/serial/cvsPendulum_dns.c +++ b/examples/cvodes/serial/cvsPendulum_dns.c @@ -101,22 +101,22 @@ #define GRAV RCONST(13.750371636040745654980191559621114395801712) /* Functions provided to CVODES */ -static int fref(realtype t, N_Vector yy, N_Vector fy, void *f_data); +static int fref(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data); -static int f(realtype t, N_Vector yy, N_Vector fy, void *f_data); -static int proj(realtype t, N_Vector yy, N_Vector corr, - realtype epsProj, N_Vector err, void *pdata); +static int f(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data); +static int proj(sunrealtype t, N_Vector yy, N_Vector corr, + sunrealtype epsProj, N_Vector err, void *pdata); /* Functions to integrate the Cartesian and reference solutions */ -int GetSol(void *cvode_mem, N_Vector yy0, realtype rtol, realtype atol, - realtype tf, int nout, booleantype proj, booleantype projerr, +int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, + sunrealtype tf, int nout, booleantype proj, booleantype projerr, N_Vector yref); -int RefSol(realtype tf, N_Vector yref, int nout); +int RefSol(sunrealtype tf, N_Vector yref, int nout); /* Utility functions */ -static int ReadInputs(int *argc, char ***argv, realtype *rtol, realtype *atol, - realtype *tf, int *nout, booleantype *projerr); +static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, + sunrealtype *tf, int *nout, booleantype *projerr); static void InputHelp(); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -132,14 +132,14 @@ int main(int argc, char* argv[]) int i; int retval; /* reusable return flag */ int nout = 1; /* number of outputs */ - realtype rtol = RCONST(1.0e-5); /* base relative tolerance */ - realtype atol = RCONST(1.0e-5); /* base absolute tolerance */ - realtype tf = RCONST(30.0); /* final integration time */ + sunrealtype rtol = RCONST(1.0e-5); /* base relative tolerance */ + sunrealtype atol = RCONST(1.0e-5); /* base absolute tolerance */ + sunrealtype tf = RCONST(30.0); /* final integration time */ booleantype projerr = SUNTRUE; /* enable error projection */ void *cvode_mem = NULL; /* CVODES memory */ N_Vector yy0 = NULL; /* initial condition vector */ - realtype *yy0data = NULL; /* vector data */ + sunrealtype *yy0data = NULL; /* vector data */ N_Vector yref = NULL; /* reference solution vector */ SUNMatrix A = NULL; /* Jacobian matrix */ SUNLinearSolver LS = NULL; /* linear solver */ @@ -238,23 +238,23 @@ int main(int argc, char* argv[]) /* Compute the Cartesian system solution */ -int GetSol(void *cvode_mem, N_Vector yy0, realtype rtol, realtype atol, - realtype tf, int nout, booleantype proj, booleantype projerr, +int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, + sunrealtype tf, int nout, booleantype proj, booleantype projerr, N_Vector yref) { char outname[100]; /* output file name */ FILE *FID = NULL; /* output file */ N_Vector yy = NULL; /* solution vector */ - realtype *yydata = NULL; /* vector data */ + sunrealtype *yydata = NULL; /* vector data */ int retval; /* reusable return flag */ int out; /* output counter */ - realtype dtout; /* output frequency */ - realtype tout; /* output time */ - realtype t; /* return time */ - realtype x, y; /* position values */ - realtype xd, yd; /* velocity values */ - realtype g; /* constraint value */ + sunrealtype dtout; /* output frequency */ + sunrealtype tout; /* output time */ + sunrealtype t; /* return time */ + sunrealtype x, y; /* position values */ + sunrealtype xd, yd; /* velocity values */ + sunrealtype g; /* constraint value */ /* Integrator stats */ long int nst, nfe, nsetups, nje, nfeLS, ncfn, netf; @@ -417,22 +417,22 @@ int GetSol(void *cvode_mem, N_Vector yy0, realtype rtol, realtype atol, /* Compute the reference system solution */ -int RefSol(realtype tf, N_Vector yref, int nout) +int RefSol(sunrealtype tf, N_Vector yref, int nout) { FILE *FID = NULL; /* output file */ void *cvode_mem = NULL; /* CVODES memory */ N_Vector yy = NULL; /* solution vector */ - realtype *yydata = NULL; /* vector data */ + sunrealtype *yydata = NULL; /* vector data */ SUNMatrix A = NULL; /* Jacobian matrix */ SUNLinearSolver LS = NULL; /* linear solver */ int retval; /* reusable return flag */ int out; /* output counter */ - realtype dtout; /* output frequency */ - realtype tout; /* output time */ - realtype t; /* return time */ - realtype th, thd; /* theta and theta dot */ - realtype tol = RCONST(1.0e-14); /* integration tolerance */ + sunrealtype dtout; /* output frequency */ + sunrealtype tout; /* output time */ + sunrealtype t; /* return time */ + sunrealtype th, thd; /* theta and theta dot */ + sunrealtype tol = RCONST(1.0e-14); /* integration tolerance */ /* Create the solution vector */ yy = N_VNew_Serial(2, sunctx); @@ -564,10 +564,10 @@ int RefSol(realtype tf, N_Vector yref, int nout) /* ODE RHS function for the reference system */ -static int fref(realtype t, N_Vector yy, N_Vector fy, void *f_data) +static int fref(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data) { - realtype *yydata = NULL; /* yy vector data */ - realtype *fydata = NULL; /* fy vector data */ + sunrealtype *yydata = NULL; /* yy vector data */ + sunrealtype *fydata = NULL; /* fy vector data */ /* Get vector array pointers */ yydata = N_VGetArrayPointer(yy); @@ -580,14 +580,14 @@ static int fref(realtype t, N_Vector yy, N_Vector fy, void *f_data) /* ODE RHS function for the Cartesian system */ -static int f(realtype t, N_Vector yy, N_Vector fy, void *f_data) +static int f(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data) { - realtype *yydata = NULL; /* yy vector data */ - realtype *fydata = NULL; /* fy vector data */ + sunrealtype *yydata = NULL; /* yy vector data */ + sunrealtype *fydata = NULL; /* fy vector data */ - realtype x, y; /* positions */ - realtype xd, yd; /* velocities */ - realtype tmp; + sunrealtype x, y; /* positions */ + sunrealtype xd, yd; /* velocities */ + sunrealtype tmp; /* Get vector array pointers */ yydata = N_VGetArrayPointer(yy); @@ -613,19 +613,19 @@ static int f(realtype t, N_Vector yy, N_Vector fy, void *f_data) /* Projection function */ -static int proj(realtype t, N_Vector yy, N_Vector corr, - realtype epsProj, N_Vector err, void *pdata) +static int proj(sunrealtype t, N_Vector yy, N_Vector corr, + sunrealtype epsProj, N_Vector err, void *pdata) { - realtype *yydata = NULL; /* yy vector data */ - realtype *cdata = NULL; /* corr vector data */ - realtype *edata = NULL; /* err vector data */ + sunrealtype *yydata = NULL; /* yy vector data */ + sunrealtype *cdata = NULL; /* corr vector data */ + sunrealtype *edata = NULL; /* err vector data */ - realtype x, y, x_new, y_new; /* positions */ - realtype xd, yd, xd_new, yd_new; /* velocities */ + sunrealtype x, y, x_new, y_new; /* positions */ + sunrealtype xd, yd, xd_new, yd_new; /* velocities */ - realtype e1, e2, e3, e4; - realtype e1_new, e2_new, e3_new, e4_new; - realtype R; + sunrealtype e1, e2, e3, e4; + sunrealtype e1_new, e2_new, e3_new, e4_new; + sunrealtype R; /* Get vector array pointers */ @@ -697,8 +697,8 @@ static int proj(realtype t, N_Vector yy, N_Vector corr, /* Read command line unputs */ -static int ReadInputs(int *argc, char ***argv, realtype *rtol, realtype *atol, - realtype *tf, int *nout, booleantype *projerr) +static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, + sunrealtype *tf, int *nout, booleantype *projerr) { int arg_idx = 1; diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns.c index 232ff1e0af..6fd4f98e03 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns.c @@ -59,7 +59,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -97,30 +97,30 @@ /* Type : UserData */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* Prototypes of user-supplied functions */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data); +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data); static int ewt(N_Vector y, N_Vector w, void *user_data); -static int fB(realtype t, N_Vector y, +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB); /* Prototypes of private functions */ -static void PrintHead(realtype tB0); -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB); +static void PrintHead(sunrealtype tB0); +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -139,17 +139,17 @@ int main(int argc, char *argv[]) void *cvode_mem; FILE* FID; - realtype reltolQ, abstolQ; + sunrealtype reltolQ, abstolQ; N_Vector y, q; int steps; int indexB; - realtype reltolB, abstolB, abstolQB; + sunrealtype reltolB, abstolB, abstolQB; N_Vector yB, qB; - realtype time; + sunrealtype time; int retval, ncheck; CVadjCheckPointRec *ckpnt; @@ -542,11 +542,11 @@ int main(int argc, char *argv[]) * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -563,12 +563,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -585,7 +585,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fQ routine. Compute fQ(t,y). */ -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(y,3); @@ -599,7 +599,7 @@ static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -620,13 +620,13 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) * fB routine. Compute fB(t,y,yB). */ -static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3; - realtype l21, l32; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32; data = (UserData) user_dataB; @@ -655,12 +655,12 @@ static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_da * JacB routine. Compute JB(t,y,yB). */ -static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; data = (UserData) user_dataB; @@ -682,12 +682,12 @@ static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, * fQB routine. Compute integrand for quadratures */ -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2, l3; - realtype l21, l32, y23; + sunrealtype y1, y2, y3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32, y23; /* The y vector */ y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -717,7 +717,7 @@ static int fQB(realtype t, N_Vector y, N_Vector yB, * Print heading for backward integration */ -static void PrintHead(realtype tB0) +static void PrintHead(sunrealtype tB0) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("Backward integration from tB0 = %12.4Le\n\n",tB0); @@ -732,7 +732,7 @@ static void PrintHead(realtype tB0) * Print intermediate results during backward integration */ -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -764,7 +764,7 @@ static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) * Print final results of backward integration */ -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c index 21538d367d..8bd88256bc 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c @@ -61,7 +61,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -99,30 +99,30 @@ /* Type : UserData */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* Prototypes of user-supplied functions */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data); +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data); static int ewt(N_Vector y, N_Vector w, void *user_data); -static int fB(realtype t, N_Vector y, +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB); /* Prototypes of private functions */ -static void PrintHead(realtype tB0); -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB); +static void PrintHead(sunrealtype tB0); +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -141,17 +141,17 @@ int main(int argc, char *argv[]) SUNLinearSolver LS, LSB; void *cvode_mem; - realtype reltolQ, abstolQ; + sunrealtype reltolQ, abstolQ; N_Vector y, q, constraints; int steps; int indexB; - realtype reltolB, abstolB, abstolQB; + sunrealtype reltolB, abstolB, abstolQB; N_Vector yB, qB, constraintsB; - realtype time; + sunrealtype time; int retval, ncheck; long int nst, nstB; @@ -540,11 +540,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -561,12 +561,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -583,7 +583,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fQ routine. Compute fQ(t,y). */ -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(y,3); @@ -597,7 +597,7 @@ static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -618,13 +618,13 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) * fB routine. Compute fB(t,y,yB). */ -static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3; - realtype l21, l32; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32; data = (UserData) user_dataB; @@ -653,12 +653,12 @@ static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_da * JacB routine. Compute JB(t,y,yB). */ -static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; data = (UserData) user_dataB; @@ -680,12 +680,12 @@ static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, * fQB routine. Compute integrand for quadratures */ -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2, l3; - realtype l21, l32, y23; + sunrealtype y1, y2, y3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32, y23; /* The y vector */ y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -715,7 +715,7 @@ static int fQB(realtype t, N_Vector y, N_Vector yB, * Print heading for backward integration */ -static void PrintHead(realtype tB0) +static void PrintHead(sunrealtype tB0) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("Backward integration from tB0 = %12.4Le\n\n",tB0); @@ -730,7 +730,7 @@ static void PrintHead(realtype tB0) * Print intermediate results during backward integration */ -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -762,7 +762,7 @@ static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) * Print final results of backward integration */ -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_klu.c b/examples/cvodes/serial/cvsRoberts_ASAi_klu.c index 2ca8508d1d..78490ea231 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_klu.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_klu.c @@ -60,7 +60,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -99,30 +99,30 @@ /* Type : UserData */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* Prototypes of user-supplied functions */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data); +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data); static int ewt(N_Vector y, N_Vector w, void *user_data); -static int fB(realtype t, N_Vector y, +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB); /* Prototypes of private functions */ -static void PrintHead(realtype tB0); -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB); +static void PrintHead(sunrealtype tB0); +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -140,17 +140,17 @@ int main(int argc, char *argv[]) SUNLinearSolver LS, LSB; void *cvode_mem; - realtype reltolQ, abstolQ; + sunrealtype reltolQ, abstolQ; N_Vector y, q; int steps; int indexB; - realtype reltolB, abstolB, abstolQB; + sunrealtype reltolB, abstolB, abstolQB; N_Vector yB, qB; - realtype time; + sunrealtype time; int retval, nnz, ncheck; long int nst, nstB; @@ -524,11 +524,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -545,15 +545,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yval = N_VGetArrayPointer(y); @@ -595,7 +595,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fQ routine. Compute fQ(t,y). */ -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(y,3); @@ -609,7 +609,7 @@ static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -630,13 +630,13 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) * fB routine. Compute fB(t,y,yB). */ -static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3; - realtype l21, l32; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32; data = (UserData) user_dataB; @@ -665,17 +665,17 @@ static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_da * JacB routine. Compute JB(t,y,yB). */ -static int JacB(realtype t, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { - realtype *yvalB; + sunrealtype *yvalB; sunindextype *colptrsB = SUNSparseMatrix_IndexPointers(JB); sunindextype *rowvalsB = SUNSparseMatrix_IndexValues(JB); - realtype *dataB = SUNSparseMatrix_Data(JB); + sunrealtype *dataB = SUNSparseMatrix_Data(JB); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yvalB = N_VGetArrayPointer(y); @@ -717,12 +717,12 @@ static int JacB(realtype t, * fQB routine. Compute integrand for quadratures */ -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2, l3; - realtype l21, l32, y23; + sunrealtype y1, y2, y3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32, y23; /* The y vector */ y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -752,7 +752,7 @@ static int fQB(realtype t, N_Vector y, N_Vector yB, * Print heading for backward integration */ -static void PrintHead(realtype tB0) +static void PrintHead(sunrealtype tB0) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("Backward integration from tB0 = %12.4Le\n\n",tB0); @@ -767,7 +767,7 @@ static void PrintHead(realtype tB0) * Print intermediate results during backward integration */ -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -799,7 +799,7 @@ static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) * Print final results of backward integration */ -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_sps.c b/examples/cvodes/serial/cvsRoberts_ASAi_sps.c index cc7c943b77..d1bd551fc2 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_sps.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_sps.c @@ -60,7 +60,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLUMT SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -99,30 +99,30 @@ /* Type : UserData */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* Prototypes of user-supplied functions */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data); +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data); static int ewt(N_Vector y, N_Vector w, void *user_data); -static int fB(realtype t, N_Vector y, +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB); -static int JacB(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB); /* Prototypes of private functions */ -static void PrintHead(realtype tB0); -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB); +static void PrintHead(sunrealtype tB0); +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB); +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -140,17 +140,17 @@ int main(int argc, char *argv[]) SUNLinearSolver LS, LSB; void *cvode_mem; - realtype reltolQ, abstolQ; + sunrealtype reltolQ, abstolQ; N_Vector y, q; int steps; int indexB; - realtype reltolB, abstolB, abstolQB; + sunrealtype reltolB, abstolB, abstolQB; N_Vector yB, qB; - realtype time; + sunrealtype time; int retval, nthreads, nnz, ncheck; long int nst, nstB; @@ -525,11 +525,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -546,15 +546,15 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yval = N_VGetArrayPointer(y); @@ -596,7 +596,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fQ routine. Compute fQ(t,y). */ -static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) +static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(y,3); @@ -610,7 +610,7 @@ static int fQ(realtype t, N_Vector y, N_Vector qdot, void *user_data) static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -631,13 +631,13 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) * fB routine. Compute fB(t,y,yB). */ -static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) +static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3; - realtype l21, l32; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32; data = (UserData) user_dataB; @@ -666,17 +666,17 @@ static int fB(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_da * JacB routine. Compute JB(t,y,yB). */ -static int JacB(realtype t, +static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { - realtype *yvalB; + sunrealtype *yvalB; sunindextype *colptrsB = SUNSparseMatrix_IndexPointers(JB); sunindextype *rowvalsB = SUNSparseMatrix_IndexValues(JB); - realtype *dataB = SUNSparseMatrix_Data(JB); + sunrealtype *dataB = SUNSparseMatrix_Data(JB); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yvalB = N_VGetArrayPointer(y); @@ -718,12 +718,12 @@ static int JacB(realtype t, * fQB routine. Compute integrand for quadratures */ -static int fQB(realtype t, N_Vector y, N_Vector yB, +static int fQB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2, l3; - realtype l21, l32, y23; + sunrealtype y1, y2, y3; + sunrealtype l1, l2, l3; + sunrealtype l21, l32, y23; /* The y vector */ y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -753,7 +753,7 @@ static int fQB(realtype t, N_Vector y, N_Vector yB, * Print heading for backward integration */ -static void PrintHead(realtype tB0) +static void PrintHead(sunrealtype tB0) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("Backward integration from tB0 = %12.4Le\n\n",tB0); @@ -768,7 +768,7 @@ static void PrintHead(realtype tB0) * Print intermediate results during backward integration */ -static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) +static void PrintOutput1(sunrealtype time, sunrealtype t, N_Vector y, N_Vector yB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -800,7 +800,7 @@ static void PrintOutput1(realtype time, realtype t, N_Vector y, N_Vector yB) * Print final results of backward integration */ -static void PrintOutput(realtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) +static void PrintOutput(sunrealtype tfinal, N_Vector y, N_Vector yB, N_Vector qB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns.c b/examples/cvodes/serial/cvsRoberts_FSA_dns.c index be09dedeab..c8338e5985 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns.c @@ -112,17 +112,17 @@ /* Type : UserData */ typedef struct { - realtype p[3]; /* problem parameters */ + sunrealtype p[3]; /* problem parameters */ } *UserData; /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2); @@ -130,7 +130,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data); /* Private functions to output results */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u); +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u); static void PrintOutputS(N_Vector *uS); /* Prototypes of private functions */ @@ -155,7 +155,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; SUNMatrix A; SUNLinearSolver LS; @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) FILE* FID; char fname[256]; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; N_Vector *yS; booleantype sensi, err_con; @@ -371,11 +371,11 @@ int main(int argc, char *argv[]) * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -392,12 +392,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -414,15 +414,15 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fS routine. Compute sensitivity r.h.s. */ -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2, sd3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2, sd3; data = (UserData) user_data; p1 = data->p[0]; p2 = data->p[1]; p3 = data->p[2]; @@ -463,7 +463,7 @@ static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -543,11 +543,11 @@ static void WrongArgs(char *name) * Print current t, step count, order, stepsize, and solution. */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; udata = N_VGetArrayPointer(u); @@ -584,7 +584,7 @@ static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) static void PrintOutputS(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); printf(" Sensitivity 1 "); diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c index c8f4c4e437..d0ff20ead6 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c @@ -35,7 +35,7 @@ #include /* access to serial NVector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -61,22 +61,22 @@ typedef struct { booleantype errconS; /* full (T) or partial error control (F) */ booleantype fsDQ; /* user provided r.h.s sensitivity analysis (T/F) */ int meth; /* sensitivity method */ - realtype p[3]; /* sensitivity variables */ + sunrealtype p[3]; /* sensitivity variables */ } *UserData; /* User provided routine called by the solver to compute * the function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *udata); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *udata); /* User provided routine called by the solver to * approximate the Jacobian J(t,y). */ -static int Jac(realtype t, N_Vector y, N_Vector fy, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *udata, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* User provided routine called by the solver to compute * r.h.s. sensititivy. */ -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *udata, N_Vector tmp1, N_Vector tmp2); @@ -98,11 +98,11 @@ int main(int argc, char *argv[]) UserData data; void *cvode_mem; - realtype reltol; + sunrealtype reltol; N_Vector y0, y, abstol; int Ns; - realtype *pbar; + sunrealtype *pbar; int is, *plist, retval; N_Vector *yS0, *yS; @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) Ns = 3; - pbar = (realtype *) malloc(Ns * sizeof(realtype)); + pbar = (sunrealtype *) malloc(Ns * sizeof(sunrealtype)); pbar[0] = data->p[0]; pbar[1] = data->p[1]; pbar[2] = data->p[2]; @@ -341,7 +341,7 @@ int main(int argc, char *argv[]) static int runCVode(void *cvode_mem, N_Vector y, N_Vector *yS, UserData data) { - realtype t; + sunrealtype t; int retval; /* Print header for current run */ @@ -369,11 +369,11 @@ static int runCVode(void *cvode_mem, N_Vector y, N_Vector *yS, UserData data) * f routine. Compute f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *udata) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *udata) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = NV_Ith_S(y,0); y2 = NV_Ith_S(y,1); y3 = NV_Ith_S(y,2); data = (UserData) udata; @@ -391,13 +391,13 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *udata) * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, N_Vector y, N_Vector fy, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *udata, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y2 = NV_Ith_S(y,1); y3 = NV_Ith_S(y,2); data = (UserData) udata; @@ -414,15 +414,15 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, * fS routine. Compute sensitivity r.h.s. */ -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *udata, N_Vector tmp1, N_Vector tmp2) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2, sd3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2, sd3; data = (UserData) udata; p1 = data->p[0]; p2 = data->p[1]; p3 = data->p[2]; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c index eb0d685996..6f7e805adb 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c @@ -60,7 +60,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* definition of ABS */ /* User-defined vector and matrix accessor macros: Ith, IJth */ @@ -105,17 +105,17 @@ /* Type : UserData */ typedef struct { - realtype p[3]; /* problem parameters */ + sunrealtype p[3]; /* problem parameters */ } *UserData; /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2); @@ -123,7 +123,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data); /* Private functions to output results */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u); +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u); static void PrintOutputS(N_Vector *uS); /* Private function to print final statistics */ @@ -150,7 +150,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector constraints; SUNMatrix A; @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) int retval, iout; UserData data; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; N_Vector *yS; booleantype sensi, err_con; @@ -355,11 +355,11 @@ int main(int argc, char *argv[]) * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -376,12 +376,12 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -398,15 +398,15 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fS routine. Compute sensitivity r.h.s. */ -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2, sd3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2, sd3; data = (UserData) user_data; p1 = data->p[0]; p2 = data->p[1]; p3 = data->p[2]; @@ -447,7 +447,7 @@ static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -527,11 +527,11 @@ static void WrongArgs(char *name) * Print current t, step count, order, stepsize, and solution. */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; udata = N_VGetArrayPointer(u); @@ -568,7 +568,7 @@ static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) static void PrintOutputS(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); printf(" Sensitivity 1 "); diff --git a/examples/cvodes/serial/cvsRoberts_FSA_klu.c b/examples/cvodes/serial/cvsRoberts_FSA_klu.c index 831713053c..9133bb7a24 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_klu.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_klu.c @@ -58,7 +58,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU sparse direct solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* User-defined vector accessor macro: Ith */ @@ -98,17 +98,17 @@ /* Type : UserData */ typedef struct { - realtype p[3]; /* problem parameters */ + sunrealtype p[3]; /* problem parameters */ } *UserData; /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2); @@ -116,7 +116,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data); /* Private functions to output results */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u); +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u); static void PrintOutputS(N_Vector *uS); /* Private function to print final statistics */ @@ -143,7 +143,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; SUNMatrix A; SUNLinearSolver LS; @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) int retval, iout; UserData data; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; N_Vector *yS; booleantype sensi, err_con; @@ -333,11 +333,11 @@ int main(int argc, char *argv[]) * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -354,24 +354,24 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* State at which to evaluate the Jacobian */ - realtype *yval = N_VGetArrayPointer(y); + sunrealtype *yval = N_VGetArrayPointer(y); /* J is stored in CSC format: data = non-zero matrix entries stored column-wise (length NNZ) rowvals = row index for each non-zero matrix entry (length NNZ) colptrs = i-th entry is the index in data where the first non-zero matrix entry of the i-th column is stored (length NEQ + 1) */ - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); UserData userdata = (UserData) user_data; - realtype p1 = userdata->p[0]; - realtype p2 = userdata->p[1]; - realtype p3 = userdata->p[2]; + sunrealtype p1 = userdata->p[0]; + sunrealtype p2 = userdata->p[1]; + sunrealtype p3 = userdata->p[2]; /* first column entries start at data[0], two entries (rows 0 and 1) */ colptrs[0] = 0; @@ -413,15 +413,15 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fS routine. Compute sensitivity r.h.s. */ -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2, sd3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2, sd3; data = (UserData) user_data; p1 = data->p[0]; p2 = data->p[1]; p3 = data->p[2]; @@ -462,7 +462,7 @@ static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -542,11 +542,11 @@ static void WrongArgs(char *name) * Print current t, step count, order, stepsize, and solution. */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; udata = N_VGetArrayPointer(u); @@ -583,7 +583,7 @@ static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) static void PrintOutputS(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); printf(" Sensitivity 1 "); diff --git a/examples/cvodes/serial/cvsRoberts_FSA_sps.c b/examples/cvodes/serial/cvsRoberts_FSA_sps.c index 265bf0149b..76a9f96577 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_sps.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_sps.c @@ -58,7 +58,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLUMT linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* User-defined vector accessor macro: Ith */ @@ -98,17 +98,17 @@ /* Type : UserData */ typedef struct { - realtype p[3]; /* problem parameters */ + sunrealtype p[3]; /* problem parameters */ } *UserData; /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2); @@ -116,7 +116,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data); /* Private functions to output results */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u); +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u); static void PrintOutputS(N_Vector *uS); /* Private function to print final statistics */ @@ -143,7 +143,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; SUNMatrix A; SUNLinearSolver LS; @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) int retval, iout; UserData data; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; N_Vector *yS; booleantype sensi, err_con; @@ -333,11 +333,11 @@ int main(int argc, char *argv[]) * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); data = (UserData) user_data; @@ -354,24 +354,24 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* State at which to evaluate the Jacobian */ - realtype *yval = N_VGetArrayPointer(y); + sunrealtype *yval = N_VGetArrayPointer(y); /* J is stored in CSC format: data = non-zero matrix entries stored column-wise (length NNZ) rowvals = row index for each non-zero matrix entry (length NNZ) colptrs = i-th entry is the index in data where the first non-zero matrix entry of the i-th column is stored (length NEQ + 1) */ - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); UserData userdata = (UserData) user_data; - realtype p1 = userdata->p[0]; - realtype p2 = userdata->p[1]; - realtype p3 = userdata->p[2]; + sunrealtype p1 = userdata->p[0]; + sunrealtype p2 = userdata->p[1]; + sunrealtype p3 = userdata->p[2]; /* first column entries start at data[0], two entries (rows 0 and 1) */ colptrs[0] = 0; @@ -413,15 +413,15 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, * fS routine. Compute sensitivity r.h.s. */ -static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, +static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2, sd3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2, sd3; data = (UserData) user_data; p1 = data->p[0]; p2 = data->p[1]; p3 = data->p[2]; @@ -462,7 +462,7 @@ static int fS(int Ns, realtype t, N_Vector y, N_Vector ydot, static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -542,11 +542,11 @@ static void WrongArgs(char *name) * Print current t, step count, order, stepsize, and solution. */ -static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) +static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; udata = N_VGetArrayPointer(u); @@ -583,7 +583,7 @@ static void PrintOutput(void *cvode_mem, realtype t, N_Vector u) static void PrintOutputS(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); printf(" Sensitivity 1 "); diff --git a/examples/cvodes/serial/cvsRoberts_dns.c b/examples/cvodes/serial/cvsRoberts_dns.c index 08372267da..813fd9fe89 100644 --- a/examples/cvodes/serial/cvsRoberts_dns.c +++ b/examples/cvodes/serial/cvsRoberts_dns.c @@ -87,16 +87,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to check function return values */ @@ -105,7 +105,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol); /* @@ -117,7 +117,7 @@ static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -250,9 +250,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -267,9 +267,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -282,10 +282,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -310,7 +310,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); @@ -369,13 +369,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* compare the solution at the final time 4e10s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ - realtype ONE=RCONST(1.0); + sunrealtype err; /* wrms error */ + sunrealtype ONE=RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/cvodes/serial/cvsRoberts_dnsL.c b/examples/cvodes/serial/cvsRoberts_dnsL.c index 0ae7f8e327..6efec0961a 100644 --- a/examples/cvodes/serial/cvsRoberts_dnsL.c +++ b/examples/cvodes/serial/cvsRoberts_dnsL.c @@ -76,16 +76,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -106,7 +106,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -228,9 +228,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -245,9 +245,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -260,10 +260,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -288,7 +288,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvodes/serial/cvsRoberts_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_dns_constraints.c index 2bd6a1843a..3ad73755b1 100644 --- a/examples/cvodes/serial/cvsRoberts_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_dns_constraints.c @@ -90,16 +90,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -112,7 +112,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol); /* @@ -124,7 +124,7 @@ static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; N_Vector constraints; @@ -262,9 +262,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -279,9 +279,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -294,10 +294,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -322,7 +322,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); @@ -420,12 +420,12 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* compare the solution at the final time 4e10s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail=0; /* answer pass (0) or fail (1) flag */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ + sunrealtype err; /* wrms error */ /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/cvodes/serial/cvsRoberts_dns_uw.c b/examples/cvodes/serial/cvsRoberts_dns_uw.c index 6efbba95cd..52f642e2e1 100644 --- a/examples/cvodes/serial/cvsRoberts_dns_uw.c +++ b/examples/cvodes/serial/cvsRoberts_dns_uw.c @@ -89,18 +89,18 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); static int ewt(N_Vector y, N_Vector w, void *user_data); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -121,7 +121,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; SUNMatrix A; SUNLinearSolver LS; @@ -231,9 +231,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -248,9 +248,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -263,10 +263,10 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; y2 = Ith(y,2); y3 = Ith(y,3); @@ -292,7 +292,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -315,7 +315,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvodes/serial/cvsRoberts_klu.c b/examples/cvodes/serial/cvsRoberts_klu.c index 4027ed13fc..614fafac9b 100644 --- a/examples/cvodes/serial/cvsRoberts_klu.c +++ b/examples/cvodes/serial/cvsRoberts_klu.c @@ -73,16 +73,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -103,7 +103,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -225,9 +225,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -242,9 +242,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -257,18 +257,18 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* State at which to evaluate the Jacobian */ - realtype *yval = N_VGetArrayPointer(y); + sunrealtype *yval = N_VGetArrayPointer(y); /* J is stored in CSC format: data = non-zero matrix entries stored column-wise (length NNZ) rowvals = row index for each non-zero matrix entry (length NNZ) colptrs = i-th entry is the index in data where the first non-zero matrix entry of the i-th column is stored (length NEQ + 1) */ - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); @@ -314,7 +314,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/cvodes/serial/cvsRoberts_sps.c b/examples/cvodes/serial/cvsRoberts_sps.c index e36a57638c..6e9a5ba1fc 100644 --- a/examples/cvodes/serial/cvsRoberts_sps.c +++ b/examples/cvodes/serial/cvsRoberts_sps.c @@ -73,16 +73,16 @@ /* Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int g(realtype t, N_Vector y, realtype *gout, void *user_data); +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private functions to output results */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3); +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3); static void PrintRootInfo(int root_f1, int root_f2); /* Private function to print final statistics */ @@ -103,7 +103,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype t, tout; + sunrealtype t, tout; N_Vector y; N_Vector abstol; SUNMatrix A; @@ -225,9 +225,9 @@ int main() * f routine. Compute function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype y1, y2, y3, yd1, yd3; + sunrealtype y1, y2, y3, yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); @@ -242,9 +242,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * g routine. Compute functions g_i(t,y) for i = 0,1. */ -static int g(realtype t, N_Vector y, realtype *gout, void *user_data) +static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) { - realtype y1, y3; + sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); gout[0] = y1 - RCONST(0.0001); @@ -257,18 +257,18 @@ static int g(realtype t, N_Vector y, realtype *gout, void *user_data) * Jacobian routine. Compute J(t,y) = df/dy. * */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { /* State at which to evaluate the Jacobian */ - realtype *yval = N_VGetArrayPointer(y); + sunrealtype *yval = N_VGetArrayPointer(y); /* J is stored in CSC format: data = non-zero matrix entries stored column-wise (length NNZ) rowvals = row index for each non-zero matrix entry (length NNZ) colptrs = i-th entry is the index in data where the first non-zero matrix entry of the i-th column is stored (length NEQ + 1) */ - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); @@ -314,7 +314,7 @@ static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, *------------------------------- */ -static void PrintOutput(realtype t, realtype y1, realtype y2, realtype y3) +static void PrintOutput(sunrealtype t, sunrealtype y1, sunrealtype y2, sunrealtype y3) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("At t = %0.4Le y =%14.6Le %14.6Le %14.6Le\n", t, y1, y2, y3); diff --git a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c index 3e64de23fb..d9f504db6c 100644 --- a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c @@ -164,15 +164,15 @@ typedef struct { sunindextype Neq, ns, np, mx, my; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; N_Vector rates; int nthreads; } *UserData; /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); /* Prototypes for private Helper Functions. */ @@ -180,13 +180,13 @@ static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, static void InitUserData(UserData webdata); static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata); -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol); -static void PrintOutput(void *ida_mem, N_Vector c, realtype t); +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t); static void PrintFinalStats(void *ida_mem); -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) N_Vector cc, cp, id; int iout, retval; sunindextype mu, ml; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; int num_threads; SUNContext ctx; @@ -350,11 +350,11 @@ int main(int argc, char *argv[]) * using cp in the case of prey species. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { sunindextype jx, jy, is, yloc, loc, np; - realtype *resv, *cpv; + sunrealtype *resv, *cpv; UserData webdata; jx = jy = is = 0; @@ -401,7 +401,7 @@ static int resweb(realtype tt, N_Vector cc, N_Vector cp, static void InitUserData(UserData webdata) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; webdata->mx = MX; webdata->my = MY; @@ -452,8 +452,8 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata) { sunindextype loc, yloc, is, jx, jy, np; - realtype xx, yy, xyfactor; - realtype *ccv, *cpv, *idv; + sunrealtype xx, yy, xyfactor; + sunrealtype *ccv, *cpv, *idv; ccv = NV_DATA_OMP(cc); cpv = NV_DATA_OMP(cp); @@ -472,7 +472,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (realtype)(is+1) * xyfactor; + ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { @@ -502,7 +502,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, * Print first lines of output (problem description) */ -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol) +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol) { printf("\nidaFoodWeb_bnd_omp: Predator-prey DAE OpenMP example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -531,11 +531,11 @@ static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtyp * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector c, realtype t) +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t) { int i, kused, retval; long int nst; - realtype *c_bl, *c_tr, hused; + sunrealtype *c_bl, *c_tr, hused; retval = IDAGetLastOrder(ida_mem, &kused); check_retval(&retval, "IDAGetLastOrder", 1); @@ -609,11 +609,11 @@ static void PrintFinalStats(void *ida_mem) * The interaction term is computed by the function WebRates. */ -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata) { sunindextype jx, jy, is, idyu, idyl, idxu, idxl; - realtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; + sunrealtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; /* Loop over grid points, evaluate interaction vector (length ns), form diffusion difference terms, and load crate. */ @@ -663,11 +663,11 @@ static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -680,13 +680,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); diff --git a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c index f178605e73..c7e8d5a897 100644 --- a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c @@ -169,9 +169,9 @@ typedef struct { sunindextype Neq, ns, np, mx, my; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; - realtype **PP[MX][MY]; + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; + sunrealtype **PP[MX][MY]; sunindextype *pivot[MX][MY]; N_Vector rates; N_Vector ewt; @@ -181,28 +181,28 @@ typedef struct { /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); -static int Precond(realtype tt, N_Vector cc, N_Vector cp, - N_Vector rr, realtype cj, void *user_data); +static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, + N_Vector rr, sunrealtype cj, void *user_data); -static int PSolve(realtype tt, N_Vector cc, N_Vector cp, +static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype delta, void *user_data); + sunrealtype cj, sunrealtype delta, void *user_data); /* Prototypes for private Helper Functions. */ static void InitUserData(UserData webdata); static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata); -static void PrintHeader(int maxl, realtype rtol, realtype atol); -static void PrintOutput(void *ida_mem, N_Vector c, realtype t); +static void PrintHeader(int maxl, sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t); static void PrintFinalStats(void *ida_mem); -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) N_Vector cc, cp, id; int iout, jx, jy, retval; int maxl; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; int num_threads; SUNContext ctx; @@ -382,11 +382,11 @@ int main(int argc, char *argv[]) * using cp in the case of prey species. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { sunindextype jx, jy, is, yloc, loc, np; - realtype *resv, *cpv; + sunrealtype *resv, *cpv; UserData webdata; jx = jy = is = 0; @@ -421,18 +421,18 @@ static int resweb(realtype tt, N_Vector cc, N_Vector cp, } -static int Precond(realtype tt, N_Vector cc, N_Vector cp, - N_Vector rr, realtype cj, void *user_data) +static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, + N_Vector rr, sunrealtype cj, void *user_data) { int retval; sunindextype ret; - realtype uround, xx, yy, del_x, del_y; - realtype **Pxy, *ratesxy, *Pxycol, *cxy, *cpxy, *ewtxy, cctmp; - realtype inc, fac, sqru, perturb_rates[NUM_SPECIES]; + sunrealtype uround, xx, yy, del_x, del_y; + sunrealtype **Pxy, *ratesxy, *Pxycol, *cxy, *cpxy, *ewtxy, cctmp; + sunrealtype inc, fac, sqru, perturb_rates[NUM_SPECIES]; int is, js, jx, jy; void *ida_mem; N_Vector ewt; - realtype hh; + sunrealtype hh; UserData webdata; webdata = (UserData) user_data; @@ -489,11 +489,11 @@ static int Precond(realtype tt, N_Vector cc, N_Vector cp, } -static int PSolve(realtype tt, N_Vector cc, N_Vector cp, +static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype dalta, void *user_data) + sunrealtype cj, sunrealtype dalta, void *user_data) { - realtype **Pxy, *zxy; + sunrealtype **Pxy, *zxy; sunindextype *pivot; sunindextype jx, jy; UserData webdata; @@ -533,7 +533,7 @@ static int PSolve(realtype tt, N_Vector cc, N_Vector cp, static void InitUserData(UserData webdata) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; webdata->mx = MX; webdata->my = MY; @@ -584,8 +584,8 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata) { sunindextype loc, yloc, is, jx, jy, np; - realtype xx, yy, xyfactor; - realtype *ccv, *cpv, *idv; + sunrealtype xx, yy, xyfactor; + sunrealtype *ccv, *cpv, *idv; ccv = NV_DATA_OMP(cc); cpv = NV_DATA_OMP(cp); @@ -604,7 +604,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (realtype)(is+1) * xyfactor; + ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { @@ -634,7 +634,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, * Print first lines of output (problem description) */ -static void PrintHeader(int maxl, realtype rtol, realtype atol) +static void PrintHeader(int maxl, sunrealtype rtol, sunrealtype atol) { printf("\nidaFoodWeb_kry_omp: Predator-prey DAE OpenMP example problem using Krylov solver for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -662,11 +662,11 @@ static void PrintHeader(int maxl, realtype rtol, realtype atol) * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector c, realtype t) +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t) { int i, kused, retval; long int nst; - realtype *c_bl, *c_tr, hused; + sunrealtype *c_bl, *c_tr, hused; retval = IDAGetLastOrder(ida_mem, &kused); check_retval(&retval, "IDAGetLastOrder", 1); @@ -740,11 +740,11 @@ static void PrintFinalStats(void *ida_mem) * The interaction term is computed by the function WebRates. */ -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata) { sunindextype jx, jy, is, idyu, idyl, idxu, idxl; - realtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; + sunrealtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; /* Loop over grid points, evaluate interaction vector (length ns), form diffusion difference terms, and load crate. */ @@ -794,11 +794,11 @@ static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -811,13 +811,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); diff --git a/examples/ida/cuda/idaHeat2D_kry_cuda.cu b/examples/ida/cuda/idaHeat2D_kry_cuda.cu index 3744041331..d665ef9139 100644 --- a/examples/ida/cuda/idaHeat2D_kry_cuda.cu +++ b/examples/ida/cuda/idaHeat2D_kry_cuda.cu @@ -35,7 +35,7 @@ #include /* prototypes for IDA methods */ #include /* access to CUDA N_Vector */ #include /* access to spgmr SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -53,8 +53,8 @@ struct _UserData { sunindextype mm; /* number of grid points in one dimension */ sunindextype neq; /* number of equations */ - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; N_Vector pp; /* vector of prec. diag. elements */ }; @@ -62,24 +62,24 @@ typedef _UserData *UserData; /* Prototypes for functions called by IDA */ -int resHeat(realtype tres, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data); + sunrealtype c_j, void *prec_data); -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data); + sunrealtype c_j, sunrealtype delta, void *prec_data); /* Prototypes for private functions */ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res); -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector uu); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu); static int check_flag(void *flagvalue, const char *funcname, int opt); @@ -90,8 +90,8 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); */ __global__ -void resHeatKernel(const realtype *uu, const realtype *up, realtype *rr, - sunindextype mm, realtype coeff) +void resHeatKernel(const sunrealtype *uu, const sunrealtype *up, sunrealtype *rr, + sunindextype mm, sunrealtype coeff) { sunindextype i, j, tid; @@ -107,15 +107,15 @@ void resHeatKernel(const realtype *uu, const realtype *up, realtype *rr, rr[tid] = uu[tid]; } else { /* Loop over interior points; set res = up - (central difference). */ - realtype dif1 = uu[tid-1] + uu[tid+1] - TWO * uu[tid]; - realtype dif2 = uu[tid-mm] + uu[tid+mm] - TWO * uu[tid]; + sunrealtype dif1 = uu[tid-1] + uu[tid+1] - TWO * uu[tid]; + sunrealtype dif2 = uu[tid-mm] + uu[tid+mm] - TWO * uu[tid]; rr[tid] = up[tid] - coeff * ( dif1 + dif2 ); } } } __global__ -void PsetupHeatKernel(realtype *ppv, sunindextype mm, realtype c_j, realtype coeff) +void PsetupHeatKernel(sunrealtype *ppv, sunindextype mm, sunrealtype c_j, sunrealtype coeff) { sunindextype i, j, tid; @@ -137,7 +137,7 @@ void PsetupHeatKernel(realtype *ppv, sunindextype mm, realtype c_j, realtype coe } __global__ -void setInitHeatKernel(realtype *up, sunindextype mm) +void setInitHeatKernel(sunrealtype *up, sunindextype mm) { sunindextype i, j, tid; @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) UserData data; N_Vector uu, up, constraints, res; int ier, iout; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; long int netf, ncfn, ncfl; SUNLinearSolver LS; SUNContext ctx; @@ -380,17 +380,17 @@ int main(int argc, char *argv[]) * while for each boundary point, it is res_i = u_i. */ -int resHeat(realtype tt, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { sunindextype mm; - realtype coeff; + sunrealtype coeff; UserData data; - const realtype *uu_data = N_VGetDeviceArrayPointer_Cuda(uu); - const realtype *up_data = N_VGetDeviceArrayPointer_Cuda(up); - realtype *rr_data = N_VGetDeviceArrayPointer_Cuda(rr); + const sunrealtype *uu_data = N_VGetDeviceArrayPointer_Cuda(uu); + const sunrealtype *up_data = N_VGetDeviceArrayPointer_Cuda(up); + sunrealtype *rr_data = N_VGetDeviceArrayPointer_Cuda(rr); data = (UserData) user_data; @@ -422,18 +422,18 @@ int resHeat(realtype tt, * pp etc.) are used from the PsetupdHeat argument list. */ -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data) + sunrealtype c_j, void *prec_data) { sunindextype mm; - realtype *ppv; + sunrealtype *ppv; UserData data; data = (UserData) prec_data; ppv = N_VGetDeviceArrayPointer_Cuda(data->pp); mm = data->mm; - realtype coeff = data->coeff; + sunrealtype coeff = data->coeff; unsigned block = 256; unsigned grid = (mm*mm + block - 1) / block; @@ -450,10 +450,10 @@ int PsetupHeat(realtype tt, * computed in PrecondHeateq), returning the result in zvec. */ -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data) + sunrealtype c_j, sunrealtype delta, void *prec_data) { UserData data; data = (UserData) prec_data; @@ -475,7 +475,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res) { sunindextype mm, i, j; - realtype xfact, yfact, *udata, *updata; + sunrealtype xfact, yfact, *udata, *updata; mm = data->mm; @@ -516,7 +516,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_kry: Heat equation, serial example problem for IDA \n"); printf(" Discretized heat equation on 2D unit square. \n"); @@ -539,9 +539,9 @@ static void PrintHeader(realtype rtol, realtype atol) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, ier; diff --git a/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu b/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu index 5b1eb5d929..3283cb4abf 100644 --- a/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu +++ b/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu @@ -63,49 +63,49 @@ typedef struct { int thispe, npex, npey, ixsub, jysub; sunindextype mx, my, mxsub, mysub; - realtype dx, dy, coeffx, coeffy, coeffxy; - realtype *uext; /* device array */ - realtype *host_send_buff; - realtype *host_recv_buff; - realtype *dev_send_buff; - realtype *dev_recv_buff; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype *uext; /* device array */ + sunrealtype *host_send_buff; + sunrealtype *host_recv_buff; + sunrealtype *dev_send_buff; + sunrealtype *dev_recv_buff; N_Vector pp; /* vector of diagonal preconditioner elements */ MPI_Comm comm; } *UserData; /* User-supplied residual function and supporting routines */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); static int rescomm(N_Vector uu, N_Vector up, void *user_data); -static int reslocal(realtype tt, N_Vector uu, N_Vector up, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector res, void *user_data); static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - const realtype *uarray, realtype *dev_send_buff, realtype *host_send_buff); + const sunrealtype *uarray, sunrealtype *dev_send_buff, sunrealtype *host_send_buff); static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *host_recv_buff); + sunrealtype *host_recv_buff); static int BRecvWait(MPI_Request request[], int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *uext, const realtype *host_recv_buff, realtype *dev_recv_buff); + sunrealtype *uext, const sunrealtype *host_recv_buff, sunrealtype *dev_recv_buff); /* User-supplied preconditioner routines */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, - N_Vector rvec, N_Vector zvec, realtype c_j, - realtype delta, void *user_data); +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, + N_Vector rvec, N_Vector zvec, sunrealtype c_j, + sunrealtype delta, void *user_data); -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data); /* Private function to check function return values */ @@ -118,9 +118,9 @@ static int DeleteUserData(UserData data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data); -static void PrintHeader(realtype rtol, realtype atol, UserData data); +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData data); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -134,9 +134,9 @@ static int check_flag(void *flagvalue, const char *funcname, int opt, int id); */ __global__ -void PsetupHeatKernel(realtype *ppv, sunindextype mx, sunindextype my, +void PsetupHeatKernel(sunrealtype *ppv, sunindextype mx, sunindextype my, sunindextype ibc, sunindextype jbc, - sunindextype i0, sunindextype j0, realtype pelinv) + sunindextype i0, sunindextype j0, sunrealtype pelinv) { sunindextype i, j, tid; @@ -154,7 +154,7 @@ void PsetupHeatKernel(realtype *ppv, sunindextype mx, sunindextype my, __global__ -void CopyLocalToExtendedArray(const realtype *uuv, realtype *uext, +void CopyLocalToExtendedArray(const sunrealtype *uuv, sunrealtype *uext, sunindextype mx, sunindextype my) { sunindextype i, j, tid; @@ -172,11 +172,11 @@ void CopyLocalToExtendedArray(const realtype *uuv, realtype *uext, __global__ -void LocalResidualKernel(const realtype *uext, const realtype *upv, realtype *resv, +void LocalResidualKernel(const sunrealtype *uext, const sunrealtype *upv, sunrealtype *resv, sunindextype mx, sunindextype my, sunindextype ibc, sunindextype jbc, sunindextype i0, sunindextype j0, - realtype coeffx, realtype coeffy, realtype coeffxy) + sunrealtype coeffx, sunrealtype coeffy, sunrealtype coeffxy) { sunindextype i, j, tid; @@ -190,16 +190,16 @@ void LocalResidualKernel(const realtype *uext, const realtype *upv, realtype *re sunindextype locu = i + j*mx; sunindextype locue = (i+1) + (j+1)*(mx+2); - realtype termx = coeffx * (uext[locue-1] + uext[locue+1]); - realtype termy = coeffy * (uext[locue-(mx+2)] + uext[locue+(mx+2)]); - realtype termctr = coeffxy * uext[locue]; + sunrealtype termx = coeffx * (uext[locue-1] + uext[locue+1]); + sunrealtype termy = coeffy * (uext[locue-(mx+2)] + uext[locue+(mx+2)]); + sunrealtype termctr = coeffxy * uext[locue]; resv[locu] = upv[locu] - (termx + termy - termctr); } } __global__ -void CopyToBottomBuffer(const realtype *uarray, realtype *bufbottom, +void CopyToBottomBuffer(const sunrealtype *uarray, sunrealtype *bufbottom, sunindextype mx) { sunindextype tid; @@ -214,7 +214,7 @@ void CopyToBottomBuffer(const realtype *uarray, realtype *bufbottom, __global__ -void CopyToTopBuffer(const realtype *uarray, realtype *buftop, +void CopyToTopBuffer(const sunrealtype *uarray, sunrealtype *buftop, sunindextype mx, sunindextype my) { sunindextype tid; @@ -229,7 +229,7 @@ void CopyToTopBuffer(const realtype *uarray, realtype *buftop, __global__ -void CopyToLeftBuffer(const realtype *uarray, realtype *bufleft, +void CopyToLeftBuffer(const sunrealtype *uarray, sunrealtype *bufleft, sunindextype mx, sunindextype my) { sunindextype tid; @@ -244,7 +244,7 @@ void CopyToLeftBuffer(const realtype *uarray, realtype *bufleft, __global__ -void CopyToRightBuffer(const realtype *uarray, realtype *bufright, +void CopyToRightBuffer(const sunrealtype *uarray, sunrealtype *bufright, sunindextype mx, sunindextype my) { sunindextype tid; @@ -259,7 +259,7 @@ void CopyToRightBuffer(const realtype *uarray, realtype *bufright, __global__ -void CopyFromBottomBuffer(const realtype *bufbottom, realtype *uext, +void CopyFromBottomBuffer(const sunrealtype *bufbottom, sunrealtype *uext, sunindextype mx) { sunindextype tid; @@ -274,7 +274,7 @@ void CopyFromBottomBuffer(const realtype *bufbottom, realtype *uext, __global__ -void CopyFromTopBuffer(const realtype *buftop, realtype *uext, +void CopyFromTopBuffer(const sunrealtype *buftop, sunrealtype *uext, sunindextype mx, sunindextype my) { sunindextype tid; @@ -289,7 +289,7 @@ void CopyFromTopBuffer(const realtype *buftop, realtype *uext, __global__ -void CopyFromLeftBuffer(const realtype *bufleft, realtype *uext, +void CopyFromLeftBuffer(const sunrealtype *bufleft, sunrealtype *uext, sunindextype mx, sunindextype my) { sunindextype tid; @@ -304,7 +304,7 @@ void CopyFromLeftBuffer(const realtype *bufleft, realtype *uext, __global__ -void CopyFromRightBuffer(const realtype *bufright, realtype *uext, +void CopyFromRightBuffer(const sunrealtype *bufright, sunrealtype *uext, sunindextype mx, sunindextype my) { sunindextype tid; @@ -332,7 +332,7 @@ int main(int argc, char *argv[]) UserData data; int iout, thispe, ier, npes; sunindextype local_N; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uulocal, uu, up, constraints, id, res; SUNContext ctx; @@ -515,7 +515,7 @@ int main(int argc, char *argv[]) * of uu required to calculate the residual. */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { int retval = 0; @@ -548,8 +548,8 @@ int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, * */ -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data) +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data) { sunindextype ibc, i0, jbc, j0; @@ -561,10 +561,10 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, const int npey = data->npey; const sunindextype mxsub = data->mxsub; const sunindextype mysub = data->mysub; - realtype *ppv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(data->pp)); + sunrealtype *ppv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(data->pp)); /* Calculate the value for the inverse element of the diagonal preconditioner */ - const realtype pelinv = ONE/(c_j + data->coeffxy); + const sunrealtype pelinv = ONE/(c_j + data->coeffxy); /* Initially set all pp elements on the device to one. */ N_VConst(ONE, data->pp); @@ -589,9 +589,9 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, * computed in PsetupHeat), returning the result in zvec. */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData data = (UserData) user_data; @@ -628,14 +628,14 @@ static int rescomm(N_Vector uu, N_Vector up, void* user_data) const sunindextype mysub = data->mysub; /* Get pointers to buffers and extended solution vector data array uext. */ - realtype *uext = data->uext; - realtype *host_send_buff = data->host_send_buff; - realtype *host_recv_buff = data->host_recv_buff; - realtype *dev_send_buff = data->dev_send_buff; - realtype *dev_recv_buff = data->dev_recv_buff; + sunrealtype *uext = data->uext; + sunrealtype *host_send_buff = data->host_send_buff; + sunrealtype *host_recv_buff = data->host_recv_buff; + sunrealtype *dev_send_buff = data->dev_send_buff; + sunrealtype *dev_recv_buff = data->dev_recv_buff; /* Get solution vector data. */ - const realtype *uarray = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(uu)); + const sunrealtype *uarray = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(uu)); /* Set array of MPI requests */ MPI_Request request[4]; @@ -659,7 +659,7 @@ static int rescomm(N_Vector uu, N_Vector up, void* user_data) * has already been done, and that this data is in the work array uext. */ -static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { UserData data = (UserData) user_data; @@ -671,15 +671,15 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, const int npey = data->npey; const sunindextype mxsub = data->mxsub; const sunindextype mysub = data->mysub; - const realtype coeffx = data->coeffx; - const realtype coeffy = data->coeffy; - const realtype coeffxy = data->coeffxy; + const sunrealtype coeffx = data->coeffx; + const sunrealtype coeffy = data->coeffy; + const sunrealtype coeffxy = data->coeffxy; /* Vector data arrays, extended work array uext. */ - const realtype *uuv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(uu)); - const realtype *upv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(up)); - realtype *resv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(rr)); - realtype *uext = data->uext; + const sunrealtype *uuv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(uu)); + const sunrealtype *upv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(up)); + sunrealtype *resv = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(rr)); + sunrealtype *uext = data->uext; sunindextype ibc, i0, jbc, j0; @@ -720,22 +720,22 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - const realtype *uarray, realtype *dev_send_buff, - realtype *host_send_buff) + const sunrealtype *uarray, sunrealtype *dev_send_buff, + sunrealtype *host_send_buff) { cudaError_t err; /* Have left, right, top and bottom device buffers use the same dev_send_buff. */ - realtype *d_bufleft = dev_send_buff; - realtype *d_bufright = dev_send_buff + mysub; - realtype *d_buftop = dev_send_buff + 2*mysub; - realtype *d_bufbottom = dev_send_buff + 2*mysub + mxsub; + sunrealtype *d_bufleft = dev_send_buff; + sunrealtype *d_bufright = dev_send_buff + mysub; + sunrealtype *d_buftop = dev_send_buff + 2*mysub; + sunrealtype *d_bufbottom = dev_send_buff + 2*mysub + mxsub; /* Have left, right, top and bottom host buffers use the same host_send_buff. */ - realtype *h_bufleft = host_send_buff; - realtype *h_bufright = host_send_buff + mysub; - realtype *h_buftop = host_send_buff + 2*mysub; - realtype *h_bufbottom = host_send_buff + 2*mysub + mxsub; + sunrealtype *h_bufleft = host_send_buff; + sunrealtype *h_bufright = host_send_buff + mysub; + sunrealtype *h_buftop = host_send_buff + 2*mysub; + sunrealtype *h_bufbottom = host_send_buff + 2*mysub + mxsub; /* If jysub > 0, send data from bottom x-line of u. (via bufbottom) */ @@ -746,7 +746,7 @@ static int BSend(MPI_Comm comm, int thispe, CopyToBottomBuffer<<>>(uarray, d_bufbottom, mxsub); // Copy buffer to the host - err = cudaMemcpy(h_bufbottom, d_bufbottom, mxsub*sizeof(realtype), + err = cudaMemcpy(h_bufbottom, d_bufbottom, mxsub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Bottom buffer: Copy from device to host failed with code %d... \n", err); @@ -765,7 +765,7 @@ static int BSend(MPI_Comm comm, int thispe, CopyToTopBuffer<<>>(uarray, d_buftop, mxsub, mysub); // Copy buffer to the host - err = cudaMemcpy(h_buftop, d_buftop, mxsub*sizeof(realtype), cudaMemcpyDeviceToHost); + err = cudaMemcpy(h_buftop, d_buftop, mxsub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Top buffer: Copy from device to host failed ... \n"); return -1; @@ -783,7 +783,7 @@ static int BSend(MPI_Comm comm, int thispe, CopyToLeftBuffer<<>>(uarray, d_bufleft, mxsub, mysub); // Copy buffer to the host - err = cudaMemcpy(h_bufleft, d_bufleft, mysub*sizeof(realtype), cudaMemcpyDeviceToHost); + err = cudaMemcpy(h_bufleft, d_bufleft, mysub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Left buffer: Copy from device to host failed ... \n"); return -1; @@ -801,7 +801,7 @@ static int BSend(MPI_Comm comm, int thispe, CopyToRightBuffer<<>>(uarray, d_bufright, mxsub, mysub); // Copy buffer to the host - err = cudaMemcpy(h_bufright, d_bufright, mysub*sizeof(realtype), cudaMemcpyDeviceToHost); + err = cudaMemcpy(h_bufright, d_bufright, mysub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Right buffer: Copy from device to host failed ... \n"); return -1; @@ -817,7 +817,7 @@ static int BSend(MPI_Comm comm, int thispe, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*(MYSUB+MYSUB) realtype entries, should + * 1) buffer should be able to hold 2*(MYSUB+MYSUB) sunrealtype entries, should * be passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -827,13 +827,13 @@ static int BSend(MPI_Comm comm, int thispe, static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *host_recv_buff) + sunrealtype *host_recv_buff) { /* Have left, right, top and bottom buffers use the same host_recv_buff. */ - realtype *bufleft = host_recv_buff; - realtype *bufright = host_recv_buff + mysub; - realtype *buftop = host_recv_buff + 2*mysub; - realtype *bufbottom = host_recv_buff + 2*mysub + mxsub; + sunrealtype *bufleft = host_recv_buff; + sunrealtype *bufright = host_recv_buff + mysub; + sunrealtype *buftop = host_recv_buff + 2*mysub; + sunrealtype *bufbottom = host_recv_buff + 2*mysub + mxsub; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) { @@ -866,7 +866,7 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -876,26 +876,26 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, static int BRecvWait(MPI_Request request[], int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *uext, const realtype *host_recv_buff, realtype *dev_recv_buff) + sunrealtype *uext, const sunrealtype *host_recv_buff, sunrealtype *dev_recv_buff) { cudaError_t err; MPI_Status status; - const realtype *h_bufleft = host_recv_buff; - const realtype *h_bufright = host_recv_buff + mysub; - const realtype *h_buftop = host_recv_buff + 2*mysub; - const realtype *h_bufbottom = host_recv_buff + 2*mysub + mxsub; + const sunrealtype *h_bufleft = host_recv_buff; + const sunrealtype *h_bufright = host_recv_buff + mysub; + const sunrealtype *h_buftop = host_recv_buff + 2*mysub; + const sunrealtype *h_bufbottom = host_recv_buff + 2*mysub + mxsub; - realtype *d_bufleft = dev_recv_buff; - realtype *d_bufright = dev_recv_buff + mysub; - realtype *d_buftop = dev_recv_buff + 2*mysub; - realtype *d_bufbottom = dev_recv_buff + 2*mysub + mxsub; + sunrealtype *d_bufleft = dev_recv_buff; + sunrealtype *d_bufright = dev_recv_buff + mysub; + sunrealtype *d_buftop = dev_recv_buff + 2*mysub; + sunrealtype *d_bufbottom = dev_recv_buff + 2*mysub + mxsub; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) { MPI_Wait(&request[0], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_bufbottom, h_bufbottom, mxsub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_bufbottom, h_bufbottom, mxsub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -910,7 +910,7 @@ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, if (jysub != npey-1) { MPI_Wait(&request[1], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_buftop, h_buftop, mxsub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_buftop, h_buftop, mxsub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -925,7 +925,7 @@ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, if (ixsub != 0) { MPI_Wait(&request[2], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_bufleft, h_bufleft, mysub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_bufleft, h_bufleft, mysub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -940,7 +940,7 @@ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, if (ixsub != npex-1) { MPI_Wait(&request[3], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_bufright, h_bufright, mysub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_bufright, h_bufright, mysub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -1013,7 +1013,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local extended vector (includes ghost nodes) */ - err = cudaMalloc((void**) &data->uext, (mxsub + 2)*(mysub +2)*sizeof(realtype)); + err = cudaMalloc((void**) &data->uext, (mxsub + 2)*(mysub +2)*sizeof(sunrealtype)); if(err != cudaSuccess) { printf("Failed to allocate uext ... \n"); N_VDestroy(data->pp); @@ -1022,7 +1022,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local host send buffer */ - data->host_send_buff = (realtype*) malloc(2*(mxsub + mysub)*sizeof(realtype)); + data->host_send_buff = (sunrealtype*) malloc(2*(mxsub + mysub)*sizeof(sunrealtype)); if(data->host_send_buff == NULL) { N_VDestroy(data->pp); free(data->uext); @@ -1030,7 +1030,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) return -1; } - data->host_recv_buff = (realtype*) malloc(2*(mxsub + mysub)*sizeof(realtype)); + data->host_recv_buff = (sunrealtype*) malloc(2*(mxsub + mysub)*sizeof(sunrealtype)); if(data->host_recv_buff == NULL) { N_VDestroy(data->pp); free(data->uext); @@ -1040,7 +1040,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local device send buffer */ - err = cudaMalloc((void**) &data->dev_send_buff, 2*(mxsub + mysub)*sizeof(realtype)); + err = cudaMalloc((void**) &data->dev_send_buff, 2*(mxsub + mysub)*sizeof(sunrealtype)); if(err != cudaSuccess) { printf("Failed to allocate dev_send_buff ... \n"); N_VDestroy(data->pp); @@ -1052,7 +1052,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local device send buffer */ - err = cudaMalloc((void**) &data->dev_recv_buff, 2*(mxsub + mysub)*sizeof(realtype)); + err = cudaMalloc((void**) &data->dev_recv_buff, 2*(mxsub + mysub)*sizeof(sunrealtype)); if(err != cudaSuccess) { printf("Failed to allocate dev_recv_buff ... \n"); N_VDestroy(data->pp); @@ -1093,17 +1093,17 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data) { sunindextype i, iloc, j, jloc, loc; - realtype xfact, yfact; + sunrealtype xfact, yfact; /* Initialize uu. */ // Get host pointer - realtype *uudata = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(uu)); - realtype *iddata = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(id)); + sunrealtype *uudata = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(uu)); + sunrealtype *iddata = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(id)); /* Set mesh spacings and subgrid indices for this PE. */ - const realtype dx = data->dx; - const realtype dy = data->dy; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; const int ixsub = data->ixsub; const int jysub = data->jysub; @@ -1155,7 +1155,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * Print first lines of output and table heading */ -static void PrintHeader(realtype rtol, realtype atol, UserData data) +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData data) { printf("\nidaHeat2D_kry_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -1188,9 +1188,9 @@ static void PrintHeader(realtype rtol, realtype atol, UserData data) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, ier; diff --git a/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp b/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp index 3fbe575de4..74ec5767e8 100644 --- a/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp +++ b/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp @@ -78,49 +78,49 @@ typedef struct { int thispe, npex, npey, ixsub, jysub; sunindextype mx, my, mxsub, mysub; - realtype dx, dy, coeffx, coeffy, coeffxy; - realtype *uext; /* device array */ - realtype *host_send_buff; - realtype *host_recv_buff; - realtype *dev_send_buff; - realtype *dev_recv_buff; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype *uext; /* device array */ + sunrealtype *host_send_buff; + sunrealtype *host_recv_buff; + sunrealtype *dev_send_buff; + sunrealtype *dev_recv_buff; N_Vector pp; /* vector of diagonal preconditioner elements */ MPI_Comm comm; } *UserData; /* User-supplied residual function and supporting routines */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); static int rescomm(N_Vector uu, N_Vector up, void *user_data); -static int reslocal(realtype tt, N_Vector uu, N_Vector up, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector res, void *user_data); static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - const realtype *uarray, realtype *dev_send_buff, realtype *host_send_buff); + const sunrealtype *uarray, sunrealtype *dev_send_buff, sunrealtype *host_send_buff); static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *host_recv_buff); + sunrealtype *host_recv_buff); static int BRecvWait(MPI_Request request[], int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *uext, const realtype *host_recv_buff, realtype *dev_recv_buff); + sunrealtype *uext, const sunrealtype *host_recv_buff, sunrealtype *dev_recv_buff); /* User-supplied preconditioner routines */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, - N_Vector rvec, N_Vector zvec, realtype c_j, - realtype delta, void *user_data); +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, + N_Vector rvec, N_Vector zvec, sunrealtype c_j, + sunrealtype delta, void *user_data); -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data); /* Private function to check function return values */ @@ -133,9 +133,9 @@ static int DeleteUserData(UserData data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data); -static void PrintHeader(realtype rtol, realtype atol, UserData data); +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData data); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) UserData data; int iout, thispe, ier, npes; sunindextype local_N; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uulocal, uu, up, constraints, id, res; SUNContext ctx; @@ -348,7 +348,7 @@ int main(int argc, char *argv[]) * of uu required to calculate the residual. */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { int retval = 0; @@ -381,8 +381,8 @@ int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, * */ -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data) +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data) { const sunindextype zero = 0; sunindextype ibc, i0, jbc, j0; @@ -395,10 +395,10 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, const int npey = data->npey; const sunindextype mxsub = data->mxsub; const sunindextype mysub = data->mysub; - realtype *ppv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(data->pp)); + sunrealtype *ppv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(data->pp)); /* Calculate the value for the inverse element of the diagonal preconditioner */ - const realtype pelinv = ONE/(c_j + data->coeffxy); + const sunrealtype pelinv = ONE/(c_j + data->coeffxy); /* Initially set all pp elements on the device to one. */ N_VConst(ONE, data->pp); @@ -428,9 +428,9 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, * computed in PsetupHeat), returning the result in zvec. */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData data = (UserData) user_data; @@ -467,14 +467,14 @@ static int rescomm(N_Vector uu, N_Vector up, void* user_data) const sunindextype mysub = data->mysub; /* Get pointers to buffers and extended solution vector data array uext. */ - realtype *uext = data->uext; - realtype *host_send_buff = data->host_send_buff; - realtype *host_recv_buff = data->host_recv_buff; - realtype *dev_send_buff = data->dev_send_buff; - realtype *dev_recv_buff = data->dev_recv_buff; + sunrealtype *uext = data->uext; + sunrealtype *host_send_buff = data->host_send_buff; + sunrealtype *host_recv_buff = data->host_recv_buff; + sunrealtype *dev_send_buff = data->dev_send_buff; + sunrealtype *dev_recv_buff = data->dev_recv_buff; /* Get solution vector data. */ - const realtype *uarray = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(uu)); + const sunrealtype *uarray = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(uu)); /* Set array of MPI requests */ MPI_Request request[4]; @@ -498,7 +498,7 @@ static int rescomm(N_Vector uu, N_Vector up, void* user_data) * has already been done, and that this data is in the work array uext. */ -static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { UserData data = (UserData) user_data; @@ -511,15 +511,15 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, const sunindextype mxsub = data->mxsub; const sunindextype mxsub2 = data->mxsub + 2; const sunindextype mysub = data->mysub; - const realtype coeffx = data->coeffx; - const realtype coeffy = data->coeffy; - const realtype coeffxy = data->coeffxy; + const sunrealtype coeffx = data->coeffx; + const sunrealtype coeffy = data->coeffy; + const sunrealtype coeffxy = data->coeffxy; /* Vector data arrays, extended work array uext. */ - const realtype *uuv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(uu)); - const realtype *upv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(up)); - realtype *resv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(rr)); - realtype *uext = data->uext; + const sunrealtype *uuv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(uu)); + const sunrealtype *upv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(up)); + sunrealtype *resv = N_VGetDeviceArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(rr)); + sunrealtype *uext = data->uext; const sunindextype zero = 0; sunindextype ibc, i0, jbc, j0; @@ -557,9 +557,9 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, sunindextype locu = i + j*mxsub; sunindextype locue = (i+1) + (j+1)*mxsub2; - realtype termx = coeffx * (uext[locue-1] + uext[locue+1]); - realtype termy = coeffy * (uext[locue-mxsub2] + uext[locue+mxsub2]); - realtype termctr = coeffxy * uext[locue]; + sunrealtype termx = coeffx * (uext[locue-1] + uext[locue+1]); + sunrealtype termy = coeffy * (uext[locue-mxsub2] + uext[locue+mxsub2]); + sunrealtype termctr = coeffxy * uext[locue]; resv[locu] = upv[locu] - (termx + termy - termctr); } ); @@ -575,21 +575,21 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - const realtype *uarray, realtype *dev_send_buff, realtype *host_send_buff) + const sunrealtype *uarray, sunrealtype *dev_send_buff, sunrealtype *host_send_buff) { cudaError_t err; const sunindextype zero = 0; /* Have left, right, top and bottom device buffers use the same dev_send_buff. */ - realtype *d_bufleft = dev_send_buff; - realtype *d_bufright = dev_send_buff + mysub; - realtype *d_buftop = dev_send_buff + 2*mysub; - realtype *d_bufbottom = dev_send_buff + 2*mysub + mxsub; + sunrealtype *d_bufleft = dev_send_buff; + sunrealtype *d_bufright = dev_send_buff + mysub; + sunrealtype *d_buftop = dev_send_buff + 2*mysub; + sunrealtype *d_bufbottom = dev_send_buff + 2*mysub + mxsub; /* Have left, right, top and bottom host buffers use the same host_send_buff. */ - realtype *h_bufleft = host_send_buff; - realtype *h_bufright = host_send_buff + mysub; - realtype *h_buftop = host_send_buff + 2*mysub; - realtype *h_bufbottom = host_send_buff + 2*mysub + mxsub; + sunrealtype *h_bufleft = host_send_buff; + sunrealtype *h_bufright = host_send_buff + mysub; + sunrealtype *h_buftop = host_send_buff + 2*mysub; + sunrealtype *h_bufbottom = host_send_buff + 2*mysub + mxsub; /* If jysub > 0, send data from bottom x-line of u. (via bufbottom) */ @@ -601,7 +601,7 @@ static int BSend(MPI_Comm comm, int thispe, } ); // Copy buffer to the host - err = cudaMemcpy(h_bufbottom, d_bufbottom, mxsub*sizeof(realtype), cudaMemcpyDeviceToHost); + err = cudaMemcpy(h_bufbottom, d_bufbottom, mxsub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Bottom buffer: Copy from device to host failed with code %d... \n", err); return -1; @@ -620,7 +620,7 @@ static int BSend(MPI_Comm comm, int thispe, } ); // Copy buffer to the host - err = cudaMemcpy(h_buftop, d_buftop, mxsub*sizeof(realtype), cudaMemcpyDeviceToHost); + err = cudaMemcpy(h_buftop, d_buftop, mxsub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Top buffer: Copy from device to host failed ... \n"); return -1; @@ -639,7 +639,7 @@ static int BSend(MPI_Comm comm, int thispe, } ); // Copy buffer to the host - err = cudaMemcpy(h_bufleft, d_bufleft, mysub*sizeof(realtype), cudaMemcpyDeviceToHost); + err = cudaMemcpy(h_bufleft, d_bufleft, mysub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Left buffer: Copy from device to host failed ... \n"); return -1; @@ -658,7 +658,7 @@ static int BSend(MPI_Comm comm, int thispe, } ); // Copy buffer to the host - err = cudaMemcpy(h_bufright, d_bufright, mysub*sizeof(realtype), cudaMemcpyDeviceToHost); + err = cudaMemcpy(h_bufright, d_bufright, mysub*sizeof(sunrealtype), cudaMemcpyDeviceToHost); if (err != cudaSuccess) { printf("Right buffer: Copy from device to host failed ... \n"); return -1; @@ -674,7 +674,7 @@ static int BSend(MPI_Comm comm, int thispe, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*(MYSUB+MYSUB) realtype entries, should + * 1) buffer should be able to hold 2*(MYSUB+MYSUB) sunrealtype entries, should * be passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -684,13 +684,13 @@ static int BSend(MPI_Comm comm, int thispe, static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *host_recv_buff) + sunrealtype *host_recv_buff) { /* Have left, right, top and bottom buffers use the same host_recv_buff. */ - realtype *bufleft = host_recv_buff; - realtype *bufright = host_recv_buff + mysub; - realtype *buftop = host_recv_buff + 2*mysub; - realtype *bufbottom = host_recv_buff + 2*mysub + mxsub; + sunrealtype *bufleft = host_recv_buff; + sunrealtype *bufright = host_recv_buff + mysub; + sunrealtype *buftop = host_recv_buff + 2*mysub; + sunrealtype *bufbottom = host_recv_buff + 2*mysub + mxsub; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) { @@ -723,7 +723,7 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -733,21 +733,21 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, static int BRecvWait(MPI_Request request[], int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype *uext, const realtype *host_recv_buff, realtype *dev_recv_buff) + sunrealtype *uext, const sunrealtype *host_recv_buff, sunrealtype *dev_recv_buff) { cudaError_t err; MPI_Status status; const sunindextype zero = 0; - const realtype *h_bufleft = host_recv_buff; - const realtype *h_bufright = host_recv_buff + mysub; - const realtype *h_buftop = host_recv_buff + 2*mysub; - const realtype *h_bufbottom = host_recv_buff + 2*mysub + mxsub; + const sunrealtype *h_bufleft = host_recv_buff; + const sunrealtype *h_bufright = host_recv_buff + mysub; + const sunrealtype *h_buftop = host_recv_buff + 2*mysub; + const sunrealtype *h_bufbottom = host_recv_buff + 2*mysub + mxsub; - realtype *d_bufleft = dev_recv_buff; - realtype *d_bufright = dev_recv_buff + mysub; - realtype *d_buftop = dev_recv_buff + 2*mysub; - realtype *d_bufbottom = dev_recv_buff + 2*mysub + mxsub; + sunrealtype *d_bufleft = dev_recv_buff; + sunrealtype *d_bufright = dev_recv_buff + mysub; + sunrealtype *d_buftop = dev_recv_buff + 2*mysub; + sunrealtype *d_bufbottom = dev_recv_buff + 2*mysub + mxsub; const sunindextype mxsub2 = mxsub + 2; const sunindextype mysub1 = mysub + 1; @@ -756,7 +756,7 @@ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, if (jysub != 0) { MPI_Wait(&request[0], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_bufbottom, h_bufbottom, mxsub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_bufbottom, h_bufbottom, mxsub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -773,7 +773,7 @@ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, if (jysub != npey-1) { MPI_Wait(&request[1], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_buftop, h_buftop, mxsub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_buftop, h_buftop, mxsub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -790,7 +790,7 @@ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, if (ixsub != 0) { MPI_Wait(&request[2], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_bufleft, h_bufleft, mysub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_bufleft, h_bufleft, mysub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -807,7 +807,7 @@ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, if (ixsub != npex-1) { MPI_Wait(&request[3], &status); /* Copy the buffer from the host to the device */ - err = cudaMemcpy(d_bufright, h_bufright, mysub*sizeof(realtype), cudaMemcpyHostToDevice); + err = cudaMemcpy(d_bufright, h_bufright, mysub*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { printf("Copy from host to device failed ... \n"); return -1; @@ -882,7 +882,7 @@ static int AllocUserData(MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local extended vector (includes ghost nodes) */ - err = cudaMalloc((void**) &data->uext, (mxsub + 2)*(mysub +2)*sizeof(realtype)); + err = cudaMalloc((void**) &data->uext, (mxsub + 2)*(mysub +2)*sizeof(sunrealtype)); if(err != cudaSuccess) { printf("Failed to allocate uext ... \n"); N_VDestroy(data->pp); @@ -891,7 +891,7 @@ static int AllocUserData(MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local host send buffer */ - data->host_send_buff = (realtype*) malloc(2*(mxsub + mysub)*sizeof(realtype)); + data->host_send_buff = (sunrealtype*) malloc(2*(mxsub + mysub)*sizeof(sunrealtype)); if(data->host_send_buff == NULL) { N_VDestroy(data->pp); free(data->uext); @@ -899,7 +899,7 @@ static int AllocUserData(MPI_Comm comm, N_Vector uu, UserData data) return -1; } - data->host_recv_buff = (realtype*) malloc(2*(mxsub + mysub)*sizeof(realtype)); + data->host_recv_buff = (sunrealtype*) malloc(2*(mxsub + mysub)*sizeof(sunrealtype)); if(data->host_recv_buff == NULL) { N_VDestroy(data->pp); free(data->uext); @@ -909,7 +909,7 @@ static int AllocUserData(MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local device send buffer */ - err = cudaMalloc((void**) &data->dev_send_buff, 2*(mxsub + mysub)*sizeof(realtype)); + err = cudaMalloc((void**) &data->dev_send_buff, 2*(mxsub + mysub)*sizeof(sunrealtype)); if(err != cudaSuccess) { printf("Failed to allocate dev_send_buff ... \n"); N_VDestroy(data->pp); @@ -921,7 +921,7 @@ static int AllocUserData(MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local device send buffer */ - err = cudaMalloc((void**) &data->dev_recv_buff, 2*(mxsub + mysub)*sizeof(realtype)); + err = cudaMalloc((void**) &data->dev_recv_buff, 2*(mxsub + mysub)*sizeof(sunrealtype)); if(err != cudaSuccess) { printf("Failed to allocate dev_recv_buff ... \n"); N_VDestroy(data->pp); @@ -962,17 +962,17 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data) { sunindextype i, iloc, j, jloc, loc; - realtype xfact, yfact; + sunrealtype xfact, yfact; /* Initialize uu. */ // Get host pointer - realtype *uudata = N_VGetHostArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(uu)); - realtype *iddata = N_VGetHostArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(id)); + sunrealtype *uudata = N_VGetHostArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(uu)); + sunrealtype *iddata = N_VGetHostArrayPointer_Raja(N_VGetLocalVector_MPIPlusX(id)); /* Set mesh spacings and subgrid indices for this PE. */ - const realtype dx = data->dx; - const realtype dy = data->dy; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; const int ixsub = data->ixsub; const int jysub = data->jysub; @@ -1024,7 +1024,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * Print first lines of output and table heading */ -static void PrintHeader(realtype rtol, realtype atol, UserData data) +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData data) { printf("\nidaHeat2D_kry_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -1057,9 +1057,9 @@ static void PrintHeader(realtype rtol, realtype atol, UserData data) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, ier; diff --git a/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c b/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c index 9e4d6d0cfc..9ac2ef18a9 100644 --- a/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c +++ b/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c @@ -165,8 +165,8 @@ typedef struct { int ns, np, thispe, npes, ixsub, jysub, npex, npey; int mxsub, mysub, nsmxsub, nsmxsub2; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], rhs[NUM_SPECIES], cext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; MPI_Comm comm; N_Vector rates; @@ -175,34 +175,34 @@ typedef struct { /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, void *user_data); /* Prototypes for supporting functions */ static void BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - int dsizex, int dsizey, realtype carray[]); + int dsizex, int dsizey, sunrealtype carray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]); + sunrealtype cext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]); + int dsizex, sunrealtype cext[], sunrealtype buffer[]); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(int size, realtype *x1, realtype *x2); +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2); /* Prototypes for private functions */ @@ -215,9 +215,9 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol); + sunrealtype rtol, sunrealtype atol); -static void PrintOutput(void *ida_mem, N_Vector cc, realtype time, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype time, UserData webdata, MPI_Comm comm); static void PrintFinalStats(void *ida_mem); @@ -237,7 +237,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; UserData webdata; sunindextype SystemSize, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; N_Vector cc, cp, res, id; int thispe, npes, maxl, iout, retval; SUNContext ctx; @@ -405,7 +405,7 @@ static void InitUserData(UserData webdata, int thispe, int npes, MPI_Comm comm) { int i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; webdata->jysub = thispe / NPEX; webdata->ixsub = thispe - (webdata->jysub)*NPEX; @@ -472,7 +472,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, N_Vector res, UserData webdata) { int ixsub, jysub, mxsub, mysub, np, ix, jy, is; - realtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; + sunrealtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; ixsub = webdata->ixsub; jysub = webdata->jysub; @@ -494,7 +494,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { if (is < np) - {cxy[is] = RCONST(10.0)+(realtype)(is+1)*xyfactor; idxy[is] = ONE;} + {cxy[is] = RCONST(10.0)+(sunrealtype)(is+1)*xyfactor; idxy[is] = ONE;} else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } @@ -524,7 +524,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol) + sunrealtype rtol, sunrealtype atol) { printf("\nidaFoodWeb_kry_bbd_p: Predator-prey DAE parallel example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -557,11 +557,11 @@ static void PrintHeader(sunindextype SystemSize, int maxl, * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector cc, realtype tt, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype tt, UserData webdata, MPI_Comm comm) { MPI_Status status; - realtype *cdata, clast[2], hused; + sunrealtype *cdata, clast[2], hused; long int nst; int i, kused, retval, thispe, npelast, ilast;; @@ -719,7 +719,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id * reslocal, for computation of the residuals on this processor. */ -static int resweb(realtype tt, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, void *user_data) { @@ -750,13 +750,13 @@ static int resweb(realtype tt, * and receive-waiting, in routines BRecvPost, BSend, BRecvWait. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, void *user_data) { UserData webdata; - realtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; int thispe, ixsub, jysub, nsmxsub, nsmysub; MPI_Comm comm; MPI_Request request[4]; @@ -793,7 +793,7 @@ static int rescomm(sunindextype Nlocal, realtype tt, /* * BRecvPost: Start receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. @@ -802,11 +802,11 @@ static int rescomm(sunindextype Nlocal, realtype tt, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]) + sunrealtype cext[], sunrealtype buffer[]) { int offsetce; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If jysub > 0, receive data for bottom x-line of cext. */ if (jysub != 0) @@ -836,18 +836,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * BRecvWait: Finish receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. */ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]) + int dsizex, sunrealtype cext[], sunrealtype buffer[]) { int i; int ly, dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -894,11 +894,11 @@ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, */ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, - int dsizex, int dsizey, realtype cdata[]) + int dsizex, int dsizey, sunrealtype cdata[]) { int i; int ly, offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If jysub > 0, send data from bottom x-line of cc. */ @@ -973,11 +973,11 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, * for use by the preconditioner setup routine. */ -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, void *user_data) { - realtype *cdata, *ratesxy, *cpxy, *resxy, + sunrealtype *cdata, *ratesxy, *cpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui; int ix, jy, is, i, locc, ylocce, locce; UserData webdata; @@ -1071,11 +1071,11 @@ static int reslocal(sunindextype Nlocal, realtype tt, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -1088,13 +1088,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(int size, realtype *x1, realtype *x2) +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2) { int i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; diff --git a/examples/ida/parallel/idaFoodWeb_kry_p.c b/examples/ida/parallel/idaFoodWeb_kry_p.c index c6410f5171..c24d2a97ab 100644 --- a/examples/ida/parallel/idaFoodWeb_kry_p.c +++ b/examples/ida/parallel/idaFoodWeb_kry_p.c @@ -171,12 +171,12 @@ typedef struct { sunindextype ns; int np, thispe, npes, ixsub, jysub, npex, npey; int mxsub, mysub, nsmxsub, nsmxsub2; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], rhs[NUM_SPECIES], cext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; MPI_Comm comm; N_Vector rates; - realtype **PP[MXSUB][MYSUB]; + sunrealtype **PP[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; N_Vector ewt; void *ida_mem; @@ -185,37 +185,37 @@ typedef struct { /* Prototypes for user-supplied and supporting functions. */ -static int resweb(realtype time, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); -static int Precondbd(realtype tt, N_Vector cc, N_Vector cp, - N_Vector rr, realtype cj, void *user_data); +static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, + N_Vector rr, sunrealtype cj, void *user_data); -static int PSolvebd(realtype tt, N_Vector cc, N_Vector cp, +static int PSolvebd(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype delta, void *user_data); + sunrealtype cj, sunrealtype delta, void *user_data); static int rescomm(N_Vector cc, N_Vector cp, void *user_data); static void BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - int dsizex, int dsizey, realtype carray[]); + int dsizex, int dsizey, sunrealtype carray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]); + sunrealtype cext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]); + int dsizex, sunrealtype cext[], sunrealtype buffer[]); -static int reslocal(realtype tt, N_Vector cc, N_Vector cp, N_Vector res, +static int reslocal(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(int size, realtype *x1, realtype *x2); +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2); /* Prototypes for private Helper Functions. */ @@ -231,9 +231,9 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, N_Vector scrtch, UserData webdata); static void PrintHeader(sunindextype SystemSize, int maxl, - realtype rtol, realtype atol); + sunrealtype rtol, sunrealtype atol); -static void PrintOutput(void *ida_mem, N_Vector cc, realtype time, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype time, UserData webdata, MPI_Comm comm); static void PrintFinalStats(void *ida_mem); @@ -253,7 +253,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; UserData webdata; sunindextype SystemSize, local_N; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; N_Vector cc, cp, res, id; int thispe, npes, maxl, iout, retval; SUNContext ctx; @@ -448,7 +448,7 @@ static void InitUserData(UserData webdata, int thispe, int npes, MPI_Comm comm) { int i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; webdata->jysub = thispe / NPEX; webdata->ixsub = thispe - (webdata->jysub)*NPEX; @@ -535,7 +535,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, N_Vector res, UserData webdata) { int ixsub, jysub, mxsub, mysub, np, ix, jy, is; - realtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; + sunrealtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; ixsub = webdata->ixsub; jysub = webdata->jysub; @@ -556,7 +556,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, cxy = IJ_Vptr(cc,ix,jy); idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { - if (is < np) { cxy[is] = RCONST(10.0) + (realtype)(is+1)*xyfactor; idxy[is] = ONE; } + if (is < np) { cxy[is] = RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } @@ -581,7 +581,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, */ static void PrintHeader(sunindextype SystemSize, int maxl, - realtype rtol, realtype atol) + sunrealtype rtol, sunrealtype atol) { printf("\nidaFoodWeb_kry_p: Predator-prey DAE parallel example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -614,11 +614,11 @@ static void PrintHeader(sunindextype SystemSize, int maxl, * (NOTE: This routine is specific to the case NUM_SPECIES = 2.) */ -static void PrintOutput(void *ida_mem, N_Vector cc, realtype tt, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype tt, UserData webdata, MPI_Comm comm) { MPI_Status status; - realtype *cdata, clast[2], hused; + sunrealtype *cdata, clast[2], hused; long int nst; int i, kused, retval, thispe, npelast, ilast;; @@ -771,7 +771,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id * reslocal, for computation of the residuals on this processor. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { int retval; @@ -803,7 +803,7 @@ static int rescomm(N_Vector cc, N_Vector cp, void *user_data) { UserData webdata; - realtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; int thispe, ixsub, jysub, nsmxsub, nsmysub; MPI_Comm comm; MPI_Request request[4]; @@ -841,11 +841,11 @@ static int rescomm(N_Vector cc, N_Vector cp, void *user_data) */ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, - int dsizex, int dsizey, realtype cdata[]) + int dsizex, int dsizey, sunrealtype cdata[]) { int i; int ly, offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If jysub > 0, send data from bottom x-line of cc. */ if (jysub != 0) @@ -883,7 +883,7 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, /* * BRecvPost: Start receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. @@ -892,11 +892,11 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]) + sunrealtype cext[], sunrealtype buffer[]) { int offsetce; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If jysub > 0, receive data for bottom x-line of cext. */ if (jysub != 0) @@ -926,18 +926,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * BRecvWait: Finish receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. */ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]) + int dsizex, sunrealtype cext[], sunrealtype buffer[]) { int i; int ly, dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -1013,10 +1013,10 @@ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, * for use by the preconditioner setup routine. */ -static int reslocal(realtype tt, N_Vector cc, N_Vector cp, N_Vector res, +static int reslocal(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { - realtype *cdata, *ratesxy, *cpxy, *resxy, + sunrealtype *cdata, *ratesxy, *cpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui; int ix, jy, is, i, locc, ylocce, locce; UserData webdata; @@ -1108,11 +1108,11 @@ static int reslocal(realtype tt, N_Vector cc, N_Vector cp, N_Vector res, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -1125,13 +1125,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(int size, realtype *x1, realtype *x2) +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2) { int i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); @@ -1148,19 +1148,19 @@ static realtype dotprod(int size, realtype *x1, realtype *x2) * Each block is LU-factored, for later solution of the linear systems. */ -static int Precondbd(realtype tt, N_Vector cc, N_Vector cp, - N_Vector rr, realtype cj, void *user_data) +static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, + N_Vector rr, sunrealtype cj, void *user_data) { int retval, thispe; sunindextype ret; - realtype uround; - realtype xx, yy, *cxy, *ewtxy, cctemp, **Pxy, *ratesxy, *Pxycol, *cpxy; - realtype inc, sqru, fac, perturb_rates[NUM_SPECIES]; + sunrealtype uround; + sunrealtype xx, yy, *cxy, *ewtxy, cctemp, **Pxy, *ratesxy, *Pxycol, *cpxy; + sunrealtype inc, sqru, fac, perturb_rates[NUM_SPECIES]; int is, js, ix, jy; UserData webdata; void *ida_mem; N_Vector ewt; - realtype hh; + sunrealtype hh; webdata = (UserData)user_data; uround = UNIT_ROUNDOFF; @@ -1222,11 +1222,11 @@ static int Precondbd(realtype tt, N_Vector cc, N_Vector cp, * preconditioner PP, to compute the solution of PP * zvec = rvec. */ -static int PSolvebd(realtype tt, N_Vector cc, N_Vector cp, +static int PSolvebd(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype delta, void *user_data) + sunrealtype cj, sunrealtype delta, void *user_data) { - realtype **Pxy, *zxy; + sunrealtype **Pxy, *zxy; sunindextype *pivot, ix, jy; UserData webdata; diff --git a/examples/ida/parallel/idaHeat2D_kry_bbd_p.c b/examples/ida/parallel/idaHeat2D_kry_bbd_p.c index a057deb334..6f8dc81866 100644 --- a/examples/ida/parallel/idaHeat2D_kry_bbd_p.c +++ b/examples/ida/parallel/idaHeat2D_kry_bbd_p.c @@ -73,34 +73,34 @@ typedef struct { int thispe, mx, my, ixsub, jysub, npex, npey, mxsub, mysub; sunindextype n_local; - realtype dx, dy, coeffx, coeffy, coeffxy; - realtype uext[(MXSUB+2)*(MYSUB+2)]; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype uext[(MXSUB+2)*(MYSUB+2)]; MPI_Comm comm; } *UserData; /* Prototypes of user-supplied and supporting functions */ -static int heatres(realtype tres, N_Vector uu, N_Vector up, +static int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uu, N_Vector up, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tres, +static int reslocal(sunindextype Nlocal, sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data); static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uarray[]); + sunrealtype uarray[]); static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static int BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype uext[], realtype buffer[]); + int dsizex, sunrealtype uext[], sunrealtype buffer[]); /* Prototypes of private functions */ @@ -109,11 +109,11 @@ static int InitUserData(int thispe, MPI_Comm comm, UserData data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data); -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol); +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol); static void PrintCase(int case_number, sunindextype mudq, sunindextype mukeep); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) UserData data; int thispe, iout, retval, npes; sunindextype Neq, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uu, up, constraints, id, res; SUNContext ctx; @@ -349,7 +349,7 @@ int main(int argc, char *argv[]) * of uu required to calculate the residual. */ -static int heatres(realtype tres, N_Vector uu, N_Vector up, +static int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data) { int retval; @@ -375,11 +375,11 @@ static int heatres(realtype tres, N_Vector uu, N_Vector up, * communication of data in u needed to calculate G. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uu, N_Vector up, void *user_data) { UserData data; - realtype *uarray, *uext, buffer[2*MYSUB]; + sunrealtype *uarray, *uext, buffer[2*MYSUB]; MPI_Comm comm; int thispe, ixsub, jysub, mxsub, mysub; MPI_Request request[4]; @@ -412,12 +412,12 @@ static int rescomm(sunindextype Nlocal, realtype tt, * has already been done, and that this data is in the work array uext. */ -static int reslocal(sunindextype Nlocal, realtype tres, +static int reslocal(sunindextype Nlocal, sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data) { - realtype *uext, *uuv, *upv, *resv; - realtype termx, termy, termctr; + sunrealtype *uext, *uuv, *upv, *resv; + sunrealtype termx, termy, termctr; int lx, ly, offsetu, offsetue, locu, locue; int ixsub, jysub, mxsub, mxsub2, mysub, npex, npey; int ixbegin, ixend, jybegin, jyend; @@ -483,10 +483,10 @@ static int reslocal(sunindextype Nlocal, realtype tres, static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uarray[]) + sunrealtype uarray[]) { int ly, offsetu; - realtype bufleft[MYSUB], bufright[MYSUB]; + sunrealtype bufleft[MYSUB], bufright[MYSUB]; /* If jysub > 0, send data from bottom x-line of u. */ @@ -528,7 +528,7 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -538,11 +538,11 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { int offsetue; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) @@ -575,7 +575,7 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -583,11 +583,11 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, */ static int BRecvWait(MPI_Request request[], int ixsub, - int jysub, int dsizex, realtype uext[], - realtype buffer[]) + int jysub, int dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int ly, dsizex2, offsetue; - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; MPI_Status status; dsizex2 = dsizex + 2; @@ -666,7 +666,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, { int i, iloc, j, jloc, offset, loc, ixsub, jysub; int ixbegin, ixend, jybegin, jyend; - realtype xfact, yfact, *udata, *iddata; + sunrealtype xfact, yfact, *udata, *iddata; /* Initialize uu. */ @@ -719,7 +719,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * and table heading */ -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_kry_bbd_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -765,9 +765,9 @@ static void PrintCase(int case_number, sunindextype mudq, sunindextype mukeep) * Print integrator statistics and max-norm of solution */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype umax, hused; + sunrealtype umax, hused; int kused, retval; long int nst, nni, nre, nli, npe, nps, nreLS, nge; diff --git a/examples/ida/parallel/idaHeat2D_kry_p.c b/examples/ida/parallel/idaHeat2D_kry_p.c index a09fc40e2a..6521b54d21 100644 --- a/examples/ida/parallel/idaHeat2D_kry_p.c +++ b/examples/ida/parallel/idaHeat2D_kry_p.c @@ -69,47 +69,47 @@ typedef struct { int thispe, npex, npey, ixsub, jysub; sunindextype mx, my, mxsub, mysub; - realtype dx, dy, coeffx, coeffy, coeffxy; - realtype *uext; - realtype *send_buff; - realtype *recv_buff; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype *uext; + sunrealtype *send_buff; + sunrealtype *recv_buff; N_Vector pp; /* vector of diagonal preconditioner elements */ MPI_Comm comm; } *UserData; /* User-supplied residual function and supporting routines */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); static int rescomm(N_Vector uu, N_Vector up, UserData data); -static int reslocal(realtype tt, N_Vector uu, N_Vector up, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector res, UserData data); static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - const realtype uarray[], realtype* send_buffer); + const sunrealtype uarray[], sunrealtype* send_buffer); static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype recv_buff[]); + sunrealtype recv_buff[]); static int BRecvWait(MPI_Request request[], int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype uext[], const realtype recv_buff[]); + sunrealtype uext[], const sunrealtype recv_buff[]); /* User-supplied preconditioner routines */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, - N_Vector rvec, N_Vector zvec, realtype c_j, - realtype delta, void *user_data); +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, + N_Vector rvec, N_Vector zvec, sunrealtype c_j, + sunrealtype delta, void *user_data); -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data); /* Private function to check function return values */ @@ -122,9 +122,9 @@ static int DeleteUserData(UserData data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data); -static void PrintHeader(realtype rtol, realtype atol, UserData data); +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData data); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -144,7 +144,7 @@ int main(int argc, char *argv[]) UserData data; int iout, thispe, retval, npes; sunindextype Neq, local_N; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uu, up, constraints, id, res; SUNContext ctx; @@ -323,7 +323,7 @@ int main(int argc, char *argv[]) * of uu required to calculate the residual. */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { int retval = 0; @@ -356,8 +356,8 @@ int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, * */ -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data) +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data) { sunindextype lx, ly, ixbegin, ixend, jybegin, jyend, locu; @@ -369,10 +369,10 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, const int npey = data->npey; const sunindextype mxsub = data->mxsub; const sunindextype mysub = data->mysub; - realtype *ppv = N_VGetArrayPointer(data->pp); + sunrealtype *ppv = N_VGetArrayPointer(data->pp); /* Calculate the value for the inverse of the diagonal preconditioner */ - const realtype pelinv = ONE/(c_j + data->coeffxy); + const sunrealtype pelinv = ONE/(c_j + data->coeffxy); /* Initially set all pp elements to one. */ N_VConst(ONE, data->pp); @@ -408,9 +408,9 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, * computed in PsetupHeat), returning the result in zvec. */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData data = (UserData) user_data; @@ -447,10 +447,10 @@ static int rescomm(N_Vector uu, N_Vector up, UserData data) const sunindextype mysub = data->mysub; /* Get solution vector data, buffers, extended array uext. */ - const realtype *uarray = N_VGetArrayPointer(uu); - realtype *uext = data->uext; - realtype *send_buffer = data->send_buff; - realtype *recv_buff = data->recv_buff; + const sunrealtype *uarray = N_VGetArrayPointer(uu); + sunrealtype *uext = data->uext; + sunrealtype *send_buffer = data->send_buff; + sunrealtype *recv_buff = data->recv_buff; /* Start receiving boundary data from neighboring PEs. */ BRecvPost(comm, request, thispe, ixsub, jysub, npex, npey, mxsub, mysub, recv_buff); @@ -471,10 +471,10 @@ static int rescomm(N_Vector uu, N_Vector up, UserData data) * has already been done, and that this data is in the work array uext. */ -static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, UserData data) { - realtype termx, termy, termctr; + sunrealtype termx, termy, termctr; sunindextype lx, ly; sunindextype locu, locue; sunindextype ixbegin, ixend, jybegin, jyend; @@ -489,10 +489,10 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, const sunindextype mysub = data->mysub; /* Vector data arrays, extended work array uext. */ - const realtype *uuv = N_VGetArrayPointer(uu); - const realtype *upv = N_VGetArrayPointer(up); - realtype *resv = N_VGetArrayPointer(rr); - realtype *uext = data->uext; + const sunrealtype *uuv = N_VGetArrayPointer(uu); + const sunrealtype *upv = N_VGetArrayPointer(up); + sunrealtype *resv = N_VGetArrayPointer(rr); + sunrealtype *uext = data->uext; /* Initialize all elements of rr to uu. This sets the boundary elements simply without indexing hassles. */ @@ -542,14 +542,14 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - const realtype uarray[], realtype *send_buffer) + const sunrealtype uarray[], sunrealtype *send_buffer) { sunindextype lx, ly; /* Have left, right, top and bottom buffers use the same send_buffer. */ - realtype *bufleft = send_buffer; - realtype *bufright = send_buffer + mysub; - realtype *buftop = send_buffer + 2*mysub; - realtype *bufbottom = send_buffer + 2*mysub + mxsub; + sunrealtype *bufleft = send_buffer; + sunrealtype *bufright = send_buffer + mysub; + sunrealtype *buftop = send_buffer + 2*mysub; + sunrealtype *bufbottom = send_buffer + 2*mysub + mxsub; /* If jysub > 0, send data from bottom x-line of u. (via bufbottom) */ @@ -594,7 +594,7 @@ static int BSend(MPI_Comm comm, int thispe, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -604,13 +604,13 @@ static int BSend(MPI_Comm comm, int thispe, static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype recv_buff[]) + sunrealtype recv_buff[]) { /* Have left, right, top and bottom buffers use the same recv_buff. */ - realtype *bufleft = recv_buff; - realtype *bufright = recv_buff + mysub; - realtype *buftop = recv_buff + 2*mysub; - realtype *bufbottom = recv_buff + 2*mysub + mxsub; + sunrealtype *bufleft = recv_buff; + sunrealtype *bufright = recv_buff + mysub; + sunrealtype *buftop = recv_buff + 2*mysub; + sunrealtype *bufbottom = recv_buff + 2*mysub + mxsub; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) { @@ -643,7 +643,7 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -653,13 +653,13 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, static int BRecvWait(MPI_Request request[], int ixsub, int jysub, int npex, int npey, sunindextype mxsub, sunindextype mysub, - realtype uext[], const realtype recv_buff[]) + sunrealtype uext[], const sunrealtype recv_buff[]) { MPI_Status status; - const realtype *bufleft = recv_buff; - const realtype *bufright = recv_buff + mysub; - const realtype *buftop = recv_buff + 2*mysub; - const realtype *bufbottom = recv_buff + 2*mysub + mxsub; + const sunrealtype *bufleft = recv_buff; + const sunrealtype *bufright = recv_buff + mysub; + const sunrealtype *buftop = recv_buff + 2*mysub; + const sunrealtype *bufbottom = recv_buff + 2*mysub + mxsub; sunindextype ly, lx, offsetue; const sunindextype mxsub2 = mxsub + 2; const sunindextype mysub1 = mysub + 1; @@ -763,7 +763,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local extended vector (includes ghost nodes) */ - data->uext = (realtype*) malloc((data->mxsub + 2)*(data->mysub +2)*sizeof(realtype)); + data->uext = (sunrealtype*) malloc((data->mxsub + 2)*(data->mysub +2)*sizeof(sunrealtype)); if(data->uext == NULL) { N_VDestroy(data->pp); MPI_Abort(comm, 1); @@ -771,7 +771,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) } /* Allocate local host send buffer */ - data->send_buff = (realtype*) malloc(2*(data->mxsub + data->mysub)*sizeof(realtype)); + data->send_buff = (sunrealtype*) malloc(2*(data->mxsub + data->mysub)*sizeof(sunrealtype)); if(data->send_buff == NULL) { N_VDestroy(data->pp); free(data->uext); @@ -779,7 +779,7 @@ static int AllocUserData(int thispe, MPI_Comm comm, N_Vector uu, UserData data) return -1; } - data->recv_buff = (realtype*) malloc(2*(data->mxsub + data->mysub)*sizeof(realtype)); + data->recv_buff = (sunrealtype*) malloc(2*(data->mxsub + data->mysub)*sizeof(sunrealtype)); if(data->recv_buff == NULL) { N_VDestroy(data->pp); free(data->uext); @@ -813,16 +813,16 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data) { sunindextype i, iloc, j, jloc, loc; - realtype xfact, yfact; + sunrealtype xfact, yfact; /* Initialize uu. */ - realtype *uudata = N_VGetArrayPointer(uu); - realtype *iddata = N_VGetArrayPointer(id); + sunrealtype *uudata = N_VGetArrayPointer(uu); + sunrealtype *iddata = N_VGetArrayPointer(id); /* Set mesh spacings and subgrid indices for this PE. */ - const realtype dx = data->dx; - const realtype dy = data->dy; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; const int ixsub = data->ixsub; const int jysub = data->jysub; @@ -869,7 +869,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * Print first lines of output and table heading */ -static void PrintHeader(realtype rtol, realtype atol, UserData data) +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData data) { printf("\nidaHeat2D_kry_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -902,9 +902,9 @@ static void PrintHeader(realtype rtol, realtype atol, UserData data) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/ida/petsc/idaHeat2D_petsc_snes.c b/examples/ida/petsc/idaHeat2D_petsc_snes.c index 7939742096..3794e7b2ea 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_snes.c +++ b/examples/ida/petsc/idaHeat2D_petsc_snes.c @@ -93,7 +93,7 @@ typedef struct { /* User-supplied residual function */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); int jacHeat(SNES snes, Vec x, Mat Jpre, Mat J, void *user_data); /* User-supplied preconditioner routines */ @@ -107,9 +107,9 @@ int PsolveHeat(PC pc, Vec x, Vec y); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, void *user_data); -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol); +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu, SNES snes); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu, SNES snes); static void PrintFinalStats(void *ida_mem, SNES snes); @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) { MPI_Comm comm; int iout, thispe, retval, npes; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; sunindextype Neq; PetscBool pre, jac; /* declare SUNDIALS data structures */ @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) * */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { PetscErrorCode ierr; @@ -730,7 +730,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * Print first lines of output and table heading */ -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_kry_petscsnes: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -763,9 +763,9 @@ static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu, SNES snes) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu, SNES snes) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, njve, nre, nreLS, npe, nps; int kused; PetscInt nli; diff --git a/examples/ida/petsc/idaHeat2D_petsc_spgmr.c b/examples/ida/petsc/idaHeat2D_petsc_spgmr.c index 47f0221d3d..c616778549 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_spgmr.c +++ b/examples/ida/petsc/idaHeat2D_petsc_spgmr.c @@ -84,25 +84,25 @@ typedef struct { /* User-supplied residual function */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); /* User-supplied preconditioner routines */ -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, realtype c_j, void *user_data); +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, + N_Vector rr, sunrealtype c_j, void *user_data); -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data); + sunrealtype c_j, sunrealtype delta, void *user_data); /* Private function to check function return values */ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, void *user_data); -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol); +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) UserData data; int iout, thispe, retval, npes; sunindextype Neq; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uu, up, constraints, id, res; PetscErrorCode ierr; /* PETSc error code */ Vec uvec; @@ -330,7 +330,7 @@ int main(int argc, char *argv[]) * */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { PetscErrorCode ierr; @@ -436,8 +436,8 @@ int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, * */ -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, realtype c_j, void *user_data) +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, + N_Vector rr, sunrealtype c_j, void *user_data) { PetscErrorCode ierr; PetscInt i, j, Mx, My, xs, ys, xm, ym; @@ -498,9 +498,9 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, * computed in PsetupHeat), returning the result in zvec. */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData data; @@ -607,7 +607,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * Print first lines of output and table heading */ -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_kry_petsc: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -640,9 +640,9 @@ static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, njve, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/ida/raja/idaHeat2D_kry_raja.cpp b/examples/ida/raja/idaHeat2D_kry_raja.cpp index 8fa5c08abc..322cded013 100644 --- a/examples/ida/raja/idaHeat2D_kry_raja.cpp +++ b/examples/ida/raja/idaHeat2D_kry_raja.cpp @@ -39,7 +39,7 @@ #include /* prototypes for IDA methods */ #include /* access to RAJA N_Vector */ #include /* access to spgmr SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ #include @@ -68,8 +68,8 @@ struct _UserData { sunindextype mm; /* number of grid points in one dimension */ sunindextype neq; /* number of equations */ - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; N_Vector pp; /* vector of prec. diag. elements */ }; @@ -77,24 +77,24 @@ typedef _UserData *UserData; /* Prototypes for functions called by IDA */ -int resHeat(realtype tres, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data); + sunrealtype c_j, void *prec_data); -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data); + sunrealtype c_j, sunrealtype delta, void *prec_data); /* Prototypes for private functions */ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res); -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector uu); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu); static int check_flag(void *flagvalue, const char *funcname, int opt); /* @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) UserData data; N_Vector uu, up, constraints, res; int ier, iout; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; long int netf, ncfn, ncfl; SUNLinearSolver LS; @@ -325,18 +325,18 @@ int main(int argc, char *argv[]) * while for each boundary point, it is res_i = u_i. */ -int resHeat(realtype tt, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { const sunindextype zero = 0; sunindextype mm; - realtype coeff; + sunrealtype coeff; UserData data; - const realtype *uu_data = N_VGetDeviceArrayPointer_Raja(uu); - const realtype *up_data = N_VGetDeviceArrayPointer_Raja(up); - realtype *rr_data = N_VGetDeviceArrayPointer_Raja(rr); + const sunrealtype *uu_data = N_VGetDeviceArrayPointer_Raja(uu); + const sunrealtype *up_data = N_VGetDeviceArrayPointer_Raja(up); + sunrealtype *rr_data = N_VGetDeviceArrayPointer_Raja(rr); data = (UserData) user_data; @@ -352,8 +352,8 @@ int resHeat(realtype tt, rr_data[loc] = uu_data[loc]; } else { /* Loop over interior points; set res = up - (central difference). */ - realtype dif1 = uu_data[loc-1] + uu_data[loc+1] - TWO * uu_data[loc]; - realtype dif2 = uu_data[loc-mm] + uu_data[loc+mm] - TWO * uu_data[loc]; + sunrealtype dif1 = uu_data[loc-1] + uu_data[loc+1] - TWO * uu_data[loc]; + sunrealtype dif2 = uu_data[loc-mm] + uu_data[loc+mm] - TWO * uu_data[loc]; rr_data[loc] = up_data[loc] - coeff * ( dif1 + dif2 ); } } @@ -379,19 +379,19 @@ int resHeat(realtype tt, * pp etc.) are used from the PsetupdHeat argument list. */ -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data) + sunrealtype c_j, void *prec_data) { const sunindextype zero = 0; sunindextype mm; - realtype *ppv; + sunrealtype *ppv; UserData data; data = (UserData) prec_data; ppv = N_VGetDeviceArrayPointer_Raja(data->pp); mm = data->mm; - realtype coeff = data->coeff; + sunrealtype coeff = data->coeff; RAJA::forall< MY_EXEC >(RAJA::RangeSegment(zero, mm*mm), [=] RAJA_DEVICE (sunindextype loc) { @@ -417,10 +417,10 @@ int PsetupHeat(realtype tt, * computed in PrecondHeateq), returning the result in zvec. */ -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data) + sunrealtype c_j, sunrealtype delta, void *prec_data) { UserData data; data = (UserData) prec_data; @@ -443,7 +443,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, { sunindextype mm, mm1, i, j; const sunindextype zero = 0; - realtype xfact, yfact, *udata, *updata; + sunrealtype xfact, yfact, *udata, *updata; mm = data->mm; @@ -490,7 +490,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_kry: Heat equation, serial example problem for IDA \n"); printf(" Discretized heat equation on 2D unit square. \n"); @@ -513,9 +513,9 @@ static void PrintHeader(realtype rtol, realtype atol) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, ier; diff --git a/examples/ida/serial/idaAnalytic_mels.c b/examples/ida/serial/idaAnalytic_mels.c index 807bc5ca87..b3babe5349 100644 --- a/examples/ida/serial/idaAnalytic_mels.c +++ b/examples/ida/serial/idaAnalytic_mels.c @@ -31,7 +31,7 @@ #include #include /* prototypes for IDA fcts., consts. */ #include /* access to serial N_Vector */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -45,21 +45,21 @@ #endif /* User-supplied functions called by IDA */ -int fres(realtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); +int fres(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); /* Custom linear solver data structure, accessor macros, and routines */ static SUNLinearSolver MatrixEmbeddedLS(void *ida_mem, SUNContext ctx); static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S); static int MatrixEmbeddedLSSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol); + N_Vector b, sunrealtype tol); static int MatrixEmbeddedLSFree(SUNLinearSolver S); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static void analytical_solution(realtype t, N_Vector y, N_Vector yp); -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static void analytical_solution(sunrealtype t, N_Vector y, N_Vector yp); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Main Program */ int main(void) @@ -68,13 +68,13 @@ int main(void) SUNContext ctx; /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ - realtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ + sunrealtype dTout = RCONST(0.1); /* time between outputs */ sunindextype NEQ = 2; /* number of dependent vars. */ - realtype reltol = RCONST(1.0e-4); /* tolerances */ - realtype abstol = RCONST(1.0e-9); - realtype alpha = RCONST(10.0); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-4); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-9); + sunrealtype alpha = RCONST(10.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -82,7 +82,7 @@ int main(void) N_Vector yp = NULL; /* empty vector for storing solution derivative */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *ida_mem = NULL; /* empty IDA memory structure */ - realtype t, tout; + sunrealtype t, tout; long int nst, nre, nni, netf, ncfn, nreLS; /* Initial diagnostics output */ @@ -186,15 +186,15 @@ int main(void) 0 = (1-alpha)/(t-2)*x1 - x1 + (alpha-1)*x2 + 2*exp(t) - x1'(t) 0 = (t+2)*x1 - (t+2)*exp(t) */ -int fres(realtype t, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int fres(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype alpha = rdata[0]; /* set shortcut for stiffness parameter */ - realtype x1 = NV_Ith_S(yy,0); /* access current solution values */ - realtype x2 = NV_Ith_S(yy,1); - realtype x1p = NV_Ith_S(yp,0); /* access current derivative values */ - realtype ONE = RCONST(1.0); - realtype TWO = RCONST(2.0); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype alpha = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype x1 = NV_Ith_S(yy,0); /* access current solution values */ + sunrealtype x2 = NV_Ith_S(yy,1); + sunrealtype x1p = NV_Ith_S(yp,0); /* access current derivative values */ + sunrealtype ONE = RCONST(1.0); + sunrealtype TWO = RCONST(2.0); NV_Ith_S(rr,0) = (ONE-alpha)/(t-TWO)*x1 - x1 + (alpha-ONE)*x2 + TWO*exp(t) - x1p; NV_Ith_S(rr,1) = (t+TWO)*x1 - (t+TWO)*SUNRexp(t); @@ -233,18 +233,18 @@ static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S) /* linear solve routine */ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { /* temporary variables */ int retval; N_Vector yypred, yppred, yyn, ypn, res; - realtype tcur, cj; + sunrealtype tcur, cj; void *user_data; - realtype *rdata; - realtype alpha; - realtype a11, a12, a21, b1, b2; - realtype ONE = RCONST(1.0); - realtype TWO = RCONST(2.0); + sunrealtype *rdata; + sunrealtype alpha; + sunrealtype a11, a12, a21, b1, b2; + sunrealtype ONE = RCONST(1.0); + sunrealtype TWO = RCONST(2.0); /* retrieve implicit system data from IDA */ retval = IDAGetNonlinearSystemData(LS->content, &tcur, &yypred, &yppred, @@ -253,7 +253,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, return(-1); /* extract stiffness parameter from user_data */ - rdata = (realtype *) user_data; + rdata = (sunrealtype *) user_data; alpha = rdata[0]; /* perform linear solve: A*x=b @@ -325,7 +325,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) } /* routine to fill analytical solution and its derivative */ -static void analytical_solution(realtype t, N_Vector y, N_Vector yp) +static void analytical_solution(sunrealtype t, N_Vector y, N_Vector yp) { NV_Ith_S(y,0) = SUNRexp(t); NV_Ith_S(y,1) = SUNRexp(t)/(t-RCONST(2.0)); @@ -334,14 +334,14 @@ static void analytical_solution(realtype t, N_Vector y, N_Vector yp) } /* check the computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) retval */ N_Vector ytrue; /* true solution vector */ N_Vector ewt; /* error weight vector */ N_Vector abstol; /* absolute tolerance vector */ - realtype err; /* wrms error */ - realtype ONE = RCONST(1.0); + sunrealtype err; /* wrms error */ + sunrealtype ONE = RCONST(1.0); /* create solution and error weight vectors */ ytrue = N_VClone(y); diff --git a/examples/ida/serial/idaFoodWeb_bnd.c b/examples/ida/serial/idaFoodWeb_bnd.c index 1890be4f0d..6f26180a06 100644 --- a/examples/ida/serial/idaFoodWeb_bnd.c +++ b/examples/ida/serial/idaFoodWeb_bnd.c @@ -96,7 +96,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants. */ @@ -142,14 +142,14 @@ typedef struct { sunindextype Neq, ns, np, mx, my; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; N_Vector rates; } *UserData; /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); /* Prototypes for private Helper Functions. */ @@ -157,13 +157,13 @@ static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, static void InitUserData(UserData webdata); static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata); -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol); -static void PrintOutput(void *mem, N_Vector c, realtype t); +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, N_Vector c, sunrealtype t); static void PrintFinalStats(void *mem); -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -179,7 +179,7 @@ int main() N_Vector cc, cp, id; int iout, retval; sunindextype mu, ml; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; SUNMatrix A; SUNLinearSolver LS; SUNContext ctx; @@ -319,11 +319,11 @@ int main() * using cp in the case of prey species. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { sunindextype jx, jy, is, yloc, loc, np; - realtype *resv, *cpv; + sunrealtype *resv, *cpv; UserData webdata; webdata = (UserData)user_data; @@ -368,7 +368,7 @@ static int resweb(realtype tt, N_Vector cc, N_Vector cp, static void InitUserData(UserData webdata) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; webdata->mx = MX; webdata->my = MY; @@ -419,8 +419,8 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata) { sunindextype loc, yloc, is, jx, jy, np; - realtype xx, yy, xyfactor; - realtype *ccv, *cpv, *idv; + sunrealtype xx, yy, xyfactor; + sunrealtype *ccv, *cpv, *idv; ccv = N_VGetArrayPointer(cc); cpv = N_VGetArrayPointer(cp); @@ -439,7 +439,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (realtype)(is+1) * xyfactor; + ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { @@ -469,7 +469,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, * Print first lines of output (problem description) */ -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol) +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol) { printf("\nidaFoodWeb_bnd: Predator-prey DAE serial example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -497,11 +497,11 @@ static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtyp * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *mem, N_Vector c, realtype t) +static void PrintOutput(void *mem, N_Vector c, sunrealtype t) { int i, kused, retval; long int nst; - realtype *c_bl, *c_tr, hused; + sunrealtype *c_bl, *c_tr, hused; retval = IDAGetLastOrder(mem, &kused); check_retval(&retval, "IDAGetLastOrder", 1); @@ -578,11 +578,11 @@ static void PrintFinalStats(void *mem) * The interaction term is computed by the function WebRates. */ -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata) { sunindextype jx, jy, is, idyu, idyl, idxu, idxl; - realtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; + sunrealtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; /* Loop over grid points, evaluate interaction vector (length ns), form diffusion difference terms, and load crate. */ @@ -629,11 +629,11 @@ static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -646,13 +646,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); diff --git a/examples/ida/serial/idaFoodWeb_kry.c b/examples/ida/serial/idaFoodWeb_kry.c index 4c1ead2956..a260b86ea5 100644 --- a/examples/ida/serial/idaFoodWeb_kry.c +++ b/examples/ida/serial/idaFoodWeb_kry.c @@ -96,7 +96,7 @@ #include /* access to serial N_Vector */ #include /* access to spgmr SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* helpful macros */ @@ -148,9 +148,9 @@ typedef struct { sunindextype Neq, ns, np, mx, my; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; - realtype **PP[MX][MY]; + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; + sunrealtype **PP[MX][MY]; sunindextype *pivot[MX][MY]; N_Vector rates; N_Vector ewt; @@ -159,30 +159,30 @@ typedef struct { /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); -static int Precond(realtype tt, +static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, - realtype cj, void *user_data); + sunrealtype cj, void *user_data); -static int PSolve(realtype tt, +static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype delta, void *user_data); + sunrealtype cj, sunrealtype delta, void *user_data); /* Prototypes for private Helper Functions. */ static void InitUserData(UserData webdata); static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata); -static void PrintHeader(int maxl, realtype rtol, realtype atol); -static void PrintOutput(void *mem, N_Vector c, realtype t); +static void PrintHeader(int maxl, sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, N_Vector c, sunrealtype t); static void PrintFinalStats(void *mem); -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -198,7 +198,7 @@ int main() N_Vector cc, cp, id; int iout, jx, jy, retval; int maxl; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; SUNLinearSolver LS; SUNContext ctx; @@ -357,11 +357,11 @@ int main() * using cp in the case of prey species. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { sunindextype jx, jy, is, yloc, loc, np; - realtype *resv, *cpv; + sunrealtype *resv, *cpv; UserData webdata; webdata = (UserData)user_data; @@ -394,19 +394,19 @@ static int resweb(realtype tt, N_Vector cc, N_Vector cp, } -static int Precond(realtype tt, +static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, - realtype cj, void *user_data) + sunrealtype cj, void *user_data) { int retval; sunindextype ret; - realtype uround, xx, yy, del_x, del_y; - realtype **Pxy, *ratesxy, *Pxycol, *cxy, *cpxy, *ewtxy, cctmp; - realtype inc, fac, sqru, perturb_rates[NUM_SPECIES]; + sunrealtype uround, xx, yy, del_x, del_y; + sunrealtype **Pxy, *ratesxy, *Pxycol, *cxy, *cpxy, *ewtxy, cctmp; + sunrealtype inc, fac, sqru, perturb_rates[NUM_SPECIES]; int is, js, jx, jy; void *mem; N_Vector ewt; - realtype hh; + sunrealtype hh; UserData webdata; webdata = (UserData) user_data; @@ -463,13 +463,13 @@ static int Precond(realtype tt, } -static int PSolve(realtype tt, +static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype dalta, + sunrealtype cj, sunrealtype dalta, void *user_data) { - realtype **Pxy, *zxy; + sunrealtype **Pxy, *zxy; sunindextype *pivot; int jx, jy; UserData webdata; @@ -506,7 +506,7 @@ static int PSolve(realtype tt, static void InitUserData(UserData webdata) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; webdata->mx = MX; webdata->my = MY; @@ -557,8 +557,8 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata) { sunindextype loc, yloc, is, jx, jy, np; - realtype xx, yy, xyfactor; - realtype *ccv, *cpv, *idv; + sunrealtype xx, yy, xyfactor; + sunrealtype *ccv, *cpv, *idv; ccv = N_VGetArrayPointer(cc); cpv = N_VGetArrayPointer(cp) ; @@ -577,7 +577,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (realtype)(is+1) * xyfactor; + ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { @@ -607,7 +607,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, * Print first lines of output (problem description) */ -static void PrintHeader(int maxl, realtype rtol, realtype atol) +static void PrintHeader(int maxl, sunrealtype rtol, sunrealtype atol) { printf("\nidaFoodWeb_kry: Predator-prey DAE serial example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -635,11 +635,11 @@ static void PrintHeader(int maxl, realtype rtol, realtype atol) * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *mem, N_Vector c, realtype t) +static void PrintOutput(void *mem, N_Vector c, sunrealtype t) { int i, kused, retval; long int nst; - realtype *c_bl, *c_tr, hused; + sunrealtype *c_bl, *c_tr, hused; retval = IDAGetLastOrder(mem, &kused); check_retval(&retval, "IDAGetLastOrder", 1); @@ -713,11 +713,11 @@ static void PrintFinalStats(void *mem) * The interaction term is computed by the function WebRates. */ -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata) { sunindextype jx, jy, is, idyu, idyl, idxu, idxl; - realtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; + sunrealtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; /* Loop over grid points, evaluate interaction vector (length ns), form diffusion difference terms, and load crate. */ @@ -764,11 +764,11 @@ static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -781,13 +781,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); diff --git a/examples/ida/serial/idaHeat2D_bnd.c b/examples/ida/serial/idaHeat2D_bnd.c index 6f5d86ddc4..47a9b5ca8f 100644 --- a/examples/ida/serial/idaHeat2D_bnd.c +++ b/examples/ida/serial/idaHeat2D_bnd.c @@ -44,7 +44,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -60,18 +60,18 @@ typedef struct { sunindextype mm; - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; } *UserData; /* Prototypes of functions called by IDA */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector u); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector u); static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res); @@ -91,7 +91,7 @@ int main(void) int retval, iout; long int netf, ncfn; sunindextype mu, ml; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; SUNMatrix A; SUNLinearSolver LS; SUNContext ctx; @@ -228,11 +228,11 @@ int main(void) * while for each boundary point, it is res_i = u_i. */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data) { sunindextype mm, i, j, offset, loc; - realtype *uv, *upv, *resv, coeff; + sunrealtype *uv, *upv, *resv, coeff; UserData data; uv = N_VGetArrayPointer(uu); upv = N_VGetArrayPointer(up); resv = N_VGetArrayPointer(resval); @@ -271,7 +271,7 @@ int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res) { - realtype xfact, yfact, *udata, *updata, *iddata; + sunrealtype xfact, yfact, *udata, *updata, *iddata; sunindextype mm, mm1, i, j, offset, loc; mm = data->mm; @@ -322,7 +322,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_bnd: Heat equation, serial example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -357,10 +357,10 @@ static void PrintHeader(realtype rtol, realtype atol) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { int retval; - realtype umax, hused; + sunrealtype umax, hused; long int nst, nni, nje, nre, nreLS; int kused; diff --git a/examples/ida/serial/idaHeat2D_klu.c b/examples/ida/serial/idaHeat2D_klu.c index 111972264c..1160b4bb37 100644 --- a/examples/ida/serial/idaHeat2D_klu.c +++ b/examples/ida/serial/idaHeat2D_klu.c @@ -44,7 +44,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Problem Constants */ @@ -62,29 +62,29 @@ typedef struct { sunindextype mm; - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; } *UserData; /* Prototypes of functions called by IDA */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int jacHeat(realtype tt, realtype cj, +int jacHeat(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Exact same setup as jacHeat. Function needed for special case MGRID=3 */ -int jacHeat3(realtype tt, realtype cj, +int jacHeat3(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector u); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector u); static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res); @@ -103,7 +103,7 @@ int main(void) N_Vector uu, up, constraints, id, res; int retval, iout; long int netf, ncfn; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; SUNMatrix A; SUNLinearSolver LS; sunindextype nnz; @@ -253,11 +253,11 @@ int main(void) * while for each boundary point, it is res_i = u_i. */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data) { sunindextype mm, i, j, offset, loc; - realtype *uv, *upv, *resv, coeff; + sunrealtype *uv, *upv, *resv, coeff; UserData data; uv = N_VGetArrayPointer(uu); upv = N_VGetArrayPointer(up); resv = N_VGetArrayPointer(resval); @@ -284,17 +284,17 @@ int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, } /* Jacobian matrix setup for MGRID=3 */ -int jacHeat3(realtype tt, realtype cj, +int jacHeat3(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype dx = ONE/(MGRID - ONE); - realtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype dx = ONE/(MGRID - ONE); + sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); SUNMatZero(JJ); @@ -347,18 +347,18 @@ int jacHeat3(realtype tt, realtype cj, } /* Jacobian matrix setup for MGRID>=4 */ -int jacHeat(realtype tt, realtype cj, +int jacHeat(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype dx = ONE/(MGRID - ONE); - realtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype dx = ONE/(MGRID - ONE); + sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; int i,j, repeat=0; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); SUNMatZero(JJ); @@ -604,7 +604,7 @@ int jacHeat(realtype tt, realtype cj, static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res) { - realtype xfact, yfact, *udata, *updata, *iddata; + sunrealtype xfact, yfact, *udata, *updata, *iddata; sunindextype mm, mm1, i, j, offset, loc; mm = data->mm; @@ -655,7 +655,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_klu: Heat equation, serial example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -690,10 +690,10 @@ static void PrintHeader(realtype rtol, realtype atol) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { int retval; - realtype umax, hused; + sunrealtype umax, hused; long int nst, nni, nje, nre; int kused; diff --git a/examples/ida/serial/idaHeat2D_kry.c b/examples/ida/serial/idaHeat2D_kry.c index fa5f8002b8..a0ca85b9f8 100644 --- a/examples/ida/serial/idaHeat2D_kry.c +++ b/examples/ida/serial/idaHeat2D_kry.c @@ -43,7 +43,7 @@ #include /* prototypes for IDA fcts., consts. */ #include /* access to serial N_Vector */ #include /* access to spgmr SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -59,31 +59,31 @@ typedef struct { sunindextype mm; /* number of grid points */ - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; N_Vector pp; /* vector of prec. diag. elements */ } *UserData; /* Prototypes for functions called by IDA */ -int resHeat(realtype tres, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data); + sunrealtype c_j, void *prec_data); -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data); + sunrealtype c_j, sunrealtype delta, void *prec_data); /* Prototypes for private functions */ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res); -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector uu); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -98,7 +98,7 @@ int main() UserData data; N_Vector uu, up, constraints, res; int retval, iout; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; long int netf, ncfn, ncfl; SUNLinearSolver LS; SUNContext ctx; @@ -308,12 +308,12 @@ int main() * while for each boundary point, it is res_i = u_i. */ -int resHeat(realtype tt, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { sunindextype i, j, offset, loc, mm; - realtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; + sunrealtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; UserData data; uu_data = N_VGetArrayPointer(uu); @@ -359,13 +359,13 @@ int resHeat(realtype tt, * pp etc.) are used from the PsetupdHeat argument list. */ -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data) + sunrealtype c_j, void *prec_data) { sunindextype i, j, offset, loc, mm; - realtype *ppv, pelinv; + sunrealtype *ppv, pelinv; UserData data; data = (UserData) prec_data; @@ -397,10 +397,10 @@ int PsetupHeat(realtype tt, * computed in PrecondHeateq), returning the result in zvec. */ -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data) + sunrealtype c_j, sunrealtype delta, void *prec_data) { UserData data; data = (UserData) prec_data; @@ -422,7 +422,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res) { sunindextype mm, mm1, i, j, offset, loc; - realtype xfact, yfact, *udata, *updata; + sunrealtype xfact, yfact, *udata, *updata; mm = data->mm; @@ -466,7 +466,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_kry: Heat equation, serial example problem for IDA \n"); printf(" Discretized heat equation on 2D unit square. \n"); @@ -489,9 +489,9 @@ static void PrintHeader(realtype rtol, realtype atol) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/ida/serial/idaHeat2D_sps.c b/examples/ida/serial/idaHeat2D_sps.c index d89c674870..9df19886a2 100644 --- a/examples/ida/serial/idaHeat2D_sps.c +++ b/examples/ida/serial/idaHeat2D_sps.c @@ -45,7 +45,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to superlumt linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Problem Constants */ @@ -63,29 +63,29 @@ typedef struct { sunindextype mm; - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; } *UserData; /* Prototypes of functions called by IDA */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int jacHeat(realtype tt, realtype cj, +int jacHeat(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Exact same setup as jacHeat. Function needed for special case MGRID=3 */ -int jacHeat3(realtype tt, realtype cj, +int jacHeat3(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector u); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector u); static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res); @@ -104,7 +104,7 @@ int main(void) N_Vector uu, up, constraints, id, res; int retval, iout; long int netf, ncfn; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; SUNMatrix A; SUNLinearSolver LS; sunindextype nnz; @@ -254,11 +254,11 @@ int main(void) * while for each boundary point, it is res_i = u_i. */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data) { sunindextype mm, i, j, offset, loc; - realtype *uv, *upv, *resv, coeff; + sunrealtype *uv, *upv, *resv, coeff; UserData data; uv = N_VGetArrayPointer(uu); upv = N_VGetArrayPointer(up); resv = N_VGetArrayPointer(resval); @@ -285,17 +285,17 @@ int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, } /* Jacobian matrix setup for MGRID=3 */ -int jacHeat3(realtype tt, realtype cj, +int jacHeat3(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype dx = ONE/(MGRID - ONE); - realtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype dx = ONE/(MGRID - ONE); + sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); SUNMatZero(JJ); @@ -348,18 +348,18 @@ int jacHeat3(realtype tt, realtype cj, } /* Jacobian matrix setup for MGRID>=4 */ -int jacHeat(realtype tt, realtype cj, +int jacHeat(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype dx = ONE/(MGRID - ONE); - realtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype dx = ONE/(MGRID - ONE); + sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; int i,j, repeat=0; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); SUNMatZero(JJ); @@ -605,7 +605,7 @@ int jacHeat(realtype tt, realtype cj, static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res) { - realtype xfact, yfact, *udata, *updata, *iddata; + sunrealtype xfact, yfact, *udata, *updata, *iddata; sunindextype mm, mm1, i, j, offset, loc; mm = data->mm; @@ -656,7 +656,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_sps: Heat equation, serial example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -691,10 +691,10 @@ static void PrintHeader(realtype rtol, realtype atol) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { int retval; - realtype umax, hused; + sunrealtype umax, hused; long int nst, nni, nje, nre; int kused; diff --git a/examples/ida/serial/idaKrylovDemo_ls.c b/examples/ida/serial/idaKrylovDemo_ls.c index b97163ea99..2bd08dc2cb 100644 --- a/examples/ida/serial/idaKrylovDemo_ls.c +++ b/examples/ida/serial/idaKrylovDemo_ls.c @@ -48,7 +48,7 @@ #include /* access to SPBCGS SUNLinearSolver */ #include /* access to SPTFQMR SUNLinearSolver */ #include /* serial N_Vector types, fct. and macros */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -82,31 +82,31 @@ typedef struct { sunindextype mm; /* number of grid points */ - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; N_Vector pp; /* vector of prec. diag. elements */ } *UserData; /* Prototypes for functions called by IDA */ -int resHeat(realtype tres, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *user_data); + sunrealtype c_j, void *user_data); -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data); + sunrealtype c_j, sunrealtype delta, void *user_data); /* Prototypes for private functions */ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res); -static void PrintHeader(realtype rtol, realtype atol, int linsolver); -static void PrintOutput(void *mem, realtype t, N_Vector uu, int linsolver); +static void PrintHeader(sunrealtype rtol, sunrealtype atol, int linsolver); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu, int linsolver); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -121,11 +121,11 @@ int main(int argc, char* argv[]) UserData data; N_Vector uu, up, constraints, res; int retval, iout, linsolver; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; long int netf, ncfn, ncfl; SUNLinearSolver LS; int nrmfactor; /* LS norm conversion factor flag */ - realtype nrmfac; /* LS norm conversion factor */ + sunrealtype nrmfac; /* LS norm conversion factor */ SUNContext ctx; mem = NULL; @@ -291,7 +291,7 @@ int main(int argc, char* argv[]) case(1): /* use the square root of the vector length */ - nrmfac = SQRT((realtype)NEQ); + nrmfac = SQRT((sunrealtype)NEQ); break; case(2): /* compute with dot product */ @@ -374,12 +374,12 @@ int main(int argc, char* argv[]) * while for each boundary point, it is res_i = u_i. */ -int resHeat(realtype tt, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { sunindextype i, j, offset, loc, mm; - realtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; + sunrealtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; UserData data; uu_data = N_VGetArrayPointer(uu); @@ -425,13 +425,13 @@ int resHeat(realtype tt, * pp etc.) are used from the PsetupdHeat argument list. */ -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *user_data) + sunrealtype c_j, void *user_data) { sunindextype i, j, offset, loc, mm; - realtype *ppv, pelinv; + sunrealtype *ppv, pelinv; UserData data; data = (UserData) user_data; @@ -463,10 +463,10 @@ int PsetupHeat(realtype tt, * computed in PrecondHeateq), returning the result in zvec. */ -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData data; data = (UserData) user_data; @@ -488,7 +488,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res) { sunindextype mm, mm1, i, j, offset, loc; - realtype xfact, yfact, *udata, *updata; + sunrealtype xfact, yfact, *udata, *updata; mm = data->mm; @@ -532,7 +532,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol, int linsolver) +static void PrintHeader(sunrealtype rtol, sunrealtype atol, int linsolver) { printf("\nidaKrylovDemo_ls: Heat equation, serial example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -569,9 +569,9 @@ static void PrintHeader(realtype rtol, realtype atol, int linsolver) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(void *mem, realtype t, N_Vector uu, int linsolver) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu, int linsolver) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/ida/serial/idaRoberts_dns.c b/examples/ida/serial/idaRoberts_dns.c index a7cc3aae52..4886b77537 100644 --- a/examples/ida/serial/idaRoberts_dns.c +++ b/examples/ida/serial/idaRoberts_dns.c @@ -40,7 +40,7 @@ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ #include /* access to Newton SUNNonlinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -67,23 +67,23 @@ /* Prototypes of functions called by IDA */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int grob(realtype t, N_Vector yy, N_Vector yp, - realtype *gout, void *user_data); +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, + sunrealtype *gout, void *user_data); -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static void PrintRootInfo(int root_f1, int root_f2); static int check_retval(void *returnvalue, const char *funcname, int opt); -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol); /* *-------------------------------------------------------------------- @@ -95,8 +95,8 @@ int main(void) { void *mem; N_Vector yy, yp, avtol; - realtype rtol, *yval, *ypval, *atval; - realtype t0, tout1, tout, tret; + sunrealtype rtol, *yval, *ypval, *atval; + sunrealtype t0, tout1, tout, tret; int iout, retval, retvalr; int rootsfound[2]; SUNMatrix A; @@ -250,9 +250,9 @@ int main(void) * Define the system residual function. */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *yval, *ypval, *rval; + sunrealtype *yval, *ypval, *rval; yval = N_VGetArrayPointer(yy); ypval = N_VGetArrayPointer(yp); @@ -270,10 +270,10 @@ int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data * Root function routine. Compute functions g_i(t,y) for i = 0,1. */ -static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, void *user_data) { - realtype *yval, y1, y3; + sunrealtype *yval, y1, y3; yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; @@ -287,12 +287,12 @@ static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, * Define the Jacobian function. */ -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; yval = N_VGetArrayPointer(yy); @@ -319,9 +319,9 @@ int jacrob(realtype tt, realtype cj, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y) { - realtype *atval, *yval; + sunrealtype *atval, *yval; atval = N_VGetArrayPointer(avtol); yval = N_VGetArrayPointer(y); @@ -356,12 +356,12 @@ static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); @@ -430,12 +430,12 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* compare the solution at the final time 4e10s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail=0; /* answer pass (0) or fail (1) retval */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ + sunrealtype err; /* wrms error */ /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/ida/serial/idaRoberts_klu.c b/examples/ida/serial/idaRoberts_klu.c index 3d7462ccaf..a8d9770f6b 100644 --- a/examples/ida/serial/idaRoberts_klu.c +++ b/examples/ida/serial/idaRoberts_klu.c @@ -38,7 +38,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Problem Constants */ @@ -51,25 +51,25 @@ /* Prototypes of functions called by IDA */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int grob(realtype t, N_Vector yy, N_Vector yp, - realtype *gout, void *user_data); +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, + sunrealtype *gout, void *user_data); -int jacrobCSC(realtype tt, realtype cj, +int jacrobCSC(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); -int jacrobCSR(realtype tt, realtype cj, +int jacrobCSR(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static void PrintRootInfo(int root_f1, int root_f2); static void PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -84,8 +84,8 @@ int main(void) { void *mem; N_Vector yy, yp, avtol; - realtype rtol, *yval, *ypval, *atval; - realtype t0, tout1, tout, tret; + sunrealtype rtol, *yval, *ypval, *atval; + sunrealtype t0, tout1, tout, tret; int iout, retval, retvalr; int rootsfound[2]; SUNMatrix A; @@ -219,9 +219,9 @@ int main(void) * Define the system residual function. */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *yval, *ypval, *rval; + sunrealtype *yval, *ypval, *rval; yval = N_VGetArrayPointer(yy); ypval = N_VGetArrayPointer(yp); @@ -239,10 +239,10 @@ int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data * Root function routine. Compute functions g_i(t,y) for i = 0,1. */ -static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, void *user_data) { - realtype *yval, y1, y3; + sunrealtype *yval, y1, y3; yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; @@ -256,15 +256,15 @@ static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, * Define the Jacobian function. */ -int jacrobCSC(realtype tt, realtype cj, +int jacrobCSC(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); yval = N_VGetArrayPointer(yy); @@ -305,15 +305,15 @@ int jacrobCSC(realtype tt, realtype cj, /* * Define the Jacobian function, where Jacobian is CSR matrix. */ -int jacrobCSR(realtype tt, realtype cj, +int jacrobCSR(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *rowptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *colvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); yval = N_VGetArrayPointer(yy); @@ -361,9 +361,9 @@ int jacrobCSR(realtype tt, realtype cj, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y) { - realtype *atval, *yval; + sunrealtype *atval, *yval; atval = N_VGetArrayPointer(avtol); yval = N_VGetArrayPointer(y); @@ -398,12 +398,12 @@ static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); diff --git a/examples/ida/serial/idaRoberts_sps.c b/examples/ida/serial/idaRoberts_sps.c index e30fbf42bf..0127ff2500 100644 --- a/examples/ida/serial/idaRoberts_sps.c +++ b/examples/ida/serial/idaRoberts_sps.c @@ -38,7 +38,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLUMT linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Problem Constants */ @@ -51,20 +51,20 @@ /* Prototypes of functions called by IDA */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int grob(realtype t, N_Vector yy, N_Vector yp, - realtype *gout, void *user_data); +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, + sunrealtype *gout, void *user_data); -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static void PrintRootInfo(int root_f1, int root_f2); static void PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -79,8 +79,8 @@ int main(void) { void *mem; N_Vector yy, yp, avtol; - realtype rtol, *yval, *ypval, *atval; - realtype t0, tout1, tout, tret; + sunrealtype rtol, *yval, *ypval, *atval; + sunrealtype t0, tout1, tout, tret; int iout, retval, retvalr; int rootsfound[2]; SUNMatrix A; @@ -214,9 +214,9 @@ int main(void) * Define the system residual function. */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *yval, *ypval, *rval; + sunrealtype *yval, *ypval, *rval; yval = N_VGetArrayPointer(yy); ypval = N_VGetArrayPointer(yp); @@ -234,10 +234,10 @@ int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data * Root function routine. Compute functions g_i(t,y) for i = 0,1. */ -static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, void *user_data) { - realtype *yval, y1, y3; + sunrealtype *yval, y1, y3; yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; @@ -251,15 +251,15 @@ static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, * Define the Jacobian function. */ -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); yval = N_VGetArrayPointer(yy); @@ -307,9 +307,9 @@ int jacrob(realtype tt, realtype cj, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y) { - realtype *atval, *yval; + sunrealtype *atval, *yval; atval = N_VGetArrayPointer(avtol); yval = N_VGetArrayPointer(y); @@ -344,12 +344,12 @@ static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); diff --git a/examples/ida/serial/idaSlCrank_dns.c b/examples/ida/serial/idaSlCrank_dns.c index 9610f5f124..ab4b77062b 100644 --- a/examples/ida/serial/idaSlCrank_dns.c +++ b/examples/ida/serial/idaSlCrank_dns.c @@ -29,7 +29,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* Problem Constants */ @@ -46,21 +46,21 @@ #define FOUR RCONST(4.0) typedef struct { - realtype a; - realtype J1, J2, m2; - realtype k, c, l0; - realtype F; + sunrealtype a; + sunrealtype J1, J2, m2; + sunrealtype k, c, l0; + sunrealtype F; } *UserData; -int ressc(realtype tres, N_Vector yy, N_Vector yp, +int ressc(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); void setIC(N_Vector yy, N_Vector yp, UserData data); -void force(N_Vector yy, realtype *Q, UserData data); +void force(N_Vector yy, sunrealtype *Q, UserData data); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, realtype atol, N_Vector y); -static int PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, sunrealtype atol, N_Vector y); +static int PrintOutput(void *mem, sunrealtype t, N_Vector y); static int PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -76,8 +76,8 @@ int main(void) void *mem; N_Vector yy, yp, id; - realtype rtol, atol; - realtype t0, tf, tout, dt, tret; + sunrealtype rtol, atol; + sunrealtype t0, tf, tout, dt, tret; int retval, iout; SUNMatrix A; SUNLinearSolver LS; @@ -182,10 +182,10 @@ int main(void) void setIC(N_Vector yy, N_Vector yp, UserData data) { - realtype pi; - realtype a, J1, m2, J2; - realtype q, p, x; - realtype Q[3]; + sunrealtype pi; + sunrealtype a, J1, m2, J2; + sunrealtype q, p, x; + sunrealtype Q[3]; N_VConst(ZERO, yy); N_VConst(ZERO, yp); @@ -213,14 +213,14 @@ void setIC(N_Vector yy, N_Vector yp, UserData data) } -void force(N_Vector yy, realtype *Q, UserData data) +void force(N_Vector yy, sunrealtype *Q, UserData data) { - realtype a, k, c, l0, F; - realtype q, x, p; - realtype qd, xd, pd; - realtype s1, c1, s2, c2, s21, c21; - realtype l2, l, ld; - realtype f, fl; + sunrealtype a, k, c, l0, F; + sunrealtype q, x, p; + sunrealtype qd, xd, pd; + sunrealtype s1, c1, s2, c2, s21, c21; + sunrealtype l2, l, ld; + sunrealtype f, fl; a = data->a; k = data->k; @@ -257,16 +257,16 @@ void force(N_Vector yy, realtype *Q, UserData data) } -int ressc(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int ressc(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { UserData data; - realtype Q[3]; - realtype a, J1, m2, J2; - realtype *yval, *ypval, *rval; - realtype q, x, p; - realtype qd, xd, pd; - realtype lam1, lam2, mu1, mu2; - realtype s1, c1, s2, c2; + sunrealtype Q[3]; + sunrealtype a, J1, m2, J2; + sunrealtype *yval, *ypval, *rval; + sunrealtype q, x, p; + sunrealtype qd, xd, pd; + sunrealtype lam1, lam2, mu1, mu2; + sunrealtype s1, c1, s2, c2; data = (UserData) user_data; @@ -317,7 +317,7 @@ int ressc(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) return(0); } -static void PrintHeader(realtype rtol, realtype atol, N_Vector y) +static void PrintHeader(sunrealtype rtol, sunrealtype atol, N_Vector y) { printf("\nidaSlCrank_dns: Slider-Crank DAE serial example problem for IDA\n"); printf("Linear solver: DENSE, Jacobian is computed by IDA.\n"); @@ -337,12 +337,12 @@ static void PrintHeader(realtype rtol, realtype atol, N_Vector y) printf("-----------------------------------------------------------------------\n"); } -static int PrintOutput(void *mem, realtype t, N_Vector y) +static int PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); diff --git a/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp index aa910858b0..b82b260e0e 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp +++ b/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp @@ -96,7 +96,7 @@ struct UserData { Teuchos::RCP > comm; int thispe, npex, npey, ixsub, jysub; sunindextype mx, my, mxsub, mysub; - realtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; Kokkos::View uext; /* device array */ Kokkos::View send_buff_top; @@ -123,12 +123,12 @@ struct UserData { /* User-supplied residual and supporting functions */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); static int rescomm(N_Vector uu, N_Vector up, void *user_data); -static int reslocal(realtype tt, N_Vector uu, N_Vector up, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector res, void *user_data); static int BSend(N_Vector uu, void *user_data); @@ -140,12 +140,12 @@ static int BRecvWait(MPI_Request request[], void *user_data); /* User-supplied preconditioner functions */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, - N_Vector rvec, N_Vector zvec, realtype c_j, - realtype delta, void *user_data); +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, + N_Vector rvec, N_Vector zvec, sunrealtype c_j, + sunrealtype delta, void *user_data); -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data); /* Private function to allocate memory, initialize problem and print output */ @@ -156,9 +156,9 @@ static int AllocUserData(int thispe, N_Vector uu, UserData *data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData *data); -static void PrintHeader(realtype rtol, realtype atol, UserData *data); +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData *data); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -255,12 +255,12 @@ int main(int argc, char *argv[]) /* Set constraints to all 1's for nonnegative solution values. */ N_VConst(ONE, constraints); - realtype t0 = ZERO; - realtype t1 = RCONST(0.01); + sunrealtype t0 = ZERO; + sunrealtype t1 = RCONST(0.01); /* Scalar relative and absolute tolerance. */ - realtype rtol = ZERO; - realtype atol = RCONST(1.0e-3); + sunrealtype rtol = ZERO; + sunrealtype atol = RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution. */ @@ -314,7 +314,7 @@ int main(int argc, char *argv[]) /* Loop over tout, call IDASolve, print output. */ int iout; - realtype tret, tout; + sunrealtype tret, tout; for (tout = t1, iout = 1; iout <= NOUT; iout++, tout *= TWO) { @@ -372,7 +372,7 @@ int main(int argc, char *argv[]) * BSend, BRecvPost, and BREcvWait handle interprocessor communication * of uu required to calculate the residual. */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { int retval = 0; @@ -404,8 +404,8 @@ int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, * pp etc.) are used from the PsetupHeat argument list. * */ -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data) +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data) { /* Unwrap the user data */ UserData* data = reinterpret_cast(user_data); @@ -433,7 +433,7 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, #endif /* Calculate the value for the inverse element of the diagonal preconditioner */ - const realtype pelinv = ONE/(c_j + data->coeffxy); + const sunrealtype pelinv = ONE/(c_j + data->coeffxy); ibc = (ixsub == 0) || (ixsub == npex-1); i0 = (ixsub == 0); @@ -461,9 +461,9 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, * containing the inverse diagonal Jacobian elements (previously * computed in PsetupHeat), returning the result in zvec. */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData* data = reinterpret_cast(user_data); @@ -505,7 +505,7 @@ static int rescomm(N_Vector uu, N_Vector up, void* user_data) * that all inter-processor communication of data needed to calculate F * has already been done, and that this data is in the work array uext. */ -static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { UserData* data = reinterpret_cast(user_data); @@ -518,9 +518,9 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, const sunindextype mxsub = data->mxsub; const sunindextype mxsub2 = data->mxsub + 2; const sunindextype mysub = data->mysub; - const realtype coeffx = data->coeffx; - const realtype coeffy = data->coeffy; - const realtype coeffxy = data->coeffxy; + const sunrealtype coeffx = data->coeffx; + const sunrealtype coeffy = data->coeffy; + const sunrealtype coeffxy = data->coeffxy; sunindextype ibc, i0, jbc, j0; @@ -549,7 +549,7 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, auto rr_1d = Kokkos::subview (rr_2d, Kokkos::ALL(), 0); #endif - Kokkos::View uext_1d = data->uext; + Kokkos::View uext_1d = data->uext; /* Copy local segment of u vector into the working extended array uext. This completes uext prior to the computation of the rr vector. @@ -581,9 +581,9 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, sunindextype locu = i + j*mxsub; sunindextype locue = (i+1) + (j+1)*mxsub2; - realtype termx = coeffx * (uext_1d(locue-1) + uext_1d(locue+1)); - realtype termy = coeffy * (uext_1d(locue-mxsub2) + uext_1d(locue+mxsub2)); - realtype termctr = coeffxy * uext_1d(locue); + sunrealtype termx = coeffx * (uext_1d(locue-1) + uext_1d(locue+1)); + sunrealtype termy = coeffy * (uext_1d(locue-mxsub2) + uext_1d(locue+mxsub2)); + sunrealtype termctr = coeffxy * uext_1d(locue); rr_1d(locu) = up_1d(locu) - (termx + termy - termctr); } ); @@ -614,14 +614,14 @@ static int BSend(N_Vector uu, void *user_data) const int mysub = data->mysub; /* Get pointers to buffers and extended solution vector data array uext. */ - Kokkos::View bufleft = data->send_buff_left; - Kokkos::View bufright = data->send_buff_right; - Kokkos::View buftop = data->send_buff_top; - Kokkos::View bufbottom = data->send_buff_bottom; - typename Kokkos::View::HostMirror h_bufleft = data->h_send_buff_left; - typename Kokkos::View::HostMirror h_bufright = data->h_send_buff_right; - typename Kokkos::View::HostMirror h_buftop = data->h_send_buff_top; - typename Kokkos::View::HostMirror h_bufbottom = data->h_send_buff_bottom; + Kokkos::View bufleft = data->send_buff_left; + Kokkos::View bufright = data->send_buff_right; + Kokkos::View buftop = data->send_buff_top; + Kokkos::View bufbottom = data->send_buff_bottom; + typename Kokkos::View::HostMirror h_bufleft = data->h_send_buff_left; + typename Kokkos::View::HostMirror h_bufright = data->h_send_buff_right; + typename Kokkos::View::HostMirror h_buftop = data->h_send_buff_top; + typename Kokkos::View::HostMirror h_bufbottom = data->h_send_buff_bottom; /* Get solution vector data. */ Teuchos::RCP uuv = N_VGetVector_Trilinos(uu); @@ -706,7 +706,7 @@ static int BSend(N_Vector uu, void *user_data) /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*(MYSUB+MYSUB) realtype entries, should + * 1) buffer should be able to hold 2*(MYSUB+MYSUB) sunrealtype entries, should * be passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -729,10 +729,10 @@ static int BRecvPost(MPI_Request request[], void *user_data) const sunindextype mysub = data->mysub; /* Get left, right, top and bottom host buffers. */ - typename Kokkos::View::HostMirror h_bufleft = data->h_recv_buff_left; - typename Kokkos::View::HostMirror h_bufright = data->h_recv_buff_right; - typename Kokkos::View::HostMirror h_buftop = data->h_recv_buff_top; - typename Kokkos::View::HostMirror h_bufbottom = data->h_recv_buff_bottom; + typename Kokkos::View::HostMirror h_bufleft = data->h_recv_buff_left; + typename Kokkos::View::HostMirror h_bufright = data->h_recv_buff_right; + typename Kokkos::View::HostMirror h_buftop = data->h_recv_buff_top; + typename Kokkos::View::HostMirror h_bufbottom = data->h_recv_buff_bottom; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) { @@ -765,7 +765,7 @@ static int BRecvPost(MPI_Request request[], void *user_data) /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -785,17 +785,17 @@ static int BRecvWait(MPI_Request request[], void *user_data) const sunindextype mysub = data->mysub; /* Get pointers to buffers and extended solution vector data array uext. */ - typename Kokkos::View::HostMirror h_bufleft = data->h_recv_buff_left; - typename Kokkos::View::HostMirror h_bufright = data->h_recv_buff_right; - typename Kokkos::View::HostMirror h_buftop = data->h_recv_buff_top; - typename Kokkos::View::HostMirror h_bufbottom = data->h_recv_buff_bottom; + typename Kokkos::View::HostMirror h_bufleft = data->h_recv_buff_left; + typename Kokkos::View::HostMirror h_bufright = data->h_recv_buff_right; + typename Kokkos::View::HostMirror h_buftop = data->h_recv_buff_top; + typename Kokkos::View::HostMirror h_bufbottom = data->h_recv_buff_bottom; - Kokkos::View bufleft = data->recv_buff_left; - Kokkos::View bufright = data->recv_buff_right; - Kokkos::View buftop = data->recv_buff_top; - Kokkos::View bufbottom = data->recv_buff_bottom; + Kokkos::View bufleft = data->recv_buff_left; + Kokkos::View bufright = data->recv_buff_right; + Kokkos::View buftop = data->recv_buff_top; + Kokkos::View bufbottom = data->recv_buff_bottom; - Kokkos::View uext_1d = data->uext; + Kokkos::View uext_1d = data->uext; const sunindextype mxsub2 = mxsub + 2; const sunindextype mysub1 = mysub + 1; @@ -941,7 +941,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData *data) { sunindextype i, iloc, j, jloc, loc; - realtype xfact, yfact; + sunrealtype xfact, yfact; /* Initialize uu. */ @@ -969,8 +969,8 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, #endif /* Set mesh spacings and subgrid indices for this PE. */ - const realtype dx = data->dx; - const realtype dy = data->dy; + const sunrealtype dx = data->dx; + const sunrealtype dy = data->dy; const int ixsub = data->ixsub; const int jysub = data->jysub; @@ -1024,7 +1024,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, /* * Print first lines of output and table heading */ -static void PrintHeader(realtype rtol, realtype atol, UserData *data) +static void PrintHeader(sunrealtype rtol, sunrealtype atol, UserData *data) { printf("\nidaHeat2D_kry_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -1057,9 +1057,9 @@ static void PrintHeader(realtype rtol, realtype atol, UserData *data) /* * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp index ef74111797..992dd8ba2f 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp +++ b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp @@ -51,7 +51,7 @@ #include #include #include /* access to spgmr SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -68,8 +68,8 @@ struct UserData { sunindextype mm; /* number of grid points in one dimension */ sunindextype neq; /* number of equations */ - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; N_Vector pp; /* vector of prec. diag. elements */ }; @@ -85,24 +85,24 @@ typedef vector_type::map_type map_type; /* Prototypes for functions called by IDA */ -int resHeat(realtype tres, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data); + sunrealtype c_j, void *prec_data); -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data); + sunrealtype c_j, sunrealtype delta, void *prec_data); /* Prototypes for private functions */ static int SetInitialProfile(UserData *data, N_Vector uu, N_Vector up, N_Vector res); -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector uu); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu); static int check_retval(void *flagvalue, const char *funcname, int opt); /* @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) void *mem; N_Vector uu, up, constraints, res; int retval, iout; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; long int netf, ncfn, ncfl; SUNLinearSolver LS; @@ -358,13 +358,13 @@ int main(int argc, char *argv[]) * res_i = u'_i - (central difference)_i * while for each boundary point, it is res_i = u_i. */ -int resHeat(realtype tt, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { UserData *data = reinterpret_cast(user_data); sunindextype mm; - realtype coeff; + sunrealtype coeff; Teuchos::RCP uutp = N_VGetVector_Trilinos(uu); Teuchos::RCP uptp = N_VGetVector_Trilinos(up); @@ -399,8 +399,8 @@ int resHeat(realtype tt, rr_1d(loc) = uu_1d(loc); } else { /* Loop over interior points; set res = up - (central difference). */ - realtype dif1 = uu_1d(loc-1) + uu_1d(loc+1) - TWO * uu_1d(loc); - realtype dif2 = uu_1d(loc-mm) + uu_1d(loc+mm) - TWO * uu_1d(loc); + sunrealtype dif1 = uu_1d(loc-1) + uu_1d(loc+1) - TWO * uu_1d(loc); + sunrealtype dif2 = uu_1d(loc-mm) + uu_1d(loc+mm) - TWO * uu_1d(loc); rr_1d(loc) = up_1d(loc) - coeff * ( dif1 + dif2 ); } } @@ -426,15 +426,15 @@ int resHeat(realtype tt, * In this instance, only cj and data (user data structure, with * pp etc.) are used from the PsetupdHeat argument list. */ -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data) + sunrealtype c_j, void *prec_data) { UserData *data = reinterpret_cast(prec_data); sunindextype mm; mm = data->mm; - realtype coeff = data->coeff; + sunrealtype coeff = data->coeff; Teuchos::RCP pptp = N_VGetVector_Trilinos(data->pp); @@ -471,10 +471,10 @@ int PsetupHeat(realtype tt, * containing the inverse diagonal Jacobian elements, returning the * result in zvec. */ -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data) + sunrealtype c_j, sunrealtype delta, void *prec_data) { UserData *data = reinterpret_cast(prec_data); N_VProd(data->pp, rvec, zvec); @@ -494,7 +494,7 @@ static int SetInitialProfile(UserData *data, N_Vector uu, N_Vector up, N_Vector res) { sunindextype mm, mm1, i, j; - realtype xfact, yfact; + sunrealtype xfact, yfact; mm = data->mm; @@ -564,7 +564,7 @@ static int SetInitialProfile(UserData *data, N_Vector uu, N_Vector up, /* * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidaHeat2D_kry_tpetra: Heat equation, serial example problem for IDA \n"); printf(" Discretized heat equation on 2D unit square. \n"); @@ -587,9 +587,9 @@ static void PrintHeader(realtype rtol, realtype atol) /* * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c index 171851849e..9a4eaf5970 100644 --- a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c @@ -164,15 +164,15 @@ typedef struct { sunindextype Neq, ns, np, mx, my; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; N_Vector rates; int nthreads; } *UserData; /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); /* Prototypes for private Helper Functions. */ @@ -180,13 +180,13 @@ static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, static void InitUserData(UserData webdata); static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata); -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol); -static void PrintOutput(void *ida_mem, N_Vector c, realtype t); +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t); static void PrintFinalStats(void *ida_mem); -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) N_Vector cc, cp, id; int iout, retval; sunindextype mu, ml; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; int num_threads; SUNContext ctx; @@ -351,11 +351,11 @@ int main(int argc, char *argv[]) * using cp in the case of prey species. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { sunindextype jx, jy, is, yloc, loc, np; - realtype *resv, *cpv; + sunrealtype *resv, *cpv; UserData webdata; jx = jy = is = 0; @@ -402,7 +402,7 @@ static int resweb(realtype tt, N_Vector cc, N_Vector cp, static void InitUserData(UserData webdata) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; webdata->mx = MX; webdata->my = MY; @@ -453,8 +453,8 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata) { sunindextype loc, yloc, is, jx, jy, np; - realtype xx, yy, xyfactor; - realtype *ccv, *cpv, *idv; + sunrealtype xx, yy, xyfactor; + sunrealtype *ccv, *cpv, *idv; ccv = NV_DATA_OMP(cc); cpv = NV_DATA_OMP(cp); @@ -473,7 +473,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (realtype)(is+1) * xyfactor; + ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { @@ -503,7 +503,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, * Print first lines of output (problem description) */ -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol) +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol) { printf("\nidasFoodWeb_bnd_omp: Predator-prey DAE OpenMP example problem for IDAS \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -532,11 +532,11 @@ static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtyp * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector c, realtype t) +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t) { int i, kused, retval; long int nst; - realtype *c_bl, *c_tr, hused; + sunrealtype *c_bl, *c_tr, hused; retval = IDAGetLastOrder(ida_mem, &kused); check_retval(&retval, "IDAGetLastOrder", 1); @@ -610,11 +610,11 @@ static void PrintFinalStats(void *ida_mem) * The interaction term is computed by the function WebRates. */ -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata) { sunindextype jx, jy, is, idyu, idyl, idxu, idxl; - realtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; + sunrealtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; /* Loop over grid points, evaluate interaction vector (length ns), form diffusion difference terms, and load crate. */ @@ -664,11 +664,11 @@ static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -681,13 +681,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); diff --git a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c index 9258327cdc..1ed9d3b477 100644 --- a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c @@ -169,9 +169,9 @@ typedef struct { sunindextype Neq, ns, np, mx, my; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; - realtype **PP[MX][MY]; + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; + sunrealtype **PP[MX][MY]; sunindextype *pivot[MX][MY]; N_Vector rates; N_Vector ewt; @@ -181,28 +181,28 @@ typedef struct { /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); -static int Precond(realtype tt, N_Vector cc, N_Vector cp, - N_Vector rr, realtype cj, void *user_data); +static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, + N_Vector rr, sunrealtype cj, void *user_data); -static int PSolve(realtype tt, N_Vector cc, N_Vector cp, +static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype delta, void *user_data); + sunrealtype cj, sunrealtype delta, void *user_data); /* Prototypes for private Helper Functions. */ static void InitUserData(UserData webdata); static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata); -static void PrintHeader(int maxl, realtype rtol, realtype atol); -static void PrintOutput(void *ida_mem, N_Vector c, realtype t); +static void PrintHeader(int maxl, sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t); static void PrintFinalStats(void *ida_mem); -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) N_Vector cc, cp, id; int iout, jx, jy, retval; int maxl; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; int num_threads; SUNContext ctx; @@ -383,11 +383,11 @@ int main(int argc, char *argv[]) * using cp in the case of prey species. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { sunindextype jx, jy, is, yloc, loc, np; - realtype *resv, *cpv; + sunrealtype *resv, *cpv; UserData webdata; jx = jy = is = 0; @@ -422,18 +422,18 @@ static int resweb(realtype tt, N_Vector cc, N_Vector cp, } -static int Precond(realtype tt, N_Vector cc, N_Vector cp, - N_Vector rr, realtype cj, void *user_data) +static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, + N_Vector rr, sunrealtype cj, void *user_data) { int retval; sunindextype ret; - realtype uround, xx, yy, del_x, del_y; - realtype **Pxy, *ratesxy, *Pxycol, *cxy, *cpxy, *ewtxy, cctmp; - realtype inc, fac, sqru, perturb_rates[NUM_SPECIES]; + sunrealtype uround, xx, yy, del_x, del_y; + sunrealtype **Pxy, *ratesxy, *Pxycol, *cxy, *cpxy, *ewtxy, cctmp; + sunrealtype inc, fac, sqru, perturb_rates[NUM_SPECIES]; int is, js, jx, jy; void *ida_mem; N_Vector ewt; - realtype hh; + sunrealtype hh; UserData webdata; webdata = (UserData) user_data; @@ -490,11 +490,11 @@ static int Precond(realtype tt, N_Vector cc, N_Vector cp, } -static int PSolve(realtype tt, N_Vector cc, N_Vector cp, +static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype dalta, void *user_data) + sunrealtype cj, sunrealtype dalta, void *user_data) { - realtype **Pxy, *zxy; + sunrealtype **Pxy, *zxy; sunindextype *pivot; sunindextype jx, jy; UserData webdata; @@ -534,7 +534,7 @@ static int PSolve(realtype tt, N_Vector cc, N_Vector cp, static void InitUserData(UserData webdata) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; webdata->mx = MX; webdata->my = MY; @@ -585,8 +585,8 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata) { sunindextype loc, yloc, is, jx, jy, np; - realtype xx, yy, xyfactor; - realtype *ccv, *cpv, *idv; + sunrealtype xx, yy, xyfactor; + sunrealtype *ccv, *cpv, *idv; ccv = NV_DATA_OMP(cc); cpv = NV_DATA_OMP(cp); @@ -605,7 +605,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (realtype)(is+1) * xyfactor; + ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { @@ -635,7 +635,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, * Print first lines of output (problem description) */ -static void PrintHeader(int maxl, realtype rtol, realtype atol) +static void PrintHeader(int maxl, sunrealtype rtol, sunrealtype atol) { printf("\nidasFoodWeb_kry_omp: Predator-prey DAE OpenMP example problem using Krylov solver for IDAS \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -663,11 +663,11 @@ static void PrintHeader(int maxl, realtype rtol, realtype atol) * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector c, realtype t) +static void PrintOutput(void *ida_mem, N_Vector c, sunrealtype t) { int i, kused, retval; long int nst; - realtype *c_bl, *c_tr, hused; + sunrealtype *c_bl, *c_tr, hused; retval = IDAGetLastOrder(ida_mem, &kused); check_retval(&retval, "IDAGetLastOrder", 1); @@ -741,11 +741,11 @@ static void PrintFinalStats(void *ida_mem) * The interaction term is computed by the function WebRates. */ -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata) { sunindextype jx, jy, is, idyu, idyl, idxu, idxl; - realtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; + sunrealtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; /* Loop over grid points, evaluate interaction vector (length ns), form diffusion difference terms, and load crate. */ @@ -795,11 +795,11 @@ static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -812,13 +812,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); diff --git a/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c b/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c index 7068eb4997..38d10d318a 100644 --- a/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c @@ -129,48 +129,48 @@ typedef struct { int ns, thispe, npes, ixsub, jysub, npex, npey; int mxsub, mysub, nsmxsub, nsmxsub2; - realtype A, B, L, eps[NUM_SPECIES]; - realtype dx, dy; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES]; - realtype gridext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; - realtype rhs[NUM_SPECIES]; + sunrealtype A, B, L, eps[NUM_SPECIES]; + sunrealtype dx, dy; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES]; + sunrealtype gridext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; + sunrealtype rhs[NUM_SPECIES]; MPI_Comm comm; - realtype rates[2]; + sunrealtype rates[2]; sunindextype n_local; } *UserData; /* Prototypes for functions called by the IDA Solver. */ -static int res(realtype tt, N_Vector uv, N_Vector uvp, +static int res(sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, void *user_data); /* Prototypes for supporting functions */ static void BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - int dsizex, int dsizey, realtype carray[]); + int dsizex, int dsizey, sunrealtype carray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]); + sunrealtype cext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]); + int dsizex, sunrealtype cext[], sunrealtype buffer[]); -static void ReactRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void ReactRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData data); /* ADJOINT */ -static int resB(realtype tt, N_Vector yy, N_Vector yp, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB); -static int resBlocal(sunindextype Nlocal, realtype tt, +static int resBlocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector yyB, N_Vector ypB, N_Vector res, void *user_dataB); @@ -189,9 +189,9 @@ static void SetInitialProfilesB(N_Vector uv, N_Vector uvp, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol); + sunrealtype rtol, sunrealtype atol); -static void PrintOutput(void *mem, N_Vector uv, realtype time, +static void PrintOutput(void *mem, N_Vector uv, sunrealtype time, UserData data, MPI_Comm comm); static void PrintSol(void* mem, N_Vector uv, N_Vector uvp, UserData data, @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS_B; UserData data; sunindextype SystemSize, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; N_Vector uv, uvp, resid, id, uvB, uvpB, residB; int thispe, npes, maxl, retval; @@ -467,7 +467,7 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, N_Vector resid, UserData data) { int ixsub, jysub, mxsub, mysub, ix, jy; - realtype *idxy, dx, dy, x, y, *uvxy, *uvxy1, L, npex, npey; + sunrealtype *idxy, dx, dy, x, y, *uvxy, *uvxy1, L, npex, npey; ixsub = data->ixsub; jysub = data->jysub; @@ -556,8 +556,8 @@ static void SetInitialProfilesB(N_Vector uv, N_Vector uvp, N_Vector residB, UserData data) { int ixsub, jysub, mxsub, mysub, ix, jy; - realtype *uvxy, *uvBxy, *uvpBxy, npex, npey; - realtype B; + sunrealtype *uvxy, *uvBxy, *uvpBxy, npex, npey; + sunrealtype B; ixsub = data->ixsub; jysub = data->jysub; @@ -633,7 +633,7 @@ static void SetInitialProfilesB(N_Vector uv, N_Vector uvp, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol) + sunrealtype rtol, sunrealtype atol) { printf("\n BRUSSELATOR: chemically reacting system\n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -666,11 +666,11 @@ static void PrintHeader(sunindextype SystemSize, int maxl, * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector uv, realtype tt, +static void PrintOutput(void *ida_mem, N_Vector uv, sunrealtype tt, UserData data, MPI_Comm comm) { MPI_Status status; - realtype *cdata, clast[2], hused; + sunrealtype *cdata, clast[2], hused; long int nst; int i, kused, retval, thispe, npelast, ilast;; @@ -727,7 +727,7 @@ static void PrintSol(void* ida_mem, N_Vector uv, N_Vector uvp, UserData data, MPI_Comm comm) { FILE* fout; - realtype *uvxy; + sunrealtype *uvxy; int ix, jy, mxsub, mysub, npex, ixsub, jysub, thispe, i, j; char szFilename[128]; @@ -776,7 +776,7 @@ static void PrintSol(void* ida_mem, N_Vector uv, N_Vector uvp, static void PrintAdjSol(N_Vector uvB, N_Vector uvpB, UserData data) { FILE* fout; - realtype *uvxy; + sunrealtype *uvxy; int ix, jy, mxsub, mysub, thispe; char szFilename[128]; @@ -915,7 +915,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id * reslocal, for computation of the residuals on this processor. */ -static int res(realtype tt, +static int res(sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data) { @@ -946,13 +946,13 @@ static int res(realtype tt, * and receive-waiting, in routines BRecvPost, BSend, BRecvWait. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, void *user_data) { UserData data; - realtype *cdata, *gridext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *gridext, buffer[2*NUM_SPECIES*MYSUB]; int thispe, ixsub, jysub, nsmxsub, nsmysub; MPI_Comm comm; MPI_Request request[4]; @@ -986,7 +986,7 @@ static int rescomm(sunindextype Nlocal, realtype tt, /* * BRecvPost: Start receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. @@ -995,11 +995,11 @@ static int rescomm(sunindextype Nlocal, realtype tt, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]) + sunrealtype cext[], sunrealtype buffer[]) { int offsetce; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If jysub > 0, receive data for bottom x-line of cext. */ if (jysub != 0) @@ -1029,18 +1029,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * BRecvWait: Finish receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. */ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]) + int dsizex, sunrealtype cext[], sunrealtype buffer[]) { int i; int ly, dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -1087,11 +1087,11 @@ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, */ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, - int dsizex, int dsizey, realtype cdata[]) + int dsizex, int dsizey, sunrealtype cdata[]) { int i; int ly, offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If jysub > 0, send data from bottom x-line of uv. */ @@ -1162,14 +1162,14 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, * for use by the preconditioner setup routine. */ -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data) { - realtype *uvdata, *uvpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui, dx2, dy2; + sunrealtype *uvdata, *uvpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui, dx2, dy2; int ixend, ixstart, jystart, jyend; int ix, jy, is, i, locc, ylocce, locce; - realtype rates[2]; + sunrealtype rates[2]; UserData data; data = (UserData) user_data; @@ -1307,10 +1307,10 @@ static int reslocal(sunindextype Nlocal, realtype tt, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void ReactRates(realtype xx, realtype yy, realtype *uvval, realtype *rates, +static void ReactRates(sunrealtype xx, sunrealtype yy, sunrealtype *uvval, sunrealtype *rates, UserData data) { - realtype A, B; + sunrealtype A, B; A = data->A; B = data->B; @@ -1323,7 +1323,7 @@ static void ReactRates(realtype xx, realtype yy, realtype *uvval, realtype *rate -static int resB(realtype tt, N_Vector yy, N_Vector yp, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB) { @@ -1346,18 +1346,18 @@ static int resB(realtype tt, N_Vector yy, N_Vector yp, -static int resBlocal(sunindextype Nlocal, realtype tt, +static int resBlocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector uvB, N_Vector uvpB, N_Vector rrB, void *user_dataB) { - realtype *uvBdata, *uvBxy, *uvpBxy, *uvxy, *rrBxy; - realtype dx2, dy2; - realtype dcxli, dcxui, dcyli, dcyui; + sunrealtype *uvBdata, *uvBxy, *uvpBxy, *uvxy, *rrBxy; + sunrealtype dx2, dy2; + sunrealtype dcxli, dcxui, dcyli, dcyui; int locc, locce, ylocce; int ix, jy, i, ixstart, ixend, jystart, jyend, is; UserData data; - realtype B; + sunrealtype B; data = (UserData) user_dataB; diff --git a/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c b/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c index 62042bfd13..9d9136d3ca 100644 --- a/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c @@ -114,43 +114,43 @@ typedef struct { int ns, thispe, npes, ixsub, jysub, npex, npey; int mxsub, mysub, nsmxsub, nsmxsub2; - realtype A, B, L, eps[NUM_SPECIES]; - realtype dx, dy; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES]; - realtype gridext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; - realtype rhs[NUM_SPECIES]; + sunrealtype A, B, L, eps[NUM_SPECIES]; + sunrealtype dx, dy; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES]; + sunrealtype gridext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; + sunrealtype rhs[NUM_SPECIES]; MPI_Comm comm; - realtype rates[2]; + sunrealtype rates[2]; sunindextype n_local; } *UserData; /* Prototypes for functions called by the IDA Solver. */ -static int res(realtype tt, N_Vector uv, N_Vector uvp, +static int res(sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, void *user_data); /* Integrate over spatial domain. */ -static int integr(MPI_Comm comm, N_Vector uv, void *user_data, realtype *intval); +static int integr(MPI_Comm comm, N_Vector uv, void *user_data, sunrealtype *intval); /* Prototypes for supporting functions */ static void BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - int dsizex, int dsizey, realtype carray[]); + int dsizex, int dsizey, sunrealtype carray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]); + sunrealtype cext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]); + int dsizex, sunrealtype cext[], sunrealtype buffer[]); -static void ReactRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void ReactRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData data); /* Prototypes for private functions */ @@ -162,9 +162,9 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol); + sunrealtype rtol, sunrealtype atol); -static void PrintOutput(void *mem, N_Vector uv, realtype time, +static void PrintOutput(void *mem, N_Vector uv, sunrealtype time, UserData data, MPI_Comm comm); static void PrintSol(void* mem, N_Vector uv, N_Vector uvp, UserData data, @@ -188,12 +188,12 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; UserData data; sunindextype SystemSize, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; N_Vector uv, uvp, resid, id, *uvS, *uvpS; int thispe, npes, maxl, iout, retval; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; - realtype intval; + sunrealtype intval; uv = uvp = resid = id = NULL; uvS = uvpS = NULL; @@ -431,7 +431,7 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, N_Vector resid, UserData data) { int ixsub, jysub, mxsub, mysub, ix, jy; - realtype *idxy, dx, dy, x, y, *uvxy, *uvxy1, L, npex, npey; + sunrealtype *idxy, dx, dy, x, y, *uvxy, *uvxy1, L, npex, npey; ixsub = data->ixsub; jysub = data->jysub; @@ -526,7 +526,7 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol) + sunrealtype rtol, sunrealtype atol) { printf("\n Brusselator PDE - DAE parallel example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -559,11 +559,11 @@ static void PrintHeader(sunindextype SystemSize, int maxl, * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector uv, realtype tt, +static void PrintOutput(void *ida_mem, N_Vector uv, sunrealtype tt, UserData data, MPI_Comm comm) { MPI_Status status; - realtype *cdata, clast[2], hused; + sunrealtype *cdata, clast[2], hused; long int nst; int i, kused, retval, thispe, npelast, ilast;; @@ -622,7 +622,7 @@ static void PrintSol(void* ida_mem, N_Vector uv, N_Vector uvp, UserData data, MPI_Comm comm) { FILE* fout; - realtype *uvxy; + sunrealtype *uvxy; int ix, jy, mxsub, mysub, thispe; char szFilename[128]; @@ -760,7 +760,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id * reslocal, for computation of the residuals on this processor. */ -static int res(realtype tt, N_Vector uv, N_Vector uvp, +static int res(sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data) { int retval; @@ -789,12 +789,12 @@ static int res(realtype tt, N_Vector uv, N_Vector uvp, * The message-passing uses blocking sends, non-blocking receives, * and receive-waiting, in routines BRecvPost, BSend, BRecvWait. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, void *user_data) { UserData data; - realtype *cdata, *gridext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *gridext, buffer[2*NUM_SPECIES*MYSUB]; int thispe, ixsub, jysub, nsmxsub, nsmysub; MPI_Comm comm; MPI_Request request[4]; @@ -827,7 +827,7 @@ static int rescomm(sunindextype Nlocal, realtype tt, /* * BRecvPost: Start receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. @@ -835,11 +835,11 @@ static int rescomm(sunindextype Nlocal, realtype tt, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]) + sunrealtype cext[], sunrealtype buffer[]) { int offsetce; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If jysub > 0, receive data for bottom x-line of cext. */ if (jysub != 0) @@ -868,18 +868,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * BRecvWait: Finish receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. */ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]) + int dsizex, sunrealtype cext[], sunrealtype buffer[]) { int i; int ly, dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -926,11 +926,11 @@ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, */ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, - int dsizex, int dsizey, realtype cdata[]) + int dsizex, int dsizey, sunrealtype cdata[]) { int i; int ly, offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If jysub > 0, send data from bottom x-line of uv. */ @@ -1001,13 +1001,13 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, * for use by the preconditioner setup routine. */ -static int reslocal(sunindextype Nlocal, realtype tt, N_Vector uv, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data) { - realtype *uvdata, *uvpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui, dx2, dy2; + sunrealtype *uvdata, *uvpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui, dx2, dy2; int ixend, ixstart, jystart, jyend; int ix, jy, is, i, locc, ylocce, locce; - realtype rates[2]; + sunrealtype rates[2]; UserData data; data = (UserData) user_data; @@ -1145,10 +1145,10 @@ static int reslocal(sunindextype Nlocal, realtype tt, N_Vector uv, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void ReactRates(realtype xx, realtype yy, realtype *uvval, - realtype *rates, UserData data) +static void ReactRates(sunrealtype xx, sunrealtype yy, sunrealtype *uvval, + sunrealtype *rates, UserData data) { - realtype A, B; + sunrealtype A, B; A = data->A; B = data->B; @@ -1161,14 +1161,14 @@ static void ReactRates(realtype xx, realtype yy, realtype *uvval, /* Integrate over the spatial domain. Each process computes the integral on its grid. Then processes call MPI_REDUCE to compute sum of the local values. */ -static int integr(MPI_Comm comm, N_Vector uv, void *user_data, realtype *intval) +static int integr(MPI_Comm comm, N_Vector uv, void *user_data, sunrealtype *intval) { int ix, jy; int retval; - realtype *uvdata; + sunrealtype *uvdata; UserData data; - realtype buf[2]; + sunrealtype buf[2]; data = (UserData) user_data; diff --git a/examples/idas/parallel/idasBruss_kry_bbd_p.c b/examples/idas/parallel/idasBruss_kry_bbd_p.c index 2a8b07ed44..e1352740c7 100644 --- a/examples/idas/parallel/idasBruss_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_kry_bbd_p.c @@ -103,40 +103,40 @@ typedef struct { int ns, thispe, npes, ixsub, jysub, npex, npey; int mxsub, mysub, nsmxsub, nsmxsub2; - realtype A, B, L, eps[NUM_SPECIES]; - realtype dx, dy; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES]; - realtype gridext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; - realtype rhs[NUM_SPECIES]; + sunrealtype A, B, L, eps[NUM_SPECIES]; + sunrealtype dx, dy; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES]; + sunrealtype gridext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; + sunrealtype rhs[NUM_SPECIES]; MPI_Comm comm; - realtype rates[2]; + sunrealtype rates[2]; sunindextype n_local; } *UserData; /* Prototypes for functions called by the IDA Solver. */ -static int res(realtype tt, N_Vector uv, N_Vector uvp, +static int res(sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, void *user_data); /* Prototypes for supporting functions */ static void BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - int dsizex, int dsizey, realtype carray[]); + int dsizex, int dsizey, sunrealtype carray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]); + sunrealtype cext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]); + int dsizex, sunrealtype cext[], sunrealtype buffer[]); -static void ReactRates(realtype xx, realtype yy, realtype *cxy, - realtype *ratesxy, UserData data); +static void ReactRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, + sunrealtype *ratesxy, UserData data); /* Prototypes for private functions */ static void InitUserData(UserData data, int thispe, int npes, @@ -148,9 +148,9 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol); + sunrealtype rtol, sunrealtype atol); -static void PrintOutput(void *ida_mem, N_Vector uv, realtype time, +static void PrintOutput(void *ida_mem, N_Vector uv, sunrealtype time, UserData data, MPI_Comm comm); static void PrintSol(void* ida_mem, N_Vector uv, N_Vector uvp, UserData data, @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; UserData data; sunindextype SystemSize, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; N_Vector uv, uvp, resid, id; int thispe, npes, maxl, iout, retval; @@ -364,7 +364,7 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, N_Vector resid, UserData data) { int ixsub, jysub, mxsub, mysub, ix, jy; - realtype *idxy, dx, dy, x, y, *uvxy, *uvxy1, L, npex, npey; + sunrealtype *idxy, dx, dy, x, y, *uvxy, *uvxy1, L, npex, npey; ixsub = data->ixsub; jysub = data->jysub; @@ -458,7 +458,7 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol) + sunrealtype rtol, sunrealtype atol) { printf("\nidasBruss_kry_bbd_p: Brusselator DAE parallel example problem for IDAS \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -491,11 +491,11 @@ static void PrintHeader(sunindextype SystemSize, int maxl, * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector uv, realtype tt, +static void PrintOutput(void *ida_mem, N_Vector uv, sunrealtype tt, UserData data, MPI_Comm comm) { MPI_Status status; - realtype *cdata, clast[2], hused; + sunrealtype *cdata, clast[2], hused; long int nst; int i, kused, retval, thispe, npelast, ilast;; @@ -554,7 +554,7 @@ static void PrintSol(void* ida_mem, N_Vector uv, N_Vector uvp, UserData data, MPI_Comm comm) { FILE* fout; - realtype *uvxy; + sunrealtype *uvxy; int ix, jy, mxsub, mysub, thispe; char szFilename[128]; @@ -692,7 +692,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id * reslocal, for computation of the residuals on this processor. */ -static int res(realtype tt, N_Vector uv, N_Vector uvp, +static int res(sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data) { int retval; @@ -721,12 +721,12 @@ static int res(realtype tt, N_Vector uv, N_Vector uvp, * The message-passing uses blocking sends, non-blocking receives, * and receive-waiting, in routines BRecvPost, BSend, BRecvWait. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, void *user_data) { UserData data; - realtype *cdata, *gridext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *gridext, buffer[2*NUM_SPECIES*MYSUB]; int thispe, ixsub, jysub, nsmxsub, nsmysub; MPI_Comm comm; MPI_Request request[4]; @@ -759,7 +759,7 @@ static int rescomm(sunindextype Nlocal, realtype tt, /* * BRecvPost: Start receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. @@ -767,11 +767,11 @@ static int rescomm(sunindextype Nlocal, realtype tt, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]) + sunrealtype cext[], sunrealtype buffer[]) { int offsetce; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If jysub > 0, receive data for bottom x-line of cext. */ if (jysub != 0) @@ -800,18 +800,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * BRecvWait: Finish receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. */ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]) + int dsizex, sunrealtype cext[], sunrealtype buffer[]) { int i; int ly, dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -858,11 +858,11 @@ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, */ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, - int dsizex, int dsizey, realtype cdata[]) + int dsizex, int dsizey, sunrealtype cdata[]) { int i; int ly, offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If jysub > 0, send data from bottom x-line of uv. */ @@ -933,13 +933,13 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, * for use by the preconditioner setup routine. */ -static int reslocal(sunindextype Nlocal, realtype tt, N_Vector uv, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, N_Vector uvp, N_Vector rr, void *user_data) { - realtype *uvdata, *uvpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui, dx2, dy2; + sunrealtype *uvdata, *uvpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui, dx2, dy2; int ixend, ixstart, jystart, jyend; int ix, jy, is, i, locc, ylocce, locce; - realtype rates[2]; + sunrealtype rates[2]; UserData data; data = (UserData) user_data; @@ -1077,10 +1077,10 @@ static int reslocal(sunindextype Nlocal, realtype tt, N_Vector uv, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void ReactRates(realtype xx, realtype yy, realtype *uvval, - realtype *rates, UserData data) +static void ReactRates(sunrealtype xx, sunrealtype yy, sunrealtype *uvval, + sunrealtype *rates, UserData data) { - realtype A, B; + sunrealtype A, B; A = data->A; B = data->B; diff --git a/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c b/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c index af438c1cb3..c489c7a498 100644 --- a/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c +++ b/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c @@ -165,8 +165,8 @@ typedef struct { int ns, np, thispe, npes, ixsub, jysub, npex, npey; int mxsub, mysub, nsmxsub, nsmxsub2; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], rhs[NUM_SPECIES], cext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; MPI_Comm comm; N_Vector rates; @@ -175,34 +175,34 @@ typedef struct { /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, void *user_data); /* Prototypes for supporting functions */ static void BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - int dsizex, int dsizey, realtype carray[]); + int dsizex, int dsizey, sunrealtype carray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]); + sunrealtype cext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]); + int dsizex, sunrealtype cext[], sunrealtype buffer[]); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(int size, realtype *x1, realtype *x2); +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2); /* Prototypes for private functions */ @@ -215,9 +215,9 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol); + sunrealtype rtol, sunrealtype atol); -static void PrintOutput(void *ida_mem, N_Vector cc, realtype time, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype time, UserData webdata, MPI_Comm comm); static void PrintFinalStats(void *ida_mem); @@ -238,7 +238,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; UserData webdata; sunindextype SystemSize, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; N_Vector cc, cp, res, id; int thispe, npes, maxl, iout, retval; @@ -405,7 +405,7 @@ static void InitUserData(UserData webdata, int thispe, int npes, MPI_Comm comm) { int i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; webdata->jysub = thispe / NPEX; webdata->ixsub = thispe - (webdata->jysub)*NPEX; @@ -472,7 +472,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, N_Vector res, UserData webdata) { int ixsub, jysub, mxsub, mysub, np, ix, jy, is; - realtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; + sunrealtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; ixsub = webdata->ixsub; jysub = webdata->jysub; @@ -494,7 +494,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { if (is < np) - { cxy[is] = RCONST(10.0) + (realtype)(is+1)*xyfactor; idxy[is] = ONE; } + { cxy[is] = RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } @@ -524,7 +524,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype rtol, realtype atol) + sunrealtype rtol, sunrealtype atol) { printf("\nidasFoodWeb_kry_bbd_p: Predator-prey DAE parallel example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -557,11 +557,11 @@ static void PrintHeader(sunindextype SystemSize, int maxl, * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *ida_mem, N_Vector cc, realtype tt, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype tt, UserData webdata, MPI_Comm comm) { MPI_Status status; - realtype *cdata, clast[2], hused; + sunrealtype *cdata, clast[2], hused; long int nst; int i, kused, retval, thispe, npelast, ilast;; @@ -719,7 +719,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id * reslocal, for computation of the residuals on this processor. */ -static int resweb(realtype tt, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, void *user_data) { @@ -750,13 +750,13 @@ static int resweb(realtype tt, * and receive-waiting, in routines BRecvPost, BSend, BRecvWait. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, void *user_data) { UserData webdata; - realtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; int thispe, ixsub, jysub, nsmxsub, nsmysub; MPI_Comm comm; MPI_Request request[4]; @@ -793,7 +793,7 @@ static int rescomm(sunindextype Nlocal, realtype tt, /* * BRecvPost: Start receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. @@ -802,11 +802,11 @@ static int rescomm(sunindextype Nlocal, realtype tt, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]) + sunrealtype cext[], sunrealtype buffer[]) { int offsetce; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If jysub > 0, receive data for bottom x-line of cext. */ if (jysub != 0) @@ -836,18 +836,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * BRecvWait: Finish receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. */ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]) + int dsizex, sunrealtype cext[], sunrealtype buffer[]) { int i; int ly, dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -894,11 +894,11 @@ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, */ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, - int dsizex, int dsizey, realtype cdata[]) + int dsizex, int dsizey, sunrealtype cdata[]) { int i; int ly, offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If jysub > 0, send data from bottom x-line of cc. */ @@ -973,11 +973,11 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, * for use by the preconditioner setup routine. */ -static int reslocal(sunindextype Nlocal, realtype tt, +static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, void *user_data) { - realtype *cdata, *ratesxy, *cpxy, *resxy, + sunrealtype *cdata, *ratesxy, *cpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui; int ix, jy, is, i, locc, ylocce, locce; UserData webdata; @@ -1071,11 +1071,11 @@ static int reslocal(sunindextype Nlocal, realtype tt, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -1088,13 +1088,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(int size, realtype *x1, realtype *x2) +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2) { int i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; diff --git a/examples/idas/parallel/idasFoodWeb_kry_p.c b/examples/idas/parallel/idasFoodWeb_kry_p.c index 587d10d5e0..a09a046911 100644 --- a/examples/idas/parallel/idasFoodWeb_kry_p.c +++ b/examples/idas/parallel/idasFoodWeb_kry_p.c @@ -170,12 +170,12 @@ typedef struct { sunindextype ns; int np, thispe, npes, ixsub, jysub, npex, npey; int mxsub, mysub, nsmxsub, nsmxsub2; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES], rhs[NUM_SPECIES], cext[(MXSUB+2)*(MYSUB+2)*NUM_SPECIES]; MPI_Comm comm; N_Vector rates; - realtype **PP[MXSUB][MYSUB]; + sunrealtype **PP[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; N_Vector ewt; void *ida_mem; @@ -184,37 +184,37 @@ typedef struct { /* Prototypes for user-supplied and supporting functions. */ -static int resweb(realtype time, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); -static int Precondbd(realtype tt, N_Vector cc, N_Vector cp, N_Vector rr, - realtype cj, void *user_data); +static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, + sunrealtype cj, void *user_data); -static int PSolvebd(realtype tt, N_Vector cc, N_Vector cp, +static int PSolvebd(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype delta, void *user_data); + sunrealtype cj, sunrealtype delta, void *user_data); static int rescomm(N_Vector cc, N_Vector cp, void *user_data); static void BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - int dsizex, int dsizey, realtype carray[]); + int dsizex, int dsizey, sunrealtype carray[]); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]); + sunrealtype cext[], sunrealtype buffer[]); static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]); + int dsizex, sunrealtype cext[], sunrealtype buffer[]); -static int reslocal(realtype tt, N_Vector cc, N_Vector cp, N_Vector res, +static int reslocal(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(int size, realtype *x1, realtype *x2); +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2); /* Prototypes for private Helper Functions. */ @@ -230,9 +230,9 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, N_Vector scrtch, UserData webdata); static void PrintHeader(sunindextype SystemSize, int maxl, - realtype rtol, realtype atol); + sunrealtype rtol, sunrealtype atol); -static void PrintOutput(void *ida_mem, N_Vector cc, realtype time, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype time, UserData webdata, MPI_Comm comm); static void PrintFinalStats(void *ida_mem); @@ -253,7 +253,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; UserData webdata; sunindextype SystemSize, local_N; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; N_Vector cc, cp, res, id; int thispe, npes, maxl, iout, retval; @@ -447,7 +447,7 @@ static void InitUserData(UserData webdata, int thispe, int npes, MPI_Comm comm) { int i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2, **acoef, *bcoef, *cox, *coy; webdata->jysub = thispe / NPEX; webdata->ixsub = thispe - (webdata->jysub)*NPEX; @@ -534,7 +534,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, N_Vector res, UserData webdata) { int ixsub, jysub, mxsub, mysub, np, ix, jy, is; - realtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; + sunrealtype *cxy, *idxy, *cpxy, dx, dy, xx, yy, xyfactor; ixsub = webdata->ixsub; jysub = webdata->jysub; @@ -555,7 +555,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, cxy = IJ_Vptr(cc,ix,jy); idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { - if (is < np) { cxy[is] = RCONST(10.0) + (realtype)(is+1)*xyfactor; idxy[is] = ONE; } + if (is < np) { cxy[is] = RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } @@ -580,7 +580,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, */ static void PrintHeader(sunindextype SystemSize, int maxl, - realtype rtol, realtype atol) + sunrealtype rtol, sunrealtype atol) { printf("\nidasFoodWeb_kry_p: Predator-prey DAE parallel example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -613,11 +613,11 @@ static void PrintHeader(sunindextype SystemSize, int maxl, * (NOTE: This routine is specific to the case NUM_SPECIES = 2.) */ -static void PrintOutput(void *ida_mem, N_Vector cc, realtype tt, +static void PrintOutput(void *ida_mem, N_Vector cc, sunrealtype tt, UserData webdata, MPI_Comm comm) { MPI_Status status; - realtype *cdata, clast[2], hused; + sunrealtype *cdata, clast[2], hused; long int nst; int i, kused, retval, thispe, npelast, ilast;; @@ -770,7 +770,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt, int id * reslocal, for computation of the residuals on this processor. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { int retval; @@ -802,7 +802,7 @@ static int rescomm(N_Vector cc, N_Vector cp, void *user_data) { UserData webdata; - realtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; int thispe, ixsub, jysub, nsmxsub, nsmysub; MPI_Comm comm; MPI_Request request[4]; @@ -840,11 +840,11 @@ static int rescomm(N_Vector cc, N_Vector cp, void *user_data) */ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, - int dsizex, int dsizey, realtype cdata[]) + int dsizex, int dsizey, sunrealtype cdata[]) { int i; int ly, offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If jysub > 0, send data from bottom x-line of cc. */ if (jysub != 0) @@ -882,7 +882,7 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, /* * BRecvPost: Start receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. @@ -891,11 +891,11 @@ static void BSend(MPI_Comm comm, int my_pe, int ixsub, int jysub, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int ixsub, int jysub, int dsizex, int dsizey, - realtype cext[], realtype buffer[]) + sunrealtype cext[], sunrealtype buffer[]) { int offsetce; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If jysub > 0, receive data for bottom x-line of cext. */ if (jysub != 0) @@ -925,18 +925,18 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * BRecvWait: Finish receiving boundary data from neighboring PEs. - * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * (1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * (2) request should have 4 entries, and is also passed in both calls. */ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype cext[], realtype buffer[]) + int dsizex, sunrealtype cext[], sunrealtype buffer[]) { int i; int ly, dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -1012,10 +1012,10 @@ static void BRecvWait(MPI_Request request[], int ixsub, int jysub, * for use by the preconditioner setup routine. */ -static int reslocal(realtype tt, N_Vector cc, N_Vector cp, N_Vector res, +static int reslocal(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { - realtype *cdata, *ratesxy, *cpxy, *resxy, + sunrealtype *cdata, *ratesxy, *cpxy, *resxy, xx, yy, dcyli, dcyui, dcxli, dcxui; int ix, jy, is, i, locc, ylocce, locce; UserData webdata; @@ -1107,11 +1107,11 @@ static int reslocal(realtype tt, N_Vector cc, N_Vector cp, N_Vector res, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -1124,13 +1124,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(int size, realtype *x1, realtype *x2) +static sunrealtype dotprod(int size, sunrealtype *x1, sunrealtype *x2) { int i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); @@ -1147,19 +1147,19 @@ static realtype dotprod(int size, realtype *x1, realtype *x2) * Each block is LU-factored, for later solution of the linear systems. */ -static int Precondbd(realtype tt, N_Vector cc, N_Vector cp, - N_Vector rr, realtype cj, void *user_data) +static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, + N_Vector rr, sunrealtype cj, void *user_data) { int retval, thispe; sunindextype ret; - realtype uround; - realtype xx, yy, *cxy, *ewtxy, cctemp, **Pxy, *ratesxy, *Pxycol, *cpxy; - realtype inc, sqru, fac, perturb_rates[NUM_SPECIES]; + sunrealtype uround; + sunrealtype xx, yy, *cxy, *ewtxy, cctemp, **Pxy, *ratesxy, *Pxycol, *cpxy; + sunrealtype inc, sqru, fac, perturb_rates[NUM_SPECIES]; int is, js, ix, jy; UserData webdata; void *ida_mem; N_Vector ewt; - realtype hh; + sunrealtype hh; webdata = (UserData)user_data; uround = UNIT_ROUNDOFF; @@ -1221,11 +1221,11 @@ static int Precondbd(realtype tt, N_Vector cc, N_Vector cp, * preconditioner PP, to compute the solution of PP * zvec = rvec. */ -static int PSolvebd(realtype tt, N_Vector cc, N_Vector cp, +static int PSolvebd(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype cj, realtype delta, void *user_data) + sunrealtype cj, sunrealtype delta, void *user_data) { - realtype **Pxy, *zxy; + sunrealtype **Pxy, *zxy; sunindextype *pivot, ix, jy; UserData webdata; diff --git a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c index 6ea9f7d02b..9d7119d0da 100644 --- a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c +++ b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c @@ -76,32 +76,32 @@ #define NS 2 /* Number of sensitivities (NS<=2) */ typedef struct { - realtype p[2]; + sunrealtype p[2]; int thispe, mx, my, ixsub, jysub, npex, npey, mxsub, mysub; sunindextype n_local; - realtype dx, dy, coeffx, coeffy, coeffxy; - realtype uext[(MXSUB+2)*(MYSUB+2)]; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype uext[(MXSUB+2)*(MYSUB+2)]; MPI_Comm comm; } *UserData; /* Prototypes of user-supplied and supporting functions */ -static int heatres(realtype tres, N_Vector uu, N_Vector up, +static int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uu, N_Vector up, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tres, +static int reslocal(sunindextype Nlocal, sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data); static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uarray[]); + sunrealtype uarray[]); static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static int BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype uext[], realtype buffer[]); + int dsizex, sunrealtype uext[], sunrealtype buffer[]); /* Prototypes of private functions */ @@ -109,10 +109,10 @@ static int InitUserData(int thispe, MPI_Comm comm, UserData data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data); -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol, +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol, sunindextype mudq, sunindextype mukeep, booleantype sensi, int sensi_meth, int err_con); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu, +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu, booleantype sensi, N_Vector *uuS); static void PrintFinalStats(void *ida_mem); @@ -137,10 +137,10 @@ int main(int argc, char *argv[]) UserData data; int thispe, iout, retval, npes; sunindextype Neq, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uu, up, constraints, id, res; - realtype *pbar; + sunrealtype *pbar; int is; N_Vector *uuS, *upS; booleantype sensi, err_con; @@ -278,7 +278,7 @@ int main(int argc, char *argv[]) done here as an illustration only, as the default values for pbar, if pbar is not supplied, are anyway 1.0) */ - pbar = (realtype *) malloc(NS*sizeof(realtype)); + pbar = (sunrealtype *) malloc(NS*sizeof(sunrealtype)); if (check_retval((void *)pbar, "malloc", 2, thispe)) MPI_Abort(comm, 1); for (is=0; isp[is]; @@ -399,7 +399,7 @@ int main(int argc, char *argv[]) * of uu required to calculate the residual. */ -static int heatres(realtype tres, N_Vector uu, N_Vector up, +static int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data) { int retval; @@ -425,11 +425,11 @@ static int heatres(realtype tres, N_Vector uu, N_Vector up, * communication of data in u needed to calculate G. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uu, N_Vector up, void *user_data) { UserData data; - realtype *uarray, *uext, buffer[2*MYSUB]; + sunrealtype *uarray, *uext, buffer[2*MYSUB]; MPI_Comm comm; int thispe, ixsub, jysub, mxsub, mysub; MPI_Request request[4]; @@ -462,17 +462,17 @@ static int rescomm(sunindextype Nlocal, realtype tt, * has already been done, and that this data is in the work array uext. */ -static int reslocal(sunindextype Nlocal, realtype tres, +static int reslocal(sunindextype Nlocal, sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data) { - realtype *uext, *uuv, *upv, *resv; - realtype termx, termy; + sunrealtype *uext, *uuv, *upv, *resv; + sunrealtype termx, termy; int lx, ly, offsetu, offsetue, locu, locue; int ixsub, jysub, mxsub, mxsub2, mysub, npex, npey; int ixbegin, ixend, jybegin, jyend; UserData data; - realtype p1, p2; + sunrealtype p1, p2; /* Get subgrid indices, array sizes, extended work array uext. */ @@ -537,10 +537,10 @@ static int reslocal(sunindextype Nlocal, realtype tres, static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uarray[]) + sunrealtype uarray[]) { int ly, offsetu; - realtype bufleft[MYSUB], bufright[MYSUB]; + sunrealtype bufleft[MYSUB], bufright[MYSUB]; /* If jysub > 0, send data from bottom x-line of u. */ @@ -582,7 +582,7 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -592,11 +592,11 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { int offsetue; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) @@ -629,7 +629,7 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -637,11 +637,11 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, */ static int BRecvWait(MPI_Request request[], int ixsub, - int jysub, int dsizex, realtype uext[], - realtype buffer[]) + int jysub, int dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int ly, dsizex2, offsetue; - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; MPI_Status status; dsizex2 = dsizex + 2; @@ -724,7 +724,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, { int i, iloc, j, jloc, offset, loc, ixsub, jysub; int ixbegin, ixend, jybegin, jyend; - realtype xfact, yfact, *udata, *iddata; + sunrealtype xfact, yfact, *udata, *iddata; /* Initialize uu. */ @@ -777,7 +777,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * and table heading */ -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol, +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol, sunindextype mudq, sunindextype mukeep, booleantype sensi, int sensi_meth, int err_con) { @@ -831,10 +831,10 @@ static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol, /* * Print integrator statistics and max-norm of solution */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu, +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu, booleantype sensi, N_Vector *uuS) { - realtype umax, hused; + sunrealtype umax, hused; int kused, retval, is; long int nst, nni, nre, nli, npe, nps, nreLS, nge; diff --git a/examples/idas/parallel/idasHeat2D_kry_bbd_p.c b/examples/idas/parallel/idasHeat2D_kry_bbd_p.c index f56ea0cdda..9ea49bdda3 100644 --- a/examples/idas/parallel/idasHeat2D_kry_bbd_p.c +++ b/examples/idas/parallel/idasHeat2D_kry_bbd_p.c @@ -73,34 +73,34 @@ typedef struct { int thispe, mx, my, ixsub, jysub, npex, npey, mxsub, mysub; int n_local; - realtype dx, dy, coeffx, coeffy, coeffxy; - realtype uext[(MXSUB+2)*(MYSUB+2)]; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype uext[(MXSUB+2)*(MYSUB+2)]; MPI_Comm comm; } *UserData; /* Prototypes of user-supplied and supporting functions */ -static int heatres(realtype tres, N_Vector uu, N_Vector up, +static int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data); -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uu, N_Vector up, void *user_data); -static int reslocal(sunindextype Nlocal, realtype tres, +static int reslocal(sunindextype Nlocal, sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data); static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uarray[]); + sunrealtype uarray[]); static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uext[], realtype buffer[]); + sunrealtype uext[], sunrealtype buffer[]); static int BRecvWait(MPI_Request request[], int ixsub, int jysub, - int dsizex, realtype uext[], realtype buffer[]); + int dsizex, sunrealtype uext[], sunrealtype buffer[]); /* Prototypes of private functions */ @@ -109,11 +109,11 @@ static int InitUserData(int thispe, MPI_Comm comm, UserData data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data); -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol); +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol); static void PrintCase(int case_number, sunindextype mudq, sunindextype mukeep); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) UserData data; int thispe, iout, retval, npes; sunindextype Neq, local_N, mudq, mldq, mukeep, mlkeep; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uu, up, constraints, id, res; ida_mem = NULL; @@ -349,7 +349,7 @@ int main(int argc, char *argv[]) * of uu required to calculate the residual. */ -static int heatres(realtype tres, N_Vector uu, N_Vector up, +static int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data) { int retval; @@ -375,11 +375,11 @@ static int heatres(realtype tres, N_Vector uu, N_Vector up, * communication of data in u needed to calculate G. */ -static int rescomm(sunindextype Nlocal, realtype tt, +static int rescomm(sunindextype Nlocal, sunrealtype tt, N_Vector uu, N_Vector up, void *user_data) { UserData data; - realtype *uarray, *uext, buffer[2*MYSUB]; + sunrealtype *uarray, *uext, buffer[2*MYSUB]; MPI_Comm comm; int thispe, ixsub, jysub, mxsub, mysub; MPI_Request request[4]; @@ -412,12 +412,12 @@ static int rescomm(sunindextype Nlocal, realtype tt, * has already been done, and that this data is in the work array uext. */ -static int reslocal(sunindextype Nlocal, realtype tres, +static int reslocal(sunindextype Nlocal, sunrealtype tres, N_Vector uu, N_Vector up, N_Vector res, void *user_data) { - realtype *uext, *uuv, *upv, *resv; - realtype termx, termy, termctr; + sunrealtype *uext, *uuv, *upv, *resv; + sunrealtype termx, termy, termctr; int lx, ly, offsetu, offsetue, locu, locue; int ixsub, jysub, mxsub, mxsub2, mysub, npex, npey; int ixbegin, ixend, jybegin, jyend; @@ -483,10 +483,10 @@ static int reslocal(sunindextype Nlocal, realtype tres, static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uarray[]) + sunrealtype uarray[]) { int ly, offsetu; - realtype bufleft[MYSUB], bufright[MYSUB]; + sunrealtype bufleft[MYSUB], bufright[MYSUB]; /* If jysub > 0, send data from bottom x-line of u. */ @@ -528,7 +528,7 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -538,11 +538,11 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, int dsizex, int dsizey, - realtype uext[], realtype buffer[]) + sunrealtype uext[], sunrealtype buffer[]) { int offsetue; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) @@ -575,7 +575,7 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -583,11 +583,11 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, */ static int BRecvWait(MPI_Request request[], int ixsub, - int jysub, int dsizex, realtype uext[], - realtype buffer[]) + int jysub, int dsizex, sunrealtype uext[], + sunrealtype buffer[]) { int ly, dsizex2, offsetue; - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; MPI_Status status; dsizex2 = dsizex + 2; @@ -666,7 +666,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, { int i, iloc, j, jloc, offset, loc, ixsub, jysub; int ixbegin, ixend, jybegin, jyend; - realtype xfact, yfact, *udata, *iddata; + sunrealtype xfact, yfact, *udata, *iddata; /* Initialize uu. */ @@ -719,7 +719,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * and table heading */ -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol) { printf("idasHeat2D_kry_bbd_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -765,9 +765,9 @@ static void PrintCase(int case_number, sunindextype mudq, sunindextype mukeep) * Print integrator statistics and max-norm of solution */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype umax, hused; + sunrealtype umax, hused; int kused, retval; long int nst, nni, nre, nli, npe, nps, nreLS, nge; diff --git a/examples/idas/parallel/idasHeat2D_kry_p.c b/examples/idas/parallel/idasHeat2D_kry_p.c index fb06286cbb..bb5960bbbe 100644 --- a/examples/idas/parallel/idasHeat2D_kry_p.c +++ b/examples/idas/parallel/idasHeat2D_kry_p.c @@ -71,40 +71,40 @@ typedef struct { int thispe, npex, npey, ixsub, jysub; sunindextype mx, my, mxsub, mysub; - realtype dx, dy, coeffx, coeffy, coeffxy; - realtype uext[(MXSUB+2)*(MYSUB+2)]; + sunrealtype dx, dy, coeffx, coeffy, coeffxy; + sunrealtype uext[(MXSUB+2)*(MYSUB+2)]; N_Vector pp; /* vector of diagonal preconditioner elements */ MPI_Comm comm; } *UserData; /* User-supplied residual function and supporting routines */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data); static int rescomm(N_Vector uu, N_Vector up, void *user_data); -static int reslocal(realtype tt, N_Vector uu, N_Vector up, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector res, void *user_data); static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - sunindextype dsizex, sunindextype dsizey, realtype uarray[]); + sunindextype dsizex, sunindextype dsizey, sunrealtype uarray[]); static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, sunindextype dsizex, - sunindextype dsizey, realtype uext[], realtype buffer[]); + sunindextype dsizey, sunrealtype uext[], sunrealtype buffer[]); static int BRecvWait(MPI_Request request[], int ixsub, int jysub, - sunindextype dsizex, realtype uext[], realtype buffer[]); + sunindextype dsizex, sunrealtype uext[], sunrealtype buffer[]); /* User-supplied preconditioner routines */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, - N_Vector rvec, N_Vector zvec, realtype c_j, - realtype delta, void *user_data); +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, + N_Vector rvec, N_Vector zvec, sunrealtype c_j, + sunrealtype delta, void *user_data); -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data); /* Private function to check function return values */ @@ -113,9 +113,9 @@ static int InitUserData(int thispe, MPI_Comm comm, UserData data); static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, N_Vector res, UserData data); -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol); +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol); -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu); +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu); static void PrintFinalStats(void *ida_mem); @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) UserData data; int iout, thispe, retval, npes; sunindextype Neq, local_N; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; N_Vector uu, up, constraints, id, res; ida_mem = NULL; @@ -317,7 +317,7 @@ int main(int argc, char *argv[]) * of uu required to calculate the residual. */ -int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { int retval; @@ -350,10 +350,10 @@ int resHeat(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, * */ -int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data) +int PsetupHeat(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + sunrealtype c_j, void *user_data) { - realtype *ppv, pelinv; + sunrealtype *ppv, pelinv; sunindextype lx, ly, ixbegin, ixend, jybegin, jyend, locu, mxsub, mysub; int ixsub, jysub, npex, npey; UserData data; @@ -403,9 +403,9 @@ int PsetupHeat(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, * computed in PsetupHeat), returning the result in zvec. */ -int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData data; @@ -432,7 +432,7 @@ int PsolveHeat(realtype tt, N_Vector uu, N_Vector up, static int rescomm(N_Vector uu, N_Vector up, void *user_data) { UserData data; - realtype *uarray, *uext, buffer[2*MYSUB]; + sunrealtype *uarray, *uext, buffer[2*MYSUB]; MPI_Comm comm; int thispe, ixsub, jysub; sunindextype mxsub, mysub; @@ -466,11 +466,11 @@ static int rescomm(N_Vector uu, N_Vector up, void *user_data) * has already been done, and that this data is in the work array uext. */ -static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, +static int reslocal(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { - realtype *uext, *uuv, *upv, *resv; - realtype termx, termy, termctr; + sunrealtype *uext, *uuv, *upv, *resv; + sunrealtype termx, termy, termctr; sunindextype lx, ly, offsetu, offsetue, locu, locue; int ixsub, jysub, npex, npey; sunindextype mxsub, mxsub2, mysub; @@ -536,10 +536,10 @@ static int reslocal(realtype tt, N_Vector uu, N_Vector up, N_Vector rr, */ static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, - sunindextype dsizex, sunindextype dsizey, realtype uarray[]) + sunindextype dsizex, sunindextype dsizey, sunrealtype uarray[]) { sunindextype ly, offsetu; - realtype bufleft[MYSUB], bufright[MYSUB]; + sunrealtype bufleft[MYSUB], bufright[MYSUB]; /* If jysub > 0, send data from bottom x-line of u. */ @@ -581,7 +581,7 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in @@ -590,11 +590,11 @@ static int BSend(MPI_Comm comm, int thispe, int ixsub, int jysub, static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, int ixsub, int jysub, sunindextype dsizex, - sunindextype dsizey, realtype uext[], realtype buffer[]) + sunindextype dsizey, sunrealtype uext[], sunrealtype buffer[]) { sunindextype offsetue; /* Have bufleft and bufright use the same buffer. */ - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; /* If jysub > 0, receive data for bottom x-line of uext. */ if (jysub != 0) @@ -627,7 +627,7 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*MYSUB realtype entries, should be + * 1) buffer should be able to hold 2*MYSUB sunrealtype entries, should be * passed to both the BRecvPost and BRecvWait functions, and should not * be manipulated between the two calls. * 2) request should have four entries, and should be passed in both @@ -635,10 +635,10 @@ static int BRecvPost(MPI_Comm comm, MPI_Request request[], int thispe, */ static int BRecvWait(MPI_Request request[], int ixsub, int jysub, - sunindextype dsizex, realtype uext[], realtype buffer[]) + sunindextype dsizex, sunrealtype uext[], sunrealtype buffer[]) { sunindextype ly, dsizex2, offsetue; - realtype *bufleft = buffer, *bufright = buffer+MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+MYSUB; MPI_Status status; dsizex2 = dsizex + 2; @@ -718,7 +718,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, int ixsub, jysub; sunindextype i, iloc, j, jloc, offset, loc; sunindextype ixbegin, ixend, jybegin, jyend; - realtype xfact, yfact, *udata, *iddata; + sunrealtype xfact, yfact, *udata, *iddata; /* Initialize uu. */ @@ -769,7 +769,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, * Print first lines of output and table heading */ -static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) +static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol) { printf("\nidasHeat2D_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -802,9 +802,9 @@ static void PrintHeader(sunindextype Neq, realtype rtol, realtype atol) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(int id, void *ida_mem, realtype t, N_Vector uu) +static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/idas/serial/idasAkzoNob_ASAi_dns.c b/examples/idas/serial/idasAkzoNob_ASAi_dns.c index 38d3a72da2..8b1a1d253f 100644 --- a/examples/idas/serial/idasAkzoNob_ASAi_dns.c +++ b/examples/idas/serial/idasAkzoNob_ASAi_dns.c @@ -34,7 +34,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* def. of SUNRpowerI */ /* Accessor macros */ @@ -61,21 +61,21 @@ #define STEPS 150 typedef struct { - realtype k1, k2, k3, k4; - realtype K, klA, Ks, pCO2, H; + sunrealtype k1, k2, k3, k4; + sunrealtype K, klA, Ks, pCO2, H; } *UserData; -static int res(realtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata); +static int res(sunrealtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata); -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB); +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB); static int check_retval(void *returnvalue, const char *funcname, int opt); /* Main program */ @@ -86,7 +86,7 @@ int main() N_Vector yy, yp, rr, q; N_Vector yB, ypB; int ncheck, retval; - realtype time; + sunrealtype time; long int nst, nstB; int indexB; SUNMatrix A, AB; @@ -94,11 +94,11 @@ int main() SUNContext ctx; /* Consistent IC for y, y'. */ - const realtype y01 = RCONST(0.444); - const realtype y02 = RCONST(0.00123); - const realtype y03 = RCONST(0.0); - const realtype y04 = RCONST(0.007); - const realtype y05 = RCONST(0.0); + const sunrealtype y01 = RCONST(0.444); + const sunrealtype y02 = RCONST(0.00123); + const sunrealtype y03 = RCONST(0.0); + const sunrealtype y04 = RCONST(0.007); + const sunrealtype y05 = RCONST(0.0); mem = NULL; yy = yp = NULL; @@ -287,16 +287,16 @@ int main() } -static int res(realtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata) +static int res(sunrealtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata) { UserData data; - realtype k1, k2, k3, k4; - realtype K, klA, Ks, pCO2, H; + sunrealtype k1, k2, k3, k4; + sunrealtype K, klA, Ks, pCO2, H; - realtype y1, y2, y3, y4, y5, y6; - realtype yd1, yd2, yd3, yd4, yd5; + sunrealtype y1, y2, y3, y4, y5, y6; + sunrealtype yd1, yd2, yd3, yd4, yd5; - realtype r1, r2, r3, r4, r5, Fin; + sunrealtype r1, r2, r3, r4, r5, Fin; data = (UserData) userdata; k1 = data->k1; @@ -343,7 +343,7 @@ static int res(realtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *user * rhsQ routine. Computes quadrature(t,y). */ -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(yy,1); @@ -357,22 +357,22 @@ static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_ /* * resB routine. Residual for adjoint system. */ -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB) { UserData data; - realtype y1, y2, y3, y4, y5, y6; + sunrealtype y1, y2, y3, y4, y5, y6; - realtype yB1, yB2, yB3, yB4, yB5, yB6; - realtype ypB1, ypB2, ypB3, ypB4, ypB5; + sunrealtype yB1, yB2, yB3, yB4, yB5, yB6; + sunrealtype ypB1, ypB2, ypB3, ypB4, ypB5; - realtype k1, k2, k3, k4; - realtype K, klA, Ks; + sunrealtype k1, k2, k3, k4; + sunrealtype K, klA, Ks; - realtype y2tohalf, y1to3, k2overK, tmp1, tmp2; + sunrealtype y2tohalf, y1to3, k2overK, tmp1, tmp2; data = (UserData) user_dataB; k1 = data->k1; @@ -434,7 +434,7 @@ static int resB(realtype tt, /* * Print results after backward integration */ -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB) +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB) { #if defined(SUNDIALS_EXTENDED_PRECISION) printf("dG/dy0: \t%12.4Le\n\t\t%12.4Le\n\t\t%12.4Le\n\t\t%12.4Le\n\t\t%12.4Le\n", diff --git a/examples/idas/serial/idasAkzoNob_dns.c b/examples/idas/serial/idasAkzoNob_dns.c index dab4a05f36..7f4496cca8 100644 --- a/examples/idas/serial/idasAkzoNob_dns.c +++ b/examples/idas/serial/idasAkzoNob_dns.c @@ -28,7 +28,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -54,17 +54,17 @@ typedef struct { - realtype k1, k2, k3, k4; - realtype K, klA, Ks, pCO2, H; + sunrealtype k1, k2, k3, k4; + sunrealtype K, klA, Ks, pCO2, H; } *UserData; -static int res(realtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata); +static int res(sunrealtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); -static void PrintHeader(realtype rtol, realtype avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, sunrealtype avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static int PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -75,18 +75,18 @@ int main() void *mem; N_Vector yy, yp, rr, q; int retval; - realtype time, tout, incr; + sunrealtype time, tout, incr; int nout; SUNMatrix A; SUNLinearSolver LS; SUNContext ctx; /* Consistent IC for y, y'. */ - const realtype y01 = RCONST(0.444); - const realtype y02 = RCONST(0.00123); - const realtype y03 = RCONST(0.0); - const realtype y04 = RCONST(0.007); - const realtype y05 = RCONST(0.0); + const sunrealtype y01 = RCONST(0.444); + const sunrealtype y02 = RCONST(0.00123); + const sunrealtype y03 = RCONST(0.0); + const sunrealtype y04 = RCONST(0.007); + const sunrealtype y05 = RCONST(0.0); mem = NULL; yy = yp = NULL; @@ -225,16 +225,16 @@ int main() } -static int res(realtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata) +static int res(sunrealtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *userdata) { UserData data; - realtype k1, k2, k3, k4; - realtype K, klA, Ks, pCO2, H; + sunrealtype k1, k2, k3, k4; + sunrealtype K, klA, Ks, pCO2, H; - realtype y1, y2, y3, y4, y5, y6; - realtype yd1, yd2, yd3, yd4, yd5; + sunrealtype y1, y2, y3, y4, y5, y6; + sunrealtype yd1, yd2, yd3, yd4, yd5; - realtype r1, r2, r3, r4, r5, Fin; + sunrealtype r1, r2, r3, r4, r5, Fin; data = (UserData) userdata; k1 = data->k1; @@ -281,14 +281,14 @@ static int res(realtype t, N_Vector yy, N_Vector yd, N_Vector resval, void *user * rhsQ routine. Computes quadrature(t,y). */ -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(yy,1); return(0); } -static void PrintHeader(realtype rtol, realtype avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, sunrealtype avtol, N_Vector y) { printf("\nidasAkzoNob_dns: Akzo Nobel chemical kinetics DAE serial example problem for IDAS\n"); printf("Linear solver: DENSE, Jacobian is computed by IDAS.\n"); @@ -309,12 +309,12 @@ static void PrintHeader(realtype rtol, realtype avtol, N_Vector y) } -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); diff --git a/examples/idas/serial/idasAnalytic_mels.c b/examples/idas/serial/idasAnalytic_mels.c index fcf37a23f5..b636bf57c1 100644 --- a/examples/idas/serial/idasAnalytic_mels.c +++ b/examples/idas/serial/idasAnalytic_mels.c @@ -31,7 +31,7 @@ #include #include /* prototypes for IDAS fcts., consts. */ #include /* access to serial N_Vector */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -45,21 +45,21 @@ #endif /* User-supplied functions called by IDA */ -int fres(realtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); +int fres(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); /* Custom linear solver data structure, accessor macros, and routines */ static SUNLinearSolver MatrixEmbeddedLS(void *ida_mem, SUNContext ctx); static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S); static int MatrixEmbeddedLSSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol); + N_Vector b, sunrealtype tol); static int MatrixEmbeddedLSFree(SUNLinearSolver S); /* Private function to check function return values */ static int check_retval(void *returnvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static void analytical_solution(realtype t, N_Vector y, N_Vector yp); -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static void analytical_solution(sunrealtype t, N_Vector y, N_Vector yp); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Main Program */ int main(void) @@ -68,13 +68,13 @@ int main(void) SUNContext ctx; /* general problem parameters */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ - realtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ + sunrealtype dTout = RCONST(0.1); /* time between outputs */ sunindextype NEQ = 2; /* number of dependent vars. */ - realtype reltol = RCONST(1.0e-4); /* tolerances */ - realtype abstol = RCONST(1.0e-9); - realtype alpha = RCONST(10.0); /* stiffness parameter */ + sunrealtype reltol = RCONST(1.0e-4); /* tolerances */ + sunrealtype abstol = RCONST(1.0e-9); + sunrealtype alpha = RCONST(10.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -82,7 +82,7 @@ int main(void) N_Vector yp = NULL; /* empty vector for storing solution derivative */ SUNLinearSolver LS = NULL; /* empty linear solver object */ void *ida_mem = NULL; /* empty IDA memory structure */ - realtype t, tout; + sunrealtype t, tout; long int nst, nre, nni, netf, ncfn, nreLS; /* Initial diagnostics output */ @@ -186,15 +186,15 @@ int main(void) 0 = (1-alpha)/(t-2)*x1 - x1 + (alpha-1)*x2 + 2*exp(t) - x1'(t) 0 = (t+2)*x1 - (t+2)*exp(t) */ -int fres(realtype t, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int fres(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype alpha = rdata[0]; /* set shortcut for stiffness parameter */ - realtype x1 = NV_Ith_S(yy,0); /* access current solution values */ - realtype x2 = NV_Ith_S(yy,1); - realtype x1p = NV_Ith_S(yp,0); /* access current derivative values */ - realtype ONE = RCONST(1.0); - realtype TWO = RCONST(2.0); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype alpha = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype x1 = NV_Ith_S(yy,0); /* access current solution values */ + sunrealtype x2 = NV_Ith_S(yy,1); + sunrealtype x1p = NV_Ith_S(yp,0); /* access current derivative values */ + sunrealtype ONE = RCONST(1.0); + sunrealtype TWO = RCONST(2.0); NV_Ith_S(rr,0) = (ONE-alpha)/(t-TWO)*x1 - x1 + (alpha-ONE)*x2 + TWO*exp(t) - x1p; NV_Ith_S(rr,1) = (t+TWO)*x1 - (t+TWO)*SUNRexp(t); @@ -233,18 +233,18 @@ static SUNLinearSolver_Type MatrixEmbeddedLSType(SUNLinearSolver S) /* linear solve routine */ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { /* temporary variables */ int retval; N_Vector yypred, yppred, yyn, ypn, res; - realtype tcur, cj; + sunrealtype tcur, cj; void *user_data; - realtype *rdata; - realtype alpha; - realtype a11, a12, a21, b1, b2; - realtype ONE = RCONST(1.0); - realtype TWO = RCONST(2.0); + sunrealtype *rdata; + sunrealtype alpha; + sunrealtype a11, a12, a21, b1, b2; + sunrealtype ONE = RCONST(1.0); + sunrealtype TWO = RCONST(2.0); /* retrieve implicit system data from IDA */ retval = IDAGetNonlinearSystemData(LS->content, &tcur, &yypred, &yppred, @@ -253,7 +253,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, return(-1); /* extract stiffness parameter from user_data */ - rdata = (realtype *) user_data; + rdata = (sunrealtype *) user_data; alpha = rdata[0]; /* perform linear solve: A*x=b @@ -325,7 +325,7 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) } /* routine to fill analytical solution and its derivative */ -static void analytical_solution(realtype t, N_Vector y, N_Vector yp) +static void analytical_solution(sunrealtype t, N_Vector y, N_Vector yp) { NV_Ith_S(y,0) = SUNRexp(t); NV_Ith_S(y,1) = SUNRexp(t)/(t-RCONST(2.0)); @@ -334,14 +334,14 @@ static void analytical_solution(realtype t, N_Vector y, N_Vector yp) } /* check the computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) retval */ N_Vector ytrue; /* true solution vector */ N_Vector ewt; /* error weight vector */ N_Vector abstol; /* absolute tolerance vector */ - realtype err; /* wrms error */ - realtype ONE = RCONST(1.0); + sunrealtype err; /* wrms error */ + sunrealtype ONE = RCONST(1.0); /* create solution and error weight vectors */ ytrue = N_VClone(y); diff --git a/examples/idas/serial/idasFoodWeb_bnd.c b/examples/idas/serial/idasFoodWeb_bnd.c index 2b8b239132..1ac87f180c 100644 --- a/examples/idas/serial/idasFoodWeb_bnd.c +++ b/examples/idas/serial/idasFoodWeb_bnd.c @@ -96,7 +96,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants. */ @@ -142,14 +142,14 @@ typedef struct { sunindextype Neq, ns, np, mx, my; - realtype dx, dy, **acoef; - realtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; + sunrealtype dx, dy, **acoef; + sunrealtype cox[NUM_SPECIES], coy[NUM_SPECIES], bcoef[NUM_SPECIES]; N_Vector rates; } *UserData; /* Prototypes for functions called by the IDA Solver. */ -static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, +static int resweb(sunrealtype time, N_Vector cc, N_Vector cp, N_Vector resval, void *user_data); /* Prototypes for private Helper Functions. */ @@ -157,13 +157,13 @@ static int resweb(realtype time, N_Vector cc, N_Vector cp, N_Vector resval, static void InitUserData(UserData webdata); static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata); -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol); -static void PrintOutput(void *mem, N_Vector c, realtype t); +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, N_Vector c, sunrealtype t); static void PrintFinalStats(void *mem); -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata); +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata); -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -179,7 +179,7 @@ int main() N_Vector cc, cp, id; int iout, retval; sunindextype mu, ml; - realtype rtol, atol, t0, tout, tret; + sunrealtype rtol, atol, t0, tout, tret; SUNMatrix A; SUNLinearSolver LS; SUNContext ctx; @@ -319,11 +319,11 @@ int main() * using cp in the case of prey species. */ -static int resweb(realtype tt, N_Vector cc, N_Vector cp, +static int resweb(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector res, void *user_data) { sunindextype jx, jy, is, yloc, loc, np; - realtype *resv, *cpv; + sunrealtype *resv, *cpv; UserData webdata; webdata = (UserData)user_data; @@ -368,7 +368,7 @@ static int resweb(realtype tt, N_Vector cc, N_Vector cp, static void InitUserData(UserData webdata) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; webdata->mx = MX; webdata->my = MY; @@ -419,8 +419,8 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, UserData webdata) { sunindextype loc, yloc, is, jx, jy, np; - realtype xx, yy, xyfactor; - realtype *ccv, *cpv, *idv; + sunrealtype xx, yy, xyfactor; + sunrealtype *ccv, *cpv, *idv; ccv = N_VGetArrayPointer(cc); cpv = N_VGetArrayPointer(cp); @@ -439,7 +439,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (realtype)(is+1) * xyfactor; + ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { @@ -469,7 +469,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, * Print first lines of output (problem description) */ -static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtype atol) +static void PrintHeader(sunindextype mu, sunindextype ml, sunrealtype rtol, sunrealtype atol) { printf("\nidasFoodWeb_bnd: Predator-prey DAE serial example problem for IDA \n\n"); printf("Number of species ns: %d", NUM_SPECIES); @@ -497,11 +497,11 @@ static void PrintHeader(sunindextype mu, sunindextype ml, realtype rtol, realtyp * are printed for the bottom left and top right grid points only. */ -static void PrintOutput(void *mem, N_Vector c, realtype t) +static void PrintOutput(void *mem, N_Vector c, sunrealtype t) { int i, kused, retval; long int nst; - realtype *c_bl, *c_tr, hused; + sunrealtype *c_bl, *c_tr, hused; retval = IDAGetLastOrder(mem, &kused); check_retval(&retval, "IDAGetLastOrder", 1); @@ -578,11 +578,11 @@ static void PrintFinalStats(void *mem) * The interaction term is computed by the function WebRates. */ -static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, +static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, UserData webdata) { sunindextype jx, jy, is, idyu, idyl, idxu, idxl; - realtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; + sunrealtype xx, yy, *cxy, *ratesxy, *cratexy, dcyli, dcyui, dcxli, dcxui; /* Loop over grid points, evaluate interaction vector (length ns), form diffusion difference terms, and load crate. */ @@ -629,11 +629,11 @@ static void Fweb(realtype tcalc, N_Vector cc, N_Vector crate, * At a given (x,y), evaluate the array of ns reaction terms R. */ -static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, UserData webdata) { int is; - realtype fac; + sunrealtype fac; for (is = 0; is < NUM_SPECIES; is++) ratesxy[is] = dotprod(NUM_SPECIES, cxy, acoef[is]); @@ -646,13 +646,13 @@ static void WebRates(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * dotprod: dot product routine for realtype arrays, for use by WebRates. + * dotprod: dot product routine for sunrealtype arrays, for use by WebRates. */ -static realtype dotprod(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype dotprod(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); diff --git a/examples/idas/serial/idasHeat2D_bnd.c b/examples/idas/serial/idasHeat2D_bnd.c index a906902016..b2f59a9041 100644 --- a/examples/idas/serial/idasHeat2D_bnd.c +++ b/examples/idas/serial/idasHeat2D_bnd.c @@ -44,7 +44,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -60,18 +60,18 @@ typedef struct { sunindextype mm; - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; } *UserData; /* Prototypes of functions called by IDA */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector u); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector u); static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res); @@ -91,7 +91,7 @@ int main(void) int retval, iout; long int netf, ncfn; sunindextype mu, ml; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; SUNMatrix A; SUNLinearSolver LS; SUNContext ctx; @@ -228,11 +228,11 @@ int main(void) * while for each boundary point, it is res_i = u_i. */ -int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, +int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data) { sunindextype mm, i, j, offset, loc; - realtype *uv, *upv, *resv, coeff; + sunrealtype *uv, *upv, *resv, coeff; UserData data; uv = N_VGetArrayPointer(uu); upv = N_VGetArrayPointer(up); resv = N_VGetArrayPointer(resval); @@ -271,7 +271,7 @@ int heatres(realtype tres, N_Vector uu, N_Vector up, N_Vector resval, static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector id, N_Vector res) { - realtype xfact, yfact, *udata, *updata, *iddata; + sunrealtype xfact, yfact, *udata, *updata, *iddata; sunindextype mm, mm1, i, j, offset, loc; mm = data->mm; @@ -322,7 +322,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidasHeat2D_bnd: Heat equation, serial example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -357,10 +357,10 @@ static void PrintHeader(realtype rtol, realtype atol) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { int retval; - realtype umax, hused; + sunrealtype umax, hused; long int nst, nni, nje, nre, nreLS; int kused; diff --git a/examples/idas/serial/idasHeat2D_kry.c b/examples/idas/serial/idasHeat2D_kry.c index 3a87184365..909daecbda 100644 --- a/examples/idas/serial/idasHeat2D_kry.c +++ b/examples/idas/serial/idasHeat2D_kry.c @@ -43,7 +43,7 @@ #include /* prototypes for IDA fcts., consts. */ #include /* access to serial N_Vector */ #include /* access to spgmr SUNLinearSolver */ -#include /* definition of type realtype */ +#include /* definition of type sunrealtype */ /* Problem Constants */ @@ -59,31 +59,31 @@ typedef struct { sunindextype mm; /* number of grid points */ - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; N_Vector pp; /* vector of prec. diag. elements */ } *UserData; /* Prototypes for functions called by IDA */ -int resHeat(realtype tres, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data); + sunrealtype c_j, void *prec_data); -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data); + sunrealtype c_j, sunrealtype delta, void *prec_data); /* Prototypes for private functions */ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res); -static void PrintHeader(realtype rtol, realtype atol); -static void PrintOutput(void *mem, realtype t, N_Vector uu); +static void PrintHeader(sunrealtype rtol, sunrealtype atol); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -98,7 +98,7 @@ int main() UserData data; N_Vector uu, up, constraints, res; int retval, iout; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; long int netf, ncfn, ncfl; SUNLinearSolver LS; SUNContext ctx; @@ -307,12 +307,12 @@ int main() * while for each boundary point, it is res_i = u_i. */ -int resHeat(realtype tt, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { sunindextype i, j, offset, loc, mm; - realtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; + sunrealtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; UserData data; uu_data = N_VGetArrayPointer(uu); @@ -358,13 +358,13 @@ int resHeat(realtype tt, * pp etc.) are used from the PsetupdHeat argument list. */ -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *prec_data) + sunrealtype c_j, void *prec_data) { sunindextype i, j, offset, loc, mm; - realtype *ppv, pelinv; + sunrealtype *ppv, pelinv; UserData data; data = (UserData) prec_data; @@ -396,10 +396,10 @@ int PsetupHeat(realtype tt, * computed in PrecondHeateq), returning the result in zvec. */ -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data) + sunrealtype c_j, sunrealtype delta, void *prec_data) { UserData data; data = (UserData) prec_data; @@ -421,7 +421,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res) { sunindextype mm, mm1, i, j, offset, loc; - realtype xfact, yfact, *udata, *updata; + sunrealtype xfact, yfact, *udata, *updata; mm = data->mm; @@ -465,7 +465,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol) +static void PrintHeader(sunrealtype rtol, sunrealtype atol) { printf("\nidasHeat2D_kry: Heat equation, serial example problem for IDA \n"); printf(" Discretized heat equation on 2D unit square. \n"); @@ -488,9 +488,9 @@ static void PrintHeader(realtype rtol, realtype atol) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(void *mem, realtype t, N_Vector uu) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/idas/serial/idasHessian_ASA_FSA.c b/examples/idas/serial/idasHessian_ASA_FSA.c index 6e4f6500be..2d02b7227f 100644 --- a/examples/idas/serial/idasHessian_ASA_FSA.c +++ b/examples/idas/serial/idasHessian_ASA_FSA.c @@ -47,7 +47,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -80,37 +80,37 @@ /* User defined struct */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* residual for forward problem */ -static int res(realtype t, N_Vector yy, N_Vector yp, +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); -static int rhsQS(int Ns, realtype t, N_Vector yy, N_Vector yp, +static int rhsQS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *rhsvalQS, void *user_data, N_Vector yytmp, N_Vector yptmp, N_Vector tmpQS); -static int resBS1(realtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, +static int resBS1(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector resvalBQ, void *user_dataB); -static int rhsQBS1(realtype tt, N_Vector yy, N_Vector yp, +static int rhsQBS1(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rhsBQS, void *user_dataB); -static int resBS2(realtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, +static int resBS2(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector resvalBQ, void *user_dataB); -static int rhsQBS2(realtype tt, N_Vector yy, N_Vector yp, +static int rhsQBS2(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rhsBQS, void *user_dataB); @@ -123,10 +123,10 @@ int main(int argc, char *argv[]) N_Vector yyB1, ypB1, qB1, yyB2, ypB2, qB2; void *ida_mem; UserData data; - realtype time, ti, tf; + sunrealtype time, ti, tf; int retval, nckp, indexB1, indexB2, is; - realtype G, Gm, Gp, dp1, dp2, grdG_fwd[2], grdG_bck[2], grdG_cntr[2], H11, H22; - realtype rtolFD, atolFD; + sunrealtype G, Gm, Gp, dp1, dp2, grdG_fwd[2], grdG_bck[2], grdG_cntr[2], H11, H22; + sunrealtype rtolFD, atolFD; SUNMatrix A, AB1, AB2; SUNLinearSolver LS, LSB1, LSB2; @@ -526,11 +526,11 @@ int main(int argc, char *argv[]) -static int res(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +static int res(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype y1, y2, y3, yp1, yp2, *rval; + sunrealtype y1, y2, y3, yp1, yp2, *rval; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); yp1 = Ith(yp,1); yp2 = Ith(yp,2); @@ -547,18 +547,18 @@ static int res(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_ return(0); } -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2; - realtype rs1, rs2, rs3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2; + sunrealtype rs1, rs2, rs3; int is; data = (UserData) user_data; @@ -603,10 +603,10 @@ static int resS(int Ns, realtype t, return(0); } -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { - realtype y1, y2, y3; + sunrealtype y1, y2, y3; y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); Ith(qdot,1) = HALF*(y1*y1+y2*y2+y3*y3); @@ -614,7 +614,7 @@ static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_ return(0); } -static int rhsQS(int Ns, realtype t, +static int rhsQS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *rhsvalQS, @@ -622,8 +622,8 @@ static int rhsQS(int Ns, realtype t, N_Vector yytmp, N_Vector yptmp, N_Vector tmpQS) { - realtype y1, y2, y3; - realtype s1, s2, s3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; y1 = Ith(yy,1); y2 = Ith(yy,2); @@ -645,7 +645,7 @@ static int rhsQS(int Ns, realtype t, } /* Residuals for adjoint model. */ -static int resBS1(realtype tt, +static int resBS1(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, @@ -653,12 +653,12 @@ static int resBS1(realtype tt, { UserData data; - realtype y1, y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3, m1, m2, m3; - realtype lp1, lp2, mp1, mp2; - realtype s1, s2, s3; - realtype l21; + sunrealtype y1, y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3, m1, m2, m3; + sunrealtype lp1, lp2, mp1, mp2; + sunrealtype s1, s2, s3; + sunrealtype l21; data = (UserData) user_dataB; @@ -695,16 +695,16 @@ static int resBS1(realtype tt, return(0); } -static int rhsQBS1(realtype tt, +static int rhsQBS1(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rhsBQS, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2, m1, m2; - realtype s1, s2, s3; - realtype l21; + sunrealtype y1, y2, y3; + sunrealtype l1, l2, m1, m2; + sunrealtype s1, s2, s3; + sunrealtype l21; /* The y vector */ y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); @@ -730,7 +730,7 @@ static int rhsQBS1(realtype tt, return(0); } -static int resBS2(realtype tt, +static int resBS2(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, @@ -738,12 +738,12 @@ static int resBS2(realtype tt, { UserData data; - realtype y1, y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3, m1, m2, m3; - realtype lp1, lp2, mp1, mp2; - realtype s1, s2, s3; - realtype l21; + sunrealtype y1, y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3, m1, m2, m3; + sunrealtype lp1, lp2, mp1, mp2; + sunrealtype s1, s2, s3; + sunrealtype l21; data = (UserData) user_dataB; @@ -781,16 +781,16 @@ static int resBS2(realtype tt, return(0); } -static int rhsQBS2(realtype tt, +static int rhsQBS2(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rhsBQS, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2, m1, m2; - realtype s1, s2, s3; - realtype l21; + sunrealtype y1, y2, y3; + sunrealtype l1, l2, m1, m2; + sunrealtype s1, s2, s3; + sunrealtype l21; /* The y vector */ y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); diff --git a/examples/idas/serial/idasKrylovDemo_ls.c b/examples/idas/serial/idasKrylovDemo_ls.c index 35d416c769..f4520f5089 100644 --- a/examples/idas/serial/idasKrylovDemo_ls.c +++ b/examples/idas/serial/idasKrylovDemo_ls.c @@ -48,7 +48,7 @@ #include /* access to SPBCGS SUNLinearSolver */ #include /* access to SPTFQMR SUNLinearSolver */ #include /* serial N_Vector types, fct. and macros */ -#include /* definition of realtype */ +#include /* definition of sunrealtype */ /* helpful macros */ @@ -82,31 +82,31 @@ typedef struct { sunindextype mm; /* number of grid points */ - realtype dx; - realtype coeff; + sunrealtype dx; + sunrealtype coeff; N_Vector pp; /* vector of prec. diag. elements */ } *UserData; /* Prototypes for functions called by IDA */ -int resHeat(realtype tres, N_Vector uu, N_Vector up, +int resHeat(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, void *user_data); -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *user_data); + sunrealtype c_j, void *user_data); -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data); + sunrealtype c_j, sunrealtype delta, void *user_data); /* Prototypes for private functions */ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res); -static void PrintHeader(realtype rtol, realtype atol, int linsolver); -static void PrintOutput(void *mem, realtype t, N_Vector uu, int linsolver); +static void PrintHeader(sunrealtype rtol, sunrealtype atol, int linsolver); +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu, int linsolver); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -121,11 +121,11 @@ int main(int argc, char* argv[]) UserData data; N_Vector uu, up, constraints, res; int retval, iout, linsolver; - realtype rtol, atol, t0, t1, tout, tret; + sunrealtype rtol, atol, t0, t1, tout, tret; long int netf, ncfn, ncfl; SUNLinearSolver LS; int nrmfactor; /* LS norm conversion factor flag */ - realtype nrmfac; /* LS norm conversion factor */ + sunrealtype nrmfac; /* LS norm conversion factor */ SUNContext ctx; mem = NULL; @@ -290,7 +290,7 @@ int main(int argc, char* argv[]) case(1): /* use the square root of the vector length */ - nrmfac = SQRT((realtype)NEQ); + nrmfac = SQRT((sunrealtype)NEQ); break; case(2): /* compute with dot product */ @@ -373,12 +373,12 @@ int main(int argc, char* argv[]) * while for each boundary point, it is res_i = u_i. */ -int resHeat(realtype tt, +int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void *user_data) { sunindextype i, j, offset, loc, mm; - realtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; + sunrealtype *uu_data, *up_data, *rr_data, coeff, dif1, dif2; UserData data; uu_data = N_VGetArrayPointer(uu); @@ -424,13 +424,13 @@ int resHeat(realtype tt, * pp etc.) are used from the PsetupdHeat argument list. */ -int PsetupHeat(realtype tt, +int PsetupHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, - realtype c_j, void *user_data) + sunrealtype c_j, void *user_data) { sunindextype i, j, offset, loc, mm; - realtype *ppv, pelinv; + sunrealtype *ppv, pelinv; UserData data; data = (UserData) user_data; @@ -462,10 +462,10 @@ int PsetupHeat(realtype tt, * computed in PrecondHeateq), returning the result in zvec. */ -int PsolveHeat(realtype tt, +int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *user_data) + sunrealtype c_j, sunrealtype delta, void *user_data) { UserData data; data = (UserData) user_data; @@ -487,7 +487,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, N_Vector res) { sunindextype mm, mm1, i, j, offset, loc; - realtype xfact, yfact, *udata, *updata; + sunrealtype xfact, yfact, *udata, *updata; mm = data->mm; @@ -531,7 +531,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, realtype atol, int linsolver) +static void PrintHeader(sunrealtype rtol, sunrealtype atol, int linsolver) { printf("\nidasKrylovDemo_ls: Heat equation, serial example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -568,9 +568,9 @@ static void PrintHeader(realtype rtol, realtype atol, int linsolver) * PrintOutput: print max norm of solution and current solver statistics */ -static void PrintOutput(void *mem, realtype t, N_Vector uu, int linsolver) +static void PrintOutput(void *mem, sunrealtype t, N_Vector uu, int linsolver) { - realtype hused, umax; + sunrealtype hused, umax; long int nst, nni, nje, nre, nreLS, nli, npe, nps; int kused, retval; diff --git a/examples/idas/serial/idasRoberts_ASAi_dns.c b/examples/idas/serial/idasRoberts_ASAi_dns.c index 8d864f22ca..8e8271c6a1 100644 --- a/examples/idas/serial/idasRoberts_ASAi_dns.c +++ b/examples/idas/serial/idasRoberts_ASAi_dns.c @@ -55,7 +55,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -95,40 +95,40 @@ /* Type : UserData */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* Prototypes of user-supplied functions */ -static int res(realtype t, N_Vector yy, N_Vector yp, +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); static int ewt(N_Vector y, N_Vector w, void *user_data); -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB); -static int JacB(realtype tt, realtype cjB, +static int JacB(sunrealtype tt, sunrealtype cjB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JB, void *user_data, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int rhsQB(realtype tt, +static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrQB, void *user_dataB); /* Prototypes of private functions */ -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) SUNMatrix A, AB; SUNLinearSolver LS, LSB; - realtype reltolQ, abstolQ; + sunrealtype reltolQ, abstolQ; N_Vector yy, yp, q; N_Vector yyTB1, ypTB1; N_Vector id; @@ -156,9 +156,9 @@ int main(int argc, char *argv[]) int indexB; - realtype reltolB, abstolB, abstolQB; + sunrealtype reltolB, abstolB, abstolQB; N_Vector yB, ypB, qB; - realtype time; + sunrealtype time; int retval, ncheck; IDAadjCheckPointRec *ckpnt; @@ -545,11 +545,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,y). */ -static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) { - realtype y1, y2, y3, yp1, yp2, *rval; + sunrealtype y1, y2, y3, yp1, yp2, *rval; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); yp1 = Ith(yp,1); yp2 = Ith(yp,2); @@ -570,14 +570,14 @@ static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y2, y3; + sunrealtype y2, y3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y2 = Ith(yy,2); y3 = Ith(yy,3); @@ -603,7 +603,7 @@ static int Jac(realtype t, realtype cj, * rhsQ routine. Compute fQ(t,y). */ -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(yy,3); return(0); @@ -616,7 +616,7 @@ static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_ static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -638,17 +638,17 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) * resB routine. */ -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3; - realtype lp1, lp2; - realtype l21; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3; + sunrealtype lp1, lp2; + sunrealtype l21; data = (UserData) user_dataB; @@ -676,15 +676,15 @@ static int resB(realtype tt, } /*Jacobian for backward problem. */ -static int JacB(realtype tt, realtype cj, +static int JacB(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JB, void *user_data, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { - realtype y2, y3; + sunrealtype y2, y3; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y2 = Ith(yy,2); y3 = Ith(yy,3); @@ -707,14 +707,14 @@ static int JacB(realtype tt, realtype cj, return(0); } -static int rhsQB(realtype tt, +static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrQB, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2; - realtype l21; + sunrealtype y1, y2, y3; + sunrealtype l1, l2; + sunrealtype l21; /* The y vector */ y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); @@ -743,7 +743,7 @@ static int rhsQB(realtype tt, * Print results after backward integration */ -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB) +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) diff --git a/examples/idas/serial/idasRoberts_ASAi_klu.c b/examples/idas/serial/idasRoberts_ASAi_klu.c index ffbe0f287d..e7aaebec19 100644 --- a/examples/idas/serial/idasRoberts_ASAi_klu.c +++ b/examples/idas/serial/idasRoberts_ASAi_klu.c @@ -56,7 +56,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -95,40 +95,40 @@ /* Type : UserData */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* Prototypes of user-supplied functions */ -static int res(realtype t, N_Vector yy, N_Vector yp, +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); static int ewt(N_Vector y, N_Vector w, void *user_data); -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB); -static int JacB(realtype tt, realtype cjB, +static int JacB(sunrealtype tt, sunrealtype cjB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JB, void *user_data, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int rhsQB(realtype tt, +static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrQB, void *user_dataB); /* Prototypes of private functions */ -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) SUNMatrix A, AB; SUNLinearSolver LS, LSB; - realtype reltolQ, abstolQ; + sunrealtype reltolQ, abstolQ; N_Vector yy, yp, q; N_Vector yyTB1, ypTB1; N_Vector id; @@ -156,9 +156,9 @@ int main(int argc, char *argv[]) int indexB; - realtype reltolB, abstolB, abstolQB; + sunrealtype reltolB, abstolB, abstolQB; N_Vector yB, ypB, qB; - realtype time; + sunrealtype time; int retval, nnz, ncheck; IDAadjCheckPointRec *ckpnt; @@ -530,11 +530,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,y). */ -static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) { - realtype y1, y2, y3,yp1, yp2, *rval; + sunrealtype y1, y2, y3,yp1, yp2, *rval; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); yp1 = Ith(yp,1); yp2 = Ith(yp,2); @@ -555,18 +555,18 @@ static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yval = N_VGetArrayPointer(yy); @@ -611,7 +611,7 @@ static int Jac(realtype t, realtype cj, * rhsQ routine. Compute fQ(t,y). */ -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(yy,3); return(0); @@ -624,7 +624,7 @@ static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_ static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -646,17 +646,17 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) * resB routine. */ -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3; - realtype lp1, lp2; - realtype l21; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3; + sunrealtype lp1, lp2; + sunrealtype l21; data = (UserData) user_dataB; @@ -684,19 +684,19 @@ static int resB(realtype tt, } /*Jacobian for backward problem. */ -static int JacB(realtype tt, realtype cjB, +static int JacB(sunrealtype tt, sunrealtype cjB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JB, void *user_data, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { - realtype *yvalB; + sunrealtype *yvalB; sunindextype *colptrsB = SUNSparseMatrix_IndexPointers(JB); sunindextype *rowvalsB = SUNSparseMatrix_IndexValues(JB); - realtype *dataB = SUNSparseMatrix_Data(JB); + sunrealtype *dataB = SUNSparseMatrix_Data(JB); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yvalB = N_VGetArrayPointer(yy); @@ -737,14 +737,14 @@ static int JacB(realtype tt, realtype cjB, return(0); } -static int rhsQB(realtype tt, +static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrQB, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2; - realtype l21; + sunrealtype y1, y2, y3; + sunrealtype l1, l2; + sunrealtype l21; /* The y vector */ y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); @@ -773,7 +773,7 @@ static int rhsQB(realtype tt, * Print results after backward integration */ -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB) +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) diff --git a/examples/idas/serial/idasRoberts_ASAi_sps.c b/examples/idas/serial/idasRoberts_ASAi_sps.c index e27e9c2bfe..43ea229333 100644 --- a/examples/idas/serial/idasRoberts_ASAi_sps.c +++ b/examples/idas/serial/idasRoberts_ASAi_sps.c @@ -56,7 +56,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLUMT linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -95,40 +95,40 @@ /* Type : UserData */ typedef struct { - realtype p[3]; + sunrealtype p[3]; } *UserData; /* Prototypes of user-supplied functions */ -static int res(realtype t, N_Vector yy, N_Vector yp, +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); static int ewt(N_Vector y, N_Vector w, void *user_data); -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB); -static int JacB(realtype tt, realtype cjB, +static int JacB(sunrealtype tt, sunrealtype cjB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JB, void *user_data, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int rhsQB(realtype tt, +static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrQB, void *user_dataB); /* Prototypes of private functions */ -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) SUNMatrix A, AB; SUNLinearSolver LS, LSB; - realtype reltolQ, abstolQ; + sunrealtype reltolQ, abstolQ; N_Vector yy, yp, q; N_Vector yyTB1, ypTB1; N_Vector id; @@ -156,9 +156,9 @@ int main(int argc, char *argv[]) int indexB; - realtype reltolB, abstolB, abstolQB; + sunrealtype reltolB, abstolB, abstolQB; N_Vector yB, ypB, qB; - realtype time; + sunrealtype time; int retval, nthreads, nnz, ncheck; IDAadjCheckPointRec *ckpnt; @@ -531,11 +531,11 @@ int main(int argc, char *argv[]) * f routine. Compute f(t,y). */ -static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) { - realtype y1, y2, y3,yp1, yp2, *rval; + sunrealtype y1, y2, y3,yp1, yp2, *rval; UserData data; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); yp1 = Ith(yp,1); yp2 = Ith(yp,2); @@ -556,18 +556,18 @@ static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yval = N_VGetArrayPointer(yy); @@ -612,7 +612,7 @@ static int Jac(realtype t, realtype cj, * rhsQ routine. Compute fQ(t,y). */ -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { Ith(qdot,1) = Ith(yy,3); return(0); @@ -625,7 +625,7 @@ static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_ static int ewt(N_Vector y, N_Vector w, void *user_data) { int i; - realtype yy, ww, rtol, atol[3]; + sunrealtype yy, ww, rtol, atol[3]; rtol = RTOL; atol[0] = ATOL1; @@ -647,17 +647,17 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) * resB routine. */ -static int resB(realtype tt, +static int resB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB) { UserData data; - realtype y2, y3; - realtype p1, p2, p3; - realtype l1, l2, l3; - realtype lp1, lp2; - realtype l21; + sunrealtype y2, y3; + sunrealtype p1, p2, p3; + sunrealtype l1, l2, l3; + sunrealtype lp1, lp2; + sunrealtype l21; data = (UserData) user_dataB; @@ -685,19 +685,19 @@ static int resB(realtype tt, } /*Jacobian for backward problem. */ -static int JacB(realtype tt, realtype cjB, +static int JacB(sunrealtype tt, sunrealtype cjB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JB, void *user_data, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { - realtype *yvalB; + sunrealtype *yvalB; sunindextype *colptrsB = SUNSparseMatrix_IndexPointers(JB); sunindextype *rowvalsB = SUNSparseMatrix_IndexValues(JB); - realtype *dataB = SUNSparseMatrix_Data(JB); + sunrealtype *dataB = SUNSparseMatrix_Data(JB); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yvalB = N_VGetArrayPointer(yy); @@ -738,14 +738,14 @@ static int JacB(realtype tt, realtype cjB, return(0); } -static int rhsQB(realtype tt, +static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrQB, void *user_dataB) { - realtype y1, y2, y3; - realtype l1, l2; - realtype l21; + sunrealtype y1, y2, y3; + sunrealtype l1, l2; + sunrealtype l21; /* The y vector */ y1 = Ith(yy,1); y2 = Ith(yy,2); y3 = Ith(yy,3); @@ -774,7 +774,7 @@ static int rhsQB(realtype tt, * Print results after backward integration */ -static void PrintOutput(realtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB) +static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB) { printf("--------------------------------------------------------\n"); #if defined(SUNDIALS_EXTENDED_PRECISION) diff --git a/examples/idas/serial/idasRoberts_FSA_dns.c b/examples/idas/serial/idasRoberts_FSA_dns.c index ab8965571f..f9820fc39f 100644 --- a/examples/idas/serial/idasRoberts_FSA_dns.c +++ b/examples/idas/serial/idasRoberts_FSA_dns.c @@ -51,7 +51,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -75,21 +75,21 @@ /* Type : UserData */ typedef struct { - realtype p[3]; /* problem parameters */ - realtype coef; + sunrealtype p[3]; /* problem parameters */ + sunrealtype coef; } *UserData; /* Prototypes of functions by IDAS */ -static int res(realtype t, N_Vector y, N_Vector yp, N_Vector resval, void *user_data); +static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector resval, void *user_data); -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector y, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int rhsQ(realtype tres, N_Vector yy, N_Vector yp, +static int rhsQ(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rrQ, void *user_data); /* Prototypes of private functions */ @@ -102,7 +102,7 @@ static void WrongArgs(char *name); static void PrintIC(N_Vector y, N_Vector yp); static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS); -static void PrintOutput(void *ida_mem, realtype t, N_Vector u); +static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u); static void PrintSensOutput(N_Vector *uS); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -119,13 +119,13 @@ int main(int argc, char *argv[]) SUNMatrix A; SUNLinearSolver LS; UserData data; - realtype reltol, t, tout; + sunrealtype reltol, t, tout; N_Vector y, yp, abstol, id; int iout, retval; FILE* FID; char fname[256]; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; N_Vector *yS, *ypS; booleantype sensi, err_con; @@ -399,12 +399,12 @@ int main(int argc, char *argv[]) /* * Residual routine. Compute F(t,y,y',p). */ -static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype yp1, yp2; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype yp1, yp2; data = (UserData) user_data; p1 = data->p[0]; @@ -430,18 +430,18 @@ static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user * resS routine. Compute sensitivity r.h.s. */ -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2; - realtype rs1, rs2, rs3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2; + sunrealtype rs1, rs2, rs3; int is; data = (UserData) user_data; @@ -489,7 +489,7 @@ static int resS(int Ns, realtype t, return(0); } -static int rhsQ(realtype t, N_Vector y, N_Vector yp, +static int rhsQ(sunrealtype t, N_Vector y, N_Vector yp, N_Vector ypQ, void* user_data) { UserData data; @@ -566,7 +566,7 @@ static void WrongArgs(char *name) static void PrintIC(N_Vector y, N_Vector yp) { - realtype* data; + sunrealtype* data; data = N_VGetArrayPointer(y); printf("\n\nConsistent IC:\n"); @@ -592,7 +592,7 @@ static void PrintIC(N_Vector y, N_Vector yp) } static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(yS[0]); printf(" Sensitivity 1 "); @@ -664,11 +664,11 @@ static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS) * Print current t, step count, order, stepsize, and solution. */ -static void PrintOutput(void *ida_mem, realtype t, N_Vector u) +static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; udata = N_VGetArrayPointer(u); @@ -705,7 +705,7 @@ static void PrintOutput(void *ida_mem, realtype t, N_Vector u) static void PrintSensOutput(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); printf(" Sensitivity 1 "); diff --git a/examples/idas/serial/idasRoberts_FSA_klu.c b/examples/idas/serial/idasRoberts_FSA_klu.c index 2df4d48e5b..a65bc4c181 100644 --- a/examples/idas/serial/idasRoberts_FSA_klu.c +++ b/examples/idas/serial/idasRoberts_FSA_klu.c @@ -54,7 +54,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -78,26 +78,26 @@ /* Type : UserData */ typedef struct { - realtype p[3]; /* problem parameters */ - realtype coef; + sunrealtype p[3]; /* problem parameters */ + sunrealtype coef; } *UserData; /* Prototypes of functions by IDAS */ -static int res(realtype t, N_Vector y, N_Vector yp, N_Vector resval, void *user_data); +static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector resval, void *user_data); -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector y, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int rhsQ(realtype tres, N_Vector yy, N_Vector yp, +static int rhsQ(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rrQ, void *user_data); /* Prototypes of private functions */ @@ -110,7 +110,7 @@ static void WrongArgs(char *name); static void PrintIC(N_Vector y, N_Vector yp); static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS); -static void PrintOutput(void *ida_mem, realtype t, N_Vector u); +static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u); static void PrintSensOutput(N_Vector *uS); static void PrintFinalStats(void *ida_mem, booleantype sensi); @@ -129,11 +129,11 @@ int main(int argc, char *argv[]) SUNMatrix A; SUNLinearSolver LS; UserData data; - realtype reltol, t, tout; + sunrealtype reltol, t, tout; N_Vector y, yp, abstol, id; int iout, retval, nnz; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; N_Vector *yS, *ypS; booleantype sensi, err_con; @@ -390,12 +390,12 @@ int main(int argc, char *argv[]) /* * Residual routine. Compute F(t,y,y',p). */ -static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype yp1, yp2; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype yp1, yp2; data = (UserData) user_data; p1 = data->p[0]; @@ -421,18 +421,18 @@ static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yval = N_VGetArrayPointer(yy); @@ -474,18 +474,18 @@ static int Jac(realtype t, realtype cj, * resS routine. Compute sensitivity r.h.s. */ -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2; - realtype rs1, rs2, rs3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2; + sunrealtype rs1, rs2, rs3; int is; data = (UserData) user_data; @@ -533,7 +533,7 @@ static int resS(int Ns, realtype t, return(0); } -static int rhsQ(realtype t, N_Vector y, N_Vector yp, +static int rhsQ(sunrealtype t, N_Vector y, N_Vector yp, N_Vector ypQ, void* user_data) { UserData data; @@ -610,7 +610,7 @@ static void WrongArgs(char *name) static void PrintIC(N_Vector y, N_Vector yp) { - realtype* data; + sunrealtype* data; data = N_VGetArrayPointer(y); printf("\n\nConsistent IC:\n"); @@ -636,7 +636,7 @@ static void PrintIC(N_Vector y, N_Vector yp) } static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(yS[0]); printf(" Sensitivity 1 "); @@ -708,11 +708,11 @@ static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS) * Print current t, step count, order, stepsize, and solution. */ -static void PrintOutput(void *ida_mem, realtype t, N_Vector u) +static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; udata = N_VGetArrayPointer(u); @@ -749,7 +749,7 @@ static void PrintOutput(void *ida_mem, realtype t, N_Vector u) static void PrintSensOutput(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); printf(" Sensitivity 1 "); diff --git a/examples/idas/serial/idasRoberts_FSA_sps.c b/examples/idas/serial/idasRoberts_FSA_sps.c index 108d997d5b..02b9ac327d 100644 --- a/examples/idas/serial/idasRoberts_FSA_sps.c +++ b/examples/idas/serial/idasRoberts_FSA_sps.c @@ -54,7 +54,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLUMT linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Accessor macros */ @@ -78,26 +78,26 @@ /* Type : UserData */ typedef struct { - realtype p[3]; /* problem parameters */ - realtype coef; + sunrealtype p[3]; /* problem parameters */ + sunrealtype coef; } *UserData; /* Prototypes of functions by IDAS */ -static int res(realtype t, N_Vector y, N_Vector yp, N_Vector resval, void *user_data); +static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector resval, void *user_data); -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector y, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int rhsQ(realtype tres, N_Vector yy, N_Vector yp, +static int rhsQ(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rrQ, void *user_data); /* Prototypes of private functions */ @@ -110,7 +110,7 @@ static void WrongArgs(char *name); static void PrintIC(N_Vector y, N_Vector yp); static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS); -static void PrintOutput(void *ida_mem, realtype t, N_Vector u); +static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u); static void PrintSensOutput(N_Vector *uS); static void PrintFinalStats(void *ida_mem, booleantype sensi); @@ -129,11 +129,11 @@ int main(int argc, char *argv[]) SUNMatrix A; SUNLinearSolver LS; UserData data; - realtype reltol, t, tout; + sunrealtype reltol, t, tout; N_Vector y, yp, abstol, id; int iout, retval, nthreads, nnz; - realtype pbar[NS]; + sunrealtype pbar[NS]; int is; N_Vector *yS, *ypS; booleantype sensi, err_con; @@ -391,12 +391,12 @@ int main(int argc, char *argv[]) /* * Residual routine. Compute F(t,y,y',p). */ -static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) +static int res(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype yp1, yp2; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype yp1, yp2; data = (UserData) user_data; p1 = data->p[0]; @@ -422,18 +422,18 @@ static int res(realtype t, N_Vector yy, N_Vector yp, N_Vector resval, void *user * Jacobian routine. Compute J(t,y). */ -static int Jac(realtype t, realtype cj, +static int Jac(sunrealtype t, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); UserData userdata; - realtype p1, p2, p3; + sunrealtype p1, p2, p3; yval = N_VGetArrayPointer(yy); @@ -475,18 +475,18 @@ static int Jac(realtype t, realtype cj, * resS routine. Compute sensitivity r.h.s. */ -static int resS(int Ns, realtype t, +static int resS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { UserData data; - realtype p1, p2, p3; - realtype y1, y2, y3; - realtype s1, s2, s3; - realtype sd1, sd2; - realtype rs1, rs2, rs3; + sunrealtype p1, p2, p3; + sunrealtype y1, y2, y3; + sunrealtype s1, s2, s3; + sunrealtype sd1, sd2; + sunrealtype rs1, rs2, rs3; int is; data = (UserData) user_data; @@ -534,7 +534,7 @@ static int resS(int Ns, realtype t, return(0); } -static int rhsQ(realtype t, N_Vector y, N_Vector yp, +static int rhsQ(sunrealtype t, N_Vector y, N_Vector yp, N_Vector ypQ, void* user_data) { UserData data; @@ -611,7 +611,7 @@ static void WrongArgs(char *name) static void PrintIC(N_Vector y, N_Vector yp) { - realtype* data; + sunrealtype* data; data = N_VGetArrayPointer(y); printf("\n\nConsistent IC:\n"); @@ -637,7 +637,7 @@ static void PrintIC(N_Vector y, N_Vector yp) } static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(yS[0]); printf(" Sensitivity 1 "); @@ -709,11 +709,11 @@ static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS) * Print current t, step count, order, stepsize, and solution. */ -static void PrintOutput(void *ida_mem, realtype t, N_Vector u) +static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u) { long int nst; int qu, retval; - realtype hu, *udata; + sunrealtype hu, *udata; udata = N_VGetArrayPointer(u); @@ -750,7 +750,7 @@ static void PrintOutput(void *ida_mem, realtype t, N_Vector u) static void PrintSensOutput(N_Vector *uS) { - realtype *sdata; + sunrealtype *sdata; sdata = N_VGetArrayPointer(uS[0]); printf(" Sensitivity 1 "); diff --git a/examples/idas/serial/idasRoberts_dns.c b/examples/idas/serial/idasRoberts_dns.c index 8abb0ab833..dff54ccb05 100644 --- a/examples/idas/serial/idasRoberts_dns.c +++ b/examples/idas/serial/idasRoberts_dns.c @@ -40,7 +40,7 @@ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ #include /* access to Newton SUNNonlinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -67,23 +67,23 @@ /* Prototypes of functions called by IDA */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int grob(realtype t, N_Vector yy, N_Vector yp, - realtype *gout, void *user_data); +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, + sunrealtype *gout, void *user_data); -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static void PrintRootInfo(int root_f1, int root_f2); static int check_retval(void *returnvalue, const char *funcname, int opt); -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol); /* *-------------------------------------------------------------------- @@ -95,8 +95,8 @@ int main(void) { void *mem; N_Vector yy, yp, avtol; - realtype rtol, *yval, *ypval, *atval; - realtype t0, tout1, tout, tret; + sunrealtype rtol, *yval, *ypval, *atval; + sunrealtype t0, tout1, tout, tret; int iout, retval, retvalr; int rootsfound[2]; SUNMatrix A; @@ -250,9 +250,9 @@ int main(void) * Define the system residual function. */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *yval, *ypval, *rval; + sunrealtype *yval, *ypval, *rval; yval = N_VGetArrayPointer(yy); ypval = N_VGetArrayPointer(yp); @@ -270,10 +270,10 @@ int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data * Root function routine. Compute functions g_i(t,y) for i = 0,1. */ -static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, void *user_data) { - realtype *yval, y1, y3; + sunrealtype *yval, y1, y3; yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; @@ -287,12 +287,12 @@ static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, * Define the Jacobian function. */ -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; yval = N_VGetArrayPointer(yy); @@ -319,9 +319,9 @@ int jacrob(realtype tt, realtype cj, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y) { - realtype *atval, *yval; + sunrealtype *atval, *yval; atval = N_VGetArrayPointer(avtol); yval = N_VGetArrayPointer(y); @@ -356,12 +356,12 @@ static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); @@ -430,12 +430,12 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) /* compare the solution at the final time 4e10s to a reference solution computed using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ -static int check_ans(N_Vector y, realtype t, realtype rtol, N_Vector atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail=0; /* answer pass (0) or fail (1) retval */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ + sunrealtype err; /* wrms error */ /* create reference solution and error weight vectors */ ref = N_VClone(y); diff --git a/examples/idas/serial/idasRoberts_klu.c b/examples/idas/serial/idasRoberts_klu.c index bf50848a6d..0994cc447a 100644 --- a/examples/idas/serial/idasRoberts_klu.c +++ b/examples/idas/serial/idasRoberts_klu.c @@ -38,7 +38,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Problem Constants */ @@ -51,25 +51,25 @@ /* Prototypes of functions called by IDA */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int grob(realtype t, N_Vector yy, N_Vector yp, - realtype *gout, void *user_data); +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, + sunrealtype *gout, void *user_data); -int jacrobCSC(realtype tt, realtype cj, +int jacrobCSC(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); -int jacrobCSR(realtype tt, realtype cj, +int jacrobCSR(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static void PrintRootInfo(int root_f1, int root_f2); static void PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -84,8 +84,8 @@ int main(void) { void *mem; N_Vector yy, yp, avtol; - realtype rtol, *yval, *ypval, *atval; - realtype t0, tout1, tout, tret; + sunrealtype rtol, *yval, *ypval, *atval; + sunrealtype t0, tout1, tout, tret; int iout, retval, retvalr; int rootsfound[2]; SUNMatrix A; @@ -219,9 +219,9 @@ int main(void) * Define the system residual function. */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *yval, *ypval, *rval; + sunrealtype *yval, *ypval, *rval; yval = N_VGetArrayPointer(yy); ypval = N_VGetArrayPointer(yp); @@ -239,10 +239,10 @@ int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data * Root function routine. Compute functions g_i(t,y) for i = 0,1. */ -static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, void *user_data) { - realtype *yval, y1, y3; + sunrealtype *yval, y1, y3; yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; @@ -256,15 +256,15 @@ static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, * Define the Jacobian function. */ -int jacrobCSC(realtype tt, realtype cj, +int jacrobCSC(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); yval = N_VGetArrayPointer(yy); @@ -305,15 +305,15 @@ int jacrobCSC(realtype tt, realtype cj, /* * Define the Jacobian function, where Jacobian is CSR matrix. */ -int jacrobCSR(realtype tt, realtype cj, +int jacrobCSR(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *rowptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *colvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); yval = N_VGetArrayPointer(yy); @@ -361,9 +361,9 @@ int jacrobCSR(realtype tt, realtype cj, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y) { - realtype *atval, *yval; + sunrealtype *atval, *yval; atval = N_VGetArrayPointer(avtol); yval = N_VGetArrayPointer(y); @@ -398,12 +398,12 @@ static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); diff --git a/examples/idas/serial/idasRoberts_sps.c b/examples/idas/serial/idasRoberts_sps.c index 6aaf7b66aa..e762afd969 100644 --- a/examples/idas/serial/idasRoberts_sps.c +++ b/examples/idas/serial/idasRoberts_sps.c @@ -38,7 +38,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLUMT linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ /* Problem Constants */ @@ -51,20 +51,20 @@ /* Prototypes of functions called by IDA */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int grob(realtype t, N_Vector yy, N_Vector yp, - realtype *gout, void *user_data); +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, + sunrealtype *gout, void *user_data); -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static void PrintRootInfo(int root_f1, int root_f2); static void PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -79,8 +79,8 @@ int main(void) { void *mem; N_Vector yy, yp, avtol; - realtype rtol, *yval, *ypval, *atval; - realtype t0, tout1, tout, tret; + sunrealtype rtol, *yval, *ypval, *atval; + sunrealtype t0, tout1, tout, tret; int iout, retval, retvalr; int rootsfound[2]; SUNMatrix A; @@ -214,9 +214,9 @@ int main(void) * Define the system residual function. */ -int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - realtype *yval, *ypval, *rval; + sunrealtype *yval, *ypval, *rval; yval = N_VGetArrayPointer(yy); ypval = N_VGetArrayPointer(yp); @@ -234,10 +234,10 @@ int resrob(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data * Root function routine. Compute functions g_i(t,y) for i = 0,1. */ -static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, +static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, void *user_data) { - realtype *yval, y1, y3; + sunrealtype *yval, y1, y3; yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; @@ -251,15 +251,15 @@ static int grob(realtype t, N_Vector yy, N_Vector yp, realtype *gout, * Define the Jacobian function. */ -int jacrob(realtype tt, realtype cj, +int jacrob(sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector resvec, SUNMatrix JJ, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype *yval; + sunrealtype *yval; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); - realtype *data = SUNSparseMatrix_Data(JJ); + sunrealtype *data = SUNSparseMatrix_Data(JJ); yval = N_VGetArrayPointer(yy); @@ -307,9 +307,9 @@ int jacrob(realtype tt, realtype cj, * Print first lines of output (problem description) */ -static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, N_Vector avtol, N_Vector y) { - realtype *atval, *yval; + sunrealtype *atval, *yval; atval = N_VGetArrayPointer(avtol); yval = N_VGetArrayPointer(y); @@ -344,12 +344,12 @@ static void PrintHeader(realtype rtol, N_Vector avtol, N_Vector y) * Print Output */ -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); diff --git a/examples/idas/serial/idasSlCrank_FSA_dns.c b/examples/idas/serial/idasSlCrank_FSA_dns.c index b958d03199..25ae1a46e9 100644 --- a/examples/idas/serial/idasSlCrank_FSA_dns.c +++ b/examples/idas/serial/idasSlCrank_FSA_dns.c @@ -37,7 +37,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #define Ith(v,i) NV_Ith_S(v,i-1) /* i-th vector component i= 1..NEQ */ @@ -67,24 +67,24 @@ #define FOUR RCONST(4.00) typedef struct { - realtype a; - realtype J1, J2, m1, m2; - realtype l0; - realtype params[2]; - realtype F; + sunrealtype a; + sunrealtype J1, J2, m1, m2; + sunrealtype l0; + sunrealtype params[2]; + sunrealtype F; } *UserData; -static int ressc(realtype tres, N_Vector yy, N_Vector yp, +static int ressc(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); -static int rhsQS(int Ns, realtype t, N_Vector yy, N_Vector yp, +static int rhsQS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *rhsvalQS, void *user_data, N_Vector yytmp, N_Vector yptmp, N_Vector tmpQS); static void setIC(N_Vector yy, N_Vector yp, UserData data); -static void force(N_Vector yy, realtype *Q, UserData data); +static void force(N_Vector yy, sunrealtype *Q, UserData data); static int PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -100,11 +100,11 @@ int main(void) void *mem; N_Vector yy, yp, id, q, *yyS, *ypS, *qS; - realtype tret; - realtype pbar[2]; - realtype dp, G, Gm[2], Gp[2]; + sunrealtype tret; + sunrealtype pbar[2]; + sunrealtype dp, G, Gm[2], Gp[2]; int retval, is; - realtype atolS[NP]; + sunrealtype atolS[NP]; SUNMatrix A; SUNLinearSolver LS; SUNContext ctx; @@ -370,10 +370,10 @@ int main(void) static void setIC(N_Vector yy, N_Vector yp, UserData data) { - realtype pi; - realtype a, J1, m2, J2; - realtype q, p, x; - realtype Q[3]; + sunrealtype pi; + sunrealtype a, J1, m2, J2; + sunrealtype q, p, x; + sunrealtype Q[3]; N_VConst(ZERO, yy); N_VConst(ZERO, yp); @@ -401,14 +401,14 @@ static void setIC(N_Vector yy, N_Vector yp, UserData data) } -static void force(N_Vector yy, realtype *Q, UserData data) +static void force(N_Vector yy, sunrealtype *Q, UserData data) { - realtype a, k, c, l0, F; - realtype q, x, p; - realtype qd, xd, pd; - realtype s1, c1, s2, c2, s21, c21; - realtype l2, l, ld; - realtype f, fl; + sunrealtype a, k, c, l0, F; + sunrealtype q, x, p; + sunrealtype qd, xd, pd; + sunrealtype s1, c1, s2, c2, s21, c21; + sunrealtype l2, l, ld; + sunrealtype f, fl; a = data->a; k = data->params[0]; @@ -445,16 +445,16 @@ static void force(N_Vector yy, realtype *Q, UserData data) } -static int ressc(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +static int ressc(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { UserData data; - realtype Q[3]; - realtype a, J1, m2, J2; - realtype *yval, *ypval, *rval; - realtype q, x, p; - realtype qd, xd, pd; - realtype lam1, lam2, mu1, mu2; - realtype s1, c1, s2, c2; + sunrealtype Q[3]; + sunrealtype a, J1, m2, J2; + sunrealtype *yval, *ypval, *rval; + sunrealtype q, x, p; + sunrealtype qd, xd, pd; + sunrealtype lam1, lam2, mu1, mu2; + sunrealtype s1, c1, s2, c2; data = (UserData) user_data; @@ -505,10 +505,10 @@ static int ressc(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *use return(0); } -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { - realtype v1, v2, v3; - realtype J1, m2, J2; + sunrealtype v1, v2, v3; + sunrealtype J1, m2, J2; UserData data; data = (UserData) user_data; @@ -525,14 +525,14 @@ static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_ return(0); } -static int rhsQS(int Ns, realtype t, N_Vector yy, N_Vector yp, +static int rhsQS(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *rhsvalQS, void *user_data, N_Vector yytmp, N_Vector yptmp, N_Vector tmpQS) { - realtype v1, v2, v3; - realtype J1, m2, J2; + sunrealtype v1, v2, v3; + sunrealtype J1, m2, J2; UserData data; - realtype s1, s2, s3; + sunrealtype s1, s2, s3; data = (UserData) user_data; diff --git a/examples/idas/serial/idasSlCrank_dns.c b/examples/idas/serial/idasSlCrank_dns.c index 143b1eb0df..4871676fa2 100644 --- a/examples/idas/serial/idasSlCrank_dns.c +++ b/examples/idas/serial/idasSlCrank_dns.c @@ -36,7 +36,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #define Ith(v,i) NV_Ith_S(v,i-1) /* i-th vector component i= 1..NEQ */ @@ -63,23 +63,23 @@ #define FOUR RCONST(4.00) typedef struct { - realtype a; - realtype J1, J2, m1, m2; - realtype l0; - realtype params[2]; - realtype F; + sunrealtype a; + sunrealtype J1, J2, m1, m2; + sunrealtype l0; + sunrealtype params[2]; + sunrealtype F; } *UserData; -static int ressc(realtype tres, N_Vector yy, N_Vector yp, +static int ressc(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector resval, void *user_data); -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data); static void setIC(N_Vector yy, N_Vector yp, UserData data); -static void force(N_Vector yy, realtype *Q, UserData data); +static void force(N_Vector yy, sunrealtype *Q, UserData data); /* Prototypes of private functions */ -static void PrintHeader(realtype rtol, realtype avtol, N_Vector y); -static void PrintOutput(void *mem, realtype t, N_Vector y); +static void PrintHeader(sunrealtype rtol, sunrealtype avtol, N_Vector y); +static void PrintOutput(void *mem, sunrealtype t, N_Vector y); static int PrintFinalStats(void *mem); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -95,7 +95,7 @@ int main(void) void *mem; N_Vector yy, yp, id, q; - realtype tret, tout; + sunrealtype tret, tout; int retval; SUNMatrix A; SUNLinearSolver LS; @@ -210,10 +210,10 @@ int main(void) static void setIC(N_Vector yy, N_Vector yp, UserData data) { - realtype pi; - realtype a, J1, m2, J2; - realtype q, p, x; - realtype Q[3]; + sunrealtype pi; + sunrealtype a, J1, m2, J2; + sunrealtype q, p, x; + sunrealtype Q[3]; N_VConst(ZERO, yy); N_VConst(ZERO, yp); @@ -241,14 +241,14 @@ static void setIC(N_Vector yy, N_Vector yp, UserData data) } -static void force(N_Vector yy, realtype *Q, UserData data) +static void force(N_Vector yy, sunrealtype *Q, UserData data) { - realtype a, k, c, l0, F; - realtype q, x, p; - realtype qd, xd, pd; - realtype s1, c1, s2, c2, s21, c21; - realtype l2, l, ld; - realtype f, fl; + sunrealtype a, k, c, l0, F; + sunrealtype q, x, p; + sunrealtype qd, xd, pd; + sunrealtype s1, c1, s2, c2, s21, c21; + sunrealtype l2, l, ld; + sunrealtype f, fl; a = data->a; k = data->params[0]; @@ -285,16 +285,16 @@ static void force(N_Vector yy, realtype *Q, UserData data) } -static int ressc(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) +static int ressc(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { UserData data; - realtype Q[3]; - realtype a, J1, m2, J2; - realtype *yval, *ypval, *rval; - realtype q, x, p; - realtype qd, xd, pd; - realtype lam1, lam2, mu1, mu2; - realtype s1, c1, s2, c2; + sunrealtype Q[3]; + sunrealtype a, J1, m2, J2; + sunrealtype *yval, *ypval, *rval; + sunrealtype q, x, p; + sunrealtype qd, xd, pd; + sunrealtype lam1, lam2, mu1, mu2; + sunrealtype s1, c1, s2, c2; data = (UserData) user_data; @@ -345,10 +345,10 @@ static int ressc(realtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *use return(0); } -static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) +static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_data) { - realtype v1, v2, v3; - realtype J1, m2, J2; + sunrealtype v1, v2, v3; + sunrealtype J1, m2, J2; UserData data; data = (UserData) user_data; @@ -365,7 +365,7 @@ static int rhsQ(realtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *user_ return(0); } -static void PrintHeader(realtype rtol, realtype avtol, N_Vector y) +static void PrintHeader(sunrealtype rtol, sunrealtype avtol, N_Vector y) { printf("\nidasSlCrank_dns: Slider-Crank DAE serial example problem for IDAS\n"); printf("Linear solver: DENSE, Jacobian is computed by IDAS.\n"); @@ -385,12 +385,12 @@ static void PrintHeader(realtype rtol, realtype avtol, N_Vector y) printf("-----------------------------------------------------------------------\n"); } -static void PrintOutput(void *mem, realtype t, N_Vector y) +static void PrintOutput(void *mem, sunrealtype t, N_Vector y) { - realtype *yval; + sunrealtype *yval; int retval, kused; long int nst; - realtype hused; + sunrealtype hused; yval = N_VGetArrayPointer(y); diff --git a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu index 8b61324436..2e1de78777 100644 --- a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu +++ b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu @@ -72,12 +72,12 @@ // ----------------------------------------------------------------------------- __global__ -void PxKernel(realtype *mu, realtype *Px, realtype *x, - realtype a1, realtype a2, realtype a3, realtype scale, +void PxKernel(sunrealtype *mu, sunrealtype *Px, sunrealtype *x, + sunrealtype a1, sunrealtype a2, sunrealtype a3, sunrealtype scale, sunindextype N) { // Calculate all P(x_k) for each x value - realtype val1, val2, val3; + sunrealtype val1, val2, val3; int tid = blockDim.x * blockIdx.x + threadIdx.x; @@ -93,13 +93,13 @@ void PxKernel(realtype *mu, realtype *Px, realtype *x, } __global__ -void EMKernel(realtype *mu, realtype *mu_top, realtype *mu_bottom, - realtype *x, realtype *Px, - realtype a1, realtype a2, realtype a3, realtype scale, +void EMKernel(sunrealtype *mu, sunrealtype *mu_top, sunrealtype *mu_bottom, + sunrealtype *x, sunrealtype *Px, + sunrealtype a1, sunrealtype a2, sunrealtype a3, sunrealtype scale, sunindextype N) { - realtype val1, val2, val3; - realtype frac1, frac2, frac3; + sunrealtype val1, val2, val3; + sunrealtype frac1, frac2, frac3; int tid = blockDim.x * blockIdx.x + threadIdx.x; @@ -123,7 +123,7 @@ void EMKernel(realtype *mu, realtype *mu_top, realtype *mu_bottom, } __global__ -void EMKernelFin(realtype *mu, realtype *mu_top, realtype *mu_bottom, +void EMKernelFin(sunrealtype *mu, sunrealtype *mu_top, sunrealtype *mu_bottom, sunindextype localn) { int tid = blockDim.x * blockIdx.x + threadIdx.x; @@ -422,16 +422,16 @@ static int FPFunction(N_Vector u, N_Vector f, void *user_data) static int SetupSamples(UserData *udata) { sunindextype i, j, start, end; - realtype mean, val; + sunrealtype mean, val; // Access problem data - realtype *samples_local = N_VGetHostArrayPointer_Cuda(udata->samples_local); + sunrealtype *samples_local = N_VGetHostArrayPointer_Cuda(udata->samples_local); if (check_retval((void *) samples_local, "N_VGetHostArrayPointer_Cuda", 0)) return 1; - realtype *mu_host = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(udata->mu_true)); + sunrealtype *mu_host = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(udata->mu_true)); if (check_retval((void *) mu_host, "N_VGetHostArrayPointer_Cuda", 0)) return 1; - realtype std_dev = ONE; + sunrealtype std_dev = ONE; for (i = 0; i < 3; i++) { // Set number of samples with this mean @@ -449,7 +449,7 @@ static int SetupSamples(UserData *udata) // Setup distribution parameters mean = mu_host[i]; std::default_random_engine generator; - std::normal_distribution distribution(mean, std_dev); + std::normal_distribution distribution(mean, std_dev); // Get samples for (j = start; j < end; j++) { @@ -469,7 +469,7 @@ static int SetMus(UserData *udata) { sunindextype i; - realtype *mu_host = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(udata->mu_true)); + sunrealtype *mu_host = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(udata->mu_true)); if (check_retval((void *) mu_host, "N_VGetHostArrayPointer_Cuda", 0)) return 1; // Fill vectors with uniform random data in [-1,1] @@ -488,7 +488,7 @@ static int SetMus(UserData *udata) static int SetStartGuess(N_Vector u, UserData* udata) { - realtype *u_host = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(u)); + sunrealtype *u_host = N_VGetHostArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(u)); if (check_retval((void *) u_host, "N_VGetHostArrayPointer_Cuda", 0)) return 1; for (sunindextype i = 0; i < udata->nodes_loc; i++) @@ -520,14 +520,14 @@ static int EM(N_Vector u, N_Vector f, void *user_data) // --------- // Scale value for functions - realtype scale = ONE / sqrt(TWO * PI); + sunrealtype scale = ONE / sqrt(TWO * PI); // Get input device pointers - realtype *u_dev = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(u)); - realtype *x_dev = N_VGetDeviceArrayPointer_Cuda(udata->samples_local); + sunrealtype *u_dev = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(u)); + sunrealtype *x_dev = N_VGetDeviceArrayPointer_Cuda(udata->samples_local); // Get output device pointer - realtype *Px_dev = N_VGetDeviceArrayPointer_Cuda(udata->px); + sunrealtype *Px_dev = N_VGetDeviceArrayPointer_Cuda(udata->px); // Compute Px PxKernel<<>>(u_dev, Px_dev, x_dev, @@ -539,8 +539,8 @@ static int EM(N_Vector u, N_Vector f, void *user_data) // --------- // Get output device pointers - realtype *mu_bottom_dev = N_VGetDeviceArrayPointer_Cuda(udata->mu_bottom); - realtype *mu_top_dev = N_VGetDeviceArrayPointer_Cuda(udata->mu_top); + sunrealtype *mu_bottom_dev = N_VGetDeviceArrayPointer_Cuda(udata->mu_bottom); + sunrealtype *mu_top_dev = N_VGetDeviceArrayPointer_Cuda(udata->mu_top); // Initilaize output vectors to zero (for sum reduction) N_VConst(ZERO, udata->mu_bottom); @@ -554,7 +554,7 @@ static int EM(N_Vector u, N_Vector f, void *user_data) // EM FINALIZE KERNEL // ------------------ - realtype *f_dev = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(f)); + sunrealtype *f_dev = N_VGetDeviceArrayPointer_Cuda(N_VGetLocalVector_MPIPlusX(f)); EMKernelFin<<>>(f_dev, mu_top_dev, mu_bottom_dev, udata->nodes_loc); @@ -894,7 +894,7 @@ static int OpenOutput(UserData *udata) udata->rout.open(fname.str()); udata->rout << scientific; - udata->rout << setprecision(numeric_limits::digits10); + udata->rout << setprecision(numeric_limits::digits10); // Open output stream for error fname.str(""); @@ -904,7 +904,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } return 0; @@ -918,12 +918,12 @@ static int WriteOutput(N_Vector u, N_Vector f, UserData *udata) // r = \|G(u) - u\|_inf N_VLinearSum(ONE, f, -ONE, u, udata->vtemp); - realtype res = N_VMaxNorm(udata->vtemp); + sunrealtype res = N_VMaxNorm(udata->vtemp); // e = \|u_exact - u\|_inf retval = SolutionError(udata->mu_true, u, udata->vtemp, udata); if (check_retval(&retval, "SolutionError", 1)) return 1; - realtype err = N_VMaxNorm(udata->vtemp); + sunrealtype err = N_VMaxNorm(udata->vtemp); if (outproc) { diff --git a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp index 759d6fa69e..afc23219e2 100644 --- a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp +++ b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp @@ -56,12 +56,12 @@ using namespace std; struct UserData { // Sigmas - realtype sigma; + sunrealtype sigma; // Alphas - mixture proportions - realtype alpha1; - realtype alpha2; - realtype alpha3; + sunrealtype alpha1; + sunrealtype alpha2; + sunrealtype alpha3; // Global total number of nodes sunindextype nodes; @@ -75,7 +75,7 @@ struct UserData int myid; // process ID in communicator // Fixed Point Solver settings - realtype rtol; // relative tolerance + sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration double damping; // daming for Anderson Acceleration int orthaa; // orthogonalization routine for AA diff --git a/examples/kinsol/CXX_parallel/kin_em_p.cpp b/examples/kinsol/CXX_parallel/kin_em_p.cpp index 70d35e8e26..5ab1419481 100644 --- a/examples/kinsol/CXX_parallel/kin_em_p.cpp +++ b/examples/kinsol/CXX_parallel/kin_em_p.cpp @@ -354,16 +354,16 @@ static int FPFunction(N_Vector u, N_Vector f, void *user_data) static int SetupSamples(UserData *udata) { sunindextype i, j, start, end; - realtype mean, val; + sunrealtype mean, val; // Access problem data - realtype *samples_local = N_VGetArrayPointer(udata->samples_local); + sunrealtype *samples_local = N_VGetArrayPointer(udata->samples_local); if (check_retval((void *) samples_local, "N_VGetArrayPointer", 0)) return 1; - realtype *mu_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(udata->mu_true)); + sunrealtype *mu_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(udata->mu_true)); if (check_retval((void *) mu_host, "N_VGetArrayPointer", 0)) return 1; - realtype std_dev = ONE; + sunrealtype std_dev = ONE; for (i = 0; i < 3; i++) { // Set number of samples with this mean @@ -381,7 +381,7 @@ static int SetupSamples(UserData *udata) // Setup distribution parameters mean = mu_host[i]; std::default_random_engine generator; - std::normal_distribution distribution(mean, std_dev); + std::normal_distribution distribution(mean, std_dev); // Get samples for (j = start; j < end; j++) { @@ -399,7 +399,7 @@ static int SetMus(UserData *udata) { sunindextype i; - realtype *mu_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(udata->mu_true)); + sunrealtype *mu_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(udata->mu_true)); if (check_retval((void *) mu_host, "N_VGetArrayPointer", 0)) return 1; // Fill vectors with uniform random data in [-1,1] @@ -416,7 +416,7 @@ static int SetMus(UserData *udata) static int SetStartGuess(N_Vector u, UserData* udata) { - realtype *u_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(u)); + sunrealtype *u_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(u)); if (check_retval((void *) u_host, "N_VGetArrayPointer", 0)) return 1; for (sunindextype i = 0; i < udata->nodes_loc; i++) @@ -441,20 +441,20 @@ static int EM(N_Vector u, N_Vector f, void *user_data) // -------------- // Scale value for functions - realtype scale = ONE / sqrt(TWO * PI); + sunrealtype scale = ONE / sqrt(TWO * PI); // Get input pointers - realtype *u_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(u)); - realtype *x_host = N_VGetArrayPointer(udata->samples_local); + sunrealtype *u_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(u)); + sunrealtype *x_host = N_VGetArrayPointer(udata->samples_local); // Get output pointer - realtype *px_host = N_VGetArrayPointer(udata->px); + sunrealtype *px_host = N_VGetArrayPointer(udata->px); // Px calculation - realtype val1, val2, val3; - realtype a1 = udata->alpha1; - realtype a2 = udata->alpha2; - realtype a3 = udata->alpha3; + sunrealtype val1, val2, val3; + sunrealtype a1 = udata->alpha1; + sunrealtype a2 = udata->alpha2; + sunrealtype a3 = udata->alpha3; for (int i = 0; i < udata->num_samples; i++) { val1 = x_host[i] - u_host[0]; @@ -471,11 +471,11 @@ static int EM(N_Vector u, N_Vector f, void *user_data) // -------------- // Get output device pointers - realtype *mub_host = N_VGetArrayPointer(udata->mu_bottom); - realtype *mut_host = N_VGetArrayPointer(udata->mu_top); + sunrealtype *mub_host = N_VGetArrayPointer(udata->mu_bottom); + sunrealtype *mut_host = N_VGetArrayPointer(udata->mu_top); // Initialize temporary variables - realtype frac1, frac2, frac3; + sunrealtype frac1, frac2, frac3; mub_host[0] = ZERO; mub_host[1] = ZERO; @@ -509,7 +509,7 @@ static int EM(N_Vector u, N_Vector f, void *user_data) // EM FINALIZE COMPUTATION // ----------------------- - realtype *f_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(f)); + sunrealtype *f_host = N_VGetArrayPointer(N_VGetLocalVector_MPIPlusX(f)); // Serial EM Fin calculation for (int j = 0; j < udata->nodes_loc; j++) @@ -855,7 +855,7 @@ static int OpenOutput(UserData *udata) udata->rout.open(fname.str()); udata->rout << scientific; - udata->rout << setprecision(numeric_limits::digits10); + udata->rout << setprecision(numeric_limits::digits10); // Open output stream for error fname.str(""); @@ -865,7 +865,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } return 0; @@ -879,12 +879,12 @@ static int WriteOutput(N_Vector u, N_Vector f, UserData *udata) // r = \|G(u) - u\|_inf N_VLinearSum(ONE, f, -ONE, u, udata->vtemp); - realtype res = N_VMaxNorm(udata->vtemp); + sunrealtype res = N_VMaxNorm(udata->vtemp); // e = \|u_exact - u\|_inf retval = SolutionError(udata->mu_true, u, udata->vtemp, udata); if (check_retval(&retval, "SolutionError", 1)) return 1; - realtype err = N_VMaxNorm(udata->vtemp); + sunrealtype err = N_VMaxNorm(udata->vtemp); if (outproc) { diff --git a/examples/kinsol/CXX_parallel/kin_em_p.hpp b/examples/kinsol/CXX_parallel/kin_em_p.hpp index 12a24535e4..4895c33842 100644 --- a/examples/kinsol/CXX_parallel/kin_em_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_em_p.hpp @@ -56,12 +56,12 @@ using namespace std; struct UserData { // Sigmas - realtype sigma; + sunrealtype sigma; // Alphas - mixture proportions - realtype alpha1; - realtype alpha2; - realtype alpha3; + sunrealtype alpha1; + sunrealtype alpha2; + sunrealtype alpha3; // Global total number of nodes sunindextype nodes; @@ -75,7 +75,7 @@ struct UserData int myid; // process ID in communicator // Fixed Point Solver settings - realtype rtol; // relative tolerance + sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration double damping; // daming for Anderson Acceleration int orthaa; // orthogonalization routine for AA diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp index 943eb66638..544c9ff077 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp @@ -239,12 +239,12 @@ int main(int argc, char* argv[]) retval = SolutionError(u, udata->e, udata); if (check_retval(&retval, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; cout << endl; } @@ -386,23 +386,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -493,15 +493,15 @@ static int FPFunction(N_Vector u, N_Vector f, void *user_data) sunindextype ny_loc = udata->ny_loc; // Constants for computing diffusion term - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return -1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_retval((void *) farray, "N_VGetArrayPointer", 0)) return -1; // Initialize rhs vector to zero (handles boundary conditions) @@ -524,10 +524,10 @@ static int FPFunction(N_Vector u, N_Vector f, void *user_data) if (check_retval(&retval, "WaitRecv", 1)) return -1; // Iterate over subdomain boundaries and add rhs diffusion term - realtype *Warray = udata->Wrecv; - realtype *Earray = udata->Erecv; - realtype *Sarray = udata->Srecv; - realtype *Narray = udata->Nrecv; + sunrealtype *Warray = udata->Wrecv; + sunrealtype *Earray = udata->Erecv; + sunrealtype *Sarray = udata->Srecv; + sunrealtype *Narray = udata->Nrecv; // West face (updates south-west and north-west corners if necessary) if (udata->HaveNbrW) @@ -708,16 +708,16 @@ static int SetupRHS(void *user_data) // ------------------------------------------------------ // Access data array - realtype *barray = N_VGetArrayPointer(udata->b); + sunrealtype *barray = N_VGetArrayPointer(udata->b); if (check_retval((void *) barray, "N_VGetArrayPointer", 0)) return 1; // Initialize rhs vector to zero (handles boundary conditions) - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; // Iterate over subdomain and compute forcing term (b) for (j = jstart; j < jend; j++) @@ -772,17 +772,17 @@ static int c(N_Vector u, N_Vector z, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return 1; - realtype *zarray = N_VGetArrayPointer(z); + sunrealtype *zarray = N_VGetArrayPointer(z); if (check_retval((void *) zarray, "N_VGetArrayPointer", 0)) return 1; // Initialize rhs vector to zero (handles boundary conditions) N_VConst(ZERO, z); // Iterate over subdomain and compute z = c(u) - realtype u_val; + sunrealtype u_val; for (j = jstart; j < jend; j++) { @@ -872,7 +872,7 @@ static int SendData(N_Vector y, UserData *udata) double t1 = MPI_Wtime(); // Access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_retval((void *) Y, "N_VGetArrayPointer", 0)) return -1; // Send data @@ -1263,8 +1263,8 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // Compute the exact solution static int Solution(N_Vector u, UserData *udata) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, u); @@ -1276,7 +1276,7 @@ static int Solution(N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype j = jstart; j < jend; j++) @@ -1457,10 +1457,10 @@ static int WriteSolution(N_Vector u, UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); // Write solution and error to disk - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype i = 0; i < udata->nodes_loc; i++) @@ -1491,7 +1491,7 @@ static int OpenOutput(UserData *udata) udata->rout.open(fname.str()); udata->rout << scientific; - udata->rout << setprecision(numeric_limits::digits10); + udata->rout << setprecision(numeric_limits::digits10); // Open output stream for error fname.str(""); @@ -1500,7 +1500,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } return 0; @@ -1514,12 +1514,12 @@ static int WriteOutput(N_Vector u, N_Vector f, UserData *udata) // r = \|G(u) - u\|_2 N_VLinearSum(ONE, f, -ONE, u, udata->e); - realtype res = N_VDotProd(udata->e, udata->e); + sunrealtype res = N_VDotProd(udata->e, udata->e); // e = \|u_exact - u\|_2 retval = SolutionError(u, udata->e, udata); if (check_retval(&retval, "SolutionError", 1)) return 1; - realtype err = N_VDotProd(udata->e, udata->e); + sunrealtype err = N_VDotProd(udata->e, udata->e); if (outproc) { diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp index 5f224a7c13..cc743d8940 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp @@ -40,7 +40,7 @@ #define IDX(x,y,n) ((n)*(y)+(x)) // Define c function type -typedef realtype (*cFn)(realtype u_val); +typedef sunrealtype (*cFn)(sunrealtype u_val); using namespace std; @@ -51,12 +51,12 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -66,8 +66,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -104,10 +104,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -116,10 +116,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -128,7 +128,7 @@ struct UserData MPI_Request reqSN; // Fixed Point Solver settings - realtype rtol; // relative tolerance + sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration double damping; // daming for Anderson Acceleration int orthaa; // orthogonalization routine for AA @@ -235,125 +235,125 @@ static int check_retval(void *flagvalue, const string funcname, int opt); // ----------------------------------------------------------------------------- // c(u) = u -realtype c1(realtype u_val) +sunrealtype c1(sunrealtype u_val) { return u_val; } // c(u) = u^3 - u -realtype c2(realtype u_val) +sunrealtype c2(sunrealtype u_val) { return u_val * u_val * u_val - u_val; } // c(u) = u - u^2 -realtype c3(realtype u_val) +sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } // c(u) = e^u -realtype c4(realtype u_val) +sunrealtype c4(sunrealtype u_val) { return exp(u_val); } // c(u) = u^4 -realtype c5(realtype u_val) +sunrealtype c5(sunrealtype u_val) { return u_val * u_val * u_val * u_val; } // c(u) = cos^2(u) - sin^2(u) -realtype c6(realtype u_val) +sunrealtype c6(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)); } // c(u) = cos^2(u) - sin^2(u) - e^u -realtype c7(realtype u_val) +sunrealtype c7(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)) - exp(u_val); } // c(u) = e^u * u^4 - u * e^{cos(u)} -realtype c8(realtype u_val) +sunrealtype c8(sunrealtype u_val) { - realtype u2 = u_val * u_val; + sunrealtype u2 = u_val * u_val; return exp(u_val) * u2 * u2 - u_val * exp(cos(u_val)); } // c(u) = e^(cos^2(u)) -realtype c9(realtype u_val) +sunrealtype c9(sunrealtype u_val) { - realtype cos2u = cos(u_val) * cos(u_val); + sunrealtype cos2u = cos(u_val) * cos(u_val); return exp(cos2u); } // c(u) = 10(u - u^2) -realtype c10(realtype u_val) +sunrealtype c10(sunrealtype u_val) { - realtype u2 = u_val * u_val; + sunrealtype u2 = u_val * u_val; return 10.0 * (u_val - u2); } // c(u) = -13 + u + ((5-u)u - 2)u -realtype c11(realtype u_val) +sunrealtype c11(sunrealtype u_val) { - realtype temp = ((5.0 - u_val) * u_val) - 2.0; + sunrealtype temp = ((5.0 - u_val) * u_val) - 2.0; return -13.0 + u_val + temp * u_val; } // c(u) = sqrt(5) * (u - u^2) -realtype c12(realtype u_val) +sunrealtype c12(sunrealtype u_val) { - realtype temp = sqrt(5); - realtype u2 = u_val * u_val; + sunrealtype temp = sqrt(5); + sunrealtype u2 = u_val * u_val; return temp * (u_val - u2); } // c(u) = (u - e^u)^2 + (u + u * sin(u) - cos(u))^2 -realtype c13(realtype u_val) +sunrealtype c13(sunrealtype u_val) { - realtype eu = u_val - exp(u_val); - realtype usin = u_val * sin(u_val); - realtype temp = (u_val + usin - cos(u_val)); + sunrealtype eu = u_val - exp(u_val); + sunrealtype usin = u_val * sin(u_val); + sunrealtype temp = (u_val + usin - cos(u_val)); return eu * eu + temp * temp; } // c(u) = u + ue^u + ue^{-u} -realtype c14(realtype u_val) +sunrealtype c14(sunrealtype u_val) { - realtype ueu = u_val * exp(u_val); - realtype ue_u = u_val * exp(-u_val); + sunrealtype ueu = u_val * exp(u_val); + sunrealtype ue_u = u_val * exp(-u_val); return u_val + ueu + ue_u; } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 -realtype c15(realtype u_val) +sunrealtype c15(sunrealtype u_val) { - realtype ueu = u_val * exp(u_val); - realtype ue_u = u_val * exp(-u_val); - realtype temp = u_val - exp(u_val); + sunrealtype ueu = u_val * exp(u_val); + sunrealtype ue_u = u_val * exp(-u_val); + sunrealtype temp = u_val - exp(u_val); return u_val + ueu + ue_u + (temp * temp); } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 + (u + usin(u) - cos(u))^2 -realtype c16(realtype u_val) +sunrealtype c16(sunrealtype u_val) { - realtype ueu = u_val * exp(u_val); - realtype ue_u = u_val * exp(-u_val); - realtype temp = u_val - exp(u_val); - realtype temp2 = u_val + (u_val * sin(u_val)) - cos(u_val); + sunrealtype ueu = u_val * exp(u_val); + sunrealtype ue_u = u_val * exp(-u_val); + sunrealtype temp = u_val - exp(u_val); + sunrealtype temp2 = u_val + (u_val * sin(u_val)) - cos(u_val); return u_val + ueu + ue_u + (temp * temp) + (temp2 * temp2); } // c(u) = u + ue^{-u} + e^u*(u + sin(u) - cos(u))^3 -realtype c17(realtype u_val) +sunrealtype c17(sunrealtype u_val) { - realtype ue_u = u_val * exp(-u_val); - realtype eu = exp(u_val); - realtype temp = u_val + sin(u_val) - cos(u_val); + sunrealtype ue_u = u_val * exp(-u_val); + sunrealtype eu = exp(u_val); + sunrealtype temp = u_val + sin(u_val) - cos(u_val); return u_val + ue_u + eu * (temp * temp * temp); } diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp index e3f1b20711..6c5fbf5ac1 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp @@ -432,10 +432,10 @@ static int FPFunction(N_Vector u, N_Vector f, void *user_data) UserData *udata = (UserData *) user_data; // Get array pointers - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return 1; - realtype *farray = N_VGetArrayPointer(f); + sunrealtype *farray = N_VGetArrayPointer(f); if (check_retval((void *) farray, "N_VGetArrayPointer", 0)) return 1; // Start timer @@ -655,7 +655,7 @@ static int PSetup(void *user_data) // Preconditioner solve routine for Pz = r static int PSolve(void *user_data, N_Vector r, N_Vector z, - realtype tol, int lr) + sunrealtype tol, int lr) { int retval; @@ -915,9 +915,9 @@ static int Jac(UserData *udata) (ilower[1] <= iupper[1])) { // Jacobian values - realtype cx = ONE / (udata->dx * udata->dx); - realtype cy = ONE / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = ONE / (udata->dx * udata->dx); + sunrealtype cy = ONE / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // -------------------------------- // Set matrix values for all nodes @@ -1185,8 +1185,8 @@ static int Jac(UserData *udata) // Compute the starting guess static int InitialGuess(N_Vector u, UserData *udata) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, u); @@ -1198,7 +1198,7 @@ static int InitialGuess(N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return 1; for (sunindextype j = jstart; j < jend; j++) @@ -1652,10 +1652,10 @@ static int WriteSolution(N_Vector u, UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); // Write solution and error to disk - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype i = 0; i < udata->nodes_loc; i++) @@ -1685,7 +1685,7 @@ static int OpenResOutput(UserData *udata) udata->rout.open(fname.str()); udata->rout << scientific; - udata->rout << setprecision(numeric_limits::digits10); + udata->rout << setprecision(numeric_limits::digits10); } return 0; @@ -1695,7 +1695,7 @@ static int WriteResOutput(UserData *udata) { bool outproc = (udata->myid_c == 0); - realtype res = N_VDotProd(udata->e, udata->e); + sunrealtype res = N_VDotProd(udata->e, udata->e); if (outproc) { diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp index dfdb220127..ce80188b2b 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp @@ -49,11 +49,11 @@ using namespace std; struct UserData { // Exponential term coefficient - realtype C; + sunrealtype C; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -63,8 +63,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -101,9 +101,9 @@ struct UserData int ipN; // Fixed Point Solver settings - realtype rtol; // relative tolerance + sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration - realtype damping; // daming for Anderson Acceleration + sunrealtype damping; // daming for Anderson Acceleration int orthaa; // orthogonalization routine for AA int maxits; // max number of fixed point iterations @@ -111,7 +111,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // Linear solver object SUNLinearSolver LS; // linear solver memory structure @@ -175,7 +175,7 @@ static int JTimes(void *user_data, N_Vector v, N_Vector Jv); static int PSetup(void *user_data); static int PSolve(void *user_data, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); // ----------------------------------------------------------------------------- // Helper functions diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp index 1cb74e17ca..f3a3d1023d 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp @@ -253,12 +253,12 @@ int main(int argc, char* argv[]) retval = SolutionError(u, udata->e, udata); if (check_retval(&retval, "SolutionError", 1)) return 1; - realtype maxerr = N_VMaxNorm(udata->e); + sunrealtype maxerr = N_VMaxNorm(udata->e); if (outproc) { cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " Max error = " << maxerr << endl; } @@ -399,23 +399,23 @@ static int SetupDecomp(MPI_Comm comm_w, UserData *udata) // Allocate exchange buffers if necessary if (udata->HaveNbrW) { - udata->Wrecv = new realtype[udata->ny_loc]; - udata->Wsend = new realtype[udata->ny_loc]; + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrE) { - udata->Erecv = new realtype[udata->ny_loc]; - udata->Esend = new realtype[udata->ny_loc]; + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; } if (udata->HaveNbrS) { - udata->Srecv = new realtype[udata->nx_loc]; - udata->Ssend = new realtype[udata->nx_loc]; + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; } if (udata->HaveNbrN) { - udata->Nrecv = new realtype[udata->nx_loc]; - udata->Nsend = new realtype[udata->nx_loc]; + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; } // MPI neighborhood information @@ -588,19 +588,19 @@ static int SetupRHS(void *user_data) // ---------------------- // Access data array - realtype *barray = N_VGetArrayPointer(udata->b); + sunrealtype *barray = N_VGetArrayPointer(udata->b); if (check_retval((void *) barray, "N_VGetArrayPointer", 0)) return 1; // Initialize rhs vector to zero (handles boundary conditions) N_VConst(ZERO, udata->b); // Iterate over subdomain and compute forcing term (b) - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; - realtype cos_sqr_x, cos_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; - realtype bx = (udata->kx) * TWO * PI * PI; - realtype by = (udata->ky) * TWO * PI * PI; + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; for (j = jstart; j < jend; j++) { @@ -654,17 +654,17 @@ static int c(N_Vector u, N_Vector z, void *user_data) sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; // Access data arrays - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return 1; - realtype *zarray = N_VGetArrayPointer(z); + sunrealtype *zarray = N_VGetArrayPointer(z); if (check_retval((void *) zarray, "N_VGetArrayPointer", 0)) return 1; // Initialize rhs vector to zero (handles boundary conditions) N_VConst(ZERO, z); // Iterate over subdomain and compute z = c(u) - realtype u_val; + sunrealtype u_val; for (j = jstart; j < jend; j++) { @@ -848,7 +848,7 @@ static int PSetup(void *user_data) // Preconditioner solve routine for Pz = r static int PSolve(void *user_data, N_Vector r, N_Vector z, - realtype tol, int lr) + sunrealtype tol, int lr) { int retval; @@ -1108,9 +1108,9 @@ static int Jac(UserData *udata) (ilower[1] <= iupper[1])) { // Jacobian values - realtype cx = udata->kx / (udata->dx * udata->dx); - realtype cy = udata->ky / (udata->dy * udata->dy); - realtype cc = -TWO * (cx + cy); + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); // -------------------------------- // Set matrix values for all nodes @@ -1695,8 +1695,8 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) // Compute the exact solution static int Solution(N_Vector u, UserData *udata) { - realtype x, y; - realtype sin_sqr_x, sin_sqr_y; + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; // Initialize u to zero (handles boundary conditions) N_VConst(ZERO, u); @@ -1708,7 +1708,7 @@ static int Solution(N_Vector u, UserData *udata) sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return 1; for (sunindextype j = jstart; j < jend; j++) @@ -1922,10 +1922,10 @@ static int WriteSolution(N_Vector u, UserData *udata) udata->uout.open(fname.str()); udata->uout << scientific; - udata->uout << setprecision(numeric_limits::digits10); + udata->uout << setprecision(numeric_limits::digits10); // Write solution and error to disk - realtype *uarray = N_VGetArrayPointer(u); + sunrealtype *uarray = N_VGetArrayPointer(u); if (check_retval((void *) uarray, "N_VGetArrayPointer", 0)) return -1; for (sunindextype i = 0; i < udata->nodes_loc; i++) @@ -1955,7 +1955,7 @@ static int OpenOutput(UserData *udata) udata->rout.open(fname.str()); udata->rout << scientific; - udata->rout << setprecision(numeric_limits::digits10); + udata->rout << setprecision(numeric_limits::digits10); // Open output stream for error fname.str(""); @@ -1964,7 +1964,7 @@ static int OpenOutput(UserData *udata) udata->eout.open(fname.str()); udata->eout << scientific; - udata->eout << setprecision(numeric_limits::digits10); + udata->eout << setprecision(numeric_limits::digits10); } return 0; @@ -1977,12 +1977,12 @@ static int WriteOutput(N_Vector u, N_Vector f, UserData *udata) // r = \|G(u) - u\|_2 N_VLinearSum(ONE, f, -ONE, u, udata->e); - realtype res = N_VDotProd(udata->e, udata->e); + sunrealtype res = N_VDotProd(udata->e, udata->e); // e = \|u_exact - u\|_2 retval = SolutionError(u, udata->e, udata); if (check_retval(&retval, "SolutionError", 1)) return 1; - realtype err = N_VDotProd(udata->e, udata->e); + sunrealtype err = N_VDotProd(udata->e, udata->e); if (outproc) { diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp index 409ae447a3..fb5e3b7204 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp @@ -41,7 +41,7 @@ #define IDX(x,y,n) ((n)*(y)+(x)) // Define c function type -typedef realtype (*cFn)(realtype u_val); +typedef sunrealtype (*cFn)(sunrealtype u_val); using namespace std; @@ -52,15 +52,15 @@ using namespace std; struct UserData { // Diffusion coefficients in the x and y directions - realtype kx; - realtype ky; + sunrealtype kx; + sunrealtype ky; // Enable/disable forcing bool forcing; // Upper bounds in x and y directions - realtype xu; - realtype yu; + sunrealtype xu; + sunrealtype yu; // Global number of nodes in the x and y directions sunindextype nx; @@ -70,8 +70,8 @@ struct UserData sunindextype nodes; // Mesh spacing in the x and y directions - realtype dx; - realtype dy; + sunrealtype dx; + sunrealtype dy; // Local number of nodes in the x and y directions sunindextype nx_loc; @@ -108,10 +108,10 @@ struct UserData int ipN; // Receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Erecv; - realtype *Srecv; - realtype *Nrecv; + sunrealtype *Wrecv; + sunrealtype *Erecv; + sunrealtype *Srecv; + sunrealtype *Nrecv; // Receive requests for neighbor exchange MPI_Request reqRW; @@ -120,10 +120,10 @@ struct UserData MPI_Request reqRN; // Send buffers for neighbor exchange - realtype *Wsend; - realtype *Esend; - realtype *Ssend; - realtype *Nsend; + sunrealtype *Wsend; + sunrealtype *Esend; + sunrealtype *Ssend; + sunrealtype *Nsend; // Send requests for neighor exchange MPI_Request reqSW; @@ -132,9 +132,9 @@ struct UserData MPI_Request reqSN; // Fixed Point Solver settings - realtype rtol; // relative tolerance + sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration - realtype damping; // daming for Anderson Acceleration + sunrealtype damping; // daming for Anderson Acceleration int orthaa; // orthogonalization routine for AA int maxits; // max number of fixed point iterations @@ -142,7 +142,7 @@ struct UserData bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups - realtype epslin; // linear solver tolerance factor + sunrealtype epslin; // linear solver tolerance factor // Linear solver object SUNLinearSolver LS; // linear solver memory structure @@ -218,7 +218,7 @@ static int JTimes(void *user_data, N_Vector v, N_Vector Jv); static int PSetup(void *user_data); static int PSolve(void *user_data, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); // ----------------------------------------------------------------------------- // Helper functions @@ -293,125 +293,125 @@ static int check_retval(void *flagvalue, const string funcname, int opt); // ----------------------------------------------------------------------------- // c(u) = u -realtype c1(realtype u_val) +sunrealtype c1(sunrealtype u_val) { return u_val; } // c(u) = u^3 - u -realtype c2(realtype u_val) +sunrealtype c2(sunrealtype u_val) { return u_val * u_val * u_val - u_val; } // c(u) = u - u^2 -realtype c3(realtype u_val) +sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } // c(u) = e^u -realtype c4(realtype u_val) +sunrealtype c4(sunrealtype u_val) { return exp(u_val); } // c(u) = u^4 -realtype c5(realtype u_val) +sunrealtype c5(sunrealtype u_val) { return u_val * u_val * u_val * u_val; } // c(u) = cos^2(u) - sin^2(u) -realtype c6(realtype u_val) +sunrealtype c6(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)); } // c(u) = cos^2(u) - sin^2(u) - e^u -realtype c7(realtype u_val) +sunrealtype c7(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)) - exp(u_val); } // c(u) = e^u * u^4 - u * e^{cos(u)} -realtype c8(realtype u_val) +sunrealtype c8(sunrealtype u_val) { - realtype u2 = u_val * u_val; + sunrealtype u2 = u_val * u_val; return exp(u_val) * u2 * u2 - u_val * exp(cos(u_val)); } // c(u) = e^(cos^2(u)) -realtype c9(realtype u_val) +sunrealtype c9(sunrealtype u_val) { - realtype cos2u = cos(u_val) * cos(u_val); + sunrealtype cos2u = cos(u_val) * cos(u_val); return exp(cos2u); } // c(u) = 10(u - u^2) -realtype c10(realtype u_val) +sunrealtype c10(sunrealtype u_val) { - realtype u2 = u_val * u_val; + sunrealtype u2 = u_val * u_val; return 10.0 * (u_val - u2); } // c(u) = -13 + u + ((5-u)u - 2)u -realtype c11(realtype u_val) +sunrealtype c11(sunrealtype u_val) { - realtype temp = ((5.0 - u_val) * u_val) - 2.0; + sunrealtype temp = ((5.0 - u_val) * u_val) - 2.0; return -13.0 + u_val + temp * u_val; } // c(u) = sqrt(5) * (u - u^2) -realtype c12(realtype u_val) +sunrealtype c12(sunrealtype u_val) { - realtype temp = sqrt(5); - realtype u2 = u_val * u_val; + sunrealtype temp = sqrt(5); + sunrealtype u2 = u_val * u_val; return temp * (u_val - u2); } // c(u) = (u - e^u)^2 + (u + u * sin(u) - cos(u))^2 -realtype c13(realtype u_val) +sunrealtype c13(sunrealtype u_val) { - realtype eu = u_val - exp(u_val); - realtype usin = u_val * sin(u_val); - realtype temp = (u_val + usin - cos(u_val)); + sunrealtype eu = u_val - exp(u_val); + sunrealtype usin = u_val * sin(u_val); + sunrealtype temp = (u_val + usin - cos(u_val)); return eu * eu + temp * temp; } // c(u) = u + ue^u + ue^{-u} -realtype c14(realtype u_val) +sunrealtype c14(sunrealtype u_val) { - realtype ueu = u_val * exp(u_val); - realtype ue_u = u_val * exp(-u_val); + sunrealtype ueu = u_val * exp(u_val); + sunrealtype ue_u = u_val * exp(-u_val); return u_val + ueu + ue_u; } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 -realtype c15(realtype u_val) +sunrealtype c15(sunrealtype u_val) { - realtype ueu = u_val * exp(u_val); - realtype ue_u = u_val * exp(-u_val); - realtype temp = u_val - exp(u_val); + sunrealtype ueu = u_val * exp(u_val); + sunrealtype ue_u = u_val * exp(-u_val); + sunrealtype temp = u_val - exp(u_val); return u_val + ueu + ue_u + (temp * temp); } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 + (u + usin(u) - cos(u))^2 -realtype c16(realtype u_val) +sunrealtype c16(sunrealtype u_val) { - realtype ueu = u_val * exp(u_val); - realtype ue_u = u_val * exp(-u_val); - realtype temp = u_val - exp(u_val); - realtype temp2 = u_val + (u_val * sin(u_val)) - cos(u_val); + sunrealtype ueu = u_val * exp(u_val); + sunrealtype ue_u = u_val * exp(-u_val); + sunrealtype temp = u_val - exp(u_val); + sunrealtype temp2 = u_val + (u_val * sin(u_val)) - cos(u_val); return u_val + ueu + ue_u + (temp * temp) + (temp2 * temp2); } // c(u) = u + ue^{-u} + e^u*(u + sin(u) - cos(u))^3 -realtype c17(realtype u_val) +sunrealtype c17(sunrealtype u_val) { - realtype ue_u = u_val * exp(-u_val); - realtype eu = exp(u_val); - realtype temp = u_val + sin(u_val) - cos(u_val); + sunrealtype ue_u = u_val * exp(-u_val); + sunrealtype eu = exp(u_val); + sunrealtype temp = u_val + sin(u_val) - cos(u_val); return u_val + ue_u + eu * (temp * temp * temp); } diff --git a/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c b/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c index 84f81469b0..fae8fb634c 100644 --- a/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c +++ b/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c @@ -106,7 +106,7 @@ #include /* access to OpenMP N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #ifdef _OPENMP #include @@ -160,13 +160,13 @@ contains preconditioner blocks, pivot arrays, and problem constants */ typedef struct { - realtype **P[MX][MY]; + sunrealtype **P[MX][MY]; sunindextype *pivot[MX][MY]; - realtype **acoef, *bcoef; + sunrealtype **acoef, *bcoef; N_Vector rates; - realtype *cox, *coy; - realtype ax, ay, dx, dy; - realtype uround, sqruround; + sunrealtype *cox, *coy; + sunrealtype ax, ay, dx, dy; + sunrealtype uround, sqruround; sunindextype mx, my, ns, np; int nthreads; } *UserData; @@ -190,12 +190,12 @@ static void InitUserData(UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector cc, N_Vector sc); static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol); + sunrealtype fnormtol, sunrealtype scsteptol); static void PrintOutput(N_Vector cc); static void PrintFinalStats(void *kmem); -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data); -static realtype DotProd(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype DotProd(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *retvalvalue, const char *funcname, int opt); /* @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) { SUNContext sunctx; int globalstrategy; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector cc, sc, constraints; UserData data; int retval, maxl, maxlrst; @@ -346,7 +346,7 @@ int main(int argc, char *argv[]) static int func(N_Vector cc, N_Vector fval, void *user_data) { - realtype xx, yy, delx, dely, *cxy, *rxy, *fxy, dcyli, dcyui, dcxli, dcxri; + sunrealtype xx, yy, delx, dely, *cxy, *rxy, *fxy, dcyli, dcyui, dcxli, dcxri; sunindextype jx, jy, is, idyu, idyl, idxr, idxl; UserData data; @@ -409,8 +409,8 @@ static int PrecSetupBD(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, void *user_data) { - realtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; - realtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; + sunrealtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; + sunrealtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; sunindextype i, j, jx, jy, ret; UserData data; @@ -478,7 +478,7 @@ static int PrecSolveBD(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, N_Vector vv, void *user_data) { - realtype **Pxy, *vxy; + sunrealtype **Pxy, *vxy; sunindextype *piv, jx, jy; UserData data; @@ -511,11 +511,11 @@ static int PrecSolveBD(N_Vector cc, N_Vector cscale, * Interaction rate function routine */ -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data) { sunindextype i; - realtype fac; + sunrealtype fac; UserData data; data = (UserData)user_data; @@ -531,13 +531,13 @@ static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * Dot product routine for realtype arrays + * Dot product routine for sunrealtype arrays */ -static realtype DotProd(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype DotProd(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); @@ -570,9 +570,9 @@ static UserData AllocUserData(void) } acoef = SUNDlsMat_newDenseMat(NUM_SPECIES, NUM_SPECIES); - bcoef = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - cox = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - coy = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); + bcoef = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + cox = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + coy = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); return(data); } @@ -584,7 +584,7 @@ static UserData AllocUserData(void) static void InitUserData(UserData data) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; data->mx = MX; data->my = MY; @@ -661,8 +661,8 @@ static void FreeUserData(UserData data) static void SetInitialProfiles(N_Vector cc, N_Vector sc) { int i, jx, jy; - realtype *cloc, *sloc; - realtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; + sunrealtype *cloc, *sloc; + sunrealtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; /* Initialize arrays ctemp and stemp used in the loading process */ for (i = 0; i < NUM_SPECIES/2; i++) { @@ -692,7 +692,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) */ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol) + sunrealtype fnormtol, sunrealtype scsteptol) { printf("\nPredator-prey test problem -- KINSol (OpenMP version)\n\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -738,7 +738,7 @@ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, static void PrintOutput(N_Vector cc) { int is, jx, jy; - realtype *ct; + sunrealtype *ct; jy = 0; jx = 0; ct = IJ_Vptr(cc,jx,jy); diff --git a/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c b/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c index 86af4b0c2a..a45642e13d 100644 --- a/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c +++ b/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c @@ -97,7 +97,7 @@ #include /* access to SPGMR SUNLinearSolver */ #include /* access to BBD preconditioner */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNMAX, SUNRabs, SUNRsqrt */ #include @@ -148,13 +148,13 @@ contains problem constants and extended array */ typedef struct { - realtype **acoef, *bcoef; + sunrealtype **acoef, *bcoef; N_Vector rates; - realtype *cox, *coy; - realtype ax, ay, dx, dy; + sunrealtype *cox, *coy; + sunrealtype ax, ay, dx, dy; sunindextype Nlocal; int mx, my, ns, np; - realtype cext[NUM_SPECIES * (MXSUB+2)*(MYSUB+2)]; + sunrealtype cext[NUM_SPECIES * (MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby, nsmxsub, nsmxsub2; MPI_Comm comm; } *UserData; @@ -176,22 +176,22 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc); static void PrintHeader(int globalstrategy, int maxl, int maxlrst, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype fnormtol, realtype scsteptol); + sunrealtype fnormtol, sunrealtype scsteptol); static void PrintOutput(int my_pe, MPI_Comm comm, N_Vector cc); static void PrintFinalStats(void *kmem); -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data); -static realtype DotProd(int size, realtype *x1, realtype *x2); +static sunrealtype DotProd(int size, sunrealtype *x1, sunrealtype *x2); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, int dsizex, int dsizey, - realtype *cdata); + sunrealtype *cdata); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, int dsizex, int dsizey, - realtype *cext, realtype *buffer); + sunrealtype *cext, sunrealtype *buffer); static void BRecvWait(MPI_Request request[], int isubx, - int isuby, int dsizex, realtype *cext, - realtype *buffer); + int isuby, int dsizex, sunrealtype *cext, + sunrealtype *buffer); static int check_retval(void *retvalvalue, const char *funcname, int opt, int id); /* @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) SUNContext sunctx; int globalstrategy; sunindextype Nlocal; - realtype fnormtol, scsteptol, dq_rel_uu; + sunrealtype fnormtol, scsteptol, dq_rel_uu; N_Vector cc, sc, constraints; UserData data; int retval, maxl, maxlrst; @@ -368,7 +368,7 @@ int main(int argc, char *argv[]) static int ccomm(sunindextype Nlocal, N_Vector cc, void *userdata) { - realtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cdata, *cext, buffer[2*NUM_SPECIES*MYSUB]; UserData data; MPI_Comm comm; int my_pe, isubx, isuby, nsmxsub, nsmysub; @@ -402,8 +402,8 @@ static int ccomm(sunindextype Nlocal, N_Vector cc, void *userdata) static int func_local(sunindextype Nlocal, N_Vector cc, N_Vector fval, void *user_data) { - realtype xx, yy, *cxy, *rxy, *fxy, dcydi, dcyui, dcxli, dcxri; - realtype *cext, dely, delx, *cdata; + sunrealtype xx, yy, *cxy, *rxy, *fxy, dcydi, dcyui, dcxli, dcxri; + sunrealtype *cext, dely, delx, *cdata; int i, jx, jy, is, ly; int isubx, isuby, nsmxsub, nsmxsub2; int shifty, offsetc, offsetce, offsetcl, offsetcr, offsetcd, offsetcu; @@ -531,11 +531,11 @@ static int func(N_Vector cc, N_Vector fval, void *user_data) * Interaction rate function routine */ -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data) { int i; - realtype fac; + sunrealtype fac; UserData data; data = (UserData)user_data; @@ -550,13 +550,13 @@ static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * Dot product routine for realtype arrays + * Dot product routine for sunrealtype arrays */ -static realtype DotProd(int size, realtype *x1, realtype *x2) +static sunrealtype DotProd(int size, sunrealtype *x1, sunrealtype *x2) { int i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); @@ -581,9 +581,9 @@ static UserData AllocUserData(void) data = (UserData) malloc(sizeof *data); acoef = SUNDlsMat_newDenseMat(NUM_SPECIES, NUM_SPECIES); - bcoef = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - cox = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - coy = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); + bcoef = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + cox = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + coy = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); return(data); } @@ -595,7 +595,7 @@ static UserData AllocUserData(void) static void InitUserData(int my_pe, sunindextype Nlocal, MPI_Comm comm, UserData data) { int i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; data->mx = MX; data->my = MY; @@ -670,8 +670,8 @@ static void FreeUserData(UserData data) static void SetInitialProfiles(N_Vector cc, N_Vector sc) { int i, jx, jy; - realtype *cloc, *sloc; - realtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; + sunrealtype *cloc, *sloc; + sunrealtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; /* Initialize arrays ctemp and stemp used in the loading process */ for (i = 0; i < NUM_SPECIES/2; i++) { @@ -704,7 +704,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) static void PrintHeader(int globalstrategy, int maxl, int maxlrst, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype fnormtol, realtype scsteptol) + sunrealtype fnormtol, sunrealtype scsteptol) { printf("\nPredator-prey test problem-- KINSol (parallel-BBD version)\n\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -752,7 +752,7 @@ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, static void PrintOutput(int my_pe, MPI_Comm comm, N_Vector cc) { int is, i0, npelast; - realtype *ct, tempc[NUM_SPECIES]; + sunrealtype *ct, tempc[NUM_SPECIES]; MPI_Status status; npelast = NPEX*NPEY - 1; @@ -839,11 +839,11 @@ static void PrintFinalStats(void *kmem) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, - int dsizex, int dsizey, realtype *cdata) + int dsizex, int dsizey, sunrealtype *cdata) { int i, ly; int offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -881,7 +881,7 @@ static void BSend(MPI_Comm comm, int my_pe, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in both calls also. @@ -890,12 +890,12 @@ static void BSend(MPI_Comm comm, int my_pe, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, int dsizex, int dsizey, - realtype *cext, realtype *buffer) + sunrealtype *cext, sunrealtype *buffer) { int offsetce; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If isuby > 0, receive data for bottom x-line of cext */ if (isuby != 0) @@ -925,19 +925,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, - int isuby, int dsizex, realtype *cext, - realtype *buffer) + int isuby, int dsizex, sunrealtype *cext, + sunrealtype *buffer) { int i, ly; int dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; diff --git a/examples/kinsol/parallel/kinFoodWeb_kry_p.c b/examples/kinsol/parallel/kinFoodWeb_kry_p.c index cca1534907..51682a272b 100644 --- a/examples/kinsol/parallel/kinFoodWeb_kry_p.c +++ b/examples/kinsol/parallel/kinFoodWeb_kry_p.c @@ -91,7 +91,7 @@ #include /* access to MPI parallel N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include @@ -147,15 +147,15 @@ contains preconditioner blocks, pivot arrays, and problem constants */ typedef struct { - realtype **P[MXSUB][MYSUB]; + sunrealtype **P[MXSUB][MYSUB]; sunindextype *pivot[MXSUB][MYSUB]; - realtype **acoef, *bcoef; + sunrealtype **acoef, *bcoef; N_Vector rates; - realtype *cox, *coy; - realtype ax, ay, dx, dy; - realtype uround, sqruround; + sunrealtype *cox, *coy; + sunrealtype ax, ay, dx, dy; + sunrealtype uround, sqruround; int mx, my, ns, np; - realtype cext[NUM_SPECIES * (MXSUB+2)*(MYSUB+2)]; + sunrealtype cext[NUM_SPECIES * (MXSUB+2)*(MYSUB+2)]; int my_pe, isubx, isuby, nsmxsub, nsmxsub2; MPI_Comm comm; } *UserData; @@ -179,23 +179,23 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector cc, N_Vector sc); static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol); + sunrealtype fnormtol, sunrealtype scsteptol); static void PrintOutput(int my_pe, MPI_Comm comm, N_Vector cc); static void PrintFinalStats(void *kmem); -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data); -static realtype DotProd(int size, realtype *x1, realtype *x2); +static sunrealtype DotProd(int size, sunrealtype *x1, sunrealtype *x2); static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, int dsizex, - int dsizey, realtype *cdata); + int dsizey, sunrealtype *cdata); static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, int dsizex, int dsizey, - realtype *cext, realtype *buffer); + sunrealtype *cext, sunrealtype *buffer); static void BRecvWait(MPI_Request request[], int isubx, - int isuby, int dsizex, realtype *cext, - realtype *buffer); -static void ccomm(realtype *cdata, UserData data); + int isuby, int dsizex, sunrealtype *cext, + sunrealtype *buffer); +static void ccomm(sunrealtype *cdata, UserData data); static void fcalcprpr(N_Vector cc, N_Vector fval,void *user_data); static int check_retval(void *retvalvalue, const char *funcname, int opt, int id); @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) SUNContext sunctx; int globalstrategy; sunindextype local_N; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector cc, sc, constraints; UserData data; int retval, maxl, maxlrst; @@ -364,7 +364,7 @@ int main(int argc, char *argv[]) static int funcprpr(N_Vector cc, N_Vector fval, void *user_data) { - realtype *cdata; + sunrealtype *cdata; UserData data; cdata = N_VGetArrayPointer(cc); @@ -387,8 +387,8 @@ static int Precondbd(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, void *user_data) { - realtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; - realtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; + sunrealtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; + sunrealtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; int i, j, jx, jy; sunindextype ret; UserData data; @@ -453,7 +453,7 @@ static int PSolvebd(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, N_Vector vv, void *user_data) { - realtype **Pxy, *vxy; + sunrealtype **Pxy, *vxy; sunindextype *piv, jx, jy; UserData data; @@ -483,11 +483,11 @@ static int PSolvebd(N_Vector cc, N_Vector cscale, * Interaction rate function routine */ -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data) { int i; - realtype fac; + sunrealtype fac; UserData data; data = (UserData) user_data; @@ -502,13 +502,13 @@ static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * Dot product routine for realtype arrays + * Dot product routine for sunrealtype arrays */ -static realtype DotProd(int size, realtype *x1, realtype *x2) +static sunrealtype DotProd(int size, sunrealtype *x1, sunrealtype *x2) { int i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); @@ -541,9 +541,9 @@ static UserData AllocUserData(void) } acoef = SUNDlsMat_newDenseMat(NUM_SPECIES, NUM_SPECIES); - bcoef = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - cox = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - coy = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); + bcoef = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + cox = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + coy = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); return(data); } @@ -555,7 +555,7 @@ static UserData AllocUserData(void) static void InitUserData(int my_pe, MPI_Comm comm, UserData data) { int i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; data->mx = MX; data->my = MY; @@ -638,8 +638,8 @@ static void FreeUserData(UserData data) static void SetInitialProfiles(N_Vector cc, N_Vector sc) { int i, jx, jy; - realtype *cloc, *sloc; - realtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; + sunrealtype *cloc, *sloc; + sunrealtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; /* Initialize arrays ctemp and stemp used in the loading process */ for (i = 0; i < NUM_SPECIES/2; i++) { @@ -669,7 +669,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) */ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol) + sunrealtype fnormtol, sunrealtype scsteptol) { printf("\nPredator-prey test problem -- KINSol (parallel version)\n\n"); @@ -718,7 +718,7 @@ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, static void PrintOutput(int my_pe, MPI_Comm comm, N_Vector cc) { int is, i0, npelast; - realtype *ct, tempc[NUM_SPECIES]; + sunrealtype *ct, tempc[NUM_SPECIES]; MPI_Status status; npelast = NPEX*NPEY - 1; @@ -805,11 +805,11 @@ static void PrintFinalStats(void *kmem) static void BSend(MPI_Comm comm, int my_pe, int isubx, int isuby, - int dsizex, int dsizey, realtype *cdata) + int dsizex, int dsizey, sunrealtype *cdata) { int i, ly; int offsetc, offsetbuf; - realtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; + sunrealtype bufleft[NUM_SPECIES*MYSUB], bufright[NUM_SPECIES*MYSUB]; /* If isuby > 0, send data from bottom x-line of u */ if (isuby != 0) @@ -847,7 +847,7 @@ static void BSend(MPI_Comm comm, int my_pe, /* * Routine to start receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in both calls also. @@ -856,12 +856,12 @@ static void BSend(MPI_Comm comm, int my_pe, static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, int isubx, int isuby, int dsizex, int dsizey, - realtype *cext, realtype *buffer) + sunrealtype *cext, sunrealtype *buffer) { int offsetce; /* Have bufleft and bufright use the same buffer */ - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; /* If isuby > 0, receive data for bottom x-line of cext */ if (isuby != 0) @@ -891,19 +891,19 @@ static void BRecvPost(MPI_Comm comm, MPI_Request request[], int my_pe, /* * Routine to finish receiving boundary data from neighboring PEs. * Notes: - * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB realtype entries, + * 1) buffer should be able to hold 2*NUM_SPECIES*MYSUB sunrealtype entries, * should be passed to both the BRecvPost and BRecvWait functions, and * should not be manipulated between the two calls. * 2) request should have 4 entries, and should be passed in both calls also. */ static void BRecvWait(MPI_Request request[], int isubx, - int isuby, int dsizex, realtype *cext, - realtype *buffer) + int isuby, int dsizex, sunrealtype *cext, + sunrealtype *buffer) { int i, ly; int dsizex2, offsetce, offsetbuf; - realtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; + sunrealtype *bufleft = buffer, *bufright = buffer+NUM_SPECIES*MYSUB; MPI_Status status; dsizex2 = dsizex + 2*NUM_SPECIES; @@ -948,9 +948,9 @@ static void BRecvWait(MPI_Request request[], int isubx, * between processors of data needed to calculate f. */ -static void ccomm(realtype *cdata, UserData data) +static void ccomm(sunrealtype *cdata, UserData data) { - realtype *cext, buffer[2*NUM_SPECIES*MYSUB]; + sunrealtype *cext, buffer[2*NUM_SPECIES*MYSUB]; MPI_Comm comm; int my_pe, isubx, isuby, nsmxsub, nsmysub; MPI_Request request[4]; @@ -979,8 +979,8 @@ static void ccomm(realtype *cdata, UserData data) static void fcalcprpr(N_Vector cc, N_Vector fval, void *user_data) { - realtype xx, yy, *cxy, *rxy, *fxy, dcydi, dcyui, dcxli, dcxri; - realtype *cext, dely, delx, *cdata; + sunrealtype xx, yy, *cxy, *rxy, *fxy, dcydi, dcyui, dcxli, dcxri; + sunrealtype *cext, dely, delx, *cdata; int i, jx, jy, is, ly; int isubx, isuby, nsmxsub, nsmxsub2; int shifty, offsetc, offsetce, offsetcl, offsetcr, offsetcd, offsetcu; diff --git a/examples/kinsol/serial/kinAnalytic_fp.c b/examples/kinsol/serial/kinAnalytic_fp.c index c635dcb520..090a561149 100644 --- a/examples/kinsol/serial/kinAnalytic_fp.c +++ b/examples/kinsol/serial/kinAnalytic_fp.c @@ -95,20 +95,20 @@ /* problem options */ typedef struct { - realtype tol; /* solve tolerance */ + sunrealtype tol; /* solve tolerance */ long int maxiter; /* max number of iterations */ long int m_aa; /* number of acceleration vectors */ long int delay_aa; /* number of iterations to delay AA */ int orth_aa; /* orthogonalization method */ - realtype damping_fp; /* damping parameter for FP */ - realtype damping_aa; /* damping parameter for AA */ + sunrealtype damping_fp; /* damping parameter for FP */ + sunrealtype damping_aa; /* damping parameter for AA */ } *UserOpt; /* Nonlinear fixed point function */ static int FPFunction(N_Vector u, N_Vector f, void *user_data); /* Check the system solution */ -static int check_ans(N_Vector u, realtype tol); +static int check_ans(N_Vector u, sunrealtype tol); /* Set default options */ static int SetDefaults(UserOpt *uopt); @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) N_Vector scale = NULL; /* scaling vector */ FILE* infofp = NULL; /* KINSOL log file */ long int nni, nfe; /* solver outputs */ - realtype* data; /* vector data array */ + sunrealtype* data; /* vector data array */ void* kmem; /* KINSOL memory */ /* Set default options */ @@ -316,9 +316,9 @@ int main(int argc, char *argv[]) * ---------------------------------------------------------------------------*/ int FPFunction(N_Vector u, N_Vector g, void* user_data) { - realtype* udata = NULL; - realtype* gdata = NULL; - realtype x, y, z; + sunrealtype* udata = NULL; + sunrealtype* gdata = NULL; + sunrealtype x, y, z; /* Get vector data arrays */ udata = N_VGetArrayPointer(u); @@ -341,10 +341,10 @@ int FPFunction(N_Vector u, N_Vector g, void* user_data) /* ----------------------------------------------------------------------------- * Check the solution of the nonlinear system and return PASS or FAIL * ---------------------------------------------------------------------------*/ -static int check_ans(N_Vector u, realtype tol) +static int check_ans(N_Vector u, sunrealtype tol) { - realtype* data = NULL; - realtype ex, ey, ez; + sunrealtype* data = NULL; + sunrealtype ex, ey, ez; /* Get vector data array */ data = N_VGetArrayPointer(u); diff --git a/examples/kinsol/serial/kinFerTron_dns.c b/examples/kinsol/serial/kinFerTron_dns.c index d0e28f348c..32bf329b7e 100644 --- a/examples/kinsol/serial/kinFerTron_dns.c +++ b/examples/kinsol/serial/kinFerTron_dns.c @@ -57,7 +57,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* Problem Constants */ @@ -78,8 +78,8 @@ #define E RCONST(2.7182818) typedef struct { - realtype lb[NVAR]; - realtype ub[NVAR]; + sunrealtype lb[NVAR]; + sunrealtype ub[NVAR]; } *UserData; /* Accessor macro */ @@ -92,7 +92,7 @@ static int func(N_Vector u, N_Vector f, void *user_data); static void SetInitialGuess1(N_Vector u, UserData data); static void SetInitialGuess2(N_Vector u, UserData data); static int SolveIt(void *kmem, N_Vector u, N_Vector s, int glstr, int mset); -static void PrintHeader(realtype fnormtol, realtype scsteptol); +static void PrintHeader(sunrealtype fnormtol, sunrealtype scsteptol); static void PrintOutput(N_Vector u); static void PrintFinalStats(void *kmem); static int check_retval(void *retvalvalue, const char *funcname, int opt); @@ -107,7 +107,7 @@ int main() { SUNContext sunctx; UserData data; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector u1, u2, u, s, c; int glstr, mset, retval; void *kmem; @@ -324,9 +324,9 @@ static int SolveIt(void *kmem, N_Vector u, N_Vector s, int glstr, int mset) static int func(N_Vector u, N_Vector f, void *user_data) { - realtype *udata, *fdata; - realtype x1, l1, L1, x2, l2, L2; - realtype *lb, *ub; + sunrealtype *udata, *fdata; + sunrealtype x1, l1, L1, x2, l2, L2; + sunrealtype *lb, *ub; UserData data; data = (UserData)user_data; @@ -365,9 +365,9 @@ static int func(N_Vector u, N_Vector f, void *user_data) static void SetInitialGuess1(N_Vector u, UserData data) { - realtype x1, x2; - realtype *udata; - realtype *lb, *ub; + sunrealtype x1, x2; + sunrealtype *udata; + sunrealtype *lb, *ub; udata = N_VGetArrayPointer(u); @@ -390,9 +390,9 @@ static void SetInitialGuess1(N_Vector u, UserData data) static void SetInitialGuess2(N_Vector u, UserData data) { - realtype x1, x2; - realtype *udata; - realtype *lb, *ub; + sunrealtype x1, x2; + sunrealtype *udata; + sunrealtype *lb, *ub; udata = N_VGetArrayPointer(u); @@ -417,7 +417,7 @@ static void SetInitialGuess2(N_Vector u, UserData data) * Print first lines of output (problem description) */ -static void PrintHeader(realtype fnormtol, realtype scsteptol) +static void PrintHeader(sunrealtype fnormtol, sunrealtype scsteptol) { printf("\nFerraris and Tronconi test problem\n"); printf("Tolerance parameters:\n"); diff --git a/examples/kinsol/serial/kinFerTron_klu.c b/examples/kinsol/serial/kinFerTron_klu.c index f3ea52a5b9..84f9857444 100644 --- a/examples/kinsol/serial/kinFerTron_klu.c +++ b/examples/kinsol/serial/kinFerTron_klu.c @@ -57,7 +57,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to KLU SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNRexp */ /* Problem Constants */ @@ -79,8 +79,8 @@ #define E RCONST(2.7182818) typedef struct { - realtype lb[NVAR]; - realtype ub[NVAR]; + sunrealtype lb[NVAR]; + sunrealtype ub[NVAR]; int nnz; } *UserData; @@ -93,7 +93,7 @@ static int jac(N_Vector y, N_Vector f, SUNMatrix J, static void SetInitialGuess1(N_Vector u, UserData data); static void SetInitialGuess2(N_Vector u, UserData data); static int SolveIt(void *kmem, N_Vector u, N_Vector s, int glstr, int mset); -static void PrintHeader(realtype fnormtol, realtype scsteptol); +static void PrintHeader(sunrealtype fnormtol, sunrealtype scsteptol); static void PrintOutput(N_Vector u); static void PrintFinalStats(void *kmem); static int check_retval(void *retvalvalue, const char *funcname, int opt); @@ -108,7 +108,7 @@ int main() { SUNContext sunctx; UserData data; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector u1, u2, u, s, c; int glstr, mset, retval; void *kmem; @@ -330,9 +330,9 @@ static int SolveIt(void *kmem, N_Vector u, N_Vector s, int glstr, int mset) static int func(N_Vector u, N_Vector f, void *user_data) { - realtype *udata, *fdata; - realtype x1, l1, L1, x2, l2, L2; - realtype *lb, *ub; + sunrealtype *udata, *fdata; + sunrealtype x1, l1, L1, x2, l2, L2; + sunrealtype *lb, *ub; UserData params; params = (UserData)user_data; @@ -367,10 +367,10 @@ static int func(N_Vector u, N_Vector f, void *user_data) static int jac(N_Vector y, N_Vector f, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2) { - realtype *yd; + sunrealtype *yd; sunindextype *rowptrs = SUNSparseMatrix_IndexPointers(J); sunindextype *colvals = SUNSparseMatrix_IndexValues(J); - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); yd = N_VGetArrayPointer(y); @@ -437,9 +437,9 @@ static int jac(N_Vector y, N_Vector f, SUNMatrix J, static void SetInitialGuess1(N_Vector u, UserData data) { - realtype x1, x2; - realtype *udata; - realtype *lb, *ub; + sunrealtype x1, x2; + sunrealtype *udata; + sunrealtype *lb, *ub; udata = N_VGetArrayPointer(u); @@ -462,9 +462,9 @@ static void SetInitialGuess1(N_Vector u, UserData data) static void SetInitialGuess2(N_Vector u, UserData data) { - realtype x1, x2; - realtype *udata; - realtype *lb, *ub; + sunrealtype x1, x2; + sunrealtype *udata; + sunrealtype *lb, *ub; udata = N_VGetArrayPointer(u); @@ -489,7 +489,7 @@ static void SetInitialGuess2(N_Vector u, UserData data) * Print first lines of output (problem description) */ -static void PrintHeader(realtype fnormtol, realtype scsteptol) +static void PrintHeader(sunrealtype fnormtol, sunrealtype scsteptol) { printf("\nFerraris and Tronconi test problem\n"); printf("Tolerance parameters:\n"); diff --git a/examples/kinsol/serial/kinFoodWeb_kry.c b/examples/kinsol/serial/kinFoodWeb_kry.c index 8b77f53672..ea2db603ff 100644 --- a/examples/kinsol/serial/kinFoodWeb_kry.c +++ b/examples/kinsol/serial/kinFoodWeb_kry.c @@ -91,7 +91,7 @@ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNMAX, SUNRabs, SUNRsqrt */ /* Problem Constants */ @@ -136,13 +136,13 @@ contains preconditioner blocks, pivot arrays, and problem constants */ typedef struct { - realtype **P[MX][MY]; + sunrealtype **P[MX][MY]; sunindextype *pivot[MX][MY]; - realtype **acoef, *bcoef; + sunrealtype **acoef, *bcoef; N_Vector rates; - realtype *cox, *coy; - realtype ax, ay, dx, dy; - realtype uround, sqruround; + sunrealtype *cox, *coy; + sunrealtype ax, ay, dx, dy; + sunrealtype uround, sqruround; sunindextype mx, my, ns, np; } *UserData; @@ -165,12 +165,12 @@ static void InitUserData(UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector cc, N_Vector sc); static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol); + sunrealtype fnormtol, sunrealtype scsteptol); static void PrintOutput(N_Vector cc); static void PrintFinalStats(void *kmem); -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data); -static realtype DotProd(sunindextype size, realtype *x1, realtype *x2); +static sunrealtype DotProd(sunindextype size, sunrealtype *x1, sunrealtype *x2); static int check_retval(void *retvalvalue, const char *funcname, int opt); /* @@ -183,7 +183,7 @@ int main(void) { SUNContext sunctx; int globalstrategy; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector cc, sc, constraints; UserData data; int retval, maxl, maxlrst; @@ -310,7 +310,7 @@ int main(void) static int func(N_Vector cc, N_Vector fval, void *user_data) { - realtype xx, yy, delx, dely, *cxy, *rxy, *fxy, dcyli, dcyui, dcxli, dcxri; + sunrealtype xx, yy, delx, dely, *cxy, *rxy, *fxy, dcyli, dcyui, dcxli, dcxri; sunindextype jx, jy, is, idyu, idyl, idxr, idxl; UserData data; @@ -373,8 +373,8 @@ static int PrecSetupBD(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, void *user_data) { - realtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; - realtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; + sunrealtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; + sunrealtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; sunindextype i, j, jx, jy, ret; UserData data; @@ -438,7 +438,7 @@ static int PrecSolveBD(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, N_Vector vv, void *user_data) { - realtype **Pxy, *vxy; + sunrealtype **Pxy, *vxy; sunindextype *piv, jx, jy; UserData data; @@ -468,11 +468,11 @@ static int PrecSolveBD(N_Vector cc, N_Vector cscale, * Interaction rate function routine */ -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data) { sunindextype i; - realtype fac; + sunrealtype fac; UserData data; data = (UserData)user_data; @@ -487,13 +487,13 @@ static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * Dot product routine for realtype arrays + * Dot product routine for sunrealtype arrays */ -static realtype DotProd(sunindextype size, realtype *x1, realtype *x2) +static sunrealtype DotProd(sunindextype size, sunrealtype *x1, sunrealtype *x2) { sunindextype i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); @@ -526,9 +526,9 @@ static UserData AllocUserData(void) } acoef = SUNDlsMat_newDenseMat(NUM_SPECIES, NUM_SPECIES); - bcoef = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - cox = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - coy = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); + bcoef = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + cox = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + coy = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); return(data); } @@ -540,7 +540,7 @@ static UserData AllocUserData(void) static void InitUserData(UserData data) { sunindextype i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; data->mx = MX; data->my = MY; @@ -617,8 +617,8 @@ static void FreeUserData(UserData data) static void SetInitialProfiles(N_Vector cc, N_Vector sc) { int i, jx, jy; - realtype *cloc, *sloc; - realtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; + sunrealtype *cloc, *sloc; + sunrealtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; /* Initialize arrays ctemp and stemp used in the loading process */ for (i = 0; i < NUM_SPECIES/2; i++) { @@ -648,7 +648,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) */ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol) + sunrealtype fnormtol, sunrealtype scsteptol) { printf("\nPredator-prey test problem -- KINSol (serial version)\n\n"); printf("Mesh dimensions = %d X %d\n", MX, MY); @@ -694,7 +694,7 @@ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, static void PrintOutput(N_Vector cc) { int is, jx, jy; - realtype *ct; + sunrealtype *ct; jy = 0; jx = 0; ct = IJ_Vptr(cc,jx,jy); diff --git a/examples/kinsol/serial/kinKrylovDemo_ls.c b/examples/kinsol/serial/kinKrylovDemo_ls.c index bd819b309a..09a0386142 100644 --- a/examples/kinsol/serial/kinKrylovDemo_ls.c +++ b/examples/kinsol/serial/kinKrylovDemo_ls.c @@ -98,7 +98,7 @@ #include /* access to SPTFQMR SUNLinearSolver */ #include /* access to SPFGMR SUNLinearSolver */ #include /* use generic dense solver in precond. */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ /* helpful macros */ @@ -155,13 +155,13 @@ contains preconditioner blocks, pivot arrays, and problem constants */ typedef struct { - realtype **P[MX][MY]; + sunrealtype **P[MX][MY]; sunindextype *pivot[MX][MY]; - realtype **acoef, *bcoef; + sunrealtype **acoef, *bcoef; N_Vector rates; - realtype *cox, *coy; - realtype ax, ay, dx, dy; - realtype uround, sqruround; + sunrealtype *cox, *coy; + sunrealtype ax, ay, dx, dy; + sunrealtype uround, sqruround; int mx, my, ns, np; } *UserData; @@ -184,13 +184,13 @@ static void InitUserData(UserData data); static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector cc, N_Vector sc); static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol, + sunrealtype fnormtol, sunrealtype scsteptol, int linsolver); static void PrintOutput(N_Vector cc); static void PrintFinalStats(void *kmem, int linsolver); -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data); -static realtype DotProd(int size, realtype *x1, realtype *x2); +static sunrealtype DotProd(int size, sunrealtype *x1, sunrealtype *x2); static int check_flag(void *flagvalue, const char *funcname, int opt); /* @@ -202,7 +202,7 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main(void) { int globalstrategy, linsolver; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector cc, sc, constraints; UserData data; int flag, maxl, maxlrst; @@ -412,7 +412,7 @@ int main(void) static int func(N_Vector cc, N_Vector fval, void *user_data) { - realtype xx, yy, delx, dely, *cxy, *rxy, *fxy, dcyli, dcyui, dcxli, dcxri; + sunrealtype xx, yy, delx, dely, *cxy, *rxy, *fxy, dcyli, dcyui, dcxli, dcxri; int jx, jy, is, idyu, idyl, idxr, idxl; UserData data; @@ -475,8 +475,8 @@ static int PrecSetupBD(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, void *user_data) { - realtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; - realtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; + sunrealtype r, r0, uround, sqruround, xx, yy, delx, dely, csave, fac; + sunrealtype *cxy, *scxy, **Pxy, *ratesxy, *Pxycol, perturb_rates[NUM_SPECIES]; sunindextype ret; int i, j, jx, jy; UserData data; @@ -542,7 +542,7 @@ static int PrecSolveBD(N_Vector cc, N_Vector cscale, N_Vector fval, N_Vector fscale, N_Vector vv, void *user_data) { - realtype **Pxy, *vxy; + sunrealtype **Pxy, *vxy; sunindextype *piv, jx, jy; UserData data; @@ -572,11 +572,11 @@ static int PrecSolveBD(N_Vector cc, N_Vector cscale, * Interaction rate function routine */ -static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, +static void WebRate(sunrealtype xx, sunrealtype yy, sunrealtype *cxy, sunrealtype *ratesxy, void *user_data) { int i; - realtype fac; + sunrealtype fac; UserData data; data = (UserData)user_data; @@ -591,13 +591,13 @@ static void WebRate(realtype xx, realtype yy, realtype *cxy, realtype *ratesxy, } /* - * Dot product routine for realtype arrays + * Dot product routine for sunrealtype arrays */ -static realtype DotProd(int size, realtype *x1, realtype *x2) +static sunrealtype DotProd(int size, sunrealtype *x1, sunrealtype *x2) { int i; - realtype *xx1, *xx2, temp = ZERO; + sunrealtype *xx1, *xx2, temp = ZERO; xx1 = x1; xx2 = x2; for (i = 0; i < size; i++) temp += (*xx1++) * (*xx2++); @@ -629,9 +629,9 @@ static UserData AllocUserData(void) } } acoef = SUNDlsMat_newDenseMat(NUM_SPECIES, NUM_SPECIES); - bcoef = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - cox = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); - coy = (realtype *)malloc(NUM_SPECIES * sizeof(realtype)); + bcoef = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + cox = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); + coy = (sunrealtype *)malloc(NUM_SPECIES * sizeof(sunrealtype)); return(data); } @@ -643,7 +643,7 @@ static UserData AllocUserData(void) static void InitUserData(UserData data) { int i, j, np; - realtype *a1,*a2, *a3, *a4, dx2, dy2; + sunrealtype *a1,*a2, *a3, *a4, dx2, dy2; data->mx = MX; data->my = MY; @@ -720,8 +720,8 @@ static void FreeUserData(UserData data) static void SetInitialProfiles(N_Vector cc, N_Vector sc) { int i, jx, jy; - realtype *cloc, *sloc; - realtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; + sunrealtype *cloc, *sloc; + sunrealtype ctemp[NUM_SPECIES], stemp[NUM_SPECIES]; /* Initialize arrays ctemp and stemp used in the loading process */ for (i = 0; i < NUM_SPECIES/2; i++) { @@ -751,7 +751,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) */ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, - realtype fnormtol, realtype scsteptol, + sunrealtype fnormtol, sunrealtype scsteptol, int linsolver) { printf("\nPredator-prey test problem -- KINSol (serial version)\n\n"); @@ -819,7 +819,7 @@ static void PrintHeader(int globalstrategy, int maxl, int maxlrst, static void PrintOutput(N_Vector cc) { int is, jx, jy; - realtype *ct; + sunrealtype *ct; jy = 0; jx = 0; ct = IJ_Vptr(cc,jx,jy); diff --git a/examples/kinsol/serial/kinLaplace_bnd.c b/examples/kinsol/serial/kinLaplace_bnd.c index 11cef35e81..fbacc03389 100644 --- a/examples/kinsol/serial/kinLaplace_bnd.c +++ b/examples/kinsol/serial/kinLaplace_bnd.c @@ -32,7 +32,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNRexp */ /* Problem Constants */ @@ -76,7 +76,7 @@ static int check_retval(void *retvalvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype fnormtol, fnorm; + sunrealtype fnormtol, fnorm; N_Vector y, scale; int mset, msubset, retval; void *kmem; @@ -236,10 +236,10 @@ int main() static int func(N_Vector u, N_Vector f, void *user_data) { - realtype dx, dy, hdiff, vdiff; - realtype hdc, vdc; - realtype uij, udn, uup, ult, urt; - realtype *udata, *fdata; + sunrealtype dx, dy, hdiff, vdiff; + sunrealtype hdc, vdc; + sunrealtype uij, udn, uup, ult, urt; + sunrealtype *udata, *fdata; int i, j; @@ -284,8 +284,8 @@ static int func(N_Vector u, N_Vector f, void *user_data) static void PrintOutput(N_Vector u) { int i, j; - realtype dx, dy, x, y; - realtype *udata; + sunrealtype dx, dy, x, y; + sunrealtype *udata; dx = ONE/(NX+1); dy = ONE/(NY+1); diff --git a/examples/kinsol/serial/kinLaplace_picard_bnd.c b/examples/kinsol/serial/kinLaplace_picard_bnd.c index 9a2a772feb..9f39e011b1 100644 --- a/examples/kinsol/serial/kinLaplace_picard_bnd.c +++ b/examples/kinsol/serial/kinLaplace_picard_bnd.c @@ -35,7 +35,7 @@ #include /* access to serial N_Vector */ #include /* access to band SUNMatrix */ #include /* access to band SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNRexp */ /* Problem Constants */ @@ -81,7 +81,7 @@ static int check_retval(void *retvalvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype fnormtol, fnorm; + sunrealtype fnormtol, fnorm; N_Vector y, scale; int retval; void *kmem; @@ -238,10 +238,10 @@ int main() static int func(N_Vector u, N_Vector f, void *user_data) { - realtype dx, dy, hdiff, vdiff; - realtype hdc, vdc; - realtype uij, udn, uup, ult, urt; - realtype *udata, *fdata; + sunrealtype dx, dy, hdiff, vdiff; + sunrealtype hdc, vdc; + sunrealtype uij, udn, uup, ult, urt; + sunrealtype *udata, *fdata; int i, j; @@ -286,9 +286,9 @@ static int func(N_Vector u, N_Vector f, void *user_data) static int jac(N_Vector u, N_Vector f, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2) { - realtype dx, dy; - realtype hdc, vdc; - realtype *kthCol; + sunrealtype dx, dy; + sunrealtype hdc, vdc; + sunrealtype *kthCol; int i, j, k; @@ -335,8 +335,8 @@ static int jac(N_Vector u, N_Vector f, SUNMatrix J, static void PrintOutput(N_Vector u) { int i, j; - realtype dx, dy, x, y; - realtype *udata; + sunrealtype dx, dy, x, y; + sunrealtype *udata; dx = ONE/(NX+1); dy = ONE/(NY+1); diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index 9122e8b0ef..e61b2db0d0 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -33,7 +33,7 @@ #include /* access to KINSOL func., consts. */ #include /* access to serial N_Vector */ #include /* access to SPGMR SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNRexp */ /* Problem Constants */ @@ -79,7 +79,7 @@ static int check_retval(void *retvalvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype fnormtol, fnorm; + sunrealtype fnormtol, fnorm; N_Vector y, scale; int retval; void *kmem; @@ -238,10 +238,10 @@ int main() static int func(N_Vector u, N_Vector f, void *user_data) { - realtype dx, dy, hdiff, vdiff; - realtype hdc, vdc; - realtype uij, udn, uup, ult, urt; - realtype *udata, *fdata; + sunrealtype dx, dy, hdiff, vdiff; + sunrealtype hdc, vdc; + sunrealtype uij, udn, uup, ult, urt; + sunrealtype *udata, *fdata; int i, j; @@ -286,10 +286,10 @@ static int func(N_Vector u, N_Vector f, void *user_data) static int jactimes(N_Vector v, N_Vector Jv, N_Vector u, booleantype *new_u, void *user_data) { - realtype dx, dy, hdiff, vdiff; - realtype hdc, vdc; - realtype vij, vdn, vup, vlt, vrt; - realtype *vdata, *Jvdata; + sunrealtype dx, dy, hdiff, vdiff; + sunrealtype hdc, vdc; + sunrealtype vij, vdn, vup, vlt, vrt; + sunrealtype *vdata, *Jvdata; int i, j; @@ -334,8 +334,8 @@ static int jactimes(N_Vector v, N_Vector Jv, N_Vector u, booleantype *new_u, static void PrintOutput(N_Vector u) { int i, j; - realtype dx, dy, x, y; - realtype *udata; + sunrealtype dx, dy, x, y; + sunrealtype *udata; dx = ONE/(NX+1); dy = ONE/(NY+1); diff --git a/examples/kinsol/serial/kinRoberts_fp.c b/examples/kinsol/serial/kinRoberts_fp.c index fe69235298..e57b3ace6e 100644 --- a/examples/kinsol/serial/kinRoberts_fp.c +++ b/examples/kinsol/serial/kinRoberts_fp.c @@ -34,7 +34,7 @@ #include /* access to KINSOL func., consts. */ #include /* access to serial N_Vector */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -80,7 +80,7 @@ static int funcRoberts(N_Vector u, N_Vector f, void *user_data); static void PrintOutput(N_Vector u); static void PrintFinalStats(void *kmem); static int check_retval(void *retvalvalue, const char *funcname, int opt); -static int check_ans(N_Vector u, realtype rtol, realtype atol); +static int check_ans(N_Vector u, sunrealtype rtol, sunrealtype atol); /* *-------------------------------------------------------------------- @@ -91,7 +91,7 @@ static int check_ans(N_Vector u, realtype rtol, realtype atol); int main() { SUNContext sunctx; - realtype fnormtol, fnorm; + sunrealtype fnormtol, fnorm; N_Vector y, scale; int retval; void *kmem; @@ -221,8 +221,8 @@ int main() static int funcRoberts(N_Vector y, N_Vector g, void *user_data) { - realtype y1, y2, y3; - realtype yd1, yd3; + sunrealtype y1, y2, y3; + sunrealtype yd1, yd3; y1 = Ith(y,1); y2 = Ith(y,2); @@ -244,7 +244,7 @@ static int funcRoberts(N_Vector y, N_Vector g, void *user_data) static void PrintOutput(N_Vector y) { - realtype y1, y2, y3; + sunrealtype y1, y2, y3; y1 = Ith(y,1); y2 = Ith(y,2); @@ -327,12 +327,12 @@ static int check_retval(void *retvalvalue, const char *funcname, int opt) /* compare the solution to a reference solution computed with a tolerance of 1e-14 */ -static int check_ans(N_Vector u, realtype rtol, realtype atol) +static int check_ans(N_Vector u, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) retval */ N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ - realtype err; /* wrms error */ + sunrealtype err; /* wrms error */ /* create reference solution and error weight vectors */ ref = N_VClone(u); diff --git a/examples/kinsol/serial/kinRoboKin_dns.c b/examples/kinsol/serial/kinRoboKin_dns.c index d0d8ffd3f5..3f628088c9 100644 --- a/examples/kinsol/serial/kinRoboKin_dns.c +++ b/examples/kinsol/serial/kinRoboKin_dns.c @@ -34,7 +34,7 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNRsqrt */ /* Problem Constants */ @@ -67,7 +67,7 @@ static int check_retval(void *retvalvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector y, scale, constraints; int mset, retval, i; void *kmem; @@ -193,15 +193,15 @@ int main() static int func(N_Vector y, N_Vector f, void *user_data) { - realtype *yd, *fd; + sunrealtype *yd, *fd; - realtype x1, x2, x3, x4, x5, x6, x7, x8; - realtype l1, l2, l3, l4, l5, l6, l7, l8; - realtype u1, u2, u3, u4, u5, u6, u7, u8; + sunrealtype x1, x2, x3, x4, x5, x6, x7, x8; + sunrealtype l1, l2, l3, l4, l5, l6, l7, l8; + sunrealtype u1, u2, u3, u4, u5, u6, u7, u8; - realtype eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8; - realtype lb1, lb2, lb3, lb4, lb5, lb6, lb7, lb8; - realtype ub1, ub2, ub3, ub4, ub5, ub6, ub7, ub8; + sunrealtype eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8; + sunrealtype lb1, lb2, lb3, lb4, lb5, lb6, lb7, lb8; + sunrealtype ub1, ub2, ub3, ub4, ub5, ub6, ub7, ub8; yd = N_VGetArrayPointer(y); fd = N_VGetArrayPointer(f); @@ -270,8 +270,8 @@ static int jac(N_Vector y, N_Vector f,SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2) { int i; - realtype *yd; - realtype x1, x2, x3, x4, x5, x6, x7, x8; + sunrealtype *yd; + sunrealtype x1, x2, x3, x4, x5, x6, x7, x8; yd = N_VGetArrayPointer(y); diff --git a/examples/kinsol/serial/kinRoboKin_slu.c b/examples/kinsol/serial/kinRoboKin_slu.c index 2adfc7d072..2630d3c123 100644 --- a/examples/kinsol/serial/kinRoboKin_slu.c +++ b/examples/kinsol/serial/kinRoboKin_slu.c @@ -36,7 +36,7 @@ #include /* access to serial N_Vector */ #include /* access to sparse SUNMatrix */ #include /* access to SuperLUMT linear solver */ -#include /* defs. of realtype, sunindextype */ +#include /* defs. of sunrealtype, sunindextype */ #include /* access to SUNRsqrt */ /* Problem Constants */ @@ -69,7 +69,7 @@ static int check_retval(void *retvalvalue, const char *funcname, int opt); int main() { SUNContext sunctx; - realtype fnormtol, scsteptol; + sunrealtype fnormtol, scsteptol; N_Vector y, scale, constraints; int mset, retval, i; void *kmem; @@ -192,15 +192,15 @@ int main() static int func(N_Vector y, N_Vector f, void *user_data) { - realtype *yd, *fd; + sunrealtype *yd, *fd; - realtype x1, x2, x3, x4, x5, x6, x7, x8; - realtype l1, l2, l3, l4, l5, l6, l7, l8; - realtype u1, u2, u3, u4, u5, u6, u7, u8; + sunrealtype x1, x2, x3, x4, x5, x6, x7, x8; + sunrealtype l1, l2, l3, l4, l5, l6, l7, l8; + sunrealtype u1, u2, u3, u4, u5, u6, u7, u8; - realtype eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8; - realtype lb1, lb2, lb3, lb4, lb5, lb6, lb7, lb8; - realtype ub1, ub2, ub3, ub4, ub5, ub6, ub7, ub8; + sunrealtype eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8; + sunrealtype lb1, lb2, lb3, lb4, lb5, lb6, lb7, lb8; + sunrealtype ub1, ub2, ub3, ub4, ub5, ub6, ub7, ub8; yd = N_VGetArrayPointer(y); fd = N_VGetArrayPointer(f); @@ -268,11 +268,11 @@ static int func(N_Vector y, N_Vector f, void *user_data) static int jac(N_Vector y, N_Vector f, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2) { - realtype *yd; - realtype x1, x2, x3, x4, x5, x6, x7, x8; + sunrealtype *yd; + sunrealtype x1, x2, x3, x4, x5, x6, x7, x8; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(J); sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); - realtype *data = SUNSparseMatrix_Data(J); + sunrealtype *data = SUNSparseMatrix_Data(J); yd = N_VGetArrayPointer(y); diff --git a/examples/nvector/C_openmp/test_nvector_openmp.c b/examples/nvector/C_openmp/test_nvector_openmp.c index 8121abf8c8..bc304b08a4 100644 --- a/examples/nvector/C_openmp/test_nvector_openmp.c +++ b/examples/nvector/C_openmp/test_nvector_openmp.c @@ -241,11 +241,11 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation specific utility functions for vector tests * --------------------------------------------------------------------*/ -int check_ans(realtype ans, N_Vector X, sunindextype local_length) +int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) { int failure = 0; sunindextype i; - realtype *Xdata; + sunrealtype *Xdata; Xdata = N_VGetArrayPointer(X); @@ -263,23 +263,23 @@ booleantype has_data(N_Vector X) return (N_VGetArrayPointer(X) == NULL) ? SUNFALSE : SUNTRUE; } -void set_element(N_Vector X, sunindextype i, realtype val) +void set_element(N_Vector X, sunindextype i, sunrealtype val) { /* set i-th element of data array */ set_element_range(X, i, i, val); } void set_element_range(N_Vector X, sunindextype is, sunindextype ie, - realtype val) + sunrealtype val) { sunindextype i; /* set elements [is,ie] of the data array */ - realtype* xd = N_VGetArrayPointer(X); + sunrealtype* xd = N_VGetArrayPointer(X); for(i = is; i <= ie; i++) xd[i] = val; } -realtype get_element(N_Vector X, sunindextype i) +sunrealtype get_element(N_Vector X, sunindextype i) { /* get i-th element of data array */ return NV_Ith_OMP(X,i); diff --git a/examples/nvector/cuda/test_nvector_cuda.cu b/examples/nvector/cuda/test_nvector_cuda.cu index d120908b74..f804c08ffe 100644 --- a/examples/nvector/cuda/test_nvector_cuda.cu +++ b/examples/nvector/cuda/test_nvector_cuda.cu @@ -130,9 +130,9 @@ int main(int argc, char *argv[]) } /* Fill vector with uniform random data in [-1,1] */ - realtype* xdata = N_VGetHostArrayPointer_Cuda(X); + sunrealtype* xdata = N_VGetHostArrayPointer_Cuda(X); for (sunindextype j=0; j(X->content)}; @@ -184,13 +184,13 @@ booleantype has_data(N_Vector X) return SUNTRUE; } -void set_element(N_Vector X, sunindextype i, realtype val) +void set_element(N_Vector X, sunindextype i, sunrealtype val) { /* set i-th element of data array */ set_element_range(X, i, i, val); } -void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype val) +void set_element_range(N_Vector X, sunindextype is, sunindextype ie, sunrealtype val) { auto Xvec{static_cast(X->content)}; auto Xdata{Xvec->HostView()}; @@ -201,7 +201,7 @@ void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype va sundials::kokkos::CopyToDevice(X); } -realtype get_element(N_Vector X, sunindextype i) +sunrealtype get_element(N_Vector X, sunindextype i) { /* get i-th element of data array */ auto Xvec{static_cast(X->content)}; diff --git a/examples/nvector/manyvector/test_nvector_manyvector.c b/examples/nvector/manyvector/test_nvector_manyvector.c index 492fb945d7..37a09856b7 100644 --- a/examples/nvector/manyvector/test_nvector_manyvector.c +++ b/examples/nvector/manyvector/test_nvector_manyvector.c @@ -262,12 +262,12 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation specific utility functions for vector tests * --------------------------------------------------------------------*/ -int check_ans(realtype ans, N_Vector X, sunindextype local_length) +int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) { int failure = 0; sunindextype i; N_Vector Xsub[2]; - realtype *x0, *x1; + sunrealtype *x0, *x1; sunindextype x0len, x1len; Xsub[0] = N_VGetSubvector_ManyVector(X, 0); @@ -294,7 +294,7 @@ booleantype has_data(N_Vector X) return SUNTRUE; } -void set_element(N_Vector X, sunindextype i, realtype val) +void set_element(N_Vector X, sunindextype i, sunrealtype val) { N_Vector Xsub[2]; sunindextype x0len; @@ -311,7 +311,7 @@ void set_element(N_Vector X, sunindextype i, realtype val) } } -void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype val) +void set_element_range(N_Vector X, sunindextype is, sunindextype ie, sunrealtype val) { N_Vector Xsub[2]; sunindextype x0len, i; @@ -325,7 +325,7 @@ void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype va for (i=x0len; i<=ie; i++) NV_Ith_S(Xsub[1], i-x0len) = val; } -realtype get_element(N_Vector X, sunindextype i) +sunrealtype get_element(N_Vector X, sunindextype i) { N_Vector Xsub[2]; sunindextype x0len; diff --git a/examples/nvector/mpicuda/test_nvector_mpicuda.cu b/examples/nvector/mpicuda/test_nvector_mpicuda.cu index d77ffc5d71..0967240893 100644 --- a/examples/nvector/mpicuda/test_nvector_mpicuda.cu +++ b/examples/nvector/mpicuda/test_nvector_mpicuda.cu @@ -298,11 +298,11 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation specific utility functions for vector tests * --------------------------------------------------------------------*/ -int check_ans(realtype ans, N_Vector plusX, sunindextype local_length) +int check_ans(sunrealtype ans, N_Vector plusX, sunindextype local_length) { int failure = 0; sunindextype i; - realtype *Xdata; + sunrealtype *Xdata; N_Vector X; X = N_VGetLocalVector_MPIPlusX(plusX); @@ -327,17 +327,17 @@ booleantype has_data(N_Vector plusX) return SUNTRUE; } -void set_element(N_Vector plusX, sunindextype i, realtype val) +void set_element(N_Vector plusX, sunindextype i, sunrealtype val) { /* set i-th element of data array */ set_element_range(plusX, i, i, val); } void set_element_range(N_Vector plusX, sunindextype is, sunindextype ie, - realtype val) + sunrealtype val) { sunindextype i; - realtype* xd; + sunrealtype* xd; N_Vector X; X = N_VGetLocalVector_MPIPlusX(plusX); @@ -349,7 +349,7 @@ void set_element_range(N_Vector plusX, sunindextype is, sunindextype ie, N_VCopyToDevice_Cuda(X); } -realtype get_element(N_Vector plusX, sunindextype i) +sunrealtype get_element(N_Vector plusX, sunindextype i) { N_Vector X = N_VGetLocalVector_MPIPlusX(plusX); diff --git a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c index b9e0f228ba..9e737e9052 100644 --- a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c +++ b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c @@ -326,12 +326,12 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation specific utility functions for vector tests * --------------------------------------------------------------------*/ -int check_ans(realtype ans, N_Vector X, sunindextype local_length) +int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) { int failure = 0; sunindextype i; N_Vector Xsub[2]; - realtype *x0, *x1; + sunrealtype *x0, *x1; sunindextype x0len, x1len; Xsub[0] = N_VGetSubvector_MPIManyVector(X, 0); @@ -358,7 +358,7 @@ booleantype has_data(N_Vector X) return SUNTRUE; } -void set_element(N_Vector X, sunindextype i, realtype val) +void set_element(N_Vector X, sunindextype i, sunrealtype val) { N_Vector Xsub[2]; sunindextype x0len; @@ -375,7 +375,7 @@ void set_element(N_Vector X, sunindextype i, realtype val) } } -void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype val) +void set_element_range(N_Vector X, sunindextype is, sunindextype ie, sunrealtype val) { N_Vector Xsub[2]; sunindextype x0len, i; @@ -389,7 +389,7 @@ void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype va for (i=x0len; i<=ie; i++) NV_Ith_P(Xsub[1], i-x0len) = val; } -realtype get_element(N_Vector X, sunindextype i) +sunrealtype get_element(N_Vector X, sunindextype i) { N_Vector Xsub[2]; sunindextype x0len; diff --git a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c index 6268948a0d..fb843c7b6f 100644 --- a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c +++ b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c @@ -345,12 +345,12 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation specific utility functions for vector tests * --------------------------------------------------------------------*/ -int check_ans(realtype ans, N_Vector X, sunindextype local_length) +int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) { int failure = 0; sunindextype i; N_Vector Xsub[2]; - realtype *x0, *x1; + sunrealtype *x0, *x1; sunindextype x0len, x1len; Xsub[0] = N_VGetSubvector_MPIManyVector(X, 0); @@ -377,7 +377,7 @@ booleantype has_data(N_Vector X) return SUNTRUE; } -void set_element(N_Vector X, sunindextype i, realtype val) +void set_element(N_Vector X, sunindextype i, sunrealtype val) { N_Vector Xsub[2]; sunindextype x0len; @@ -394,7 +394,7 @@ void set_element(N_Vector X, sunindextype i, realtype val) } } -void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype val) +void set_element_range(N_Vector X, sunindextype is, sunindextype ie, sunrealtype val) { N_Vector Xsub[2]; sunindextype x0len, i; @@ -408,7 +408,7 @@ void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype va for (i=x0len; i<=ie; i++) NV_Ith_P(Xsub[1], i-x0len) = val; } -realtype get_element(N_Vector X, sunindextype i) +sunrealtype get_element(N_Vector X, sunindextype i) { N_Vector Xsub[2]; sunindextype x0len; diff --git a/examples/nvector/mpiplusx/test_nvector_mpiplusx.c b/examples/nvector/mpiplusx/test_nvector_mpiplusx.c index 3e44b0abbc..63c0b39ee5 100644 --- a/examples/nvector/mpiplusx/test_nvector_mpiplusx.c +++ b/examples/nvector/mpiplusx/test_nvector_mpiplusx.c @@ -294,11 +294,11 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation specific utility functions for vector tests * --------------------------------------------------------------------*/ -int check_ans(realtype ans, N_Vector X, sunindextype local_length) +int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) { int failure = 0; sunindextype i; - realtype *x0; + sunrealtype *x0; sunindextype x0len; x0len = N_VGetLocalLength_MPIPlusX(X); @@ -320,9 +320,9 @@ booleantype has_data(N_Vector X) return SUNTRUE; } -void set_element(N_Vector X, sunindextype i, realtype val) +void set_element(N_Vector X, sunindextype i, sunrealtype val) { - realtype *data; + sunrealtype *data; data = N_VGetArrayPointer(X); @@ -330,10 +330,10 @@ void set_element(N_Vector X, sunindextype i, realtype val) data[i] = val; } -void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype val) +void set_element_range(N_Vector X, sunindextype is, sunindextype ie, sunrealtype val) { sunindextype x0len, i; - realtype *data; + sunrealtype *data; data = N_VGetArrayPointer(X); x0len = N_VGetLocalLength_MPIPlusX(X); @@ -342,9 +342,9 @@ void set_element_range(N_Vector X, sunindextype is, sunindextype ie, realtype va for (i=is; iops->nvconst == NULL) { @@ -417,7 +417,7 @@ int Test_N_VSetArrayPointer(N_Vector W, sunindextype local_length, int myid) int failure = 0; sunindextype i; double start_time, stop_time, maxt; - realtype *Wdata; + sunrealtype *Wdata; /* check if the required operations are implemented */ if (W->ops->nvconst == NULL) { @@ -427,7 +427,7 @@ int Test_N_VSetArrayPointer(N_Vector W, sunindextype local_length, int myid) } /* create vector data */ - Wdata = (realtype*) malloc(local_length * sizeof(realtype)); + Wdata = (sunrealtype*) malloc(local_length * sizeof(sunrealtype)); for(i=0; i < local_length; i++){ Wdata[i] = ONE; } @@ -1381,7 +1381,7 @@ int Test_N_VDotProd(N_Vector X, N_Vector Y, sunindextype local_length, int myid) int fails = 0, failure = 0; double start_time, stop_time, maxt; sunindextype global_length; - realtype ans; + sunrealtype ans; /* get global length */ global_length = N_VGetLength(X); @@ -1396,7 +1396,7 @@ int Test_N_VDotProd(N_Vector X, N_Vector Y, sunindextype local_length, int myid) stop_time = get_time(); /* ans should equal global vector length */ - failure = SUNRCompare(ans, (realtype) global_length); + failure = SUNRCompare(ans, (sunrealtype) global_length); if (failure) { printf(">>> FAILED test -- N_VDotProd, Proc %d \n", myid); @@ -1420,7 +1420,7 @@ int Test_N_VMaxNorm(N_Vector X, sunindextype local_length, int myid) { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans; + sunrealtype ans; /* * Case 1: zero vector @@ -1493,7 +1493,7 @@ int Test_N_VWrmsNorm(N_Vector X, N_Vector W, sunindextype local_length, int myid { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans; + sunrealtype ans; /* fill vector data */ N_VConst(NEG_HALF, X); @@ -1531,14 +1531,14 @@ int Test_N_VWrmsNormMask(N_Vector X, N_Vector W, N_Vector ID, int fails = 0, failure = 0; double start_time, stop_time, maxt; sunindextype global_length; - realtype ans; - realtype fac; + sunrealtype ans; + sunrealtype fac; /* get global length */ global_length = N_VGetLength(X); /* factor used in checking solutions */ - fac = SUNRsqrt((realtype) (global_length - 1)/(global_length))*HALF*HALF; + fac = SUNRsqrt((sunrealtype) (global_length - 1)/(global_length))*HALF*HALF; /* fill vector data */ N_VConst(NEG_HALF, X); @@ -1579,7 +1579,7 @@ int Test_N_VMin(N_Vector X, sunindextype local_length, int myid) { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans; + sunrealtype ans; /* fill vector data */ N_VConst(TWO, X); @@ -1647,7 +1647,7 @@ int Test_N_VWL2Norm(N_Vector X, N_Vector W, sunindextype local_length, int myid) int fails = 0, failure = 0; double start_time, stop_time, maxt; sunindextype global_length; - realtype ans; + sunrealtype ans; /* get global length */ global_length = N_VGetLength(X); @@ -1662,7 +1662,7 @@ int Test_N_VWL2Norm(N_Vector X, N_Vector W, sunindextype local_length, int myid) stop_time = get_time(); /* ans should equal 1/4 * sqrt(global_length) */ - failure = (ans < ZERO) ? 1 : SUNRCompare(ans, HALF*HALF*SUNRsqrt((realtype) global_length)); + failure = (ans < ZERO) ? 1 : SUNRCompare(ans, HALF*HALF*SUNRsqrt((sunrealtype) global_length)); if (failure) { printf(">>> FAILED test -- N_VWL2Norm, Proc %d \n", myid); @@ -1687,7 +1687,7 @@ int Test_N_VL1Norm(N_Vector X, sunindextype local_length, int myid) int fails = 0, failure = 0; double start_time, stop_time, maxt; sunindextype global_length; - realtype ans; + sunrealtype ans; /* get global length */ global_length = N_VGetLength(X); @@ -1701,7 +1701,7 @@ int Test_N_VL1Norm(N_Vector X, sunindextype local_length, int myid) stop_time = get_time(); /* ans should equal global_length */ - failure = (ans < ZERO) ? 1 : SUNRCompare(ans, (realtype) global_length); + failure = (ans < ZERO) ? 1 : SUNRCompare(ans, (sunrealtype) global_length); if (failure) { printf(">>> FAILED test -- N_VL1Norm, Proc %d \n", myid); @@ -2068,7 +2068,7 @@ int Test_N_VMinQuotient(N_Vector NUM, N_Vector DENOM, { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans; + sunrealtype ans; /* * Case 1: Pass @@ -2147,7 +2147,7 @@ int Test_N_VLinearCombination(N_Vector X, sunindextype local_length, int myid) N_Vector Y1, Y2, Y3; N_Vector V[3]; - realtype c[3]; + sunrealtype c[3]; /* create vectors for testing */ Y1 = N_VClone(X); @@ -2425,7 +2425,7 @@ int Test_N_VScaleAddMulti(N_Vector X, sunindextype local_length, int myid) int fails = 0, failure = 0, ierr = 0; double start_time, stop_time, maxt; - realtype avals[3]; + sunrealtype avals[3]; N_Vector *V, *Z; /* create vectors for testing */ @@ -2606,7 +2606,7 @@ int Test_N_VDotProdMulti(N_Vector X, sunindextype local_length, int myid) sunindextype global_length; N_Vector *V; - realtype dotprods[3]; + sunrealtype dotprods[3]; /* get global length */ global_length = N_VGetLength(X); @@ -2629,7 +2629,7 @@ int Test_N_VDotProdMulti(N_Vector X, sunindextype local_length, int myid) /* dotprod[0] should equal the global vector length */ if (ierr == 0) - failure = SUNRCompare(dotprods[0], (realtype) global_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) global_length); else failure = 1; @@ -2661,9 +2661,9 @@ int Test_N_VDotProdMulti(N_Vector X, sunindextype local_length, int myid) /* dotprod[i] should equal -1, +1, and 2 times the global vector length */ if (ierr == 0) { - failure = SUNRCompare(dotprods[0], (realtype) -1*global_length); - failure += SUNRCompare(dotprods[1], (realtype) global_length); - failure += SUNRCompare(dotprods[2], (realtype) 2*global_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) -1*global_length); + failure += SUNRCompare(dotprods[1], (sunrealtype) global_length); + failure += SUNRCompare(dotprods[2], (sunrealtype) 2*global_length); } else { failure = 1; } @@ -3400,7 +3400,7 @@ int Test_N_VScaleVectorArray(N_Vector X, sunindextype local_length, int myid) int fails = 0, failure = 0, ierr = 0; double start_time, stop_time, maxt; - realtype c[3]; + sunrealtype c[3]; N_Vector *Y, *Z; /* create vectors for testing */ @@ -3644,7 +3644,7 @@ int Test_N_VWrmsNormVectorArray(N_Vector X, sunindextype local_length, int myid) int fails = 0, failure = 0, ierr = 0; double start_time, stop_time, maxt; - realtype nrm[3]; + sunrealtype nrm[3]; N_Vector *Z; N_Vector *W; @@ -3746,8 +3746,8 @@ int Test_N_VWrmsNormMaskVectorArray(N_Vector X, sunindextype local_length, double start_time, stop_time, maxt; sunindextype global_length; - realtype fac; - realtype nrm[3]; + sunrealtype fac; + sunrealtype nrm[3]; N_Vector *Z; N_Vector *W; @@ -3755,7 +3755,7 @@ int Test_N_VWrmsNormMaskVectorArray(N_Vector X, sunindextype local_length, global_length = N_VGetLength(X); /* factor used in checking solutions */ - fac = SUNRsqrt((realtype) (global_length - 1)/(global_length)); + fac = SUNRsqrt((sunrealtype) (global_length - 1)/(global_length)); /* create vectors for testing */ Z = N_VCloneVectorArray(3, X); @@ -3863,7 +3863,7 @@ int Test_N_VScaleAddMultiVectorArray(N_Vector V, sunindextype local_length, int int fails = 0, failure = 0, ierr = 0; double start_time, stop_time, maxt; - realtype a[3]; + sunrealtype a[3]; N_Vector* X; N_Vector* Y[3]; N_Vector* Z[3]; @@ -4275,7 +4275,7 @@ int Test_N_VLinearCombinationVectorArray(N_Vector V, sunindextype local_length, int fails = 0, failure = 0, ierr = 0; double start_time, stop_time, maxt; - realtype c[3]; + sunrealtype c[3]; N_Vector *Z; N_Vector* X[3]; @@ -4823,10 +4823,10 @@ int Test_N_VDotProdLocal(N_Vector X, N_Vector Y, sunindextype local_length, int { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans, rmyid, locleninv; + sunrealtype ans, rmyid, locleninv; /* fill vector data */ - rmyid = (realtype) myid; + rmyid = (sunrealtype) myid; locleninv = ONE/local_length; set_element_range(X, 0, local_length-1, rmyid); set_element_range(Y, 0, local_length-1, locleninv); @@ -4862,10 +4862,10 @@ int Test_N_VMaxNormLocal(N_Vector X, sunindextype local_length, int myid) { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans, myidp1; + sunrealtype ans, myidp1; /* fill vector data */ - myidp1 = (realtype) (myid+1); + myidp1 = (sunrealtype) (myid+1); N_VConst(NEG_HALF, X); set_element(X, local_length-1, -myidp1); @@ -4899,10 +4899,10 @@ int Test_N_VMinLocal(N_Vector X, sunindextype local_length, int myid) { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans, negmyid; + sunrealtype ans, negmyid; /* fill vector data */ - negmyid = (realtype) -myid; + negmyid = (sunrealtype) -myid; N_VConst(TWO, X); set_element(X, local_length-1, negmyid); @@ -4936,7 +4936,7 @@ int Test_N_VL1NormLocal(N_Vector X, sunindextype local_length, int myid) { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans, val; + sunrealtype ans, val; /* fill vector data */ val = -(ONE*myid)/local_length; @@ -4948,7 +4948,7 @@ int Test_N_VL1NormLocal(N_Vector X, sunindextype local_length, int myid) stop_time = get_time(); /* ans should equal myid */ - failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (realtype) myid, + failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (sunrealtype) myid, SUNRsqrt(UNIT_ROUNDOFF)); if (failure) { @@ -4973,7 +4973,7 @@ int Test_N_VWSqrSumLocal(N_Vector X, N_Vector W, sunindextype local_length, int { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans, xval, wval; + sunrealtype ans, xval, wval; /* fill vector data */ xval = SUNRsqrt(myid); @@ -4987,7 +4987,7 @@ int Test_N_VWSqrSumLocal(N_Vector X, N_Vector W, sunindextype local_length, int stop_time = get_time(); /* ans should equal myid */ - failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (realtype) myid, + failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (sunrealtype) myid, SUNRsqrt(UNIT_ROUNDOFF)); if (failure) { @@ -5013,7 +5013,7 @@ int Test_N_VWSqrSumMaskLocal(N_Vector X, N_Vector W, N_Vector ID, { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans, xval, wval; + sunrealtype ans, xval, wval; /* fill vector data */ xval = SUNRsqrt(myid); @@ -5031,7 +5031,7 @@ int Test_N_VWSqrSumMaskLocal(N_Vector X, N_Vector W, N_Vector ID, stop_time = get_time(); /* ans should equal myid */ - failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (realtype) myid, + failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (sunrealtype) myid, SUNRsqrt(UNIT_ROUNDOFF)); if (failure) { @@ -5056,7 +5056,7 @@ int Test_N_VInvTestLocal(N_Vector X, N_Vector Z, sunindextype local_length, int { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype xval; + sunrealtype xval; sunindextype i; booleantype test; @@ -5314,7 +5314,7 @@ int Test_N_VMinQuotientLocal(N_Vector NUM, N_Vector DENOM, { int fails = 0, failure = 0; double start_time, stop_time, maxt; - realtype ans; + sunrealtype ans; /* * Case 1: Pass @@ -5331,7 +5331,7 @@ int Test_N_VMinQuotientLocal(N_Vector NUM, N_Vector DENOM, stop_time = get_time(); /* ans should equal myid */ - failure = SUNRCompareTol(ans, (realtype) myid, SUNRsqrt(UNIT_ROUNDOFF)); + failure = SUNRCompareTol(ans, (sunrealtype) myid, SUNRsqrt(UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VMinQuotientLocal Case 1, Proc %d \n", myid); @@ -5388,7 +5388,7 @@ int Test_N_VDotProdMultiLocal(N_Vector X, sunindextype local_length, int myid) double start_time, stop_time, maxt; N_Vector *V; - realtype dotprods[3]; + sunrealtype dotprods[3]; /* create vectors for testing */ V = N_VCloneVectorArray(3, X); @@ -5408,7 +5408,7 @@ int Test_N_VDotProdMultiLocal(N_Vector X, sunindextype local_length, int myid) /* dotprod[0] should equal the local vector length */ if (ierr == 0) - failure = SUNRCompare(dotprods[0], (realtype) local_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) local_length); else failure = 1; @@ -5440,9 +5440,9 @@ int Test_N_VDotProdMultiLocal(N_Vector X, sunindextype local_length, int myid) /* dotprod[i] should equal -1, +1, and 2 times the local vector length */ if (ierr == 0) { - failure = SUNRCompare(dotprods[0], (realtype) -1 * local_length); - failure += SUNRCompare(dotprods[1], (realtype) local_length); - failure += SUNRCompare(dotprods[2], (realtype) 2 * local_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) -1 * local_length); + failure += SUNRCompare(dotprods[1], (sunrealtype) local_length); + failure += SUNRCompare(dotprods[2], (sunrealtype) 2 * local_length); } else { failure = 1; } @@ -5476,7 +5476,7 @@ int Test_N_VDotProdMultiAllReduce(N_Vector X, sunindextype local_length, sunindextype global_length; N_Vector *V; - realtype dotprods[3]; + sunrealtype dotprods[3]; /* only test if the operation is implemented, local vectors (non-MPI) do not provide this function */ @@ -5503,7 +5503,7 @@ int Test_N_VDotProdMultiAllReduce(N_Vector X, sunindextype local_length, /* dotprod[0] should equal the local vector length */ if (ierr == 0) - failure = SUNRCompare(dotprods[0], (realtype) local_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) local_length); else failure = 1; @@ -5526,7 +5526,7 @@ int Test_N_VDotProdMultiAllReduce(N_Vector X, sunindextype local_length, /* dotprod[0] should equal the global vector length */ if (ierr == 0) - failure = SUNRCompare(dotprods[0], (realtype) global_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) global_length); else failure = 1; @@ -5558,9 +5558,9 @@ int Test_N_VDotProdMultiAllReduce(N_Vector X, sunindextype local_length, /* dotprod[i] should equal -1, +1, and 2 times the local vector length */ if (ierr == 0) { - failure = SUNRCompare(dotprods[0], (realtype) -1 * local_length); - failure += SUNRCompare(dotprods[1], (realtype) local_length); - failure += SUNRCompare(dotprods[2], (realtype) 2 * local_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) -1 * local_length); + failure += SUNRCompare(dotprods[1], (sunrealtype) local_length); + failure += SUNRCompare(dotprods[2], (sunrealtype) 2 * local_length); } else { failure = 1; } @@ -5584,9 +5584,9 @@ int Test_N_VDotProdMultiAllReduce(N_Vector X, sunindextype local_length, /* dotprod[i] should equal -1, +1, and 2 times the global vector length */ if (ierr == 0) { - failure = SUNRCompare(dotprods[0], (realtype) -1 * global_length); - failure += SUNRCompare(dotprods[1], (realtype) global_length); - failure += SUNRCompare(dotprods[2], (realtype) 2 * global_length); + failure = SUNRCompare(dotprods[0], (sunrealtype) -1 * global_length); + failure += SUNRCompare(dotprods[1], (sunrealtype) global_length); + failure += SUNRCompare(dotprods[2], (sunrealtype) 2 * global_length); } else { failure = 1; } @@ -5631,7 +5631,7 @@ int Test_N_VBufSize(N_Vector x, sunindextype local_length, int myid) } /* check buffer size */ - if (size != local_length * ((sunindextype)sizeof(realtype))) { + if (size != local_length * ((sunindextype)sizeof(sunrealtype))) { printf(">>> FAILED test -- N_VBufSize, Proc %d \n", myid); return(1); } @@ -5656,7 +5656,7 @@ int Test_N_VBufPack(N_Vector x, sunindextype local_length, int myid) int flag = 0, failure = 0; double start_time, stop_time, maxt; sunindextype i, size; - realtype *buf; + sunrealtype *buf; /* get buffer size */ flag = N_VBufSize(x, &size); @@ -5667,7 +5667,7 @@ int Test_N_VBufPack(N_Vector x, sunindextype local_length, int myid) /* create and initialize buffer */ buf = NULL; - buf = (realtype*) malloc((size_t)size); + buf = (sunrealtype*) malloc((size_t)size); if (buf == NULL) { printf(">>> FAILED test -- malloc failed, Proc %d \n", myid); return(1); @@ -5724,7 +5724,7 @@ int Test_N_VBufUnpack(N_Vector x, sunindextype local_length, int myid) int flag = 0, failure = 0; double start_time, stop_time, maxt; sunindextype i, size; - realtype *buf; + sunrealtype *buf; /* get buffer size */ flag = N_VBufSize(x, &size); @@ -5735,7 +5735,7 @@ int Test_N_VBufUnpack(N_Vector x, sunindextype local_length, int myid) /* create and initialize buffer */ buf = NULL; - buf = (realtype*) malloc((size_t)size); + buf = (sunrealtype*) malloc((size_t)size); if (buf == NULL) { printf(">>> FAILED test -- malloc failed, Proc %d \n", myid); return(1); diff --git a/examples/nvector/test_nvector.h b/examples/nvector/test_nvector.h index a8a42faa96..84e89a9b4b 100644 --- a/examples/nvector/test_nvector.h +++ b/examples/nvector/test_nvector.h @@ -34,12 +34,12 @@ extern "C" { extern SUNContext sunctx; /* Forward declarations for implementation specific utility functions */ -int check_ans(realtype ans, N_Vector X, sunindextype local_length); +int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length); booleantype has_data(N_Vector X); -void set_element(N_Vector X, sunindextype i, realtype val); +void set_element(N_Vector X, sunindextype i, sunrealtype val); void set_element_range(N_Vector X, sunindextype is, sunindextype ie, - realtype val); -realtype get_element(N_Vector X, sunindextype i); + sunrealtype val); +sunrealtype get_element(N_Vector X, sunindextype i); double max_time(N_Vector X, double time); void sync_device(N_Vector X); diff --git a/examples/nvector/trilinos/test_nvector_trilinos.cpp b/examples/nvector/trilinos/test_nvector_trilinos.cpp index d14ffdb463..f280caa5df 100644 --- a/examples/nvector/trilinos/test_nvector_trilinos.cpp +++ b/examples/nvector/trilinos/test_nvector_trilinos.cpp @@ -211,7 +211,7 @@ int main (int argc, char *argv[]) /* * Checks if all elements of vector X are _ans_ */ -int check_ans(realtype ans, N_Vector X, sunindextype local_length) +int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) { Teuchos::RCP xv = N_VGetVector_Trilinos(X); @@ -253,7 +253,7 @@ booleantype has_data(N_Vector X) /* * Sets ith element of vector X to val */ -void set_element(N_Vector X, sunindextype i, realtype val) +void set_element(N_Vector X, sunindextype i, sunrealtype val) { set_element_range(X, i, i, val); } @@ -262,7 +262,7 @@ void set_element(N_Vector X, sunindextype i, realtype val) * Sets elements [is, ie] of vector X to val */ void set_element_range(N_Vector X, sunindextype is, sunindextype ie, - realtype val) + sunrealtype val) { typedef TpetraVectorInterface::vector_type vector_type; #if TRILINOS_MAJOR_VERSION < 14 @@ -294,7 +294,7 @@ void set_element_range(N_Vector X, sunindextype is, sunindextype ie, /* * Returns ith element of vector X */ -realtype get_element(N_Vector X, sunindextype i) +sunrealtype get_element(N_Vector X, sunindextype i) { Teuchos::RCP xv = N_VGetVector_Trilinos(X); diff --git a/examples/sunlinsol/band/test_sunlinsol_band.c b/examples/sunlinsol/band/test_sunlinsol_band.c index 8480b09e7b..b656537808 100644 --- a/examples/sunlinsol/band/test_sunlinsol_band.c +++ b/examples/sunlinsol/band/test_sunlinsol_band.c @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) N_Vector x, y, b; /* test vectors */ int print_timing; sunindextype j, k, kstart, kend; - realtype *colj, *xdata; + sunrealtype *colj, *xdata; SUNContext sunctx; if (SUNContext_Create(NULL, &sunctx)) { @@ -103,10 +103,10 @@ int main(int argc, char *argv[]) kstart = (jcols-1-lband) ? cols-1-j: lband; for (k=kstart; k<=kend; k++) - colj[k] = (realtype) rand() / (realtype) RAND_MAX; + colj[k] = (sunrealtype) rand() / (sunrealtype) RAND_MAX; /* x entry */ - xdata[j] = (realtype) rand() / (realtype) RAND_MAX; + xdata[j] = (sunrealtype) rand() / (sunrealtype) RAND_MAX; } @@ -199,11 +199,11 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i, local_length; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu b/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu index 4f69a36fde..73c70e4295 100644 --- a/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu +++ b/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; /* linear solver object */ SUNMatrix A, B, dA; /* test matrices */ N_Vector x, b, d_x, d_xref, d_b;/* test vectors */ - realtype *matdata, *xdata, *xrefdata; + sunrealtype *matdata, *xdata, *xrefdata; int print_timing; sunindextype i, j; SUNContext sunctx; @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) sunindextype col = cols[j] + block_size*i; sunindextype row = rows[j] + block_size*i; matdata = SUNDenseMatrix_Column(B,col); - matdata[row] = (realtype) rand() / (realtype) RAND_MAX / N; + matdata[row] = (sunrealtype) rand() / (sunrealtype) RAND_MAX / N; } } @@ -167,7 +167,7 @@ int main(int argc, char *argv[]) xdata = N_VGetHostArrayPointer_Cuda(d_x); xrefdata = N_VGetHostArrayPointer_Cuda(d_xref); for (i=0; i::epsilon(), tol * norm); } -int check_vector(N_Vector expected, N_Vector computed, realtype tol) +int check_vector(N_Vector expected, N_Vector computed, sunrealtype tol) { int failure = 0; diff --git a/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c b/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c index 319fd3a23d..98911f8f20 100644 --- a/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c +++ b/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) N_Vector x, y, b; /* test vectors */ int print_timing, print_matrix_on_fail; sunindextype j, k, kstart, kend; - realtype *colj, *xdata; + sunrealtype *colj, *xdata; SUNContext sunctx; if (SUNContext_Create(NULL, &sunctx)) { @@ -96,10 +96,10 @@ int main(int argc, char *argv[]) kstart = (jcols-1-lband) ? cols-1-j: lband; for (k=kstart; k<=kend; k++) - colj[k] = (realtype) rand() / (realtype) RAND_MAX; + colj[k] = (sunrealtype) rand() / (sunrealtype) RAND_MAX; /* x entry */ - xdata[j] = (realtype) rand() / (realtype) RAND_MAX; + xdata[j] = (sunrealtype) rand() / (sunrealtype) RAND_MAX; } @@ -170,11 +170,11 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i, local_length; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c b/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c index 41abcb5f06..1b312e13fc 100644 --- a/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c +++ b/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) N_Vector x, y, b; /* test vectors */ int print_timing, print_matrix_on_fail; sunindextype j, k; - realtype *colj, *xdata, *colIj; + sunrealtype *colj, *xdata, *colIj; SUNContext sunctx; if (SUNContext_Create(NULL, &sunctx)) { @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) for (j=0; j ZERO) { - realtype maxerr = ZERO; + sunrealtype maxerr = ZERO; for(i = 0; i < local_length; i++) maxerr = SUNMAX(SUNRabs(Xdata[i] - Ydata[i]), maxerr); printf("check err failure: maxerr = %g (tol = %g)\n", maxerr, tol); diff --git a/examples/sunlinsol/pcg/parallel/test_sunlinsol_pcg_parallel.c b/examples/sunlinsol/pcg/parallel/test_sunlinsol_pcg_parallel.c index 644079a94d..536e5048ed 100644 --- a/examples/sunlinsol/pcg/parallel/test_sunlinsol_pcg_parallel.c +++ b/examples/sunlinsol/pcg/parallel/test_sunlinsol_pcg_parallel.c @@ -58,11 +58,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of Nloc (for check_vector routine) */ sunindextype local_problem_size; @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -361,7 +361,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s, vL, vR, vsL, vsR; + sunrealtype *v, *z, *s, vL, vR, vsL, vsR; sunindextype i, Nloc; int ierr; UserData *ProbData; @@ -426,10 +426,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d, *s; + sunrealtype *r, *z, *d, *s; sunindextype i; UserData *ProbData; @@ -453,9 +453,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -486,11 +486,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/pcg/serial/test_sunlinsol_pcg_serial.c b/examples/sunlinsol/pcg/serial/test_sunlinsol_pcg_serial.c index d48a0b225a..76c4bdffac 100644 --- a/examples/sunlinsol/pcg/serial/test_sunlinsol_pcg_serial.c +++ b/examples/sunlinsol/pcg/serial/test_sunlinsol_pcg_serial.c @@ -54,11 +54,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of the problem size (for check_vector routine) */ sunindextype problem_size; @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -335,7 +335,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s; + sunrealtype *v, *z, *s; sunindextype i, N; UserData *ProbData; @@ -367,10 +367,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d, *s; + sunrealtype *r, *z, *d, *s; sunindextype i; UserData *ProbData; @@ -394,9 +394,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -427,11 +427,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; long int i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/spbcgs/parallel/test_sunlinsol_spbcgs_parallel.c b/examples/sunlinsol/spbcgs/parallel/test_sunlinsol_spbcgs_parallel.c index e829cc4665..1d257765b9 100644 --- a/examples/sunlinsol/spbcgs/parallel/test_sunlinsol_spbcgs_parallel.c +++ b/examples/sunlinsol/spbcgs/parallel/test_sunlinsol_spbcgs_parallel.c @@ -59,11 +59,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of Nloc (for check_vector routine) */ sunindextype local_problem_size; @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int pretype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -452,7 +452,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; + sunrealtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; sunindextype i, Nloc; int ierr; UserData *ProbData; @@ -519,10 +519,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -544,9 +544,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -577,11 +577,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/spbcgs/serial/test_sunlinsol_spbcgs_serial.c b/examples/sunlinsol/spbcgs/serial/test_sunlinsol_spbcgs_serial.c index 4154b15728..4f2d6e024e 100644 --- a/examples/sunlinsol/spbcgs/serial/test_sunlinsol_spbcgs_serial.c +++ b/examples/sunlinsol/spbcgs/serial/test_sunlinsol_spbcgs_serial.c @@ -55,11 +55,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of the problem size (for check_vector routine) */ sunindextype problem_size; @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int pretype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -423,7 +423,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2; + sunrealtype *v, *z, *s1, *s2; sunindextype i, N; UserData *ProbData; @@ -457,10 +457,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -482,9 +482,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -515,11 +515,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/spfgmr/parallel/test_sunlinsol_spfgmr_parallel.c b/examples/sunlinsol/spfgmr/parallel/test_sunlinsol_spfgmr_parallel.c index 95bd497d3e..acadc23bf8 100644 --- a/examples/sunlinsol/spfgmr/parallel/test_sunlinsol_spfgmr_parallel.c +++ b/examples/sunlinsol/spfgmr/parallel/test_sunlinsol_spfgmr_parallel.c @@ -59,11 +59,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of Nloc (for check_vector routine) */ sunindextype local_problem_size; @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int gstype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -441,7 +441,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; + sunrealtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; sunindextype i, Nloc; int ierr; UserData *ProbData; @@ -508,10 +508,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -533,9 +533,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -566,11 +566,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/spfgmr/serial/test_sunlinsol_spfgmr_serial.c b/examples/sunlinsol/spfgmr/serial/test_sunlinsol_spfgmr_serial.c index ae6d0ab55e..43a78b47aa 100644 --- a/examples/sunlinsol/spfgmr/serial/test_sunlinsol_spfgmr_serial.c +++ b/examples/sunlinsol/spfgmr/serial/test_sunlinsol_spfgmr_serial.c @@ -55,11 +55,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of the problem size (for check_vector routine) */ sunindextype problem_size; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int gstype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -413,7 +413,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2; + sunrealtype *v, *z, *s1, *s2; sunindextype i, N; UserData *ProbData; @@ -447,10 +447,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -472,9 +472,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -505,11 +505,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/spgmr/parallel/test_sunlinsol_spgmr_parallel.c b/examples/sunlinsol/spgmr/parallel/test_sunlinsol_spgmr_parallel.c index 100b96a822..278663f3f3 100644 --- a/examples/sunlinsol/spgmr/parallel/test_sunlinsol_spgmr_parallel.c +++ b/examples/sunlinsol/spgmr/parallel/test_sunlinsol_spgmr_parallel.c @@ -59,11 +59,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of Nloc (for check_vector routine) */ sunindextype local_problem_size; @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int gstype, pretype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -448,7 +448,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; + sunrealtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; sunindextype i, Nloc; int ierr; UserData *ProbData; @@ -515,10 +515,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -540,9 +540,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -573,11 +573,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/spgmr/serial/test_sunlinsol_spgmr_serial.c b/examples/sunlinsol/spgmr/serial/test_sunlinsol_spgmr_serial.c index 112a10f5d0..afd4378adc 100644 --- a/examples/sunlinsol/spgmr/serial/test_sunlinsol_spgmr_serial.c +++ b/examples/sunlinsol/spgmr/serial/test_sunlinsol_spgmr_serial.c @@ -55,11 +55,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of the problem size (for check_vector routine) */ sunindextype problem_size; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int gstype, pretype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -420,7 +420,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2; + sunrealtype *v, *z, *s1, *s2; sunindextype i, N; UserData *ProbData; @@ -454,10 +454,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -479,9 +479,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -512,11 +512,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/sptfqmr/parallel/test_sunlinsol_sptfqmr_parallel.c b/examples/sunlinsol/sptfqmr/parallel/test_sunlinsol_sptfqmr_parallel.c index 423805a37c..3aa2e689c8 100644 --- a/examples/sunlinsol/sptfqmr/parallel/test_sunlinsol_sptfqmr_parallel.c +++ b/examples/sunlinsol/sptfqmr/parallel/test_sunlinsol_sptfqmr_parallel.c @@ -59,11 +59,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of Nloc (for check_vector routine) */ sunindextype local_problem_size; @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int pretype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -455,7 +455,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; + sunrealtype *v, *z, *s1, *s2, vL, vR, vsL, vsR; sunindextype i, Nloc; int ierr; UserData *ProbData; @@ -522,10 +522,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -547,9 +547,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -580,11 +580,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/sptfqmr/serial/test_sunlinsol_sptfqmr_serial.c b/examples/sunlinsol/sptfqmr/serial/test_sunlinsol_sptfqmr_serial.c index 5028949d07..a38a6ed8ce 100644 --- a/examples/sunlinsol/sptfqmr/serial/test_sunlinsol_sptfqmr_serial.c +++ b/examples/sunlinsol/sptfqmr/serial/test_sunlinsol_sptfqmr_serial.c @@ -55,11 +55,11 @@ int ATimes(void* ProbData, N_Vector v, N_Vector z); /* preconditioner setup */ int PSetup(void* ProbData); /* preconditioner solve */ -int PSolve(void* ProbData, N_Vector r, N_Vector z, realtype tol, int lr); +int PSolve(void* ProbData, N_Vector r, N_Vector z, sunrealtype tol, int lr); /* checks function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* uniform random number generator in [0,1] */ -static realtype urand(); +static sunrealtype urand(); /* global copy of the problem size (for check_vector routine) */ sunindextype problem_size; @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) UserData ProbData; /* problem data structure */ int pretype, maxl, print_timing; sunindextype i; - realtype *vecdata; + sunrealtype *vecdata; double tol; SUNContext sunctx; @@ -428,7 +428,7 @@ int main(int argc, char *argv[]) int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) { /* local variables */ - realtype *v, *z, *s1, *s2; + sunrealtype *v, *z, *s1, *s2; sunindextype i, N; UserData *ProbData; @@ -462,10 +462,10 @@ int ATimes(void* Data, N_Vector v_vec, N_Vector z_vec) int PSetup(void* Data) { return 0; } /* preconditioner solve */ -int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) +int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, sunrealtype tol, int lr) { /* local variables */ - realtype *r, *z, *d; + sunrealtype *r, *z, *d; sunindextype i; UserData *ProbData; @@ -487,9 +487,9 @@ int PSolve(void* Data, N_Vector r_vec, N_Vector z_vec, realtype tol, int lr) } /* uniform random number generator */ -static realtype urand() +static sunrealtype urand() { - return ((realtype) rand() / (realtype) RAND_MAX); + return ((sunrealtype) rand() / (sunrealtype) RAND_MAX); } /* Check function return value based on "opt" input: @@ -520,11 +520,11 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) /* ---------------------------------------------------------------------- * Implementation-specific 'check' routines * --------------------------------------------------------------------*/ -int check_vector(N_Vector X, N_Vector Y, realtype tol) +int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) { int failure = 0; sunindextype i; - realtype *Xdata, *Ydata, maxerr; + sunrealtype *Xdata, *Ydata, maxerr; Xdata = N_VGetArrayPointer(X); Ydata = N_VGetArrayPointer(Y); diff --git a/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp b/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp index a4b23609c4..75e92f15e9 100644 --- a/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp +++ b/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp @@ -34,7 +34,7 @@ #define LOG_PROCESS_TO_FILE 0 /* helper functions */ -int csr_from_dense(SUNMatrix Ad, realtype droptol, realtype **matdata, +int csr_from_dense(SUNMatrix Ad, sunrealtype droptol, sunrealtype **matdata, sunindextype **colind, sunindextype **rowptrs); /* ---------------------------------------------------------------------- @@ -53,8 +53,8 @@ int main(int argc, char *argv[]) SUNMatrix A, D; /* test matrices */ SuperMatrix *Asuper; /* SuperMatrices of A */ N_Vector gx, gy, gb, x, y, b; /* test vectors */ - realtype *matdata; /* underlying data arrays */ - realtype *xdata, *ydata, *bdata; + sunrealtype *matdata; /* underlying data arrays */ + sunrealtype *xdata, *ydata, *bdata; sunindextype *rowptrs, *colind; gridinfo_t grid; /* SuperLU-DIST process grid */ xLUstruct_t lu; @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) i = rand() % N; j = rand() % N; matdata = SUNDenseMatrix_Column(D,j); - matdata[i] = (realtype) rand() / (realtype) RAND_MAX / N; + matdata[i] = (sunrealtype) rand() / (sunrealtype) RAND_MAX / N; } /* Add identity to matrix */ @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) /* fill x with random data */ for (i=0; i droptol); /* allocate */ - (*matdata) = (realtype*) malloc(nnz*sizeof(realtype)); + (*matdata) = (sunrealtype*) malloc(nnz*sizeof(sunrealtype)); (*colind) = (sunindextype*) malloc(nnz*sizeof(sunindextype)); (*rowptrs) = (sunindextype*) malloc((M+1)*sizeof(sunindextype)); diff --git a/examples/sunlinsol/superlumt/test_sunlinsol_superlumt.c b/examples/sunlinsol/superlumt/test_sunlinsol_superlumt.c index 141ce9a092..e352d5eb77 100644 --- a/examples/sunlinsol/superlumt/test_sunlinsol_superlumt.c +++ b/examples/sunlinsol/superlumt/test_sunlinsol_superlumt.c @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) SUNLinearSolver LS; /* linear solver object */ SUNMatrix A, B; /* test matrices */ N_Vector x, y, b; /* test vectors */ - realtype *matdata, *xdata; + sunrealtype *matdata, *xdata; int mattype, num_threads, print_timing; sunindextype i, j, k; SUNContext sunctx; @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) i = rand() % N; j = rand() % N; matdata = SUNDenseMatrix_Column(B,j); - matdata[i] = (realtype) rand() / (realtype) RAND_MAX / N; + matdata[i] = (sunrealtype) rand() / (sunrealtype) RAND_MAX / N; } /* Add identity to matrix */ @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) /* Fill x vector with uniform random data in [0,1] */ xdata = N_VGetArrayPointer(x); for (i=0; i */ static void -FormFullA(sunindextype n, sunindextype *nonz, realtype **nzval, sunindextype **rowind, sunindextype **colptr) +FormFullA(sunindextype n, sunindextype *nonz, sunrealtype **nzval, sunindextype **rowind, sunindextype **colptr) { register sunindextype i, j, k, col, new_nnz; sunindextype *t_rowind, *t_colptr, *al_rowind, *al_colptr, *a_rowind, *a_colptr; sunindextype *marker; - realtype *t_val, *al_val, *a_val; + sunrealtype *t_val, *al_val, *a_val; al_rowind = *rowind; al_colptr = *colptr; @@ -256,7 +256,7 @@ FormFullA(sunindextype n, sunindextype *nonz, realtype **nzval, sunindextype **r DREADRB_ABORT("malloc t_colptr[]"); if ( !(t_rowind = (sunindextype *) malloc( *nonz * sizeof(sunindextype)) ) ) DREADRB_ABORT("malloc fails for t_rowind[]"); - if ( !(t_val = (realtype*) malloc( *nonz * sizeof(realtype)) ) ) + if ( !(t_val = (sunrealtype*) malloc( *nonz * sizeof(sunrealtype)) ) ) DREADRB_ABORT("malloc fails for t_val[]"); /* Get counts of each column of T, and set up column pointers */ @@ -285,7 +285,7 @@ FormFullA(sunindextype n, sunindextype *nonz, realtype **nzval, sunindextype **r DREADRB_ABORT("malloc a_colptr[]"); if ( !(a_rowind = (sunindextype *) malloc( new_nnz * sizeof(sunindextype)) ) ) DREADRB_ABORT("malloc fails for a_rowind[]"); - if ( !(a_val = (realtype*) malloc( new_nnz * sizeof(realtype)) ) ) + if ( !(a_val = (sunrealtype*) malloc( new_nnz * sizeof(sunrealtype)) ) ) DREADRB_ABORT("malloc fails for a_val[]"); a_colptr[0] = 0; @@ -330,7 +330,7 @@ dreadrb_dist(int iam, FILE *fp, SUNMatrix *Aout, SUNContext sunctx) register sunindextype i, numer_lines = 0; sunindextype tmp, colnum, colsize, rownum, rowsize, valnum, valsize, nrow, ncol, nonz; sunindextype *rowind, *colptr; - realtype *nzval; + sunrealtype *nzval; char buf[100], type[4]; int sym; SUNMatrix A; diff --git a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp index 6cb291b273..c870c92fb9 100644 --- a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp +++ b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp @@ -256,7 +256,7 @@ int main(int argc, char* argv[]) /* ---------------------------------------------------------------------- * Check matrix * --------------------------------------------------------------------*/ -int check_matrix_csr(SUNMatrix A, SUNMatrix B, realtype tol) +int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure{0}; auto Amat{static_cast*>(A->content)->GkoMtx()}; @@ -284,7 +284,7 @@ int check_matrix_csr(SUNMatrix A, SUNMatrix B, realtype tol) return failure > 0; } -int check_matrix_dense(SUNMatrix A, SUNMatrix B, realtype tol) +int check_matrix_dense(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure{0}; auto Amat{static_cast*>(A->content)->GkoMtx()}; @@ -308,14 +308,14 @@ int check_matrix_dense(SUNMatrix A, SUNMatrix B, realtype tol) return failure > 0; } -extern "C" int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) +extern "C" int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol) { if (using_csr_matrix_type) return check_matrix_csr(A, B, tol); else if (using_dense_matrix_type) return check_matrix_dense(A, B, tol); else return 1; } -int check_matrix_entry_csr(SUNMatrix A, realtype val, realtype tol) +int check_matrix_entry_csr(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure{0}; auto Amat{static_cast*>(A->content)->GkoMtx()}; @@ -337,7 +337,7 @@ int check_matrix_entry_csr(SUNMatrix A, realtype val, realtype tol) return failure > 0; } -int check_matrix_entry_dense(SUNMatrix A, realtype val, realtype tol) +int check_matrix_entry_dense(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure{0}; auto Amat{static_cast*>(A->content)->GkoMtx()}; @@ -359,7 +359,7 @@ int check_matrix_entry_dense(SUNMatrix A, realtype val, realtype tol) return failure > 0; } -extern "C" int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) +extern "C" int check_matrix_entry(SUNMatrix A, sunrealtype val, sunrealtype tol) { if (using_csr_matrix_type) { return check_matrix_entry_csr(A, val, tol); @@ -372,7 +372,7 @@ extern "C" int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) } } -extern "C" int check_vector(N_Vector expected, N_Vector computed, realtype tol) +extern "C" int check_vector(N_Vector expected, N_Vector computed, sunrealtype tol) { int failure{0}; diff --git a/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp b/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp index 41d4379172..fa007d2a1e 100644 --- a/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp +++ b/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp @@ -51,9 +51,9 @@ int main(int argc, char *argv[]) sunindextype matrows, matcols; /* matrix dimensions */ sunindextype nblocks; /* number of blocks in matrix */ N_Vector x, y; /* test vectors */ - realtype *xdata, *ydata; /* pointers to vector data */ + sunrealtype *xdata, *ydata; /* pointers to vector data */ SUNMatrix A, I; /* test matrices */ - realtype *Adata, *Idata; /* pointers to matrix data */ + sunrealtype *Adata, *Idata; /* pointers to matrix data */ int print_timing, square; sunindextype i, j, k, m, n; SUNContext sunctx; @@ -113,9 +113,9 @@ int main(int argc, char *argv[]) I = SUNMatClone(A); /* Allocate host data */ - Adata = (realtype*) malloc(sizeof(realtype)*SUNMatrix_MagmaDense_LData(A)); + Adata = (sunrealtype*) malloc(sizeof(sunrealtype)*SUNMatrix_MagmaDense_LData(A)); if (square) - Idata = (realtype*) malloc(sizeof(realtype)*SUNMatrix_MagmaDense_LData(I)); + Idata = (sunrealtype*) malloc(sizeof(sunrealtype)*SUNMatrix_MagmaDense_LData(I)); /* Fill matrices and vectors */ for(k=0; k < nblocks; k++) { @@ -194,14 +194,14 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Check matrix * --------------------------------------------------------------------*/ -int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) +int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure = 0; sunindextype i = 0; sunindextype Aldata = SUNMatrix_MagmaDense_LData(A); sunindextype Bldata = SUNMatrix_MagmaDense_LData(B); - realtype *Adata = (realtype*) malloc(sizeof(realtype)*Aldata); - realtype *Bdata = (realtype*) malloc(sizeof(realtype)*Bldata); + sunrealtype *Adata = (sunrealtype*) malloc(sizeof(sunrealtype)*Aldata); + sunrealtype *Bdata = (sunrealtype*) malloc(sizeof(sunrealtype)*Bldata); /* copy data to host */ SUNMatrix_MagmaDense_CopyFromDevice(A, Adata); @@ -227,12 +227,12 @@ int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) return(0); } -int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) +int check_matrix_entry(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure = 0; sunindextype i = 0; sunindextype Aldata = SUNMatrix_MagmaDense_LData(A); - realtype *Adata = (realtype*) malloc(sizeof(realtype)*Aldata); + sunrealtype *Adata = (sunrealtype*) malloc(sizeof(sunrealtype)*Aldata); /* copy data to host */ SUNMatrix_MagmaDense_CopyFromDevice(A, Adata); @@ -254,10 +254,10 @@ int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) return(0); } -int check_vector(N_Vector actual, N_Vector expected, realtype tol) +int check_vector(N_Vector actual, N_Vector expected, sunrealtype tol) { int failure = 0; - realtype *xdata, *ydata; + sunrealtype *xdata, *ydata; sunindextype xldata, yldata; sunindextype i; @@ -301,7 +301,7 @@ int check_vector(N_Vector actual, N_Vector expected, realtype tol) booleantype has_data(SUNMatrix A) { - realtype *Adata = SUNMatrix_MagmaDense_Data(A); + sunrealtype *Adata = SUNMatrix_MagmaDense_Data(A); if (Adata == NULL) return SUNFALSE; else diff --git a/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp b/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp index 615e1ee9dd..51ea7d61a1 100644 --- a/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp +++ b/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) } // Allocate host data - realtype* Adata = (realtype*) malloc(sizeof(realtype)*SUNMatrix_OneMklDense_LData(A)); + sunrealtype* Adata = (sunrealtype*) malloc(sizeof(sunrealtype)*SUNMatrix_OneMklDense_LData(A)); if (!Adata) { printf("Data allocation failed\n"); @@ -187,10 +187,10 @@ int main(int argc, char *argv[]) SUNMatDestroy(A); } - realtype* Idata = NULL; + sunrealtype* Idata = NULL; if (square) { - Idata = (realtype*) malloc(sizeof(realtype)*SUNMatrix_OneMklDense_LData(I)); + Idata = (sunrealtype*) malloc(sizeof(sunrealtype)*SUNMatrix_OneMklDense_LData(I)); if (!Idata) { printf("Data allocation failed\n"); @@ -224,7 +224,7 @@ int main(int argc, char *argv[]) SUNMatrix_OneMklDense_CopyToDevice(I, Idata); } - realtype* xdata = N_VGetArrayPointer(x); + sunrealtype* xdata = N_VGetArrayPointer(x); for(k = 0; k < nblocks; k++) for(i = 0; i < matcols; i++) xdata[matcols * k + i] = ONE / (i+1); @@ -233,7 +233,7 @@ int main(int argc, char *argv[]) N_VCopyToDevice_Sycl(x); - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); for(k = 0; k < nblocks; k++) { for(i = 0; i < matrows; i++) @@ -290,14 +290,14 @@ int main(int argc, char *argv[]) * ---------------------------------------------------------------------------*/ -int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) +int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure = 0; sunindextype i = 0; sunindextype Aldata = SUNMatrix_OneMklDense_LData(A); sunindextype Bldata = SUNMatrix_OneMklDense_LData(B); - realtype *Adata = (realtype*) malloc(sizeof(realtype) * Aldata); - realtype *Bdata = (realtype*) malloc(sizeof(realtype) * Bldata); + sunrealtype *Adata = (sunrealtype*) malloc(sizeof(sunrealtype) * Aldata); + sunrealtype *Bdata = (sunrealtype*) malloc(sizeof(sunrealtype) * Bldata); // Copy data to host SUNMatrix_OneMklDense_CopyFromDevice(A, Adata); @@ -326,12 +326,12 @@ int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) } -int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) +int check_matrix_entry(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure = 0; sunindextype i = 0; sunindextype Aldata = SUNMatrix_OneMklDense_LData(A); - realtype *Adata = (realtype*) malloc(sizeof(realtype) * Aldata); + sunrealtype *Adata = (sunrealtype*) malloc(sizeof(sunrealtype) * Aldata); // copy data to host SUNMatrix_OneMklDense_CopyFromDevice(A, Adata); @@ -356,10 +356,10 @@ int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) } -int check_vector(N_Vector actual, N_Vector expected, realtype tol) +int check_vector(N_Vector actual, N_Vector expected, sunrealtype tol) { int failure = 0; - realtype *xdata, *ydata; + sunrealtype *xdata, *ydata; sunindextype xldata, yldata; sunindextype i; @@ -403,7 +403,7 @@ int check_vector(N_Vector actual, N_Vector expected, realtype tol) booleantype has_data(SUNMatrix A) { - realtype *Adata = SUNMatrix_OneMklDense_Data(A); + sunrealtype *Adata = SUNMatrix_OneMklDense_Data(A); if (Adata == NULL) return SUNFALSE; else diff --git a/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp b/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp index cf2088e392..a323c93a9c 100644 --- a/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp +++ b/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp @@ -37,7 +37,7 @@ static int print_all_ranks; static int print_timing; /* helper functions */ -int csr_from_dense(SUNMatrix Ad, realtype droptol, realtype **matdata, +int csr_from_dense(SUNMatrix Ad, sunrealtype droptol, sunrealtype **matdata, sunindextype **colind, sunindextype **rowptrs); /* ---------------------------------------------------------------------------- @@ -53,13 +53,13 @@ int main(int argc, char *argv[]) gridinfo_t grid; /* SuperLU-DIST process grid */ sunindextype M, N; /* matrix size */ - realtype *matdata; /* pointer to matrix data */ + sunrealtype *matdata; /* pointer to matrix data */ sunindextype *rowptrs, *colind; /* indexptrs and indexvals */ SUNMatrix D, A, I; /* global and local matrices */ SuperMatrix *Asuper, *Isuper; /* SLU_NR_loc SuperMatrices */ NRformat_loc *Istore; /* SuperMatrix->Store */ N_Vector gx, gy, x, y; /* test vectors */ - realtype *xdata, *ydata; /* vector data */ + sunrealtype *xdata, *ydata; /* vector data */ sunindextype M_local; /* num rows in local matrix */ sunindextype Mnprocs; /* M/nprocs */ sunindextype Mrem; /* M%nprocs */ @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) i = rand() % N; j = rand() % N; matdata = SUNDenseMatrix_Column(D,j); - matdata[i] = (realtype) rand() / (realtype) RAND_MAX / N; + matdata[i] = (sunrealtype) rand() / (sunrealtype) RAND_MAX / N; } /* Add identity to matrix */ @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) /* fill x with random data, then find y = Dx using Matvec */ for (i=0; i>> FAIL: SUNMatMatvec failed for dense matrix\n", grid.iam); SUNMatDestroy(D); N_VDestroy(gx); N_VDestroy(gy); @@ -187,7 +187,7 @@ int main(int argc, char *argv[]) /* distribute matrix and vectors */ for (i=1; iStore; - matdata = (realtype *) Istore->nzval; + matdata = (sunrealtype *) Istore->nzval; rowptrs = (sunindextype *) Istore->rowptr; colind = (sunindextype *) Istore->colind; @@ -364,13 +364,13 @@ int main(int argc, char *argv[]) /* ---------------------------------------------------------------------- * Check matrix * --------------------------------------------------------------------*/ -int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) +int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure = 0; gridinfo_t *grid; SuperMatrix *Asuper, *Bsuper; NRformat_loc *Astore, *Bstore; - realtype *Adata, *Bdata; + sunrealtype *Adata, *Bdata; sunindextype *Aindexptrs, *Bindexptrs; sunindextype *Aindexvals, *Bindexvals; sunindextype i, Arows, Brows, Annz, Bnnz; @@ -380,7 +380,7 @@ int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) /* get matrix pointers */ Asuper = SUNMatrix_SLUNRloc_SuperMatrix(A); Astore = (NRformat_loc*) Asuper->Store; - Adata = (realtype*) Astore->nzval; + Adata = (sunrealtype*) Astore->nzval; Aindexptrs = Astore->rowptr; Aindexvals = Astore->colind; Arows = Astore->m_loc; @@ -388,7 +388,7 @@ int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) Bsuper = SUNMatrix_SLUNRloc_SuperMatrix(B); Bstore = (NRformat_loc*) Bsuper->Store; - Bdata = (realtype*) Bstore->nzval; + Bdata = (sunrealtype*) Bstore->nzval; Bindexptrs = Bstore->rowptr; Bindexvals = Bstore->colind; Brows = Bstore->m_loc; @@ -457,18 +457,18 @@ int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol) return(0); } -int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) +int check_matrix_entry(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure = 0; SuperMatrix *Asuper; NRformat_loc *Astore; - realtype *Adata; + sunrealtype *Adata; sunindextype i, nnz_loc; /* get matrix pointers */ Asuper = SUNMatrix_SLUNRloc_SuperMatrix(A); Astore = (NRformat_loc*) Asuper->Store; - Adata = (realtype*) Astore->nzval; + Adata = (sunrealtype*) Astore->nzval; /* compare data */ nnz_loc = Astore->nnz_loc; @@ -487,10 +487,10 @@ int check_matrix_entry(SUNMatrix A, realtype val, realtype tol) return(0); } -int check_vector(N_Vector x, N_Vector y, realtype tol) +int check_vector(N_Vector x, N_Vector y, sunrealtype tol) { int failure = 0; - realtype *xdata, *ydata; + sunrealtype *xdata, *ydata; sunindextype xldata, yldata; sunindextype i; @@ -521,12 +521,12 @@ booleantype has_data(SUNMatrix A) { SuperMatrix *Asuper; NRformat_loc *Astore; - realtype *Adata; + sunrealtype *Adata; /* get matrix pointers */ Asuper = SUNMatrix_SLUNRloc_SuperMatrix(A); Astore = (NRformat_loc*) Asuper->Store; - Adata = (realtype*) Astore->nzval; + Adata = (sunrealtype*) Astore->nzval; if (Adata == NULL) return SUNFALSE; @@ -543,7 +543,7 @@ booleantype is_square(SUNMatrix A) return SUNFALSE; } -int csr_from_dense(SUNMatrix Ad, realtype droptol, realtype **matdata, +int csr_from_dense(SUNMatrix Ad, sunrealtype droptol, sunrealtype **matdata, sunindextype **colind, sunindextype **rowptrs) { sunindextype i, j, nnz; @@ -565,7 +565,7 @@ int csr_from_dense(SUNMatrix Ad, realtype droptol, realtype **matdata, nnz += (std::abs(SM_ELEMENT_D(Ad,i,j)) > droptol); /* allocate */ - (*matdata) = (realtype*) malloc(nnz*sizeof(realtype)); + (*matdata) = (sunrealtype*) malloc(nnz*sizeof(sunrealtype)); (*colind) = (sunindextype*) malloc(nnz*sizeof(sunindextype)); (*rowptrs) = (sunindextype*) malloc((M+1)*sizeof(sunindextype)); diff --git a/examples/sunmatrix/sparse/test_sunmatrix_sparse.c b/examples/sunmatrix/sparse/test_sunmatrix_sparse.c index ecfcd4fdfd..dcb36f3d4f 100644 --- a/examples/sunmatrix/sparse/test_sunmatrix_sparse.c +++ b/examples/sunmatrix/sparse/test_sunmatrix_sparse.c @@ -44,9 +44,9 @@ int main(int argc, char *argv[]) sunindextype matrows, matcols; /* matrix dims */ int mattype; /* matrix storage type */ N_Vector x, y, z; /* test vectors */ - realtype* vecdata; /* pointers to vector data */ + sunrealtype* vecdata; /* pointers to vector data */ SUNMatrix A, B, C, D, I; /* test matrices */ - realtype* matdata; /* pointer to matrix data */ + sunrealtype* matdata; /* pointer to matrix data */ sunindextype i, j, k, kstart, kend, N, uband, lband; sunindextype *colptrs, *rowindices; sunindextype *rowptrs, *colindices; @@ -322,13 +322,13 @@ int main(int argc, char *argv[]) i = rand() % matrows; j = rand() % matcols; matdata = SUNDenseMatrix_Column(D,j); - matdata[i] = (realtype) rand() / (realtype) RAND_MAX; + matdata[i] = (sunrealtype) rand() / (sunrealtype) RAND_MAX; } for (k=0; kops->matvec == NULL) { TEST_STATUS(" PASSED test -- SUNMatMatvec not implemented\n", myid); diff --git a/examples/sunmatrix/test_sunmatrix.h b/examples/sunmatrix/test_sunmatrix.h index 2a10c980aa..e6da14544c 100644 --- a/examples/sunmatrix/test_sunmatrix.h +++ b/examples/sunmatrix/test_sunmatrix.h @@ -57,9 +57,9 @@ extern "C" { #endif /* Forward declarations for implementation specific utility functions */ - int check_matrix(SUNMatrix A, SUNMatrix B, realtype tol); - int check_matrix_entry(SUNMatrix A, realtype val, realtype tol); - int check_vector(N_Vector expected, N_Vector computed, realtype tol); + int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol); + int check_matrix_entry(SUNMatrix A, sunrealtype val, sunrealtype tol); + int check_vector(N_Vector expected, N_Vector computed, sunrealtype tol); booleantype has_data(SUNMatrix A); booleantype is_square(SUNMatrix A); void sync_device(SUNMatrix A); diff --git a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c index e773eeb7f6..a7931d7a29 100644 --- a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c +++ b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c @@ -82,7 +82,7 @@ #define ZTRUE -PI/SIX /* Check the system solution */ -static int check_ans(N_Vector ycur, realtype tol); +static int check_ans(N_Vector ycur, sunrealtype tol); /* Check function return values */ static int check_retval(void *flagvalue, const char *funcname, int opt); @@ -92,7 +92,7 @@ static int FPFunction(N_Vector y, N_Vector f, void *mem); /* Convergence test function */ static int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, - realtype tol, N_Vector ewt, void* mem); + sunrealtype tol, N_Vector ewt, void* mem); /* * Proxy for integrator memory struct @@ -114,17 +114,17 @@ int main(int argc, char *argv[]) IntegratorMem Imem = NULL; int retval = 0; SUNNonlinearSolver NLS = NULL; - realtype tol = 100 * SUNRsqrt(UNIT_ROUNDOFF); + sunrealtype tol = 100 * SUNRsqrt(UNIT_ROUNDOFF); int mxiter = 20; int maa = 0; /* no acceleration */ - realtype damping = RCONST(1.0); /* no damping */ + sunrealtype damping = RCONST(1.0); /* no damping */ long int niters = 0; - realtype* data = NULL; + sunrealtype* data = NULL; SUNContext sunctx = NULL; /* Check if a acceleration/dampling values were provided */ if (argc > 1) maa = (long int) atoi(argv[1]); - if (argc > 2) damping = (realtype) atof(argv[2]); + if (argc > 2) damping = (sunrealtype) atof(argv[2]); /* Print problem description */ printf("Solve the nonlinear system:\n"); @@ -226,10 +226,10 @@ int main(int argc, char *argv[]) } /* Proxy for integrator convergence test function */ -int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, realtype tol, +int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* mem) { - realtype delnrm; + sunrealtype delnrm; /* compute the norm of the correction */ delnrm = N_VMaxNorm(del); @@ -262,9 +262,9 @@ int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, realtype tol, int FPFunction(N_Vector ycor, N_Vector gvec, void *mem) { IntegratorMem Imem; - realtype* ydata = NULL; - realtype* gdata = NULL; - realtype x, y, z; + sunrealtype* ydata = NULL; + sunrealtype* gdata = NULL; + sunrealtype x, y, z; if (mem == NULL) { printf("ERROR: Integrator memory is NULL"); @@ -300,10 +300,10 @@ int FPFunction(N_Vector ycor, N_Vector gvec, void *mem) /* ----------------------------------------------------------------------------- * Check the solution of the nonlinear system and return PASS or FAIL * ---------------------------------------------------------------------------*/ -static int check_ans(N_Vector ycur, realtype tol) +static int check_ans(N_Vector ycur, sunrealtype tol) { - realtype* data = NULL; - realtype ex, ey, ez; + sunrealtype* data = NULL; + sunrealtype ex, ey, ez; /* Get vector data array */ data = N_VGetArrayPointer(ycur); diff --git a/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c b/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c index f0b80bfa77..b24209b22e 100644 --- a/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c +++ b/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c @@ -57,7 +57,7 @@ static int check_retval(void *flagvalue, const char *funcname, int opt); static int Res(N_Vector y, N_Vector f, void *mem); /* Jacobian of the nonlinear residual */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* @@ -83,7 +83,7 @@ static int LSolve(N_Vector b, void* mem); /* Convergence test function */ static int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, - realtype tol, N_Vector ewt, void* mem); + sunrealtype tol, N_Vector ewt, void* mem); /* ----------------------------------------------------------------------------- * Main testing routine @@ -264,10 +264,10 @@ int LSolve(N_Vector b, void* mem) /* Proxy for integrator convergence test function */ -int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, realtype tol, +int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* mem) { - realtype delnrm; + sunrealtype delnrm; /* compute the norm of the correction */ delnrm = N_VWrmsNorm(del, ewt); @@ -288,7 +288,7 @@ int ConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, realtype tol, int Res(N_Vector ycor, N_Vector f, void *mem) { IntegratorMem Imem; - realtype y1, y2, y3; + sunrealtype y1, y2, y3; if (mem == NULL) { printf("ERROR: Integrator memory is NULL"); @@ -322,10 +322,10 @@ int Res(N_Vector ycor, N_Vector f, void *mem) * ( 6x -4 2z ) * * ---------------------------------------------------------------------------*/ -int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype y1, y2, y3; + sunrealtype y1, y2, y3; y1 = NV_Ith_S(y,0); y2 = NV_Ith_S(y,1); diff --git a/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c b/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c index 56fb587b40..d859c2b4fc 100644 --- a/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c +++ b/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) if (check_retval(&retval, "SUNNonlinSolSolve", 1)) return(1); /* get the solution */ - realtype yvals[3]; + sunrealtype yvals[3]; sunindextype indc[3] = {0, 1, 2}; VecGetValues(Y, 3, indc, yvals); @@ -184,8 +184,8 @@ int main(int argc, char *argv[]) int Res(N_Vector y, N_Vector f, void *mem) { Vec yvec, fvec; - realtype vals[3]; - realtype y1, y2, y3; + sunrealtype vals[3]; + sunrealtype y1, y2, y3; yvec = N_VGetVector_Petsc(y); fvec = N_VGetVector_Petsc(f); @@ -221,8 +221,8 @@ int Res(N_Vector y, N_Vector f, void *mem) * ---------------------------------------------------------------------------*/ int Jac(SNES snes, Vec y, Mat J, Mat Jpre, void *ctx) { - realtype y1, y2, y3; - realtype yvals[3]; + sunrealtype y1, y2, y3; + sunrealtype yvals[3]; /* set vector indices */ sunindextype indc[3] = { 0, 1, 2 }; @@ -232,7 +232,7 @@ int Jac(SNES snes, Vec y, Mat J, Mat Jpre, void *ctx) y1 = yvals[0]; y2 = yvals[1]; y3 = yvals[2]; /* set the Jacobian values */ - realtype jvals[3][3] = { { TWO*y1, TWO*y2, TWO*y3 }, + sunrealtype jvals[3][3] = { { TWO*y1, TWO*y2, TWO*y3 }, { FOUR*y1, TWO*y2, -FOUR }, { SIX*y1, -FOUR, TWO*y3 } }; MatSetValues(J, 3, indc, 3, indc, &jvals[0][0], INSERT_VALUES); diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 3b12589182..bdeaacee40 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -144,11 +144,11 @@ extern "C" { * User-Supplied Function Types * ------------------------------ */ -typedef int (*ARKRhsFn)(realtype t, N_Vector y, +typedef int (*ARKRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -typedef int (*ARKRootFn)(realtype t, N_Vector y, - realtype *gout, void *user_data); +typedef int (*ARKRootFn)(sunrealtype t, N_Vector y, + sunrealtype *gout, void *user_data); typedef int (*ARKEwtFn)(N_Vector y, N_Vector ewt, void *user_data); @@ -158,25 +158,25 @@ typedef void (*ARKErrHandlerFn)(int error_code, const char *module, const char *function, char *msg, void *user_data); -typedef int (*ARKAdaptFn)(N_Vector y, realtype t, realtype h1, - realtype h2, realtype h3, - realtype e1, realtype e2, - realtype e3, int q, int p, - realtype *hnew, void *user_data); +typedef int (*ARKAdaptFn)(N_Vector y, sunrealtype t, sunrealtype h1, + sunrealtype h2, sunrealtype h3, + sunrealtype e1, sunrealtype e2, + sunrealtype e3, int q, int p, + sunrealtype *hnew, void *user_data); -typedef int (*ARKExpStabFn)(N_Vector y, realtype t, - realtype *hstab, void *user_data); +typedef int (*ARKExpStabFn)(N_Vector y, sunrealtype t, + sunrealtype *hstab, void *user_data); typedef int (*ARKVecResizeFn)(N_Vector y, N_Vector ytemplate, void *user_data); -typedef int (*ARKPostProcessFn)(realtype t, N_Vector y, +typedef int (*ARKPostProcessFn)(sunrealtype t, N_Vector y, void *user_data); -typedef int (*ARKStagePredictFn)(realtype t, N_Vector zpred, +typedef int (*ARKStagePredictFn)(sunrealtype t, N_Vector zpred, void *user_data); -typedef int (*ARKRelaxFn)(N_Vector y, realtype* r, void* user_data); +typedef int (*ARKRelaxFn)(N_Vector y, sunrealtype* r, void* user_data); typedef int (*ARKRelaxJacFn)(N_Vector y, N_Vector J, void* user_data); diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 91167b7f5a..cddbf122d1 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -65,32 +65,32 @@ static const int ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5; /* Create, Resize, and Reinitialization functions */ SUNDIALS_EXPORT void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, - realtype t0, N_Vector y0, + sunrealtype t0, N_Vector y0, SUNContext sunctx); SUNDIALS_EXPORT int ARKStepResize(void *arkode_mem, N_Vector ynew, - realtype hscale, realtype t0, + sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void *resize_data); SUNDIALS_EXPORT int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, - ARKRhsFn fi, realtype t0, N_Vector y0); + ARKRhsFn fi, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int ARKStepReset(void* arkode_mem, realtype tR, N_Vector yR); +SUNDIALS_EXPORT int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Tolerance input functions */ SUNDIALS_EXPORT int ARKStepSStolerances(void *arkode_mem, - realtype reltol, - realtype abstol); + sunrealtype reltol, + sunrealtype abstol); SUNDIALS_EXPORT int ARKStepSVtolerances(void *arkode_mem, - realtype reltol, + sunrealtype reltol, N_Vector abstol); SUNDIALS_EXPORT int ARKStepWFtolerances(void *arkode_mem, ARKEwtFn efun); /* Residual tolerance input functions */ SUNDIALS_EXPORT int ARKStepResStolerance(void *arkode_mem, - realtype rabstol); + sunrealtype rabstol); SUNDIALS_EXPORT int ARKStepResVtolerance(void *arkode_mem, N_Vector rabstol); SUNDIALS_EXPORT int ARKStepResFtolerance(void *arkode_mem, @@ -134,38 +134,38 @@ SUNDIALS_EXPORT int ARKStepSetTableNum(void *arkode_mem, SUNDIALS_EXPORT int ARKStepSetTableName(void *arkode_mem, const char *itable, const char *etable); SUNDIALS_EXPORT int ARKStepSetCFLFraction(void *arkode_mem, - realtype cfl_frac); + sunrealtype cfl_frac); SUNDIALS_EXPORT int ARKStepSetSafetyFactor(void *arkode_mem, - realtype safety); + sunrealtype safety); SUNDIALS_EXPORT int ARKStepSetErrorBias(void *arkode_mem, - realtype bias); + sunrealtype bias); SUNDIALS_EXPORT int ARKStepSetMaxGrowth(void *arkode_mem, - realtype mx_growth); + sunrealtype mx_growth); SUNDIALS_EXPORT int ARKStepSetMinReduction(void *arkode_mem, - realtype eta_min); + sunrealtype eta_min); SUNDIALS_EXPORT int ARKStepSetFixedStepBounds(void *arkode_mem, - realtype lb, realtype ub); + sunrealtype lb, sunrealtype ub); SUNDIALS_EXPORT int ARKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, int pq, - realtype adapt_params[3]); + sunrealtype adapt_params[3]); SUNDIALS_EXPORT int ARKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data); SUNDIALS_EXPORT int ARKStepSetMaxFirstGrowth(void *arkode_mem, - realtype etamx1); + sunrealtype etamx1); SUNDIALS_EXPORT int ARKStepSetMaxEFailGrowth(void *arkode_mem, - realtype etamxf); + sunrealtype etamxf); SUNDIALS_EXPORT int ARKStepSetSmallNumEFails(void *arkode_mem, int small_nef); SUNDIALS_EXPORT int ARKStepSetMaxCFailGrowth(void *arkode_mem, - realtype etacf); + sunrealtype etacf); SUNDIALS_EXPORT int ARKStepSetNonlinCRDown(void *arkode_mem, - realtype crdown); + sunrealtype crdown); SUNDIALS_EXPORT int ARKStepSetNonlinRDiv(void *arkode_mem, - realtype rdiv); + sunrealtype rdiv); SUNDIALS_EXPORT int ARKStepSetDeltaGammaMax(void *arkode_mem, - realtype dgmax); + sunrealtype dgmax); SUNDIALS_EXPORT int ARKStepSetLSetupFrequency(void *arkode_mem, int msbp); SUNDIALS_EXPORT int ARKStepSetPredictorMethod(void *arkode_mem, @@ -180,7 +180,7 @@ SUNDIALS_EXPORT int ARKStepSetMaxNonlinIters(void *arkode_mem, SUNDIALS_EXPORT int ARKStepSetMaxConvFails(void *arkode_mem, int maxncf); SUNDIALS_EXPORT int ARKStepSetNonlinConvCoef(void *arkode_mem, - realtype nlscoef); + sunrealtype nlscoef); SUNDIALS_EXPORT int ARKStepSetConstraints(void *arkode_mem, N_Vector constraints); SUNDIALS_EXPORT int ARKStepSetMaxNumSteps(void *arkode_mem, @@ -188,18 +188,18 @@ SUNDIALS_EXPORT int ARKStepSetMaxNumSteps(void *arkode_mem, SUNDIALS_EXPORT int ARKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil); SUNDIALS_EXPORT int ARKStepSetInitStep(void *arkode_mem, - realtype hin); + sunrealtype hin); SUNDIALS_EXPORT int ARKStepSetMinStep(void *arkode_mem, - realtype hmin); + sunrealtype hmin); SUNDIALS_EXPORT int ARKStepSetMaxStep(void *arkode_mem, - realtype hmax); + sunrealtype hmax); SUNDIALS_EXPORT int ARKStepSetInterpolateStopTime(void *arkode_mem, booleantype interp); SUNDIALS_EXPORT int ARKStepSetStopTime(void *arkode_mem, - realtype tstop); + sunrealtype tstop); SUNDIALS_EXPORT int ARKStepClearStopTime(void *arkode_mem); SUNDIALS_EXPORT int ARKStepSetFixedStep(void *arkode_mem, - realtype hfixed); + sunrealtype hfixed); SUNDIALS_EXPORT int ARKStepSetMaxNumConstrFails(void *arkode_mem, int maxfails); @@ -230,12 +230,12 @@ SUNDIALS_EXPORT int ARKStepSetJacEvalFrequency(void *arkode_mem, long int msbj); SUNDIALS_EXPORT int ARKStepSetLinearSolutionScaling(void *arkode_mem, booleantype onoff); -SUNDIALS_EXPORT int ARKStepSetEpsLin(void *arkode_mem, realtype eplifac); -SUNDIALS_EXPORT int ARKStepSetMassEpsLin(void *arkode_mem, realtype eplifac); +SUNDIALS_EXPORT int ARKStepSetEpsLin(void *arkode_mem, sunrealtype eplifac); +SUNDIALS_EXPORT int ARKStepSetMassEpsLin(void *arkode_mem, sunrealtype eplifac); SUNDIALS_EXPORT int ARKStepSetLSNormFactor(void *arkode_mem, - realtype nrmfac); + sunrealtype nrmfac); SUNDIALS_EXPORT int ARKStepSetMassLSNormFactor(void *arkode_mem, - realtype nrmfac); + sunrealtype nrmfac); SUNDIALS_EXPORT int ARKStepSetPreconditioner(void *arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve); @@ -254,12 +254,12 @@ SUNDIALS_EXPORT int ARKStepSetMassTimes(void *arkode_mem, SUNDIALS_EXPORT int ARKStepSetLinSysFn(void *arkode_mem, ARKLsLinSysFn linsys); /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int ARKStepEvolve(void *arkode_mem, realtype tout, - N_Vector yout, realtype *tret, +SUNDIALS_EXPORT int ARKStepEvolve(void *arkode_mem, sunrealtype tout, + N_Vector yout, sunrealtype *tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int ARKStepGetDky(void *arkode_mem, realtype t, +SUNDIALS_EXPORT int ARKStepGetDky(void *arkode_mem, sunrealtype t, int k, N_Vector dky); /* Utility function to update/compute y based on zcor */ @@ -291,21 +291,21 @@ SUNDIALS_EXPORT int ARKStepGetWorkSpace(void *arkode_mem, SUNDIALS_EXPORT int ARKStepGetNumSteps(void *arkode_mem, long int *nsteps); SUNDIALS_EXPORT int ARKStepGetActualInitStep(void *arkode_mem, - realtype *hinused); + sunrealtype *hinused); SUNDIALS_EXPORT int ARKStepGetLastStep(void *arkode_mem, - realtype *hlast); + sunrealtype *hlast); SUNDIALS_EXPORT int ARKStepGetCurrentStep(void *arkode_mem, - realtype *hcur); + sunrealtype *hcur); SUNDIALS_EXPORT int ARKStepGetCurrentTime(void *arkode_mem, - realtype *tcur); + sunrealtype *tcur); SUNDIALS_EXPORT int ARKStepGetCurrentState(void *arkode_mem, N_Vector *state); SUNDIALS_EXPORT int ARKStepGetCurrentGamma(void *arkode_mem, - realtype *gamma); + sunrealtype *gamma); SUNDIALS_EXPORT int ARKStepGetCurrentMassMatrix(void *arkode_mem, SUNMatrix *M); SUNDIALS_EXPORT int ARKStepGetTolScaleFactor(void *arkode_mem, - realtype *tolsfac); + sunrealtype *tolsfac); SUNDIALS_EXPORT int ARKStepGetErrWeights(void *arkode_mem, N_Vector eweight); SUNDIALS_EXPORT int ARKStepGetResWeights(void *arkode_mem, @@ -338,18 +338,18 @@ SUNDIALS_EXPORT int ARKStepGetTimestepperStats(void *arkode_mem, long int *netfails); SUNDIALS_EXPORT int ARKStepGetStepStats(void *arkode_mem, long int *nsteps, - realtype *hinused, - realtype *hlast, - realtype *hcur, - realtype *tcur); + sunrealtype *hinused, + sunrealtype *hlast, + sunrealtype *hcur, + sunrealtype *tcur); /* Nonlinear solver optional output functions */ SUNDIALS_EXPORT int ARKStepGetNonlinearSystemData(void *arkode_mem, - realtype *tcur, + sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, - realtype *gamma, + sunrealtype *gamma, N_Vector *sdata, void **user_data); diff --git a/include/arkode/arkode_bbdpre.h b/include/arkode/arkode_bbdpre.h index 6fb216b40c..3796def78c 100644 --- a/include/arkode/arkode_bbdpre.h +++ b/include/arkode/arkode_bbdpre.h @@ -28,10 +28,10 @@ extern "C" { /* User-supplied function Types */ -typedef int (*ARKLocalFn)(sunindextype Nlocal, realtype t, +typedef int (*ARKLocalFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector g, void *user_data); -typedef int (*ARKCommFn)(sunindextype Nlocal, realtype t, +typedef int (*ARKCommFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, void *user_data); /* Exported Functions */ @@ -42,14 +42,14 @@ SUNDIALS_EXPORT int ARKBBDPrecInit(void *arkode_mem, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dqrely, + sunrealtype dqrely, ARKLocalFn gloc, ARKCommFn cfn); SUNDIALS_EXPORT int ARKBBDPrecReInit(void *arkode_mem, sunindextype mudq, sunindextype mldq, - realtype dqrely); + sunrealtype dqrely); /* Optional output functions */ diff --git a/include/arkode/arkode_butcher.h b/include/arkode/arkode_butcher.h index 1c842ebd40..82683d7a97 100644 --- a/include/arkode/arkode_butcher.h +++ b/include/arkode/arkode_butcher.h @@ -33,10 +33,10 @@ struct ARKodeButcherTableMem { int q; /* method order of accuracy */ int p; /* embedding order of accuracy */ int stages; /* number of stages */ - realtype **A; /* Butcher table coefficients */ - realtype *c; /* canopy node coefficients */ - realtype *b; /* root node coefficients */ - realtype *d; /* embedding coefficients */ + sunrealtype **A; /* Butcher table coefficients */ + sunrealtype *c; /* canopy node coefficients */ + sunrealtype *b; /* root node coefficients */ + sunrealtype *d; /* embedding coefficients */ }; @@ -49,10 +49,10 @@ SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, booleantype embedded); SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, - realtype *c, - realtype *A, - realtype *b, - realtype *d); + sunrealtype *c, + sunrealtype *A, + sunrealtype *b, + sunrealtype *d); SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Copy(ARKodeButcherTable B); SUNDIALS_EXPORT void ARKodeButcherTable_Space(ARKodeButcherTable B, sunindextype *liw, diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index cd4e5c7018..f9fc3a9503 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -43,26 +43,26 @@ static const int ERKSTEP_DEFAULT_8 = ARKODE_FEHLBERG_13_7_8; * ------------------- */ /* Create, Resize, and Reinitialization functions */ -SUNDIALS_EXPORT void* ERKStepCreate(ARKRhsFn f, realtype t0, +SUNDIALS_EXPORT void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx); SUNDIALS_EXPORT int ERKStepResize(void *arkode_mem, N_Vector ynew, - realtype hscale, realtype t0, + sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void *resize_data); SUNDIALS_EXPORT int ERKStepReInit(void* arkode_mem, ARKRhsFn f, - realtype t0, N_Vector y0); + sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int ERKStepReset(void* arkode_mem, realtype tR, +SUNDIALS_EXPORT int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Tolerance input functions */ SUNDIALS_EXPORT int ERKStepSStolerances(void *arkode_mem, - realtype reltol, - realtype abstol); + sunrealtype reltol, + sunrealtype abstol); SUNDIALS_EXPORT int ERKStepSVtolerances(void *arkode_mem, - realtype reltol, + sunrealtype reltol, N_Vector abstol); SUNDIALS_EXPORT int ERKStepWFtolerances(void *arkode_mem, ARKEwtFn efun); @@ -82,28 +82,28 @@ SUNDIALS_EXPORT int ERKStepSetTable(void *arkode_mem, SUNDIALS_EXPORT int ERKStepSetTableNum(void *arkode_mem, ARKODE_ERKTableID etable); SUNDIALS_EXPORT int ERKStepSetTableName(void *arkode_mem, const char *etable); SUNDIALS_EXPORT int ERKStepSetCFLFraction(void *arkode_mem, - realtype cfl_frac); + sunrealtype cfl_frac); SUNDIALS_EXPORT int ERKStepSetSafetyFactor(void *arkode_mem, - realtype safety); + sunrealtype safety); SUNDIALS_EXPORT int ERKStepSetErrorBias(void *arkode_mem, - realtype bias); + sunrealtype bias); SUNDIALS_EXPORT int ERKStepSetMaxGrowth(void *arkode_mem, - realtype mx_growth); + sunrealtype mx_growth); SUNDIALS_EXPORT int ERKStepSetMinReduction(void *arkode_mem, - realtype eta_min); + sunrealtype eta_min); SUNDIALS_EXPORT int ERKStepSetFixedStepBounds(void *arkode_mem, - realtype lb, realtype ub); + sunrealtype lb, sunrealtype ub); SUNDIALS_EXPORT int ERKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, int pq, - realtype adapt_params[3]); + sunrealtype adapt_params[3]); SUNDIALS_EXPORT int ERKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data); SUNDIALS_EXPORT int ERKStepSetMaxFirstGrowth(void *arkode_mem, - realtype etamx1); + sunrealtype etamx1); SUNDIALS_EXPORT int ERKStepSetMaxEFailGrowth(void *arkode_mem, - realtype etamxf); + sunrealtype etamxf); SUNDIALS_EXPORT int ERKStepSetSmallNumEFails(void *arkode_mem, int small_nef); SUNDIALS_EXPORT int ERKStepSetStabilityFn(void *arkode_mem, @@ -118,18 +118,18 @@ SUNDIALS_EXPORT int ERKStepSetMaxNumSteps(void *arkode_mem, SUNDIALS_EXPORT int ERKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil); SUNDIALS_EXPORT int ERKStepSetInitStep(void *arkode_mem, - realtype hin); + sunrealtype hin); SUNDIALS_EXPORT int ERKStepSetMinStep(void *arkode_mem, - realtype hmin); + sunrealtype hmin); SUNDIALS_EXPORT int ERKStepSetMaxStep(void *arkode_mem, - realtype hmax); + sunrealtype hmax); SUNDIALS_EXPORT int ERKStepSetInterpolateStopTime(void *arkode_mem, booleantype interp); SUNDIALS_EXPORT int ERKStepSetStopTime(void *arkode_mem, - realtype tstop); + sunrealtype tstop); SUNDIALS_EXPORT int ERKStepClearStopTime(void *arkode_mem); SUNDIALS_EXPORT int ERKStepSetFixedStep(void *arkode_mem, - realtype hfixed); + sunrealtype hfixed); SUNDIALS_EXPORT int ERKStepSetMaxNumConstrFails(void *arkode_mem, int maxfails); @@ -152,12 +152,12 @@ SUNDIALS_EXPORT int ERKStepSetPostprocessStageFn(void *arkode_mem, /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int ERKStepEvolve(void *arkode_mem, realtype tout, - N_Vector yout, realtype *tret, +SUNDIALS_EXPORT int ERKStepEvolve(void *arkode_mem, sunrealtype tout, + N_Vector yout, sunrealtype *tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int ERKStepGetDky(void *arkode_mem, realtype t, +SUNDIALS_EXPORT int ERKStepGetDky(void *arkode_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ @@ -181,15 +181,15 @@ SUNDIALS_EXPORT int ERKStepGetWorkSpace(void *arkode_mem, SUNDIALS_EXPORT int ERKStepGetNumSteps(void *arkode_mem, long int *nsteps); SUNDIALS_EXPORT int ERKStepGetActualInitStep(void *arkode_mem, - realtype *hinused); + sunrealtype *hinused); SUNDIALS_EXPORT int ERKStepGetLastStep(void *arkode_mem, - realtype *hlast); + sunrealtype *hlast); SUNDIALS_EXPORT int ERKStepGetCurrentStep(void *arkode_mem, - realtype *hcur); + sunrealtype *hcur); SUNDIALS_EXPORT int ERKStepGetCurrentTime(void *arkode_mem, - realtype *tcur); + sunrealtype *tcur); SUNDIALS_EXPORT int ERKStepGetTolScaleFactor(void *arkode_mem, - realtype *tolsfac); + sunrealtype *tolsfac); SUNDIALS_EXPORT int ERKStepGetErrWeights(void *arkode_mem, N_Vector eweight); SUNDIALS_EXPORT int ERKStepGetNumGEvals(void *arkode_mem, @@ -218,10 +218,10 @@ SUNDIALS_EXPORT int ERKStepGetTimestepperStats(void *arkode_mem, long int *netfails); SUNDIALS_EXPORT int ERKStepGetStepStats(void *arkode_mem, long int *nsteps, - realtype *hinused, - realtype *hlast, - realtype *hcur, - realtype *tcur); + sunrealtype *hinused, + sunrealtype *hlast, + sunrealtype *hcur, + sunrealtype *tcur); /* Free function */ diff --git a/include/arkode/arkode_ls.h b/include/arkode/arkode_ls.h index a2be31d23e..f3b000e213 100644 --- a/include/arkode/arkode_ls.h +++ b/include/arkode/arkode_ls.h @@ -51,47 +51,47 @@ extern "C" { ARKLS user-supplied function prototypes =================================================================*/ -typedef int (*ARKLsJacFn)(realtype t, N_Vector y, N_Vector fy, +typedef int (*ARKLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*ARKLsMassFn)(realtype t, SUNMatrix M, void *user_data, +typedef int (*ARKLsMassFn)(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*ARKLsPrecSetupFn)(realtype t, N_Vector y, +typedef int (*ARKLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -typedef int (*ARKLsPrecSolveFn)(realtype t, N_Vector y, +typedef int (*ARKLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, realtype gamma, - realtype delta, int lr, + N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data); -typedef int (*ARKLsJacTimesSetupFn)(realtype t, N_Vector y, +typedef int (*ARKLsJacTimesSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, void *user_data); typedef int (*ARKLsJacTimesVecFn)(N_Vector v, N_Vector Jv, - realtype t, N_Vector y, + sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); -typedef int (*ARKLsLinSysFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, +typedef int (*ARKLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, booleantype jok, booleantype *jcur, - realtype gamma, void *user_data, N_Vector tmp1, + sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*ARKLsMassTimesSetupFn)(realtype t, void *mtimes_data); +typedef int (*ARKLsMassTimesSetupFn)(sunrealtype t, void *mtimes_data); typedef int (*ARKLsMassTimesVecFn)(N_Vector v, N_Vector Mv, - realtype t, void *mtimes_data); + sunrealtype t, void *mtimes_data); -typedef int (*ARKLsMassPrecSetupFn)(realtype t, void *user_data); +typedef int (*ARKLsMassPrecSetupFn)(sunrealtype t, void *user_data); -typedef int (*ARKLsMassPrecSolveFn)(realtype t, N_Vector r, - N_Vector z, realtype delta, +typedef int (*ARKLsMassPrecSolveFn)(sunrealtype t, N_Vector r, + N_Vector z, sunrealtype delta, int lr, void *user_data); diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index fbfb91c349..9297936df4 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -73,14 +73,14 @@ static const int MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4; * ------------------------------------ */ typedef int (*MRIStepInnerEvolveFn)(MRIStepInnerStepper stepper, - realtype t0, realtype tout, N_Vector y); + sunrealtype t0, sunrealtype tout, N_Vector y); typedef int (*MRIStepInnerFullRhsFn)(MRIStepInnerStepper stepper, - realtype t, N_Vector y, N_Vector f, + sunrealtype t, N_Vector y, N_Vector f, int mode); typedef int (*MRIStepInnerResetFn)(MRIStepInnerStepper stepper, - realtype tR, N_Vector yR); + sunrealtype tR, N_Vector yR); /*--------------------------------------------------------------- MRI coupling data structure and associated utility routines @@ -91,9 +91,9 @@ struct MRIStepCouplingMem int stages; /* size of coupling matrices (stages * stages) */ int q; /* method order of accuracy */ int p; /* embedding order of accuracy */ - realtype *c; /* stage abscissae */ - realtype ***W; /* explicit coupling matrices [nmat][stages][stages] */ - realtype ***G; /* implicit coupling matrices [nmat][stages][stages] */ + sunrealtype *c; /* stage abscissae */ + sunrealtype ***W; /* explicit coupling matrices [nmat][stages][stages] */ + sunrealtype ***G; /* implicit coupling matrices [nmat][stages][stages] */ }; typedef _SUNDIALS_STRUCT_ MRIStepCouplingMem *MRIStepCoupling; @@ -111,9 +111,9 @@ SUNDIALS_EXPORT MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, - realtype *W, - realtype *G, - realtype *c); + sunrealtype *W, + sunrealtype *G, + sunrealtype *c); SUNDIALS_EXPORT MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p); SUNDIALS_EXPORT MRIStepCoupling MRIStepCoupling_Copy(MRIStepCoupling MRIC); @@ -129,35 +129,35 @@ SUNDIALS_EXPORT void MRIStepCoupling_Write(MRIStepCoupling MRIC, * User-Supplied Function Types * ------------------------------ */ -typedef int (*MRIStepPreInnerFn)(realtype t, N_Vector *f, int nvecs, +typedef int (*MRIStepPreInnerFn)(sunrealtype t, N_Vector *f, int nvecs, void *user_data); -typedef int (*MRIStepPostInnerFn)(realtype t, N_Vector y, void *user_data); +typedef int (*MRIStepPostInnerFn)(sunrealtype t, N_Vector y, void *user_data); /* ------------------- * Exported Functions * ------------------- */ /* Create, Resize, and Reinitialization functions */ -SUNDIALS_EXPORT void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, realtype t0, +SUNDIALS_EXPORT void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx); SUNDIALS_EXPORT int MRIStepResize(void *arkode_mem, N_Vector ynew, - realtype t0, ARKVecResizeFn resize, + sunrealtype t0, ARKVecResizeFn resize, void *resize_data); SUNDIALS_EXPORT int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, - realtype t0, N_Vector y0); + sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int MRIStepReset(void* arkode_mem, realtype tR, N_Vector yR); +SUNDIALS_EXPORT int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Tolerance input functions */ SUNDIALS_EXPORT int MRIStepSStolerances(void *arkode_mem, - realtype reltol, - realtype abstol); + sunrealtype reltol, + sunrealtype abstol); SUNDIALS_EXPORT int MRIStepSVtolerances(void *arkode_mem, - realtype reltol, + sunrealtype reltol, N_Vector abstol); SUNDIALS_EXPORT int MRIStepWFtolerances(void *arkode_mem, ARKEwtFn efun); @@ -187,11 +187,11 @@ SUNDIALS_EXPORT int MRIStepSetCoupling(void *arkode_mem, SUNDIALS_EXPORT int MRIStepSetMaxNumSteps(void *arkode_mem, long int mxsteps); SUNDIALS_EXPORT int MRIStepSetNonlinCRDown(void *arkode_mem, - realtype crdown); + sunrealtype crdown); SUNDIALS_EXPORT int MRIStepSetNonlinRDiv(void *arkode_mem, - realtype rdiv); + sunrealtype rdiv); SUNDIALS_EXPORT int MRIStepSetDeltaGammaMax(void *arkode_mem, - realtype dgmax); + sunrealtype dgmax); SUNDIALS_EXPORT int MRIStepSetLSetupFrequency(void *arkode_mem, int msbp); SUNDIALS_EXPORT int MRIStepSetPredictorMethod(void *arkode_mem, @@ -199,16 +199,16 @@ SUNDIALS_EXPORT int MRIStepSetPredictorMethod(void *arkode_mem, SUNDIALS_EXPORT int MRIStepSetMaxNonlinIters(void *arkode_mem, int maxcor); SUNDIALS_EXPORT int MRIStepSetNonlinConvCoef(void *arkode_mem, - realtype nlscoef); + sunrealtype nlscoef); SUNDIALS_EXPORT int MRIStepSetMaxHnilWarns(void *arkode_mem, int mxhnil); SUNDIALS_EXPORT int MRIStepSetStopTime(void *arkode_mem, - realtype tstop); + sunrealtype tstop); SUNDIALS_EXPORT int MRIStepSetInterpolateStopTime(void *arkode_mem, booleantype interp); SUNDIALS_EXPORT int MRIStepClearStopTime(void *arkode_mem); SUNDIALS_EXPORT int MRIStepSetFixedStep(void *arkode_mem, - realtype hsfixed); + sunrealtype hsfixed); SUNDIALS_EXPORT int MRIStepSetRootDirection(void *arkode_mem, int *rootdir); SUNDIALS_EXPORT int MRIStepSetNoInactiveRootWarn(void *arkode_mem); @@ -239,9 +239,9 @@ SUNDIALS_EXPORT int MRIStepSetJacEvalFrequency(void *arkode_mem, long int msbj); SUNDIALS_EXPORT int MRIStepSetLinearSolutionScaling(void *arkode_mem, booleantype onoff); -SUNDIALS_EXPORT int MRIStepSetEpsLin(void *arkode_mem, realtype eplifac); +SUNDIALS_EXPORT int MRIStepSetEpsLin(void *arkode_mem, sunrealtype eplifac); SUNDIALS_EXPORT int MRIStepSetLSNormFactor(void *arkode_mem, - realtype nrmfac); + sunrealtype nrmfac); SUNDIALS_EXPORT int MRIStepSetPreconditioner(void *arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve); @@ -253,12 +253,12 @@ SUNDIALS_EXPORT int MRIStepSetJacTimesRhsFn(void *arkode_mem, SUNDIALS_EXPORT int MRIStepSetLinSysFn(void *arkode_mem, ARKLsLinSysFn linsys); /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int MRIStepEvolve(void *arkode_mem, realtype tout, - N_Vector yout, realtype *tret, +SUNDIALS_EXPORT int MRIStepEvolve(void *arkode_mem, sunrealtype tout, + N_Vector yout, sunrealtype *tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int MRIStepGetDky(void *arkode_mem, realtype t, +SUNDIALS_EXPORT int MRIStepGetDky(void *arkode_mem, sunrealtype t, int k, N_Vector dky); /* Utility function to update/compute y based on zcor */ @@ -279,15 +279,15 @@ SUNDIALS_EXPORT int MRIStepGetWorkSpace(void *arkode_mem, SUNDIALS_EXPORT int MRIStepGetNumSteps(void *arkode_mem, long int *nssteps); SUNDIALS_EXPORT int MRIStepGetLastStep(void *arkode_mem, - realtype *hlast); + sunrealtype *hlast); SUNDIALS_EXPORT int MRIStepGetCurrentTime(void *arkode_mem, - realtype *tcur); + sunrealtype *tcur); SUNDIALS_EXPORT int MRIStepGetCurrentState(void *arkode_mem, N_Vector *state); SUNDIALS_EXPORT int MRIStepGetCurrentGamma(void *arkode_mem, - realtype *gamma); + sunrealtype *gamma); SUNDIALS_EXPORT int MRIStepGetTolScaleFactor(void *arkode_mem, - realtype *tolsfac); + sunrealtype *tolsfac); SUNDIALS_EXPORT int MRIStepGetErrWeights(void *arkode_mem, N_Vector eweight); SUNDIALS_EXPORT int MRIStepGetNumGEvals(void *arkode_mem, @@ -308,11 +308,11 @@ SUNDIALS_EXPORT int MRIStepWriteCoupling(void *arkode_mem, FILE *fp); /* Nonlinear solver optional output functions */ SUNDIALS_EXPORT int MRIStepGetNonlinearSystemData(void *arkode_mem, - realtype *tcur, + sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *F, - realtype *gamma, + sunrealtype *gamma, N_Vector *sdata, void **user_data); SUNDIALS_EXPORT int MRIStepGetNumNonlinSolvIters(void *arkode_mem, @@ -382,11 +382,11 @@ SUNDIALS_EXPORT int MRIStepInnerStepper_SetResetFn(MRIStepInnerStepper stepper, MRIStepInnerResetFn fn); SUNDIALS_EXPORT int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, - realtype t, N_Vector f); + sunrealtype t, N_Vector f); SUNDIALS_EXPORT int MRIStepInnerStepper_GetForcingData(MRIStepInnerStepper stepper, - realtype *tshift, - realtype *tscale, + sunrealtype *tshift, + sunrealtype *tscale, N_Vector **forcing, int *nforcing); diff --git a/include/arkode/arkode_sprkstep.h b/include/arkode/arkode_sprkstep.h index 566f444d49..186988d953 100644 --- a/include/arkode/arkode_sprkstep.h +++ b/include/arkode/arkode_sprkstep.h @@ -43,13 +43,13 @@ static const int SPRKSTEP_DEFAULT_10 = ARKODE_SPRK_SOFRONIOU_10_36; * ------------------- */ /* Create, Resize, and Reinitialization functions */ -SUNDIALS_EXPORT void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, realtype t0, +SUNDIALS_EXPORT void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, SUNContext sunctx); SUNDIALS_EXPORT int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, - realtype t0, N_Vector y0); + sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int SPRKStepReset(void* arkode_mem, realtype tR, N_Vector yR); +SUNDIALS_EXPORT int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Rootfinding functions */ @@ -67,8 +67,8 @@ SUNDIALS_EXPORT int SPRKStepSetOrder(void* arkode_mem, int maxord); SUNDIALS_EXPORT int SPRKStepSetInterpolantType(void* arkode_mem, int itype); SUNDIALS_EXPORT int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree); SUNDIALS_EXPORT int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_EXPORT int SPRKStepSetStopTime(void* arkode_mem, realtype tstop); -SUNDIALS_EXPORT int SPRKStepSetFixedStep(void* arkode_mem, realtype hfixed); +SUNDIALS_EXPORT int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_EXPORT int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_EXPORT int SPRKStepSetErrHandlerFn(void* arkode_mem, ARKErrHandlerFn ehfun, void* eh_data); SUNDIALS_EXPORT int SPRKStepSetErrFile(void* arkode_mem, FILE* errfp); @@ -80,11 +80,11 @@ SUNDIALS_EXPORT int SPRKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int SPRKStepEvolve(void* arkode_mem, realtype tout, - N_Vector yout, realtype* tret, int itask); +SUNDIALS_EXPORT int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, + N_Vector yout, sunrealtype* tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int SPRKStepGetDky(void* arkode_mem, realtype t, int k, +SUNDIALS_EXPORT int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ @@ -92,9 +92,9 @@ SUNDIALS_EXPORT char* SPRKStepGetReturnFlagName(long int flag); SUNDIALS_EXPORT int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage); SUNDIALS_EXPORT int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_EXPORT int SPRKStepGetCurrentStep(void* arkode_mem, realtype* hcur); -SUNDIALS_EXPORT int SPRKStepGetCurrentTime(void* arkode_mem, realtype* tcur); -SUNDIALS_EXPORT int SPRKStepGetLastStep(void* arkode_mem, realtype* hlast); +SUNDIALS_EXPORT int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_EXPORT int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_EXPORT int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); SUNDIALS_EXPORT int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2); SUNDIALS_EXPORT int SPRKStepGetNumStepAttempts(void* arkode_mem, @@ -108,8 +108,8 @@ SUNDIALS_EXPORT int SPRKStepWriteParameters(void* arkode_mem, FILE* fp); /* Grouped optional output functions */ SUNDIALS_EXPORT int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, - realtype* hinused, realtype* hlast, - realtype* hcur, realtype* tcur); + sunrealtype* hinused, sunrealtype* hlast, + sunrealtype* hcur, sunrealtype* tcur); /* Free function */ SUNDIALS_EXPORT void SPRKStepFree(void** arkode_mem); diff --git a/include/arkode/arkode_xbraid.h b/include/arkode/arkode_xbraid.h index db83a4a944..0527da32f3 100644 --- a/include/arkode/arkode_xbraid.h +++ b/include/arkode/arkode_xbraid.h @@ -34,7 +34,7 @@ extern "C" { SUNDIALS_EXPORT int ARKBraid_Create(void *arkode_mem, braid_App *app); SUNDIALS_EXPORT int ARKBraid_BraidInit(MPI_Comm comm_w, MPI_Comm comm_t, - realtype tstart, realtype tstop, + sunrealtype tstart, sunrealtype tstop, sunindextype nt, braid_App app, braid_Core *core); @@ -72,7 +72,7 @@ SUNDIALS_EXPORT int ARKBraid_GetLastBraidFlag(braid_App app, int *last_flag); SUNDIALS_EXPORT int ARKBraid_GetLastARKStepFlag(braid_App app, int *last_flag); -SUNDIALS_EXPORT int ARKBraid_GetSolution(braid_App app, realtype *tout, +SUNDIALS_EXPORT int ARKBraid_GetSolution(braid_App app, sunrealtype *tout, N_Vector yout); @@ -85,7 +85,7 @@ SUNDIALS_EXPORT int ARKBraid_Step(braid_App app, braid_Vector ustop, braid_Vector fstop, braid_Vector u, braid_StepStatus status); -SUNDIALS_EXPORT int ARKBraid_Init(braid_App app, realtype t, +SUNDIALS_EXPORT int ARKBraid_Init(braid_App app, sunrealtype t, braid_Vector *u_ptr); SUNDIALS_EXPORT int ARKBraid_Access(braid_App app, braid_Vector u, @@ -97,8 +97,8 @@ SUNDIALS_EXPORT int ARKBraid_Access(braid_App app, braid_Vector u, * ----------------- */ -SUNDIALS_EXPORT int ARKBraid_TakeStep(void *arkode_mem, realtype tstart, - realtype tstop, N_Vector y, +SUNDIALS_EXPORT int ARKBraid_TakeStep(void *arkode_mem, sunrealtype tstart, + sunrealtype tstop, N_Vector y, int *ark_flag); diff --git a/include/cvode/cvode.h b/include/cvode/cvode.h index 35647f983e..0ec9df30a9 100644 --- a/include/cvode/cvode.h +++ b/include/cvode/cvode.h @@ -91,10 +91,10 @@ extern "C" { * User-Supplied Function Types * ------------------------------ */ -typedef int (*CVRhsFn)(realtype t, N_Vector y, +typedef int (*CVRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -typedef int (*CVRootFn)(realtype t, N_Vector y, realtype *gout, +typedef int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); typedef int (*CVEwtFn)(N_Vector y, N_Vector ewt, void *user_data); @@ -112,14 +112,14 @@ typedef int (*CVMonitorFn)(void *cvode_mem, void *user_data); /* Initialization functions */ SUNDIALS_EXPORT void *CVodeCreate(int lmm, SUNContext sunctx); -SUNDIALS_EXPORT int CVodeInit(void *cvode_mem, CVRhsFn f, realtype t0, +SUNDIALS_EXPORT int CVodeInit(void *cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int CVodeReInit(void *cvode_mem, realtype t0, N_Vector y0); +SUNDIALS_EXPORT int CVodeReInit(void *cvode_mem, sunrealtype t0, N_Vector y0); /* Tolerance input functions */ -SUNDIALS_EXPORT int CVodeSStolerances(void *cvode_mem, realtype reltol, - realtype abstol); -SUNDIALS_EXPORT int CVodeSVtolerances(void *cvode_mem, realtype reltol, +SUNDIALS_EXPORT int CVodeSStolerances(void *cvode_mem, sunrealtype reltol, + sunrealtype abstol); +SUNDIALS_EXPORT int CVodeSVtolerances(void *cvode_mem, sunrealtype reltol, N_Vector abstol); SUNDIALS_EXPORT int CVodeWFtolerances(void *cvode_mem, CVEwtFn efun); @@ -127,10 +127,10 @@ SUNDIALS_EXPORT int CVodeWFtolerances(void *cvode_mem, CVEwtFn efun); SUNDIALS_EXPORT int CVodeSetConstraints(void *cvode_mem, N_Vector constraints); SUNDIALS_EXPORT int CVodeSetDeltaGammaMaxLSetup(void *cvode_mem, - realtype dgmax_lsetup); + sunrealtype dgmax_lsetup); SUNDIALS_EXPORT int CVodeSetErrFile(void *cvode_mem, FILE *errfp); SUNDIALS_EXPORT int CVodeSetErrHandlerFn(void *cvode_mem, CVErrHandlerFn ehfun, void *eh_data); -SUNDIALS_EXPORT int CVodeSetInitStep(void *cvode_mem, realtype hin); +SUNDIALS_EXPORT int CVodeSetInitStep(void *cvode_mem, sunrealtype hin); SUNDIALS_EXPORT int CVodeSetLSetupFrequency(void *cvode_mem, long int msbp); SUNDIALS_EXPORT int CVodeSetMaxConvFails(void *cvode_mem, int maxncf); SUNDIALS_EXPORT int CVodeSetMaxErrTestFails(void *cvode_mem, int maxnef); @@ -138,15 +138,15 @@ SUNDIALS_EXPORT int CVodeSetMaxHnilWarns(void *cvode_mem, int mxhnil); SUNDIALS_EXPORT int CVodeSetMaxNonlinIters(void *cvode_mem, int maxcor); SUNDIALS_EXPORT int CVodeSetMaxNumSteps(void *cvode_mem, long int mxsteps); SUNDIALS_EXPORT int CVodeSetMaxOrd(void *cvode_mem, int maxord); -SUNDIALS_EXPORT int CVodeSetMaxStep(void *cvode_mem, realtype hmax); -SUNDIALS_EXPORT int CVodeSetMinStep(void *cvode_mem, realtype hmin); +SUNDIALS_EXPORT int CVodeSetMaxStep(void *cvode_mem, sunrealtype hmax); +SUNDIALS_EXPORT int CVodeSetMinStep(void *cvode_mem, sunrealtype hmin); SUNDIALS_EXPORT int CVodeSetMonitorFn(void *cvode_mem, CVMonitorFn fn); SUNDIALS_EXPORT int CVodeSetMonitorFrequency(void *cvode_mem, long int nst); SUNDIALS_EXPORT int CVodeSetNlsRhsFn(void *cvode_mem, CVRhsFn f); -SUNDIALS_EXPORT int CVodeSetNonlinConvCoef(void *cvode_mem, realtype nlscoef); +SUNDIALS_EXPORT int CVodeSetNonlinConvCoef(void *cvode_mem, sunrealtype nlscoef); SUNDIALS_EXPORT int CVodeSetNonlinearSolver(void *cvode_mem, SUNNonlinearSolver NLS); SUNDIALS_EXPORT int CVodeSetStabLimDet(void *cvode_mem, booleantype stldet); -SUNDIALS_EXPORT int CVodeSetStopTime(void *cvode_mem, realtype tstop); +SUNDIALS_EXPORT int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop); SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void *cvode_mem, booleantype interp); SUNDIALS_EXPORT int CVodeClearStopTime(void *cvode_mem); SUNDIALS_EXPORT int CVodeSetUseIntegratorFusedKernels(void *cvode_mem, booleantype onoff); @@ -154,26 +154,26 @@ SUNDIALS_EXPORT int CVodeSetUserData(void *cvode_mem, void *user_data); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT -int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, - realtype eta_max_fx); +int CVodeSetEtaFixedStepBounds(void* cvode_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx); SUNDIALS_EXPORT -int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs); +int CVodeSetEtaMaxFirstStep(void* cvode_mem, sunrealtype eta_max_fs); SUNDIALS_EXPORT -int CVodeSetEtaMaxEarlyStep(void* cvode_mem, realtype eta_max_es); +int CVodeSetEtaMaxEarlyStep(void* cvode_mem, sunrealtype eta_max_es); SUNDIALS_EXPORT int CVodeSetNumStepsEtaMaxEarlyStep(void* cvode_mem, long int small_nst); SUNDIALS_EXPORT -int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs); +int CVodeSetEtaMax(void* cvode_mem, sunrealtype eta_max_gs); SUNDIALS_EXPORT -int CVodeSetEtaMin(void* cvode_mem, realtype eta_min); +int CVodeSetEtaMin(void* cvode_mem, sunrealtype eta_min); SUNDIALS_EXPORT -int CVodeSetEtaMinErrFail(void *cvode_mem, realtype eta_min_ef); +int CVodeSetEtaMinErrFail(void *cvode_mem, sunrealtype eta_min_ef); SUNDIALS_EXPORT -int CVodeSetEtaMaxErrFail(void* cvode_mem, realtype eta_max_ef); +int CVodeSetEtaMaxErrFail(void* cvode_mem, sunrealtype eta_max_ef); SUNDIALS_EXPORT int CVodeSetNumFailsEtaMaxErrFail(void *cvode_mem, int small_nef); SUNDIALS_EXPORT -int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf); +int CVodeSetEtaConvFail(void* cvode_mem, sunrealtype eta_cf); /* Rootfinding initialization function */ SUNDIALS_EXPORT int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g); @@ -183,14 +183,14 @@ SUNDIALS_EXPORT int CVodeSetRootDirection(void *cvode_mem, int *rootdir); SUNDIALS_EXPORT int CVodeSetNoInactiveRootWarn(void *cvode_mem); /* Solver function */ -SUNDIALS_EXPORT int CVode(void *cvode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask); +SUNDIALS_EXPORT int CVode(void *cvode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask); /* Utility functions to update/compute y based on ycor */ SUNDIALS_EXPORT int CVodeComputeState(void *cvode_mem, N_Vector ycor, N_Vector y); /* Dense output function */ -SUNDIALS_EXPORT int CVodeGetDky(void *cvode_mem, realtype t, int k, +SUNDIALS_EXPORT int CVodeGetDky(void *cvode_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ @@ -204,15 +204,15 @@ SUNDIALS_EXPORT int CVodeGetNumErrTestFails(void *cvode_mem, long int *netfails); SUNDIALS_EXPORT int CVodeGetLastOrder(void *cvode_mem, int *qlast); SUNDIALS_EXPORT int CVodeGetCurrentOrder(void *cvode_mem, int *qcur); -SUNDIALS_EXPORT int CVodeGetCurrentGamma(void *cvode_mem, realtype *gamma); +SUNDIALS_EXPORT int CVodeGetCurrentGamma(void *cvode_mem, sunrealtype *gamma); SUNDIALS_EXPORT int CVodeGetNumStabLimOrderReds(void *cvode_mem, long int *nslred); -SUNDIALS_EXPORT int CVodeGetActualInitStep(void *cvode_mem, realtype *hinused); -SUNDIALS_EXPORT int CVodeGetLastStep(void *cvode_mem, realtype *hlast); -SUNDIALS_EXPORT int CVodeGetCurrentStep(void *cvode_mem, realtype *hcur); +SUNDIALS_EXPORT int CVodeGetActualInitStep(void *cvode_mem, sunrealtype *hinused); +SUNDIALS_EXPORT int CVodeGetLastStep(void *cvode_mem, sunrealtype *hlast); +SUNDIALS_EXPORT int CVodeGetCurrentStep(void *cvode_mem, sunrealtype *hcur); SUNDIALS_EXPORT int CVodeGetCurrentState(void *cvode_mem, N_Vector *y); -SUNDIALS_EXPORT int CVodeGetCurrentTime(void *cvode_mem, realtype *tcur); -SUNDIALS_EXPORT int CVodeGetTolScaleFactor(void *cvode_mem, realtype *tolsfac); +SUNDIALS_EXPORT int CVodeGetCurrentTime(void *cvode_mem, sunrealtype *tcur); +SUNDIALS_EXPORT int CVodeGetTolScaleFactor(void *cvode_mem, sunrealtype *tolsfac); SUNDIALS_EXPORT int CVodeGetErrWeights(void *cvode_mem, N_Vector eweight); SUNDIALS_EXPORT int CVodeGetEstLocalErrors(void *cvode_mem, N_Vector ele); SUNDIALS_EXPORT int CVodeGetNumGEvals(void *cvode_mem, long int *ngevals); @@ -222,12 +222,12 @@ SUNDIALS_EXPORT int CVodeGetIntegratorStats(void *cvode_mem, long int *nsteps, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur); -SUNDIALS_EXPORT int CVodeGetNonlinearSystemData(void *cvode_mem, realtype *tcur, + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur); +SUNDIALS_EXPORT int CVodeGetNonlinearSystemData(void *cvode_mem, sunrealtype *tcur, N_Vector *ypred, N_Vector *yn, - N_Vector *fn, realtype *gamma, - realtype *rl1, N_Vector *zn1, + N_Vector *fn, sunrealtype *gamma, + sunrealtype *rl1, N_Vector *zn1, void **user_data); SUNDIALS_EXPORT int CVodeGetNumNonlinSolvIters(void *cvode_mem, long int *nniters); diff --git a/include/cvode/cvode_bbdpre.h b/include/cvode/cvode_bbdpre.h index c21487e49f..5d1a088397 100644 --- a/include/cvode/cvode_bbdpre.h +++ b/include/cvode/cvode_bbdpre.h @@ -30,10 +30,10 @@ extern "C" { /* User-supplied function Types */ -typedef int (*CVLocalFn)(sunindextype Nlocal, realtype t, +typedef int (*CVLocalFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector g, void *user_data); -typedef int (*CVCommFn)(sunindextype Nlocal, realtype t, +typedef int (*CVCommFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, void *user_data); /* Exported Functions */ @@ -41,11 +41,11 @@ typedef int (*CVCommFn)(sunindextype Nlocal, realtype t, SUNDIALS_EXPORT int CVBBDPrecInit(void *cvode_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dqrely, CVLocalFn gloc, CVCommFn cfn); + sunrealtype dqrely, CVLocalFn gloc, CVCommFn cfn); SUNDIALS_EXPORT int CVBBDPrecReInit(void *cvode_mem, sunindextype mudq, sunindextype mldq, - realtype dqrely); + sunrealtype dqrely); /* Optional output functions */ diff --git a/include/cvode/cvode_hypamgpre.h b/include/cvode/cvode_hypamgpre.h index ad18281a6f..27e1ad3902 100644 --- a/include/cvode/cvode_hypamgpre.h +++ b/include/cvode/cvode_hypamgpre.h @@ -156,7 +156,7 @@ extern "C" { */ -typedef int (*CVParCsrJacFn)(sunindextype N, sunindextype ilower, sunindextype iupper, sunindextype jlower, sunindextype jupper, realtype gamma, realtype t, +typedef int (*CVParCsrJacFn)(sunindextype N, sunindextype ilower, sunindextype iupper, sunindextype jlower, sunindextype jupper, sunrealtype gamma, sunrealtype t, N_Vector y, N_Vector fy, HYPRE_IJMatrix* Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -208,14 +208,14 @@ typedef int (*CVJacobianIJUpdateFn)(HYPRE_IJMatrix* pointer_A, int ilower, int i SUNDIALS_EXPORT int CVBoomerAMGInit(void *cvode_mem, int ilower, int iupper, int jlower, int jupper, int N); /* -SUNDIALS_EXPORT int CVBoomerAMGSetup(realtype t, N_Vector y, N_Vector fy, +SUNDIALS_EXPORT int CVBoomerAMGSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bbd_data, + sunrealtype gamma, void *bbd_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -SUNDIALS_EXPORT int CVBoomerAMGSolve(realtype t, N_Vector y, N_Vector fy, +SUNDIALS_EXPORT int CVBoomerAMGSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bbd_data, N_Vector tmp);*/ /* @@ -241,7 +241,7 @@ SUNDIALS_EXPORT int CVBoomerAMGSolve(realtype t, N_Vector y, N_Vector fy, */ SUNDIALS_EXPORT int CVBoomerAMGReInit(void *cvode_mem, sunindextype mudq, sunindextype mldq, - realtype dqrely); + sunrealtype dqrely); /* * ----------------------------------------------------------------- diff --git a/include/cvode/cvode_ls.h b/include/cvode/cvode_ls.h index eaae642553..2d8765273c 100644 --- a/include/cvode/cvode_ls.h +++ b/include/cvode/cvode_ls.h @@ -50,27 +50,27 @@ extern "C" { CVLS user-supplied function prototypes =================================================================*/ -typedef int (*CVLsJacFn)(realtype t, N_Vector y, N_Vector fy, +typedef int (*CVLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*CVLsPrecSetupFn)(realtype t, N_Vector y, N_Vector fy, +typedef int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -typedef int (*CVLsPrecSolveFn)(realtype t, N_Vector y, N_Vector fy, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *user_data); +typedef int (*CVLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data); -typedef int (*CVLsJacTimesSetupFn)(realtype t, N_Vector y, +typedef int (*CVLsJacTimesSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, void *user_data); -typedef int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, realtype t, +typedef int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); -typedef int (*CVLsLinSysFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, realtype gamma, +typedef int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, + booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -93,10 +93,10 @@ SUNDIALS_EXPORT int CVodeSetJacEvalFrequency(void *cvode_mem, SUNDIALS_EXPORT int CVodeSetLinearSolutionScaling(void *cvode_mem, booleantype onoff); SUNDIALS_EXPORT int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, - realtype dgmax_jbad); -SUNDIALS_EXPORT int CVodeSetEpsLin(void *cvode_mem, realtype eplifac); + sunrealtype dgmax_jbad); +SUNDIALS_EXPORT int CVodeSetEpsLin(void *cvode_mem, sunrealtype eplifac); SUNDIALS_EXPORT int CVodeSetLSNormFactor(void *arkode_mem, - realtype nrmfac); + sunrealtype nrmfac); SUNDIALS_EXPORT int CVodeSetPreconditioner(void *cvode_mem, CVLsPrecSetupFn pset, CVLsPrecSolveFn psolve); diff --git a/include/cvode/cvode_proj.h b/include/cvode/cvode_proj.h index c34b527f2e..eca1771537 100644 --- a/include/cvode/cvode_proj.h +++ b/include/cvode/cvode_proj.h @@ -29,8 +29,8 @@ extern "C" { * CVProj user-supplied function prototypes * ---------------------------------------------------------------------------*/ -typedef int (*CVProjFn)(realtype t, N_Vector ycur, N_Vector corr, - realtype epsProj, N_Vector err, void *user_data); +typedef int (*CVProjFn)(sunrealtype t, N_Vector ycur, N_Vector corr, + sunrealtype epsProj, N_Vector err, void *user_data); /* ----------------------------------------------------------------------------- @@ -44,8 +44,8 @@ SUNDIALS_EXPORT int CVodeSetProjFn(void *cvode_mem, CVProjFn pfun); SUNDIALS_EXPORT int CVodeSetProjErrEst(void *cvode_mem, booleantype onoff); SUNDIALS_EXPORT int CVodeSetProjFrequency(void *cvode_mem, long int proj_freq); SUNDIALS_EXPORT int CVodeSetMaxNumProjFails(void *cvode_mem, int max_fails); -SUNDIALS_EXPORT int CVodeSetEpsProj(void *cvode_mem, realtype eps); -SUNDIALS_EXPORT int CVodeSetProjFailEta(void *cvode_mem, realtype eta); +SUNDIALS_EXPORT int CVodeSetEpsProj(void *cvode_mem, sunrealtype eps); +SUNDIALS_EXPORT int CVodeSetProjFailEta(void *cvode_mem, sunrealtype eta); /* Optional output functions */ SUNDIALS_EXPORT int CVodeGetNumProjEvals(void *cvode_mem, long int *nproj); diff --git a/include/cvodes/cvodes.h b/include/cvodes/cvodes.h index b1a7892377..0157fca601 100644 --- a/include/cvodes/cvodes.h +++ b/include/cvodes/cvodes.h @@ -131,10 +131,10 @@ extern "C" { * User-Supplied Function Types * ------------------------------ */ -typedef int (*CVRhsFn)(realtype t, N_Vector y, +typedef int (*CVRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -typedef int (*CVRootFn)(realtype t, N_Vector y, realtype *gout, +typedef int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data); typedef int (*CVEwtFn)(N_Vector y, N_Vector ewt, void *user_data); @@ -145,38 +145,38 @@ typedef void (*CVErrHandlerFn)(int error_code, typedef int (*CVMonitorFn)(void *cvode_mem, void *user_data); -typedef int (*CVQuadRhsFn)(realtype t, N_Vector y, +typedef int (*CVQuadRhsFn)(sunrealtype t, N_Vector y, N_Vector yQdot, void *user_data); -typedef int (*CVSensRhsFn)(int Ns, realtype t, +typedef int (*CVSensRhsFn)(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, N_Vector *yS, N_Vector *ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2); -typedef int (*CVSensRhs1Fn)(int Ns, realtype t, +typedef int (*CVSensRhs1Fn)(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void *user_data, N_Vector tmp1, N_Vector tmp2); -typedef int (*CVQuadSensRhsFn)(int Ns, realtype t, +typedef int (*CVQuadSensRhsFn)(int Ns, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yQdot, N_Vector *yQSdot, void *user_data, N_Vector tmp, N_Vector tmpQ); -typedef int (*CVRhsFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector yBdot, +typedef int (*CVRhsFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user_dataB); -typedef int (*CVRhsFnBS)(realtype t, N_Vector y, N_Vector *yS, +typedef int (*CVRhsFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector yBdot, void *user_dataB); -typedef int (*CVQuadRhsFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector qBdot, +typedef int (*CVQuadRhsFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void *user_dataB); -typedef int (*CVQuadRhsFnBS)(realtype t, N_Vector y, N_Vector *yS, +typedef int (*CVQuadRhsFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector qBdot, void *user_dataB); @@ -187,14 +187,14 @@ typedef int (*CVQuadRhsFnBS)(realtype t, N_Vector y, N_Vector *yS, /* Initialization functions */ SUNDIALS_EXPORT void *CVodeCreate(int lmm, SUNContext sunctx); -SUNDIALS_EXPORT int CVodeInit(void *cvode_mem, CVRhsFn f, realtype t0, +SUNDIALS_EXPORT int CVodeInit(void *cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int CVodeReInit(void *cvode_mem, realtype t0, N_Vector y0); +SUNDIALS_EXPORT int CVodeReInit(void *cvode_mem, sunrealtype t0, N_Vector y0); /* Tolerance input functions */ -SUNDIALS_EXPORT int CVodeSStolerances(void *cvode_mem, realtype reltol, - realtype abstol); -SUNDIALS_EXPORT int CVodeSVtolerances(void *cvode_mem, realtype reltol, +SUNDIALS_EXPORT int CVodeSStolerances(void *cvode_mem, sunrealtype reltol, + sunrealtype abstol); +SUNDIALS_EXPORT int CVodeSVtolerances(void *cvode_mem, sunrealtype reltol, N_Vector abstol); SUNDIALS_EXPORT int CVodeWFtolerances(void *cvode_mem, CVEwtFn efun); @@ -202,10 +202,10 @@ SUNDIALS_EXPORT int CVodeWFtolerances(void *cvode_mem, CVEwtFn efun); SUNDIALS_EXPORT int CVodeSetConstraints(void *cvode_mem, N_Vector constraints); SUNDIALS_EXPORT int CVodeSetDeltaGammaMaxLSetup(void *cvode_mem, - realtype dgmax_lsetup); + sunrealtype dgmax_lsetup); SUNDIALS_EXPORT int CVodeSetErrFile(void *cvode_mem, FILE *errfp); SUNDIALS_EXPORT int CVodeSetErrHandlerFn(void *cvode_mem, CVErrHandlerFn ehfun, void *eh_data); -SUNDIALS_EXPORT int CVodeSetInitStep(void *cvode_mem, realtype hin); +SUNDIALS_EXPORT int CVodeSetInitStep(void *cvode_mem, sunrealtype hin); SUNDIALS_EXPORT int CVodeSetLSetupFrequency(void *cvode_mem, long int msbp); SUNDIALS_EXPORT int CVodeSetMaxConvFails(void *cvode_mem, int maxncf); SUNDIALS_EXPORT int CVodeSetMaxErrTestFails(void *cvode_mem, int maxnef); @@ -213,41 +213,41 @@ SUNDIALS_EXPORT int CVodeSetMaxHnilWarns(void *cvode_mem, int mxhnil); SUNDIALS_EXPORT int CVodeSetMaxNonlinIters(void *cvode_mem, int maxcor); SUNDIALS_EXPORT int CVodeSetMaxNumSteps(void *cvode_mem, long int mxsteps); SUNDIALS_EXPORT int CVodeSetMaxOrd(void *cvode_mem, int maxord); -SUNDIALS_EXPORT int CVodeSetMaxStep(void *cvode_mem, realtype hmax); -SUNDIALS_EXPORT int CVodeSetMinStep(void *cvode_mem, realtype hmin); +SUNDIALS_EXPORT int CVodeSetMaxStep(void *cvode_mem, sunrealtype hmax); +SUNDIALS_EXPORT int CVodeSetMinStep(void *cvode_mem, sunrealtype hmin); SUNDIALS_EXPORT int CVodeSetMonitorFn(void *cvode_mem, CVMonitorFn fn); SUNDIALS_EXPORT int CVodeSetMonitorFrequency(void *cvode_mem, long int nst); SUNDIALS_EXPORT int CVodeSetNlsRhsFn(void *cvode_mem, CVRhsFn f); -SUNDIALS_EXPORT int CVodeSetNonlinConvCoef(void *cvode_mem, realtype nlscoef); +SUNDIALS_EXPORT int CVodeSetNonlinConvCoef(void *cvode_mem, sunrealtype nlscoef); SUNDIALS_EXPORT int CVodeSetNonlinearSolver(void *cvode_mem, SUNNonlinearSolver NLS); SUNDIALS_EXPORT int CVodeSetStabLimDet(void *cvode_mem, booleantype stldet); -SUNDIALS_EXPORT int CVodeSetStopTime(void *cvode_mem, realtype tstop); +SUNDIALS_EXPORT int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop); SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void *cvode_mem, booleantype interp); SUNDIALS_EXPORT int CVodeClearStopTime(void *cvode_mem); SUNDIALS_EXPORT int CVodeSetUserData(void *cvode_mem, void *user_data); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT -int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, - realtype eta_max_fx); +int CVodeSetEtaFixedStepBounds(void* cvode_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx); SUNDIALS_EXPORT -int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs); +int CVodeSetEtaMaxFirstStep(void* cvode_mem, sunrealtype eta_max_fs); SUNDIALS_EXPORT -int CVodeSetEtaMaxEarlyStep(void* cvode_mem, realtype eta_max_es); +int CVodeSetEtaMaxEarlyStep(void* cvode_mem, sunrealtype eta_max_es); SUNDIALS_EXPORT int CVodeSetNumStepsEtaMaxEarlyStep(void* cvode_mem, long int small_nst); SUNDIALS_EXPORT -int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs); +int CVodeSetEtaMax(void* cvode_mem, sunrealtype eta_max_gs); SUNDIALS_EXPORT -int CVodeSetEtaMin(void* cvode_mem, realtype eta_min); +int CVodeSetEtaMin(void* cvode_mem, sunrealtype eta_min); SUNDIALS_EXPORT -int CVodeSetEtaMinErrFail(void *cvode_mem, realtype eta_min_ef); +int CVodeSetEtaMinErrFail(void *cvode_mem, sunrealtype eta_min_ef); SUNDIALS_EXPORT -int CVodeSetEtaMaxErrFail(void* cvode_mem, realtype eta_max_ef); +int CVodeSetEtaMaxErrFail(void* cvode_mem, sunrealtype eta_max_ef); SUNDIALS_EXPORT int CVodeSetNumFailsEtaMaxErrFail(void *cvode_mem, int small_nef); SUNDIALS_EXPORT -int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf); +int CVodeSetEtaConvFail(void* cvode_mem, sunrealtype eta_cf); /* Rootfinding initialization function */ SUNDIALS_EXPORT int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g); @@ -257,8 +257,8 @@ SUNDIALS_EXPORT int CVodeSetRootDirection(void *cvode_mem, int *rootdir); SUNDIALS_EXPORT int CVodeSetNoInactiveRootWarn(void *cvode_mem); /* Solver function */ -SUNDIALS_EXPORT int CVode(void *cvode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask); +SUNDIALS_EXPORT int CVode(void *cvode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask); /* Utility functions to update/compute y based on ycor */ SUNDIALS_EXPORT int CVodeComputeState(void *cvode_mem, N_Vector ycor, @@ -269,7 +269,7 @@ SUNDIALS_EXPORT int CVodeComputeStateSens1(void *cvode_mem, int idx, N_Vector yScor1, N_Vector yS1); /* Dense output function */ -SUNDIALS_EXPORT int CVodeGetDky(void *cvode_mem, realtype t, int k, +SUNDIALS_EXPORT int CVodeGetDky(void *cvode_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ @@ -283,17 +283,17 @@ SUNDIALS_EXPORT int CVodeGetNumErrTestFails(void *cvode_mem, long int *netfails); SUNDIALS_EXPORT int CVodeGetLastOrder(void *cvode_mem, int *qlast); SUNDIALS_EXPORT int CVodeGetCurrentOrder(void *cvode_mem, int *qcur); -SUNDIALS_EXPORT int CVodeGetCurrentGamma(void *cvode_mem, realtype *gamma); +SUNDIALS_EXPORT int CVodeGetCurrentGamma(void *cvode_mem, sunrealtype *gamma); SUNDIALS_EXPORT int CVodeGetNumStabLimOrderReds(void *cvode_mem, long int *nslred); -SUNDIALS_EXPORT int CVodeGetActualInitStep(void *cvode_mem, realtype *hinused); -SUNDIALS_EXPORT int CVodeGetLastStep(void *cvode_mem, realtype *hlast); -SUNDIALS_EXPORT int CVodeGetCurrentStep(void *cvode_mem, realtype *hcur); +SUNDIALS_EXPORT int CVodeGetActualInitStep(void *cvode_mem, sunrealtype *hinused); +SUNDIALS_EXPORT int CVodeGetLastStep(void *cvode_mem, sunrealtype *hlast); +SUNDIALS_EXPORT int CVodeGetCurrentStep(void *cvode_mem, sunrealtype *hcur); SUNDIALS_EXPORT int CVodeGetCurrentState(void *cvode_mem, N_Vector *y); SUNDIALS_EXPORT int CVodeGetCurrentStateSens(void *cvode_mem, N_Vector **yS); SUNDIALS_EXPORT int CVodeGetCurrentSensSolveIndex(void *cvode_mem, int *index); -SUNDIALS_EXPORT int CVodeGetCurrentTime(void *cvode_mem, realtype *tcur); -SUNDIALS_EXPORT int CVodeGetTolScaleFactor(void *cvode_mem, realtype *tolsfac); +SUNDIALS_EXPORT int CVodeGetCurrentTime(void *cvode_mem, sunrealtype *tcur); +SUNDIALS_EXPORT int CVodeGetTolScaleFactor(void *cvode_mem, sunrealtype *tolsfac); SUNDIALS_EXPORT int CVodeGetErrWeights(void *cvode_mem, N_Vector eweight); SUNDIALS_EXPORT int CVodeGetEstLocalErrors(void *cvode_mem, N_Vector ele); SUNDIALS_EXPORT int CVodeGetNumGEvals(void *cvode_mem, long int *ngevals); @@ -303,19 +303,19 @@ SUNDIALS_EXPORT int CVodeGetIntegratorStats(void *cvode_mem, long int *nsteps, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur); -SUNDIALS_EXPORT int CVodeGetNonlinearSystemData(void *cvode_mem, realtype *tcur, + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur); +SUNDIALS_EXPORT int CVodeGetNonlinearSystemData(void *cvode_mem, sunrealtype *tcur, N_Vector *ypred, N_Vector *yn, - N_Vector *fn, realtype *gamma, - realtype *rl1, N_Vector *zn1, + N_Vector *fn, sunrealtype *gamma, + sunrealtype *rl1, N_Vector *zn1, void **user_data); SUNDIALS_EXPORT int CVodeGetNonlinearSystemDataSens(void *cvode_mem, - realtype *tcur, + sunrealtype *tcur, N_Vector **ySpred, N_Vector **ySn, - realtype *gamma, - realtype *rl1, + sunrealtype *gamma, + sunrealtype *rl1, N_Vector **zn1, void **user_data); SUNDIALS_EXPORT int CVodeGetNumNonlinSolvIters(void *cvode_mem, @@ -349,18 +349,18 @@ SUNDIALS_EXPORT int CVodeQuadInit(void *cvode_mem, CVQuadRhsFn fQ, SUNDIALS_EXPORT int CVodeQuadReInit(void *cvode_mem, N_Vector yQ0); /* Tolerance input functions */ -SUNDIALS_EXPORT int CVodeQuadSStolerances(void *cvode_mem, realtype reltolQ, - realtype abstolQ); -SUNDIALS_EXPORT int CVodeQuadSVtolerances(void *cvode_mem, realtype reltolQ, +SUNDIALS_EXPORT int CVodeQuadSStolerances(void *cvode_mem, sunrealtype reltolQ, + sunrealtype abstolQ); +SUNDIALS_EXPORT int CVodeQuadSVtolerances(void *cvode_mem, sunrealtype reltolQ, N_Vector abstolQ); /* Optional input specification functions */ SUNDIALS_EXPORT int CVodeSetQuadErrCon(void *cvode_mem, booleantype errconQ); /* Extraction and Dense Output Functions for Forward Problems */ -SUNDIALS_EXPORT int CVodeGetQuad(void *cvode_mem, realtype *tret, +SUNDIALS_EXPORT int CVodeGetQuad(void *cvode_mem, sunrealtype *tret, N_Vector yQout); -SUNDIALS_EXPORT int CVodeGetQuadDky(void *cvode_mem, realtype t, int k, +SUNDIALS_EXPORT int CVodeGetQuadDky(void *cvode_mem, sunrealtype t, int k, N_Vector dky); /* Optional output specification functions */ @@ -388,19 +388,19 @@ SUNDIALS_EXPORT int CVodeSensInit1(void *cvode_mem, int Ns, int ism, SUNDIALS_EXPORT int CVodeSensReInit(void *cvode_mem, int ism, N_Vector *yS0); /* Tolerance input functions */ -SUNDIALS_EXPORT int CVodeSensSStolerances(void *cvode_mem, realtype reltolS, - realtype *abstolS); -SUNDIALS_EXPORT int CVodeSensSVtolerances(void *cvode_mem, realtype reltolS, +SUNDIALS_EXPORT int CVodeSensSStolerances(void *cvode_mem, sunrealtype reltolS, + sunrealtype *abstolS); +SUNDIALS_EXPORT int CVodeSensSVtolerances(void *cvode_mem, sunrealtype reltolS, N_Vector *abstolS); SUNDIALS_EXPORT int CVodeSensEEtolerances(void *cvode_mem); /* Optional input specification functions */ SUNDIALS_EXPORT int CVodeSetSensDQMethod(void *cvode_mem, int DQtype, - realtype DQrhomax); + sunrealtype DQrhomax); SUNDIALS_EXPORT int CVodeSetSensErrCon(void *cvode_mem, booleantype errconS); SUNDIALS_EXPORT int CVodeSetSensMaxNonlinIters(void *cvode_mem, int maxcorS); -SUNDIALS_EXPORT int CVodeSetSensParams(void *cvode_mem, realtype *p, - realtype *pbar, int *plist); +SUNDIALS_EXPORT int CVodeSetSensParams(void *cvode_mem, sunrealtype *p, + sunrealtype *pbar, int *plist); /* Integrator nonlinear solver specification functions */ SUNDIALS_EXPORT int CVodeSetNonlinearSolverSensSim(void *cvode_mem, @@ -414,14 +414,14 @@ SUNDIALS_EXPORT int CVodeSetNonlinearSolverSensStg1(void *cvode_mem, SUNDIALS_EXPORT int CVodeSensToggleOff(void *cvode_mem); /* Extraction and dense output functions */ -SUNDIALS_EXPORT int CVodeGetSens(void *cvode_mem, realtype *tret, +SUNDIALS_EXPORT int CVodeGetSens(void *cvode_mem, sunrealtype *tret, N_Vector *ySout); -SUNDIALS_EXPORT int CVodeGetSens1(void *cvode_mem, realtype *tret, int is, +SUNDIALS_EXPORT int CVodeGetSens1(void *cvode_mem, sunrealtype *tret, int is, N_Vector ySout); -SUNDIALS_EXPORT int CVodeGetSensDky(void *cvode_mem, realtype t, int k, +SUNDIALS_EXPORT int CVodeGetSensDky(void *cvode_mem, sunrealtype t, int k, N_Vector *dkyA); -SUNDIALS_EXPORT int CVodeGetSensDky1(void *cvode_mem, realtype t, int k, int is, +SUNDIALS_EXPORT int CVodeGetSensDky1(void *cvode_mem, sunrealtype t, int k, int is, N_Vector dky); /* Optional output specification functions */ @@ -471,10 +471,10 @@ SUNDIALS_EXPORT int CVodeQuadSensReInit(void *cvode_mem, N_Vector *yQS0); /* Tolerance input functions */ SUNDIALS_EXPORT int CVodeQuadSensSStolerances(void *cvode_mem, - realtype reltolQS, - realtype *abstolQS); + sunrealtype reltolQS, + sunrealtype *abstolQS); SUNDIALS_EXPORT int CVodeQuadSensSVtolerances(void *cvode_mem, - realtype reltolQS, + sunrealtype reltolQS, N_Vector *abstolQS); SUNDIALS_EXPORT int CVodeQuadSensEEtolerances(void *cvode_mem); @@ -483,14 +483,14 @@ SUNDIALS_EXPORT int CVodeSetQuadSensErrCon(void *cvode_mem, booleantype errconQS); /* Extraction and dense output functions */ -SUNDIALS_EXPORT int CVodeGetQuadSens(void *cvode_mem, realtype *tret, +SUNDIALS_EXPORT int CVodeGetQuadSens(void *cvode_mem, sunrealtype *tret, N_Vector *yQSout); -SUNDIALS_EXPORT int CVodeGetQuadSens1(void *cvode_mem, realtype *tret, int is, +SUNDIALS_EXPORT int CVodeGetQuadSens1(void *cvode_mem, sunrealtype *tret, int is, N_Vector yQSout); -SUNDIALS_EXPORT int CVodeGetQuadSensDky(void *cvode_mem, realtype t, int k, +SUNDIALS_EXPORT int CVodeGetQuadSensDky(void *cvode_mem, sunrealtype t, int k, N_Vector *dkyQS_all); -SUNDIALS_EXPORT int CVodeGetQuadSensDky1(void *cvode_mem, realtype t, int k, +SUNDIALS_EXPORT int CVodeGetQuadSensDky1(void *cvode_mem, sunrealtype t, int k, int is, N_Vector dkyQS); /* Optional output specification functions */ @@ -526,17 +526,17 @@ SUNDIALS_EXPORT int CVodeCreateB(void *cvode_mem, int lmmB, int *which); SUNDIALS_EXPORT int CVodeInitB(void *cvode_mem, int which, CVRhsFnB fB, - realtype tB0, N_Vector yB0); + sunrealtype tB0, N_Vector yB0); SUNDIALS_EXPORT int CVodeInitBS(void *cvode_mem, int which, CVRhsFnBS fBs, - realtype tB0, N_Vector yB0); + sunrealtype tB0, N_Vector yB0); SUNDIALS_EXPORT int CVodeReInitB(void *cvode_mem, int which, - realtype tB0, N_Vector yB0); + sunrealtype tB0, N_Vector yB0); SUNDIALS_EXPORT int CVodeSStolerancesB(void *cvode_mem, int which, - realtype reltolB, realtype abstolB); + sunrealtype reltolB, sunrealtype abstolB); SUNDIALS_EXPORT int CVodeSVtolerancesB(void *cvode_mem, int which, - realtype reltolB, N_Vector abstolB); + sunrealtype reltolB, N_Vector abstolB); SUNDIALS_EXPORT int CVodeQuadInitB(void *cvode_mem, int which, CVQuadRhsFnB fQB, N_Vector yQB0); @@ -545,21 +545,21 @@ SUNDIALS_EXPORT int CVodeQuadInitBS(void *cvode_mem, int which, SUNDIALS_EXPORT int CVodeQuadReInitB(void *cvode_mem, int which, N_Vector yQB0); SUNDIALS_EXPORT int CVodeQuadSStolerancesB(void *cvode_mem, int which, - realtype reltolQB, - realtype abstolQB); + sunrealtype reltolQB, + sunrealtype abstolQB); SUNDIALS_EXPORT int CVodeQuadSVtolerancesB(void *cvode_mem, int which, - realtype reltolQB, + sunrealtype reltolQB, N_Vector abstolQB); /* Solver Function For Forward Problems */ -SUNDIALS_EXPORT int CVodeF(void *cvode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask, int *ncheckPtr); +SUNDIALS_EXPORT int CVodeF(void *cvode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask, int *ncheckPtr); /* Solver Function For Backward Problems */ -SUNDIALS_EXPORT int CVodeB(void *cvode_mem, realtype tBout, int itaskB); +SUNDIALS_EXPORT int CVodeB(void *cvode_mem, sunrealtype tBout, int itaskB); /* Optional Input Functions For Adjoint Problems */ @@ -573,11 +573,11 @@ SUNDIALS_EXPORT int CVodeSetMaxNumStepsB(void *cvode_mem, int which, SUNDIALS_EXPORT int CVodeSetStabLimDetB(void *cvode_mem, int which, booleantype stldetB); SUNDIALS_EXPORT int CVodeSetInitStepB(void *cvode_mem, int which, - realtype hinB); + sunrealtype hinB); SUNDIALS_EXPORT int CVodeSetMinStepB(void *cvode_mem, int which, - realtype hminB); + sunrealtype hminB); SUNDIALS_EXPORT int CVodeSetMaxStepB(void *cvode_mem, int which, - realtype hmaxB); + sunrealtype hmaxB); SUNDIALS_EXPORT int CVodeSetConstraintsB(void *cvode_mem, int which, N_Vector constraintsB); SUNDIALS_EXPORT int CVodeSetQuadErrConB(void *cvode_mem, int which, @@ -589,24 +589,24 @@ SUNDIALS_EXPORT int CVodeSetNonlinearSolverB(void *cvode_mem, int which, /* Extraction And Dense Output Functions For Backward Problems */ SUNDIALS_EXPORT int CVodeGetB(void *cvode_mem, int which, - realtype *tBret, N_Vector yB); + sunrealtype *tBret, N_Vector yB); SUNDIALS_EXPORT int CVodeGetQuadB(void *cvode_mem, int which, - realtype *tBret, N_Vector qB); + sunrealtype *tBret, N_Vector qB); /* Optional Output Functions For Backward Problems */ SUNDIALS_EXPORT void *CVodeGetAdjCVodeBmem(void *cvode_mem, int which); -SUNDIALS_EXPORT int CVodeGetAdjY(void *cvode_mem, realtype t, N_Vector y); +SUNDIALS_EXPORT int CVodeGetAdjY(void *cvode_mem, sunrealtype t, N_Vector y); typedef struct { void *my_addr; void *next_addr; - realtype t0; - realtype t1; + sunrealtype t0; + sunrealtype t1; long int nstep; int order; - realtype step; + sunrealtype step; } CVadjCheckPointRec; SUNDIALS_EXPORT int CVodeGetAdjCheckPointsInfo(void *cvode_mem, @@ -637,11 +637,11 @@ int CVodeSetJacTimesRhsFnB(void *cvode_mem, int which, CVRhsFn jtimesRhsFn); * ----------------------------------------------------------------- */ SUNDIALS_EXPORT int CVodeGetAdjDataPointHermite(void *cvode_mem, int which, - realtype *t, N_Vector y, + sunrealtype *t, N_Vector y, N_Vector yd); SUNDIALS_EXPORT int CVodeGetAdjDataPointPolynomial(void *cvode_mem, int which, - realtype *t, int *order, + sunrealtype *t, int *order, N_Vector y); /* ----------------------------------------------------------------- diff --git a/include/cvodes/cvodes_bbdpre.h b/include/cvodes/cvodes_bbdpre.h index 754e582269..668f6831ac 100644 --- a/include/cvodes/cvodes_bbdpre.h +++ b/include/cvodes/cvodes_bbdpre.h @@ -33,10 +33,10 @@ extern "C" { /* User-supplied function Types */ -typedef int (*CVLocalFn)(sunindextype Nlocal, realtype t, +typedef int (*CVLocalFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, N_Vector g, void *user_data); -typedef int (*CVCommFn)(sunindextype Nlocal, realtype t, +typedef int (*CVCommFn)(sunindextype Nlocal, sunrealtype t, N_Vector y, void *user_data); /* Exported Functions */ @@ -44,11 +44,11 @@ typedef int (*CVCommFn)(sunindextype Nlocal, realtype t, SUNDIALS_EXPORT int CVBBDPrecInit(void *cvode_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dqrely, CVLocalFn gloc, CVCommFn cfn); + sunrealtype dqrely, CVLocalFn gloc, CVCommFn cfn); SUNDIALS_EXPORT int CVBBDPrecReInit(void *cvode_mem, sunindextype mudq, sunindextype mldq, - realtype dqrely); + sunrealtype dqrely); /* Optional output functions */ @@ -67,10 +67,10 @@ SUNDIALS_EXPORT int CVBBDPrecGetNumGfnEvals(void *cvode_mem, /* User-Supplied Function Types */ -typedef int (*CVLocalFnB)(sunindextype NlocalB, realtype t, +typedef int (*CVLocalFnB)(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yB, N_Vector gB, void *user_dataB); -typedef int (*CVCommFnB)(sunindextype NlocalB, realtype t, +typedef int (*CVCommFnB)(sunindextype NlocalB, sunrealtype t, N_Vector y, N_Vector yB, void *user_dataB); @@ -79,11 +79,11 @@ typedef int (*CVCommFnB)(sunindextype NlocalB, realtype t, SUNDIALS_EXPORT int CVBBDPrecInitB(void *cvode_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, - realtype dqrelyB, CVLocalFnB glocB, CVCommFnB cfnB); + sunrealtype dqrelyB, CVLocalFnB glocB, CVCommFnB cfnB); SUNDIALS_EXPORT int CVBBDPrecReInitB(void *cvode_mem, int which, sunindextype mudqB, sunindextype mldqB, - realtype dqrelyB); + sunrealtype dqrelyB); #ifdef __cplusplus diff --git a/include/cvodes/cvodes_ls.h b/include/cvodes/cvodes_ls.h index bcd3f02442..3ebbcf0425 100644 --- a/include/cvodes/cvodes_ls.h +++ b/include/cvodes/cvodes_ls.h @@ -58,27 +58,27 @@ extern "C" { CVLS user-supplied function prototypes =================================================================*/ -typedef int (*CVLsJacFn)(realtype t, N_Vector y, N_Vector fy, +typedef int (*CVLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*CVLsPrecSetupFn)(realtype t, N_Vector y, N_Vector fy, +typedef int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *user_data); + sunrealtype gamma, void *user_data); -typedef int (*CVLsPrecSolveFn)(realtype t, N_Vector y, N_Vector fy, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *user_data); +typedef int (*CVLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *user_data); -typedef int (*CVLsJacTimesSetupFn)(realtype t, N_Vector y, +typedef int (*CVLsJacTimesSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, void *user_data); -typedef int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, realtype t, +typedef int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); -typedef int (*CVLsLinSysFn)(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, realtype gamma, +typedef int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, + booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -101,10 +101,10 @@ SUNDIALS_EXPORT int CVodeSetJacEvalFrequency(void *cvode_mem, SUNDIALS_EXPORT int CVodeSetLinearSolutionScaling(void *cvode_mem, booleantype onoff); SUNDIALS_EXPORT int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, - realtype dgmax_jbad); -SUNDIALS_EXPORT int CVodeSetEpsLin(void *cvode_mem, realtype eplifac); + sunrealtype dgmax_jbad); +SUNDIALS_EXPORT int CVodeSetEpsLin(void *cvode_mem, sunrealtype eplifac); SUNDIALS_EXPORT int CVodeSetLSNormFactor(void *arkode_mem, - realtype nrmfac); + sunrealtype nrmfac); SUNDIALS_EXPORT int CVodeSetPreconditioner(void *cvode_mem, CVLsPrecSetupFn pset, CVLsPrecSolveFn psolve); @@ -156,64 +156,64 @@ SUNDIALS_EXPORT char *CVodeGetLinReturnFlagName(long int flag); CVLS user-supplied function prototypes =================================================================*/ -typedef int (*CVLsJacFnB)(realtype t, N_Vector y, N_Vector yB, +typedef int (*CVLsJacFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -typedef int (*CVLsJacFnBS)(realtype t, N_Vector y, N_Vector *yS, +typedef int (*CVLsJacFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -typedef int (*CVLsPrecSetupFnB)(realtype t, N_Vector y, N_Vector yB, +typedef int (*CVLsPrecSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, - realtype gammaB, void *user_dataB); + sunrealtype gammaB, void *user_dataB); -typedef int (*CVLsPrecSetupFnBS)(realtype t, N_Vector y, +typedef int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, - realtype gammaB, void *user_dataB); + sunrealtype gammaB, void *user_dataB); -typedef int (*CVLsPrecSolveFnB)(realtype t, N_Vector y, N_Vector yB, +typedef int (*CVLsPrecSolveFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, N_Vector rB, - N_Vector zB, realtype gammaB, - realtype deltaB, int lrB, + N_Vector zB, sunrealtype gammaB, + sunrealtype deltaB, int lrB, void *user_dataB); -typedef int (*CVLsPrecSolveFnBS)(realtype t, N_Vector y, N_Vector *yS, +typedef int (*CVLsPrecSolveFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, N_Vector rB, N_Vector zB, - realtype gammaB, realtype deltaB, + sunrealtype gammaB, sunrealtype deltaB, int lrB, void *user_dataB); -typedef int (*CVLsJacTimesSetupFnB)(realtype t, N_Vector y, N_Vector yB, +typedef int (*CVLsJacTimesSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, void *jac_dataB); -typedef int (*CVLsJacTimesSetupFnBS)(realtype t, N_Vector y, +typedef int (*CVLsJacTimesSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *jac_dataB); -typedef int (*CVLsJacTimesVecFnB)(N_Vector vB, N_Vector JvB, realtype t, +typedef int (*CVLsJacTimesVecFnB)(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, void *jac_dataB, N_Vector tmpB); typedef int (*CVLsJacTimesVecFnBS)(N_Vector vB, N_Vector JvB, - realtype t, N_Vector y, N_Vector *yS, + sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *jac_dataB, N_Vector tmpB); -typedef int (*CVLsLinSysFnB)(realtype t, N_Vector y, N_Vector yB, N_Vector fyB, +typedef int (*CVLsLinSysFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, - realtype gammaB, void *user_dataB, N_Vector tmp1B, + sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -typedef int (*CVLsLinSysFnBS)(realtype t, N_Vector y, N_Vector* yS, +typedef int (*CVLsLinSysFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, - realtype gammaB, void *user_dataB, N_Vector tmp1B, + sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); /*================================================================= @@ -238,10 +238,10 @@ SUNDIALS_EXPORT int CVodeSetJacFnBS(void *cvode_mem, int which, CVLsJacFnBS jacBS); SUNDIALS_EXPORT int CVodeSetEpsLinB(void *cvode_mem, int which, - realtype eplifacB); + sunrealtype eplifacB); SUNDIALS_EXPORT int CVodeSetLSNormFactorB(void *arkode_mem, int which, - realtype nrmfacB); + sunrealtype nrmfacB); SUNDIALS_EXPORT int CVodeSetLinearSolutionScalingB(void *cvode_mem, int which, booleantype onoffB); diff --git a/include/cvodes/cvodes_proj.h b/include/cvodes/cvodes_proj.h index c34b527f2e..eca1771537 100644 --- a/include/cvodes/cvodes_proj.h +++ b/include/cvodes/cvodes_proj.h @@ -29,8 +29,8 @@ extern "C" { * CVProj user-supplied function prototypes * ---------------------------------------------------------------------------*/ -typedef int (*CVProjFn)(realtype t, N_Vector ycur, N_Vector corr, - realtype epsProj, N_Vector err, void *user_data); +typedef int (*CVProjFn)(sunrealtype t, N_Vector ycur, N_Vector corr, + sunrealtype epsProj, N_Vector err, void *user_data); /* ----------------------------------------------------------------------------- @@ -44,8 +44,8 @@ SUNDIALS_EXPORT int CVodeSetProjFn(void *cvode_mem, CVProjFn pfun); SUNDIALS_EXPORT int CVodeSetProjErrEst(void *cvode_mem, booleantype onoff); SUNDIALS_EXPORT int CVodeSetProjFrequency(void *cvode_mem, long int proj_freq); SUNDIALS_EXPORT int CVodeSetMaxNumProjFails(void *cvode_mem, int max_fails); -SUNDIALS_EXPORT int CVodeSetEpsProj(void *cvode_mem, realtype eps); -SUNDIALS_EXPORT int CVodeSetProjFailEta(void *cvode_mem, realtype eta); +SUNDIALS_EXPORT int CVodeSetEpsProj(void *cvode_mem, sunrealtype eps); +SUNDIALS_EXPORT int CVodeSetProjFailEta(void *cvode_mem, sunrealtype eta); /* Optional output functions */ SUNDIALS_EXPORT int CVodeGetNumProjEvals(void *cvode_mem, long int *nproj); diff --git a/include/ida/ida.h b/include/ida/ida.h index cd0c4e571a..347c352daf 100644 --- a/include/ida/ida.h +++ b/include/ida/ida.h @@ -87,11 +87,11 @@ extern "C" { * User-Supplied Function Types * ------------------------------ */ -typedef int (*IDAResFn)(realtype tt, N_Vector yy, N_Vector yp, +typedef int (*IDAResFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data); -typedef int (*IDARootFn)(realtype t, N_Vector y, N_Vector yp, - realtype *gout, void *user_data); +typedef int (*IDARootFn)(sunrealtype t, N_Vector y, N_Vector yp, + sunrealtype *gout, void *user_data); typedef int (*IDAEwtFn)(N_Vector y, N_Vector ewt, void *user_data); @@ -106,42 +106,42 @@ typedef void (*IDAErrHandlerFn)(int error_code, /* Initialization functions */ SUNDIALS_EXPORT void *IDACreate(SUNContext sunctx); -SUNDIALS_EXPORT int IDAInit(void *ida_mem, IDAResFn res, realtype t0, +SUNDIALS_EXPORT int IDAInit(void *ida_mem, IDAResFn res, sunrealtype t0, N_Vector yy0, N_Vector yp0); -SUNDIALS_EXPORT int IDAReInit(void *ida_mem, realtype t0, N_Vector yy0, +SUNDIALS_EXPORT int IDAReInit(void *ida_mem, sunrealtype t0, N_Vector yy0, N_Vector yp0); /* Tolerance input functions */ -SUNDIALS_EXPORT int IDASStolerances(void *ida_mem, realtype reltol, - realtype abstol); -SUNDIALS_EXPORT int IDASVtolerances(void *ida_mem, realtype reltol, +SUNDIALS_EXPORT int IDASStolerances(void *ida_mem, sunrealtype reltol, + sunrealtype abstol); +SUNDIALS_EXPORT int IDASVtolerances(void *ida_mem, sunrealtype reltol, N_Vector abstol); SUNDIALS_EXPORT int IDAWFtolerances(void *ida_mem, IDAEwtFn efun); /* Initial condition calculation function */ -SUNDIALS_EXPORT int IDACalcIC(void *ida_mem, int icopt, realtype tout1); +SUNDIALS_EXPORT int IDACalcIC(void *ida_mem, int icopt, sunrealtype tout1); /* Initial condition calculation optional input functions */ -SUNDIALS_EXPORT int IDASetNonlinConvCoefIC(void *ida_mem, realtype epiccon); +SUNDIALS_EXPORT int IDASetNonlinConvCoefIC(void *ida_mem, sunrealtype epiccon); SUNDIALS_EXPORT int IDASetMaxNumStepsIC(void *ida_mem, int maxnh); SUNDIALS_EXPORT int IDASetMaxNumJacsIC(void *ida_mem, int maxnj); SUNDIALS_EXPORT int IDASetMaxNumItersIC(void *ida_mem, int maxnit); SUNDIALS_EXPORT int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff); -SUNDIALS_EXPORT int IDASetStepToleranceIC(void *ida_mem, realtype steptol); +SUNDIALS_EXPORT int IDASetStepToleranceIC(void *ida_mem, sunrealtype steptol); SUNDIALS_EXPORT int IDASetMaxBacksIC(void *ida_mem, int maxbacks); /* Optional input functions */ -SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void *ida_max, realtype dcj); +SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void *ida_max, sunrealtype dcj); SUNDIALS_EXPORT int IDASetErrHandlerFn(void *ida_mem, IDAErrHandlerFn ehfun, void *eh_data); SUNDIALS_EXPORT int IDASetErrFile(void *ida_mem, FILE *errfp); SUNDIALS_EXPORT int IDASetUserData(void *ida_mem, void *user_data); SUNDIALS_EXPORT int IDASetMaxOrd(void *ida_mem, int maxord); SUNDIALS_EXPORT int IDASetMaxNumSteps(void *ida_mem, long int mxsteps); -SUNDIALS_EXPORT int IDASetInitStep(void *ida_mem, realtype hin); -SUNDIALS_EXPORT int IDASetMaxStep(void *ida_mem, realtype hmax); -SUNDIALS_EXPORT int IDASetMinStep(void *ida_mem, realtype hmin); -SUNDIALS_EXPORT int IDASetStopTime(void *ida_mem, realtype tstop); +SUNDIALS_EXPORT int IDASetInitStep(void *ida_mem, sunrealtype hin); +SUNDIALS_EXPORT int IDASetMaxStep(void *ida_mem, sunrealtype hmax); +SUNDIALS_EXPORT int IDASetMinStep(void *ida_mem, sunrealtype hmin); +SUNDIALS_EXPORT int IDASetStopTime(void *ida_mem, sunrealtype tstop); SUNDIALS_EXPORT int IDAClearStopTime(void *ida_mem); SUNDIALS_EXPORT int IDASetMaxErrTestFails(void *ida_mem, int maxnef); SUNDIALS_EXPORT int IDASetSuppressAlg(void *ida_mem, booleantype suppressalg); @@ -150,24 +150,24 @@ SUNDIALS_EXPORT int IDASetConstraints(void *ida_mem, N_Vector constraints); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT -int IDASetEtaFixedStepBounds(void *ida_mem, realtype eta_min_fx, - realtype eta_max_fx); +int IDASetEtaFixedStepBounds(void *ida_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx); SUNDIALS_EXPORT -int IDASetEtaMin(void *ida_mem, realtype eta_min); +int IDASetEtaMin(void *ida_mem, sunrealtype eta_min); SUNDIALS_EXPORT -int IDASetEtaMax(void *ida_mem, realtype eta_max); +int IDASetEtaMax(void *ida_mem, sunrealtype eta_max); SUNDIALS_EXPORT -int IDASetEtaLow(void *ida_mem, realtype eta_low); +int IDASetEtaLow(void *ida_mem, sunrealtype eta_low); SUNDIALS_EXPORT -int IDASetEtaMinErrFail(void *ida_mem, realtype eta_min_ef); +int IDASetEtaMinErrFail(void *ida_mem, sunrealtype eta_min_ef); SUNDIALS_EXPORT -int IDASetEtaConvFail(void *ida_mem, realtype eta_cf); +int IDASetEtaConvFail(void *ida_mem, sunrealtype eta_cf); /* Nonlinear solve input functions */ SUNDIALS_EXPORT int IDASetMaxConvFails(void *ida_mem, int maxncf); SUNDIALS_EXPORT int IDASetMaxNonlinIters(void *ida_mem, int maxcor); SUNDIALS_EXPORT int IDASetNlsResFn(void *IDA_mem, IDAResFn res); -SUNDIALS_EXPORT int IDASetNonlinConvCoef(void *ida_mem, realtype epcon); +SUNDIALS_EXPORT int IDASetNonlinConvCoef(void *ida_mem, sunrealtype epcon); SUNDIALS_EXPORT int IDASetNonlinearSolver(void *ida_mem, SUNNonlinearSolver NLS); @@ -179,7 +179,7 @@ SUNDIALS_EXPORT int IDASetRootDirection(void *ida_mem, int *rootdir); SUNDIALS_EXPORT int IDASetNoInactiveRootWarn(void *ida_mem); /* Solver function */ -SUNDIALS_EXPORT int IDASolve(void *ida_mem, realtype tout, realtype *tret, +SUNDIALS_EXPORT int IDASolve(void *ida_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask); /* Utility functions to update/compute y and yp based on ycor */ @@ -187,7 +187,7 @@ SUNDIALS_EXPORT int IDAComputeY(void *ida_mem, N_Vector ycor, N_Vector y); SUNDIALS_EXPORT int IDAComputeYp(void *ida_mem, N_Vector ycor, N_Vector yp); /* Dense output function */ -SUNDIALS_EXPORT int IDAGetDky(void *ida_mem, realtype t, int k, N_Vector dky); +SUNDIALS_EXPORT int IDAGetDky(void *ida_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ SUNDIALS_EXPORT int IDAGetWorkSpace(void *ida_mem, long int *lenrw, @@ -201,14 +201,14 @@ SUNDIALS_EXPORT int IDAGetConsistentIC(void *ida_mem, N_Vector yy0_mod, N_Vector yp0_mod); SUNDIALS_EXPORT int IDAGetLastOrder(void *ida_mem, int *klast); SUNDIALS_EXPORT int IDAGetCurrentOrder(void *ida_mem, int *kcur); -SUNDIALS_EXPORT int IDAGetCurrentCj(void *ida_mem, realtype *cj); +SUNDIALS_EXPORT int IDAGetCurrentCj(void *ida_mem, sunrealtype *cj); SUNDIALS_EXPORT int IDAGetCurrentY(void *ida_mem, N_Vector *ycur); SUNDIALS_EXPORT int IDAGetCurrentYp(void *ida_mem, N_Vector *ypcur); -SUNDIALS_EXPORT int IDAGetActualInitStep(void *ida_mem, realtype *hinused); -SUNDIALS_EXPORT int IDAGetLastStep(void *ida_mem, realtype *hlast); -SUNDIALS_EXPORT int IDAGetCurrentStep(void *ida_mem, realtype *hcur); -SUNDIALS_EXPORT int IDAGetCurrentTime(void *ida_mem, realtype *tcur); -SUNDIALS_EXPORT int IDAGetTolScaleFactor(void *ida_mem, realtype *tolsfact); +SUNDIALS_EXPORT int IDAGetActualInitStep(void *ida_mem, sunrealtype *hinused); +SUNDIALS_EXPORT int IDAGetLastStep(void *ida_mem, sunrealtype *hlast); +SUNDIALS_EXPORT int IDAGetCurrentStep(void *ida_mem, sunrealtype *hcur); +SUNDIALS_EXPORT int IDAGetCurrentTime(void *ida_mem, sunrealtype *tcur); +SUNDIALS_EXPORT int IDAGetTolScaleFactor(void *ida_mem, sunrealtype *tolsfact); SUNDIALS_EXPORT int IDAGetErrWeights(void *ida_mem, N_Vector eweight); SUNDIALS_EXPORT int IDAGetEstLocalErrors(void *ida_mem, N_Vector ele); SUNDIALS_EXPORT int IDAGetNumGEvals(void *ida_mem, long int *ngevals); @@ -218,13 +218,13 @@ SUNDIALS_EXPORT int IDAGetIntegratorStats(void *ida_mem, long int *nsteps, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur); -SUNDIALS_EXPORT int IDAGetNonlinearSystemData(void *ida_mem, realtype *tcur, + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur); +SUNDIALS_EXPORT int IDAGetNonlinearSystemData(void *ida_mem, sunrealtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, - N_Vector *res, realtype *cj, + N_Vector *res, sunrealtype *cj, void **user_data); SUNDIALS_EXPORT int IDAGetNumNonlinSolvIters(void *ida_mem, long int *nniters); SUNDIALS_EXPORT int IDAGetNumNonlinSolvConvFails(void *ida_mem, diff --git a/include/ida/ida_bbdpre.h b/include/ida/ida_bbdpre.h index 8ba2af5b35..ccb3a3614c 100644 --- a/include/ida/ida_bbdpre.h +++ b/include/ida/ida_bbdpre.h @@ -29,11 +29,11 @@ extern "C" { /* User-supplied function Types */ -typedef int (*IDABBDLocalFn)(sunindextype Nlocal, realtype tt, +typedef int (*IDABBDLocalFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector gval, void *user_data); -typedef int (*IDABBDCommFn)(sunindextype Nlocal, realtype tt, +typedef int (*IDABBDCommFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, void *user_data); /* Exported Functions */ @@ -41,12 +41,12 @@ typedef int (*IDABBDCommFn)(sunindextype Nlocal, realtype tt, SUNDIALS_EXPORT int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dq_rel_yy, + sunrealtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm); SUNDIALS_EXPORT int IDABBDPrecReInit(void *ida_mem, sunindextype mudq, sunindextype mldq, - realtype dq_rel_yy); + sunrealtype dq_rel_yy); /* Optional output functions */ diff --git a/include/ida/ida_ls.h b/include/ida/ida_ls.h index 12a7fcb065..dbbcc0ed5c 100644 --- a/include/ida/ida_ls.h +++ b/include/ida/ida_ls.h @@ -50,29 +50,29 @@ extern "C" { IDALS user-supplied function prototypes =================================================================*/ -typedef int (*IDALsJacFn)(realtype t, realtype c_j, N_Vector y, +typedef int (*IDALsJacFn)(sunrealtype t, sunrealtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*IDALsPrecSetupFn)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); + sunrealtype c_j, void *user_data); -typedef int (*IDALsPrecSolveFn)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSolveFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, + sunrealtype c_j, sunrealtype delta, void *user_data); -typedef int (*IDALsJacTimesSetupFn)(realtype tt, N_Vector yy, +typedef int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); + sunrealtype c_j, void *user_data); -typedef int (*IDALsJacTimesVecFn)(realtype tt, N_Vector yy, +typedef int (*IDALsJacTimesVecFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, - realtype c_j, void *user_data, + sunrealtype c_j, void *user_data, N_Vector tmp1, N_Vector tmp2); @@ -96,13 +96,13 @@ SUNDIALS_EXPORT int IDASetPreconditioner(void *ida_mem, SUNDIALS_EXPORT int IDASetJacTimes(void *ida_mem, IDALsJacTimesSetupFn jtsetup, IDALsJacTimesVecFn jtimes); -SUNDIALS_EXPORT int IDASetEpsLin(void *ida_mem, realtype eplifac); +SUNDIALS_EXPORT int IDASetEpsLin(void *ida_mem, sunrealtype eplifac); SUNDIALS_EXPORT int IDASetLSNormFactor(void *ida_mem, - realtype nrmfac); + sunrealtype nrmfac); SUNDIALS_EXPORT int IDASetLinearSolutionScaling(void *ida_mem, booleantype onoff); SUNDIALS_EXPORT int IDASetIncrementFactor(void *ida_mem, - realtype dqincfac); + sunrealtype dqincfac); /*----------------------------------------------------------------- Optional outputs from the IDALS linear solver interface diff --git a/include/idas/idas.h b/include/idas/idas.h index f89f15bc67..b1cc894521 100644 --- a/include/idas/idas.h +++ b/include/idas/idas.h @@ -122,11 +122,11 @@ extern "C" { * User-Supplied Function Types * ------------------------------ */ -typedef int (*IDAResFn)(realtype tt, N_Vector yy, N_Vector yp, +typedef int (*IDAResFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data); -typedef int (*IDARootFn)(realtype t, N_Vector y, N_Vector yp, - realtype *gout, void *user_data); +typedef int (*IDARootFn)(sunrealtype t, N_Vector y, N_Vector yp, + sunrealtype *gout, void *user_data); typedef int (*IDAEwtFn)(N_Vector y, N_Vector ewt, void *user_data); @@ -134,39 +134,39 @@ typedef void (*IDAErrHandlerFn)(int error_code, const char *module, const char *function, char *msg, void *user_data); -typedef int (*IDAQuadRhsFn)(realtype tres, N_Vector yy, N_Vector yp, +typedef int (*IDAQuadRhsFn)(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rrQ, void *user_data); -typedef int (*IDASensResFn)(int Ns, realtype t, +typedef int (*IDASensResFn)(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*IDAQuadSensRhsFn)(int Ns, realtype t, +typedef int (*IDAQuadSensRhsFn)(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *rhsvalQS, void *user_data, N_Vector yytmp, N_Vector yptmp, N_Vector tmpQS); -typedef int (*IDAResFnB)(realtype tt, +typedef int (*IDAResFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *user_dataB); -typedef int (*IDAResFnBS)(realtype t, +typedef int (*IDAResFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrBS, void *user_dataB); -typedef int (*IDAQuadRhsFnB)(realtype tt, +typedef int (*IDAQuadRhsFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rhsvalBQ, void *user_dataB); -typedef int (*IDAQuadRhsFnBS)(realtype t, +typedef int (*IDAQuadRhsFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, @@ -180,42 +180,42 @@ typedef int (*IDAQuadRhsFnBS)(realtype t, /* Initialization functions */ SUNDIALS_EXPORT void *IDACreate(SUNContext sunctx); -SUNDIALS_EXPORT int IDAInit(void *ida_mem, IDAResFn res, realtype t0, +SUNDIALS_EXPORT int IDAInit(void *ida_mem, IDAResFn res, sunrealtype t0, N_Vector yy0, N_Vector yp0); -SUNDIALS_EXPORT int IDAReInit(void *ida_mem, realtype t0, N_Vector yy0, +SUNDIALS_EXPORT int IDAReInit(void *ida_mem, sunrealtype t0, N_Vector yy0, N_Vector yp0); /* Tolerance input functions */ -SUNDIALS_EXPORT int IDASStolerances(void *ida_mem, realtype reltol, - realtype abstol); -SUNDIALS_EXPORT int IDASVtolerances(void *ida_mem, realtype reltol, +SUNDIALS_EXPORT int IDASStolerances(void *ida_mem, sunrealtype reltol, + sunrealtype abstol); +SUNDIALS_EXPORT int IDASVtolerances(void *ida_mem, sunrealtype reltol, N_Vector abstol); SUNDIALS_EXPORT int IDAWFtolerances(void *ida_mem, IDAEwtFn efun); /* Initial condition calculation function */ -SUNDIALS_EXPORT int IDACalcIC(void *ida_mem, int icopt, realtype tout1); +SUNDIALS_EXPORT int IDACalcIC(void *ida_mem, int icopt, sunrealtype tout1); /* Initial condition calculation optional input functions */ -SUNDIALS_EXPORT int IDASetNonlinConvCoefIC(void *ida_mem, realtype epiccon); +SUNDIALS_EXPORT int IDASetNonlinConvCoefIC(void *ida_mem, sunrealtype epiccon); SUNDIALS_EXPORT int IDASetMaxNumStepsIC(void *ida_mem, int maxnh); SUNDIALS_EXPORT int IDASetMaxNumJacsIC(void *ida_mem, int maxnj); SUNDIALS_EXPORT int IDASetMaxNumItersIC(void *ida_mem, int maxnit); SUNDIALS_EXPORT int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff); -SUNDIALS_EXPORT int IDASetStepToleranceIC(void *ida_mem, realtype steptol); +SUNDIALS_EXPORT int IDASetStepToleranceIC(void *ida_mem, sunrealtype steptol); SUNDIALS_EXPORT int IDASetMaxBacksIC(void *ida_mem, int maxbacks); /* Optional input functions */ -SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void *ida_max, realtype dcj); +SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void *ida_max, sunrealtype dcj); SUNDIALS_EXPORT int IDASetErrHandlerFn(void *ida_mem, IDAErrHandlerFn ehfun, void *eh_data); SUNDIALS_EXPORT int IDASetErrFile(void *ida_mem, FILE *errfp); SUNDIALS_EXPORT int IDASetUserData(void *ida_mem, void *user_data); SUNDIALS_EXPORT int IDASetMaxOrd(void *ida_mem, int maxord); SUNDIALS_EXPORT int IDASetMaxNumSteps(void *ida_mem, long int mxsteps); -SUNDIALS_EXPORT int IDASetInitStep(void *ida_mem, realtype hin); -SUNDIALS_EXPORT int IDASetMaxStep(void *ida_mem, realtype hmax); -SUNDIALS_EXPORT int IDASetMinStep(void *ida_mem, realtype hmin); -SUNDIALS_EXPORT int IDASetStopTime(void *ida_mem, realtype tstop); +SUNDIALS_EXPORT int IDASetInitStep(void *ida_mem, sunrealtype hin); +SUNDIALS_EXPORT int IDASetMaxStep(void *ida_mem, sunrealtype hmax); +SUNDIALS_EXPORT int IDASetMinStep(void *ida_mem, sunrealtype hmin); +SUNDIALS_EXPORT int IDASetStopTime(void *ida_mem, sunrealtype tstop); SUNDIALS_EXPORT int IDAClearStopTime(void *ida_mem); SUNDIALS_EXPORT int IDASetMaxErrTestFails(void *ida_mem, int maxnef); SUNDIALS_EXPORT int IDASetSuppressAlg(void *ida_mem, booleantype suppressalg); @@ -224,24 +224,24 @@ SUNDIALS_EXPORT int IDASetConstraints(void *ida_mem, N_Vector constraints); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT -int IDASetEtaFixedStepBounds(void *ida_mem, realtype eta_min_fx, - realtype eta_max_fx); +int IDASetEtaFixedStepBounds(void *ida_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx); SUNDIALS_EXPORT -int IDASetEtaMin(void *ida_mem, realtype eta_min); +int IDASetEtaMin(void *ida_mem, sunrealtype eta_min); SUNDIALS_EXPORT -int IDASetEtaMax(void *ida_mem, realtype eta_max); +int IDASetEtaMax(void *ida_mem, sunrealtype eta_max); SUNDIALS_EXPORT -int IDASetEtaLow(void *ida_mem, realtype eta_low); +int IDASetEtaLow(void *ida_mem, sunrealtype eta_low); SUNDIALS_EXPORT -int IDASetEtaMinErrFail(void *ida_mem, realtype eta_min_ef); +int IDASetEtaMinErrFail(void *ida_mem, sunrealtype eta_min_ef); SUNDIALS_EXPORT -int IDASetEtaConvFail(void *ida_mem, realtype eta_cf); +int IDASetEtaConvFail(void *ida_mem, sunrealtype eta_cf); /* Nonlinear solve input functions */ SUNDIALS_EXPORT int IDASetMaxConvFails(void *ida_mem, int maxncf); SUNDIALS_EXPORT int IDASetMaxNonlinIters(void *ida_mem, int maxcor); SUNDIALS_EXPORT int IDASetNlsResFn(void *IDA_mem, IDAResFn res); -SUNDIALS_EXPORT int IDASetNonlinConvCoef(void *ida_mem, realtype epcon); +SUNDIALS_EXPORT int IDASetNonlinConvCoef(void *ida_mem, sunrealtype epcon); SUNDIALS_EXPORT int IDASetNonlinearSolver(void *ida_mem, SUNNonlinearSolver NLS); @@ -253,7 +253,7 @@ SUNDIALS_EXPORT int IDASetRootDirection(void *ida_mem, int *rootdir); SUNDIALS_EXPORT int IDASetNoInactiveRootWarn(void *ida_mem); /* Solver function */ -SUNDIALS_EXPORT int IDASolve(void *ida_mem, realtype tout, realtype *tret, +SUNDIALS_EXPORT int IDASolve(void *ida_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask); /* Utility functions to update/compute y and yp based on ycor */ @@ -263,7 +263,7 @@ SUNDIALS_EXPORT int IDAComputeYSens(void *ida_mem, N_Vector *ycor, N_Vector *yyS SUNDIALS_EXPORT int IDAComputeYpSens(void *ida_mem, N_Vector *ycor, N_Vector *ypS); /* Dense output function */ -SUNDIALS_EXPORT int IDAGetDky(void *ida_mem, realtype t, int k, N_Vector dky); +SUNDIALS_EXPORT int IDAGetDky(void *ida_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ SUNDIALS_EXPORT int IDAGetWorkSpace(void *ida_mem, long int *lenrw, @@ -277,16 +277,16 @@ SUNDIALS_EXPORT int IDAGetConsistentIC(void *ida_mem, N_Vector yy0_mod, N_Vector yp0_mod); SUNDIALS_EXPORT int IDAGetLastOrder(void *ida_mem, int *klast); SUNDIALS_EXPORT int IDAGetCurrentOrder(void *ida_mem, int *kcur); -SUNDIALS_EXPORT int IDAGetCurrentCj(void *ida_mem, realtype *cj); +SUNDIALS_EXPORT int IDAGetCurrentCj(void *ida_mem, sunrealtype *cj); SUNDIALS_EXPORT int IDAGetCurrentY(void *ida_mem, N_Vector *ycur); SUNDIALS_EXPORT int IDAGetCurrentYSens(void *ida_mem, N_Vector **yS); SUNDIALS_EXPORT int IDAGetCurrentYp(void *ida_mem, N_Vector *ypcur); SUNDIALS_EXPORT int IDAGetCurrentYpSens(void *ida_mem, N_Vector **ypS); -SUNDIALS_EXPORT int IDAGetActualInitStep(void *ida_mem, realtype *hinused); -SUNDIALS_EXPORT int IDAGetLastStep(void *ida_mem, realtype *hlast); -SUNDIALS_EXPORT int IDAGetCurrentStep(void *ida_mem, realtype *hcur); -SUNDIALS_EXPORT int IDAGetCurrentTime(void *ida_mem, realtype *tcur); -SUNDIALS_EXPORT int IDAGetTolScaleFactor(void *ida_mem, realtype *tolsfact); +SUNDIALS_EXPORT int IDAGetActualInitStep(void *ida_mem, sunrealtype *hinused); +SUNDIALS_EXPORT int IDAGetLastStep(void *ida_mem, sunrealtype *hlast); +SUNDIALS_EXPORT int IDAGetCurrentStep(void *ida_mem, sunrealtype *hcur); +SUNDIALS_EXPORT int IDAGetCurrentTime(void *ida_mem, sunrealtype *tcur); +SUNDIALS_EXPORT int IDAGetTolScaleFactor(void *ida_mem, sunrealtype *tolsfact); SUNDIALS_EXPORT int IDAGetErrWeights(void *ida_mem, N_Vector eweight); SUNDIALS_EXPORT int IDAGetEstLocalErrors(void *ida_mem, N_Vector ele); SUNDIALS_EXPORT int IDAGetNumGEvals(void *ida_mem, long int *ngevals); @@ -296,20 +296,20 @@ SUNDIALS_EXPORT int IDAGetIntegratorStats(void *ida_mem, long int *nsteps, long int *nlinsetups, long int *netfails, int *qlast, int *qcur, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur); -SUNDIALS_EXPORT int IDAGetNonlinearSystemData(void *ida_mem, realtype *tcur, + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur); +SUNDIALS_EXPORT int IDAGetNonlinearSystemData(void *ida_mem, sunrealtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, - N_Vector *res, realtype *cj, + N_Vector *res, sunrealtype *cj, void **user_data); -SUNDIALS_EXPORT int IDAGetNonlinearSystemDataSens(void *ida_mem, realtype *tcur, +SUNDIALS_EXPORT int IDAGetNonlinearSystemDataSens(void *ida_mem, sunrealtype *tcur, N_Vector **yySpred, N_Vector **ypSpred, N_Vector **yySn, N_Vector **ypSn, - realtype *cj, + sunrealtype *cj, void **user_data); SUNDIALS_EXPORT int IDAGetNumNonlinSolvIters(void *ida_mem, long int *nniters); SUNDIALS_EXPORT int IDAGetNumNonlinSolvConvFails(void *ida_mem, @@ -340,17 +340,17 @@ SUNDIALS_EXPORT int IDAQuadInit(void *ida_mem, IDAQuadRhsFn rhsQ, N_Vector yQ0); SUNDIALS_EXPORT int IDAQuadReInit(void *ida_mem, N_Vector yQ0); /* Tolerance input functions */ -SUNDIALS_EXPORT int IDAQuadSStolerances(void *ida_mem, realtype reltolQ, - realtype abstolQ); -SUNDIALS_EXPORT int IDAQuadSVtolerances(void *ida_mem, realtype reltolQ, +SUNDIALS_EXPORT int IDAQuadSStolerances(void *ida_mem, sunrealtype reltolQ, + sunrealtype abstolQ); +SUNDIALS_EXPORT int IDAQuadSVtolerances(void *ida_mem, sunrealtype reltolQ, N_Vector abstolQ); /* Optional input specification functions */ SUNDIALS_EXPORT int IDASetQuadErrCon(void *ida_mem, booleantype errconQ); /* Extraction and dense output functions */ -SUNDIALS_EXPORT int IDAGetQuad(void *ida_mem, realtype *t, N_Vector yQout); -SUNDIALS_EXPORT int IDAGetQuadDky(void *ida_mem, realtype t, int k, +SUNDIALS_EXPORT int IDAGetQuad(void *ida_mem, sunrealtype *t, N_Vector yQout); +SUNDIALS_EXPORT int IDAGetQuadDky(void *ida_mem, sunrealtype t, int k, N_Vector dky); /* Optional output specification functions */ @@ -377,9 +377,9 @@ SUNDIALS_EXPORT int IDASensReInit(void *ida_mem, int ism, N_Vector *yS0, N_Vector *ypS0); /* Tolerance input functions */ -SUNDIALS_EXPORT int IDASensSStolerances(void *ida_mem, realtype reltolS, - realtype *abstolS); -SUNDIALS_EXPORT int IDASensSVtolerances(void *ida_mem, realtype reltolS, +SUNDIALS_EXPORT int IDASensSStolerances(void *ida_mem, sunrealtype reltolS, + sunrealtype *abstolS); +SUNDIALS_EXPORT int IDASensSVtolerances(void *ida_mem, sunrealtype reltolS, N_Vector *abstolS); SUNDIALS_EXPORT int IDASensEEtolerances(void *ida_mem); @@ -389,10 +389,10 @@ SUNDIALS_EXPORT int IDAGetSensConsistentIC(void *ida_mem, N_Vector *yyS0, /* Optional input specification functions */ SUNDIALS_EXPORT int IDASetSensDQMethod(void *ida_mem, int DQtype, - realtype DQrhomax); + sunrealtype DQrhomax); SUNDIALS_EXPORT int IDASetSensErrCon(void *ida_mem, booleantype errconS); SUNDIALS_EXPORT int IDASetSensMaxNonlinIters(void *ida_mem, int maxcorS); -SUNDIALS_EXPORT int IDASetSensParams(void *ida_mem, realtype *p, realtype *pbar, +SUNDIALS_EXPORT int IDASetSensParams(void *ida_mem, sunrealtype *p, sunrealtype *pbar, int *plist); /* Integrator nonlinear solver specification functions */ @@ -405,13 +405,13 @@ SUNDIALS_EXPORT int IDASetNonlinearSolverSensStg(void *ida_mem, SUNDIALS_EXPORT int IDASensToggleOff(void *ida_mem); /* Extraction and dense output functions */ -SUNDIALS_EXPORT int IDAGetSens(void *ida_mem, realtype *tret, N_Vector *yySout); -SUNDIALS_EXPORT int IDAGetSens1(void *ida_mem, realtype *tret, int is, +SUNDIALS_EXPORT int IDAGetSens(void *ida_mem, sunrealtype *tret, N_Vector *yySout); +SUNDIALS_EXPORT int IDAGetSens1(void *ida_mem, sunrealtype *tret, int is, N_Vector yySret); -SUNDIALS_EXPORT int IDAGetSensDky(void *ida_mem, realtype t, int k, +SUNDIALS_EXPORT int IDAGetSensDky(void *ida_mem, sunrealtype t, int k, N_Vector *dkyS); -SUNDIALS_EXPORT int IDAGetSensDky1(void *ida_mem, realtype t, int k, int is, +SUNDIALS_EXPORT int IDAGetSensDky1(void *ida_mem, sunrealtype t, int k, int is, N_Vector dkyS); /* Optional output specification functions */ @@ -449,9 +449,9 @@ SUNDIALS_EXPORT int IDAQuadSensInit(void *ida_mem, IDAQuadSensRhsFn resQS, SUNDIALS_EXPORT int IDAQuadSensReInit(void *ida_mem, N_Vector *yQS0); /* Tolerance input functions */ -SUNDIALS_EXPORT int IDAQuadSensSStolerances(void *ida_mem, realtype reltolQS, - realtype *abstolQS); -SUNDIALS_EXPORT int IDAQuadSensSVtolerances(void *ida_mem, realtype reltolQS, +SUNDIALS_EXPORT int IDAQuadSensSStolerances(void *ida_mem, sunrealtype reltolQS, + sunrealtype *abstolQS); +SUNDIALS_EXPORT int IDAQuadSensSVtolerances(void *ida_mem, sunrealtype reltolQS, N_Vector *abstolQS); SUNDIALS_EXPORT int IDAQuadSensEEtolerances(void *ida_mem); @@ -459,13 +459,13 @@ SUNDIALS_EXPORT int IDAQuadSensEEtolerances(void *ida_mem); SUNDIALS_EXPORT int IDASetQuadSensErrCon(void *ida_mem, booleantype errconQS); /* Extraction and dense output functions */ -SUNDIALS_EXPORT int IDAGetQuadSens(void *ida_mem, realtype *tret, +SUNDIALS_EXPORT int IDAGetQuadSens(void *ida_mem, sunrealtype *tret, N_Vector *yyQSout); -SUNDIALS_EXPORT int IDAGetQuadSens1(void *ida_mem, realtype *tret, int is, +SUNDIALS_EXPORT int IDAGetQuadSens1(void *ida_mem, sunrealtype *tret, int is, N_Vector yyQSret); -SUNDIALS_EXPORT int IDAGetQuadSensDky(void *ida_mem, realtype t, int k, +SUNDIALS_EXPORT int IDAGetQuadSensDky(void *ida_mem, sunrealtype t, int k, N_Vector *dkyQS); -SUNDIALS_EXPORT int IDAGetQuadSensDky1(void *ida_mem, realtype t, int k, int is, +SUNDIALS_EXPORT int IDAGetQuadSensDky1(void *ida_mem, sunrealtype t, int k, int is, N_Vector dkyQS); /* Optional output specification functions */ @@ -500,18 +500,18 @@ SUNDIALS_EXPORT void IDAAdjFree(void *ida_mem); SUNDIALS_EXPORT int IDACreateB(void *ida_mem, int *which); SUNDIALS_EXPORT int IDAInitB(void *ida_mem, int which, IDAResFnB resB, - realtype tB0, N_Vector yyB0, N_Vector ypB0); + sunrealtype tB0, N_Vector yyB0, N_Vector ypB0); SUNDIALS_EXPORT int IDAInitBS(void *ida_mem, int which, IDAResFnBS resS, - realtype tB0, N_Vector yyB0, N_Vector ypB0); + sunrealtype tB0, N_Vector yyB0, N_Vector ypB0); SUNDIALS_EXPORT int IDAReInitB(void *ida_mem, int which, - realtype tB0, N_Vector yyB0, N_Vector ypB0); + sunrealtype tB0, N_Vector yyB0, N_Vector ypB0); SUNDIALS_EXPORT int IDASStolerancesB(void *ida_mem, int which, - realtype relTolB, realtype absTolB); + sunrealtype relTolB, sunrealtype absTolB); SUNDIALS_EXPORT int IDASVtolerancesB(void *ida_mem, int which, - realtype relTolB, N_Vector absTolB); + sunrealtype relTolB, N_Vector absTolB); SUNDIALS_EXPORT int IDAQuadInitB(void *ida_mem, int which, IDAQuadRhsFnB rhsQB, N_Vector yQB0); @@ -522,29 +522,29 @@ SUNDIALS_EXPORT int IDAQuadInitBS(void *ida_mem, int which, SUNDIALS_EXPORT int IDAQuadReInitB(void *ida_mem, int which, N_Vector yQB0); SUNDIALS_EXPORT int IDAQuadSStolerancesB(void *ida_mem, int which, - realtype reltolQB, realtype abstolQB); + sunrealtype reltolQB, sunrealtype abstolQB); SUNDIALS_EXPORT int IDAQuadSVtolerancesB(void *ida_mem, int which, - realtype reltolQB, N_Vector abstolQB); + sunrealtype reltolQB, N_Vector abstolQB); /* Consistent IC calculation functions */ -SUNDIALS_EXPORT int IDACalcICB (void *ida_mem, int which, realtype tout1, +SUNDIALS_EXPORT int IDACalcICB (void *ida_mem, int which, sunrealtype tout1, N_Vector yy0, N_Vector yp0); -SUNDIALS_EXPORT int IDACalcICBS(void *ida_mem, int which, realtype tout1, +SUNDIALS_EXPORT int IDACalcICBS(void *ida_mem, int which, sunrealtype tout1, N_Vector yy0, N_Vector yp0, N_Vector *yyS0, N_Vector *ypS0); /* Solver Function For Forward Problems */ -SUNDIALS_EXPORT int IDASolveF(void *ida_mem, realtype tout, - realtype *tret, +SUNDIALS_EXPORT int IDASolveF(void *ida_mem, sunrealtype tout, + sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask, int *ncheckPtr); /* Solver Function For Backward Problems */ -SUNDIALS_EXPORT int IDASolveB(void *ida_mem, realtype tBout, int itaskB); +SUNDIALS_EXPORT int IDASolveB(void *ida_mem, sunrealtype tBout, int itaskB); /* Optional Input Functions For Adjoint Problems */ @@ -554,8 +554,8 @@ SUNDIALS_EXPORT int IDASetUserDataB(void *ida_mem, int which, void *user_dataB); SUNDIALS_EXPORT int IDASetMaxOrdB(void *ida_mem, int which, int maxordB); SUNDIALS_EXPORT int IDASetMaxNumStepsB(void *ida_mem, int which, long int mxstepsB); -SUNDIALS_EXPORT int IDASetInitStepB(void *ida_mem, int which, realtype hinB); -SUNDIALS_EXPORT int IDASetMaxStepB(void *ida_mem, int which, realtype hmaxB); +SUNDIALS_EXPORT int IDASetInitStepB(void *ida_mem, int which, sunrealtype hinB); +SUNDIALS_EXPORT int IDASetMaxStepB(void *ida_mem, int which, sunrealtype hmaxB); SUNDIALS_EXPORT int IDASetSuppressAlgB(void *ida_mem, int which, booleantype suppressalgB); SUNDIALS_EXPORT int IDASetIdB(void *ida_mem, int which, N_Vector idB); @@ -568,10 +568,10 @@ SUNDIALS_EXPORT int IDASetNonlinearSolverB(void *ida_mem, int which, /* Extraction And Dense Output Functions For Backward Problems */ -SUNDIALS_EXPORT int IDAGetB(void* ida_mem, int which, realtype *tret, +SUNDIALS_EXPORT int IDAGetB(void* ida_mem, int which, sunrealtype *tret, N_Vector yy, N_Vector yp); SUNDIALS_EXPORT int IDAGetQuadB(void *ida_mem, int which, - realtype *tret, N_Vector qB); + sunrealtype *tret, N_Vector qB); /* Optional Output Functions For Backward Problems */ @@ -580,17 +580,17 @@ SUNDIALS_EXPORT void *IDAGetAdjIDABmem(void *ida_mem, int which); SUNDIALS_EXPORT int IDAGetConsistentICB(void *ida_mem, int which, N_Vector yyB0, N_Vector ypB0); -SUNDIALS_EXPORT int IDAGetAdjY(void *ida_mem, realtype t, +SUNDIALS_EXPORT int IDAGetAdjY(void *ida_mem, sunrealtype t, N_Vector yy, N_Vector yp); typedef struct { void *my_addr; void *next_addr; - realtype t0; - realtype t1; + sunrealtype t0; + sunrealtype t1; long int nstep; int order; - realtype step; + sunrealtype step; } IDAadjCheckPointRec; SUNDIALS_EXPORT int IDAGetAdjCheckPointsInfo(void *ida_mem, @@ -622,11 +622,11 @@ SUNDIALS_EXPORT int IDASetJacTimesResFnB(void *ida_mem, int which, * ----------------------------------------------------------------- */ SUNDIALS_EXPORT int IDAGetAdjDataPointHermite(void *ida_mem, int which, - realtype *t, N_Vector yy, + sunrealtype *t, N_Vector yy, N_Vector yd); SUNDIALS_EXPORT int IDAGetAdjDataPointPolynomial(void *ida_mem, int which, - realtype *t, int *order, + sunrealtype *t, int *order, N_Vector y); /* ----------------------------------------------------------------- diff --git a/include/idas/idas_bbdpre.h b/include/idas/idas_bbdpre.h index 670ae5790e..e4ee717188 100644 --- a/include/idas/idas_bbdpre.h +++ b/include/idas/idas_bbdpre.h @@ -32,11 +32,11 @@ extern "C" { /* User-supplied function Types */ -typedef int (*IDABBDLocalFn)(sunindextype Nlocal, realtype tt, +typedef int (*IDABBDLocalFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector gval, void *user_data); -typedef int (*IDABBDCommFn)(sunindextype Nlocal, realtype tt, +typedef int (*IDABBDCommFn)(sunindextype Nlocal, sunrealtype tt, N_Vector yy, N_Vector yp, void *user_data); /* Exported Functions */ @@ -44,12 +44,12 @@ typedef int (*IDABBDCommFn)(sunindextype Nlocal, realtype tt, SUNDIALS_EXPORT int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dq_rel_yy, + sunrealtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm); SUNDIALS_EXPORT int IDABBDPrecReInit(void *ida_mem, sunindextype mudq, sunindextype mldq, - realtype dq_rel_yy); + sunrealtype dq_rel_yy); /* Optional output functions */ @@ -67,12 +67,12 @@ SUNDIALS_EXPORT int IDABBDPrecGetNumGfnEvals(void *ida_mem, /* User-Supplied Function Types */ -typedef int (*IDABBDLocalFnB)(sunindextype NlocalB, realtype tt, +typedef int (*IDABBDLocalFnB)(sunindextype NlocalB, sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector gvalB, void *user_dataB); -typedef int (*IDABBDCommFnB)(sunindextype NlocalB, realtype tt, +typedef int (*IDABBDCommFnB)(sunindextype NlocalB, sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, void *user_dataB); @@ -81,12 +81,12 @@ typedef int (*IDABBDCommFnB)(sunindextype NlocalB, realtype tt, SUNDIALS_EXPORT int IDABBDPrecInitB(void *ida_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, - realtype dq_rel_yyB, + sunrealtype dq_rel_yyB, IDABBDLocalFnB GresB, IDABBDCommFnB GcommB); SUNDIALS_EXPORT int IDABBDPrecReInitB(void *ida_mem, int which, sunindextype mudqB, sunindextype mldqB, - realtype dq_rel_yyB); + sunrealtype dq_rel_yyB); #ifdef __cplusplus diff --git a/include/idas/idas_ls.h b/include/idas/idas_ls.h index 1b6010be02..e1baf9d2a1 100644 --- a/include/idas/idas_ls.h +++ b/include/idas/idas_ls.h @@ -57,29 +57,29 @@ extern "C" { IDALS user-supplied function prototypes =================================================================*/ -typedef int (*IDALsJacFn)(realtype t, realtype c_j, N_Vector y, +typedef int (*IDALsJacFn)(sunrealtype t, sunrealtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -typedef int (*IDALsPrecSetupFn)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); + sunrealtype c_j, void *user_data); -typedef int (*IDALsPrecSolveFn)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSolveFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, + sunrealtype c_j, sunrealtype delta, void *user_data); -typedef int (*IDALsJacTimesSetupFn)(realtype tt, N_Vector yy, +typedef int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - realtype c_j, void *user_data); + sunrealtype c_j, void *user_data); -typedef int (*IDALsJacTimesVecFn)(realtype tt, N_Vector yy, +typedef int (*IDALsJacTimesVecFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, - realtype c_j, void *user_data, + sunrealtype c_j, void *user_data, N_Vector tmp1, N_Vector tmp2); @@ -103,13 +103,13 @@ SUNDIALS_EXPORT int IDASetPreconditioner(void *ida_mem, SUNDIALS_EXPORT int IDASetJacTimes(void *ida_mem, IDALsJacTimesSetupFn jtsetup, IDALsJacTimesVecFn jtimes); -SUNDIALS_EXPORT int IDASetEpsLin(void *ida_mem, realtype eplifac); +SUNDIALS_EXPORT int IDASetEpsLin(void *ida_mem, sunrealtype eplifac); SUNDIALS_EXPORT int IDASetLSNormFactor(void *ida_mem, - realtype nrmfac); + sunrealtype nrmfac); SUNDIALS_EXPORT int IDASetLinearSolutionScaling(void *ida_mem, booleantype onoff); SUNDIALS_EXPORT int IDASetIncrementFactor(void *ida_mem, - realtype dqincfac); + sunrealtype dqincfac); /*----------------------------------------------------------------- Optional outputs from the IDALS linear solver interface @@ -151,69 +151,69 @@ SUNDIALS_EXPORT char *IDAGetLinReturnFlagName(long int flag); IDALS user-supplied function prototypes =================================================================*/ -typedef int (*IDALsJacFnB)(realtype tt, realtype c_jB, N_Vector yy, +typedef int (*IDALsJacFnB)(sunrealtype tt, sunrealtype c_jB, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -typedef int (*IDALsJacFnBS)(realtype tt, realtype c_jB, N_Vector yy, +typedef int (*IDALsJacFnBS)(sunrealtype tt, sunrealtype c_jB, N_Vector yy, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -typedef int (*IDALsPrecSetupFnB)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSetupFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *user_dataB); + sunrealtype c_jB, void *user_dataB); -typedef int (*IDALsPrecSetupFnBS)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSetupFnBS)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *user_dataB); + sunrealtype c_jB, void *user_dataB); -typedef int (*IDALsPrecSolveFnB)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSolveFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector rvecB, N_Vector zvecB, - realtype c_jB, realtype deltaB, + sunrealtype c_jB, sunrealtype deltaB, void *user_dataB); -typedef int (*IDALsPrecSolveFnBS)(realtype tt, N_Vector yy, +typedef int (*IDALsPrecSolveFnBS)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector rvecB, N_Vector zvecB, - realtype c_jB, realtype deltaB, + sunrealtype c_jB, sunrealtype deltaB, void *user_dataB); -typedef int (*IDALsJacTimesSetupFnB)(realtype t, N_Vector yy, +typedef int (*IDALsJacTimesSetupFnB)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *user_dataB); + sunrealtype c_jB, void *user_dataB); -typedef int (*IDALsJacTimesSetupFnBS)(realtype t, N_Vector yy, +typedef int (*IDALsJacTimesSetupFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *user_dataB); + sunrealtype c_jB, void *user_dataB); -typedef int (*IDALsJacTimesVecFnB)(realtype t, N_Vector yy, +typedef int (*IDALsJacTimesVecFnB)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector vB, N_Vector JvB, - realtype c_jB, void *user_dataB, + sunrealtype c_jB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B); -typedef int (*IDALsJacTimesVecFnBS)(realtype t, N_Vector yy, +typedef int (*IDALsJacTimesVecFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector vB, N_Vector JvB, - realtype c_jB, void *user_dataB, + sunrealtype c_jB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B); @@ -239,13 +239,13 @@ SUNDIALS_EXPORT int IDASetJacFnBS(void *ida_mem, int which, IDALsJacFnBS jacBS); SUNDIALS_EXPORT int IDASetEpsLinB(void *ida_mem, int which, - realtype eplifacB); + sunrealtype eplifacB); SUNDIALS_EXPORT int IDASetLSNormFactorB(void *ida_mem, int which, - realtype nrmfacB); + sunrealtype nrmfacB); SUNDIALS_EXPORT int IDASetLinearSolutionScalingB(void *ida_mem, int which, booleantype onoffB); SUNDIALS_EXPORT int IDASetIncrementFactorB(void *ida_mem, int which, - realtype dqincfacB); + sunrealtype dqincfacB); SUNDIALS_EXPORT int IDASetPreconditionerB(void *ida_mem, int which, IDALsPrecSetupFnB psetB, IDALsPrecSolveFnB psolveB); diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index 196b708def..d8a06709a1 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -106,11 +106,11 @@ SUNDIALS_EXPORT int KINSol(void *kinmem, N_Vector uu, int strategy, /* Optional input functions */ SUNDIALS_EXPORT int KINSetUserData(void *kinmem, void *user_data); -SUNDIALS_EXPORT int KINSetDamping(void *kinmem, realtype beta); +SUNDIALS_EXPORT int KINSetDamping(void *kinmem, sunrealtype beta); SUNDIALS_EXPORT int KINSetMAA(void *kinmem, long int maa); SUNDIALS_EXPORT int KINSetOrthAA(void *kinmem, int orthaa); SUNDIALS_EXPORT int KINSetDelayAA(void *kinmem, long int delay); -SUNDIALS_EXPORT int KINSetDampingAA(void *kinmem, realtype beta); +SUNDIALS_EXPORT int KINSetDampingAA(void *kinmem, sunrealtype beta); SUNDIALS_EXPORT int KINSetReturnNewest(void *kinmem, booleantype ret_newest); SUNDIALS_EXPORT int KINSetNumMaxIters(void *kinmem, long int mxiter); SUNDIALS_EXPORT int KINSetNoInitSetup(void *kinmem, booleantype noInitSetup); @@ -118,18 +118,18 @@ SUNDIALS_EXPORT int KINSetNoResMon(void *kinmem, booleantype noNNIResMon); SUNDIALS_EXPORT int KINSetMaxSetupCalls(void *kinmem, long int msbset); SUNDIALS_EXPORT int KINSetMaxSubSetupCalls(void *kinmem, long int msbsetsub); SUNDIALS_EXPORT int KINSetEtaForm(void *kinmem, int etachoice); -SUNDIALS_EXPORT int KINSetEtaConstValue(void *kinmem, realtype eta); -SUNDIALS_EXPORT int KINSetEtaParams(void *kinmem, realtype egamma, - realtype ealpha); -SUNDIALS_EXPORT int KINSetResMonParams(void *kinmem, realtype omegamin, - realtype omegamax); -SUNDIALS_EXPORT int KINSetResMonConstValue(void *kinmem, realtype omegaconst); +SUNDIALS_EXPORT int KINSetEtaConstValue(void *kinmem, sunrealtype eta); +SUNDIALS_EXPORT int KINSetEtaParams(void *kinmem, sunrealtype egamma, + sunrealtype ealpha); +SUNDIALS_EXPORT int KINSetResMonParams(void *kinmem, sunrealtype omegamin, + sunrealtype omegamax); +SUNDIALS_EXPORT int KINSetResMonConstValue(void *kinmem, sunrealtype omegaconst); SUNDIALS_EXPORT int KINSetNoMinEps(void *kinmem, booleantype noMinEps); -SUNDIALS_EXPORT int KINSetMaxNewtonStep(void *kinmem, realtype mxnewtstep); +SUNDIALS_EXPORT int KINSetMaxNewtonStep(void *kinmem, sunrealtype mxnewtstep); SUNDIALS_EXPORT int KINSetMaxBetaFails(void *kinmem, long int mxnbcf); -SUNDIALS_EXPORT int KINSetRelErrFunc(void *kinmem, realtype relfunc); -SUNDIALS_EXPORT int KINSetFuncNormTol(void *kinmem, realtype fnormtol); -SUNDIALS_EXPORT int KINSetScaledStepTol(void *kinmem, realtype scsteptol); +SUNDIALS_EXPORT int KINSetRelErrFunc(void *kinmem, sunrealtype relfunc); +SUNDIALS_EXPORT int KINSetFuncNormTol(void *kinmem, sunrealtype fnormtol); +SUNDIALS_EXPORT int KINSetScaledStepTol(void *kinmem, sunrealtype scsteptol); SUNDIALS_EXPORT int KINSetConstraints(void *kinmem, N_Vector constraints); SUNDIALS_EXPORT int KINSetSysFunc(void *kinmem, KINSysFn func); @@ -149,8 +149,8 @@ SUNDIALS_EXPORT int KINGetNumNonlinSolvIters(void *kinmem, long int *nniters); SUNDIALS_EXPORT int KINGetNumFuncEvals(void *kinmem, long int *nfevals); SUNDIALS_EXPORT int KINGetNumBetaCondFails(void *kinmem, long int *nbcfails); SUNDIALS_EXPORT int KINGetNumBacktrackOps(void *kinmem, long int *nbacktr); -SUNDIALS_EXPORT int KINGetFuncNorm(void *kinmem, realtype *fnorm); -SUNDIALS_EXPORT int KINGetStepLength(void *kinmem, realtype *steplength); +SUNDIALS_EXPORT int KINGetFuncNorm(void *kinmem, sunrealtype *fnorm); +SUNDIALS_EXPORT int KINGetStepLength(void *kinmem, sunrealtype *steplength); SUNDIALS_EXPORT int KINGetUserData(void *kinmem, void **user_data); SUNDIALS_EXPORT int KINPrintAllStats(void *kinmem, FILE *outfile, SUNOutputFormat fmt); diff --git a/include/kinsol/kinsol_bbdpre.h b/include/kinsol/kinsol_bbdpre.h index 50b7f00d13..8e0823ccd9 100644 --- a/include/kinsol/kinsol_bbdpre.h +++ b/include/kinsol/kinsol_bbdpre.h @@ -46,7 +46,7 @@ typedef int (*KINBBDLocalFn)(sunindextype Nlocal, N_Vector uu, SUNDIALS_EXPORT int KINBBDPrecInit(void *kinmem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dq_rel_uu, + sunrealtype dq_rel_uu, KINBBDLocalFn gloc, KINBBDCommFn gcomm); /* Optional output functions */ diff --git a/include/nvector/nvector_cuda.h b/include/nvector/nvector_cuda.h index a8449ef322..a9bb88751c 100644 --- a/include/nvector/nvector_cuda.h +++ b/include/nvector/nvector_cuda.h @@ -64,14 +64,14 @@ SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Cuda(sunindextype length, SUNMemoryHelper helper, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_Cuda(sunindextype length, - realtype *h_vdata, - realtype *d_vdata, + sunrealtype *h_vdata, + sunrealtype *d_vdata, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMakeManaged_Cuda(sunindextype length, - realtype *vdata, + sunrealtype *vdata, SUNContext sunctx); -SUNDIALS_EXPORT void N_VSetHostArrayPointer_Cuda(realtype* h_vdata, N_Vector v); -SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Cuda(realtype* d_vdata, N_Vector v); +SUNDIALS_EXPORT void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v); +SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v); SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Cuda(N_Vector x); SUNDIALS_EXPORT int N_VSetKernelExecPolicy_Cuda(N_Vector x, SUNCudaExecPolicy* stream_exec_policy, @@ -87,17 +87,17 @@ sunindextype N_VGetLength_Cuda(N_Vector x) } SUNDIALS_STATIC_INLINE -realtype *N_VGetHostArrayPointer_Cuda(N_Vector x) +sunrealtype *N_VGetHostArrayPointer_Cuda(N_Vector x) { N_VectorContent_Cuda content = (N_VectorContent_Cuda)x->content; - return(content->host_data == NULL ? NULL : (realtype*)content->host_data->ptr); + return(content->host_data == NULL ? NULL : (sunrealtype*)content->host_data->ptr); } SUNDIALS_STATIC_INLINE -realtype *N_VGetDeviceArrayPointer_Cuda(N_Vector x) +sunrealtype *N_VGetDeviceArrayPointer_Cuda(N_Vector x) { N_VectorContent_Cuda content = (N_VectorContent_Cuda)x->content; - return(content->device_data == NULL ? NULL : (realtype*)content->device_data->ptr); + return(content->device_data == NULL ? NULL : (sunrealtype*)content->device_data->ptr); } /* @@ -118,58 +118,58 @@ SUNDIALS_EXPORT void N_VDestroy_Cuda(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Cuda(N_Vector v, sunindextype *lrw, sunindextype *liw); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Cuda(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Cuda(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Cuda(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Cuda(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Cuda(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Cuda(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Cuda(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Cuda(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Cuda(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Cuda(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Cuda(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Cuda(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Cuda(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Cuda(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Cuda(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Cuda(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Cuda(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Cuda(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Cuda(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_Cuda(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Cuda(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Cuda(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Cuda(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Cuda(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_Cuda(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Cuda(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Cuda(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Cuda(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Cuda(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Cuda(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Cuda(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VLinearCombination_Cuda(int nvec, sunrealtype* c, N_Vector* X, N_Vector Z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Cuda(int nvec, realtype* c, N_Vector X, +SUNDIALS_EXPORT int N_VScaleAddMulti_Cuda(int nvec, sunrealtype* c, N_Vector X, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_Cuda(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods); + sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Cuda(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Cuda(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VScaleVectorArray_Cuda(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Cuda(int nvec, realtype c, N_Vector* Z); +SUNDIALS_EXPORT int N_VConstVectorArray_Cuda(int nvec, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Cuda(int nvec, int nsum, - realtype* a, N_Vector* X, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Cuda(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_Cuda(int nvec, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_Cuda(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Cuda(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Cuda(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Cuda(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Cuda(N_Vector x, N_Vector w, N_Vector id); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_Cuda(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_hip.h b/include/nvector/nvector_hip.h index dd5f3c01df..1c2ade734a 100644 --- a/include/nvector/nvector_hip.h +++ b/include/nvector/nvector_hip.h @@ -64,14 +64,14 @@ SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Hip(sunindextype length, SUNMemoryHelper helper, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_Hip(sunindextype length, - realtype *h_vdata, - realtype *d_vdata, + sunrealtype *h_vdata, + sunrealtype *d_vdata, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMakeManaged_Hip(sunindextype length, - realtype *vdata, + sunrealtype *vdata, SUNContext sunctx); -SUNDIALS_EXPORT void N_VSetHostArrayPointer_Hip(realtype* h_vdata, N_Vector v); -SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Hip(realtype* d_vdata, N_Vector v); +SUNDIALS_EXPORT void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v); +SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v); SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Hip(N_Vector x); SUNDIALS_EXPORT int N_VSetKernelExecPolicy_Hip(N_Vector x, SUNHipExecPolicy* stream_exec_policy, @@ -87,17 +87,17 @@ sunindextype N_VGetLength_Hip(N_Vector x) } SUNDIALS_STATIC_INLINE -realtype *N_VGetHostArrayPointer_Hip(N_Vector x) +sunrealtype *N_VGetHostArrayPointer_Hip(N_Vector x) { N_VectorContent_Hip content = (N_VectorContent_Hip)x->content; - return(content->host_data == NULL ? NULL : (realtype*)content->host_data->ptr); + return(content->host_data == NULL ? NULL : (sunrealtype*)content->host_data->ptr); } SUNDIALS_STATIC_INLINE -realtype *N_VGetDeviceArrayPointer_Hip(N_Vector x) +sunrealtype *N_VGetDeviceArrayPointer_Hip(N_Vector x) { N_VectorContent_Hip content = (N_VectorContent_Hip)x->content; - return(content->device_data == NULL ? NULL : (realtype*)content->device_data->ptr); + return(content->device_data == NULL ? NULL : (sunrealtype*)content->device_data->ptr); } /* @@ -118,58 +118,58 @@ SUNDIALS_EXPORT void N_VDestroy_Hip(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Hip(N_Vector v, sunindextype *lrw, sunindextype *liw); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Hip(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Hip(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Hip(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Hip(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Hip(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Hip(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Hip(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Hip(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Hip(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Hip(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Hip(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Hip(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Hip(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Hip(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Hip(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Hip(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Hip(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Hip(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Hip(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_Hip(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Hip(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Hip(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Hip(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Hip(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_Hip(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Hip(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Hip(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Hip(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Hip(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Hip(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Hip(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VLinearCombination_Hip(int nvec, sunrealtype* c, N_Vector* X, N_Vector Z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Hip(int nvec, realtype* c, N_Vector X, +SUNDIALS_EXPORT int N_VScaleAddMulti_Hip(int nvec, sunrealtype* c, N_Vector X, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_Hip(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods); + sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Hip(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Hip(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VScaleVectorArray_Hip(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Hip(int nvec, realtype c, N_Vector* Z); +SUNDIALS_EXPORT int N_VConstVectorArray_Hip(int nvec, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Hip(int nvec, int nsum, - realtype* a, N_Vector* X, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Hip(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_Hip(int nvec, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_Hip(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Hip(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Hip(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Hip(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Hip(N_Vector x, N_Vector w, N_Vector id); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_Hip(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_manyvector.h b/include/nvector/nvector_manyvector.h index 5f8b551f04..d207b2ec49 100644 --- a/include/nvector/nvector_manyvector.h +++ b/include/nvector/nvector_manyvector.h @@ -19,7 +19,7 @@ * - The definition of the generic N_Vector structure can be found * in the header file sundials_nvector.h. * - * - The definitions of the types 'realtype' and 'sunindextype' can + * - The definitions of the types 'sunrealtype' and 'sunindextype' can * be found in the header file sundials_types.h, and it may be * changed (at the configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -68,10 +68,10 @@ SUNDIALS_EXPORT N_Vector N_VNew_ManyVector(sunindextype num_subvectors, SUNDIALS_EXPORT N_Vector N_VGetSubvector_ManyVector(N_Vector v, sunindextype vec_num); -SUNDIALS_EXPORT realtype *N_VGetSubvectorArrayPointer_ManyVector(N_Vector v, +SUNDIALS_EXPORT sunrealtype *N_VGetSubvectorArrayPointer_ManyVector(N_Vector v, sunindextype vec_num); -SUNDIALS_EXPORT int N_VSetSubvectorArrayPointer_ManyVector(realtype *v_data, N_Vector v, +SUNDIALS_EXPORT int N_VSetSubvectorArrayPointer_ManyVector(sunrealtype *v_data, N_Vector v, sunindextype vec_num); SUNDIALS_EXPORT sunindextype N_VGetNumSubvectors_ManyVector(N_Vector v); @@ -87,68 +87,68 @@ SUNDIALS_EXPORT void N_VSpace_ManyVector(N_Vector v, sunindextype *lrw, sunindextype *liw); SUNDIALS_EXPORT sunindextype N_VGetLength_ManyVector(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetSubvectorLocalLength_ManyVector(N_Vector v, sunindextype vec_num); -SUNDIALS_EXPORT void N_VLinearSum_ManyVector(realtype a, N_Vector x, - realtype b, N_Vector y, +SUNDIALS_EXPORT void N_VLinearSum_ManyVector(sunrealtype a, N_Vector x, + sunrealtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_ManyVector(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VConst_ManyVector(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_ManyVector(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_ManyVector(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_ManyVector(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_ManyVector(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_ManyVector(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_ManyVector(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_ManyVector(N_Vector x, realtype b, +SUNDIALS_EXPORT void N_VAddConst_ManyVector(N_Vector x, sunrealtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VWrmsNorm_ManyVector(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_ManyVector(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_ManyVector(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_ManyVector(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VWL2Norm_ManyVector(N_Vector x, N_Vector w); -SUNDIALS_EXPORT void N_VCompare_ManyVector(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_ManyVector(N_Vector x, N_Vector w); +SUNDIALS_EXPORT void N_VCompare_ManyVector(sunrealtype c, N_Vector x, N_Vector z); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_ManyVector(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VLinearCombination_ManyVector(int nvec, sunrealtype* c, N_Vector* V, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_ManyVector(int nvec, realtype* a, +SUNDIALS_EXPORT int N_VScaleAddMulti_ManyVector(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_ManyVector(int nvec, N_Vector x, N_Vector *Y, - realtype* dotprods); + sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_ManyVector(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_ManyVector(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_ManyVector(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_ManyVector(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_ManyVector(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_ManyVector(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_ManyVector(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VDotProdLocal_ManyVector(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNormLocal_ManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VMinLocal_ManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VL1NormLocal_ManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_ManyVector(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_ManyVector(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProdLocal_ManyVector(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNormLocal_ManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VMinLocal_ManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_ManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_ManyVector(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_ManyVector(N_Vector x, N_Vector w, N_Vector id); SUNDIALS_EXPORT booleantype N_VInvTestLocal_ManyVector(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_ManyVector(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotientLocal_ManyVector(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_ManyVector(N_Vector num, N_Vector denom); /* OPTIONAL single buffer reduction operations */ SUNDIALS_EXPORT int N_VDotProdMultiLocal_ManyVector(int nvec, N_Vector x, N_Vector *Y, - realtype* dotprods); + sunrealtype* dotprods); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_ManyVector(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_mpimanyvector.h b/include/nvector/nvector_mpimanyvector.h index 313aa7dee5..21380156ee 100644 --- a/include/nvector/nvector_mpimanyvector.h +++ b/include/nvector/nvector_mpimanyvector.h @@ -19,7 +19,7 @@ * - The definition of the generic N_Vector structure can be found * in the header file sundials_nvector.h. * - * - The definitions of the types 'realtype' and 'sunindextype' can + * - The definitions of the types 'sunrealtype' and 'sunindextype' can * be found in the header file sundials_types.h, and it may be * changed (at the configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -76,10 +76,10 @@ SUNDIALS_EXPORT N_Vector N_VNew_MPIManyVector(sunindextype num_subvectors, SUNDIALS_EXPORT N_Vector N_VGetSubvector_MPIManyVector(N_Vector v, sunindextype vec_num); -SUNDIALS_EXPORT realtype *N_VGetSubvectorArrayPointer_MPIManyVector(N_Vector v, +SUNDIALS_EXPORT sunrealtype *N_VGetSubvectorArrayPointer_MPIManyVector(N_Vector v, sunindextype vec_num); -SUNDIALS_EXPORT int N_VSetSubvectorArrayPointer_MPIManyVector(realtype *v_data, N_Vector v, +SUNDIALS_EXPORT int N_VSetSubvectorArrayPointer_MPIManyVector(sunrealtype *v_data, N_Vector v, sunindextype vec_num); SUNDIALS_EXPORT sunindextype N_VGetNumSubvectors_MPIManyVector(N_Vector v); @@ -96,79 +96,79 @@ SUNDIALS_EXPORT void N_VSpace_MPIManyVector(N_Vector v, sunindextype *lrw, SUNDIALS_EXPORT void *N_VGetCommunicator_MPIManyVector(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength_MPIManyVector(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetSubvectorLocalLength_MPIManyVector(N_Vector v, sunindextype vec_num); -SUNDIALS_EXPORT void N_VLinearSum_MPIManyVector(realtype a, N_Vector x, - realtype b, N_Vector y, +SUNDIALS_EXPORT void N_VLinearSum_MPIManyVector(sunrealtype a, N_Vector x, + sunrealtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_MPIManyVector(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VConst_MPIManyVector(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_MPIManyVector(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_MPIManyVector(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_MPIManyVector(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_MPIManyVector(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_MPIManyVector(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_MPIManyVector(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_MPIManyVector(N_Vector x, realtype b, +SUNDIALS_EXPORT void N_VAddConst_MPIManyVector(N_Vector x, sunrealtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_MPIManyVector(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_MPIManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_MPIManyVector(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_MPIManyVector(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProd_MPIManyVector(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_MPIManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_MPIManyVector(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_MPIManyVector(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_MPIManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_MPIManyVector(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_MPIManyVector(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_MPIManyVector(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VMin_MPIManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_MPIManyVector(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_MPIManyVector(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_MPIManyVector(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_MPIManyVector(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_MPIManyVector(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_MPIManyVector(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_MPIManyVector(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_MPIManyVector(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VLinearCombination_MPIManyVector(int nvec, sunrealtype* c, N_Vector* V, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_MPIManyVector(int nvec, realtype* a, +SUNDIALS_EXPORT int N_VScaleAddMulti_MPIManyVector(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_MPIManyVector(int nvec, N_Vector x, N_Vector *Y, - realtype* dotprods); + sunrealtype* dotprods); /* single buffer reduction operations */ SUNDIALS_EXPORT int N_VDotProdMultiLocal_MPIManyVector(int nvec, N_Vector x, N_Vector *Y, - realtype* dotprods); + sunrealtype* dotprods); SUNDIALS_EXPORT int N_VDotProdMultiAllReduce_MPIManyVector(int nvec_total, N_Vector x, - realtype* sum); + sunrealtype* sum); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_MPIManyVector(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_MPIManyVector(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_MPIManyVector(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_MPIManyVector(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_MPIManyVector(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_MPIManyVector(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_MPIManyVector(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VDotProdLocal_MPIManyVector(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNormLocal_MPIManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VMinLocal_MPIManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VL1NormLocal_MPIManyVector(N_Vector x); -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_MPIManyVector(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_MPIManyVector(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProdLocal_MPIManyVector(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNormLocal_MPIManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VMinLocal_MPIManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_MPIManyVector(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_MPIManyVector(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_MPIManyVector(N_Vector x, N_Vector w, N_Vector id); SUNDIALS_EXPORT booleantype N_VInvTestLocal_MPIManyVector(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_MPIManyVector(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotientLocal_MPIManyVector(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_MPIManyVector(N_Vector num, N_Vector denom); /* OPTIONAL XBraid interface operations */ diff --git a/include/nvector/nvector_mpiplusx.h b/include/nvector/nvector_mpiplusx.h index f6e6e9e61e..c7692a6c70 100644 --- a/include/nvector/nvector_mpiplusx.h +++ b/include/nvector/nvector_mpiplusx.h @@ -34,9 +34,9 @@ SUNDIALS_EXPORT N_Vector N_VMake_MPIPlusX(MPI_Comm comm, N_Vector X, SUNContext SUNDIALS_EXPORT N_Vector_ID N_VGetVectorID_MPIPlusX(N_Vector v); -SUNDIALS_EXPORT realtype* N_VGetArrayPointer_MPIPlusX(N_Vector v); +SUNDIALS_EXPORT sunrealtype* N_VGetArrayPointer_MPIPlusX(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer_MPIPlusX(realtype *vdata, N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_MPIPlusX(sunrealtype *vdata, N_Vector v); SUNDIALS_EXPORT void N_VPrint_MPIPlusX(N_Vector x); diff --git a/include/nvector/nvector_openmp.h b/include/nvector/nvector_openmp.h index 713f1fbd64..6360b891b3 100644 --- a/include/nvector/nvector_openmp.h +++ b/include/nvector/nvector_openmp.h @@ -24,7 +24,7 @@ * - The definition of the generic N_Vector structure can be found * in the header file sundials_nvector.h. * - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -58,7 +58,7 @@ extern "C" { struct _N_VectorContent_OpenMP { sunindextype length; /* vector length */ booleantype own_data; /* data ownership flag */ - realtype *data; /* data array */ + sunrealtype *data; /* data array */ int num_threads; /* number of OpenMP threads */ }; @@ -93,7 +93,7 @@ SUNDIALS_EXPORT N_Vector N_VNew_OpenMP(sunindextype vec_length, int num_threads, SUNDIALS_EXPORT N_Vector N_VNewEmpty_OpenMP(sunindextype vec_length, int num_threads, SUNContext sunctx); -SUNDIALS_EXPORT N_Vector N_VMake_OpenMP(sunindextype vec_length, realtype *v_data, +SUNDIALS_EXPORT N_Vector N_VMake_OpenMP(sunindextype vec_length, sunrealtype *v_data, int num_threads, SUNContext sunctx); SUNDIALS_EXPORT sunindextype N_VGetLength_OpenMP(N_Vector v); @@ -108,65 +108,65 @@ SUNDIALS_EXPORT N_Vector N_VCloneEmpty_OpenMP(N_Vector w); SUNDIALS_EXPORT N_Vector N_VClone_OpenMP(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_OpenMP(N_Vector v); SUNDIALS_EXPORT void N_VSpace_OpenMP(N_Vector v, sunindextype *lrw, sunindextype *liw); -SUNDIALS_EXPORT realtype *N_VGetArrayPointer_OpenMP(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer_OpenMP(realtype *v_data, N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetArrayPointer_OpenMP(N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_OpenMP(sunrealtype *v_data, N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_OpenMP(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_OpenMP(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_OpenMP(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_OpenMP(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_OpenMP(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_OpenMP(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_OpenMP(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_OpenMP(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_OpenMP(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_OpenMP(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_OpenMP(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_OpenMP(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_OpenMP(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_OpenMP(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_OpenMP(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_OpenMP(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_OpenMP(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_OpenMP(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_OpenMP(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_OpenMP(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_OpenMP(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_OpenMP(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_OpenMP(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_OpenMP(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_OpenMP(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_OpenMP(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_OpenMP(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_OpenMP(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_OpenMP(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_OpenMP(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_OpenMP(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_OpenMP(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VLinearCombination_OpenMP(int nvec, sunrealtype* c, N_Vector* V, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_OpenMP(int nvec, realtype* a, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_OpenMP(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_OpenMP(int nvec, N_Vector x, - N_Vector* Y, realtype* dotprods); + N_Vector* Y, sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_OpenMP(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_OpenMP(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_OpenMP(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_OpenMP(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_OpenMP(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_OpenMP(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_OpenMP(int nvecs, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_OpenMP(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_OpenMP(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_OpenMP(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_OpenMP(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_OpenMP(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_OpenMP(N_Vector x, N_Vector w, N_Vector id); /* OPTIONAL XBraid interface operations */ diff --git a/include/nvector/nvector_openmpdev.h b/include/nvector/nvector_openmpdev.h index fcc2ced766..f55a834111 100644 --- a/include/nvector/nvector_openmpdev.h +++ b/include/nvector/nvector_openmpdev.h @@ -24,7 +24,7 @@ * - The definition of the generic N_Vector structure can be found * in the header file sundials_nvector.h. * - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -58,8 +58,8 @@ extern "C" { struct _N_VectorContent_OpenMPDEV { sunindextype length; /* vector length */ booleantype own_data; /* data ownership flag */ - realtype *host_data; /* host data array */ - realtype *dev_data; /* device data array */ + sunrealtype *host_data; /* host data array */ + sunrealtype *dev_data; /* device data array */ }; typedef struct _N_VectorContent_OpenMPDEV *N_VectorContent_OpenMPDEV; @@ -92,15 +92,15 @@ SUNDIALS_EXPORT N_Vector N_VNew_OpenMPDEV(sunindextype vec_length, SUNContext su SUNDIALS_EXPORT N_Vector N_VNewEmpty_OpenMPDEV(sunindextype vec_length, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_OpenMPDEV(sunindextype vec_length, - realtype *h_data, - realtype *v_data, + sunrealtype *h_data, + sunrealtype *v_data, SUNContext sunctx); SUNDIALS_EXPORT sunindextype N_VGetLength_OpenMPDEV(N_Vector v); -SUNDIALS_EXPORT realtype *N_VGetHostArrayPointer_OpenMPDEV(N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetHostArrayPointer_OpenMPDEV(N_Vector v); -SUNDIALS_EXPORT realtype *N_VGetDeviceArrayPointer_OpenMPDEV(N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetDeviceArrayPointer_OpenMPDEV(N_Vector v); SUNDIALS_EXPORT void N_VPrint_OpenMPDEV(N_Vector v); @@ -117,61 +117,61 @@ SUNDIALS_EXPORT void N_VDestroy_OpenMPDEV(N_Vector v); SUNDIALS_EXPORT void N_VSpace_OpenMPDEV(N_Vector v, sunindextype *lrw, sunindextype *liw); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_OpenMPDEV(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_OpenMPDEV(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_OpenMPDEV(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_OpenMPDEV(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_OpenMPDEV(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_OpenMPDEV(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_OpenMPDEV(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_OpenMPDEV(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_OpenMPDEV(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_OpenMPDEV(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_OpenMPDEV(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_OpenMPDEV(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_OpenMPDEV(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_OpenMPDEV(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_OpenMPDEV(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_OpenMPDEV(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_OpenMPDEV(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_OpenMPDEV(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_OpenMPDEV(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_OpenMPDEV(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_OpenMPDEV(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_OpenMPDEV(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_OpenMPDEV(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_OpenMPDEV(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_OpenMPDEV(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_OpenMPDEV(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_OpenMPDEV(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_OpenMPDEV(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_OpenMPDEV(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_OpenMPDEV(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_OpenMPDEV(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_OpenMPDEV(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_OpenMPDEV(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VLinearCombination_OpenMPDEV(int nvec, sunrealtype* c, N_Vector* V, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_OpenMPDEV(int nvec, realtype* a, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_OpenMPDEV(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_OpenMPDEV(int nvec, N_Vector x, - N_Vector *Y, realtype* dotprods); + N_Vector *Y, sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_OpenMPDEV(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_OpenMPDEV(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_OpenMPDEV(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_OpenMPDEV(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_OpenMPDEV(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_OpenMPDEV(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_OpenMPDEV(int nvecs, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_OpenMPDEV(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_OpenMPDEV(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_OpenMPDEV(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_OpenMPDEV(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_OpenMPDEV(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_OpenMPDEV(N_Vector x, N_Vector w, N_Vector id); diff --git a/include/nvector/nvector_parallel.h b/include/nvector/nvector_parallel.h index 127f319c0b..4c7767c982 100644 --- a/include/nvector/nvector_parallel.h +++ b/include/nvector/nvector_parallel.h @@ -20,7 +20,7 @@ * - The definition of the generic N_Vector structure can be * found in the header file sundials_nvector.h. * - * - The definition of the type realtype can be found in the + * - The definition of the type sunrealtype can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -57,7 +57,7 @@ struct _N_VectorContent_Parallel { sunindextype local_length; /* local vector length */ sunindextype global_length; /* global vector length */ booleantype own_data; /* ownership of data */ - realtype *data; /* local data array */ + sunrealtype *data; /* local data array */ MPI_Comm comm; /* pointer to MPI communicator */ }; @@ -103,7 +103,7 @@ SUNDIALS_EXPORT N_Vector N_VNewEmpty_Parallel(MPI_Comm comm, SUNDIALS_EXPORT N_Vector N_VMake_Parallel(MPI_Comm comm, sunindextype local_length, sunindextype global_length, - realtype *v_data, + sunrealtype *v_data, SUNContext sunctx); SUNDIALS_EXPORT sunindextype N_VGetLength_Parallel(N_Vector v); @@ -120,83 +120,83 @@ SUNDIALS_EXPORT N_Vector N_VClone_Parallel(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_Parallel(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Parallel(N_Vector v, sunindextype *lrw, sunindextype *liw); -SUNDIALS_EXPORT realtype *N_VGetArrayPointer_Parallel(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer_Parallel(realtype *v_data, N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetArrayPointer_Parallel(N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_Parallel(sunrealtype *v_data, N_Vector v); SUNDIALS_EXPORT void *N_VGetCommunicator_Parallel(N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Parallel(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Parallel(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Parallel(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Parallel(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Parallel(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Parallel(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Parallel(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Parallel(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Parallel(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Parallel(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Parallel(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Parallel(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Parallel(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Parallel(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Parallel(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Parallel(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Parallel(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Parallel(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Parallel(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_Parallel(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Parallel(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Parallel(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Parallel(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Parallel(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_Parallel(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Parallel(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Parallel(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Parallel(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Parallel(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Parallel(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Parallel(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Parallel(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Parallel(int nvec, realtype* c, N_Vector* V, +SUNDIALS_EXPORT int N_VLinearCombination_Parallel(int nvec, sunrealtype* c, N_Vector* V, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Parallel(int nvec, realtype* a, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_Parallel(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_Parallel(int nvec, N_Vector x, - N_Vector* Y, realtype* dotprods); + N_Vector* Y, sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Parallel(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Parallel(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_Parallel(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Parallel(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_Parallel(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_Parallel(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_Parallel(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Parallel(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Parallel(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VDotProdLocal_Parallel(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNormLocal_Parallel(N_Vector x); -SUNDIALS_EXPORT realtype N_VMinLocal_Parallel(N_Vector x); -SUNDIALS_EXPORT realtype N_VL1NormLocal_Parallel(N_Vector x); -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Parallel(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Parallel(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProdLocal_Parallel(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNormLocal_Parallel(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VMinLocal_Parallel(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_Parallel(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Parallel(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Parallel(N_Vector x, N_Vector w, N_Vector id); SUNDIALS_EXPORT booleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotientLocal_Parallel(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_Parallel(N_Vector num, N_Vector denom); /* OPTIONAL single buffer reduction operations */ SUNDIALS_EXPORT int N_VDotProdMultiLocal_Parallel(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods); + sunrealtype* dotprods); SUNDIALS_EXPORT int N_VDotProdMultiAllReduce_Parallel(int nvec_total, N_Vector x, - realtype* dotprods); + sunrealtype* dotprods); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_Parallel(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_parhyp.h b/include/nvector/nvector_parhyp.h index 03e7f66df6..109afc725d 100644 --- a/include/nvector/nvector_parhyp.h +++ b/include/nvector/nvector_parhyp.h @@ -23,7 +23,7 @@ * - The definition of the generic N_Vector structure can be * found in the header file sundials_nvector.h. * - * - The definition of the type realtype can be found in the + * - The definition of the type sunrealtype can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -96,87 +96,87 @@ SUNDIALS_EXPORT N_Vector N_VClone_ParHyp(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_ParHyp(N_Vector v); SUNDIALS_EXPORT void N_VSpace_ParHyp(N_Vector v, sunindextype *lrw, sunindextype *liw); -SUNDIALS_EXPORT realtype *N_VGetArrayPointer_ParHyp(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer_ParHyp(realtype *v_data, N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetArrayPointer_ParHyp(N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_ParHyp(sunrealtype *v_data, N_Vector v); SUNDIALS_EXPORT void *N_VGetCommunicator_ParHyp(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength_ParHyp(N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_ParHyp(realtype a, N_Vector x, realtype b, +SUNDIALS_EXPORT void N_VLinearSum_ParHyp(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_ParHyp(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VConst_ParHyp(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_ParHyp(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_ParHyp(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_ParHyp(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_ParHyp(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_ParHyp(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_ParHyp(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_ParHyp(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_ParHyp(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_ParHyp(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_ParHyp(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_ParHyp(N_Vector x, N_Vector w, +SUNDIALS_EXPORT void N_VAddConst_ParHyp(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_ParHyp(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_ParHyp(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_ParHyp(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_ParHyp(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_ParHyp(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_ParHyp(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_ParHyp(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_ParHyp(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VMin_ParHyp(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_ParHyp(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_ParHyp(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_ParHyp(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_ParHyp(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_ParHyp(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_ParHyp(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_ParHyp(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_ParHyp(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VLinearCombination_ParHyp(int nvec, sunrealtype* c, N_Vector* X, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_ParHyp(int nvec, realtype* a, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_ParHyp(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_ParHyp(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods); + sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_ParHyp(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_ParHyp(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_ParHyp(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_ParHyp(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_ParHyp(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_ParHyp(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_ParHyp(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_ParHyp(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_ParHyp(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VDotProdLocal_ParHyp(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNormLocal_ParHyp(N_Vector x); -SUNDIALS_EXPORT realtype N_VMinLocal_ParHyp(N_Vector x); -SUNDIALS_EXPORT realtype N_VL1NormLocal_ParHyp(N_Vector x); -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_ParHyp(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_ParHyp(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProdLocal_ParHyp(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNormLocal_ParHyp(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VMinLocal_ParHyp(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_ParHyp(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_ParHyp(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_ParHyp(N_Vector x, N_Vector w, N_Vector id); SUNDIALS_EXPORT booleantype N_VInvTestLocal_ParHyp(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_ParHyp(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotientLocal_ParHyp(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_ParHyp(N_Vector num, N_Vector denom); /* OPTIONAL single buffer reduction operations */ SUNDIALS_EXPORT int N_VDotProdMultiLocal_ParHyp(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods); + sunrealtype* dotprods); SUNDIALS_EXPORT int N_VDotProdMultiAllReduce_ParHyp(int nvec, N_Vector x, - realtype* sum); + sunrealtype* sum); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_ParHyp(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_petsc.h b/include/nvector/nvector_petsc.h index f7745ad98f..67f789e780 100644 --- a/include/nvector/nvector_petsc.h +++ b/include/nvector/nvector_petsc.h @@ -19,7 +19,7 @@ * - The definition of the generic N_Vector structure can be * found in the header file sundials_nvector.h. * - * - The definition of the type realtype can be found in the + * - The definition of the type sunrealtype can be found in the * header file sundials_types.h, and it may be changed (at the * build configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -75,7 +75,7 @@ SUNDIALS_EXPORT N_Vector N_VNewEmpty_Petsc(MPI_Comm comm, SUNDIALS_EXPORT N_Vector N_VMake_Petsc(Vec v, SUNContext sunctx); -SUNDIALS_EXPORT realtype *N_VGetArrayPointer_Petsc(N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetArrayPointer_Petsc(N_Vector v); SUNDIALS_EXPORT Vec N_VGetVector_Petsc(N_Vector v); @@ -91,82 +91,82 @@ SUNDIALS_EXPORT N_Vector N_VCloneEmpty_Petsc(N_Vector w); SUNDIALS_EXPORT N_Vector N_VClone_Petsc(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_Petsc(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Petsc(N_Vector v, sunindextype *lrw, sunindextype *liw); -SUNDIALS_EXPORT void N_VSetArrayPointer_Petsc(realtype *v_data, N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_Petsc(sunrealtype *v_data, N_Vector v); SUNDIALS_EXPORT void *N_VGetCommunicator_Petsc(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength_Petsc(N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Petsc(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Petsc(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Petsc(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Petsc(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Petsc(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Petsc(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Petsc(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Petsc(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Petsc(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Petsc(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Petsc(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Petsc(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Petsc(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Petsc(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Petsc(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Petsc(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Petsc(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Petsc(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Petsc(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_Petsc(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Petsc(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Petsc(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Petsc(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Petsc(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_Petsc(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Petsc(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Petsc(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Petsc(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Petsc(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Petsc(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Petsc(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Petsc(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Petsc(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VLinearCombination_Petsc(int nvec, sunrealtype* c, N_Vector* X, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Petsc(int nvec, realtype* a, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_Petsc(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_Petsc(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods); + sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Petsc(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Petsc(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_Petsc(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Petsc(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_Petsc(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_Petsc(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_Petsc(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Petsc(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Petsc(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VDotProdLocal_Petsc(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNormLocal_Petsc(N_Vector x); -SUNDIALS_EXPORT realtype N_VMinLocal_Petsc(N_Vector x); -SUNDIALS_EXPORT realtype N_VL1NormLocal_Petsc(N_Vector x); -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Petsc(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Petsc(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProdLocal_Petsc(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNormLocal_Petsc(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VMinLocal_Petsc(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_Petsc(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Petsc(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Petsc(N_Vector x, N_Vector w, N_Vector id); SUNDIALS_EXPORT booleantype N_VInvTestLocal_Petsc(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotientLocal_Petsc(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_Petsc(N_Vector num, N_Vector denom); /* OPTIONAL single buffer reduction operations */ SUNDIALS_EXPORT int N_VDotProdMultiLocal_Petsc(int nvec, N_Vector x, - N_Vector* Y, realtype* dotprods); + N_Vector* Y, sunrealtype* dotprods); SUNDIALS_EXPORT int N_VDotProdMultiAllReduce_Petsc(int nvec, N_Vector x, - realtype* sum); + sunrealtype* sum); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_Petsc(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_pthreads.h b/include/nvector/nvector_pthreads.h index 4e20c7ad5b..0ff06fe9f2 100644 --- a/include/nvector/nvector_pthreads.h +++ b/include/nvector/nvector_pthreads.h @@ -25,7 +25,7 @@ * - The definition of the generic N_Vector structure can be found * in the header file sundials_nvector.h. * - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -60,7 +60,7 @@ extern "C" { struct _N_VectorContent_Pthreads { sunindextype length; /* vector length */ booleantype own_data; /* data ownership flag */ - realtype *data; /* data array */ + sunrealtype *data; /* data array */ int num_threads; /* number of POSIX threads */ }; @@ -69,21 +69,21 @@ typedef struct _N_VectorContent_Pthreads *N_VectorContent_Pthreads; /* Structure to hold parallelization information for each thread when calling "companion" functions to compute vector operations. The start and end vector (loop) indices are unique to each thread, the - realtype variables are the same for each thread, and the mutex + sunrealtype variables are the same for each thread, and the mutex variable is used to lock variables in reductions. */ struct _Pthreads_Data{ sunindextype start; /* starting index for loop */ sunindextype end; /* ending index for loop */ - realtype c1, c2; /* scalar values */ - realtype *v1, *v2, *v3; /* vector data */ - realtype *global_val; /* shared global variable */ + sunrealtype c1, c2; /* scalar values */ + sunrealtype *v1, *v2, *v3; /* vector data */ + sunrealtype *global_val; /* shared global variable */ pthread_mutex_t *global_mutex; /* lock for shared variable */ int nvec; /* number of vectors in fused op */ int nsum; /* number of sums in fused op */ - realtype* cvals; /* scalar values in fused op */ + sunrealtype* cvals; /* scalar values in fused op */ N_Vector x1; /* vector array in fused op */ N_Vector x2; /* vector array in fused op */ @@ -131,7 +131,7 @@ SUNDIALS_EXPORT N_Vector N_VNewEmpty_Pthreads(sunindextype vec_length, int n_threads, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_Pthreads(sunindextype vec_length, - int n_threads, realtype *v_data, + int n_threads, sunrealtype *v_data, SUNContext sunctx); SUNDIALS_EXPORT sunindextype N_VGetLength_Pthreads(N_Vector v); @@ -146,68 +146,68 @@ SUNDIALS_EXPORT N_Vector N_VClone_Pthreads(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_Pthreads(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Pthreads(N_Vector v, sunindextype *lrw, sunindextype *liw); -SUNDIALS_EXPORT realtype *N_VGetArrayPointer_Pthreads(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer_Pthreads(realtype *v_data, N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetArrayPointer_Pthreads(N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_Pthreads(sunrealtype *v_data, N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Pthreads(realtype a, N_Vector x, realtype b, +SUNDIALS_EXPORT void N_VLinearSum_Pthreads(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Pthreads(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Pthreads(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Pthreads(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Pthreads(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Pthreads(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Pthreads(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Pthreads(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Pthreads(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Pthreads(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Pthreads(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Pthreads(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Pthreads(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Pthreads(N_Vector x, N_Vector w, +SUNDIALS_EXPORT void N_VAddConst_Pthreads(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Pthreads(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Pthreads(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Pthreads(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Pthreads(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Pthreads(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Pthreads(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Pthreads(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Pthreads(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VMin_Pthreads(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Pthreads(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Pthreads(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Pthreads(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Pthreads(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Pthreads(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Pthreads(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VLinearCombination_Pthreads(int nvec, sunrealtype* c, N_Vector* X, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Pthreads(int nvec, realtype* a, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_Pthreads(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_Pthreads(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods); + sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Pthreads(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Pthreads(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_Pthreads(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Pthreads(int nvec, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_Pthreads(int nvec, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_Pthreads(int nvec, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_Pthreads(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Pthreads(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Pthreads(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Pthreads(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Pthreads(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Pthreads(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Pthreads(N_Vector x, N_Vector w, N_Vector id); /* OPTIONAL XBraid interface operations */ diff --git a/include/nvector/nvector_raja.h b/include/nvector/nvector_raja.h index b31bd3dd79..ec5de520a5 100644 --- a/include/nvector/nvector_raja.h +++ b/include/nvector/nvector_raja.h @@ -36,7 +36,7 @@ extern "C" { /* RAJA implementation of the N_Vector 'content' structure contains the length of the vector, pointers to host and device - arrays of 'realtype' components, a flag indicating ownership of + arrays of 'sunrealtype' components, a flag indicating ownership of the data, and a private data pointer */ struct _N_VectorContent_Raja { @@ -64,13 +64,13 @@ SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Raja(sunindextype length, booleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx); -SUNDIALS_EXPORT N_Vector N_VMake_Raja(sunindextype length, realtype *h_vdata, - realtype *d_vdata, SUNContext sunctx); +SUNDIALS_EXPORT N_Vector N_VMake_Raja(sunindextype length, sunrealtype *h_vdata, + sunrealtype *d_vdata, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMakeManaged_Raja(sunindextype length, - realtype *vdata, + sunrealtype *vdata, SUNContext sunctx); -SUNDIALS_EXPORT void N_VSetHostArrayPointer_Raja(realtype* h_vdata, N_Vector v); -SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Raja(realtype* d_vdata, +SUNDIALS_EXPORT void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v); +SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v); SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Raja(N_Vector x); SUNDIALS_EXPORT void N_VCopyToDevice_Raja(N_Vector v); @@ -84,17 +84,17 @@ sunindextype N_VGetLength_Raja(N_Vector x) } SUNDIALS_STATIC_INLINE -realtype *N_VGetHostArrayPointer_Raja(N_Vector x) +sunrealtype *N_VGetHostArrayPointer_Raja(N_Vector x) { N_VectorContent_Raja content = (N_VectorContent_Raja)x->content; - return(content->host_data == NULL ? NULL : (realtype*)content->host_data->ptr); + return(content->host_data == NULL ? NULL : (sunrealtype*)content->host_data->ptr); } SUNDIALS_STATIC_INLINE -realtype *N_VGetDeviceArrayPointer_Raja(N_Vector x) +sunrealtype *N_VGetDeviceArrayPointer_Raja(N_Vector x) { N_VectorContent_Raja content = (N_VectorContent_Raja)x->content; - return(content->device_data == NULL ? NULL : (realtype*)content->device_data->ptr); + return(content->device_data == NULL ? NULL : (sunrealtype*)content->device_data->ptr); } @@ -114,55 +114,55 @@ SUNDIALS_EXPORT N_Vector N_VCloneEmpty_Raja(N_Vector w); SUNDIALS_EXPORT N_Vector N_VClone_Raja(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_Raja(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Raja(N_Vector v, sunindextype *lrw, sunindextype *liw); -SUNDIALS_EXPORT void N_VSetArrayPointer_Raja(realtype *v_data, N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_Raja(sunrealtype *v_data, N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Raja(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Raja(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Raja(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Raja(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Raja(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Raja(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Raja(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Raja(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Raja(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Raja(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Raja(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Raja(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Raja(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Raja(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Raja(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Raja(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Raja(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Raja(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Raja(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_Raja(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Raja(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Raja(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Raja(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Raja(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_Raja(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Raja(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Raja(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Raja(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Raja(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Raja(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Raja(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Raja(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Raja(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VLinearCombination_Raja(int nvec, sunrealtype* c, N_Vector* X, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Raja(int nvec, realtype* c, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_Raja(int nvec, sunrealtype* c, N_Vector x, N_Vector* Y, N_Vector* Z); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Raja(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Raja(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VScaleVectorArray_Raja(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Raja(int nvec, realtype c, N_Vector* Z); +SUNDIALS_EXPORT int N_VConstVectorArray_Raja(int nvec, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Raja(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Raja(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Raja(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Raja(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Raja(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Raja(N_Vector x, N_Vector w, N_Vector id); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_Raja(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_serial.h b/include/nvector/nvector_serial.h index 1b08708c6c..42e475cea5 100644 --- a/include/nvector/nvector_serial.h +++ b/include/nvector/nvector_serial.h @@ -20,7 +20,7 @@ * - The definition of the generic N_Vector structure can be found * in the header file sundials_nvector.h. * - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -54,7 +54,7 @@ extern "C" { struct _N_VectorContent_Serial { sunindextype length; /* vector length */ booleantype own_data; /* data ownership flag */ - realtype *data; /* data array */ + sunrealtype *data; /* data array */ }; typedef struct _N_VectorContent_Serial *N_VectorContent_Serial; @@ -86,7 +86,7 @@ SUNDIALS_EXPORT N_Vector N_VNew_Serial(sunindextype vec_length, SUNContext sunct SUNDIALS_EXPORT N_Vector N_VNewEmpty_Serial(sunindextype vec_length, SUNContext sunctx); -SUNDIALS_EXPORT N_Vector N_VMake_Serial(sunindextype vec_length, realtype *v_data, SUNContext sunctx); +SUNDIALS_EXPORT N_Vector N_VMake_Serial(sunindextype vec_length, sunrealtype *v_data, SUNContext sunctx); SUNDIALS_EXPORT sunindextype N_VGetLength_Serial(N_Vector v); @@ -99,65 +99,65 @@ SUNDIALS_EXPORT N_Vector N_VCloneEmpty_Serial(N_Vector w); SUNDIALS_EXPORT N_Vector N_VClone_Serial(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_Serial(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Serial(N_Vector v, sunindextype *lrw, sunindextype *liw); -SUNDIALS_EXPORT realtype *N_VGetArrayPointer_Serial(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer_Serial(realtype *v_data, N_Vector v); +SUNDIALS_EXPORT sunrealtype *N_VGetArrayPointer_Serial(N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer_Serial(sunrealtype *v_data, N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Serial(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Serial(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Serial(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Serial(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Serial(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Serial(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Serial(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Serial(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Serial(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Serial(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Serial(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Serial(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Serial(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Serial(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Serial(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Serial(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Serial(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Serial(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Serial(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_Serial(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Serial(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Serial(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Serial(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Serial(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_Serial(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Serial(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Serial(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Serial(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Serial(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Serial(int nvec, realtype* c, N_Vector* V, +SUNDIALS_EXPORT int N_VLinearCombination_Serial(int nvec, sunrealtype* c, N_Vector* V, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Serial(int nvec, realtype* a, N_Vector x, +SUNDIALS_EXPORT int N_VScaleAddMulti_Serial(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); SUNDIALS_EXPORT int N_VDotProdMulti_Serial(int nvec, N_Vector x, - N_Vector* Y, realtype* dotprods); + N_Vector* Y, sunrealtype* dotprods); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Serial(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Serial(int nvec, realtype* c, +SUNDIALS_EXPORT int N_VScaleVectorArray_Serial(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Serial(int nvecs, realtype c, +SUNDIALS_EXPORT int N_VConstVectorArray_Serial(int nvecs, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_Serial(int nvecs, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_Serial(int nvecs, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Serial(int nvec, int nsum, - realtype* a, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Serial(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Serial(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Serial(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Serial(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Serial(N_Vector x, N_Vector w, N_Vector id); /* OPTIONAL XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize_Serial(N_Vector x, sunindextype *size); diff --git a/include/nvector/nvector_sycl.h b/include/nvector/nvector_sycl.h index d60187f05b..2ac028f740 100644 --- a/include/nvector/nvector_sycl.h +++ b/include/nvector/nvector_sycl.h @@ -70,17 +70,17 @@ SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Sycl(sunindextype length, ::sycl::queue *Q, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_Sycl(sunindextype length, - realtype *h_vdata, - realtype *d_vdata, + sunrealtype *h_vdata, + sunrealtype *d_vdata, ::sycl::queue *Q, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMakeManaged_Sycl(sunindextype length, - realtype *vdata, + sunrealtype *vdata, ::sycl::queue *Q, SUNContext sunctx); -SUNDIALS_EXPORT void N_VSetHostArrayPointer_Sycl(realtype* h_vdata, N_Vector v); -SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Sycl(realtype* d_vdata, +SUNDIALS_EXPORT void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v); +SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v); SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Sycl(N_Vector x); SUNDIALS_EXPORT int N_VSetKernelExecPolicy_Sycl(N_Vector x, @@ -97,17 +97,17 @@ sunindextype N_VGetLength_Sycl(N_Vector x) } SUNDIALS_STATIC_INLINE -realtype *N_VGetHostArrayPointer_Sycl(N_Vector x) +sunrealtype *N_VGetHostArrayPointer_Sycl(N_Vector x) { N_VectorContent_Sycl content = (N_VectorContent_Sycl)x->content; - return(content->host_data == NULL ? NULL : (realtype*)content->host_data->ptr); + return(content->host_data == NULL ? NULL : (sunrealtype*)content->host_data->ptr); } SUNDIALS_STATIC_INLINE -realtype *N_VGetDeviceArrayPointer_Sycl(N_Vector x) +sunrealtype *N_VGetDeviceArrayPointer_Sycl(N_Vector x) { N_VectorContent_Sycl content = (N_VectorContent_Sycl)x->content; - return(content->device_data == NULL ? NULL : (realtype*)content->device_data->ptr); + return(content->device_data == NULL ? NULL : (sunrealtype*)content->device_data->ptr); } @@ -129,59 +129,59 @@ SUNDIALS_EXPORT void N_VSpace_Sycl(N_Vector v, sunindextype *lrw, sunindextype *liw); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_Sycl(realtype a, N_Vector x, - realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Sycl(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Sycl(sunrealtype a, N_Vector x, + sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Sycl(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Sycl(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Sycl(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Sycl(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Sycl(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Sycl(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Sycl(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Sycl(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Sycl(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Sycl(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Sycl(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Sycl(N_Vector x, N_Vector w, +SUNDIALS_EXPORT void N_VAddConst_Sycl(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Sycl(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Sycl(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Sycl(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Sycl(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Sycl(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Sycl(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Sycl(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Sycl(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VMin_Sycl(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Sycl(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Sycl(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Sycl(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Sycl(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Sycl(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Sycl(N_Vector num, N_Vector denom); /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination_Sycl(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VLinearCombination_Sycl(int nvec, sunrealtype* c, N_Vector* X, N_Vector Z); -SUNDIALS_EXPORT int N_VScaleAddMulti_Sycl(int nvec, realtype* c, N_Vector X, +SUNDIALS_EXPORT int N_VScaleAddMulti_Sycl(int nvec, sunrealtype* c, N_Vector X, N_Vector* Y, N_Vector* Z); /* vector array operations */ SUNDIALS_EXPORT int N_VLinearSumVectorArray_Sycl(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray_Sycl(int nvec, realtype* c, N_Vector* X, +SUNDIALS_EXPORT int N_VScaleVectorArray_Sycl(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray_Sycl(int nvec, realtype c, N_Vector* Z); +SUNDIALS_EXPORT int N_VConstVectorArray_Sycl(int nvec, sunrealtype c, N_Vector* Z); SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray_Sycl(int nvec, int nsum, - realtype* a, N_Vector* X, + sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); SUNDIALS_EXPORT int N_VLinearCombinationVectorArray_Sycl(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z); SUNDIALS_EXPORT int N_VWrmsNormVectorArray_Sycl(int nvec, N_Vector* X, - N_Vector* W, realtype* nrm); + N_Vector* W, sunrealtype* nrm); SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray_Sycl(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm); + sunrealtype* nrm); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Sycl(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Sycl(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Sycl(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Sycl(N_Vector x, N_Vector w, N_Vector id); /* OPTIONAL XBraid interface operations */ diff --git a/include/nvector/nvector_trilinos.h b/include/nvector/nvector_trilinos.h index 21a9f8a04d..3f190e70da 100644 --- a/include/nvector/nvector_trilinos.h +++ b/include/nvector/nvector_trilinos.h @@ -26,7 +26,7 @@ * - The definition of the generic N_Vector structure can be * found in the header file sundials_nvector.h. * - * - The definition of the type realtype can be found in the + * - The definition of the type sunrealtype can be found in the * header file sundials_types.h, and it may be changed (at the * build configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -100,38 +100,38 @@ SUNDIALS_EXPORT void N_VDestroy_Trilinos(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Trilinos(N_Vector v, sunindextype *lrw, sunindextype *liw); SUNDIALS_EXPORT void *N_VGetCommunicator_Trilinos(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength_Trilinos(N_Vector v); -SUNDIALS_EXPORT void N_VLinearSum_Trilinos(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_Trilinos(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum_Trilinos(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst_Trilinos(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_Trilinos(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_Trilinos(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_Trilinos(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_Trilinos(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_Trilinos(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_Trilinos(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_Trilinos(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_Trilinos(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_Trilinos(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_Trilinos(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_Trilinos(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_Trilinos(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_Trilinos(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_Trilinos(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_Trilinos(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst_Trilinos(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd_Trilinos(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_Trilinos(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_Trilinos(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_Trilinos(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin_Trilinos(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Trilinos(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_Trilinos(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_Trilinos(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_Trilinos(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_Trilinos(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_Trilinos(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Trilinos(N_Vector num, N_Vector denom); /* OPTIONAL local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VDotProdLocal_Trilinos(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNormLocal_Trilinos(N_Vector x); -SUNDIALS_EXPORT realtype N_VMinLocal_Trilinos(N_Vector x); -SUNDIALS_EXPORT realtype N_VL1NormLocal_Trilinos(N_Vector x); -SUNDIALS_EXPORT realtype N_VWSqrSumLocal_Trilinos(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal_Trilinos(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProdLocal_Trilinos(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNormLocal_Trilinos(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VMinLocal_Trilinos(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_Trilinos(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Trilinos(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Trilinos(N_Vector x, N_Vector w, N_Vector id); SUNDIALS_EXPORT booleantype N_VInvTestLocal_Trilinos(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_Trilinos(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotientLocal_Trilinos(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_Trilinos(N_Vector num, N_Vector denom); #ifdef __cplusplus diff --git a/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp b/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp index a399232b8b..07376bb27f 100644 --- a/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp +++ b/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp @@ -28,7 +28,7 @@ namespace nvector_tpetra struct TpetraVectorInterface : public _N_VectorContent_Trilinos { // Typedef of Tpetra vector class to be used with SUNDIALS - typedef Tpetra::Vector vector_type; + typedef Tpetra::Vector vector_type; TpetraVectorInterface(Teuchos::RCP rcpvec) { diff --git a/include/sundials/sundials_band.h b/include/sundials/sundials_band.h index 9c306de2c1..4ddca2fe74 100644 --- a/include/sundials/sundials_band.h +++ b/include/sundials/sundials_band.h @@ -16,9 +16,9 @@ * * There are two sets of band solver routines listed in * this file: one set uses type SUNDlsMat defined below and the - * other set uses the type realtype ** for band matrix arguments. + * other set uses the type sunrealtype ** for band matrix arguments. * Routines that work with the type SUNDlsMat begin with "Band". - * Routines that work with realtype ** begin with "band". + * Routines that work with sunrealtype ** begin with "band". * -----------------------------------------------------------------*/ #ifndef _SUNDIALS_BAND_H @@ -80,7 +80,7 @@ SUNDIALS_EXPORT sunindextype SUNDlsMat_BandGBTRF(SUNDlsMat A, sunindextype* p); SUNDIALS_EXPORT -sunindextype SUNDlsMat_bandGBTRF(realtype **a, sunindextype n, +sunindextype SUNDlsMat_bandGBTRF(sunrealtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype *p); @@ -103,11 +103,11 @@ sunindextype SUNDlsMat_bandGBTRF(realtype **a, sunindextype n, */ SUNDIALS_EXPORT -void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype *p, realtype *b); +void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype *p, sunrealtype *b); SUNDIALS_EXPORT -void SUNDlsMat_bandGBTRS(realtype **a, sunindextype n, sunindextype smu, - sunindextype ml, sunindextype *p, realtype *b); +void SUNDlsMat_bandGBTRS(sunrealtype **a, sunindextype n, sunindextype smu, + sunindextype ml, sunindextype *p, sunrealtype *b); /* * ----------------------------------------------------------------- @@ -129,7 +129,7 @@ SUNDIALS_EXPORT void SUNDlsMat_BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml); SUNDIALS_EXPORT -void SUNDlsMat_bandCopy(realtype **a, realtype **b, sunindextype n, +void SUNDlsMat_bandCopy(sunrealtype **a, sunrealtype **b, sunindextype n, sunindextype a_smu, sunindextype b_smu, sunindextype copymu, sunindextype copyml); @@ -147,10 +147,10 @@ void SUNDlsMat_bandCopy(realtype **a, realtype **b, sunindextype n, * ----------------------------------------------------------------- */ -void SUNDlsMat_BandScale(realtype c, SUNDlsMat A); +void SUNDlsMat_BandScale(sunrealtype c, SUNDlsMat A); SUNDIALS_EXPORT -void SUNDlsMat_bandScale(realtype c, realtype **a, sunindextype n, +void SUNDlsMat_bandScale(sunrealtype c, sunrealtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu); /* @@ -158,11 +158,11 @@ void SUNDlsMat_bandScale(realtype c, realtype **a, sunindextype n, * Function: SUNDlsMat_bandAddIdentity * ----------------------------------------------------------------- * SUNDlsMat_bandAddIdentity adds the identity matrix to the n-by-n - * matrix stored in the realtype** arrays. + * matrix stored in the sunrealtype** arrays. * ----------------------------------------------------------------- */ -void SUNDlsMat_bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); +void SUNDlsMat_bandAddIdentity(sunrealtype **a, sunindextype n, sunindextype smu); /* @@ -181,10 +181,10 @@ void SUNDlsMat_bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); */ SUNDIALS_EXPORT -void SUNDlsMat_BandMatvec(SUNDlsMat A, realtype *x, realtype *y); +void SUNDlsMat_BandMatvec(SUNDlsMat A, sunrealtype *x, sunrealtype *y); SUNDIALS_EXPORT -void SUNDlsMat_bandMatvec(realtype **a, realtype *x, realtype *y, +void SUNDlsMat_bandMatvec(sunrealtype **a, sunrealtype *x, sunrealtype *y, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu); diff --git a/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index da05f390b5..23846def6d 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -52,7 +52,7 @@ #cmakedefine SUNDIALS_C_COMPILER_HAS_ISINF_ISNAN #cmakedefine SUNDIALS_C_COMPILER_HAS_INLINE -/* Define precision of SUNDIALS data type 'realtype' +/* Define precision of SUNDIALS data type 'sunrealtype' * Depending on the precision level, one of the following * three macros will be defined: * #define SUNDIALS_SINGLE_PRECISION 1 diff --git a/include/sundials/sundials_dense.h b/include/sundials/sundials_dense.h index 201580cad4..ae9ac57139 100644 --- a/include/sundials/sundials_dense.h +++ b/include/sundials/sundials_dense.h @@ -16,9 +16,9 @@ * * There are two sets of dense solver routines listed in * this file: one set uses type DlsMat defined below and the - * other set uses the type realtype ** for dense matrix arguments. + * other set uses the type sunrealtype ** for dense matrix arguments. * Routines that work with the type DlsMat begin with "Dense". - * Routines that work with realtype** begin with "dense". + * Routines that work with sunrealtype** begin with "dense". * -----------------------------------------------------------------*/ #ifndef _SUNDIALS_DENSE_H @@ -73,15 +73,15 @@ SUNDIALS_EXPORT sunindextype SUNDlsMat_DenseGETRF(SUNDlsMat A, sunindextype *p); SUNDIALS_EXPORT -void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype *p, realtype *b); +void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype *p, sunrealtype *b); SUNDIALS_EXPORT -sunindextype SUNDlsMat_denseGETRF(realtype **a, sunindextype m, +sunindextype SUNDlsMat_denseGETRF(sunrealtype **a, sunindextype m, sunindextype n, sunindextype *p); SUNDIALS_EXPORT -void SUNDlsMat_denseGETRS(realtype **a, sunindextype n, sunindextype *p, - realtype *b); +void SUNDlsMat_denseGETRS(sunrealtype **a, sunindextype n, sunindextype *p, + sunrealtype *b); /* * ---------------------------------------------------------------------------- @@ -106,13 +106,13 @@ SUNDIALS_EXPORT sunindextype SUNDlsMat_DensePOTRF(SUNDlsMat A); SUNDIALS_EXPORT -void SUNDlsMat_DensePOTRS(SUNDlsMat A, realtype *b); +void SUNDlsMat_DensePOTRS(SUNDlsMat A, sunrealtype *b); SUNDIALS_EXPORT -sunindextype SUNDlsMat_densePOTRF(realtype **a, sunindextype m); +sunindextype SUNDlsMat_densePOTRF(sunrealtype **a, sunindextype m); SUNDIALS_EXPORT -void SUNDlsMat_densePOTRS(realtype **a, sunindextype m, realtype *b); +void SUNDlsMat_densePOTRS(sunrealtype **a, sunindextype m, sunrealtype *b); /* * ----------------------------------------------------------------------------- @@ -141,21 +141,21 @@ void SUNDlsMat_densePOTRS(realtype **a, sunindextype m, realtype *b); */ SUNDIALS_EXPORT -int SUNDlsMat_DenseGEQRF(SUNDlsMat A, realtype *beta, realtype *wrk); +int SUNDlsMat_DenseGEQRF(SUNDlsMat A, sunrealtype *beta, sunrealtype *wrk); SUNDIALS_EXPORT -int SUNDlsMat_DenseORMQR(SUNDlsMat A, realtype *beta, realtype *vn, - realtype *vm, realtype *wrk); +int SUNDlsMat_DenseORMQR(SUNDlsMat A, sunrealtype *beta, sunrealtype *vn, + sunrealtype *vm, sunrealtype *wrk); SUNDIALS_EXPORT -int SUNDlsMat_denseGEQRF(realtype **a, sunindextype m, sunindextype n, - realtype *beta, realtype *wrk); +int SUNDlsMat_denseGEQRF(sunrealtype **a, sunindextype m, sunindextype n, + sunrealtype *beta, sunrealtype *wrk); SUNDIALS_EXPORT -int SUNDlsMat_denseORMQR(realtype **a, sunindextype m, sunindextype n, - realtype *beta, realtype *v, realtype *w, - realtype *wrk); +int SUNDlsMat_denseORMQR(sunrealtype **a, sunindextype m, sunindextype n, + sunrealtype *beta, sunrealtype *v, sunrealtype *w, + sunrealtype *wrk); /* * ---------------------------------------------------------------------------- @@ -173,7 +173,7 @@ SUNDIALS_EXPORT void SUNDlsMat_DenseCopy(SUNDlsMat A, SUNDlsMat B); SUNDIALS_EXPORT -void SUNDlsMat_denseCopy(realtype **a, realtype **b, sunindextype m, +void SUNDlsMat_denseCopy(sunrealtype **a, sunrealtype **b, sunindextype m, sunindextype n); /* @@ -190,10 +190,10 @@ void SUNDlsMat_denseCopy(realtype **a, realtype **b, sunindextype m, */ SUNDIALS_EXPORT -void SUNDlsMat_DenseScale(realtype c, SUNDlsMat A); +void SUNDlsMat_DenseScale(sunrealtype c, SUNDlsMat A); SUNDIALS_EXPORT -void SUNDlsMat_denseScale(realtype c, realtype **a, sunindextype m, +void SUNDlsMat_denseScale(sunrealtype c, sunrealtype **a, sunindextype m, sunindextype n); /* @@ -201,12 +201,12 @@ void SUNDlsMat_denseScale(realtype c, realtype **a, sunindextype m, * Function: SUNDlsMat_denseAddIdentity * ----------------------------------------------------------------------------- * SUNDlsMat_denseAddIdentity adds the identity matrix to the n-by-n matrix - * stored in a realtype** array. + * stored in a sunrealtype** array. * ----------------------------------------------------------------------------- */ SUNDIALS_EXPORT -void SUNDlsMat_denseAddIdentity(realtype **a, sunindextype n); +void SUNDlsMat_denseAddIdentity(sunrealtype **a, sunindextype n); /* @@ -224,10 +224,10 @@ void SUNDlsMat_denseAddIdentity(realtype **a, sunindextype n); */ SUNDIALS_EXPORT -void SUNDlsMat_DenseMatvec(SUNDlsMat A, realtype *x, realtype *y); +void SUNDlsMat_DenseMatvec(SUNDlsMat A, sunrealtype *x, sunrealtype *y); SUNDIALS_EXPORT -void SUNDlsMat_denseMatvec(realtype **a, realtype *x, realtype *y, +void SUNDlsMat_denseMatvec(sunrealtype **a, sunrealtype *x, sunrealtype *y, sunindextype m, sunindextype n); diff --git a/include/sundials/sundials_direct.h b/include/sundials/sundials_direct.h index b73ffeae7e..17f0329195 100644 --- a/include/sundials/sundials_direct.h +++ b/include/sundials/sundials_direct.h @@ -63,7 +63,7 @@ extern "C" { * M - number of rows * N - number of columns * ldim - leading dimension (ldim >= M) - * data - pointer to a contiguous block of realtype variables + * data - pointer to a contiguous block of sunrealtype variables * ldata - length of the data array =ldim*N * cols - array of pointers. cols[j] points to the first element * of the j-th column of the matrix in the array data. @@ -94,7 +94,7 @@ extern "C" { * partial pivoting. The s_mu field holds the upper * bandwidth allocated for A. * ldim - leading dimension (ldim >= s_mu) - * data - pointer to a contiguous block of realtype variables + * data - pointer to a contiguous block of sunrealtype variables * ldata - length of the data array =ldim*(s_mu+ml+1) * cols - array of pointers. cols[j] points to the first element * of the j-th column of the matrix in the array data. @@ -122,9 +122,9 @@ typedef struct _DlsMat { sunindextype mu; sunindextype ml; sunindextype s_mu; - realtype *data; + sunrealtype *data; sunindextype ldata; - realtype **cols; + sunrealtype **cols; } *SUNDlsMat; @@ -141,7 +141,7 @@ typedef struct _DlsMat { * * SUNDLS_DENSE_COL(A,j) references the jth column of the M-by-N dense * matrix A, 0 <= j < N. The type of the expression SUNDLS_DENSE_COL(A,j) - * is (realtype *). After the assignment col_j = SUNDLS_DENSE_COL(A,j), + * is (sunrealtype *). After the assignment col_j = SUNDLS_DENSE_COL(A,j), * col_j may be treated as an array indexed from 0 to M-1. The (i,j)-th * element of A is thus referenced by * col_j[i]. * @@ -161,7 +161,7 @@ typedef struct _DlsMat { * * SUNDLS_BAND_COL(A,j) references the diagonal element of the jth * column of the N by N band matrix A, 0 <= j <= N-1. The type of the - * expression SUNDLS_BAND_COL(A,j) is realtype *. The pointer returned + * expression SUNDLS_BAND_COL(A,j) is sunrealtype *. The pointer returned * by the call SUNDLS_BAND_COL(A,j) can be treated as an array which * is indexed from -(A->mu) to (A->ml). * @@ -267,14 +267,14 @@ sunindextype* SUNDlsMat_NewIndexArray(sunindextype N); * ----------------------------------------------------------------- * Function: SUNDlsMat_NewRealArray * ----------------------------------------------------------------- - * SUNDlsMat_NewRealArray allocates memory an array of N realtype and + * SUNDlsMat_NewRealArray allocates memory an array of N sunrealtype and * returns the pointer to the memory it allocates. If the request for * memory storage cannot be satisfied, it returns NULL. * ----------------------------------------------------------------- */ SUNDIALS_EXPORT -realtype* SUNDlsMat_NewRealArray(sunindextype N); +sunrealtype* SUNDlsMat_NewRealArray(sunindextype N); /* * ----------------------------------------------------------------- @@ -333,20 +333,20 @@ void SUNDlsMat_PrintMat(SUNDlsMat A, FILE *outfile); /* * ================================================================== - * Exported function prototypes (functions working on realtype**) + * Exported function prototypes (functions working on sunrealtype**) * ================================================================== */ SUNDIALS_EXPORT -realtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n); +sunrealtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n); SUNDIALS_EXPORT -realtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, +sunrealtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, sunindextype ml); SUNDIALS_EXPORT -void SUNDlsMat_destroyMat(realtype** a); +void SUNDlsMat_destroyMat(sunrealtype** a); SUNDIALS_EXPORT int* SUNDlsMat_newIntArray(int n); @@ -355,7 +355,7 @@ SUNDIALS_EXPORT sunindextype* SUNDlsMat_newIndexArray(sunindextype n); SUNDIALS_EXPORT -realtype* SUNDlsMat_newRealArray(sunindextype m); +sunrealtype* SUNDlsMat_newRealArray(sunindextype m); SUNDIALS_EXPORT void SUNDlsMat_destroyArray(void* v); diff --git a/include/sundials/sundials_iterative.h b/include/sundials/sundials_iterative.h index ba909df174..2ee1d65a06 100644 --- a/include/sundials/sundials_iterative.h +++ b/include/sundials/sundials_iterative.h @@ -123,7 +123,7 @@ typedef int (*SUNPSetupFn)(void *P_data); */ typedef int (*SUNPSolveFn)(void *P_data, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* * ----------------------------------------------------------------- @@ -132,7 +132,7 @@ typedef int (*SUNPSolveFn)(void *P_data, N_Vector r, N_Vector z, * A QRAddFn updates a given QR factorization defined by the input * parameters: * Q : N_Vector * - * R : realtype * + * R : sunrealtype * * with the input vector * f : N_Vector * @@ -149,7 +149,7 @@ typedef int (*SUNPSolveFn)(void *P_data, N_Vector r, N_Vector z, * ----------------------------------------------------------------- */ -typedef int (*SUNQRAddFn)(N_Vector *Q, realtype *R, N_Vector f, +typedef int (*SUNQRAddFn)(N_Vector *Q, sunrealtype *R, N_Vector f, int m, int mMax, void *QR_data); /* @@ -189,8 +189,8 @@ typedef int (*SUNQRAddFn)(N_Vector *Q, realtype *R, N_Vector f, */ SUNDIALS_EXPORT -int SUNModifiedGS(N_Vector* v, realtype **h, int k, int p, - realtype *new_vk_norm); +int SUNModifiedGS(N_Vector* v, sunrealtype **h, int k, int p, + sunrealtype *new_vk_norm); /* * ----------------------------------------------------------------- @@ -202,7 +202,7 @@ int SUNModifiedGS(N_Vector* v, realtype **h, int k, int p, * k, p, and new_vk_norm are as described in the documentation * for SUNModifiedGS. * - * stemp is a length k+1 array of realtype which can be used as + * stemp is a length k+1 array of sunrealtype which can be used as * workspace by the SUNClassicalGS routine. * * vtemp is an N_Vector array of k+1 vectors which can be used as @@ -213,8 +213,8 @@ int SUNModifiedGS(N_Vector* v, realtype **h, int k, int p, */ SUNDIALS_EXPORT -int SUNClassicalGS(N_Vector* v, realtype **h, int k, int p, - realtype *new_vk_norm, realtype *stemp, +int SUNClassicalGS(N_Vector* v, sunrealtype **h, int k, int p, + sunrealtype *new_vk_norm, sunrealtype *stemp, N_Vector* vtemp); /* @@ -250,7 +250,7 @@ int SUNClassicalGS(N_Vector* v, realtype **h, int k, int p, */ SUNDIALS_EXPORT -int SUNQRfact(int n, realtype **h, realtype *q, int job); +int SUNQRfact(int n, sunrealtype **h, sunrealtype *q, int job); /* * ----------------------------------------------------------------- @@ -285,7 +285,7 @@ int SUNQRfact(int n, realtype **h, realtype *q, int job); */ SUNDIALS_EXPORT -int SUNQRsol(int n, realtype **h, realtype *q, realtype *b); +int SUNQRsol(int n, sunrealtype **h, sunrealtype *q, sunrealtype *b); /* * ----------------------------------------------------------------- @@ -294,7 +294,7 @@ int SUNQRsol(int n, realtype **h, realtype *q, realtype *b); * SUNQRAdd_MGS uses Modified Gram Schmidt to update the QR factorization * stored in user inputs * - N_Vector *Q - * - realtype *R + * - sunrealtype *R * to include the orthonormalized vector input by * - N_Vector df. * @@ -316,7 +316,7 @@ int SUNQRsol(int n, realtype **h, realtype *q, realtype *b); */ SUNDIALS_EXPORT -int SUNQRAdd_MGS(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_MGS(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata); /* @@ -326,8 +326,8 @@ int SUNQRAdd_MGS(N_Vector *Q, realtype *R, N_Vector df, * SUNQRAdd_ICWY uses the Inverse Compact WY Modified Gram Schmidt * method to update the QR factorization stored in user inputs * - N_Vector *Q - * - realtype *R - * - realtype *T (held within (void *) QRdata) + * - sunrealtype *R + * - sunrealtype *T (held within (void *) QRdata) * to include the orthonormalized vector input by * - N_Vector df. * where the factorization to be updated is of the form @@ -344,7 +344,7 @@ int SUNQRAdd_MGS(N_Vector *Q, realtype *R, N_Vector df, * vectors or arrays required for the QRAdd routine * * QRdata should contain : - * N_Vector vtemp, realtype *temp_array (this will be used for T) + * N_Vector vtemp, sunrealtype *temp_array (this will be used for T) * * On return, Q, R, and T contain the updated Q T R factors, if * SUNQRAdd_ICWY was successful. @@ -354,7 +354,7 @@ int SUNQRAdd_MGS(N_Vector *Q, realtype *R, N_Vector df, */ SUNDIALS_EXPORT -int SUNQRAdd_ICWY(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_ICWY(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata); /* @@ -367,7 +367,7 @@ int SUNQRAdd_ICWY(N_Vector *Q, realtype *R, N_Vector df, */ SUNDIALS_EXPORT -int SUNQRAdd_ICWY_SB(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_ICWY_SB(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata); /* @@ -377,7 +377,7 @@ int SUNQRAdd_ICWY_SB(N_Vector *Q, realtype *R, N_Vector df, * SUNQRAdd_CGS2 uses a Classical Gram Schmidt with Reorthogonalization * formulation to update the QR factorization stored in user inputs * - N_Vector *Q - * - realtype *R + * - sunrealtype *R * to include the orthonormalized vector input by * - N_Vector df. * @@ -392,7 +392,7 @@ int SUNQRAdd_ICWY_SB(N_Vector *Q, realtype *R, N_Vector df, * vectors or arrays required for the QRAdd routine * * QRdata should contain : - * N_Vector vtemp, N_Vector vtemp2, realtype *temp_array + * N_Vector vtemp, N_Vector vtemp2, sunrealtype *temp_array * * On return, Q and R contain the updated Q R factors, if * SUNQRAdd_CGS2 was successful. @@ -402,7 +402,7 @@ int SUNQRAdd_ICWY_SB(N_Vector *Q, realtype *R, N_Vector df, */ SUNDIALS_EXPORT -int SUNQRAdd_CGS2(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_CGS2(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata); /* @@ -414,7 +414,7 @@ int SUNQRAdd_CGS2(N_Vector *Q, realtype *R, N_Vector df, * reducing number of inner products) to update the QR factorization * stored in user inputs * - N_Vector *Q - * - realtype *R + * - sunrealtype *R * to include the orthonormalized vector input by * - N_Vector df. * @@ -429,7 +429,7 @@ int SUNQRAdd_CGS2(N_Vector *Q, realtype *R, N_Vector df, * vectors or arrays required for the QRAdd routine * * QRdata should contain : - * N_Vector vtemp, N_Vector vtemp2, realtype *temp_array + * N_Vector vtemp, N_Vector vtemp2, sunrealtype *temp_array * * On return, Q and R contain the updated Q R factors, if * SUNQRAdd_DCGS2 was successful. @@ -439,7 +439,7 @@ int SUNQRAdd_CGS2(N_Vector *Q, realtype *R, N_Vector df, */ SUNDIALS_EXPORT -int SUNQRAdd_DCGS2(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_DCGS2(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata); /* @@ -452,7 +452,7 @@ int SUNQRAdd_DCGS2(N_Vector *Q, realtype *R, N_Vector df, */ SUNDIALS_EXPORT -int SUNQRAdd_DCGS2_SB(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_DCGS2_SB(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata); #ifdef __cplusplus diff --git a/include/sundials/sundials_linearsolver.h b/include/sundials/sundials_linearsolver.h index 198be4372e..0a669937d8 100644 --- a/include/sundials/sundials_linearsolver.h +++ b/include/sundials/sundials_linearsolver.h @@ -117,9 +117,9 @@ struct _generic_SUNLinearSolver_Ops int (*setzeroguess)(SUNLinearSolver, booleantype); int (*initialize)(SUNLinearSolver); int (*setup)(SUNLinearSolver, SUNMatrix); - int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype); + int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, sunrealtype); int (*numiters)(SUNLinearSolver); - realtype (*resnorm)(SUNLinearSolver); + sunrealtype (*resnorm)(SUNLinearSolver); sunindextype (*lastflag)(SUNLinearSolver); int (*space)(SUNLinearSolver, long int*, long int*); N_Vector (*resid)(SUNLinearSolver); @@ -166,11 +166,11 @@ SUNDIALS_EXPORT int SUNLinSolInitialize(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup(SUNLinearSolver S, SUNMatrix A); -SUNDIALS_EXPORT int SUNLinSolSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, realtype tol); +SUNDIALS_EXPORT int SUNLinSolSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT int SUNLinSolNumIters(SUNLinearSolver S); -SUNDIALS_EXPORT realtype SUNLinSolResNorm(SUNLinearSolver S); +SUNDIALS_EXPORT sunrealtype SUNLinSolResNorm(SUNLinearSolver S); SUNDIALS_EXPORT N_Vector SUNLinSolResid(SUNLinearSolver S); diff --git a/include/sundials/sundials_math.h b/include/sundials/sundials_math.h index c0f32b2e98..6186653d94 100644 --- a/include/sundials/sundials_math.h +++ b/include/sundials/sundials_math.h @@ -233,9 +233,9 @@ SUNDIALS_EXPORT booleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunreal * ----------------------------------------------------------------- * Function : SUNStrToReal * ----------------------------------------------------------------- - * Usage : realtype a = SUNStrToReal(const char* str) + * Usage : sunrealtype a = SUNStrToReal(const char* str) * ----------------------------------------------------------------- - * SUNStrToReal parses str into the realtype variable. Uses standard + * SUNStrToReal parses str into the sunrealtype variable. Uses standard * strtod variants when they are available. * ----------------------------------------------------------------- */ diff --git a/include/sundials/sundials_matrix.h b/include/sundials/sundials_matrix.h index a542094ad9..0a99ec7613 100644 --- a/include/sundials/sundials_matrix.h +++ b/include/sundials/sundials_matrix.h @@ -88,8 +88,8 @@ struct _generic_SUNMatrix_Ops void (*destroy)(SUNMatrix); int (*zero)(SUNMatrix); int (*copy)(SUNMatrix, SUNMatrix); - int (*scaleadd)(realtype, SUNMatrix, SUNMatrix); - int (*scaleaddi)(realtype, SUNMatrix); + int (*scaleadd)(sunrealtype, SUNMatrix, SUNMatrix); + int (*scaleaddi)(sunrealtype, SUNMatrix); int (*matvecsetup)(SUNMatrix); int (*matvec)(SUNMatrix, N_Vector, N_Vector); int (*space)(SUNMatrix, long int*, long int*); @@ -123,8 +123,8 @@ SUNDIALS_EXPORT SUNMatrix SUNMatClone(SUNMatrix A); SUNDIALS_EXPORT void SUNMatDestroy(SUNMatrix A); SUNDIALS_EXPORT int SUNMatZero(SUNMatrix A); SUNDIALS_EXPORT int SUNMatCopy(SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAdd(realtype c, SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAddI(realtype c, SUNMatrix A); +SUNDIALS_EXPORT int SUNMatScaleAdd(sunrealtype c, SUNMatrix A, SUNMatrix B); +SUNDIALS_EXPORT int SUNMatScaleAddI(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvecSetup(SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvec(SUNMatrix A, N_Vector x, N_Vector y); SUNDIALS_EXPORT int SUNMatSpace(SUNMatrix A, long int* lenrw, long int* leniw); diff --git a/include/sundials/sundials_nonlinearsolver.h b/include/sundials/sundials_nonlinearsolver.h index 87008b003e..d48373c518 100644 --- a/include/sundials/sundials_nonlinearsolver.h +++ b/include/sundials/sundials_nonlinearsolver.h @@ -75,7 +75,7 @@ typedef int (*SUNNonlinSolLSetupFn)(booleantype jbad, booleantype* jcur, void* m typedef int (*SUNNonlinSolLSolveFn)(N_Vector b, void* mem); -typedef int (*SUNNonlinSolConvTestFn)(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, realtype tol, N_Vector ewt, +typedef int (*SUNNonlinSolConvTestFn)(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* mem); /* ----------------------------------------------------------------------------- @@ -98,7 +98,7 @@ struct _generic_SUNNonlinearSolver_Ops SUNNonlinearSolver_Type (*gettype)(SUNNonlinearSolver); int (*initialize)(SUNNonlinearSolver); int (*setup)(SUNNonlinearSolver, N_Vector, void*); - int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, booleantype, void*); + int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, sunrealtype, booleantype, void*); int (*free)(SUNNonlinearSolver); int (*setsysfn)(SUNNonlinearSolver, SUNNonlinSolSysFn); int (*setlsetupfn)(SUNNonlinearSolver, SUNNonlinSolLSetupFn); @@ -141,7 +141,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSetup(SUNNonlinearSolver NLS, N_Vector y, void* mem); -SUNDIALS_EXPORT int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, realtype tol, +SUNDIALS_EXPORT int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem); SUNDIALS_EXPORT int SUNNonlinSolFree(SUNNonlinearSolver NLS); diff --git a/include/sundials/sundials_nvector.h b/include/sundials/sundials_nvector.h index ab42b5bcf3..f43acc2ce7 100644 --- a/include/sundials/sundials_nvector.h +++ b/include/sundials/sundials_nvector.h @@ -107,33 +107,33 @@ struct _generic_N_Vector_Ops N_Vector (*nvcloneempty)(N_Vector); void (*nvdestroy)(N_Vector); void (*nvspace)(N_Vector, sunindextype*, sunindextype*); - realtype* (*nvgetarraypointer)(N_Vector); - realtype* (*nvgetdevicearraypointer)(N_Vector); - void (*nvsetarraypointer)(realtype*, N_Vector); + sunrealtype* (*nvgetarraypointer)(N_Vector); + sunrealtype* (*nvgetdevicearraypointer)(N_Vector); + void (*nvsetarraypointer)(sunrealtype*, N_Vector); void* (*nvgetcommunicator)(N_Vector); sunindextype (*nvgetlength)(N_Vector); sunindextype (*nvgetlocallength)(N_Vector); /* standard vector operations */ - void (*nvlinearsum)(realtype, N_Vector, realtype, N_Vector, N_Vector); - void (*nvconst)(realtype, N_Vector); + void (*nvlinearsum)(sunrealtype, N_Vector, sunrealtype, N_Vector, N_Vector); + void (*nvconst)(sunrealtype, N_Vector); void (*nvprod)(N_Vector, N_Vector, N_Vector); void (*nvdiv)(N_Vector, N_Vector, N_Vector); - void (*nvscale)(realtype, N_Vector, N_Vector); + void (*nvscale)(sunrealtype, N_Vector, N_Vector); void (*nvabs)(N_Vector, N_Vector); void (*nvinv)(N_Vector, N_Vector); - void (*nvaddconst)(N_Vector, realtype, N_Vector); - realtype (*nvdotprod)(N_Vector, N_Vector); - realtype (*nvmaxnorm)(N_Vector); - realtype (*nvwrmsnorm)(N_Vector, N_Vector); - realtype (*nvwrmsnormmask)(N_Vector, N_Vector, N_Vector); - realtype (*nvmin)(N_Vector); - realtype (*nvwl2norm)(N_Vector, N_Vector); - realtype (*nvl1norm)(N_Vector); - void (*nvcompare)(realtype, N_Vector, N_Vector); + void (*nvaddconst)(N_Vector, sunrealtype, N_Vector); + sunrealtype (*nvdotprod)(N_Vector, N_Vector); + sunrealtype (*nvmaxnorm)(N_Vector); + sunrealtype (*nvwrmsnorm)(N_Vector, N_Vector); + sunrealtype (*nvwrmsnormmask)(N_Vector, N_Vector, N_Vector); + sunrealtype (*nvmin)(N_Vector); + sunrealtype (*nvwl2norm)(N_Vector, N_Vector); + sunrealtype (*nvl1norm)(N_Vector); + void (*nvcompare)(sunrealtype, N_Vector, N_Vector); booleantype (*nvinvtest)(N_Vector, N_Vector); booleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector); - realtype (*nvminquotient)(N_Vector, N_Vector); + sunrealtype (*nvminquotient)(N_Vector, N_Vector); /* * OPTIONAL operations. @@ -142,37 +142,37 @@ struct _generic_N_Vector_Ops */ /* OPTIONAL fused vector operations */ - int (*nvlinearcombination)(int, realtype*, N_Vector*, N_Vector); - int (*nvscaleaddmulti)(int, realtype*, N_Vector, N_Vector*, N_Vector*); - int (*nvdotprodmulti)(int, N_Vector, N_Vector*, realtype*); + int (*nvlinearcombination)(int, sunrealtype*, N_Vector*, N_Vector); + int (*nvscaleaddmulti)(int, sunrealtype*, N_Vector, N_Vector*, N_Vector*); + int (*nvdotprodmulti)(int, N_Vector, N_Vector*, sunrealtype*); /* OPTIONAL vector array operations */ - int (*nvlinearsumvectorarray)(int, realtype, N_Vector*, realtype, N_Vector*, N_Vector*); - int (*nvscalevectorarray)(int, realtype*, N_Vector*, N_Vector*); - int (*nvconstvectorarray)(int, realtype, N_Vector*); - int (*nvwrmsnormvectorarray)(int, N_Vector*, N_Vector*, realtype*); - int (*nvwrmsnormmaskvectorarray)(int, N_Vector*, N_Vector*, N_Vector, realtype*); - int (*nvscaleaddmultivectorarray)(int, int, realtype*, N_Vector*, N_Vector**, N_Vector**); - int (*nvlinearcombinationvectorarray)(int, int, realtype*, N_Vector**, N_Vector*); + int (*nvlinearsumvectorarray)(int, sunrealtype, N_Vector*, sunrealtype, N_Vector*, N_Vector*); + int (*nvscalevectorarray)(int, sunrealtype*, N_Vector*, N_Vector*); + int (*nvconstvectorarray)(int, sunrealtype, N_Vector*); + int (*nvwrmsnormvectorarray)(int, N_Vector*, N_Vector*, sunrealtype*); + int (*nvwrmsnormmaskvectorarray)(int, N_Vector*, N_Vector*, N_Vector, sunrealtype*); + int (*nvscaleaddmultivectorarray)(int, int, sunrealtype*, N_Vector*, N_Vector**, N_Vector**); + int (*nvlinearcombinationvectorarray)(int, int, sunrealtype*, N_Vector**, N_Vector*); /* * OPTIONAL operations with no default implementation. */ /* Local reduction kernels (no parallel communication) */ - realtype (*nvdotprodlocal)(N_Vector, N_Vector); - realtype (*nvmaxnormlocal)(N_Vector); - realtype (*nvminlocal)(N_Vector); - realtype (*nvl1normlocal)(N_Vector); + sunrealtype (*nvdotprodlocal)(N_Vector, N_Vector); + sunrealtype (*nvmaxnormlocal)(N_Vector); + sunrealtype (*nvminlocal)(N_Vector); + sunrealtype (*nvl1normlocal)(N_Vector); booleantype (*nvinvtestlocal)(N_Vector, N_Vector); booleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector); - realtype (*nvminquotientlocal)(N_Vector, N_Vector); - realtype (*nvwsqrsumlocal)(N_Vector, N_Vector); - realtype (*nvwsqrsummasklocal)(N_Vector, N_Vector, N_Vector); + sunrealtype (*nvminquotientlocal)(N_Vector, N_Vector); + sunrealtype (*nvwsqrsumlocal)(N_Vector, N_Vector); + sunrealtype (*nvwsqrsummasklocal)(N_Vector, N_Vector, N_Vector); /* Single buffer reduction operations */ - int (*nvdotprodmultilocal)(int, N_Vector, N_Vector*, realtype*); - int (*nvdotprodmultiallreduce)(int, N_Vector, realtype*); + int (*nvdotprodmultilocal)(int, N_Vector, N_Vector*, sunrealtype*); + int (*nvdotprodmultiallreduce)(int, N_Vector, sunrealtype*); /* XBraid interface operations */ int (*nvbufsize)(N_Vector, sunindextype*); @@ -218,79 +218,79 @@ SUNDIALS_EXPORT N_Vector N_VClone(N_Vector w); SUNDIALS_EXPORT N_Vector N_VCloneEmpty(N_Vector w); SUNDIALS_EXPORT void N_VDestroy(N_Vector v); SUNDIALS_EXPORT void N_VSpace(N_Vector v, sunindextype* lrw, sunindextype* liw); -SUNDIALS_EXPORT realtype* N_VGetArrayPointer(N_Vector v); -SUNDIALS_EXPORT realtype* N_VGetDeviceArrayPointer(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer(realtype* v_data, N_Vector v); +SUNDIALS_EXPORT sunrealtype* N_VGetArrayPointer(N_Vector v); +SUNDIALS_EXPORT sunrealtype* N_VGetDeviceArrayPointer(N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer(sunrealtype* v_data, N_Vector v); SUNDIALS_EXPORT void* N_VGetCommunicator(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLocalLength(N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VLinearSum(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z); +SUNDIALS_EXPORT void N_VConst(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst(N_Vector x, realtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm(N_Vector x); -SUNDIALS_EXPORT void N_VCompare(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VAddConst(N_Vector x, sunrealtype b, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VDotProd(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VMin(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm(N_Vector x); +SUNDIALS_EXPORT void N_VCompare(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotient(N_Vector num, N_Vector denom); /* * OPTIONAL operations with default implementations. */ /* fused vector operations */ -SUNDIALS_EXPORT int N_VLinearCombination(int nvec, realtype* c, N_Vector* X, N_Vector z); +SUNDIALS_EXPORT int N_VLinearCombination(int nvec, sunrealtype* c, N_Vector* X, N_Vector z); -SUNDIALS_EXPORT int N_VScaleAddMulti(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); +SUNDIALS_EXPORT int N_VScaleAddMulti(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VDotProdMulti(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods); +SUNDIALS_EXPORT int N_VDotProdMulti(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods); /* vector array operations */ -SUNDIALS_EXPORT int N_VLinearSumVectorArray(int nvec, realtype a, N_Vector* X, realtype b, N_Vector* Y, N_Vector* Z); +SUNDIALS_EXPORT int N_VLinearSumVectorArray(int nvec, sunrealtype a, N_Vector* X, sunrealtype b, N_Vector* Y, N_Vector* Z); -SUNDIALS_EXPORT int N_VScaleVectorArray(int nvec, realtype* c, N_Vector* X, N_Vector* Z); +SUNDIALS_EXPORT int N_VScaleVectorArray(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z); -SUNDIALS_EXPORT int N_VConstVectorArray(int nvec, realtype c, N_Vector* Z); +SUNDIALS_EXPORT int N_VConstVectorArray(int nvec, sunrealtype c, N_Vector* Z); -SUNDIALS_EXPORT int N_VWrmsNormVectorArray(int nvec, N_Vector* X, N_Vector* W, realtype* nrm); +SUNDIALS_EXPORT int N_VWrmsNormVectorArray(int nvec, N_Vector* X, N_Vector* W, sunrealtype* nrm); -SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray(int nvec, N_Vector* X, N_Vector* W, N_Vector id, realtype* nrm); +SUNDIALS_EXPORT int N_VWrmsNormMaskVectorArray(int nvec, N_Vector* X, N_Vector* W, N_Vector id, sunrealtype* nrm); -SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray(int nvec, int nsum, realtype* a, N_Vector* X, N_Vector** Y, +SUNDIALS_EXPORT int N_VScaleAddMultiVectorArray(int nvec, int nsum, sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z); -SUNDIALS_EXPORT int N_VLinearCombinationVectorArray(int nvec, int nsum, realtype* c, N_Vector** X, N_Vector* Z); +SUNDIALS_EXPORT int N_VLinearCombinationVectorArray(int nvec, int nsum, sunrealtype* c, N_Vector** X, N_Vector* Z); /* * OPTIONAL operations with no default implementation. */ /* local reduction kernels (no parallel communication) */ -SUNDIALS_EXPORT realtype N_VDotProdLocal(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNormLocal(N_Vector x); -SUNDIALS_EXPORT realtype N_VMinLocal(N_Vector x); -SUNDIALS_EXPORT realtype N_VL1NormLocal(N_Vector x); -SUNDIALS_EXPORT realtype N_VWSqrSumLocal(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id); +SUNDIALS_EXPORT sunrealtype N_VDotProdLocal(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNormLocal(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VMinLocal(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VL1NormLocal(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id); SUNDIALS_EXPORT booleantype N_VInvTestLocal(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotientLocal(N_Vector num, N_Vector denom); +SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal(N_Vector num, N_Vector denom); /* single buffer reduction operations */ -SUNDIALS_EXPORT int N_VDotProdMultiLocal(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods); -SUNDIALS_EXPORT int N_VDotProdMultiAllReduce(int nvec_total, N_Vector x, realtype* sum); +SUNDIALS_EXPORT int N_VDotProdMultiLocal(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods); +SUNDIALS_EXPORT int N_VDotProdMultiAllReduce(int nvec_total, N_Vector x, sunrealtype* sum); /* XBraid interface operations */ SUNDIALS_EXPORT int N_VBufSize(N_Vector x, sunindextype* size); diff --git a/include/sundials/sundials_nvector_senswrapper.h b/include/sundials/sundials_nvector_senswrapper.h index ab96a101cc..281ba2591f 100644 --- a/include/sundials/sundials_nvector_senswrapper.h +++ b/include/sundials/sundials_nvector_senswrapper.h @@ -71,30 +71,30 @@ SUNDIALS_EXPORT N_Vector N_VClone_SensWrapper(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_SensWrapper(N_Vector v); /* standard vector operations */ -SUNDIALS_EXPORT void N_VLinearSum_SensWrapper(realtype a, N_Vector x, - realtype b, N_Vector y, +SUNDIALS_EXPORT void N_VLinearSum_SensWrapper(sunrealtype a, N_Vector x, + sunrealtype b, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VConst_SensWrapper(realtype c, N_Vector z); +SUNDIALS_EXPORT void N_VConst_SensWrapper(sunrealtype c, N_Vector z); SUNDIALS_EXPORT void N_VProd_SensWrapper(N_Vector x, N_Vector y, N_Vector z); SUNDIALS_EXPORT void N_VDiv_SensWrapper(N_Vector x, N_Vector y, N_Vector z); -SUNDIALS_EXPORT void N_VScale_SensWrapper(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT void N_VScale_SensWrapper(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VAbs_SensWrapper(N_Vector x, N_Vector z); SUNDIALS_EXPORT void N_VInv_SensWrapper(N_Vector x, N_Vector z); -SUNDIALS_EXPORT void N_VAddConst_SensWrapper(N_Vector x, realtype b, +SUNDIALS_EXPORT void N_VAddConst_SensWrapper(N_Vector x, sunrealtype b, N_Vector z); -SUNDIALS_EXPORT realtype N_VDotProd_SensWrapper(N_Vector x, N_Vector y); -SUNDIALS_EXPORT realtype N_VMaxNorm_SensWrapper(N_Vector x); -SUNDIALS_EXPORT realtype N_VWrmsNorm_SensWrapper(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VWrmsNormMask_SensWrapper(N_Vector x, N_Vector w, +SUNDIALS_EXPORT sunrealtype N_VDotProd_SensWrapper(N_Vector x, N_Vector y); +SUNDIALS_EXPORT sunrealtype N_VMaxNorm_SensWrapper(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWrmsNorm_SensWrapper(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VWrmsNormMask_SensWrapper(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT realtype N_VMin_SensWrapper(N_Vector x); -SUNDIALS_EXPORT realtype N_VWL2Norm_SensWrapper(N_Vector x, N_Vector w); -SUNDIALS_EXPORT realtype N_VL1Norm_SensWrapper(N_Vector x); -SUNDIALS_EXPORT void N_VCompare_SensWrapper(realtype c, N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunrealtype N_VMin_SensWrapper(N_Vector x); +SUNDIALS_EXPORT sunrealtype N_VWL2Norm_SensWrapper(N_Vector x, N_Vector w); +SUNDIALS_EXPORT sunrealtype N_VL1Norm_SensWrapper(N_Vector x); +SUNDIALS_EXPORT void N_VCompare_SensWrapper(sunrealtype c, N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VInvTest_SensWrapper(N_Vector x, N_Vector z); SUNDIALS_EXPORT booleantype N_VConstrMask_SensWrapper(N_Vector c, N_Vector x, N_Vector m); -SUNDIALS_EXPORT realtype N_VMinQuotient_SensWrapper(N_Vector num, +SUNDIALS_EXPORT sunrealtype N_VMinQuotient_SensWrapper(N_Vector num, N_Vector denom); #ifdef __cplusplus diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index 45e2ee839f..e60509088d 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -84,7 +84,7 @@ extern "C" { #if defined(SUNDIALS_SINGLE_PRECISION) /* deprecated */ -typedef float realtype; +typedef float sunrealtype; # define RCONST(x) x##F # define BIG_REAL FLT_MAX # define SMALL_REAL FLT_MIN @@ -99,7 +99,6 @@ typedef float sunrealtype; #elif defined(SUNDIALS_DOUBLE_PRECISION) /* deprecated */ -typedef double realtype; # define RCONST(x) x # define BIG_REAL DBL_MAX # define SMALL_REAL DBL_MIN @@ -114,7 +113,7 @@ typedef double sunrealtype; #elif defined(SUNDIALS_EXTENDED_PRECISION) /* deprecated */ -typedef long double realtype; +typedef long double sunrealtype; # define RCONST(x) x##L # define BIG_REAL LDBL_MAX # define SMALL_REAL LDBL_MIN diff --git a/include/sunlinsol/sunlinsol_band.h b/include/sunlinsol/sunlinsol_band.h index 70f66beea0..fbb76200fb 100644 --- a/include/sunlinsol/sunlinsol_band.h +++ b/include/sunlinsol/sunlinsol_band.h @@ -57,7 +57,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_Band(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolInitialize_Band(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_Band(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_Band(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_Band(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_Band(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunlinsol/sunlinsol_cusolversp_batchqr.h b/include/sunlinsol/sunlinsol_cusolversp_batchqr.h index c71459d71e..8d70dfd02d 100644 --- a/include/sunlinsol/sunlinsol_cusolversp_batchqr.h +++ b/include/sunlinsol/sunlinsol_cusolversp_batchqr.h @@ -81,7 +81,7 @@ SUNDIALS_EXPORT int SUNLinSolSolve_cuSolverSp_batchQR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - realtype tol); + sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_cuSolverSp_batchQR(SUNLinearSolver S); diff --git a/include/sunlinsol/sunlinsol_dense.h b/include/sunlinsol/sunlinsol_dense.h index b386403da5..f46bced8d3 100644 --- a/include/sunlinsol/sunlinsol_dense.h +++ b/include/sunlinsol/sunlinsol_dense.h @@ -18,7 +18,7 @@ * Notes: * - The definition of the generic SUNLinearSolver structure can * be found in the header file sundials_linearsolver.h. - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -61,7 +61,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_Dense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolInitialize_Dense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_Dense(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_Dense(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_Dense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_Dense(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunlinsol/sunlinsol_klu.h b/include/sunlinsol/sunlinsol_klu.h index efb420b7f1..e557479cf5 100644 --- a/include/sunlinsol/sunlinsol_klu.h +++ b/include/sunlinsol/sunlinsol_klu.h @@ -74,7 +74,7 @@ extern "C" { #if defined(SUNDIALS_DOUBLE_PRECISION) #else -#error Incompatible realtype for KLU +#error Incompatible sunrealtype for KLU #endif /* -------------------------------------- @@ -128,7 +128,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_KLU(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolInitialize_KLU(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_KLU(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_KLU(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_KLU(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunlinsol/sunlinsol_lapackband.h b/include/sunlinsol/sunlinsol_lapackband.h index a203a578bd..e2b7bbcb2e 100644 --- a/include/sunlinsol/sunlinsol_lapackband.h +++ b/include/sunlinsol/sunlinsol_lapackband.h @@ -58,7 +58,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_LapackBand(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolInitialize_LapackBand(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_LapackBand(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_LapackBand(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_LapackBand(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_LapackBand(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunlinsol/sunlinsol_lapackdense.h b/include/sunlinsol/sunlinsol_lapackdense.h index a7567cc6dd..00108f1f27 100644 --- a/include/sunlinsol/sunlinsol_lapackdense.h +++ b/include/sunlinsol/sunlinsol_lapackdense.h @@ -58,7 +58,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_LapackDense(SUNLinearSolver S) SUNDIALS_EXPORT int SUNLinSolInitialize_LapackDense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_LapackDense(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_LapackDense(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_LapackDense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_LapackDense(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunlinsol/sunlinsol_magmadense.h b/include/sunlinsol/sunlinsol_magmadense.h index 15885b111e..c101267967 100644 --- a/include/sunlinsol/sunlinsol_magmadense.h +++ b/include/sunlinsol/sunlinsol_magmadense.h @@ -65,7 +65,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_MagmaDense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolInitialize_MagmaDense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_MagmaDense(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_MagmaDense(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_MagmaDense(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_MagmaDense(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunlinsol/sunlinsol_onemkldense.h b/include/sunlinsol/sunlinsol_onemkldense.h index 5f57a3ac20..f75bf87422 100644 --- a/include/sunlinsol/sunlinsol_onemkldense.h +++ b/include/sunlinsol/sunlinsol_onemkldense.h @@ -66,7 +66,7 @@ int SUNLinSolSetup_OneMklDense(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol); + N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_OneMklDense(SUNLinearSolver S); diff --git a/include/sunlinsol/sunlinsol_pcg.h b/include/sunlinsol/sunlinsol_pcg.h index 28e34ae6f9..59b619a8c2 100644 --- a/include/sunlinsol/sunlinsol_pcg.h +++ b/include/sunlinsol/sunlinsol_pcg.h @@ -45,7 +45,7 @@ struct _SUNLinearSolverContent_PCG { int pretype; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; @@ -96,9 +96,9 @@ SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_PCG(SUNLinearSolver S, booleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNMatrix nul); SUNDIALS_EXPORT int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT int SUNLinSolNumIters_PCG(SUNLinearSolver S); -SUNDIALS_EXPORT realtype SUNLinSolResNorm_PCG(SUNLinearSolver S); +SUNDIALS_EXPORT sunrealtype SUNLinSolResNorm_PCG(SUNLinearSolver S); SUNDIALS_EXPORT N_Vector SUNLinSolResid_PCG(SUNLinearSolver S); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_PCG(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_PCG(SUNLinearSolver S, diff --git a/include/sunlinsol/sunlinsol_spbcgs.h b/include/sunlinsol/sunlinsol_spbcgs.h index f2caa1ba06..c3cf699d97 100644 --- a/include/sunlinsol/sunlinsol_spbcgs.h +++ b/include/sunlinsol/sunlinsol_spbcgs.h @@ -49,7 +49,7 @@ struct _SUNLinearSolverContent_SPBCGS { int pretype; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; @@ -103,9 +103,9 @@ SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPBCGS(SUNLinearSolver S, booleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT int SUNLinSolNumIters_SPBCGS(SUNLinearSolver S); -SUNDIALS_EXPORT realtype SUNLinSolResNorm_SPBCGS(SUNLinearSolver S); +SUNDIALS_EXPORT sunrealtype SUNLinSolResNorm_SPBCGS(SUNLinearSolver S); SUNDIALS_EXPORT N_Vector SUNLinSolResid_SPBCGS(SUNLinearSolver S); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_SPBCGS(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_SPBCGS(SUNLinearSolver S, diff --git a/include/sunlinsol/sunlinsol_spfgmr.h b/include/sunlinsol/sunlinsol_spfgmr.h index 39ba18027e..41a8d7ef0e 100644 --- a/include/sunlinsol/sunlinsol_spfgmr.h +++ b/include/sunlinsol/sunlinsol_spfgmr.h @@ -52,7 +52,7 @@ struct _SUNLinearSolverContent_SPFGMR { int max_restarts; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; @@ -65,13 +65,13 @@ struct _SUNLinearSolverContent_SPFGMR { N_Vector s2; N_Vector *V; N_Vector *Z; - realtype **Hes; - realtype *givens; + sunrealtype **Hes; + sunrealtype *givens; N_Vector xcor; - realtype *yg; + sunrealtype *yg; N_Vector vtemp; - realtype *cv; + sunrealtype *cv; N_Vector *Xv; int print_level; @@ -110,9 +110,9 @@ SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPFGMR(SUNLinearSolver S, booleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT int SUNLinSolNumIters_SPFGMR(SUNLinearSolver S); -SUNDIALS_EXPORT realtype SUNLinSolResNorm_SPFGMR(SUNLinearSolver S); +SUNDIALS_EXPORT sunrealtype SUNLinSolResNorm_SPFGMR(SUNLinearSolver S); SUNDIALS_EXPORT N_Vector SUNLinSolResid_SPFGMR(SUNLinearSolver S); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_SPFGMR(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_SPFGMR(SUNLinearSolver S, diff --git a/include/sunlinsol/sunlinsol_spgmr.h b/include/sunlinsol/sunlinsol_spgmr.h index 807556b9a3..a1b7e77378 100644 --- a/include/sunlinsol/sunlinsol_spgmr.h +++ b/include/sunlinsol/sunlinsol_spgmr.h @@ -54,7 +54,7 @@ struct _SUNLinearSolverContent_SPGMR { int max_restarts; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; @@ -66,13 +66,13 @@ struct _SUNLinearSolverContent_SPGMR { N_Vector s1; N_Vector s2; N_Vector *V; - realtype **Hes; - realtype *givens; + sunrealtype **Hes; + sunrealtype *givens; N_Vector xcor; - realtype *yg; + sunrealtype *yg; N_Vector vtemp; - realtype *cv; + sunrealtype *cv; N_Vector *Xv; int print_level; @@ -112,9 +112,9 @@ SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPGMR(SUNLinearSolver S, booleantype onff); SUNDIALS_EXPORT int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT int SUNLinSolNumIters_SPGMR(SUNLinearSolver S); -SUNDIALS_EXPORT realtype SUNLinSolResNorm_SPGMR(SUNLinearSolver S); +SUNDIALS_EXPORT sunrealtype SUNLinSolResNorm_SPGMR(SUNLinearSolver S); SUNDIALS_EXPORT N_Vector SUNLinSolResid_SPGMR(SUNLinearSolver S); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_SPGMR(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_SPGMR(SUNLinearSolver S, diff --git a/include/sunlinsol/sunlinsol_sptfqmr.h b/include/sunlinsol/sunlinsol_sptfqmr.h index 11355d15d9..53e787353c 100644 --- a/include/sunlinsol/sunlinsol_sptfqmr.h +++ b/include/sunlinsol/sunlinsol_sptfqmr.h @@ -47,7 +47,7 @@ struct _SUNLinearSolverContent_SPTFQMR { int pretype; booleantype zeroguess; int numiters; - realtype resnorm; + sunrealtype resnorm; int last_flag; SUNATimesFn ATimes; @@ -103,9 +103,9 @@ SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPTFQMR(SUNLinearSolver S, booleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT int SUNLinSolNumIters_SPTFQMR(SUNLinearSolver S); -SUNDIALS_EXPORT realtype SUNLinSolResNorm_SPTFQMR(SUNLinearSolver S); +SUNDIALS_EXPORT sunrealtype SUNLinSolResNorm_SPTFQMR(SUNLinearSolver S); SUNDIALS_EXPORT N_Vector SUNLinSolResid_SPTFQMR(SUNLinearSolver S); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_SPTFQMR(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_SPTFQMR(SUNLinearSolver S, diff --git a/include/sunlinsol/sunlinsol_superludist.h b/include/sunlinsol/sunlinsol_superludist.h index 5679dd5034..8233609691 100644 --- a/include/sunlinsol/sunlinsol_superludist.h +++ b/include/sunlinsol/sunlinsol_superludist.h @@ -63,7 +63,7 @@ extern "C" { struct _SUNLinearSolverContent_SuperLUDIST { booleantype first_factorize; int last_flag; - realtype berr; + sunrealtype berr; gridinfo_t *grid; xLUstruct_t *lu; superlu_dist_options_t *options; @@ -97,7 +97,7 @@ SUNDIALS_EXPORT SUNLinearSolver SUNLinSol_SuperLUDIST(N_Vector y, SUNMatrix A, * ---------------------------------------------------------------------------- */ -SUNDIALS_EXPORT realtype SUNLinSol_SuperLUDIST_GetBerr(SUNLinearSolver LS); +SUNDIALS_EXPORT sunrealtype SUNLinSol_SuperLUDIST_GetBerr(SUNLinearSolver LS); SUNDIALS_EXPORT gridinfo_t* SUNLinSol_SuperLUDIST_GetGridinfo(SUNLinearSolver LS); SUNDIALS_EXPORT xLUstruct_t* SUNLinSol_SuperLUDIST_GetLUstruct(SUNLinearSolver LS); SUNDIALS_EXPORT superlu_dist_options_t* SUNLinSol_SuperLUDIST_GetSuperLUOptions(SUNLinearSolver LS); @@ -116,7 +116,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_SuperLUDIST(SUNLinearSolver S) SUNDIALS_EXPORT int SUNLinSolInitialize_SuperLUDIST(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SuperLUDIST(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_SuperLUDIST(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_SuperLUDIST(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunlinsol/sunlinsol_superlumt.h b/include/sunlinsol/sunlinsol_superlumt.h index 1885cd8f48..e14033aae2 100644 --- a/include/sunlinsol/sunlinsol_superlumt.h +++ b/include/sunlinsol/sunlinsol_superlumt.h @@ -43,7 +43,7 @@ extern "C" { /* Default SuperLU_MT solver parameters */ #define SUNSLUMT_ORDERING_DEFAULT 3 /* COLAMD */ -/* Interfaces to match 'realtype' with the correct SuperLUMT functions */ +/* Interfaces to match 'sunrealtype' with the correct SuperLUMT functions */ #if defined(SUNDIALS_DOUBLE_PRECISION) #ifndef _SLUMT_H #define _SLUMT_H @@ -65,7 +65,7 @@ extern "C" { #define xCreate_Dense_Matrix sCreate_Dense_Matrix #define xCreate_CompCol_Matrix sCreate_CompCol_Matrix #else /* incompatible sunindextype for SuperLUMT */ -#error Incompatible realtype for SuperLUMT +#error Incompatible sunrealtype for SuperLUMT #endif @@ -81,7 +81,7 @@ struct _SUNLinearSolverContent_SuperLUMT { sunindextype *perm_r, *perm_c; sunindextype N; int num_threads; - realtype diag_pivot_thresh; + sunrealtype diag_pivot_thresh; int ordering; superlumt_options_t *options; }; @@ -104,7 +104,7 @@ SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_SuperLUMT(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolInitialize_SuperLUMT(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSetup_SuperLUMT(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SuperLUMT(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol); + N_Vector x, N_Vector b, sunrealtype tol); SUNDIALS_EXPORT sunindextype SUNLinSolLastFlag_SuperLUMT(SUNLinearSolver S); SUNDIALS_EXPORT int SUNLinSolSpace_SuperLUMT(SUNLinearSolver S, long int *lenrwLS, diff --git a/include/sunmatrix/sunmatrix_band.h b/include/sunmatrix/sunmatrix_band.h index f977e0d969..1955c75d61 100644 --- a/include/sunmatrix/sunmatrix_band.h +++ b/include/sunmatrix/sunmatrix_band.h @@ -20,7 +20,7 @@ * Notes: * - The definition of the generic SUNMatrix structure can be found * in the header file sundials_matrix.h. - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -49,9 +49,9 @@ struct _SUNMatrixContent_Band { sunindextype mu; sunindextype ml; sunindextype s_mu; - realtype *data; + sunrealtype *data; sunindextype ldata; - realtype **cols; + sunrealtype **cols; }; typedef struct _SUNMatrixContent_Band *SUNMatrixContent_Band; @@ -110,17 +110,17 @@ SUNDIALS_EXPORT sunindextype SUNBandMatrix_UpperBandwidth(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNBandMatrix_StoredUpperBandwidth(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNBandMatrix_LDim(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNBandMatrix_LData(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNBandMatrix_Data(SUNMatrix A); -SUNDIALS_EXPORT realtype** SUNBandMatrix_Cols(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j); +SUNDIALS_EXPORT sunrealtype* SUNBandMatrix_Data(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype** SUNBandMatrix_Cols(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j); SUNDIALS_EXPORT SUNMatrix_ID SUNMatGetID_Band(SUNMatrix A); SUNDIALS_EXPORT SUNMatrix SUNMatClone_Band(SUNMatrix A); SUNDIALS_EXPORT void SUNMatDestroy_Band(SUNMatrix A); SUNDIALS_EXPORT int SUNMatZero_Band(SUNMatrix A); SUNDIALS_EXPORT int SUNMatCopy_Band(SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAdd_Band(realtype c, SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAddI_Band(realtype c, SUNMatrix A); +SUNDIALS_EXPORT int SUNMatScaleAdd_Band(sunrealtype c, SUNMatrix A, SUNMatrix B); +SUNDIALS_EXPORT int SUNMatScaleAddI_Band(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvec_Band(SUNMatrix A, N_Vector x, N_Vector y); SUNDIALS_EXPORT int SUNMatSpace_Band(SUNMatrix A, long int *lenrw, long int *leniw); diff --git a/include/sunmatrix/sunmatrix_cusparse.h b/include/sunmatrix/sunmatrix_cusparse.h index fd7c18ee4e..c6ebaa0065 100644 --- a/include/sunmatrix/sunmatrix_cusparse.h +++ b/include/sunmatrix/sunmatrix_cusparse.h @@ -77,7 +77,7 @@ typedef struct _SUNMatrix_Content_cuSparse *SUNMatrix_Content_cuSparse; SUNDIALS_EXPORT SUNMatrix SUNMatrix_cuSparse_NewCSR(int M, int N, int NNZ, cusparseHandle_t cusp, SUNContext sunctx); SUNDIALS_EXPORT SUNMatrix SUNMatrix_cuSparse_MakeCSR(cusparseMatDescr_t mat_descr, int M, int N, int NNZ, - int *rowptrs , int *colind , realtype *data, + int *rowptrs , int *colind , sunrealtype *data, cusparseHandle_t cusp, SUNContext sunctx); /* Creates a CSR block-diagonal matrix where each block shares the same sparsity structure. @@ -97,7 +97,7 @@ SUNDIALS_EXPORT int SUNMatrix_cuSparse_Columns(SUNMatrix A); SUNDIALS_EXPORT int SUNMatrix_cuSparse_NNZ(SUNMatrix A); SUNDIALS_EXPORT int* SUNMatrix_cuSparse_IndexPointers(SUNMatrix A); SUNDIALS_EXPORT int* SUNMatrix_cuSparse_IndexValues(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNMatrix_cuSparse_Data(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype* SUNMatrix_cuSparse_Data(SUNMatrix A); SUNDIALS_EXPORT int SUNMatrix_cuSparse_SetFixedPattern(SUNMatrix A, booleantype yesno); SUNDIALS_EXPORT int SUNMatrix_cuSparse_SetKernelExecPolicy(SUNMatrix A, SUNCudaExecPolicy* exec_policy); @@ -105,11 +105,11 @@ SUNDIALS_EXPORT int SUNMatrix_cuSparse_NumBlocks(SUNMatrix A); SUNDIALS_EXPORT int SUNMatrix_cuSparse_BlockRows(SUNMatrix A); SUNDIALS_EXPORT int SUNMatrix_cuSparse_BlockColumns(SUNMatrix A); SUNDIALS_EXPORT int SUNMatrix_cuSparse_BlockNNZ(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNMatrix_cuSparse_BlockData(SUNMatrix A, int blockidx); +SUNDIALS_EXPORT sunrealtype* SUNMatrix_cuSparse_BlockData(SUNMatrix A, int blockidx); SUNDIALS_EXPORT cusparseMatDescr_t SUNMatrix_cuSparse_MatDescr(SUNMatrix A); -SUNDIALS_EXPORT int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix device, realtype* h_data, +SUNDIALS_EXPORT int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix device, sunrealtype* h_data, int* h_idxptrs, int* h_idxvals); -SUNDIALS_EXPORT int SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix device, realtype* h_data, +SUNDIALS_EXPORT int SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix device, sunrealtype* h_data, int* h_idxptrs, int* h_idxvals); @@ -122,8 +122,8 @@ SUNDIALS_EXPORT SUNMatrix SUNMatClone_cuSparse(SUNMatrix A); SUNDIALS_EXPORT void SUNMatDestroy_cuSparse(SUNMatrix A); SUNDIALS_EXPORT int SUNMatZero_cuSparse(SUNMatrix A); SUNDIALS_EXPORT int SUNMatCopy_cuSparse(SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAdd_cuSparse(realtype c, SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAddI_cuSparse(realtype c, SUNMatrix A); +SUNDIALS_EXPORT int SUNMatScaleAdd_cuSparse(sunrealtype c, SUNMatrix A, SUNMatrix B); +SUNDIALS_EXPORT int SUNMatScaleAddI_cuSparse(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvecSetup_cuSparse(SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvec_cuSparse(SUNMatrix A, N_Vector x, N_Vector y); diff --git a/include/sunmatrix/sunmatrix_dense.h b/include/sunmatrix/sunmatrix_dense.h index 7c16db8c49..e1f427a92b 100644 --- a/include/sunmatrix/sunmatrix_dense.h +++ b/include/sunmatrix/sunmatrix_dense.h @@ -20,7 +20,7 @@ * Notes: * - The definition of the generic SUNMatrix structure can be found * in the header file sundials_matrix.h. - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -45,9 +45,9 @@ extern "C" { struct _SUNMatrixContent_Dense { sunindextype M; sunindextype N; - realtype *data; + sunrealtype *data; sunindextype ldata; - realtype **cols; + sunrealtype **cols; }; typedef struct _SUNMatrixContent_Dense *SUNMatrixContent_Dense; @@ -83,17 +83,17 @@ SUNDIALS_EXPORT void SUNDenseMatrix_Print(SUNMatrix A, FILE* outfile); SUNDIALS_EXPORT sunindextype SUNDenseMatrix_Rows(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNDenseMatrix_Columns(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNDenseMatrix_LData(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNDenseMatrix_Data(SUNMatrix A); -SUNDIALS_EXPORT realtype** SUNDenseMatrix_Cols(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j); +SUNDIALS_EXPORT sunrealtype* SUNDenseMatrix_Data(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype** SUNDenseMatrix_Cols(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j); SUNDIALS_EXPORT SUNMatrix_ID SUNMatGetID_Dense(SUNMatrix A); SUNDIALS_EXPORT SUNMatrix SUNMatClone_Dense(SUNMatrix A); SUNDIALS_EXPORT void SUNMatDestroy_Dense(SUNMatrix A); SUNDIALS_EXPORT int SUNMatZero_Dense(SUNMatrix A); SUNDIALS_EXPORT int SUNMatCopy_Dense(SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAdd_Dense(realtype c, SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAddI_Dense(realtype c, SUNMatrix A); +SUNDIALS_EXPORT int SUNMatScaleAdd_Dense(sunrealtype c, SUNMatrix A, SUNMatrix B); +SUNDIALS_EXPORT int SUNMatScaleAddI_Dense(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvec_Dense(SUNMatrix A, N_Vector x, N_Vector y); SUNDIALS_EXPORT int SUNMatSpace_Dense(SUNMatrix A, long int *lenrw, long int *leniw); diff --git a/include/sunmatrix/sunmatrix_magmadense.h b/include/sunmatrix/sunmatrix_magmadense.h index 762a0b2eb5..25cd946939 100644 --- a/include/sunmatrix/sunmatrix_magmadense.h +++ b/include/sunmatrix/sunmatrix_magmadense.h @@ -63,7 +63,7 @@ SUNDIALS_EXPORT SUNMatrix SUNMatrix_MagmaDenseBlock(sunindextype nblocks, sunind SUNMemoryType memtype, SUNMemoryHelper memhelper, void* queue, SUNContext sunctx); SUNDIALS_EXPORT void SUNMatrix_MagmaDense_Print(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNMatrix_MagmaDense_Data(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype* SUNMatrix_MagmaDense_Data(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNMatrix_MagmaDense_LData(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNMatrix_MagmaDense_Rows(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNMatrix_MagmaDense_Columns(SUNMatrix A); @@ -71,29 +71,29 @@ SUNDIALS_EXPORT sunindextype SUNMatrix_MagmaDense_BlockRows(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNMatrix_MagmaDense_BlockColumns(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNMatrix_MagmaDense_BlockLData(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNMatrix_MagmaDense_NumBlocks(SUNMatrix A); -SUNDIALS_EXPORT realtype** SUNMatrix_MagmaDense_BlockData(SUNMatrix A); -SUNDIALS_EXPORT int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix A, realtype* h_data); -SUNDIALS_EXPORT int SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix A, realtype* h_data); +SUNDIALS_EXPORT sunrealtype** SUNMatrix_MagmaDense_BlockData(SUNMatrix A); +SUNDIALS_EXPORT int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data); +SUNDIALS_EXPORT int SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data); SUNDIALS_STATIC_INLINE -realtype* SUNMatrix_MagmaDense_Block(SUNMatrix Amat, sunindextype k) +sunrealtype* SUNMatrix_MagmaDense_Block(SUNMatrix Amat, sunindextype k) { SUNMatrixContent_MagmaDense A = (SUNMatrixContent_MagmaDense) Amat->content; - return( ((realtype*) A->data->ptr) + k*A->M*A->N ); + return( ((sunrealtype*) A->data->ptr) + k*A->M*A->N ); } SUNDIALS_STATIC_INLINE -realtype* SUNMatrix_MagmaDense_Column(SUNMatrix Amat, sunindextype j) +sunrealtype* SUNMatrix_MagmaDense_Column(SUNMatrix Amat, sunindextype j) { SUNMatrixContent_MagmaDense A = (SUNMatrixContent_MagmaDense) Amat->content; - return( ((realtype*) A->data->ptr) + j*A->M ); + return( ((sunrealtype*) A->data->ptr) + j*A->M ); } SUNDIALS_STATIC_INLINE -realtype* SUNMatrix_MagmaDense_BlockColumn(SUNMatrix Amat, sunindextype k, sunindextype j) +sunrealtype* SUNMatrix_MagmaDense_BlockColumn(SUNMatrix Amat, sunindextype k, sunindextype j) { SUNMatrixContent_MagmaDense A = (SUNMatrixContent_MagmaDense) Amat->content; - return( ((realtype*) A->data->ptr) + k*A->M*A->N + j*A->M ); + return( ((sunrealtype*) A->data->ptr) + k*A->M*A->N + j*A->M ); } @@ -108,8 +108,8 @@ SUNDIALS_EXPORT SUNMatrix SUNMatClone_MagmaDense(SUNMatrix A); SUNDIALS_EXPORT void SUNMatDestroy_MagmaDense(SUNMatrix A); SUNDIALS_EXPORT int SUNMatZero_MagmaDense(SUNMatrix A); SUNDIALS_EXPORT int SUNMatCopy_MagmaDense(SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAdd_MagmaDense(realtype c, SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAddI_MagmaDense(realtype c, SUNMatrix A); +SUNDIALS_EXPORT int SUNMatScaleAdd_MagmaDense(sunrealtype c, SUNMatrix A, SUNMatrix B); +SUNDIALS_EXPORT int SUNMatScaleAddI_MagmaDense(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvecSetup_MagmaDense(SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvec_MagmaDense(SUNMatrix A, N_Vector x, N_Vector y); SUNDIALS_EXPORT int SUNMatSpace_MagmaDense(SUNMatrix A, long int *lenrw, long int *leniw); diff --git a/include/sunmatrix/sunmatrix_onemkldense.h b/include/sunmatrix/sunmatrix_onemkldense.h index e0cbdbdfec..f9b7dae746 100644 --- a/include/sunmatrix/sunmatrix_onemkldense.h +++ b/include/sunmatrix/sunmatrix_onemkldense.h @@ -93,13 +93,13 @@ SUNDIALS_EXPORT sunindextype SUNMatrix_OneMklDense_LData(SUNMatrix A); SUNDIALS_EXPORT -realtype* SUNMatrix_OneMklDense_Data(SUNMatrix A); +sunrealtype* SUNMatrix_OneMklDense_Data(SUNMatrix A); SUNDIALS_STATIC_INLINE -realtype* SUNMatrix_OneMklDense_Column(SUNMatrix Amat, sunindextype j) +sunrealtype* SUNMatrix_OneMklDense_Column(SUNMatrix Amat, sunindextype j) { SUNMatrixContent_OneMklDense A = (SUNMatrixContent_OneMklDense) Amat->content; - return( ((realtype*) A->data->ptr) + j * A->block_rows ); + return( ((sunrealtype*) A->data->ptr) + j * A->block_rows ); } /* Get matrix block data */ @@ -108,31 +108,31 @@ SUNDIALS_EXPORT sunindextype SUNMatrix_OneMklDense_BlockLData(SUNMatrix A); SUNDIALS_EXPORT -realtype** SUNMatrix_OneMklDense_BlockData(SUNMatrix A); +sunrealtype** SUNMatrix_OneMklDense_BlockData(SUNMatrix A); SUNDIALS_STATIC_INLINE -realtype* SUNMatrix_OneMklDense_Block(SUNMatrix Amat, sunindextype k) +sunrealtype* SUNMatrix_OneMklDense_Block(SUNMatrix Amat, sunindextype k) { SUNMatrixContent_OneMklDense A = (SUNMatrixContent_OneMklDense) Amat->content; - return( ((realtype*) A->data->ptr) + k * A->block_rows * A->block_cols ); + return( ((sunrealtype*) A->data->ptr) + k * A->block_rows * A->block_cols ); } SUNDIALS_STATIC_INLINE -realtype* SUNMatrix_OneMklDense_BlockColumn(SUNMatrix Amat, sunindextype k, +sunrealtype* SUNMatrix_OneMklDense_BlockColumn(SUNMatrix Amat, sunindextype k, sunindextype j) { SUNMatrixContent_OneMklDense A = (SUNMatrixContent_OneMklDense) Amat->content; - return( ((realtype*) A->data->ptr) + + return( ((sunrealtype*) A->data->ptr) + k * A->block_rows * A->block_cols + j * A->block_rows ); } /* Copy data */ SUNDIALS_EXPORT -int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, realtype* h_data); +int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data); SUNDIALS_EXPORT -int SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, realtype* h_data); +int SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data); /* --------------------------------------------------------------------------- * SUNMatrix API functions @@ -154,10 +154,10 @@ SUNDIALS_EXPORT int SUNMatCopy_OneMklDense(SUNMatrix A, SUNMatrix B); SUNDIALS_EXPORT -int SUNMatScaleAdd_OneMklDense(realtype c, SUNMatrix A, SUNMatrix B); +int SUNMatScaleAdd_OneMklDense(sunrealtype c, SUNMatrix A, SUNMatrix B); SUNDIALS_EXPORT -int SUNMatScaleAddI_OneMklDense(realtype c, SUNMatrix A); +int SUNMatScaleAddI_OneMklDense(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvecSetup_OneMklDense(SUNMatrix A); diff --git a/include/sunmatrix/sunmatrix_slunrloc.h b/include/sunmatrix/sunmatrix_slunrloc.h index 077da98e4c..df2fdb4cee 100644 --- a/include/sunmatrix/sunmatrix_slunrloc.h +++ b/include/sunmatrix/sunmatrix_slunrloc.h @@ -73,8 +73,8 @@ SUNDIALS_EXPORT SUNMatrix SUNMatClone_SLUNRloc(SUNMatrix A); SUNDIALS_EXPORT void SUNMatDestroy_SLUNRloc(SUNMatrix A); SUNDIALS_EXPORT int SUNMatZero_SLUNRloc(SUNMatrix A); SUNDIALS_EXPORT int SUNMatCopy_SLUNRloc(SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAdd_SLUNRloc(realtype c, SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAddI_SLUNRloc(realtype c, SUNMatrix A); +SUNDIALS_EXPORT int SUNMatScaleAdd_SLUNRloc(sunrealtype c, SUNMatrix A, SUNMatrix B); +SUNDIALS_EXPORT int SUNMatScaleAddI_SLUNRloc(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvecSetup_SLUNRloc(SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvec_SLUNRloc(SUNMatrix A, N_Vector x, N_Vector y); SUNDIALS_EXPORT int SUNMatSpace_SLUNRloc(SUNMatrix A, long int *lenrw, long int *leniw); diff --git a/include/sunmatrix/sunmatrix_sparse.h b/include/sunmatrix/sunmatrix_sparse.h index ac0eef10ce..a7a299a93c 100644 --- a/include/sunmatrix/sunmatrix_sparse.h +++ b/include/sunmatrix/sunmatrix_sparse.h @@ -21,7 +21,7 @@ * Notes: * - The definition of the generic SUNMatrix structure can be found * in the header file sundials_matrix.h. - * - The definition of the type 'realtype' can be found in the + * - The definition of the type 'sunrealtype' can be found in the * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition @@ -58,7 +58,7 @@ struct _SUNMatrixContent_Sparse { sunindextype N; sunindextype NNZ; sunindextype NP; - realtype *data; + sunrealtype *data; int sparsetype; sunindextype *indexvals; sunindextype *indexptrs; @@ -104,11 +104,11 @@ SUNDIALS_EXPORT SUNMatrix SUNSparseMatrix(sunindextype M, sunindextype N, SUNContext sunctx); SUNDIALS_EXPORT SUNMatrix SUNSparseFromDenseMatrix(SUNMatrix A, - realtype droptol, + sunrealtype droptol, int sparsetype); SUNDIALS_EXPORT SUNMatrix SUNSparseFromBandMatrix(SUNMatrix A, - realtype droptol, + sunrealtype droptol, int sparsetype); SUNDIALS_EXPORT int SUNSparseMatrix_ToCSR(const SUNMatrix A, SUNMatrix* Bout); @@ -125,7 +125,7 @@ SUNDIALS_EXPORT sunindextype SUNSparseMatrix_Columns(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNSparseMatrix_NNZ(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNSparseMatrix_NP(SUNMatrix A); SUNDIALS_EXPORT int SUNSparseMatrix_SparseType(SUNMatrix A); -SUNDIALS_EXPORT realtype* SUNSparseMatrix_Data(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype* SUNSparseMatrix_Data(SUNMatrix A); SUNDIALS_EXPORT sunindextype* SUNSparseMatrix_IndexValues(SUNMatrix A); SUNDIALS_EXPORT sunindextype* SUNSparseMatrix_IndexPointers(SUNMatrix A); @@ -134,8 +134,8 @@ SUNDIALS_EXPORT SUNMatrix SUNMatClone_Sparse(SUNMatrix A); SUNDIALS_EXPORT void SUNMatDestroy_Sparse(SUNMatrix A); SUNDIALS_EXPORT int SUNMatZero_Sparse(SUNMatrix A); SUNDIALS_EXPORT int SUNMatCopy_Sparse(SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAdd_Sparse(realtype c, SUNMatrix A, SUNMatrix B); -SUNDIALS_EXPORT int SUNMatScaleAddI_Sparse(realtype c, SUNMatrix A); +SUNDIALS_EXPORT int SUNMatScaleAdd_Sparse(sunrealtype c, SUNMatrix A, SUNMatrix B); +SUNDIALS_EXPORT int SUNMatScaleAddI_Sparse(sunrealtype c, SUNMatrix A); SUNDIALS_EXPORT int SUNMatMatvec_Sparse(SUNMatrix A, N_Vector x, N_Vector y); SUNDIALS_EXPORT int SUNMatSpace_Sparse(SUNMatrix A, long int *lenrw, long int *leniw); diff --git a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h index caaea50c20..73ed985bf9 100644 --- a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h +++ b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h @@ -44,10 +44,10 @@ struct _SUNNonlinearSolverContent_FixedPoint { int m; /* number of acceleration vectors to use */ int *imap; /* array of length m */ booleantype damping; /* flag to apply dampling in acceleration */ - realtype beta; /* damping paramter */ - realtype *R; /* array of length m*m */ - realtype *gamma; /* array of length m */ - realtype *cvals; /* array of length m+1 for fused vector op */ + sunrealtype beta; /* damping paramter */ + sunrealtype *R; /* array of length m*m */ + sunrealtype *gamma; /* array of length m */ + sunrealtype *cvals; /* array of length m+1 for fused vector op */ N_Vector *df; /* vector array of length m */ N_Vector *dg; /* vector array of length m */ N_Vector *q; /* vector array of length m */ @@ -90,7 +90,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize_FixedPoint(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callSetup, void *mem); SUNDIALS_EXPORT int SUNNonlinSolFree_FixedPoint(SUNNonlinearSolver NLS); @@ -107,7 +107,7 @@ SUNDIALS_EXPORT int SUNNonlinSolSetMaxIters_FixedPoint(SUNNonlinearSolver NLS, int maxiters); SUNDIALS_EXPORT int SUNNonlinSolSetDamping_FixedPoint(SUNNonlinearSolver NLS, - realtype beta); + sunrealtype beta); /* get functions */ SUNDIALS_EXPORT int SUNNonlinSolGetNumIters_FixedPoint(SUNNonlinearSolver NLS, diff --git a/include/sunnonlinsol/sunnonlinsol_newton.h b/include/sunnonlinsol/sunnonlinsol_newton.h index d6bbe89d4f..a009b900ca 100644 --- a/include/sunnonlinsol/sunnonlinsol_newton.h +++ b/include/sunnonlinsol/sunnonlinsol_newton.h @@ -78,7 +78,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize_Newton(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void *mem); SUNDIALS_EXPORT int SUNNonlinSolFree_Newton(SUNNonlinearSolver NLS); diff --git a/include/sunnonlinsol/sunnonlinsol_petscsnes.h b/include/sunnonlinsol/sunnonlinsol_petscsnes.h index 6fcea929f4..00cae2bf7a 100644 --- a/include/sunnonlinsol/sunnonlinsol_petscsnes.h +++ b/include/sunnonlinsol/sunnonlinsol_petscsnes.h @@ -68,7 +68,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize_PetscSNES(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSolve_PetscSNES(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem); SUNDIALS_EXPORT int SUNNonlinSolSetSysFn_PetscSNES(SUNNonlinearSolver NLS, diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 601abca7ae..54c25d81ef 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -204,8 +204,8 @@ ARKodeMem arkCreate(SUNContext sunctx) The return value is ARK_SUCCESS = 0 if no errors occurred, or a negative value otherwise. ---------------------------------------------------------------*/ -int arkResize(ARKodeMem ark_mem, N_Vector y0, realtype hscale, - realtype t0, ARKVecResizeFn resize, void *resize_data) +int arkResize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void *resize_data) { booleantype resizeOK; sunindextype lrw1, liw1, lrw_diff, liw_diff; @@ -318,7 +318,7 @@ int arkResize(ARKodeMem ark_mem, N_Vector y0, realtype hscale, arkWFtolerances specifies a user-provides function (of type ARKEwtFn) which will be called to set the error weight vector. ---------------------------------------------------------------*/ -int arkSStolerances(ARKodeMem ark_mem, realtype reltol, realtype abstol) +int arkSStolerances(ARKodeMem ark_mem, sunrealtype reltol, sunrealtype abstol) { /* Check inputs */ if (ark_mem==NULL) { @@ -359,10 +359,10 @@ int arkSStolerances(ARKodeMem ark_mem, realtype reltol, realtype abstol) } -int arkSVtolerances(ARKodeMem ark_mem, realtype reltol, N_Vector abstol) +int arkSVtolerances(ARKodeMem ark_mem, sunrealtype reltol, N_Vector abstol) { /* local variables */ - realtype abstolmin; + sunrealtype abstolmin; /* Check inputs */ if (ark_mem==NULL) { @@ -467,7 +467,7 @@ int arkWFtolerances(ARKodeMem ark_mem, ARKEwtFn efun) type ARKRwtFn) which will be called to set the residual weight vector. ---------------------------------------------------------------*/ -int arkResStolerance(ARKodeMem ark_mem, realtype rabstol) +int arkResStolerance(ARKodeMem ark_mem, sunrealtype rabstol) { /* Check inputs */ if (ark_mem==NULL) { @@ -516,7 +516,7 @@ int arkResStolerance(ARKodeMem ark_mem, realtype rabstol) int arkResVtolerance(ARKodeMem ark_mem, N_Vector rabstol) { /* local variables */ - realtype rabstolmin; + sunrealtype rabstolmin; /* Check inputs */ if (ark_mem==NULL) { @@ -638,15 +638,15 @@ int arkResFtolerance(ARKodeMem ark_mem, ARKRwtFn rfun) exactly the specified stop time, and hence interpolation of y(tout) is not required. ---------------------------------------------------------------*/ -int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, - realtype *tret, int itask) +int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask) { long int nstloc; int retval, kflag, istate, ir; int ewtsetOK; - realtype troundoff, nrm; + sunrealtype troundoff, nrm; booleantype inactive_roots; - realtype dsm; + sunrealtype dsm; int nflag, attempts, ncf, nef, constrfails; int relax_fails; @@ -1043,9 +1043,9 @@ int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, updated to correspond with the end time of the last successful step. ---------------------------------------------------------------*/ -int arkGetDky(ARKodeMem ark_mem, realtype t, int k, N_Vector dky) +int arkGetDky(ARKodeMem ark_mem, sunrealtype t, int k, N_Vector dky) { - realtype s, tfuzz, tp, tn1; + sunrealtype s, tfuzz, tp, tn1; int retval; /* Check all inputs for legality */ @@ -1243,7 +1243,7 @@ void arkErrHandler(int error_code, const char *module, initialization type indicates if the values of internal counters should be reinitialized (FIRST_INIT) or retained (RESET_INIT). ---------------------------------------------------------------*/ -int arkInit(ARKodeMem ark_mem, realtype t0, N_Vector y0, +int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) { booleantype stepperOK, nvectorOK, allocOK; @@ -1834,10 +1834,10 @@ void arkFreeVectors(ARKodeMem ark_mem) - checks for approach to tstop - checks for root near t0 ---------------------------------------------------------------*/ -int arkInitialSetup(ARKodeMem ark_mem, realtype tout) +int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) { int retval, hflag, istate; - realtype tout_hin, rh, htmp; + sunrealtype tout_hin, rh, htmp; booleantype conOK; /* Set up the time stepper module */ @@ -2031,11 +2031,11 @@ int arkInitialSetup(ARKodeMem ark_mem, realtype tout) - check if we are close to tstop (adjust step size if needed) ---------------------------------------------------------------*/ -int arkStopTests(ARKodeMem ark_mem, realtype tout, N_Vector yout, - realtype *tret, int itask, int *ier) +int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask, int *ier) { int irfndp, retval; - realtype troundoff; + sunrealtype troundoff; /* Estimate an infinitesimal time interval to be used as a roundoff for time quantities (based on current time @@ -2217,11 +2217,11 @@ int arkStopTests(ARKodeMem ark_mem, realtype tout, N_Vector yout, Finally, we apply a bias (0.5) and verify that h0 is within bounds. ---------------------------------------------------------------*/ -int arkHin(ARKodeMem ark_mem, realtype tout) +int arkHin(ARKodeMem ark_mem, sunrealtype tout) { int retval, sign, count1, count2; - realtype tdiff, tdist, tround, hlb, hub; - realtype hg, hgs, hs, hnew, hrat, h0, yddnrm; + sunrealtype tdiff, tdist, tround, hlb, hub; + sunrealtype hg, hgs, hs, hnew, hrat, h0, yddnrm; booleantype hgOK; /* If tout is too close to tn, give up */ @@ -2316,9 +2316,9 @@ int arkHin(ARKodeMem ark_mem, realtype tout) This routine sets an upper bound on abs(h0) based on tdist = tn - t0 and the values of y[i]/y'[i]. ---------------------------------------------------------------*/ -realtype arkUpperBoundH0(ARKodeMem ark_mem, realtype tdist) +sunrealtype arkUpperBoundH0(ARKodeMem ark_mem, sunrealtype tdist) { - realtype hub_inv, hub; + sunrealtype hub_inv, hub; N_Vector temp1, temp2; /* Bound based on |y0|/|y0'| -- allow at most an increase of @@ -2354,7 +2354,7 @@ realtype arkUpperBoundH0(ARKodeMem ark_mem, realtype tdist) This routine computes an estimate of the second derivative of y using a difference quotient, and returns its WRMS norm. ---------------------------------------------------------------*/ -int arkYddNorm(ARKodeMem ark_mem, realtype hg, realtype *yddnrm) +int arkYddNorm(ARKodeMem ark_mem, sunrealtype hg, sunrealtype *yddnrm) { int retval; @@ -2397,10 +2397,10 @@ int arkYddNorm(ARKodeMem ark_mem, realtype hg, realtype *yddnrm) and tnew, allow for user-provided postprocessing, and update the interpolation structure. ---------------------------------------------------------------*/ -int arkCompleteStep(ARKodeMem ark_mem, realtype dsm) +int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm) { int retval, mode; - realtype troundoff; + sunrealtype troundoff; /* Set current time to the end of the step (in case the last stage time does not coincide with the step solution time). @@ -2720,7 +2720,7 @@ int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight) /*--------------------------------------------------------------- arkExpStab is the default explicit stability estimation function ---------------------------------------------------------------*/ -int arkExpStab(N_Vector y, realtype t, realtype *hstab, void *data) +int arkExpStab(N_Vector y, sunrealtype t, sunrealtype *hstab, void *data) { /* explicit stability not used by default, set to zero to disable */ @@ -2738,7 +2738,7 @@ int arkExpStab(N_Vector y, realtype t, realtype *hstab, void *data) highest-degree interpolant supported by the module (stored in the interpolation module). ---------------------------------------------------------------*/ -int arkPredict_MaximumOrder(ARKodeMem ark_mem, realtype tau, N_Vector yguess) +int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { /* verify that ark_mem and interpolation structure are provided */ @@ -2769,11 +2769,11 @@ int arkPredict_MaximumOrder(ARKodeMem ark_mem, realtype tau, N_Vector yguess) interpolant is based on the level of extrapolation outside the preceding time step. ---------------------------------------------------------------*/ -int arkPredict_VariableOrder(ARKodeMem ark_mem, realtype tau, N_Vector yguess) +int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { int ord; - realtype tau_tol = 0.5; - realtype tau_tol2 = 0.75; + sunrealtype tau_tol = 0.5; + sunrealtype tau_tol2 = 0.75; /* verify that ark_mem and interpolation structure are provided */ if (ark_mem == NULL) { @@ -2813,10 +2813,10 @@ int arkPredict_VariableOrder(ARKodeMem ark_mem, realtype tau, N_Vector yguess) polynomial available (stored in the interpolation module structure); otherwise it uses a linear polynomial. ---------------------------------------------------------------*/ -int arkPredict_CutoffOrder(ARKodeMem ark_mem, realtype tau, N_Vector yguess) +int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { int ord; - realtype tau_tol = 0.5; + sunrealtype tau_tol = 0.5; /* verify that ark_mem and interpolation structure are provided */ if (ark_mem == NULL) { @@ -2857,11 +2857,11 @@ int arkPredict_CutoffOrder(ARKodeMem ark_mem, realtype tau, N_Vector yguess) i.e. the inputs cvals[0:nvec-1] and Xvecs[0:nvec-1] may be combined to form f(t_n+hj,z_j). ---------------------------------------------------------------*/ -int arkPredict_Bootstrap(ARKodeMem ark_mem, realtype hj, - realtype tau, int nvec, realtype *cvals, +int arkPredict_Bootstrap(ARKodeMem ark_mem, sunrealtype hj, + sunrealtype tau, int nvec, sunrealtype *cvals, N_Vector *Xvecs, N_Vector yguess) { - realtype a0, a1, a2; + sunrealtype a0, a1, a2; int i, retval; /* verify that ark_mem and interpolation structure are provided */ @@ -3027,10 +3027,10 @@ int arkCheckConstraints(ARKodeMem ark_mem, int *constrfails, int *nflag) - otherwise: set *nflagPtr to PREV_ERR_FAIL, and return TRY_AGAIN. --------------------------------------------------------------*/ -int arkCheckTemporalError(ARKodeMem ark_mem, int *nflagPtr, int *nefPtr, realtype dsm) +int arkCheckTemporalError(ARKodeMem ark_mem, int *nflagPtr, int *nefPtr, sunrealtype dsm) { int retval; - realtype ttmp; + sunrealtype ttmp; long int nsttmp; ARKodeHAdaptMem hadapt_mem; diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 617681e9f5..da6003f407 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -107,11 +107,11 @@ void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE *outfile) data structure. ---------------------------------------------------------------*/ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, - N_Vector ycur, realtype tcur, realtype hcur, - realtype dsm, long int nst) + N_Vector ycur, sunrealtype tcur, sunrealtype hcur, + sunrealtype dsm, long int nst) { int ier, k; - realtype ecur, h_acc, h_cfl, int_dir; + sunrealtype ecur, h_acc, h_cfl, int_dir; ARKodeMem ark_mem; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", @@ -260,10 +260,10 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, /*--------------------------------------------------------------- arkAdaptPID implements a PID time step control algorithm. ---------------------------------------------------------------*/ -int arkAdaptPID(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, - realtype ecur, realtype *hnew) +int arkAdaptPID(ARKodeHAdaptMem hadapt_mem, int k, sunrealtype hcur, + sunrealtype ecur, sunrealtype *hnew) { - realtype k1, k2, k3, e1, e2, e3, h_acc; + sunrealtype k1, k2, k3, e1, e2, e3, h_acc; /* set usable time-step adaptivity parameters */ k1 = -hadapt_mem->k1 / k; @@ -284,10 +284,10 @@ int arkAdaptPID(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, /*--------------------------------------------------------------- arkAdaptPI implements a PI time step control algorithm. ---------------------------------------------------------------*/ -int arkAdaptPI(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, - realtype ecur, realtype *hnew) +int arkAdaptPI(ARKodeHAdaptMem hadapt_mem, int k, sunrealtype hcur, + sunrealtype ecur, sunrealtype *hnew) { - realtype k1, k2, e1, e2, h_acc; + sunrealtype k1, k2, e1, e2, h_acc; /* set usable time-step adaptivity parameters */ k1 = -hadapt_mem->k1 / k; @@ -306,10 +306,10 @@ int arkAdaptPI(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, /*--------------------------------------------------------------- arkAdaptI implements an I time step control algorithm. ---------------------------------------------------------------*/ -int arkAdaptI(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, - realtype ecur, realtype *hnew) +int arkAdaptI(ARKodeHAdaptMem hadapt_mem, int k, sunrealtype hcur, + sunrealtype ecur, sunrealtype *hnew) { - realtype k1, e1, h_acc; + sunrealtype k1, e1, h_acc; /* set usable time-step adaptivity parameters */ k1 = -hadapt_mem->k1 / k; @@ -328,9 +328,9 @@ int arkAdaptI(ARKodeHAdaptMem hadapt_mem, int k, realtype hcur, control algorithm. ---------------------------------------------------------------*/ int arkAdaptExpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew) + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew) { - realtype k1, k2, e1, e2, h_acc; + sunrealtype k1, k2, e1, e2, h_acc; /* modified method for first step */ if (nst < 2) { @@ -360,9 +360,9 @@ int arkAdaptExpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, control algorithm. ---------------------------------------------------------------*/ int arkAdaptImpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew) + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew) { - realtype k1, k2, e1, e2, hrat, h_acc; + sunrealtype k1, k2, e1, e2, hrat, h_acc; /* modified method for first step */ if (nst < 2) { @@ -393,9 +393,9 @@ int arkAdaptImpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, Gustafsson time step control algorithm. ---------------------------------------------------------------*/ int arkAdaptImExGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew) + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew) { - realtype k1, k2, k3, e1, e2, hrat, h_acc; + sunrealtype k1, k2, k3, e1, e2, hrat, h_acc; /* modified method for first step */ if (nst < 2) { diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index 5cdd3d2e58..215666d7ea 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -79,16 +79,16 @@ extern "C" { ---------------------------------------------------------------*/ typedef struct ARKodeHAdaptMemRec { - realtype etamax; /* eta <= etamax */ - realtype etamx1; /* max step size change on first step */ - realtype etamxf; /* h reduction factor on multiple error fails */ - realtype etamin; /* eta >= etamin on error test fail */ + sunrealtype etamax; /* eta <= etamax */ + sunrealtype etamx1; /* max step size change on first step */ + sunrealtype etamxf; /* h reduction factor on multiple error fails */ + sunrealtype etamin; /* eta >= etamin on error test fail */ int small_nef; /* bound to determine 'multiple' above */ - realtype etacf; /* h reduction factor on nonlinear conv fail */ + sunrealtype etacf; /* h reduction factor on nonlinear conv fail */ ARKAdaptFn HAdapt; /* function to set the new time step size */ void *HAdapt_data; /* user pointer passed to hadapt */ - realtype ehist[2]; /* error history for time adaptivity */ - realtype hhist[2]; /* step history for time adaptivity */ + sunrealtype ehist[2]; /* error history for time adaptivity */ + sunrealtype hhist[2]; /* step history for time adaptivity */ int imethod; /* step adaptivity method to use: -1 -> User-specified function above 0 -> PID controller @@ -97,15 +97,15 @@ typedef struct ARKodeHAdaptMemRec { 3 -> explicit Gustafsson controller 4 -> implicit Gustafsson controller 5 -> imex Gustafsson controller */ - realtype cfl; /* cfl safety factor */ - realtype safety; /* accuracy safety factor on h */ - realtype bias; /* accuracy safety factor on LTE */ - realtype growth; /* maximum step growth safety factor */ - realtype lbound; /* eta lower bound to leave h unchanged */ - realtype ubound; /* eta upper bound to leave h unchanged */ - realtype k1; /* method-specific adaptivity parameters */ - realtype k2; - realtype k3; + sunrealtype cfl; /* cfl safety factor */ + sunrealtype safety; /* accuracy safety factor on h */ + sunrealtype bias; /* accuracy safety factor on LTE */ + sunrealtype growth; /* maximum step growth safety factor */ + sunrealtype lbound; /* eta lower bound to leave h unchanged */ + sunrealtype ubound; /* eta upper bound to leave h unchanged */ + sunrealtype k1; /* method-specific adaptivity parameters */ + sunrealtype k2; + sunrealtype k3; int q; /* method order */ int p; /* embedding order */ booleantype pq; /* choice of using p (0) vs q (1) */ @@ -126,20 +126,20 @@ typedef struct ARKodeHAdaptMemRec { ARKodeHAdaptMem arkAdaptInit(); void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE *outfile); int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, - N_Vector ycur, realtype tcur, realtype hcur, - realtype dsm, long int nst); + N_Vector ycur, sunrealtype tcur, sunrealtype hcur, + sunrealtype dsm, long int nst); int arkAdaptPID(ARKodeHAdaptMem hadapt_mem, int k, - realtype hcur, realtype ecur, realtype *hnew); + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew); int arkAdaptPI(ARKodeHAdaptMem hadapt_mem, int k, - realtype hcur, realtype ecur, realtype *hnew); + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew); int arkAdaptI(ARKodeHAdaptMem hadapt_mem, int k, - realtype hcur, realtype ecur, realtype *hnew); + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew); int arkAdaptExpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew); + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew); int arkAdaptImpGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew); + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew); int arkAdaptImExGus(ARKodeHAdaptMem hadapt_mem, int k, long int nst, - realtype hcur, realtype ecur, realtype *hnew); + sunrealtype hcur, sunrealtype ecur, sunrealtype *hnew); #ifdef __cplusplus diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 2bedd445eb..8c4f132e3e 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -31,7 +31,7 @@ ARKStep Exported functions -- Required ===============================================================*/ -void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, realtype t0, N_Vector y0, +void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, SUNContext sunctx) { ARKodeMem ark_mem; @@ -211,8 +211,8 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, realtype t0, N_Vector y0, It first resizes the main ARKODE infrastructure memory, and then resizes its own data. ---------------------------------------------------------------*/ -int ARKStepResize(void *arkode_mem, N_Vector y0, realtype hscale, - realtype t0, ARKVecResizeFn resize, void *resize_data) +int ARKStepResize(void *arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void *resize_data) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -336,7 +336,7 @@ int ARKStepResize(void *arkode_mem, N_Vector y0, realtype hscale, Note all internal counters are set to 0 on re-initialization. ---------------------------------------------------------------*/ int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, - ARKRhsFn fi, realtype t0, N_Vector y0) + ARKRhsFn fi, sunrealtype t0, N_Vector y0) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -404,7 +404,7 @@ int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, problem from the given time with the input state (all counter values are retained). ---------------------------------------------------------------*/ -int ARKStepReset(void* arkode_mem, realtype tR, N_Vector yR) +int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -435,7 +435,7 @@ int ARKStepReset(void* arkode_mem, realtype tR, N_Vector yR) These routines set integration tolerances (wrappers for general ARKODE utility routines) ---------------------------------------------------------------*/ -int ARKStepSStolerances(void *arkode_mem, realtype reltol, realtype abstol) +int ARKStepSStolerances(void *arkode_mem, sunrealtype reltol, sunrealtype abstol) { /* unpack ark_mem, call arkSStolerances, and return */ ARKodeMem ark_mem; @@ -448,7 +448,7 @@ int ARKStepSStolerances(void *arkode_mem, realtype reltol, realtype abstol) return(arkSStolerances(ark_mem, reltol, abstol)); } -int ARKStepSVtolerances(void *arkode_mem, realtype reltol, N_Vector abstol) +int ARKStepSVtolerances(void *arkode_mem, sunrealtype reltol, N_Vector abstol) { /* unpack ark_mem, call arkSVtolerances, and return */ ARKodeMem ark_mem; @@ -474,7 +474,7 @@ int ARKStepWFtolerances(void *arkode_mem, ARKEwtFn efun) return(arkWFtolerances(ark_mem, efun)); } -int ARKStepResStolerance(void *arkode_mem, realtype rabstol) +int ARKStepResStolerance(void *arkode_mem, sunrealtype rabstol) { /* unpack ark_mem, call arkResStolerance, and return */ ARKodeMem ark_mem; @@ -540,8 +540,8 @@ int ARKStepRootInit(void *arkode_mem, int nrtfn, ARKRootFn g) This is the main time-integration driver (wrappers for general ARKODE utility routine) ---------------------------------------------------------------*/ -int ARKStepEvolve(void *arkode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask) +int ARKStepEvolve(void *arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask) { /* unpack ark_mem, call arkEvolve, and return */ int retval; @@ -566,7 +566,7 @@ int ARKStepEvolve(void *arkode_mem, realtype tout, N_Vector yout, derivatives over the most-recently-computed step (wrapper for generic ARKODE utility routine) ---------------------------------------------------------------*/ -int ARKStepGetDky(void *arkode_mem, realtype t, int k, N_Vector dky) +int ARKStepGetDky(void *arkode_mem, sunrealtype t, int k, N_Vector dky) { /* unpack ark_mem, call arkGetDky, and return */ int retval; @@ -777,7 +777,7 @@ void ARKStepPrintMem(void* arkode_mem, FILE* outfile) fprintf(outfile,"ARKStep: user_implicit = %i\n", step_mem->implicit); fprintf(outfile,"ARKStep: jcur = %i\n", step_mem->jcur); - /* output realtype quantities */ + /* output sunrealtype quantities */ if (step_mem->Be != NULL) { fprintf(outfile,"ARKStep: explicit Butcher table:\n"); ARKodeButcherTable_Write(step_mem->Be, outfile); @@ -1023,8 +1023,8 @@ ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem) This routine fills the current value of gamma, and states whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ -int arkStep_GetGammas(void* arkode_mem, realtype *gamma, - realtype *gamrat, booleantype **jcur, +int arkStep_GetGammas(void* arkode_mem, sunrealtype *gamma, + sunrealtype *gamrat, booleantype **jcur, booleantype *dgamma_fail) { ARKodeMem ark_mem; @@ -1196,8 +1196,8 @@ int arkStep_Init(void* arkode_mem, int init_type) /* Allocate reusable arrays for fused vector operations */ step_mem->nfusedopvecs = 2 * step_mem->stages + 2 + step_mem->nforcing; if (step_mem->cvals == NULL) { - step_mem->cvals = (realtype *) calloc(step_mem->nfusedopvecs, - sizeof(realtype)); + step_mem->cvals = (sunrealtype *) calloc(step_mem->nfusedopvecs, + sizeof(sunrealtype)); if (step_mem->cvals == NULL) return(ARK_MEM_FAIL); ark_mem->lrw += step_mem->nfusedopvecs; } @@ -1326,14 +1326,14 @@ int arkStep_Init(void* arkode_mem, int init_type) store the intermediate parts so that they do not interfere with the other two modes. ---------------------------------------------------------------*/ -int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int nvec, retval; booleantype recomputeRHS; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* access ARKodeARKStepMem structure */ @@ -1583,7 +1583,7 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) +int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr) { int retval, is, nvec; booleantype implicit_stage; @@ -1591,7 +1591,7 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) ARKodeMem ark_mem; ARKodeARKStepMem step_mem; N_Vector zcor0; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* access ARKodeARKStepMem structure */ @@ -2083,7 +2083,7 @@ int arkStep_CheckButcherTables(ARKodeMem ark_mem) int i, j; booleantype okay; ARKodeARKStepMem step_mem; - const realtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; /* access ARKodeARKStepMem structure */ if (ark_mem->step_mem==NULL) { @@ -2252,10 +2252,10 @@ int arkStep_CheckButcherTables(ARKodeMem ark_mem) int arkStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess) { int i, retval, jstage, nvec; - realtype tau; - realtype h; + sunrealtype tau; + sunrealtype h; ARKodeARKStepMem step_mem; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* access ARKodeARKStepMem structure */ @@ -2472,7 +2472,7 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) /* local data */ ARKodeARKStepMem step_mem; int retval, i, j, nvec; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* access ARKodeARKStepMem structure */ @@ -2567,12 +2567,12 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) This version assumes either an identity or time-dependent mass matrix (identical steps). ---------------------------------------------------------------*/ -int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) +int arkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsmPtr) { /* local data */ int retval, j, nvec; N_Vector y, yerr; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeARKStepMem step_mem; @@ -2660,12 +2660,12 @@ int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) This version assumes a fixed mass matrix. ---------------------------------------------------------------*/ -int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, realtype *dsmPtr) +int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype *dsmPtr) { /* local data */ int retval, j, nvec; N_Vector y, yerr; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeARKStepMem step_mem; @@ -2815,12 +2815,12 @@ int ARKStepCreateMRIStepInnerStepper(void *inner_arkode_mem, ODE IVP. ----------------------------------------------------------------------------*/ -int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, realtype t0, - realtype tout, N_Vector y) +int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y) { void* arkode_mem; /* arkode memory */ - realtype tret; /* return time */ - realtype tshift, tscale; /* time normalization values */ + sunrealtype tret; /* return time */ + sunrealtype tshift, tscale; /* time normalization values */ N_Vector *forcing; /* forcing vectors */ int nforcing; /* number of forcing vectors */ int retval; /* return value */ @@ -2863,7 +2863,7 @@ int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, realtype t0, (fast) ODE IVP RHS. ----------------------------------------------------------------------------*/ -int arkStep_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, realtype t, +int arkStep_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, sunrealtype t, N_Vector y, N_Vector f, int mode) { void* arkode_mem; @@ -2884,7 +2884,7 @@ int arkStep_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, realtype t, state. ----------------------------------------------------------------------------*/ -int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, realtype tR, +int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR) { void* arkode_mem; @@ -2909,10 +2909,10 @@ int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, realtype tR, scaling factor that should be applied to each of these coefficients. ----------------------------------------------------------------------------*/ -void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype t, - realtype s, int *nvec) +void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, sunrealtype t, + sunrealtype s, int *nvec) { - realtype tau, taui; + sunrealtype tau, taui; int i; /* always append the constant forcing term */ @@ -2946,7 +2946,7 @@ void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype t, methods). ----------------------------------------------------------------------------*/ -int arkStep_SetInnerForcing(void* arkode_mem, realtype tshift, realtype tscale, +int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nvecs) { ARKodeMem ark_mem; @@ -2997,8 +2997,8 @@ int arkStep_SetInnerForcing(void* arkode_mem, realtype tshift, realtype tscale, step_mem->nfusedopvecs = 2 * step_mem->stages + 2 + nvecs; step_mem->cvals = NULL; - step_mem->cvals = (realtype *) calloc(step_mem->nfusedopvecs, - sizeof(realtype)); + step_mem->cvals = (sunrealtype *) calloc(step_mem->nfusedopvecs, + sizeof(sunrealtype)); if (step_mem->cvals == NULL) return(ARK_MEM_FAIL); ark_mem->lrw += step_mem->nfusedopvecs; @@ -3034,7 +3034,7 @@ int arkStep_SetInnerForcing(void* arkode_mem, realtype tshift, realtype tscale, int arkStep_RelaxDeltaY(ARKodeMem ark_mem, N_Vector delta_y) { int i, nvec, retval; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeARKStepMem step_mem; diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 91ff0e6489..d844600673 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -95,19 +95,19 @@ typedef struct ARKodeARKStepMemRec { SUNNonlinearSolver NLS; /* generic SUNNonlinearSolver object */ booleantype ownNLS; /* flag indicating ownership of NLS */ ARKRhsFn nls_fi; /* fi(t,y) used in the nonlinear solver */ - realtype gamma; /* gamma = h * A(i,i) */ - realtype gammap; /* gamma at the last setup call */ - realtype gamrat; /* gamma / gammap */ - realtype dgmax; /* call lsetup if |gamma/gammap-1| >= dgmax */ + sunrealtype gamma; /* gamma = h * A(i,i) */ + sunrealtype gammap; /* gamma at the last setup call */ + sunrealtype gamrat; /* gamma / gammap */ + sunrealtype dgmax; /* call lsetup if |gamma/gammap-1| >= dgmax */ int predictor; /* implicit prediction method to use */ - realtype crdown; /* nonlinear conv rate estimation constant */ - realtype rdiv; /* nonlin divergence if del/delp > rdiv */ - realtype crate; /* estimated nonlin convergence rate */ - realtype delp; /* norm of previous nonlinear solver update */ - realtype eRNrm; /* estimated residual norm, used in nonlin + sunrealtype crdown; /* nonlinear conv rate estimation constant */ + sunrealtype rdiv; /* nonlin divergence if del/delp > rdiv */ + sunrealtype crate; /* estimated nonlin convergence rate */ + sunrealtype delp; /* norm of previous nonlinear solver update */ + sunrealtype eRNrm; /* estimated residual norm, used in nonlin and linear solver convergence tests */ - realtype nlscoef; /* coefficient in nonlin. convergence test */ + sunrealtype nlscoef; /* coefficient in nonlin. convergence test */ int msbp; /* positive => max # steps between lsetup negative => call at each Newton iter */ @@ -145,15 +145,15 @@ typedef struct ARKodeARKStepMemRec { long int nls_fails; /* num nonlinear solver fails */ /* Reusable arrays for fused vector operations */ - realtype *cvals; /* scalar array for fused ops */ + sunrealtype *cvals; /* scalar array for fused ops */ N_Vector *Xvecs; /* array of vectors for fused ops */ int nfusedopvecs; /* length of cvals and Xvecs arrays */ /* Data for using ARKStep with external polynomial forcing */ booleantype expforcing; /* add forcing to explicit RHS */ booleantype impforcing; /* add forcing to implicit RHS */ - realtype tshift; /* time normalization shift */ - realtype tscale; /* time normalization scaling */ + sunrealtype tshift; /* time normalization shift */ + sunrealtype tscale; /* time normalization scaling */ N_Vector* forcing; /* array of forcing vectors */ int nforcing; /* number of forcing vectors */ @@ -186,12 +186,12 @@ int arkStep_Init(void* arkode_mem, int init_type); void* arkStep_GetLmem(void* arkode_mem); void* arkStep_GetMassMem(void* arkode_mem); ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem); -int arkStep_GetGammas(void* arkode_mem, realtype *gamma, - realtype *gamrat, booleantype **jcur, +int arkStep_GetGammas(void* arkode_mem, sunrealtype *gamma, + sunrealtype *gamrat, booleantype **jcur, booleantype *dgamma_fail); -int arkStep_FullRHS(void* arkode_mem, realtype t, +int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr); +int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); /* Internal utility routines */ int arkStep_AccessStepMem(void* arkode_mem, const char *fname, @@ -203,10 +203,10 @@ int arkStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess); int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit); int arkStep_NlsInit(ARKodeMem ark_mem); int arkStep_Nls(ARKodeMem ark_mem, int nflag); -int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsm); -int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, realtype *dsm); -void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype t, - realtype s, int *nvec); +int arkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsm); +int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype *dsm); +void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, sunrealtype t, + sunrealtype s, int *nvec); /* private functions passed to nonlinear solver */ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem); @@ -218,16 +218,16 @@ int arkStep_NlsFPFunction_MassTDep(N_Vector zcor, N_Vector g, void* arkode_mem); int arkStep_NlsLSetup(booleantype jbad, booleantype* jcur, void* arkode_mem); int arkStep_NlsLSolve(N_Vector delta, void* arkode_mem); int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, - realtype tol, N_Vector ewt, void* arkode_mem); + sunrealtype tol, N_Vector ewt, void* arkode_mem); /* private functions for interfacing with MRIStep */ -int arkStep_SetInnerForcing(void* arkode_mem, realtype tshift, realtype tscale, +int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, sunrealtype tscale, N_Vector *f, int nvecs); int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, - realtype t0, realtype tout, N_Vector y); -int arkStep_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, realtype t, + sunrealtype t0, sunrealtype tout, N_Vector y); +int arkStep_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, sunrealtype t, N_Vector y, N_Vector f, int mode); -int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, realtype tR, +int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR); /* private functions for relaxation */ diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 26f6e1b6bc..8994d6d830 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -48,13 +48,13 @@ int ARKStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int ARKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { return(arkSetMaxHnilWarns(arkode_mem, mxhnil)); } -int ARKStepSetInitStep(void *arkode_mem, realtype hin) { +int ARKStepSetInitStep(void *arkode_mem, sunrealtype hin) { return(arkSetInitStep(arkode_mem, hin)); } -int ARKStepSetMinStep(void *arkode_mem, realtype hmin) { +int ARKStepSetMinStep(void *arkode_mem, sunrealtype hmin) { return(arkSetMinStep(arkode_mem, hmin)); } -int ARKStepSetMaxStep(void *arkode_mem, realtype hmax) { +int ARKStepSetMaxStep(void *arkode_mem, sunrealtype hmax) { return(arkSetMaxStep(arkode_mem, hmax)); } -int ARKStepSetStopTime(void *arkode_mem, realtype tstop) { +int ARKStepSetStopTime(void *arkode_mem, sunrealtype tstop) { return(arkSetStopTime(arkode_mem, tstop)); } int ARKStepSetInterpolateStopTime(void *arkode_mem, booleantype interp) { @@ -75,30 +75,30 @@ int ARKStepSetPostprocessStepFn(void *arkode_mem, int ARKStepSetPostprocessStageFn(void *arkode_mem, ARKPostProcessFn ProcessStage) { return(arkSetPostprocessStageFn(arkode_mem, ProcessStage)); } -int ARKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac) { +int ARKStepSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac) { return(arkSetCFLFraction(arkode_mem, cfl_frac)); } -int ARKStepSetSafetyFactor(void *arkode_mem, realtype safety) { +int ARKStepSetSafetyFactor(void *arkode_mem, sunrealtype safety) { return(arkSetSafetyFactor(arkode_mem, safety)); } -int ARKStepSetErrorBias(void *arkode_mem, realtype bias) { +int ARKStepSetErrorBias(void *arkode_mem, sunrealtype bias) { return(arkSetErrorBias(arkode_mem, bias)); } -int ARKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth) { +int ARKStepSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth) { return(arkSetMaxGrowth(arkode_mem, mx_growth)); } -int ARKStepSetMinReduction(void *arkode_mem, realtype eta_min) { +int ARKStepSetMinReduction(void *arkode_mem, sunrealtype eta_min) { return(arkSetMinReduction(arkode_mem, eta_min)); } -int ARKStepSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub) { +int ARKStepSetFixedStepBounds(void *arkode_mem, sunrealtype lb, sunrealtype ub) { return(arkSetFixedStepBounds(arkode_mem, lb, ub)); } int ARKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) { + int pq, sunrealtype adapt_params[3]) { return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } int ARKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { return(arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } -int ARKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) { +int ARKStepSetMaxFirstGrowth(void *arkode_mem, sunrealtype etamx1) { return(arkSetMaxFirstGrowth(arkode_mem, etamx1)); } -int ARKStepSetMaxEFailGrowth(void *arkode_mem, realtype etamxf) { +int ARKStepSetMaxEFailGrowth(void *arkode_mem, sunrealtype etamxf) { return(arkSetMaxEFailGrowth(arkode_mem, etamxf)); } int ARKStepSetSmallNumEFails(void *arkode_mem, int small_nef) { return(arkSetSmallNumEFails(arkode_mem, small_nef)); } -int ARKStepSetMaxCFailGrowth(void *arkode_mem, realtype etacf) { +int ARKStepSetMaxCFailGrowth(void *arkode_mem, sunrealtype etacf) { return(arkSetMaxCFailGrowth(arkode_mem, etacf)); } int ARKStepSetStabilityFn(void *arkode_mem, ARKExpStabFn EStab, void *estab_data) { return(arkSetStabilityFn(arkode_mem, EStab, estab_data)); } @@ -106,7 +106,7 @@ int ARKStepSetMaxErrTestFails(void *arkode_mem, int maxnef) { return(arkSetMaxErrTestFails(arkode_mem, maxnef)); } int ARKStepSetMaxConvFails(void *arkode_mem, int maxncf) { return(arkSetMaxConvFails(arkode_mem, maxncf)); } -int ARKStepSetFixedStep(void *arkode_mem, realtype hfixed) { +int ARKStepSetFixedStep(void *arkode_mem, sunrealtype hfixed) { return(arkSetFixedStep(arkode_mem, hfixed)); } @@ -128,13 +128,13 @@ int ARKStepSetJacEvalFrequency(void *arkode_mem, long int msbj) { return(arkLSSetJacEvalFrequency(arkode_mem, msbj)); } int ARKStepSetLinearSolutionScaling(void *arkode_mem, booleantype onoff) { return(arkLSSetLinearSolutionScaling(arkode_mem, onoff)); } -int ARKStepSetEpsLin(void *arkode_mem, realtype eplifac) { +int ARKStepSetEpsLin(void *arkode_mem, sunrealtype eplifac) { return(arkLSSetEpsLin(arkode_mem, eplifac)); } -int ARKStepSetMassEpsLin(void *arkode_mem, realtype eplifac) { +int ARKStepSetMassEpsLin(void *arkode_mem, sunrealtype eplifac) { return(arkLSSetMassEpsLin(arkode_mem, eplifac)); } -int ARKStepSetLSNormFactor(void *arkode_mem, realtype nrmfac) { +int ARKStepSetLSNormFactor(void *arkode_mem, sunrealtype nrmfac) { return(arkLSSetNormFactor(arkode_mem, nrmfac)); } -int ARKStepSetMassLSNormFactor(void *arkode_mem, realtype nrmfac) { +int ARKStepSetMassLSNormFactor(void *arkode_mem, sunrealtype nrmfac) { return(arkLSSetMassNormFactor(arkode_mem, nrmfac)); } int ARKStepSetPreconditioner(void *arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve) { @@ -161,17 +161,17 @@ int ARKStepGetNumStepAttempts(void *arkode_mem, long int *nstep_attempts) { return(arkGetNumStepAttempts(arkode_mem, nstep_attempts)); } int ARKStepGetNumSteps(void *arkode_mem, long int *nsteps) { return(arkGetNumSteps(arkode_mem, nsteps)); } -int ARKStepGetActualInitStep(void *arkode_mem, realtype *hinused) { +int ARKStepGetActualInitStep(void *arkode_mem, sunrealtype *hinused) { return(arkGetActualInitStep(arkode_mem, hinused)); } -int ARKStepGetLastStep(void *arkode_mem, realtype *hlast) { +int ARKStepGetLastStep(void *arkode_mem, sunrealtype *hlast) { return(arkGetLastStep(arkode_mem, hlast)); } -int ARKStepGetCurrentStep(void *arkode_mem, realtype *hcur) { +int ARKStepGetCurrentStep(void *arkode_mem, sunrealtype *hcur) { return(arkGetCurrentStep(arkode_mem, hcur)); } -int ARKStepGetCurrentTime(void *arkode_mem, realtype *tcur) { +int ARKStepGetCurrentTime(void *arkode_mem, sunrealtype *tcur) { return(arkGetCurrentTime(arkode_mem, tcur)); } int ARKStepGetCurrentState(void *arkode_mem, N_Vector *state) { return(arkGetCurrentState(arkode_mem, state)); } -int ARKStepGetTolScaleFactor(void *arkode_mem, realtype *tolsfact) { +int ARKStepGetTolScaleFactor(void *arkode_mem, sunrealtype *tolsfact) { return(arkGetTolScaleFactor(arkode_mem, tolsfact)); } int ARKStepGetErrWeights(void *arkode_mem, N_Vector eweight) { return(arkGetErrWeights(arkode_mem, eweight)); } @@ -184,8 +184,8 @@ int ARKStepGetNumGEvals(void *arkode_mem, long int *ngevals) { int ARKStepGetRootInfo(void *arkode_mem, int *rootsfound) { return(arkGetRootInfo(arkode_mem, rootsfound)); } int ARKStepGetStepStats(void *arkode_mem, long int *nsteps, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur) { + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur) { return(arkGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } int ARKStepGetNumConstrFails(void *arkode_mem, long int *nconstrfails) { return(arkGetNumConstrFails(arkode_mem, nconstrfails)); } @@ -1196,7 +1196,7 @@ int ARKStepSetTableName(void *arkode_mem, const char *itable, const char *etable crdown. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int ARKStepSetNonlinCRDown(void *arkode_mem, realtype crdown) +int ARKStepSetNonlinCRDown(void *arkode_mem, sunrealtype crdown) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -1225,7 +1225,7 @@ int ARKStepSetNonlinCRDown(void *arkode_mem, realtype crdown) rdiv. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int ARKStepSetNonlinRDiv(void *arkode_mem, realtype rdiv) +int ARKStepSetNonlinRDiv(void *arkode_mem, sunrealtype rdiv) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -1254,7 +1254,7 @@ int ARKStepSetNonlinRDiv(void *arkode_mem, realtype rdiv) dgmax. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int ARKStepSetDeltaGammaMax(void *arkode_mem, realtype dgmax) +int ARKStepSetDeltaGammaMax(void *arkode_mem, sunrealtype dgmax) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -1390,7 +1390,7 @@ int ARKStepSetMaxNonlinIters(void *arkode_mem, int maxcor) Specifies the coefficient in the nonlinear solver convergence test. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int ARKStepSetNonlinConvCoef(void *arkode_mem, realtype nlscoef) +int ARKStepSetNonlinConvCoef(void *arkode_mem, sunrealtype nlscoef) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -1469,7 +1469,7 @@ int ARKStepSetDeduceImplicitRhs(void *arkode_mem, sunbooleantype deduce) /*--------------------------------------------------------------- ARKStepGetCurrentGamma: Returns the current value of gamma ---------------------------------------------------------------*/ -int ARKStepGetCurrentGamma(void *arkode_mem, realtype *gamma) +int ARKStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) { int retval; ARKodeMem ark_mem; @@ -1718,7 +1718,7 @@ int ARKStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (ark_mem->nst > 0) { fprintf(outfile, "NLS iters per step = %"RSYM"\n", - (realtype) step_mem->nls_iters / (realtype) ark_mem->nst); + (sunrealtype) step_mem->nls_iters / (sunrealtype) ark_mem->nst); } /* linear solver stats */ @@ -1737,11 +1737,11 @@ int ARKStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (step_mem->nls_iters > 0) { fprintf(outfile, "LS iters per NLS iter = %"RSYM"\n", - (realtype) arkls_mem->nli / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nli / (sunrealtype) step_mem->nls_iters); fprintf(outfile, "Jac evals per NLS iter = %"RSYM"\n", - (realtype) arkls_mem->nje / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nje / (sunrealtype) step_mem->nls_iters); fprintf(outfile, "Prec evals per NLS iter = %"RSYM"\n", - (realtype) arkls_mem->npe / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->npe / (sunrealtype) step_mem->nls_iters); } } @@ -1771,7 +1771,7 @@ int ARKStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (ark_mem->nst > 0) { fprintf(outfile, ",NLS iters per step,%"RSYM, - (realtype) step_mem->nls_iters / (realtype) ark_mem->nst); + (sunrealtype) step_mem->nls_iters / (sunrealtype) ark_mem->nst); } else { @@ -1794,11 +1794,11 @@ int ARKStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (step_mem->nls_iters > 0) { fprintf(outfile, ",LS iters per NLS iter,%"RSYM, - (realtype) arkls_mem->nli / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nli / (sunrealtype) step_mem->nls_iters); fprintf(outfile, ",Jac evals per NLS iter,%"RSYM, - (realtype) arkls_mem->nje / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nje / (sunrealtype) step_mem->nls_iters); fprintf(outfile, ",Prec evals per NLS iter,%"RSYM, - (realtype) arkls_mem->npe / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->npe / (sunrealtype) step_mem->nls_iters); } else { diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index 01565187dd..5dcabb8388 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -136,9 +136,9 @@ int ARKStepSetNlsRhsFn(void *arkode_mem, ARKRhsFn nls_fi) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int ARKStepGetNonlinearSystemData(void *arkode_mem, realtype *tcur, +int ARKStepGetNonlinearSystemData(void *arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, - N_Vector *Fi, realtype *gamma, + N_Vector *Fi, sunrealtype *gamma, N_Vector *sdata, void **user_data) { ARKodeMem ark_mem; @@ -478,7 +478,7 @@ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem) ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; - realtype c[3]; + sunrealtype c[3]; N_Vector X[3]; /* access ARKodeARKStepMem structure */ @@ -543,7 +543,7 @@ int arkStep_NlsResidual_MassFixed(N_Vector zcor, N_Vector r, void* arkode_mem) ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; - realtype c[3]; + sunrealtype c[3]; N_Vector X[3]; /* access ARKodeARKStepMem structure */ @@ -874,12 +874,12 @@ int arkStep_NlsFPFunction_MassTDep(N_Vector zcor, N_Vector g, void* arkode_mem) is provided. ---------------------------------------------------------------*/ int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, - realtype tol, N_Vector ewt, void* arkode_mem) + sunrealtype tol, N_Vector ewt, void* arkode_mem) { /* temporary variables */ ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - realtype delnrm, dcon; + sunrealtype delnrm, dcon; int m, retval; /* access ARKodeARKStepMem structure */ diff --git a/src/arkode/arkode_bandpre.c b/src/arkode/arkode_bandpre.c index 0375bdc62e..c985533494 100644 --- a/src/arkode/arkode_bandpre.c +++ b/src/arkode/arkode_bandpre.c @@ -32,12 +32,12 @@ /* Prototypes of ARKBandPrecSetup and ARKBandPrecSolve */ -static int ARKBandPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int ARKBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bp_data); -static int ARKBandPrecSolve(realtype t, N_Vector y, N_Vector fy, + sunrealtype gamma, void *bp_data); +static int ARKBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bp_data); /* Prototype for ARKBandPrecFree */ @@ -45,7 +45,7 @@ static int ARKBandPrecFree(ARKodeMem ark_mem); /* Prototype for difference quotient Jacobian calculation routine */ static int ARKBandPDQJac(ARKBandPrecData pdata, - realtype t, N_Vector y, N_Vector fy, + sunrealtype t, N_Vector y, N_Vector fy, N_Vector ftemp, N_Vector ytemp); @@ -311,9 +311,9 @@ int ARKBandPrecGetNumRhsEvals(void *arkode_mem, long int *nfevalsBP) 0 if successful, or 1 if the band factorization failed. ---------------------------------------------------------------*/ -static int ARKBandPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int ARKBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bp_data) + sunrealtype gamma, void *bp_data) { ARKBandPrecData pdata; ARKodeMem ark_mem; @@ -406,9 +406,9 @@ static int ARKBandPrecSetup(realtype t, N_Vector y, N_Vector fy, The value returned by the ARKBandPrecSolve function is always 0, indicating success. ---------------------------------------------------------------*/ -static int ARKBandPrecSolve(realtype t, N_Vector y, N_Vector fy, +static int ARKBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bp_data) { ARKBandPrecData pdata; @@ -466,15 +466,15 @@ static int ARKBandPrecFree(ARKodeMem ark_mem) each of the elements of a column in succession. ---------------------------------------------------------------*/ static int ARKBandPDQJac(ARKBandPrecData pdata, - realtype t, N_Vector y, N_Vector fy, + sunrealtype t, N_Vector y, N_Vector fy, N_Vector ftemp, N_Vector ytemp) { ARKodeMem ark_mem; ARKRhsFn fi; - realtype fnorm, minInc, inc, inc_inv, yj, srur, conj; + sunrealtype fnorm, minInc, inc, inc_inv, yj, srur, conj; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *col_j, *ewt_data, *fy_data, *ftemp_data; - realtype *y_data, *ytemp_data, *cns_data; + sunrealtype *col_j, *ewt_data, *fy_data, *ftemp_data; + sunrealtype *y_data, *ytemp_data, *cns_data; int retval; ark_mem = (ARKodeMem) pdata->arkode_mem; diff --git a/src/arkode/arkode_bbdpre.c b/src/arkode/arkode_bbdpre.c index d1a4cc171f..be491e4a8f 100644 --- a/src/arkode/arkode_bbdpre.c +++ b/src/arkode/arkode_bbdpre.c @@ -34,19 +34,19 @@ /* Prototypes of functions ARKBBDPrecSetup and ARKBBDPrecSolve */ -static int ARKBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bbd_data); -static int ARKBBDPrecSolve(realtype t, N_Vector y, N_Vector fy, + sunrealtype gamma, void *bbd_data); +static int ARKBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bbd_data); /* Prototype for ARKBBDPrecFree */ static int ARKBBDPrecFree(ARKodeMem ark_mem); /* Prototype for difference quotient Jacobian calculation routine */ -static int ARKBBDDQJac(ARKBBDPrecData pdata, realtype t, +static int ARKBBDDQJac(ARKBBDPrecData pdata, sunrealtype t, N_Vector y, N_Vector gy, N_Vector ytemp, N_Vector gtemp); @@ -57,7 +57,7 @@ static int ARKBBDDQJac(ARKBBDPrecData pdata, realtype t, int ARKBBDPrecInit(void *arkode_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dqrely, + sunrealtype dqrely, ARKLocalFn gloc, ARKCommFn cfn) { ARKodeMem ark_mem; @@ -276,7 +276,7 @@ int ARKBBDPrecInit(void *arkode_mem, sunindextype Nlocal, /*-------------------------------------------------------------*/ int ARKBBDPrecReInit(void *arkode_mem, sunindextype mudq, - sunindextype mldq, realtype dqrely) + sunindextype mldq, sunrealtype dqrely) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -419,9 +419,9 @@ int ARKBBDPrecGetNumGfnEvals(void *arkode_mem, 0 if successful, 1 for a recoverable error (step will be retried). ---------------------------------------------------------------*/ -static int ARKBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bbd_data) + sunrealtype gamma, void *bbd_data) { ARKBBDPrecData pdata; ARKodeMem ark_mem; @@ -514,9 +514,9 @@ static int ARKBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, The value returned by the ARKBBDPrecSolve function is the same as the value returned from the linear solver object. ---------------------------------------------------------------*/ -static int ARKBBDPrecSolve(realtype t, N_Vector y, N_Vector fy, +static int ARKBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bbd_data) { int retval; @@ -585,15 +585,15 @@ static int ARKBBDPrecFree(ARKodeMem ark_mem) This routine also assumes that the local elements of a vector are stored contiguously. ---------------------------------------------------------------*/ -static int ARKBBDDQJac(ARKBBDPrecData pdata, realtype t, +static int ARKBBDDQJac(ARKBBDPrecData pdata, sunrealtype t, N_Vector y, N_Vector gy, N_Vector ytemp, N_Vector gtemp) { ARKodeMem ark_mem; - realtype gnorm, minInc, inc, inc_inv, yj, conj; + sunrealtype gnorm, minInc, inc, inc_inv, yj, conj; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *y_data, *ewt_data, *gy_data, *gtemp_data; - realtype *ytemp_data, *col_j, *cns_data; + sunrealtype *y_data, *ewt_data, *gy_data, *gtemp_data; + sunrealtype *ytemp_data, *col_j, *cns_data; int retval; ark_mem = (ARKodeMem) pdata->arkode_mem; diff --git a/src/arkode/arkode_bbdpre_impl.h b/src/arkode/arkode_bbdpre_impl.h index ba1ace334c..97e52c9aca 100644 --- a/src/arkode/arkode_bbdpre_impl.h +++ b/src/arkode/arkode_bbdpre_impl.h @@ -33,7 +33,7 @@ typedef struct ARKBBDPrecDataRec { /* passed by user to ARKBBDPrecAlloc and used by PrecSetup/PrecSolve */ sunindextype mudq, mldq, mukeep, mlkeep; - realtype dqrely; + sunrealtype dqrely; ARKLocalFn gloc; ARKCommFn cfn; diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index e16191fcb5..11fd4756b2 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -26,48 +26,48 @@ #define TOL (SUNRsqrt(UNIT_ROUNDOFF)) /* Private utility functions for checking method order */ -static int __mv(realtype **A, realtype *x, int s, realtype *b); -static int __vv(realtype *x, realtype *y, int s, realtype *z); -static int __vp(realtype *x, int l, int s, realtype *z); -static int __dot(realtype *x, realtype *y, int s, realtype *d); -static booleantype __rowsum(realtype **A, realtype *c, int s); -static booleantype __order1(realtype *b, int s); -static booleantype __order2(realtype *b, realtype *c, int s); -static booleantype __order3a(realtype *b, realtype *c1, realtype *c2, int s); -static booleantype __order3b(realtype *b, realtype **A, realtype *c, int s); -static booleantype __order4a(realtype *b, realtype *c1, realtype *c2, realtype *c3, int s); -static booleantype __order4b(realtype *b, realtype *c1, realtype **A, realtype *c2, int s); -static booleantype __order4c(realtype *b, realtype **A, realtype *c1, realtype *c2, int s); -static booleantype __order4d(realtype *b, realtype **A1, realtype **A2, realtype *c, int s); -static booleantype __order5a(realtype *b, realtype *c1, realtype *c2, realtype *c3, realtype *c4, int s); -static booleantype __order5b(realtype *b, realtype *c1, realtype *c2, realtype **A, realtype *c3, int s); -static booleantype __order5c(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype *c2, int s); -static booleantype __order5d(realtype *b, realtype *c1, realtype **A, realtype *c2, realtype *c3, int s); -static booleantype __order5e(realtype *b, realtype **A, realtype *c1, realtype *c2, realtype *c3, int s); -static booleantype __order5f(realtype *b, realtype *c1, realtype **A1, realtype **A2, realtype *c2, int s); -static booleantype __order5g(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype *c2, int s); -static booleantype __order5h(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype *c2, int s); -static booleantype __order5i(realtype *b, realtype **A1, realtype **A2, realtype **A3, realtype *c, int s); -static booleantype __order6a(realtype *b, realtype *c1, realtype *c2, realtype *c3, realtype *c4, realtype *c5, int s); -static booleantype __order6b(realtype *b, realtype *c1, realtype *c2, realtype *c3, realtype **A, realtype *c4, int s); -static booleantype __order6c(realtype *b, realtype *c1, realtype **A1, realtype *c2, realtype **A2, realtype *c3, int s); -static booleantype __order6d(realtype *b, realtype *c1, realtype *c2, realtype **A, realtype *c3, realtype *c4, int s); -static booleantype __order6e(realtype *b, realtype *c1, realtype *c2, realtype **A1, realtype **A2, realtype *c3, int s); -static booleantype __order6f(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype **A3, realtype *c2, int s); -static booleantype __order6g(realtype *b, realtype *c1, realtype **A, realtype *c2, realtype *c3, realtype *c4, int s); -static booleantype __order6h(realtype *b, realtype *c1, realtype **A1, realtype *c2, realtype **A2, realtype *c3, int s); -static booleantype __order6i(realtype *b, realtype *c1, realtype **A1, realtype **A2, realtype *c2, realtype *c3, int s); -static booleantype __order6j(realtype *b, realtype *c1, realtype **A1, realtype **A2, realtype **A3, realtype *c2, int s); -static booleantype __order6k(realtype *b, realtype **A, realtype *c1, realtype *c2, realtype *c3, realtype *c4, int s); -static booleantype __order6l(realtype *b, realtype **A1, realtype *c1, realtype *c2, realtype **A2, realtype *c3, int s); -static booleantype __order6m(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype **A3, realtype *c2, int s); -static booleantype __order6n(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype *c2, realtype *c3, int s); -static booleantype __order6o(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype **A3, realtype *c2, int s); -static booleantype __order6p(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype *c2, realtype *c3, int s); -static booleantype __order6q(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype **A3, realtype *c2, int s); -static booleantype __order6r(realtype *b, realtype **A1, realtype **A2, realtype **A3, realtype *c1, realtype *c2, int s); -static booleantype __order6s(realtype *b, realtype **A1, realtype **A2, realtype **A3, realtype **A4, realtype *c, int s); -static int __ButcherSimplifyingAssumptions(realtype **A, realtype *b, realtype *c, int s); +static int __mv(sunrealtype **A, sunrealtype *x, int s, sunrealtype *b); +static int __vv(sunrealtype *x, sunrealtype *y, int s, sunrealtype *z); +static int __vp(sunrealtype *x, int l, int s, sunrealtype *z); +static int __dot(sunrealtype *x, sunrealtype *y, int s, sunrealtype *d); +static booleantype __rowsum(sunrealtype **A, sunrealtype *c, int s); +static booleantype __order1(sunrealtype *b, int s); +static booleantype __order2(sunrealtype *b, sunrealtype *c, int s); +static booleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, int s); +static booleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, int s); +static booleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); +static booleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, int s); +static booleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, int s); +static booleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c, int s); +static booleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); +static booleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, int s); +static booleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s); +static booleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, int s); +static booleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); +static booleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, int s); +static booleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s); +static booleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, int s); +static booleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c, int s); +static booleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, sunrealtype *c5, int s); +static booleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype **A, sunrealtype *c4, int s); +static booleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); +static booleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, sunrealtype *c4, int s); +static booleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A1, sunrealtype **A2, sunrealtype *c3, int s); +static booleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); +static booleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); +static booleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); +static booleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s); +static booleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s); +static booleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); +static booleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); +static booleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); +static booleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s); +static booleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s); +static booleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); +static booleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); +static booleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c1, sunrealtype *c2, int s); +static booleantype __order6s(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype **A4, sunrealtype *c, int s); +static int __ButcherSimplifyingAssumptions(sunrealtype **A, sunrealtype *b, sunrealtype *c, int s); /*--------------------------------------------------------------- @@ -100,7 +100,7 @@ ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, booleantype embedded) */ /* allocate rows of A */ - B->A = (realtype **) calloc( stages, sizeof(realtype*) ); + B->A = (sunrealtype **) calloc( stages, sizeof(sunrealtype*) ); if (B->A == NULL) { ARKodeButcherTable_Free(B); return(NULL); } /* initialize each row of A to NULL */ @@ -109,18 +109,18 @@ ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, booleantype embedded) /* allocate columns of A */ for (i=0; iA[i] = (realtype *) calloc( stages, sizeof(realtype) ); + B->A[i] = (sunrealtype *) calloc( stages, sizeof(sunrealtype) ); if (B->A[i] == NULL) { ARKodeButcherTable_Free(B); return(NULL); } } - B->b = (realtype *) calloc( stages, sizeof(realtype) ); + B->b = (sunrealtype *) calloc( stages, sizeof(sunrealtype) ); if (B->b == NULL) { ARKodeButcherTable_Free(B); return(NULL); } - B->c = (realtype *) calloc( stages, sizeof(realtype) ); + B->c = (sunrealtype *) calloc( stages, sizeof(sunrealtype) ); if (B->c == NULL) { ARKodeButcherTable_Free(B); return(NULL); } if (embedded) { - B->d = (realtype *) calloc( stages, sizeof(realtype) ); + B->d = (sunrealtype *) calloc( stages, sizeof(sunrealtype) ); if (B->d == NULL) { ARKodeButcherTable_Free(B); return(NULL); } } @@ -135,9 +135,9 @@ ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, booleantype embedded) /*--------------------------------------------------------------- Routine to allocate and fill a Butcher table structure ---------------------------------------------------------------*/ -ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, realtype *c, - realtype *A, realtype *b, - realtype *d) +ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, sunrealtype *c, + sunrealtype *A, sunrealtype *b, + sunrealtype *d) { int i, j; ARKodeButcherTable B; @@ -336,7 +336,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int *q, int *p, FILE *ou { /* local variables */ int q_SA, p_SA, i, s; - realtype **A, *b, *c, *d; + sunrealtype **A, *b, *c, *d; booleantype alltrue; (*q) = (*p) = 0; @@ -790,7 +790,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, /* local variables */ int i, j, k, l, m, n, s; booleantype alltrue; - realtype **A[2], *b[2], *c[2], *d[2]; + sunrealtype **A[2], *b[2], *c[2], *d[2]; (*q) = (*p) = 0; /* verify non-NULL Butcher table structure and contents */ @@ -1454,7 +1454,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, Here A is (s x s), x and b are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __mv(realtype **A, realtype *x, int s, realtype *b) +static int __mv(sunrealtype **A, sunrealtype *x, int s, sunrealtype *b) { int i, j; if ((A == NULL) || (x == NULL) || (b == NULL) || (s < 1)) @@ -1473,7 +1473,7 @@ static int __mv(realtype **A, realtype *x, int s, realtype *b) Here all vectors are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __vv(realtype *x, realtype *y, int s, realtype *z) +static int __vv(sunrealtype *x, sunrealtype *y, int s, sunrealtype *z) { int i; if ((x == NULL) || (y == NULL) || (z == NULL) || (s < 1)) @@ -1490,7 +1490,7 @@ static int __vv(realtype *x, realtype *y, int s, realtype *z) Here all vectors are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __vp(realtype *x, int l, int s, realtype *z) +static int __vp(sunrealtype *x, int l, int s, sunrealtype *z) { int i; if ((x == NULL) || (z == NULL) || (s < 1) || (s < 0)) @@ -1507,7 +1507,7 @@ static int __vp(realtype *x, int l, int s, realtype *z) Here x and y are (s x 1), and d is scalar. Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __dot(realtype *x, realtype *y, int s, realtype *d) +static int __dot(sunrealtype *x, sunrealtype *y, int s, sunrealtype *d) { int i; if ((x == NULL) || (y == NULL) || (d == NULL) || (s < 1)) @@ -1532,10 +1532,10 @@ static int __dot(realtype *x, realtype *y, int s, realtype *d) ---------------------------------------------------------------*/ /* c(i) = sum(A(i,:)) */ -static booleantype __rowsum(realtype **A, realtype *c, int s) +static booleantype __rowsum(sunrealtype **A, sunrealtype *c, int s) { int i, j; - realtype rsum; + sunrealtype rsum; for (i=0; i TOL) ? SUNFALSE : SUNTRUE; } /* b'*c = 1/2 */ -static booleantype __order2(realtype *b, realtype *c, int s) +static booleantype __order2(sunrealtype *b, sunrealtype *c, int s) { - realtype bc; + sunrealtype bc; if (__dot(b,c,s,&bc)) return(SUNFALSE); return (SUNRabs(bc - RCONST(0.5)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2) = 1/3 */ -static booleantype __order3a(realtype *b, realtype *c1, realtype *c2, int s) +static booleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, int s) { - realtype bcc; - realtype *tmp = calloc( s, sizeof(realtype) ); + sunrealtype bcc; + sunrealtype *tmp = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp)) { free(tmp); return(SUNFALSE); } if (__dot(b,tmp,s,&bcc)) return(SUNFALSE); free(tmp); @@ -1576,10 +1576,10 @@ static booleantype __order3a(realtype *b, realtype *c1, realtype *c2, int s) } /* b'*(A*c) = 1/6 */ -static booleantype __order3b(realtype *b, realtype **A, realtype *c, int s) +static booleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, int s) { - realtype bAc; - realtype *tmp = calloc( s, sizeof(realtype) ); + sunrealtype bAc; + sunrealtype *tmp = calloc( s, sizeof(sunrealtype) ); if (__mv(A,c,s,tmp)) { free(tmp); return(SUNFALSE); } if (__dot(b,tmp,s,&bAc)) return(SUNFALSE); free(tmp); @@ -1587,11 +1587,11 @@ static booleantype __order3b(realtype *b, realtype **A, realtype *c, int s) } /* b'*(c1.*c2.*c3) = 1/4 */ -static booleantype __order4a(realtype *b, realtype *c1, realtype *c2, realtype *c3, int s) +static booleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) { - realtype bccc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bccc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bccc)) return(SUNFALSE); @@ -1600,11 +1600,11 @@ static booleantype __order4a(realtype *b, realtype *c1, realtype *c2, realtype * } /* (b.*c1)'*(A*c2) = 1/8 */ -static booleantype __order4b(realtype *b, realtype *c1, realtype **A, realtype *c2, int s) +static booleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, int s) { - realtype bcAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(b,c1,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A,c2,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(tmp1,tmp2,s,&bcAc)) return(SUNFALSE); @@ -1613,11 +1613,11 @@ static booleantype __order4b(realtype *b, realtype *c1, realtype **A, realtype * } /* b'*A*(c1.*c2) = 1/12 */ -static booleantype __order4c(realtype *b, realtype **A, realtype *c1, realtype *c2, int s) +static booleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, int s) { - realtype bAcc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAcc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAcc)) return(SUNFALSE); @@ -1626,11 +1626,11 @@ static booleantype __order4c(realtype *b, realtype **A, realtype *c1, realtype * } /* b'*A1*A2*c = 1/24 */ -static booleantype __order4d(realtype *b, realtype **A1, realtype **A2, realtype *c, int s) +static booleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c, int s) { - realtype bAAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A2,c,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAAc)) return(SUNFALSE); @@ -1639,11 +1639,11 @@ static booleantype __order4d(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*(c1.*c2.*c3.*c4) = 1/5 */ -static booleantype __order5a(realtype *b, realtype *c1, realtype *c2, realtype *c3, realtype *c4, int s) +static booleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) { - realtype bcccc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcccc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c4,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1653,11 +1653,11 @@ static booleantype __order5a(realtype *b, realtype *c1, realtype *c2, realtype * } /* (b.*c1.*c2)'*(A*c3) = 1/10 */ -static booleantype __order5b(realtype *b, realtype *c1, realtype *c2, realtype **A, realtype *c3, int s) +static booleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, int s) { - realtype bccAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bccAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(b,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1667,12 +1667,12 @@ static booleantype __order5b(realtype *b, realtype *c1, realtype *c2, realtype * } /* b'*((A1*c1).*(A2*c2)) = 1/20 */ -static booleantype __order5c(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype *c2, int s) +static booleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s) { - realtype bAcAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); - realtype *tmp3 = calloc( s, sizeof(realtype) ); + sunrealtype bAcAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp3 = calloc( s, sizeof(sunrealtype) ); if (__mv(A1,c1,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__mv(A2,c2,s,tmp2)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__vv(tmp1,tmp2,s,tmp3)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } @@ -1682,11 +1682,11 @@ static booleantype __order5c(realtype *b, realtype **A1, realtype *c1, realtype } /* (b.*c1)'*A*(c2.*c3) = 1/15 */ -static booleantype __order5d(realtype *b, realtype *c1, realtype **A, realtype *c2, realtype *c3, int s) +static booleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, int s) { - realtype bcAcc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcAcc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c2,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(b,c1,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1696,11 +1696,11 @@ static booleantype __order5d(realtype *b, realtype *c1, realtype **A, realtype * } /* b'*A*(c1.*c2.*c3) = 1/20 */ -static booleantype __order5e(realtype *b, realtype **A, realtype *c1, realtype *c2, realtype *c3, int s) +static booleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) { - realtype bAccc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAccc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1710,11 +1710,11 @@ static booleantype __order5e(realtype *b, realtype **A, realtype *c1, realtype * } /* (b.*c1)'*A1*A2*c2 = 1/30 */ -static booleantype __order5f(realtype *b, realtype *c1, realtype **A1, realtype **A2, realtype *c2, int s) +static booleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, int s) { - realtype bcAAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcAAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A2,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(b,c1,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1724,11 +1724,11 @@ static booleantype __order5f(realtype *b, realtype *c1, realtype **A1, realtype } /* b'*A1*(c1.*(A2*c2)) = 1/40 */ -static booleantype __order5g(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype *c2, int s) +static booleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s) { - realtype bAcAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAcAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A2,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1738,11 +1738,11 @@ static booleantype __order5g(realtype *b, realtype **A1, realtype *c1, realtype } /* b'*A1*A2*(c1.*c2) = 1/60 */ -static booleantype __order5h(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype *c2, int s) +static booleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, int s) { - realtype bAAcc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAAcc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1752,11 +1752,11 @@ static booleantype __order5h(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*A1*A2*A3*c = 1/120 */ -static booleantype __order5i(realtype *b, realtype **A1, realtype **A2, realtype **A3, realtype *c, int s) +static booleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c, int s) { - realtype bAAAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAAAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A3,c,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1766,11 +1766,11 @@ static booleantype __order5i(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*(c1.*c2.*c3.*c4.*c5) = 1/6 */ -static booleantype __order6a(realtype *b, realtype *c1, realtype *c2, realtype *c3, realtype *c4, realtype *c5, int s) +static booleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, sunrealtype *c5, int s) { - realtype bccccc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bccccc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c4,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1781,11 +1781,11 @@ static booleantype __order6a(realtype *b, realtype *c1, realtype *c2, realtype * } /* (b.*c1.*c2.*c3)'*(A*c4) = 1/12 */ -static booleantype __order6b(realtype *b, realtype *c1, realtype *c2, realtype *c3, realtype **A, realtype *c4, int s) +static booleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype **A, sunrealtype *c4, int s) { - realtype bcccAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcccAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(b,c1,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c3,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1796,12 +1796,12 @@ static booleantype __order6b(realtype *b, realtype *c1, realtype *c2, realtype * } /* b'*(c1.*(A1*c2).*(A2*c3)) = 1/24 */ -static booleantype __order6c(realtype *b, realtype *c1, realtype **A1, realtype *c2, realtype **A2, realtype *c3, int s) +static booleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) { - realtype bcAc2; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); - realtype *tmp3 = calloc( s, sizeof(realtype) ); + sunrealtype bcAc2; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp3 = calloc( s, sizeof(sunrealtype) ); if (__mv(A2,c3,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__mv(A1,c2,s,tmp2)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__vv(tmp1,tmp2,s,tmp3)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } @@ -1812,12 +1812,12 @@ static booleantype __order6c(realtype *b, realtype *c1, realtype **A1, realtype } /* (b.*c1.*c2)'*A*(c3.*c4) = 1/18 */ -static booleantype __order6d(realtype *b, realtype *c1, realtype *c2, realtype **A, realtype *c3, realtype *c4, int s) +static booleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, sunrealtype *c4, int s) { - realtype bccAcc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); - realtype *tmp3 = calloc( s, sizeof(realtype) ); + sunrealtype bccAcc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp3 = calloc( s, sizeof(sunrealtype) ); if (__vv(c3,c4,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__mv(A,tmp1,s,tmp2)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } @@ -1828,12 +1828,12 @@ static booleantype __order6d(realtype *b, realtype *c1, realtype *c2, realtype * } /* (b.*(c1.*c2))'*A1*A2*c3 = 1/36 */ -static booleantype __order6e(realtype *b, realtype *c1, realtype *c2, realtype **A1, realtype **A2, realtype *c3, int s) +static booleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A1, sunrealtype **A2, sunrealtype *c3, int s) { - realtype bccAAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); - realtype *tmp3 = calloc( s, sizeof(realtype) ); + sunrealtype bccAAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp3 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__vv(b,tmp1,s,tmp2)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__mv(A2,c3,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } @@ -1844,12 +1844,12 @@ static booleantype __order6e(realtype *b, realtype *c1, realtype *c2, realtype * } /* b'*((A1*A2*c1).*(A3*c2)) = 1/72 */ -static booleantype __order6f(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype **A3, realtype *c2, int s) +static booleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) { - realtype bAAcAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); - realtype *tmp3 = calloc( s, sizeof(realtype) ); + sunrealtype bAAcAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp3 = calloc( s, sizeof(sunrealtype) ); if (__mv(A2,c1,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__mv(A3,c2,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } @@ -1860,11 +1860,11 @@ static booleantype __order6f(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*(c1.*(A*(c2.*c3.*c4))) = 1/24 */ -static booleantype __order6g(realtype *b, realtype *c1, realtype **A, realtype *c2, realtype *c3, realtype *c4, int s) +static booleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) { - realtype bcAccc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcAccc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c2,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c4,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1875,11 +1875,11 @@ static booleantype __order6g(realtype *b, realtype *c1, realtype **A, realtype * } /* b'*(c1.*(A1*(c2.*(A2*c3)))) = 1/48 */ -static booleantype __order6h(realtype *b, realtype *c1, realtype **A1, realtype *c2, realtype **A2, realtype *c3, int s) +static booleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) { - realtype bcAcAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcAcAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A2,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1890,11 +1890,11 @@ static booleantype __order6h(realtype *b, realtype *c1, realtype **A1, realtype } /* b'*(c1.*(A1*A2*(c2.*c3))) = 1/72 */ -static booleantype __order6i(realtype *b, realtype *c1, realtype **A1, realtype **A2, realtype *c2, realtype *c3, int s) +static booleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s) { - realtype bcAAcc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcAAcc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c2,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1905,11 +1905,11 @@ static booleantype __order6i(realtype *b, realtype *c1, realtype **A1, realtype } /* b'*(c1.*(A1*A2*A3*c2)) = 1/144 */ -static booleantype __order6j(realtype *b, realtype *c1, realtype **A1, realtype **A2, realtype **A3, realtype *c2, int s) +static booleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s) { - realtype bcAAAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bcAAAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A3,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1920,11 +1920,11 @@ static booleantype __order6j(realtype *b, realtype *c1, realtype **A1, realtype } /* b'*A*(c1.*c2.*c3.*c4) = 1/30 */ -static booleantype __order6k(realtype *b, realtype **A, realtype *c1, realtype *c2, realtype *c3, realtype *c4, int s) +static booleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) { - realtype bAcccc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAcccc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c4,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1935,11 +1935,11 @@ static booleantype __order6k(realtype *b, realtype **A, realtype *c1, realtype * } /* b'*A1*(c1.*c2.*(A2*c3)) = 1/60 */ -static booleantype __order6l(realtype *b, realtype **A1, realtype *c1, realtype *c2, realtype **A2, realtype *c3, int s) +static booleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) { - realtype bAccAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAccAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A2,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1950,12 +1950,12 @@ static booleantype __order6l(realtype *b, realtype **A1, realtype *c1, realtype } /* b'*A1*((A2*c1).*(A3*c2)) = 1/120 */ -static booleantype __order6m(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype **A3, realtype *c2, int s) +static booleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) { - realtype bAAcAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); - realtype *tmp3 = calloc( s, sizeof(realtype) ); + sunrealtype bAAcAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp3 = calloc( s, sizeof(sunrealtype) ); if (__mv(A3,c2,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__mv(A2,c1,s,tmp2)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__vv(tmp1,tmp2,s,tmp3)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1966,11 +1966,11 @@ static booleantype __order6m(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*A1*(c1.*(A2*(c2.*c3))) = 1/90 */ -static booleantype __order6n(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype *c2, realtype *c3, int s) +static booleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s) { - realtype bAcAcc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAcAcc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c2,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1981,11 +1981,11 @@ static booleantype __order6n(realtype *b, realtype **A1, realtype *c1, realtype } /* b'*A1*(c1.*(A2*A3*c2)) = 1/180 */ -static booleantype __order6o(realtype *b, realtype **A1, realtype *c1, realtype **A2, realtype **A3, realtype *c2, int s) +static booleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s) { - realtype bAcAAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAcAAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A3,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -1996,11 +1996,11 @@ static booleantype __order6o(realtype *b, realtype **A1, realtype *c1, realtype } /* b'*A1*A2*(c1.*c2.*c3) = 1/120 */ -static booleantype __order6p(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype *c2, realtype *c3, int s) +static booleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) { - realtype bAAccc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAAccc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -2011,11 +2011,11 @@ static booleantype __order6p(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*A1*A2*(c1.*(A3*c2)) = 1/240 */ -static booleantype __order6q(realtype *b, realtype **A1, realtype **A2, realtype *c1, realtype **A3, realtype *c2, int s) +static booleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) { - realtype bAAcAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAAcAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A3,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__vv(c1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -2026,11 +2026,11 @@ static booleantype __order6q(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*A1*A2*A3*(c1.*c2) = 1/360 */ -static booleantype __order6r(realtype *b, realtype **A1, realtype **A2, realtype **A3, realtype *c1, realtype *c2, int s) +static booleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c1, sunrealtype *c2, int s) { - realtype bAAAcc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAAAcc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__vv(c1,c2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -2041,11 +2041,11 @@ static booleantype __order6r(realtype *b, realtype **A1, realtype **A2, realtype } /* b'*A1*A2*A3*A4*c = 1/720 */ -static booleantype __order6s(realtype *b, realtype **A1, realtype **A2, realtype **A3, realtype **A4, realtype *c, int s) +static booleantype __order6s(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype **A4, sunrealtype *c, int s) { - realtype bAAAAc; - realtype *tmp1 = calloc( s, sizeof(realtype) ); - realtype *tmp2 = calloc( s, sizeof(realtype) ); + sunrealtype bAAAAc; + sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); + sunrealtype *tmp2 = calloc( s, sizeof(sunrealtype) ); if (__mv(A4,c,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__mv(A2,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } @@ -2060,12 +2060,12 @@ static booleantype __order6s(realtype *b, realtype **A1, realtype **A2, realtype Utility routine to check Butcher's simplifying assumptions. Returns the maximum predicted order. ---------------------------------------------------------------*/ -static int __ButcherSimplifyingAssumptions(realtype **A, realtype *b, realtype *c, int s) +static int __ButcherSimplifyingAssumptions(sunrealtype **A, sunrealtype *b, sunrealtype *c, int s) { int P, Q, R, i, j, k, q; - realtype RHS, LHS; + sunrealtype RHS, LHS; booleantype alltrue; - realtype *tmp = calloc( s, sizeof(realtype) ); + sunrealtype *tmp = calloc( s, sizeof(sunrealtype) ); /* B(P) */ P = 0; diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index f21aa2602b..62e80a5087 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -30,7 +30,7 @@ ERKStep Exported functions -- Required ===============================================================*/ -void* ERKStepCreate(ARKRhsFn f, realtype t0, N_Vector y0, SUNContext sunctx) +void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { ARKodeMem ark_mem; ARKodeERKStepMem step_mem; @@ -130,8 +130,8 @@ void* ERKStepCreate(ARKRhsFn f, realtype t0, N_Vector y0, SUNContext sunctx) It first resizes the main ARKODE infrastructure memory, and then resizes its own data. ---------------------------------------------------------------*/ -int ERKStepResize(void *arkode_mem, N_Vector y0, realtype hscale, - realtype t0, ARKVecResizeFn resize, void *resize_data) +int ERKStepResize(void *arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void *resize_data) { ARKodeMem ark_mem; ARKodeERKStepMem step_mem; @@ -185,7 +185,7 @@ int ERKStepResize(void *arkode_mem, N_Vector y0, realtype hscale, Note all internal counters are set to 0 on re-initialization. ---------------------------------------------------------------*/ -int ERKStepReInit(void* arkode_mem, ARKRhsFn f, realtype t0, N_Vector y0) +int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) { ARKodeMem ark_mem; ARKodeERKStepMem step_mem; @@ -242,7 +242,7 @@ int ERKStepReInit(void* arkode_mem, ARKRhsFn f, realtype t0, N_Vector y0) problem from the given time with the input state (all counter values are retained). ---------------------------------------------------------------*/ -int ERKStepReset(void* arkode_mem, realtype tR, N_Vector yR) +int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { ARKodeMem ark_mem; ARKodeERKStepMem step_mem; @@ -272,7 +272,7 @@ int ERKStepReset(void* arkode_mem, realtype tR, N_Vector yR) These routines set integration tolerances (wrappers for general ARKODE utility routines) ---------------------------------------------------------------*/ -int ERKStepSStolerances(void *arkode_mem, realtype reltol, realtype abstol) +int ERKStepSStolerances(void *arkode_mem, sunrealtype reltol, sunrealtype abstol) { /* unpack ark_mem, call arkSStolerances, and return */ ARKodeMem ark_mem; @@ -286,7 +286,7 @@ int ERKStepSStolerances(void *arkode_mem, realtype reltol, realtype abstol) } -int ERKStepSVtolerances(void *arkode_mem, realtype reltol, N_Vector abstol) +int ERKStepSVtolerances(void *arkode_mem, sunrealtype reltol, N_Vector abstol) { /* unpack ark_mem, call arkSVtolerances, and return */ ARKodeMem ark_mem; @@ -328,8 +328,8 @@ int ERKStepRootInit(void *arkode_mem, int nrtfn, ARKRootFn g) } -int ERKStepEvolve(void *arkode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask) +int ERKStepEvolve(void *arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask) { /* unpack ark_mem, call arkEvolve, and return */ int retval; @@ -347,7 +347,7 @@ int ERKStepEvolve(void *arkode_mem, realtype tout, N_Vector yout, } -int ERKStepGetDky(void *arkode_mem, realtype t, int k, N_Vector dky) +int ERKStepGetDky(void *arkode_mem, sunrealtype t, int k, N_Vector dky) { /* unpack ark_mem, call arkGetDky, and return */ int retval; @@ -459,7 +459,7 @@ void ERKStepPrintMem(void* arkode_mem, FILE* outfile) /* output long integer quantities */ fprintf(outfile,"ERKStep: nfe = %li\n", step_mem->nfe); - /* output realtype quantities */ + /* output sunrealtype quantities */ fprintf(outfile,"ERKStep: Butcher table:\n"); ARKodeButcherTable_Write(step_mem->B, outfile); @@ -559,7 +559,7 @@ int erkStep_Init(void* arkode_mem, int init_type) /* Allocate reusable arrays for fused vector interface */ if (step_mem->cvals == NULL) { - step_mem->cvals = (realtype *) calloc(step_mem->stages+1, sizeof(realtype)); + step_mem->cvals = (sunrealtype *) calloc(step_mem->stages+1, sizeof(sunrealtype)); if (step_mem->cvals == NULL) return(ARK_MEM_FAIL); ark_mem->lrw += (step_mem->stages + 1); } @@ -624,7 +624,7 @@ int erkStep_Init(void* arkode_mem, int init_type) steps, so we strive to store the intermediate parts so that they do not interfere with the other two modes. ---------------------------------------------------------------*/ -int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int erkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { int retval; @@ -739,10 +739,10 @@ int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) +int erkStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr) { int retval, is, js, nvec; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeMem ark_mem; ARKodeERKStepMem step_mem; @@ -1004,7 +1004,7 @@ int erkStep_CheckButcherTable(ARKodeMem ark_mem) int i, j; booleantype okay; ARKodeERKStepMem step_mem; - realtype tol = RCONST(1.0e-12); + sunrealtype tol = RCONST(1.0e-12); /* access ARKodeERKStepMem structure */ if (ark_mem->step_mem==NULL) { @@ -1102,12 +1102,12 @@ int erkStep_CheckButcherTable(ARKodeMem ark_mem) Note: at this point in the step, the vector ark_tempv1 may be used as a temporary vector. ---------------------------------------------------------------*/ -int erkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) +int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsmPtr) { /* local data */ int retval, j, nvec; N_Vector y, yerr; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeERKStepMem step_mem; @@ -1178,7 +1178,7 @@ int erkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsmPtr) int erkStep_RelaxDeltaY(ARKodeMem ark_mem, N_Vector delta_y) { int i, nvec, retval; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeERKStepMem step_mem; @@ -1221,7 +1221,7 @@ int erkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, long int* num_relax_jac_evals, sunrealtype* delta_e_out) { int i, j, nvec, retval; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeERKStepMem step_mem; N_Vector z_stage = ark_mem->tempv2; diff --git a/src/arkode/arkode_erkstep_impl.h b/src/arkode/arkode_erkstep_impl.h index f3684d9d39..1c25db0846 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -59,7 +59,7 @@ typedef struct ARKodeERKStepMemRec { long int nfe; /* num fe calls */ /* Reusable arrays for fused vector operations */ - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; } *ARKodeERKStepMem; @@ -71,9 +71,9 @@ typedef struct ARKodeERKStepMemRec { /* Interface routines supplied to ARKODE */ int erkStep_Init(void* arkode_mem, int init_type); -int erkStep_FullRHS(void* arkode_mem, realtype t, +int erkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr); +int erkStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); /* Internal utility routines */ int erkStep_AccessStepMem(void* arkode_mem, const char *fname, @@ -81,7 +81,7 @@ int erkStep_AccessStepMem(void* arkode_mem, const char *fname, booleantype erkStep_CheckNVector(N_Vector tmpl); int erkStep_SetButcherTable(ARKodeMem ark_mem); int erkStep_CheckButcherTable(ARKodeMem ark_mem); -int erkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsm); +int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsm); /* private functions for relaxation */ int erkStep_RelaxDeltaY(ARKodeMem ark_mem, N_Vector delta_y); diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 53ba691d34..2664b9654e 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -49,13 +49,13 @@ int ERKStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int ERKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { return(arkSetMaxHnilWarns(arkode_mem, mxhnil)); } -int ERKStepSetInitStep(void *arkode_mem, realtype hin) { +int ERKStepSetInitStep(void *arkode_mem, sunrealtype hin) { return(arkSetInitStep(arkode_mem, hin)); } -int ERKStepSetMinStep(void *arkode_mem, realtype hmin) { +int ERKStepSetMinStep(void *arkode_mem, sunrealtype hmin) { return(arkSetMinStep(arkode_mem, hmin)); } -int ERKStepSetMaxStep(void *arkode_mem, realtype hmax) { +int ERKStepSetMaxStep(void *arkode_mem, sunrealtype hmax) { return(arkSetMaxStep(arkode_mem, hmax)); } -int ERKStepSetStopTime(void *arkode_mem, realtype tstop) { +int ERKStepSetStopTime(void *arkode_mem, sunrealtype tstop) { return(arkSetStopTime(arkode_mem, tstop)); } int ERKStepSetInterpolateStopTime(void *arkode_mem, booleantype interp) { @@ -76,26 +76,26 @@ int ERKStepSetPostprocessStepFn(void *arkode_mem, int ERKStepSetPostprocessStageFn(void *arkode_mem, ARKPostProcessFn ProcessStage) { return(arkSetPostprocessStageFn(arkode_mem, ProcessStage)); } -int ERKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac) { +int ERKStepSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac) { return(arkSetCFLFraction(arkode_mem, cfl_frac)); } -int ERKStepSetSafetyFactor(void *arkode_mem, realtype safety) { +int ERKStepSetSafetyFactor(void *arkode_mem, sunrealtype safety) { return(arkSetSafetyFactor(arkode_mem, safety)); } -int ERKStepSetErrorBias(void *arkode_mem, realtype bias) { +int ERKStepSetErrorBias(void *arkode_mem, sunrealtype bias) { return(arkSetErrorBias(arkode_mem, bias)); } -int ERKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth) { +int ERKStepSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth) { return(arkSetMaxGrowth(arkode_mem, mx_growth)); } -int ERKStepSetMinReduction(void *arkode_mem, realtype eta_min) { +int ERKStepSetMinReduction(void *arkode_mem, sunrealtype eta_min) { return(arkSetMinReduction(arkode_mem, eta_min)); } -int ERKStepSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub) { +int ERKStepSetFixedStepBounds(void *arkode_mem, sunrealtype lb, sunrealtype ub) { return(arkSetFixedStepBounds(arkode_mem, lb, ub)); } int ERKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) { + int pq, sunrealtype adapt_params[3]) { return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } int ERKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { return(arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } -int ERKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) { +int ERKStepSetMaxFirstGrowth(void *arkode_mem, sunrealtype etamx1) { return(arkSetMaxFirstGrowth(arkode_mem, etamx1)); } -int ERKStepSetMaxEFailGrowth(void *arkode_mem, realtype etamxf) { +int ERKStepSetMaxEFailGrowth(void *arkode_mem, sunrealtype etamxf) { return(arkSetMaxEFailGrowth(arkode_mem, etamxf)); } int ERKStepSetSmallNumEFails(void *arkode_mem, int small_nef) { return(arkSetSmallNumEFails(arkode_mem, small_nef)); } @@ -103,7 +103,7 @@ int ERKStepSetStabilityFn(void *arkode_mem, ARKExpStabFn EStab, void *estab_data return(arkSetStabilityFn(arkode_mem, EStab, estab_data)); } int ERKStepSetMaxErrTestFails(void *arkode_mem, int maxnef) { return(arkSetMaxErrTestFails(arkode_mem, maxnef)); } -int ERKStepSetFixedStep(void *arkode_mem, realtype hfixed) { +int ERKStepSetFixedStep(void *arkode_mem, sunrealtype hfixed) { return(arkSetFixedStep(arkode_mem, hfixed)); } @@ -116,15 +116,15 @@ int ERKStepGetNumStepAttempts(void *arkode_mem, long int *nstep_attempts) { return(arkGetNumStepAttempts(arkode_mem, nstep_attempts)); } int ERKStepGetNumSteps(void *arkode_mem, long int *nsteps) { return(arkGetNumSteps(arkode_mem, nsteps)); } -int ERKStepGetActualInitStep(void *arkode_mem, realtype *hinused) { +int ERKStepGetActualInitStep(void *arkode_mem, sunrealtype *hinused) { return(arkGetActualInitStep(arkode_mem, hinused)); } -int ERKStepGetLastStep(void *arkode_mem, realtype *hlast) { +int ERKStepGetLastStep(void *arkode_mem, sunrealtype *hlast) { return(arkGetLastStep(arkode_mem, hlast)); } -int ERKStepGetCurrentStep(void *arkode_mem, realtype *hcur) { +int ERKStepGetCurrentStep(void *arkode_mem, sunrealtype *hcur) { return(arkGetCurrentStep(arkode_mem, hcur)); } -int ERKStepGetCurrentTime(void *arkode_mem, realtype *tcur) { +int ERKStepGetCurrentTime(void *arkode_mem, sunrealtype *tcur) { return(arkGetCurrentTime(arkode_mem, tcur)); } -int ERKStepGetTolScaleFactor(void *arkode_mem, realtype *tolsfact) { +int ERKStepGetTolScaleFactor(void *arkode_mem, sunrealtype *tolsfact) { return(arkGetTolScaleFactor(arkode_mem, tolsfact)); } int ERKStepGetErrWeights(void *arkode_mem, N_Vector eweight) { return(arkGetErrWeights(arkode_mem, eweight)); } @@ -135,8 +135,8 @@ int ERKStepGetNumGEvals(void *arkode_mem, long int *ngevals) { int ERKStepGetRootInfo(void *arkode_mem, int *rootsfound) { return(arkGetRootInfo(arkode_mem, rootsfound)); } int ERKStepGetStepStats(void *arkode_mem, long int *nsteps, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur) { + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur) { return(arkGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } int ERKStepGetNumConstrFails(void *arkode_mem, long int *nconstrfails) { return(arkGetNumConstrFails(arkode_mem, nconstrfails)); } diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 32c73219ee..398a939e6e 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -151,26 +151,26 @@ extern "C" { /* linear solver interface functions */ typedef int (*ARKLinsolInitFn)(void* arkode_mem); typedef int (*ARKLinsolSetupFn)(void* arkode_mem, int convfail, - realtype tpred, N_Vector ypred, + sunrealtype tpred, N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); typedef int (*ARKLinsolSolveFn)(void* arkode_mem, N_Vector b, - realtype tcur, N_Vector ycur, - N_Vector fcur, realtype client_tol, + sunrealtype tcur, N_Vector ycur, + N_Vector fcur, sunrealtype client_tol, int mnewt); typedef int (*ARKLinsolFreeFn)(void* arkode_mem); /* mass-matrix solver interface functions */ typedef int (*ARKMassInitFn)(void *arkode_mem); -typedef int (*ARKMassSetupFn)(void *arkode_mem, realtype t, +typedef int (*ARKMassSetupFn)(void *arkode_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); typedef int (*ARKMassMultFn)(void *arkode_mem, N_Vector v, N_Vector Mv); typedef int (*ARKMassSolveFn)(void *arkode_mem, N_Vector b, - realtype client_tol); + sunrealtype client_tol); typedef int (*ARKMassFreeFn)(void *arkode_mem); /* time stepper interface functions */ @@ -197,13 +197,13 @@ typedef void* (*ARKTimestepGetLinMemFn)(void* arkode_mem); typedef void* (*ARKTimestepGetMassMemFn)(void* arkode_mem); typedef ARKRhsFn (*ARKTimestepGetImplicitRHSFn)(void* arkode_mem); typedef int (*ARKTimestepGetGammasFn)(void* arkode_mem, - realtype *gamma, - realtype *gamrat, + sunrealtype *gamma, + sunrealtype *gamrat, booleantype **jcur, booleantype *dgamma_fail); -typedef int (*ARKTimestepFullRHSFn)(void* arkode_mem, realtype t, +typedef int (*ARKTimestepFullRHSFn)(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -typedef int (*ARKTimestepStepFn)(void* arkode_mem, realtype *dsm, +typedef int (*ARKTimestepStepFn)(void* arkode_mem, sunrealtype *dsm, int *nflag); @@ -226,10 +226,10 @@ struct _generic_ARKInterpOps { void (*free)(void* arkode_mem, ARKInterp interp); void (*print)(ARKInterp interp, FILE *outfile); int (*setdegree)(void *arkode_mem, ARKInterp interp, int degree); - int (*init)(void* arkode_mem, ARKInterp interp, realtype tnew); - int (*update)(void* arkode_mem, ARKInterp interp, realtype tnew); + int (*init)(void* arkode_mem, ARKInterp interp, sunrealtype tnew); + int (*update)(void* arkode_mem, ARKInterp interp, sunrealtype tnew); int (*evaluate)(void* arkode_mem, ARKInterp interp, - realtype tau, int d, int order, N_Vector yout); + sunrealtype tau, int d, int order, N_Vector yout); }; /* An interpolation module consists of an implementation-dependent 'content' @@ -247,10 +247,10 @@ int arkInterpResize(void* arkode_mem, ARKInterp interp, void arkInterpFree(void* arkode_mem, ARKInterp interp); void arkInterpPrintMem(ARKInterp interp, FILE *outfile); int arkInterpSetDegree(void *arkode_mem, ARKInterp interp, int degree); -int arkInterpInit(void* arkode_mem, ARKInterp interp, realtype tnew); -int arkInterpUpdate(void* arkode_mem, ARKInterp interp, realtype tnew); +int arkInterpInit(void* arkode_mem, ARKInterp interp, sunrealtype tnew); +int arkInterpUpdate(void* arkode_mem, ARKInterp interp, sunrealtype tnew); int arkInterpEvaluate(void* arkode_mem, ARKInterp interp, - realtype tau, int d, int order, N_Vector yout); + sunrealtype tau, int d, int order, N_Vector yout); /*=============================================================== @@ -289,7 +289,7 @@ struct ARKodeMemRec { SUNContext sunctx; - realtype uround; /* machine unit roundoff */ + sunrealtype uround; /* machine unit roundoff */ /* Problem specification data */ void *user_data; /* user ptr passed to supplied functions */ @@ -299,11 +299,11 @@ struct ARKodeMemRec int ritol; /* itol = ARK_SS (scalar, default), ARK_SV (vector), ARK_WF (user weight function) */ - realtype reltol; /* relative tolerance */ - realtype Sabstol; /* scalar absolute solution tolerance */ + sunrealtype reltol; /* relative tolerance */ + sunrealtype Sabstol; /* scalar absolute solution tolerance */ N_Vector Vabstol; /* vector absolute solution tolerance */ booleantype atolmin0; /* flag indicating that min(abstol) = 0 */ - realtype SRabstol; /* scalar absolute residual tolerance */ + sunrealtype SRabstol; /* scalar absolute residual tolerance */ N_Vector VRabstol; /* vector absolute residual tolerance */ booleantype Ratolmin0; /* flag indicating that min(Rabstol) = 0 */ booleantype user_efun; /* SUNTRUE if user sets efun */ @@ -350,21 +350,21 @@ struct ARKodeMemRec /* Tstop information */ booleantype tstopset; booleantype tstopinterp; - realtype tstop; + sunrealtype tstop; /* Time step data */ - realtype hin; /* initial step size */ - realtype h; /* current step size */ - realtype hmin; /* |h| >= hmin */ - realtype hmax_inv; /* |h| <= 1/hmax_inv */ - realtype hprime; /* next actual step size to be used */ - realtype next_h; /* next dynamical step size (only used in + sunrealtype hin; /* initial step size */ + sunrealtype h; /* current step size */ + sunrealtype hmin; /* |h| >= hmin */ + sunrealtype hmax_inv; /* |h| <= 1/hmax_inv */ + sunrealtype hprime; /* next actual step size to be used */ + sunrealtype next_h; /* next dynamical step size (only used in getCurrentStep); note that this could overtake tstop */ - realtype eta; /* eta = hprime / h */ - realtype tcur; /* current internal value of t + sunrealtype eta; /* eta = hprime / h */ + sunrealtype tcur; /* current internal value of t (changes with each stage) */ - realtype tretlast; /* value of tret last returned by ARKODE */ + sunrealtype tretlast; /* value of tret last returned by ARKODE */ booleantype fixedstep; /* flag to disable temporal adaptivity */ ARKodeHAdaptMem hadapt_mem; /* time step adaptivity structure */ @@ -391,17 +391,17 @@ struct ARKodeMemRec FILE *diagfp; /* diagnostic outputs are sent to diagfp */ /* Space requirements for ARKODE */ - sunindextype lrw1; /* no. of realtype words in 1 N_Vector */ + sunindextype lrw1; /* no. of sunrealtype words in 1 N_Vector */ sunindextype liw1; /* no. of integer words in 1 N_Vector */ - long int lrw; /* no. of realtype words in ARKODE work vectors */ + long int lrw; /* no. of sunrealtype words in ARKODE work vectors */ long int liw; /* no. of integer words in ARKODE work vectors */ /* Saved Values */ - realtype h0u; /* actual initial stepsize */ - realtype tn; /* time of last successful step */ - realtype terr; /* error in tn for compensated sums */ - realtype hold; /* last successful h value used */ - realtype tolsf; /* tolerance scale factor (suggestion to user) */ + sunrealtype h0u; /* actual initial stepsize */ + sunrealtype tn; /* time of last successful step */ + sunrealtype terr; /* error in tn for compensated sums */ + sunrealtype hold; /* last successful h value used */ + sunrealtype tolsf; /* tolerance scale factor (suggestion to user) */ booleantype VabstolMallocDone; booleantype VRabstolMallocDone; booleantype MallocDone; @@ -625,7 +625,7 @@ struct ARKodeMemRec --------------------------------------------------------------- This must solve the linear equation M x = b, where M is the system mass matrix, and the RHS vector b is input. The - realtype client_tol contains the desired accuracy (in the wrms + sunrealtype client_tol contains the desired accuracy (in the wrms norm) of the routine calling the solver; the ARKDLS solver ignore this value and the ARKSPILS solver tightens it by the factor eplifac. The solution is to be returned in the vector b. @@ -876,7 +876,7 @@ void arkErrHandler(int error_code, const char *module, const char *function, char *msg, void *data); /* Prototype of internal explicit stability estimation function */ -int arkExpStab(N_Vector y, realtype t, realtype *hstab, void *user_data); +int arkExpStab(N_Vector y, sunrealtype t, sunrealtype *hstab, void *user_data); /*=============================================================== HIGH LEVEL ERROR HANDLER, USED THROUGHOUT ARKODE @@ -895,7 +895,7 @@ void arkProcessError(ARKodeMem ark_mem, int error_code, #define SUNDIALS_UNUSED #endif -int arkInit(ARKodeMem ark_mem, realtype t0, N_Vector y0, int init_type); +int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type); booleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector *v); booleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector **v, sunindextype lrw1, long int *lrw, @@ -928,16 +928,16 @@ booleantype arkResizeVectors(ARKodeMem ark_mem, N_Vector tmpl); void arkFreeVectors(ARKodeMem ark_mem); -int arkInitialSetup(ARKodeMem ark_mem, realtype tout); -int arkStopTests(ARKodeMem ark_mem, realtype tout, N_Vector yout, - realtype *tret, int itask, int *ier); -int arkHin(ARKodeMem ark_mem, realtype tout); -realtype arkUpperBoundH0(ARKodeMem ark_mem, - realtype tdist); -int arkYddNorm(ARKodeMem ark_mem, realtype hg, - realtype *yddnrm); +int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout); +int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask, int *ier); +int arkHin(ARKodeMem ark_mem, sunrealtype tout); +sunrealtype arkUpperBoundH0(ARKodeMem ark_mem, + sunrealtype tdist); +int arkYddNorm(ARKodeMem ark_mem, sunrealtype hg, + sunrealtype *yddnrm); -int arkCompleteStep(ARKodeMem ark_mem, realtype dsm); +int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm); int arkHandleFailure(ARKodeMem ark_mem,int flag); int arkEwtSetSS(N_Vector ycur, N_Vector weight, void* arkode_mem); @@ -949,34 +949,34 @@ int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight); ARKodeMem arkCreate(SUNContext sunctx); -int arkResize(ARKodeMem ark_mem, N_Vector ynew, realtype hscale, - realtype t0, ARKVecResizeFn resize, void *resize_data); -int arkSStolerances(ARKodeMem ark_mem, realtype reltol, realtype abstol); -int arkSVtolerances(ARKodeMem ark_mem, realtype reltol, N_Vector abstol); +int arkResize(ARKodeMem ark_mem, N_Vector ynew, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void *resize_data); +int arkSStolerances(ARKodeMem ark_mem, sunrealtype reltol, sunrealtype abstol); +int arkSVtolerances(ARKodeMem ark_mem, sunrealtype reltol, N_Vector abstol); int arkWFtolerances(ARKodeMem ark_mem, ARKEwtFn efun); -int arkResStolerance(ARKodeMem ark_mem, realtype rabstol); +int arkResStolerance(ARKodeMem ark_mem, sunrealtype rabstol); int arkResVtolerance(ARKodeMem ark_mem, N_Vector rabstol); int arkResFtolerance(ARKodeMem ark_mem, ARKRwtFn rfun); int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g); -int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, - realtype *tret, int itask); -int arkGetDky(ARKodeMem ark_mem, realtype t, int k, N_Vector dky); +int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask); +int arkGetDky(ARKodeMem ark_mem, sunrealtype t, int k, N_Vector dky); void arkFree(void **arkode_mem); int arkWriteParameters(ARKodeMem ark_mem, FILE *fp); -int arkPredict_MaximumOrder(ARKodeMem ark_mem, realtype tau, +int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); -int arkPredict_VariableOrder(ARKodeMem ark_mem, realtype tau, +int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); -int arkPredict_CutoffOrder(ARKodeMem ark_mem, realtype tau, +int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); -int arkPredict_Bootstrap(ARKodeMem ark_mem, realtype hj, - realtype tau, int nvec, realtype *cvals, +int arkPredict_Bootstrap(ARKodeMem ark_mem, sunrealtype hj, + sunrealtype tau, int nvec, sunrealtype *cvals, N_Vector *Xvecs, N_Vector yguess); int arkCheckConvergence(ARKodeMem ark_mem, int *nflagPtr, int *ncfPtr); int arkCheckConstraints(ARKodeMem ark_mem, int *nflag, int *constrfails); int arkCheckTemporalError(ARKodeMem ark_mem, int *nflagPtr, int *nefPtr, - realtype dsm); + sunrealtype dsm); int arkAccessHAdaptMem(void* arkode_mem, const char *fname, ARKodeMem *ark_mem, ARKodeHAdaptMem *hadapt_mem); @@ -992,13 +992,13 @@ int arkSetUserData(void *arkode_mem, void *user_data); int arkSetDiagnostics(void *arkode_mem, FILE *diagfp); int arkSetMaxNumSteps(void *arkode_mem, long int mxsteps); int arkSetMaxHnilWarns(void *arkode_mem, int mxhnil); -int arkSetInitStep(void *arkode_mem, realtype hin); -int arkSetMinStep(void *arkode_mem, realtype hmin); -int arkSetMaxStep(void *arkode_mem, realtype hmax); -int arkSetStopTime(void *arkode_mem, realtype tstop); +int arkSetInitStep(void *arkode_mem, sunrealtype hin); +int arkSetMinStep(void *arkode_mem, sunrealtype hmin); +int arkSetMaxStep(void *arkode_mem, sunrealtype hmax); +int arkSetStopTime(void *arkode_mem, sunrealtype tstop); int arkSetInterpolateStopTime(void *arkode_mem, booleantype interp); int arkClearStopTime(void *arkode_mem); -int arkSetFixedStep(void *arkode_mem, realtype hfixed); +int arkSetFixedStep(void *arkode_mem, sunrealtype hfixed); int arkSetRootDirection(void *arkode_mem, int *rootdir); int arkSetNoInactiveRootWarn(void *arkode_mem); int arkSetPostprocessStepFn(void *arkode_mem, @@ -1007,19 +1007,19 @@ int arkSetPostprocessStageFn(void *arkode_mem, ARKPostProcessFn ProcessStage); int arkSetConstraints(void *arkode_mem, N_Vector constraints); int arkSetMaxNumConstrFails(void *arkode_mem, int maxfails); -int arkSetCFLFraction(void *arkode_mem, realtype cfl_frac); -int arkSetSafetyFactor(void *arkode_mem, realtype safety); -int arkSetErrorBias(void *arkode_mem, realtype bias); -int arkSetMaxGrowth(void *arkode_mem, realtype mx_growth); -int arkSetMinReduction(void *arkode_mem, realtype eta_min); -int arkSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub); +int arkSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac); +int arkSetSafetyFactor(void *arkode_mem, sunrealtype safety); +int arkSetErrorBias(void *arkode_mem, sunrealtype bias); +int arkSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth); +int arkSetMinReduction(void *arkode_mem, sunrealtype eta_min); +int arkSetFixedStepBounds(void *arkode_mem, sunrealtype lb, sunrealtype ub); int arkSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]); + int pq, sunrealtype adapt_params[3]); int arkSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data); -int arkSetMaxFirstGrowth(void *arkode_mem, realtype etamx1); -int arkSetMaxEFailGrowth(void *arkode_mem, realtype etamxf); +int arkSetMaxFirstGrowth(void *arkode_mem, sunrealtype etamx1); +int arkSetMaxEFailGrowth(void *arkode_mem, sunrealtype etamxf); int arkSetSmallNumEFails(void *arkode_mem, int small_nef); -int arkSetMaxCFailGrowth(void *arkode_mem, realtype etacf); +int arkSetMaxCFailGrowth(void *arkode_mem, sunrealtype etacf); int arkSetStabilityFn(void *arkode_mem, ARKExpStabFn EStab, void *estab_data); int arkSetMaxErrTestFails(void *arkode_mem, int maxnef); int arkSetMaxConvFails(void *arkode_mem, int maxncf); @@ -1027,12 +1027,12 @@ int arkSetUseCompensatedSums(void *arkode_mem, sunbooleantype onoff); int arkGetWorkSpace(void *arkode_mem, long int *lenrw, long int *leniw); int arkGetNumStepAttempts(void *arkode_mem, long int *nstep_attempts); int arkGetNumSteps(void *arkode_mem, long int *nsteps); -int arkGetActualInitStep(void *arkode_mem, realtype *hinused); -int arkGetLastStep(void *arkode_mem, realtype *hlast); -int arkGetCurrentStep(void *arkode_mem, realtype *hcur); +int arkGetActualInitStep(void *arkode_mem, sunrealtype *hinused); +int arkGetLastStep(void *arkode_mem, sunrealtype *hlast); +int arkGetCurrentStep(void *arkode_mem, sunrealtype *hcur); int arkGetCurrentState(void *arkode_mem, N_Vector *ycur); -int arkGetCurrentTime(void *arkode_mem, realtype *tcur); -int arkGetTolScaleFactor(void *arkode_mem, realtype *tolsfac); +int arkGetCurrentTime(void *arkode_mem, sunrealtype *tcur); +int arkGetTolScaleFactor(void *arkode_mem, sunrealtype *tolsfac); int arkGetErrWeights(void *arkode_mem, N_Vector eweight); int arkGetResWeights(void *arkode_mem, N_Vector rweight); int arkGetNumGEvals(void *arkode_mem, long int *ngevals); @@ -1043,8 +1043,8 @@ int arkGetNumAccSteps(void *arkode_mem, long int *nsteps); int arkGetNumErrTestFails(void *arkode_mem, long int *netfails); int arkGetNumStepSolveFails(void *arkode_mem, long int *nncfails); int arkGetStepStats(void *arkode_mem, long int *nsteps, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur); + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur); int arkGetUserData(void *arkode_mem, void** user_data); int arkPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt); diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index 30ee7aece8..7f726dc2a7 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -65,20 +65,20 @@ int arkInterpSetDegree(void* arkode_mem, ARKInterp interp, } int arkInterpInit(void* arkode_mem, ARKInterp interp, - realtype tnew) + sunrealtype tnew) { if (interp == NULL) return(ARK_SUCCESS); return((int) interp->ops->init(arkode_mem, interp, tnew)); } -int arkInterpUpdate(void* arkode_mem, ARKInterp interp, realtype tnew) +int arkInterpUpdate(void* arkode_mem, ARKInterp interp, sunrealtype tnew) { if (interp == NULL) return(ARK_SUCCESS); return((int) interp->ops->update(arkode_mem, interp, tnew)); } int arkInterpEvaluate(void* arkode_mem, ARKInterp interp, - realtype tau, int d, int order, N_Vector yout) + sunrealtype tau, int d, int order, N_Vector yout) { if (interp == NULL) return(ARK_SUCCESS); return((int) interp->ops->evaluate(arkode_mem, interp, @@ -369,7 +369,7 @@ int arkInterpSetDegree_Hermite(void* arkode_mem, ARKInterp interp, 5. Copies fnew into fold ---------------------------------------------------------------*/ int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, - realtype tnew) + sunrealtype tnew) { ARKodeMem ark_mem; @@ -422,7 +422,7 @@ int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, This routine copies ynew into yold, and fnew into fold, so that yold and fold contain the previous values. ---------------------------------------------------------------*/ -int arkInterpUpdate_Hermite(void* arkode_mem, ARKInterp interp, realtype tnew) +int arkInterpUpdate_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tnew) { ARKodeMem ark_mem; @@ -474,13 +474,13 @@ int arkInterpUpdate_Hermite(void* arkode_mem, ARKInterp interp, realtype tnew) other values result in extrapolation. ---------------------------------------------------------------*/ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, - realtype tau, int d, int order, N_Vector yout) + sunrealtype tau, int d, int order, N_Vector yout) { /* local variables */ int q, retval; - realtype tval, a0, a1, tau2, tau3, tau4, tau5; - realtype h, h2, h3, h4, h5; - realtype a[6]; + sunrealtype tval, a0, a1, tau2, tau3, tau4, tau5; + sunrealtype h, h2, h3, h4, h5; + sunrealtype a[6]; N_Vector X[6]; ARKodeMem ark_mem; @@ -1003,7 +1003,7 @@ int arkInterpSetDegree_Lagrange(void* arkode_mem, ARKInterp I, 4. updates the 'active' history counter to 1 ---------------------------------------------------------------*/ int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp I, - realtype tnew) + sunrealtype tnew) { int i; ARKodeMem ark_mem; @@ -1032,7 +1032,7 @@ int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp I, /* allocate storage for time and solution histories */ if (LINT_THIST(I) == NULL) { - LINT_THIST(I) = (realtype*) malloc(LINT_NMAX(I) * sizeof(realtype)); + LINT_THIST(I) = (sunrealtype*) malloc(LINT_NMAX(I) * sizeof(sunrealtype)); if (LINT_THIST(I) == NULL) { arkInterpFree(ark_mem, I); return(ARK_MEM_FAIL); } @@ -1083,14 +1083,14 @@ int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp I, into the first history vector Otherwise it just returns with success. ---------------------------------------------------------------*/ -int arkInterpUpdate_Lagrange(void* arkode_mem, ARKInterp I, realtype tnew) +int arkInterpUpdate_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tnew) { int i; ARKodeMem ark_mem; - realtype tdiff; + sunrealtype tdiff; N_Vector ytmp; int nhist, nmax; - realtype *thist; + sunrealtype *thist; N_Vector *yhist; /* access ARKodeMem structure */ @@ -1156,17 +1156,17 @@ int arkInterpUpdate_Lagrange(void* arkode_mem, ARKInterp I, realtype tnew) approximate). ---------------------------------------------------------------*/ int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp I, - realtype tau, int deriv, int degree, + sunrealtype tau, int deriv, int degree, N_Vector yout) { /* local variables */ int q, retval, i, j; - realtype tval; - realtype a[6]; + sunrealtype tval; + sunrealtype a[6]; N_Vector X[6]; ARKodeMem ark_mem; int nhist; - realtype *thist; + sunrealtype *thist; N_Vector *yhist; /* access ARKodeMem structure */ @@ -1260,10 +1260,10 @@ int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp I, /* Lagrange utility routines (basis functions and their derivatives) */ -realtype LBasis(ARKInterp I, int j, realtype t) +sunrealtype LBasis(ARKInterp I, int j, sunrealtype t) { int k; - realtype p = ONE; + sunrealtype p = ONE; for (k=0; k= 1.0. Any illegal value implies a reset to the default value. ---------------------------------------------------------------*/ -int arkSetErrorBias(void *arkode_mem, realtype bias) +int arkSetErrorBias(void *arkode_mem, sunrealtype bias) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -923,7 +923,7 @@ int arkSetErrorBias(void *arkode_mem, realtype bias) a separate maximum growth factor. Allowable values must be > 1.0. Any illegal value implies a reset to the default. ---------------------------------------------------------------*/ -int arkSetMaxGrowth(void *arkode_mem, realtype mx_growth) +int arkSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -951,7 +951,7 @@ int arkSetMaxGrowth(void *arkode_mem, realtype mx_growth) must be > 0.0 and < 1.0. Any illegal value implies a reset to the default. ---------------------------------------------------------------*/ -int arkSetMinReduction(void *arkode_mem, realtype eta_min) +int arkSetMinReduction(void *arkode_mem, sunrealtype eta_min) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -978,7 +978,7 @@ int arkSetMinReduction(void *arkode_mem, realtype eta_min) size will remain unchanged. Allowable values must enclose the value 1.0. Any illegal interval implies a reset to the default. ---------------------------------------------------------------*/ -int arkSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub) +int arkSetFixedStepBounds(void *arkode_mem, sunrealtype lb, sunrealtype ub) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1008,7 +1008,7 @@ int arkSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub) will be checked for validity when used by the solver. ---------------------------------------------------------------*/ int arkSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) + int pq, sunrealtype adapt_params[3]) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1099,7 +1099,7 @@ int arkSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) etamx1. Legal values are greater than 1.0. Illegal values imply a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) +int arkSetMaxFirstGrowth(void *arkode_mem, sunrealtype etamx1) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1126,7 +1126,7 @@ int arkSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) etamxf. Legal values are in the interval (0,1]. Illegal values imply a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxEFailGrowth(void *arkode_mem, realtype etamxf) +int arkSetMaxEFailGrowth(void *arkode_mem, sunrealtype etamxf) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1180,7 +1180,7 @@ int arkSetSmallNumEFails(void *arkode_mem, int small_nef) etacf. Legal values are in the interval (0,1]. Illegal values imply a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxCFailGrowth(void *arkode_mem, realtype etacf) +int arkSetMaxCFailGrowth(void *arkode_mem, sunrealtype etacf) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1357,7 +1357,7 @@ int arkGetNumSteps(void *arkode_mem, long int *nsteps) Returns the step size used on the first step ---------------------------------------------------------------*/ -int arkGetActualInitStep(void *arkode_mem, realtype *hinused) +int arkGetActualInitStep(void *arkode_mem, sunrealtype *hinused) { ARKodeMem ark_mem; if (arkode_mem==NULL) { @@ -1377,7 +1377,7 @@ int arkGetActualInitStep(void *arkode_mem, realtype *hinused) Returns the step size used on the last successful step ---------------------------------------------------------------*/ -int arkGetLastStep(void *arkode_mem, realtype *hlast) +int arkGetLastStep(void *arkode_mem, sunrealtype *hlast) { ARKodeMem ark_mem; if (arkode_mem==NULL) { @@ -1397,7 +1397,7 @@ int arkGetLastStep(void *arkode_mem, realtype *hlast) Returns the step size to be attempted on the next step ---------------------------------------------------------------*/ -int arkGetCurrentStep(void *arkode_mem, realtype *hcur) +int arkGetCurrentStep(void *arkode_mem, sunrealtype *hcur) { ARKodeMem ark_mem; if (arkode_mem==NULL) { @@ -1438,7 +1438,7 @@ int arkGetCurrentState(void *arkode_mem, N_Vector *state) Returns the current value of the independent variable ---------------------------------------------------------------*/ -int arkGetCurrentTime(void *arkode_mem, realtype *tcur) +int arkGetCurrentTime(void *arkode_mem, sunrealtype *tcur) { ARKodeMem ark_mem; if (arkode_mem==NULL) { @@ -1458,7 +1458,7 @@ int arkGetCurrentTime(void *arkode_mem, realtype *tcur) Returns a suggested factor for scaling tolerances ---------------------------------------------------------------*/ -int arkGetTolScaleFactor(void *arkode_mem, realtype *tolsfact) +int arkGetTolScaleFactor(void *arkode_mem, sunrealtype *tolsfact) { ARKodeMem ark_mem; if (arkode_mem==NULL) { @@ -1594,8 +1594,8 @@ int arkGetRootInfo(void *arkode_mem, int *rootsfound) Returns step statistics ---------------------------------------------------------------*/ int arkGetStepStats(void *arkode_mem, long int *nsteps, - realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur) + sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur) { ARKodeMem ark_mem; if (arkode_mem==NULL) { diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 71c05682a6..d511a04062 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -32,9 +32,9 @@ #define ONE RCONST(1.0) /* Prototypes for internal functions */ -static int arkLsLinSys(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, +static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, booleantype jok, booleantype *jcur, - realtype gamma, void *user_data, N_Vector tmp1, + sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /*=============================================================== @@ -571,7 +571,7 @@ int arkLSSetMassFn(void *arkode_mem, ARKLsMassFn mass) arkLSSetEpsLin specifies the nonlinear -> linear tolerance scale factor. ---------------------------------------------------------------*/ -int arkLSSetEpsLin(void *arkode_mem, realtype eplifac) +int arkLSSetEpsLin(void *arkode_mem, sunrealtype eplifac) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -592,7 +592,7 @@ int arkLSSetEpsLin(void *arkode_mem, realtype eplifac) converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm). ---------------------------------------------------------------*/ -int arkLSSetNormFactor(void *arkode_mem, realtype nrmfac) +int arkLSSetNormFactor(void *arkode_mem, sunrealtype nrmfac) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -1209,7 +1209,7 @@ char *arkLSGetReturnFlagName(long int flag) arkLSSetMassEpsLin specifies the nonlinear -> linear tolerance scale factor for mass matrix linear systems. ---------------------------------------------------------------*/ -int arkLSSetMassEpsLin(void *arkode_mem, realtype eplifac) +int arkLSSetMassEpsLin(void *arkode_mem, sunrealtype eplifac) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -1230,7 +1230,7 @@ int arkLSSetMassEpsLin(void *arkode_mem, realtype eplifac) converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm). ---------------------------------------------------------------*/ -int arkLSSetMassNormFactor(void *arkode_mem, realtype nrmfac) +int arkLSSetMassNormFactor(void *arkode_mem, sunrealtype nrmfac) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -1643,7 +1643,7 @@ int arkLsATimes(void *arkode_mem, N_Vector v, N_Vector z) ARKLsMem arkls_mem; void* ark_step_massmem; int retval; - realtype gamma, gamrat; + sunrealtype gamma, gamrat; booleantype dgamma_fail, *jcur; /* access ARKLsMem structure */ @@ -1702,7 +1702,7 @@ int arkLsPSetup(void *arkode_mem) { ARKodeMem ark_mem; ARKLsMem arkls_mem; - realtype gamma, gamrat; + sunrealtype gamma, gamrat; booleantype dgamma_fail, *jcur; int retval; @@ -1744,11 +1744,11 @@ int arkLsPSetup(void *arkode_mem) to be NULL. ---------------------------------------------------------------*/ int arkLsPSolve(void *arkode_mem, N_Vector r, N_Vector z, - realtype tol, int lr) + sunrealtype tol, int lr) { ARKodeMem ark_mem; ARKLsMem arkls_mem; - realtype gamma, gamrat; + sunrealtype gamma, gamrat; booleantype dgamma_fail, *jcur; int retval; @@ -1878,7 +1878,7 @@ int arkLsMPSetup(void *arkode_mem) in which the user's psolve routine is allowed to be NULL. ---------------------------------------------------------------*/ int arkLsMPSolve(void *arkode_mem, N_Vector r, N_Vector z, - realtype tol, int lr) + sunrealtype tol, int lr) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -1904,7 +1904,7 @@ int arkLsMPSolve(void *arkode_mem, N_Vector r, N_Vector z, implementations of the difference quotient Jacobian approximation routines. ---------------------------------------------------------------*/ -int arkLsDQJac(realtype t, N_Vector y, N_Vector fy, +int arkLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *arkode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -1975,13 +1975,13 @@ int arkLsDQJac(realtype t, N_Vector y, N_Vector fy, actual computation of the jth column of the Jacobian is done with a call to N_VLinearSum. ---------------------------------------------------------------*/ -int arkLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, +int arkLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, ARKodeMem ark_mem, ARKLsMem arkls_mem, ARKRhsFn fi, N_Vector tmp1) { - realtype fnorm, minInc, inc, inc_inv, yjsaved, srur, conj; - realtype *y_data, *ewt_data, *cns_data; + sunrealtype fnorm, minInc, inc, inc_inv, yjsaved, srur, conj; + sunrealtype *y_data, *ewt_data, *cns_data; N_Vector ftemp, jthCol; sunindextype j, N; int retval = 0; @@ -2054,15 +2054,15 @@ int arkLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, write a simple for loop to set each of the elements of a column in succession. ---------------------------------------------------------------*/ -int arkLsBandDQJac(realtype t, N_Vector y, N_Vector fy, +int arkLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, ARKodeMem ark_mem, ARKLsMem arkls_mem, ARKRhsFn fi, N_Vector tmp1, N_Vector tmp2) { N_Vector ftemp, ytemp; - realtype fnorm, minInc, inc, inc_inv, srur, conj; - realtype *col_j, *ewt_data, *fy_data, *ftemp_data, *y_data, *ytemp_data; - realtype *cns_data; + sunrealtype fnorm, minInc, inc, inc_inv, srur, conj; + sunrealtype *col_j, *ewt_data, *fy_data, *ftemp_data, *y_data, *ytemp_data; + sunrealtype *cns_data; sunindextype group, i, j, width, ngroups, i1, i2; sunindextype N, mupper, mlower; int retval = 0; @@ -2153,13 +2153,13 @@ int arkLsBandDQJac(realtype t, N_Vector y, N_Vector fy, Jv = [fi(y + v*sig) - fi(y)]/sig, where sig = 1 / ||v||_WRMS, i.e. the WRMS norm of v*sig is 1. ---------------------------------------------------------------*/ -int arkLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, +int arkLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *arkode_mem, N_Vector work) { ARKodeMem ark_mem; ARKLsMem arkls_mem; - realtype sig, siginv; + sunrealtype sig, siginv; int iter, retval; /* access ARKLsMem structure */ @@ -2202,9 +2202,9 @@ int arkLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, Setup the linear system A = I - gamma J or A = M - gamma J -----------------------------------------------------------------*/ -static int arkLsLinSys(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, +static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, booleantype jok, booleantype *jcur, - realtype gamma, void *arkode_mem, N_Vector vtemp1, + sunrealtype gamma, void *arkode_mem, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { ARKodeMem ark_mem; @@ -2466,7 +2466,7 @@ int arkLsInitialize(void* arkode_mem) This routine then calls the LS 'setup' routine with A. ---------------------------------------------------------------*/ -int arkLsSetup(void* arkode_mem, int convfail, realtype tpred, +int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { @@ -2474,7 +2474,7 @@ int arkLsSetup(void* arkode_mem, int convfail, realtype tpred, ARKLsMem arkls_mem = NULL; void* ark_step_massmem = NULL; SUNMatrix M = NULL; - realtype gamma, gamrat; + sunrealtype gamma, gamrat; booleantype dgamma_fail, *jcur; int retval; @@ -2602,13 +2602,13 @@ int arkLsSetup(void* arkode_mem, int convfail, realtype tpred, When using a non-NULL SUNMatrix, this will additionally scale the solution appropriately when gamrat != 1. ---------------------------------------------------------------*/ -int arkLsSolve(void* arkode_mem, N_Vector b, realtype tnow, - N_Vector ynow, N_Vector fnow, realtype eRNrm, int mnewt) +int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tnow, + N_Vector ynow, N_Vector fnow, sunrealtype eRNrm, int mnewt) { - realtype bnorm, resnorm; + sunrealtype bnorm, resnorm; ARKodeMem ark_mem; ARKLsMem arkls_mem; - realtype gamma, gamrat, delta, deltar, rwt_mean; + sunrealtype gamma, gamrat, delta, deltar, rwt_mean; booleantype dgamma_fail, *jcur; long int nps_inc; int nli_inc, retval; @@ -2921,7 +2921,7 @@ int arkLsMassInitialize(void *arkode_mem) /*--------------------------------------------------------------- arkLsMassSetup calls the LS 'setup' routine. ---------------------------------------------------------------*/ -int arkLsMassSetup(void *arkode_mem, realtype t, N_Vector vtemp1, +int arkLsMassSetup(void *arkode_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { ARKodeMem ark_mem; @@ -3062,9 +3062,9 @@ int arkLsMassSetup(void *arkode_mem, realtype t, N_Vector vtemp1, and scaling vectors, calling the solver, and accumulating statistics from the solve for use/reporting by ARKODE. ---------------------------------------------------------------*/ -int arkLsMassSolve(void *arkode_mem, N_Vector b, realtype nlscoef) +int arkLsMassSolve(void *arkode_mem, N_Vector b, sunrealtype nlscoef) { - realtype resnorm, delta, rwt_mean; + sunrealtype resnorm, delta, rwt_mean; ARKodeMem ark_mem; ARKLsMassMem arkls_mem; long int nps_inc; diff --git a/src/arkode/arkode_ls_impl.h b/src/arkode/arkode_ls_impl.h index e837d2bca2..6ce1f093fc 100644 --- a/src/arkode/arkode_ls_impl.h +++ b/src/arkode/arkode_ls_impl.h @@ -59,8 +59,8 @@ typedef struct ARKLsMemRec { booleantype scalesol; /* Iterative solver tolerance */ - realtype eplifac; /* nonlinear -> linear tol scaling factor */ - realtype nrmfac; /* integrator -> LS norm conversion factor */ + sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ + sunrealtype nrmfac; /* integrator -> LS norm conversion factor */ /* Linear solver, matrix and vector objects/pointers */ SUNLinearSolver LS; /* generic linear solver object */ @@ -73,7 +73,7 @@ typedef struct ARKLsMemRec { /* Statistics and associated parameters */ long int msbj; /* max num steps between jac/pset calls */ - realtype tcur; /* 'time' for current ARKLs solve */ + sunrealtype tcur; /* 'time' for current ARKLs solve */ long int nje; /* no. of calls to jac */ long int nfeDQ; /* no. of calls to f due to DQ Jacobian or J*v approximations */ @@ -146,12 +146,12 @@ typedef struct ARKLsMassMemRec { void* M_data; /* user data pointer */ /* Iterative solver tolerance */ - realtype eplifac; /* nonlinear -> linear tol scaling factor */ - realtype nrmfac; /* integrator -> LS norm conversion factor */ + sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ + sunrealtype nrmfac; /* integrator -> LS norm conversion factor */ /* Statistics and associated parameters */ booleantype time_dependent; /* flag whether M depends on t */ - realtype msetuptime; /* "t" value at last msetup call */ + sunrealtype msetuptime; /* "t" value at last msetup call */ long int nmsetups; /* total # mass matrix-solver setups */ long int nmsolves; /* total # mass matrix-solver solves */ long int nmtsetup; /* total # calls to mtsetup */ @@ -197,27 +197,27 @@ typedef struct ARKLsMassMemRec { int arkLsATimes(void* arkode_mem, N_Vector v, N_Vector z); int arkLsPSetup(void* arkode_mem); int arkLsPSolve(void* arkode_mem, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* Interface routines called by mass SUNLinearSolver */ int arkLsMTimes(void* arkode_mem, N_Vector v, N_Vector z); int arkLsMPSetup(void* arkode_mem); int arkLsMPSolve(void* arkode_mem, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* Difference quotient approximation for Jac times vector */ -int arkLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, +int arkLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void* data, N_Vector work); /* Difference-quotient Jacobian approximation routines */ -int arkLsDQJac(realtype t, N_Vector y, N_Vector fy, +int arkLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void* data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int arkLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, +int arkLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, ARKodeMem ark_mem, ARKLsMem arkls_mem, ARKRhsFn fi, N_Vector tmp1); -int arkLsBandDQJac(realtype t, N_Vector y, N_Vector fy, +int arkLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, ARKodeMem ark_mem, ARKLsMem arkls_mem, ARKRhsFn fi, N_Vector tmp1, N_Vector tmp2); @@ -225,24 +225,24 @@ int arkLsBandDQJac(realtype t, N_Vector y, N_Vector fy, /* Generic linit/lsetup/lsolve/lfree interface routines for ARKODE to call */ int arkLsInitialize(void* arkode_mem); -int arkLsSetup(void* arkode_mem, int convfail, realtype tpred, +int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, N_Vector ypred, N_Vector fpred, booleantype* jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); -int arkLsSolve(void* arkode_mem, N_Vector b, realtype tcur, - N_Vector ycur, N_Vector fcur, realtype eRnrm, int mnewt); +int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tcur, + N_Vector ycur, N_Vector fcur, sunrealtype eRnrm, int mnewt); int arkLsFree(void* arkode_mem); /* Generic minit/msetup/mmult/msolve/mfree routines for ARKODE to call */ int arkLsMassInitialize(void* arkode_mem); -int arkLsMassSetup(void* arkode_mem, realtype t, N_Vector vtemp1, +int arkLsMassSetup(void* arkode_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); int arkLsMassMult(void* arkode_mem, N_Vector v, N_Vector Mv); -int arkLsMassSolve(void* arkode_mem, N_Vector b, realtype nlscoef); +int arkLsMassSolve(void* arkode_mem, N_Vector b, sunrealtype nlscoef); int arkLsMassFree(void* arkode_mem); @@ -265,10 +265,10 @@ int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, int arkLSSetJacFn(void* arkode_mem, ARKLsJacFn jac); int arkLSSetMassFn(void* arkode_mem, ARKLsMassFn mass); -int arkLSSetEpsLin(void* arkode_mem, realtype eplifac); -int arkLSSetMassEpsLin(void* arkode_mem, realtype eplifac); -int arkLSSetNormFactor(void* arkode_mem, realtype nrmfac); -int arkLSSetMassNormFactor(void* arkode_mem, realtype nrmfac); +int arkLSSetEpsLin(void* arkode_mem, sunrealtype eplifac); +int arkLSSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); +int arkLSSetNormFactor(void* arkode_mem, sunrealtype nrmfac); +int arkLSSetMassNormFactor(void* arkode_mem, sunrealtype nrmfac); int arkLSSetJacEvalFrequency(void* arkode_mem, long int msbj); int arkLSSetLinearSolutionScaling(void* arkode_mem, booleantype onoff); int arkLSSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, diff --git a/src/arkode/arkode_mri_tables.c b/src/arkode/arkode_mri_tables.c index b1fc0723d6..0458c5aa26 100644 --- a/src/arkode/arkode_mri_tables.c +++ b/src/arkode/arkode_mri_tables.c @@ -100,19 +100,19 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, * Allocate abscissae and coupling coefficients * -------------------------------------------- */ - MRIC->c = (realtype *) calloc( stages, sizeof(realtype) ); + MRIC->c = (sunrealtype *) calloc( stages, sizeof(sunrealtype) ); if (!(MRIC->c)) { MRIStepCoupling_Free(MRIC); return(NULL); } if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) { /* allocate W matrices */ - MRIC->W = (realtype ***) calloc( nmat, sizeof(realtype**) ); + MRIC->W = (sunrealtype ***) calloc( nmat, sizeof(sunrealtype**) ); if (!(MRIC->W)) { MRIStepCoupling_Free(MRIC); return(NULL); } /* allocate rows of each matrix in W */ for (i=0; iW[i] = NULL; - MRIC->W[i] = (realtype **) calloc( stages, sizeof(realtype*) ); + MRIC->W[i] = (sunrealtype **) calloc( stages, sizeof(sunrealtype*) ); if (!(MRIC->W[i])) { MRIStepCoupling_Free(MRIC); return(NULL); } } @@ -120,7 +120,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, for (i=0; iW[i][j] = NULL; - MRIC->W[i][j] = (realtype *) calloc( stages, sizeof(realtype) ); + MRIC->W[i][j] = (sunrealtype *) calloc( stages, sizeof(sunrealtype) ); if (!(MRIC->W[i][j])) { MRIStepCoupling_Free(MRIC); return(NULL); } } } @@ -128,13 +128,13 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { /* allocate G matrices */ - MRIC->G = (realtype ***) calloc( nmat, sizeof(realtype**) ); + MRIC->G = (sunrealtype ***) calloc( nmat, sizeof(sunrealtype**) ); if (!(MRIC->G)) { MRIStepCoupling_Free(MRIC); return(NULL); } /* allocate rows of each matrix in G */ for (i=0; iG[i] = NULL; - MRIC->G[i] = (realtype **) calloc( stages, sizeof(realtype*) ); + MRIC->G[i] = (sunrealtype **) calloc( stages, sizeof(sunrealtype*) ); if (!(MRIC->G[i])) { MRIStepCoupling_Free(MRIC); return(NULL); } } @@ -142,7 +142,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, for (i=0; iG[i][j] = NULL; - MRIC->G[i][j] = (realtype *) calloc( stages, sizeof(realtype) ); + MRIC->G[i][j] = (sunrealtype *) calloc( stages, sizeof(sunrealtype) ); if (!(MRIC->G[i][j])) { MRIStepCoupling_Free(MRIC); return(NULL); } } } @@ -155,7 +155,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, Routine to allocate and fill a MRIStepCoupling structure ---------------------------------------------------------------*/ MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, - realtype *W, realtype *G, realtype *c) + sunrealtype *W, sunrealtype *G, sunrealtype *c) { int i, j, k; MRISTEP_METHOD_TYPE type; @@ -218,12 +218,12 @@ MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, { int i, j, stages; booleantype padding; - realtype Asum; - realtype ***C; + sunrealtype Asum; + sunrealtype ***C; MRISTEP_METHOD_TYPE type; MRIStepCoupling MRIC; - const realtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; /* Check that input table is non-NULL */ if (!B) return(NULL); @@ -543,8 +543,8 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE *outfile) int mriStepCoupling_GetStageType(MRIStepCoupling MRIC, int is) { int i; - realtype Gabs, cdiff; - const realtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + sunrealtype Gabs, cdiff; + const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; if ((is < 1) || (is >= MRIC->stages)) return ARK_INVALID_TABLE; @@ -585,8 +585,8 @@ int mriStepCoupling_GetStageMap(MRIStepCoupling MRIC, int* nstages_active) { int i, j, k, idx; - realtype Wsum, Gsum; - const realtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + sunrealtype Wsum, Gsum; + const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; /* ---------------------- * Check for valid inputs diff --git a/src/arkode/arkode_mri_tables.def b/src/arkode/arkode_mri_tables.def index 4cd224a67d..c8b5b98e24 100644 --- a/src/arkode/arkode_mri_tables.def +++ b/src/arkode/arkode_mri_tables.def @@ -145,7 +145,7 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_IRK21a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK34a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 7, MRISTEP_IMPLICIT); - realtype beta = RCONST(0.4358665215084589994160194511935568425); + sunrealtype beta = RCONST(0.4358665215084589994160194511935568425); C->q = 3; C->p = 0; @@ -259,7 +259,7 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK46a, { /* A. Sandu, SINUM 57:2300-2327, 2019 ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK3a, { /* R. Chinomona & D. Reynolds SINUM 43(5):A3082-A3113, 2021 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 8, MRISTEP_IMEX); - realtype beta = RCONST(0.4358665215084589994160194511935568425); + sunrealtype beta = RCONST(0.4358665215084589994160194511935568425); C->q = 3; C->p = 0; @@ -303,7 +303,7 @@ ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK3a, { /* R. Chinomona & D. Reynolds SINUM 43(5 ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK3b, { /* R. Chinomona & D. Reynolds SINUM 43(5):A3082-A3113, 2021 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 8, MRISTEP_IMEX); - realtype beta = RCONST(0.4358665215084589994160194511935568425); + sunrealtype beta = RCONST(0.4358665215084589994160194511935568425); C->q = 3; C->p = 0; diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 11e74e86a5..32f7ae18a7 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -34,7 +34,7 @@ /*--------------------------------------------------------------- Create MRIStep integrator memory struct ---------------------------------------------------------------*/ -void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, realtype t0, N_Vector y0, +void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx) { ARKodeMem ark_mem; /* outer ARKODE memory */ @@ -211,7 +211,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, realtype t0, N_Vector y0, It first resizes the main ARKODE infrastructure memory, and then resizes its own data. ---------------------------------------------------------------*/ -int MRIStepResize(void *arkode_mem, N_Vector y0, realtype t0, +int MRIStepResize(void *arkode_mem, N_Vector y0, sunrealtype t0, ARKVecResizeFn resize, void *resize_data) { ARKodeMem ark_mem; @@ -344,7 +344,7 @@ int MRIStepResize(void *arkode_mem, N_Vector y0, realtype t0, NOTE: the inner stepper needs to be reinitialized before calling this function. ---------------------------------------------------------------*/ -int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, realtype t0, +int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0) { ARKodeMem ark_mem; @@ -430,7 +430,7 @@ int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, realtype t0, problem from the given time with the input state (all counter values are retained). ---------------------------------------------------------------*/ -int MRIStepReset(void* arkode_mem, realtype tR, N_Vector yR) +int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; @@ -464,7 +464,7 @@ int MRIStepReset(void* arkode_mem, realtype tR, N_Vector yR) These routines set integration tolerances (wrappers for general ARKODE utility routines) ---------------------------------------------------------------*/ -int MRIStepSStolerances(void *arkode_mem, realtype reltol, realtype abstol) +int MRIStepSStolerances(void *arkode_mem, sunrealtype reltol, sunrealtype abstol) { /* unpack ark_mem, call arkSStolerances, and return */ ARKodeMem ark_mem; @@ -477,7 +477,7 @@ int MRIStepSStolerances(void *arkode_mem, realtype reltol, realtype abstol) return(arkSStolerances(ark_mem, reltol, abstol)); } -int MRIStepSVtolerances(void *arkode_mem, realtype reltol, N_Vector abstol) +int MRIStepSVtolerances(void *arkode_mem, sunrealtype reltol, N_Vector abstol) { /* unpack ark_mem, call arkSVtolerances, and return */ ARKodeMem ark_mem; @@ -530,8 +530,8 @@ int MRIStepRootInit(void *arkode_mem, int nrtfn, ARKRootFn g) This is the main time-integration driver (wrappers for general ARKODE utility routine) ---------------------------------------------------------------*/ -int MRIStepEvolve(void *arkode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask) +int MRIStepEvolve(void *arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask) { /* unpack ark_mem, call arkEvolve, and return */ int retval; @@ -556,7 +556,7 @@ int MRIStepEvolve(void *arkode_mem, realtype tout, N_Vector yout, derivatives over the most-recently-computed step (wrapper for generic ARKODE utility routine) ---------------------------------------------------------------*/ -int MRIStepGetDky(void *arkode_mem, realtype t, int k, N_Vector dky) +int MRIStepGetDky(void *arkode_mem, sunrealtype t, int k, N_Vector dky) { /* unpack ark_mem, call arkGetDky, and return */ int retval; @@ -760,7 +760,7 @@ void MRIStepPrintMem(void* arkode_mem, FILE* outfile) fprintf(outfile,"MRIStep: jcur = %i\n", step_mem->jcur); fprintf(outfile,"MRIStep: ownNLS = %i\n", step_mem->ownNLS); - /* output realtype quantities */ + /* output sunrealtype quantities */ fprintf(outfile,"MRIStep: Coupling structure:\n"); MRIStepCoupling_Write(step_mem->MRIC, outfile); @@ -931,8 +931,8 @@ ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem) This routine fills the current value of gamma, and states whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ -int mriStep_GetGammas(void* arkode_mem, realtype *gamma, - realtype *gamrat, booleantype **jcur, +int mriStep_GetGammas(void* arkode_mem, sunrealtype *gamma, + sunrealtype *gamrat, booleantype **jcur, booleantype *dgamma_fail) { ARKodeMem ark_mem; @@ -1063,8 +1063,8 @@ int mriStep_Init(void* arkode_mem, int init_type) step_mem->Ae_row = NULL; ark_mem->lrw -= step_mem->stages; } - step_mem->Ae_row = (realtype *) calloc(step_mem->stages, - sizeof(realtype)); + step_mem->Ae_row = (sunrealtype *) calloc(step_mem->stages, + sizeof(sunrealtype)); ark_mem->lrw += step_mem->stages; /* implicit RK coefficient row */ @@ -1073,8 +1073,8 @@ int mriStep_Init(void* arkode_mem, int init_type) step_mem->Ai_row = NULL; ark_mem->lrw -= step_mem->stages; } - step_mem->Ai_row = (realtype *) calloc(step_mem->stages, - sizeof(realtype)); + step_mem->Ai_row = (sunrealtype *) calloc(step_mem->stages, + sizeof(sunrealtype)); ark_mem->lrw += step_mem->stages; /* Allocate MRI RHS vector memory, update storage requirements */ @@ -1143,7 +1143,7 @@ int mriStep_Init(void* arkode_mem, int init_type) /* Allocate reusable arrays for fused vector interface */ step_mem->nfusedopvecs = 2*step_mem->stages + 2; if (step_mem->cvals == NULL) { - step_mem->cvals = (realtype *) calloc(step_mem->nfusedopvecs, sizeof(realtype)); + step_mem->cvals = (sunrealtype *) calloc(step_mem->nfusedopvecs, sizeof(sunrealtype)); if (step_mem->cvals == NULL) return(ARK_MEM_FAIL); ark_mem->lrw += (step_mem->nfusedopvecs); } @@ -1238,7 +1238,7 @@ int mriStep_Init(void* arkode_mem, int init_type) steps, so we strive to store the intermediate parts so that they do not interfere with the other two modes. ---------------------------------------------------------------*/ -int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { ARKodeMem ark_mem; @@ -1440,7 +1440,7 @@ int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) +int mriStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr) { ARKodeMem ark_mem; /* outer ARKODE memory */ ARKodeMRIStepMem step_mem; /* outer stepper memory */ @@ -1802,8 +1802,8 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) int i, j, k; booleantype okay; ARKodeMRIStepMem step_mem; - realtype Gabs, Wabs; - const realtype tol = RCONST(100.0)*UNIT_ROUNDOFF; + sunrealtype Gabs, Wabs; + const sunrealtype tol = RCONST(100.0)*UNIT_ROUNDOFF; /* access ARKodeMRIStepMem structure */ if (ark_mem->step_mem==NULL) { @@ -1953,8 +1953,8 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) { - realtype cdiff; /* stage time increment */ - realtype t0; /* start time for stage */ + sunrealtype cdiff; /* stage time increment */ + sunrealtype t0; /* start time for stage */ int retval; /* reusable return flag */ #ifdef SUNDIALS_DEBUG @@ -2188,11 +2188,11 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, ---------------------------------------------------------------*/ int mriStep_ComputeInnerForcing(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, - int stage, realtype cdiff) + int stage, sunrealtype cdiff) { - realtype rcdiff; + sunrealtype rcdiff; int j, k, nmat, nstore, retval; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* local shortcuts for fused vector operations */ @@ -2263,10 +2263,10 @@ int mriStep_ComputeInnerForcing(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, ---------------------------------------------------------------*/ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int *stage_map, - realtype *Ae_row, realtype *Ai_row) + sunrealtype *Ae_row, sunrealtype *Ai_row) { int j, k; - realtype kconst; + sunrealtype kconst; if (is < 1 || is >= MRIC->stages || !stage_map || !Ae_row || !Ai_row) return ARK_INVALID_TABLE; @@ -2309,10 +2309,10 @@ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int *stage_map, int mriStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess) { int i, retval, jstage, nvec; - realtype tau; - realtype h; + sunrealtype tau; + sunrealtype h; ARKodeMRIStepMem step_mem; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* access ARKodeMRIStepMem structure */ @@ -2442,7 +2442,7 @@ int mriStep_StageSetup(ARKodeMem ark_mem) /* local data */ ARKodeMRIStepMem step_mem; int retval, i, j, nvec; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* access ARKodeMRIStepMem structure */ @@ -2661,9 +2661,9 @@ int MRIStepInnerStepper_SetResetFn(MRIStepInnerStepper stepper, int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, - realtype t, N_Vector f) + sunrealtype t, N_Vector f) { - realtype tau, taui; + sunrealtype tau, taui; int i; if (stepper == NULL) @@ -2698,7 +2698,7 @@ int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, int MRIStepInnerStepper_GetForcingData(MRIStepInnerStepper stepper, - realtype *tshift, realtype *tscale, + sunrealtype *tshift, sunrealtype *tscale, N_Vector **forcing, int *nforcing) { if (stepper == NULL) @@ -2738,7 +2738,7 @@ int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper) /* Evolve the inner (fast) ODE */ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, - realtype t0, realtype tout, N_Vector y) + sunrealtype t0, sunrealtype tout, N_Vector y) { if (stepper == NULL) return ARK_ILL_INPUT; if (stepper->ops == NULL) return ARK_ILL_INPUT; @@ -2766,7 +2766,7 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, be made optional when fullrhs is not called unconditionally by the ARKODE infrastructure e.g., in arkInitialSetup, arkYddNorm, and arkCompleteStep. */ int mriStepInnerStepper_FullRhs(MRIStepInnerStepper stepper, - realtype t, N_Vector y, N_Vector f, + sunrealtype t, N_Vector y, N_Vector f, int mode) { if (stepper == NULL) return ARK_ILL_INPUT; @@ -2780,7 +2780,7 @@ int mriStepInnerStepper_FullRhs(MRIStepInnerStepper stepper, /* Reset the inner (fast) stepper state */ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, - realtype tR, N_Vector yR) + sunrealtype tR, N_Vector yR) { if (stepper == NULL) return ARK_ILL_INPUT; if (stepper->ops == NULL) return ARK_ILL_INPUT; @@ -2851,7 +2851,7 @@ int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, } if (stepper->vals == NULL) { - stepper->vals = (realtype *) calloc(count + 1, sizeof(realtype)); + stepper->vals = (sunrealtype *) calloc(count + 1, sizeof(sunrealtype)); if (stepper->vals == NULL) { mriStepInnerStepper_FreeVecs(stepper); return(ARK_MEM_FAIL); diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index 34e29b8485..f2200dfcd3 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -78,8 +78,8 @@ typedef struct ARKodeMRIStepMemRec { int nstages_allocated; /* number of stage RHS vectors allocated */ int *stage_map; /* index map for storing stage RHS vectors */ int *stagetypes; /* type flags for stages */ - realtype *Ae_row; /* equivalent explicit RK coeffs */ - realtype *Ai_row; /* equivalent implicit RK coeffs */ + sunrealtype *Ae_row; /* equivalent explicit RK coeffs */ + sunrealtype *Ai_row; /* equivalent implicit RK coeffs */ /* Algebraic solver data and parameters */ N_Vector sdata; /* old stage data in residual */ @@ -89,18 +89,18 @@ typedef struct ARKodeMRIStepMemRec { SUNNonlinearSolver NLS; /* generic SUNNonlinearSolver object */ booleantype ownNLS; /* flag indicating ownership of NLS */ ARKRhsFn nls_fsi; /* fsi(t,y) used in the nonlinear solver */ - realtype gamma; /* gamma = h * A(i,i) */ - realtype gammap; /* gamma at the last setup call */ - realtype gamrat; /* gamma / gammap */ - realtype dgmax; /* call lsetup if |gamma/gammap-1| >= dgmax */ + sunrealtype gamma; /* gamma = h * A(i,i) */ + sunrealtype gammap; /* gamma at the last setup call */ + sunrealtype gamrat; /* gamma / gammap */ + sunrealtype dgmax; /* call lsetup if |gamma/gammap-1| >= dgmax */ int predictor; /* implicit prediction method to use */ - realtype crdown; /* nonlinear conv rate estimation constant */ - realtype rdiv; /* nonlin divergence if del/delp > rdiv */ - realtype crate; /* estimated nonlin convergence rate */ - realtype delp; /* norm of previous nonlinear solver update */ - realtype eRNrm; /* estimated residual norm, used in nonlin + sunrealtype crdown; /* nonlinear conv rate estimation constant */ + sunrealtype rdiv; /* nonlin divergence if del/delp > rdiv */ + sunrealtype crate; /* estimated nonlin convergence rate */ + sunrealtype delp; /* norm of previous nonlinear solver update */ + sunrealtype eRNrm; /* estimated residual norm, used in nonlin and linear solver convergence tests */ - realtype nlscoef; /* coefficient in nonlin. convergence test */ + sunrealtype nlscoef; /* coefficient in nonlin. convergence test */ int msbp; /* positive => max # steps between lsetup negative => call at each Newton iter */ @@ -135,7 +135,7 @@ typedef struct ARKodeMRIStepMemRec { int nfusedopvecs; /* length of cvals and Xvecs arrays */ /* Reusable arrays for fused vector operations */ - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; } *ARKodeMRIStepMem; @@ -168,17 +168,17 @@ struct _MRIStepInnerStepper int nforcing; /* number of forcing vectors active */ int nforcing_allocated; /* number of forcing vectors allocated */ int last_flag; /* last stepper return flag */ - realtype tshift; /* time normalization shift */ - realtype tscale; /* time normalization scaling */ + sunrealtype tshift; /* time normalization shift */ + sunrealtype tscale; /* time normalization scaling */ /* fused op workspace */ - realtype* vals; + sunrealtype* vals; N_Vector* vecs; /* Space requirements */ - sunindextype lrw1; /* no. of realtype words in 1 N_Vector */ + sunindextype lrw1; /* no. of sunrealtype words in 1 N_Vector */ sunindextype liw1; /* no. of integer words in 1 N_Vector */ - long int lrw; /* no. of realtype words in ARKODE work vectors */ + long int lrw; /* no. of sunrealtype words in ARKODE work vectors */ long int liw; /* no. of integer words in ARKODE work vectors */ }; @@ -198,12 +198,12 @@ void mriStep_DisableLSetup(void* arkode_mem); int mriStep_Init(void* arkode_mem, int init_type); void* mriStep_GetLmem(void* arkode_mem); ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem); -int mriStep_GetGammas(void* arkode_mem, realtype *gamma, - realtype *gamrat, booleantype **jcur, +int mriStep_GetGammas(void* arkode_mem, sunrealtype *gamma, + sunrealtype *gamrat, booleantype **jcur, booleantype *dgamma_fail); -int mriStep_FullRHS(void* arkode_mem, realtype t, +int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr); +int mriStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); /* Internal utility routines */ int mriStep_AccessStepMem(void* arkode_mem, const char *fname, @@ -230,18 +230,18 @@ int mriStep_NlsFPFunction(N_Vector yy, N_Vector res, void* arkode_mem); int mriStep_NlsLSetup(booleantype jbad, booleantype* jcur, void* arkode_mem); int mriStep_NlsLSolve(N_Vector delta, void* arkode_mem); int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, - realtype tol, N_Vector ewt, void* arkode_mem); + sunrealtype tol, N_Vector ewt, void* arkode_mem); /* Inner stepper functions */ int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper); int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, - realtype t0, realtype tout, N_Vector y); + sunrealtype t0, sunrealtype tout, N_Vector y); int mriStepInnerStepper_FullRhs(MRIStepInnerStepper stepper, - realtype t, N_Vector y, N_Vector f, + sunrealtype t, N_Vector y, N_Vector f, int mode); int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, - realtype tR, N_Vector yR); + sunrealtype tR, N_Vector yR); int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, N_Vector tmpl); int mriStepInnerStepper_Resize(MRIStepInnerStepper stepper, @@ -254,11 +254,11 @@ void mriStepInnerStepper_PrintMem(MRIStepInnerStepper stepper, /* Compute forcing for inner stepper */ int mriStep_ComputeInnerForcing(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, - int stage, realtype cdiff); + int stage, sunrealtype cdiff); /* Return effective RK coefficients (nofast stage) */ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int *stage_map, - realtype *Ae_row, realtype *Ai_row); + sunrealtype *Ae_row, sunrealtype *Ai_row); /*=============================================================== Reusable MRIStep Error Messages diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index da5a76442b..3e80940f99 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -44,7 +44,7 @@ int MRIStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int MRIStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { return(arkSetMaxHnilWarns(arkode_mem, mxhnil)); } -int MRIStepSetStopTime(void *arkode_mem, realtype tstop) { +int MRIStepSetStopTime(void *arkode_mem, sunrealtype tstop) { return(arkSetStopTime(arkode_mem, tstop)); } int MRIStepSetInterpolateStopTime(void *arkode_mem, booleantype interp) { @@ -76,9 +76,9 @@ int MRIStepSetJacEvalFrequency(void *arkode_mem, long int msbj) { return(arkLSSetJacEvalFrequency(arkode_mem, msbj)); } int MRIStepSetLinearSolutionScaling(void *arkode_mem, booleantype onoff) { return(arkLSSetLinearSolutionScaling(arkode_mem, onoff)); } -int MRIStepSetEpsLin(void *arkode_mem, realtype eplifac) { +int MRIStepSetEpsLin(void *arkode_mem, sunrealtype eplifac) { return(arkLSSetEpsLin(arkode_mem, eplifac)); } -int MRIStepSetLSNormFactor(void *arkode_mem, realtype nrmfac) { +int MRIStepSetLSNormFactor(void *arkode_mem, sunrealtype nrmfac) { return(arkLSSetNormFactor(arkode_mem, nrmfac)); } int MRIStepSetPreconditioner(void *arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve) { @@ -98,13 +98,13 @@ int MRIStepSetLinSysFn(void *arkode_mem, ARKLsLinSysFn linsys) { ===============================================================*/ int MRIStepGetNumSteps(void *arkode_mem, long int *nssteps) { return(arkGetNumSteps(arkode_mem, nssteps)); } -int MRIStepGetLastStep(void *arkode_mem, realtype *hlast) { +int MRIStepGetLastStep(void *arkode_mem, sunrealtype *hlast) { return(arkGetLastStep(arkode_mem, hlast)); } -int MRIStepGetCurrentTime(void *arkode_mem, realtype *tcur) { +int MRIStepGetCurrentTime(void *arkode_mem, sunrealtype *tcur) { return(arkGetCurrentTime(arkode_mem, tcur)); } int MRIStepGetCurrentState(void *arkode_mem, N_Vector *state) { return(arkGetCurrentState(arkode_mem, state)); } -int MRIStepGetTolScaleFactor(void *arkode_mem, realtype *tolsfact) { +int MRIStepGetTolScaleFactor(void *arkode_mem, sunrealtype *tolsfact) { return(arkGetTolScaleFactor(arkode_mem, tolsfact)); } int MRIStepGetErrWeights(void *arkode_mem, N_Vector eweight) { return(arkGetErrWeights(arkode_mem, eweight)); } @@ -441,7 +441,7 @@ int MRIStepSetPostInnerFn(void *arkode_mem, MRIStepPostInnerFn postfn) Wrapper for generic arkSetFixedStep routine. Additionally enforces current MRIStep constraint for fixed time-stepping. ---------------------------------------------------------------*/ -int MRIStepSetFixedStep(void *arkode_mem, realtype hsfixed) +int MRIStepSetFixedStep(void *arkode_mem, sunrealtype hsfixed) { ARKodeMem ark_mem; if (arkode_mem==NULL) { @@ -470,7 +470,7 @@ int MRIStepSetFixedStep(void *arkode_mem, realtype hsfixed) crdown. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int MRIStepSetNonlinCRDown(void *arkode_mem, realtype crdown) +int MRIStepSetNonlinCRDown(void *arkode_mem, sunrealtype crdown) { ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; @@ -499,7 +499,7 @@ int MRIStepSetNonlinCRDown(void *arkode_mem, realtype crdown) rdiv. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int MRIStepSetNonlinRDiv(void *arkode_mem, realtype rdiv) +int MRIStepSetNonlinRDiv(void *arkode_mem, sunrealtype rdiv) { ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; @@ -528,7 +528,7 @@ int MRIStepSetNonlinRDiv(void *arkode_mem, realtype rdiv) dgmax. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int MRIStepSetDeltaGammaMax(void *arkode_mem, realtype dgmax) +int MRIStepSetDeltaGammaMax(void *arkode_mem, sunrealtype dgmax) { ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; @@ -657,7 +657,7 @@ int MRIStepSetMaxNonlinIters(void *arkode_mem, int maxcor) Specifies the coefficient in the nonlinear solver convergence test. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int MRIStepSetNonlinConvCoef(void *arkode_mem, realtype nlscoef) +int MRIStepSetNonlinConvCoef(void *arkode_mem, sunrealtype nlscoef) { ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; @@ -783,7 +783,7 @@ int MRIStepGetLastInnerStepFlag(void *arkode_mem, int *flag) /*--------------------------------------------------------------- MRIStepGetCurrentGamma: Returns the current value of gamma ---------------------------------------------------------------*/ -int MRIStepGetCurrentGamma(void *arkode_mem, realtype *gamma) +int MRIStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) { int retval; ARKodeMem ark_mem; @@ -969,7 +969,7 @@ int MRIStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (ark_mem->nst > 0) { fprintf(outfile, "NLS iters per step = %"RSYM"\n", - (realtype) step_mem->nls_iters / (realtype) ark_mem->nst); + (sunrealtype) step_mem->nls_iters / (sunrealtype) ark_mem->nst); } /* linear solver stats */ @@ -988,11 +988,11 @@ int MRIStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (step_mem->nls_iters > 0) { fprintf(outfile, "LS iters per NLS iter = %"RSYM"\n", - (realtype) arkls_mem->nli / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nli / (sunrealtype) step_mem->nls_iters); fprintf(outfile, "Jac evals per NLS iter = %"RSYM"\n", - (realtype) arkls_mem->nje / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nje / (sunrealtype) step_mem->nls_iters); fprintf(outfile, "Prec evals per NLS iter = %"RSYM"\n", - (realtype) arkls_mem->npe / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->npe / (sunrealtype) step_mem->nls_iters); } } break; @@ -1008,7 +1008,7 @@ int MRIStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (ark_mem->nst > 0) { fprintf(outfile, ",NLS iters per step,%"RSYM, - (realtype) step_mem->nls_iters / (realtype) ark_mem->nst); + (sunrealtype) step_mem->nls_iters / (sunrealtype) ark_mem->nst); } else { @@ -1031,11 +1031,11 @@ int MRIStepPrintAllStats(void *arkode_mem, FILE *outfile, SUNOutputFormat fmt) if (step_mem->nls_iters > 0) { fprintf(outfile, ",LS iters per NLS iter,%"RSYM, - (realtype) arkls_mem->nli / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nli / (sunrealtype) step_mem->nls_iters); fprintf(outfile, ",Jac evals per NLS iter,%"RSYM, - (realtype) arkls_mem->nje / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->nje / (sunrealtype) step_mem->nls_iters); fprintf(outfile, ",Prec evals per NLS iter,%"RSYM, - (realtype) arkls_mem->npe / (realtype) step_mem->nls_iters); + (sunrealtype) arkls_mem->npe / (sunrealtype) step_mem->nls_iters); } else { diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index 1ef2d22887..e62934b874 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -158,9 +158,9 @@ int MRIStepSetNlsRhsFn(void *arkode_mem, ARKRhsFn nls_fsi) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int MRIStepGetNonlinearSystemData(void *arkode_mem, realtype *tcur, +int MRIStepGetNonlinearSystemData(void *arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, - N_Vector *F, realtype *gamma, + N_Vector *F, sunrealtype *gamma, N_Vector *sdata, void **user_data) { ARKodeMem ark_mem; @@ -454,7 +454,7 @@ int mriStep_NlsResidual(N_Vector zcor, N_Vector r, void* arkode_mem) ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; - realtype c[3]; + sunrealtype c[3]; N_Vector X[3]; /* access ARKodeMRIStepMem structure */ @@ -559,12 +559,12 @@ int mriStep_NlsFPFunction(N_Vector zcor, N_Vector g, void* arkode_mem) is provided. ---------------------------------------------------------------*/ int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, - realtype tol, N_Vector ewt, void* arkode_mem) + sunrealtype tol, N_Vector ewt, void* arkode_mem) { /* temporary variables */ ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; - realtype delnrm, dcon; + sunrealtype delnrm, dcon; int m, retval; /* access ARKodeMRIStepMem structure */ diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index cc9fb5d0b8..77e9c757a4 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -778,7 +778,7 @@ int arkRelaxDestroy(ARKodeRelaxMem relax_mem) } /* Compute and apply relaxation, called by driver */ -int arkRelax(ARKodeMem ark_mem, int* relax_fails, realtype* dsm_inout, +int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout, int* nflag_out) { int retval; diff --git a/src/arkode/arkode_root.c b/src/arkode/arkode_root.c index 7c0b49df81..f1c8ebc37e 100644 --- a/src/arkode/arkode_root.c +++ b/src/arkode/arkode_root.c @@ -134,14 +134,14 @@ int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) /* Allocate necessary memory and return */ ark_mem->root_mem->glo = NULL; - ark_mem->root_mem->glo = (realtype *) malloc(nrt*sizeof(realtype)); + ark_mem->root_mem->glo = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (ark_mem->root_mem->glo == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkRootInit", MSG_ARK_MEM_FAIL); return(ARK_MEM_FAIL); } ark_mem->root_mem->ghi = NULL; - ark_mem->root_mem->ghi = (realtype *) malloc(nrt*sizeof(realtype)); + ark_mem->root_mem->ghi = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (ark_mem->root_mem->ghi == NULL) { free(ark_mem->root_mem->glo); ark_mem->root_mem->glo = NULL; arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", @@ -149,7 +149,7 @@ int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) return(ARK_MEM_FAIL); } ark_mem->root_mem->grout = NULL; - ark_mem->root_mem->grout = (realtype *) malloc(nrt*sizeof(realtype)); + ark_mem->root_mem->grout = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (ark_mem->root_mem->grout == NULL) { free(ark_mem->root_mem->glo); ark_mem->root_mem->glo = NULL; free(ark_mem->root_mem->ghi); ark_mem->root_mem->ghi = NULL; @@ -303,7 +303,7 @@ int arkPrintRootMem(void* arkode_mem, FILE *outfile) int arkRootCheck1(void* arkode_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; ARKodeMem ark_mem; ARKodeRootMem rootmem; @@ -381,7 +381,7 @@ int arkRootCheck1(void* arkode_mem) int arkRootCheck2(void* arkode_mem) { int i, retval; - realtype smallh, tplus; + sunrealtype smallh, tplus; booleantype zroot; ARKodeMem ark_mem; ARKodeRootMem rootmem; @@ -604,7 +604,7 @@ int arkRootCheck3(void* arkode_mem) ---------------------------------------------------------------*/ int arkRootfind(void* arkode_mem) { - realtype alpha, tmid, gfrac, maxfrac, fracint, fracsub; + sunrealtype alpha, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; booleantype zroot, sgnchg; ARKodeMem ark_mem; diff --git a/src/arkode/arkode_root_impl.h b/src/arkode/arkode_root_impl.h index 224a7413ca..38854de58e 100644 --- a/src/arkode/arkode_root_impl.h +++ b/src/arkode/arkode_root_impl.h @@ -54,14 +54,14 @@ typedef struct ARKodeRootMemRec { int nrtfn; /* number of components of g */ int *iroots; /* array for root information */ int *rootdir; /* array specifying direction of zero-crossing */ - realtype tlo; /* nearest endpoint of interval in root search */ - realtype thi; /* farthest endpoint of interval in root search */ - realtype trout; /* t value returned by rootfinding routine */ - realtype *glo; /* saved array of g values at t = tlo */ - realtype *ghi; /* saved array of g values at t = thi */ - realtype *grout; /* array of g values at t = trout */ - realtype toutc; /* copy of tout (if NORMAL mode) */ - realtype ttol; /* tolerance on root location */ + sunrealtype tlo; /* nearest endpoint of interval in root search */ + sunrealtype thi; /* farthest endpoint of interval in root search */ + sunrealtype trout; /* t value returned by rootfinding routine */ + sunrealtype *glo; /* saved array of g values at t = tlo */ + sunrealtype *ghi; /* saved array of g values at t = thi */ + sunrealtype *grout; /* array of g values at t = trout */ + sunrealtype toutc; /* copy of tout (if NORMAL mode) */ + sunrealtype ttol; /* tolerance on root location */ int taskc; /* copy of parameter itask */ int irfnd; /* flag showing whether last step had a root */ long int nge; /* counter for g evaluations */ diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 5d6219e98e..950edbb428 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -33,7 +33,7 @@ SPRKStep Exported functions -- Required ===============================================================*/ -void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, realtype t0, N_Vector y0, +void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, SUNContext sunctx) { ARKodeMem ark_mem = NULL; @@ -171,7 +171,7 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, realtype t0, N_Vector y0, Note all internal counters are set to 0 on re-initialization. ---------------------------------------------------------------*/ -int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, realtype t0, +int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0) { ARKodeMem ark_mem = NULL; @@ -238,7 +238,7 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, realtype t0, problem from the given time with the input state (all counter values are retained). ---------------------------------------------------------------*/ -int SPRKStepReset(void* arkode_mem, realtype tR, N_Vector yR) +int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; @@ -270,8 +270,8 @@ int SPRKStepReset(void* arkode_mem, realtype tR, N_Vector yR) This is the main time-integration driver (wrappers for general ARKODE utility routine) ---------------------------------------------------------------*/ -int SPRKStepEvolve(void* arkode_mem, realtype tout, N_Vector yout, - realtype* tret, int itask) +int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) { /* unpack ark_mem, call arkEvolve, and return */ ARKodeMem ark_mem = NULL; @@ -296,7 +296,7 @@ int SPRKStepEvolve(void* arkode_mem, realtype tout, N_Vector yout, derivatives over the most-recently-computed step (wrapper for generic ARKODE utility routine) ---------------------------------------------------------------*/ -int SPRKStepGetDky(void* arkode_mem, realtype t, int k, N_Vector dky) +int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) { /* unpack ark_mem, call arkGetDky, and return */ ARKodeMem ark_mem = NULL; @@ -524,7 +524,7 @@ int sprkStep_f2(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, steps, so we strive to store the intermediate parts so that they do not interfere with the other two modes. ---------------------------------------------------------------*/ -int sprkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int sprkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { int retval = 0; @@ -575,7 +575,7 @@ int sprkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, This requires only 2 vectors in principle, but we use three since we persist the stage data. Only the stage data vector belongs to SPRKStep, the other two are reused from the ARKODE core. */ -int sprkStep_TakeStep(void* arkode_mem, realtype* dsmPtr, int* nflagPtr) +int sprkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) { ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; @@ -652,7 +652,7 @@ int sprkStep_TakeStep(void* arkode_mem, realtype* dsmPtr, int* nflagPtr) /* Increment SPRK algorithm with compensated summation. This algorithm requires 6 vectors, but 5 of them are reused from the ARKODE core. */ -int sprkStep_TakeStep_Compensated(void* arkode_mem, realtype* dsmPtr, +int sprkStep_TakeStep_Compensated(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) { ARKodeMem ark_mem = NULL; diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index 0474fd646b..dcd4e7eb93 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -58,7 +58,7 @@ int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) return (arkSetMaxNumSteps(arkode_mem, mxsteps)); } -int SPRKStepSetStopTime(void* arkode_mem, realtype tstop) +int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) { return (arkSetStopTime(arkode_mem, tstop)); } @@ -88,7 +88,7 @@ int SPRKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStag return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); } -int SPRKStepSetFixedStep(void* arkode_mem, realtype hfixed) +int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) { return (arkSetFixedStep(arkode_mem, hfixed)); } @@ -107,17 +107,17 @@ int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps) return (arkGetNumSteps(arkode_mem, nsteps)); } -int SPRKStepGetLastStep(void* arkode_mem, realtype* hlast) +int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) { return (arkGetLastStep(arkode_mem, hlast)); } -int SPRKStepGetCurrentStep(void* arkode_mem, realtype* hcur) +int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) { return (arkGetCurrentStep(arkode_mem, hcur)); } -int SPRKStepGetCurrentTime(void* arkode_mem, realtype* tcur) +int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { return (arkGetCurrentTime(arkode_mem, tcur)); } @@ -132,8 +132,8 @@ int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound) return (arkGetRootInfo(arkode_mem, rootsfound)); } -int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, realtype* hinused, - realtype* hlast, realtype* hcur, realtype* tcur) +int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) { return (arkGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } diff --git a/src/arkode/fmod/farkode_arkstep_mod.c b/src/arkode/fmod/farkode_arkstep_mod.c index cf29b827f6..ff8b2581f3 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.c +++ b/src/arkode/fmod/farkode_arkstep_mod.c @@ -237,14 +237,14 @@ SWIGEXPORT void * _wrap_FARKStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double co void * fresult ; ARKRhsFn arg1 = (ARKRhsFn) 0 ; ARKRhsFn arg2 = (ARKRhsFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; SUNContext arg5 = (SUNContext) 0 ; void *result = 0 ; arg1 = (ARKRhsFn)(farg1); arg2 = (ARKRhsFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (SUNContext)(farg5); result = (void *)ARKStepCreate(arg1,arg2,arg3,arg4,arg5); @@ -257,16 +257,16 @@ SWIGEXPORT int _wrap_FARKStepResize(void *farg1, N_Vector farg2, double const *f int fresult ; void *arg1 = (void *) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype arg3 ; - realtype arg4 ; + sunrealtype arg3 ; + sunrealtype arg4 ; ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; void *arg6 = (void *) 0 ; int result; arg1 = (void *)(farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype)(*farg3); - arg4 = (realtype)(*farg4); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); arg5 = (ARKVecResizeFn)(farg5); arg6 = (void *)(farg6); result = (int)ARKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); @@ -280,14 +280,14 @@ SWIGEXPORT int _wrap_FARKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, void *arg1 = (void *) 0 ; ARKRhsFn arg2 = (ARKRhsFn) 0 ; ARKRhsFn arg3 = (ARKRhsFn) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (ARKRhsFn)(farg2); arg3 = (ARKRhsFn)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector)(farg5); result = (int)ARKStepReInit(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -298,12 +298,12 @@ SWIGEXPORT int _wrap_FARKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, SWIGEXPORT int _wrap_FARKStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)ARKStepReset(arg1,arg2,arg3); fresult = (int)(result); @@ -314,13 +314,13 @@ SWIGEXPORT int _wrap_FARKStepReset(void *farg1, double const *farg2, N_Vector fa SWIGEXPORT int _wrap_FARKStepSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)ARKStepSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -330,12 +330,12 @@ SWIGEXPORT int _wrap_FARKStepSStolerances(void *farg1, double const *farg2, doub SWIGEXPORT int _wrap_FARKStepSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)ARKStepSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -360,11 +360,11 @@ SWIGEXPORT int _wrap_FARKStepWFtolerances(void *farg1, ARKEwtFn farg2) { SWIGEXPORT int _wrap_FARKStepResStolerance(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepResStolerance(arg1,arg2); fresult = (int)(result); return fresult; @@ -688,11 +688,11 @@ SWIGEXPORT int _wrap_FARKStepSetTableName(void *farg1, SwigArrayWrapper *farg2, SWIGEXPORT int _wrap_FARKStepSetCFLFraction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetCFLFraction(arg1,arg2); fresult = (int)(result); return fresult; @@ -702,11 +702,11 @@ SWIGEXPORT int _wrap_FARKStepSetCFLFraction(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetSafetyFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetSafetyFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -716,11 +716,11 @@ SWIGEXPORT int _wrap_FARKStepSetSafetyFactor(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetErrorBias(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetErrorBias(arg1,arg2); fresult = (int)(result); return fresult; @@ -730,11 +730,11 @@ SWIGEXPORT int _wrap_FARKStepSetErrorBias(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetMaxGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMaxGrowth(arg1,arg2); fresult = (int)(result); return fresult; @@ -744,11 +744,11 @@ SWIGEXPORT int _wrap_FARKStepSetMaxGrowth(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetMinReduction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMinReduction(arg1,arg2); fresult = (int)(result); return fresult; @@ -758,13 +758,13 @@ SWIGEXPORT int _wrap_FARKStepSetMinReduction(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)ARKStepSetFixedStepBounds(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -777,7 +777,7 @@ SWIGEXPORT int _wrap_FARKStepSetAdaptivityMethod(void *farg1, int const *farg2, int arg2 ; int arg3 ; int arg4 ; - realtype *arg5 ; + sunrealtype *arg5 ; int result; arg1 = (void *)(farg1); @@ -810,11 +810,11 @@ SWIGEXPORT int _wrap_FARKStepSetAdaptivityFn(void *farg1, ARKAdaptFn farg2, void SWIGEXPORT int _wrap_FARKStepSetMaxFirstGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMaxFirstGrowth(arg1,arg2); fresult = (int)(result); return fresult; @@ -824,11 +824,11 @@ SWIGEXPORT int _wrap_FARKStepSetMaxFirstGrowth(void *farg1, double const *farg2) SWIGEXPORT int _wrap_FARKStepSetMaxEFailGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMaxEFailGrowth(arg1,arg2); fresult = (int)(result); return fresult; @@ -852,11 +852,11 @@ SWIGEXPORT int _wrap_FARKStepSetSmallNumEFails(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FARKStepSetMaxCFailGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMaxCFailGrowth(arg1,arg2); fresult = (int)(result); return fresult; @@ -866,11 +866,11 @@ SWIGEXPORT int _wrap_FARKStepSetMaxCFailGrowth(void *farg1, double const *farg2) SWIGEXPORT int _wrap_FARKStepSetNonlinCRDown(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetNonlinCRDown(arg1,arg2); fresult = (int)(result); return fresult; @@ -880,11 +880,11 @@ SWIGEXPORT int _wrap_FARKStepSetNonlinCRDown(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetNonlinRDiv(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetNonlinRDiv(arg1,arg2); fresult = (int)(result); return fresult; @@ -894,11 +894,11 @@ SWIGEXPORT int _wrap_FARKStepSetNonlinRDiv(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetDeltaGammaMax(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetDeltaGammaMax(arg1,arg2); fresult = (int)(result); return fresult; @@ -994,11 +994,11 @@ SWIGEXPORT int _wrap_FARKStepSetMaxConvFails(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FARKStepSetNonlinConvCoef(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetNonlinConvCoef(arg1,arg2); fresult = (int)(result); return fresult; @@ -1050,11 +1050,11 @@ SWIGEXPORT int _wrap_FARKStepSetMaxHnilWarns(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FARKStepSetInitStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1064,11 +1064,11 @@ SWIGEXPORT int _wrap_FARKStepSetInitStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetMinStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMinStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1078,11 +1078,11 @@ SWIGEXPORT int _wrap_FARKStepSetMinStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetMaxStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMaxStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1106,11 +1106,11 @@ SWIGEXPORT int _wrap_FARKStepSetInterpolateStopTime(void *farg1, int const *farg SWIGEXPORT int _wrap_FARKStepSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1132,11 +1132,11 @@ SWIGEXPORT int _wrap_FARKStepClearStopTime(void *farg1) { SWIGEXPORT int _wrap_FARKStepSetFixedStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetFixedStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1328,11 +1328,11 @@ SWIGEXPORT int _wrap_FARKStepSetLinearSolutionScaling(void *farg1, int const *fa SWIGEXPORT int _wrap_FARKStepSetEpsLin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetEpsLin(arg1,arg2); fresult = (int)(result); return fresult; @@ -1342,11 +1342,11 @@ SWIGEXPORT int _wrap_FARKStepSetEpsLin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetMassEpsLin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMassEpsLin(arg1,arg2); fresult = (int)(result); return fresult; @@ -1356,11 +1356,11 @@ SWIGEXPORT int _wrap_FARKStepSetMassEpsLin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetLSNormFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetLSNormFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1370,11 +1370,11 @@ SWIGEXPORT int _wrap_FARKStepSetLSNormFactor(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FARKStepSetMassLSNormFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ARKStepSetMassLSNormFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1478,16 +1478,16 @@ SWIGEXPORT int _wrap_FARKStepSetLinSysFn(void *farg1, ARKLsLinSysFn farg2) { SWIGEXPORT int _wrap_FARKStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int arg5 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); arg5 = (int)(*farg5); result = (int)ARKStepEvolve(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -1498,13 +1498,13 @@ SWIGEXPORT int _wrap_FARKStepEvolve(void *farg1, double const *farg2, N_Vector f SWIGEXPORT int _wrap_FARKStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)ARKStepGetDky(arg1,arg2,arg3,arg4); @@ -1678,11 +1678,11 @@ SWIGEXPORT int _wrap_FARKStepGetNumSteps(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FARKStepGetActualInitStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ARKStepGetActualInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1692,11 +1692,11 @@ SWIGEXPORT int _wrap_FARKStepGetActualInitStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FARKStepGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ARKStepGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1706,11 +1706,11 @@ SWIGEXPORT int _wrap_FARKStepGetLastStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FARKStepGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ARKStepGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1720,11 +1720,11 @@ SWIGEXPORT int _wrap_FARKStepGetCurrentStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FARKStepGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ARKStepGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1748,11 +1748,11 @@ SWIGEXPORT int _wrap_FARKStepGetCurrentState(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FARKStepGetCurrentGamma(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ARKStepGetCurrentGamma(arg1,arg2); fresult = (int)(result); return fresult; @@ -1776,11 +1776,11 @@ SWIGEXPORT int _wrap_FARKStepGetCurrentMassMatrix(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FARKStepGetTolScaleFactor(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ARKStepGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1958,18 +1958,18 @@ SWIGEXPORT int _wrap_FARKStepGetStepStats(void *farg1, long *farg2, double *farg int fresult ; void *arg1 = (void *) 0 ; long *arg2 = (long *) 0 ; - realtype *arg3 = (realtype *) 0 ; - realtype *arg4 = (realtype *) 0 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); arg2 = (long *)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (realtype *)(farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); result = (int)ARKStepGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; @@ -1979,21 +1979,21 @@ SWIGEXPORT int _wrap_FARKStepGetStepStats(void *farg1, long *farg2, double *farg SWIGEXPORT int _wrap_FARKStepGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, void *farg7, void *farg8) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; N_Vector *arg7 = (N_Vector *) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); - arg6 = (realtype *)(farg6); + arg6 = (sunrealtype *)(farg6); arg7 = (N_Vector *)(farg7); arg8 = (void **)(farg8); result = (int)ARKStepGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); diff --git a/src/arkode/fmod/farkode_erkstep_mod.c b/src/arkode/fmod/farkode_erkstep_mod.c index 8616db5916..4449323e57 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.c +++ b/src/arkode/fmod/farkode_erkstep_mod.c @@ -236,13 +236,13 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { SWIGEXPORT void * _wrap_FERKStepCreate(ARKRhsFn farg1, double const *farg2, N_Vector farg3, void *farg4) { void * fresult ; ARKRhsFn arg1 = (ARKRhsFn) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; SUNContext arg4 = (SUNContext) 0 ; void *result = 0 ; arg1 = (ARKRhsFn)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); arg4 = (SUNContext)(farg4); result = (void *)ERKStepCreate(arg1,arg2,arg3,arg4); @@ -255,16 +255,16 @@ SWIGEXPORT int _wrap_FERKStepResize(void *farg1, N_Vector farg2, double const *f int fresult ; void *arg1 = (void *) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype arg3 ; - realtype arg4 ; + sunrealtype arg3 ; + sunrealtype arg4 ; ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; void *arg6 = (void *) 0 ; int result; arg1 = (void *)(farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype)(*farg3); - arg4 = (realtype)(*farg4); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); arg5 = (ARKVecResizeFn)(farg5); arg6 = (void *)(farg6); result = (int)ERKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); @@ -277,13 +277,13 @@ SWIGEXPORT int _wrap_FERKStepReInit(void *farg1, ARKRhsFn farg2, double const *f int fresult ; void *arg1 = (void *) 0 ; ARKRhsFn arg2 = (ARKRhsFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (ARKRhsFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)ERKStepReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -294,12 +294,12 @@ SWIGEXPORT int _wrap_FERKStepReInit(void *farg1, ARKRhsFn farg2, double const *f SWIGEXPORT int _wrap_FERKStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)ERKStepReset(arg1,arg2,arg3); fresult = (int)(result); @@ -310,13 +310,13 @@ SWIGEXPORT int _wrap_FERKStepReset(void *farg1, double const *farg2, N_Vector fa SWIGEXPORT int _wrap_FERKStepSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)ERKStepSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -326,12 +326,12 @@ SWIGEXPORT int _wrap_FERKStepSStolerances(void *farg1, double const *farg2, doub SWIGEXPORT int _wrap_FERKStepSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)ERKStepSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -482,11 +482,11 @@ SWIGEXPORT int _wrap_FERKStepSetTableName(void *farg1, SwigArrayWrapper *farg2) SWIGEXPORT int _wrap_FERKStepSetCFLFraction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetCFLFraction(arg1,arg2); fresult = (int)(result); return fresult; @@ -496,11 +496,11 @@ SWIGEXPORT int _wrap_FERKStepSetCFLFraction(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FERKStepSetSafetyFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetSafetyFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -510,11 +510,11 @@ SWIGEXPORT int _wrap_FERKStepSetSafetyFactor(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FERKStepSetErrorBias(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetErrorBias(arg1,arg2); fresult = (int)(result); return fresult; @@ -524,11 +524,11 @@ SWIGEXPORT int _wrap_FERKStepSetErrorBias(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FERKStepSetMaxGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetMaxGrowth(arg1,arg2); fresult = (int)(result); return fresult; @@ -538,11 +538,11 @@ SWIGEXPORT int _wrap_FERKStepSetMaxGrowth(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FERKStepSetMinReduction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetMinReduction(arg1,arg2); fresult = (int)(result); return fresult; @@ -552,13 +552,13 @@ SWIGEXPORT int _wrap_FERKStepSetMinReduction(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FERKStepSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)ERKStepSetFixedStepBounds(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -571,7 +571,7 @@ SWIGEXPORT int _wrap_FERKStepSetAdaptivityMethod(void *farg1, int const *farg2, int arg2 ; int arg3 ; int arg4 ; - realtype *arg5 ; + sunrealtype *arg5 ; int result; arg1 = (void *)(farg1); @@ -604,11 +604,11 @@ SWIGEXPORT int _wrap_FERKStepSetAdaptivityFn(void *farg1, ARKAdaptFn farg2, void SWIGEXPORT int _wrap_FERKStepSetMaxFirstGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetMaxFirstGrowth(arg1,arg2); fresult = (int)(result); return fresult; @@ -618,11 +618,11 @@ SWIGEXPORT int _wrap_FERKStepSetMaxFirstGrowth(void *farg1, double const *farg2) SWIGEXPORT int _wrap_FERKStepSetMaxEFailGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetMaxEFailGrowth(arg1,arg2); fresult = (int)(result); return fresult; @@ -718,11 +718,11 @@ SWIGEXPORT int _wrap_FERKStepSetMaxHnilWarns(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FERKStepSetInitStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -732,11 +732,11 @@ SWIGEXPORT int _wrap_FERKStepSetInitStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FERKStepSetMinStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetMinStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -746,11 +746,11 @@ SWIGEXPORT int _wrap_FERKStepSetMinStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FERKStepSetMaxStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetMaxStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -774,11 +774,11 @@ SWIGEXPORT int _wrap_FERKStepSetInterpolateStopTime(void *farg1, int const *farg SWIGEXPORT int _wrap_FERKStepSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -800,11 +800,11 @@ SWIGEXPORT int _wrap_FERKStepClearStopTime(void *farg1) { SWIGEXPORT int _wrap_FERKStepSetFixedStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)ERKStepSetFixedStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -926,16 +926,16 @@ SWIGEXPORT int _wrap_FERKStepSetPostprocessStageFn(void *farg1, ARKPostProcessFn SWIGEXPORT int _wrap_FERKStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int arg5 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); arg5 = (int)(*farg5); result = (int)ERKStepEvolve(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -946,13 +946,13 @@ SWIGEXPORT int _wrap_FERKStepEvolve(void *farg1, double const *farg2, N_Vector f SWIGEXPORT int _wrap_FERKStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)ERKStepGetDky(arg1,arg2,arg3,arg4); @@ -1092,11 +1092,11 @@ SWIGEXPORT int _wrap_FERKStepGetNumSteps(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FERKStepGetActualInitStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ERKStepGetActualInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1106,11 +1106,11 @@ SWIGEXPORT int _wrap_FERKStepGetActualInitStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FERKStepGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ERKStepGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1120,11 +1120,11 @@ SWIGEXPORT int _wrap_FERKStepGetLastStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FERKStepGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ERKStepGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1134,11 +1134,11 @@ SWIGEXPORT int _wrap_FERKStepGetCurrentStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FERKStepGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ERKStepGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1148,11 +1148,11 @@ SWIGEXPORT int _wrap_FERKStepGetCurrentTime(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FERKStepGetTolScaleFactor(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)ERKStepGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1312,18 +1312,18 @@ SWIGEXPORT int _wrap_FERKStepGetStepStats(void *farg1, long *farg2, double *farg int fresult ; void *arg1 = (void *) 0 ; long *arg2 = (long *) 0 ; - realtype *arg3 = (realtype *) 0 ; - realtype *arg4 = (realtype *) 0 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); arg2 = (long *)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (realtype *)(farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); result = (int)ERKStepGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; diff --git a/src/arkode/fmod/farkode_mod.c b/src/arkode/fmod/farkode_mod.c index 704328f607..c6b6c17b6e 100644 --- a/src/arkode/fmod/farkode_mod.c +++ b/src/arkode/fmod/farkode_mod.c @@ -371,7 +371,7 @@ SWIGEXPORT int _wrap_FARKBBDPrecInit(void *farg1, int64_t const *farg2, int64_t sunindextype arg4 ; sunindextype arg5 ; sunindextype arg6 ; - realtype arg7 ; + sunrealtype arg7 ; ARKLocalFn arg8 = (ARKLocalFn) 0 ; ARKCommFn arg9 = (ARKCommFn) 0 ; int result; @@ -382,7 +382,7 @@ SWIGEXPORT int _wrap_FARKBBDPrecInit(void *farg1, int64_t const *farg2, int64_t arg4 = (sunindextype)(*farg4); arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); - arg7 = (realtype)(*farg7); + arg7 = (sunrealtype)(*farg7); arg8 = (ARKLocalFn)(farg8); arg9 = (ARKCommFn)(farg9); result = (int)ARKBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); @@ -396,13 +396,13 @@ SWIGEXPORT int _wrap_FARKBBDPrecReInit(void *farg1, int64_t const *farg2, int64_ void *arg1 = (void *) 0 ; sunindextype arg2 ; sunindextype arg3 ; - realtype arg4 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (sunindextype)(*farg2); arg3 = (sunindextype)(*farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); result = (int)ARKBBDPrecReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -513,11 +513,11 @@ SWIGEXPORT int _wrap_ARKodeButcherTableMem_stages_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_A_set(SwigClassWrapper const *farg1, void *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype **arg2 = (realtype **) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (realtype **)(farg2); + arg2 = (sunrealtype **)(farg2); if (arg1) (arg1)->A = arg2; } @@ -525,11 +525,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_A_set(SwigClassWrapper const *farg1, SWIGEXPORT void * _wrap_ARKodeButcherTableMem_A_get(SwigClassWrapper const *farg1) { void * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype **result = 0 ; + sunrealtype **result = 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (realtype **) ((arg1)->A); + result = (sunrealtype **) ((arg1)->A); fresult = result; return fresult; } @@ -537,11 +537,11 @@ SWIGEXPORT void * _wrap_ARKodeButcherTableMem_A_get(SwigClassWrapper const *farg SWIGEXPORT void _wrap_ARKodeButcherTableMem_c_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); if (arg1) (arg1)->c = arg2; } @@ -549,11 +549,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_c_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_c_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (realtype *) ((arg1)->c); + result = (sunrealtype *) ((arg1)->c); fresult = result; return fresult; } @@ -561,11 +561,11 @@ SWIGEXPORT double * _wrap_ARKodeButcherTableMem_c_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_b_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); if (arg1) (arg1)->b = arg2; } @@ -573,11 +573,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_b_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_b_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (realtype *) ((arg1)->b); + result = (sunrealtype *) ((arg1)->b); fresult = result; return fresult; } @@ -585,11 +585,11 @@ SWIGEXPORT double * _wrap_ARKodeButcherTableMem_b_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_d_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); if (arg1) (arg1)->d = arg2; } @@ -597,11 +597,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_d_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_d_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (realtype *) ((arg1)->d); + result = (sunrealtype *) ((arg1)->d); fresult = result; return fresult; } @@ -657,19 +657,19 @@ SWIGEXPORT void * _wrap_FARKodeButcherTable_Create(int const *farg1, int const * int arg1 ; int arg2 ; int arg3 ; - realtype *arg4 = (realtype *) 0 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; - realtype *arg7 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; ARKodeButcherTable result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); - arg4 = (realtype *)(farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); - arg7 = (realtype *)(farg7); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); result = (ARKodeButcherTable)ARKodeButcherTable_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = result; return fresult; diff --git a/src/arkode/fmod/farkode_mristep_mod.c b/src/arkode/fmod/farkode_mristep_mod.c index 0065b6553f..63c3adb087 100644 --- a/src/arkode/fmod/farkode_mristep_mod.c +++ b/src/arkode/fmod/farkode_mristep_mod.c @@ -406,11 +406,11 @@ SWIGEXPORT int _wrap_MRIStepCouplingMem_p_get(SwigClassWrapper const *farg1) { SWIGEXPORT void _wrap_MRIStepCouplingMem_c_set(SwigClassWrapper const *farg1, double *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); if (arg1) (arg1)->c = arg2; } @@ -418,11 +418,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_c_set(SwigClassWrapper const *farg1, do SWIGEXPORT double * _wrap_MRIStepCouplingMem_c_get(SwigClassWrapper const *farg1) { double * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (realtype *) ((arg1)->c); + result = (sunrealtype *) ((arg1)->c); fresult = result; return fresult; } @@ -430,11 +430,11 @@ SWIGEXPORT double * _wrap_MRIStepCouplingMem_c_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_MRIStepCouplingMem_W_set(SwigClassWrapper const *farg1, void *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - realtype ***arg2 = (realtype ***) 0 ; + sunrealtype ***arg2 = (sunrealtype ***) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (realtype ***)(farg2); + arg2 = (sunrealtype ***)(farg2); if (arg1) (arg1)->W = arg2; } @@ -442,11 +442,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_W_set(SwigClassWrapper const *farg1, vo SWIGEXPORT void * _wrap_MRIStepCouplingMem_W_get(SwigClassWrapper const *farg1) { void * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - realtype ***result = 0 ; + sunrealtype ***result = 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (realtype ***) ((arg1)->W); + result = (sunrealtype ***) ((arg1)->W); fresult = result; return fresult; } @@ -454,11 +454,11 @@ SWIGEXPORT void * _wrap_MRIStepCouplingMem_W_get(SwigClassWrapper const *farg1) SWIGEXPORT void _wrap_MRIStepCouplingMem_G_set(SwigClassWrapper const *farg1, void *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - realtype ***arg2 = (realtype ***) 0 ; + sunrealtype ***arg2 = (sunrealtype ***) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (realtype ***)(farg2); + arg2 = (sunrealtype ***)(farg2); if (arg1) (arg1)->G = arg2; } @@ -466,11 +466,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_G_set(SwigClassWrapper const *farg1, vo SWIGEXPORT void * _wrap_MRIStepCouplingMem_G_get(SwigClassWrapper const *farg1) { void * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - realtype ***result = 0 ; + sunrealtype ***result = 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (realtype ***) ((arg1)->G); + result = (sunrealtype ***) ((arg1)->G); fresult = result; return fresult; } @@ -553,18 +553,18 @@ SWIGEXPORT void * _wrap_FMRIStepCoupling_Create(int const *farg1, int const *far int arg2 ; int arg3 ; int arg4 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; - realtype *arg7 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; MRIStepCoupling result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); - arg7 = (realtype *)(farg7); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); result = (MRIStepCoupling)MRIStepCoupling_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = result; return fresult; @@ -633,7 +633,7 @@ SWIGEXPORT void * _wrap_FMRIStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double co void * fresult ; ARKRhsFn arg1 = (ARKRhsFn) 0 ; ARKRhsFn arg2 = (ARKRhsFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; MRIStepInnerStepper arg5 = (MRIStepInnerStepper) 0 ; SUNContext arg6 = (SUNContext) 0 ; @@ -641,7 +641,7 @@ SWIGEXPORT void * _wrap_FMRIStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double co arg1 = (ARKRhsFn)(farg1); arg2 = (ARKRhsFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (MRIStepInnerStepper)(farg5); arg6 = (SUNContext)(farg6); @@ -655,14 +655,14 @@ SWIGEXPORT int _wrap_FMRIStepResize(void *farg1, N_Vector farg2, double const *f int fresult ; void *arg1 = (void *) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype arg3 ; + sunrealtype arg3 ; ARKVecResizeFn arg4 = (ARKVecResizeFn) 0 ; void *arg5 = (void *) 0 ; int result; arg1 = (void *)(farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (ARKVecResizeFn)(farg4); arg5 = (void *)(farg5); result = (int)MRIStepResize(arg1,arg2,arg3,arg4,arg5); @@ -676,14 +676,14 @@ SWIGEXPORT int _wrap_FMRIStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, void *arg1 = (void *) 0 ; ARKRhsFn arg2 = (ARKRhsFn) 0 ; ARKRhsFn arg3 = (ARKRhsFn) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (ARKRhsFn)(farg2); arg3 = (ARKRhsFn)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector)(farg5); result = (int)MRIStepReInit(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -694,12 +694,12 @@ SWIGEXPORT int _wrap_FMRIStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, SWIGEXPORT int _wrap_FMRIStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)MRIStepReset(arg1,arg2,arg3); fresult = (int)(result); @@ -710,13 +710,13 @@ SWIGEXPORT int _wrap_FMRIStepReset(void *farg1, double const *farg2, N_Vector fa SWIGEXPORT int _wrap_FMRIStepSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)MRIStepSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -726,12 +726,12 @@ SWIGEXPORT int _wrap_FMRIStepSStolerances(void *farg1, double const *farg2, doub SWIGEXPORT int _wrap_FMRIStepSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)MRIStepSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -938,11 +938,11 @@ SWIGEXPORT int _wrap_FMRIStepSetMaxNumSteps(void *farg1, long const *farg2) { SWIGEXPORT int _wrap_FMRIStepSetNonlinCRDown(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetNonlinCRDown(arg1,arg2); fresult = (int)(result); return fresult; @@ -952,11 +952,11 @@ SWIGEXPORT int _wrap_FMRIStepSetNonlinCRDown(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FMRIStepSetNonlinRDiv(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetNonlinRDiv(arg1,arg2); fresult = (int)(result); return fresult; @@ -966,11 +966,11 @@ SWIGEXPORT int _wrap_FMRIStepSetNonlinRDiv(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FMRIStepSetDeltaGammaMax(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetDeltaGammaMax(arg1,arg2); fresult = (int)(result); return fresult; @@ -1022,11 +1022,11 @@ SWIGEXPORT int _wrap_FMRIStepSetMaxNonlinIters(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FMRIStepSetNonlinConvCoef(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetNonlinConvCoef(arg1,arg2); fresult = (int)(result); return fresult; @@ -1050,11 +1050,11 @@ SWIGEXPORT int _wrap_FMRIStepSetMaxHnilWarns(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FMRIStepSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1090,11 +1090,11 @@ SWIGEXPORT int _wrap_FMRIStepClearStopTime(void *farg1) { SWIGEXPORT int _wrap_FMRIStepSetFixedStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetFixedStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1300,11 +1300,11 @@ SWIGEXPORT int _wrap_FMRIStepSetLinearSolutionScaling(void *farg1, int const *fa SWIGEXPORT int _wrap_FMRIStepSetEpsLin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetEpsLin(arg1,arg2); fresult = (int)(result); return fresult; @@ -1314,11 +1314,11 @@ SWIGEXPORT int _wrap_FMRIStepSetEpsLin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FMRIStepSetLSNormFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)MRIStepSetLSNormFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1388,16 +1388,16 @@ SWIGEXPORT int _wrap_FMRIStepSetLinSysFn(void *farg1, ARKLsLinSysFn farg2) { SWIGEXPORT int _wrap_FMRIStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int arg5 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); arg5 = (int)(*farg5); result = (int)MRIStepEvolve(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -1408,13 +1408,13 @@ SWIGEXPORT int _wrap_FMRIStepEvolve(void *farg1, double const *farg2, N_Vector f SWIGEXPORT int _wrap_FMRIStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)MRIStepGetDky(arg1,arg2,arg3,arg4); @@ -1516,11 +1516,11 @@ SWIGEXPORT int _wrap_FMRIStepGetNumSteps(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FMRIStepGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)MRIStepGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1530,11 +1530,11 @@ SWIGEXPORT int _wrap_FMRIStepGetLastStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FMRIStepGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)MRIStepGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1558,11 +1558,11 @@ SWIGEXPORT int _wrap_FMRIStepGetCurrentState(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FMRIStepGetCurrentGamma(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)MRIStepGetCurrentGamma(arg1,arg2); fresult = (int)(result); return fresult; @@ -1572,11 +1572,11 @@ SWIGEXPORT int _wrap_FMRIStepGetCurrentGamma(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FMRIStepGetTolScaleFactor(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)MRIStepGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1713,21 +1713,21 @@ SWIGEXPORT int _wrap_FMRIStepWriteCoupling(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FMRIStepGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, void *farg7, void *farg8) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; N_Vector *arg7 = (N_Vector *) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); - arg6 = (realtype *)(farg6); + arg6 = (sunrealtype *)(farg6); arg7 = (N_Vector *)(farg7); arg8 = (void **)(farg8); result = (int)MRIStepGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); @@ -2108,12 +2108,12 @@ SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetResetFn(void *farg1, MRIStepInnerRe SWIGEXPORT int _wrap_FMRIStepInnerStepper_AddForcing(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)MRIStepInnerStepper_AddForcing(arg1,arg2,arg3); fresult = (int)(result); @@ -2124,15 +2124,15 @@ SWIGEXPORT int _wrap_FMRIStepInnerStepper_AddForcing(void *farg1, double const * SWIGEXPORT int _wrap_FMRIStepInnerStepper_GetForcingData(void *farg1, double *farg2, double *farg3, void *farg4, int *farg5) { int fresult ; MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - realtype *arg2 = (realtype *) 0 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector **arg4 = (N_Vector **) 0 ; int *arg5 = (int *) 0 ; int result; arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (realtype *)(farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype *)(farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector **)(farg4); arg5 = (int *)(farg5); result = (int)MRIStepInnerStepper_GetForcingData(arg1,arg2,arg3,arg4,arg5); diff --git a/src/arkode/fmod/farkode_sprkstep_mod.c b/src/arkode/fmod/farkode_sprkstep_mod.c index f7ab4ba794..4cf502f9fd 100644 --- a/src/arkode/fmod/farkode_sprkstep_mod.c +++ b/src/arkode/fmod/farkode_sprkstep_mod.c @@ -237,14 +237,14 @@ SWIGEXPORT void * _wrap_FSPRKStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double c void * fresult ; ARKRhsFn arg1 = (ARKRhsFn) 0 ; ARKRhsFn arg2 = (ARKRhsFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; SUNContext arg5 = (SUNContext) 0 ; void *result = 0 ; arg1 = (ARKRhsFn)(farg1); arg2 = (ARKRhsFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (SUNContext)(farg5); result = (void *)SPRKStepCreate(arg1,arg2,arg3,arg4,arg5); @@ -258,14 +258,14 @@ SWIGEXPORT int _wrap_FSPRKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3 void *arg1 = (void *) 0 ; ARKRhsFn arg2 = (ARKRhsFn) 0 ; ARKRhsFn arg3 = (ARKRhsFn) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (ARKRhsFn)(farg2); arg3 = (ARKRhsFn)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector)(farg5); result = (int)SPRKStepReInit(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -276,12 +276,12 @@ SWIGEXPORT int _wrap_FSPRKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3 SWIGEXPORT int _wrap_FSPRKStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)SPRKStepReset(arg1,arg2,arg3); fresult = (int)(result); @@ -418,11 +418,11 @@ SWIGEXPORT int _wrap_FSPRKStepSetMaxNumSteps(void *farg1, long const *farg2) { SWIGEXPORT int _wrap_FSPRKStepSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)SPRKStepSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -432,11 +432,11 @@ SWIGEXPORT int _wrap_FSPRKStepSetStopTime(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FSPRKStepSetFixedStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)SPRKStepSetFixedStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -518,16 +518,16 @@ SWIGEXPORT int _wrap_FSPRKStepSetPostprocessStageFn(void *farg1, ARKPostProcessF SWIGEXPORT int _wrap_FSPRKStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int arg5 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); arg5 = (int)(*farg5); result = (int)SPRKStepEvolve(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -538,13 +538,13 @@ SWIGEXPORT int _wrap_FSPRKStepEvolve(void *farg1, double const *farg2, N_Vector SWIGEXPORT int _wrap_FSPRKStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)SPRKStepGetDky(arg1,arg2,arg3,arg4); @@ -597,11 +597,11 @@ SWIGEXPORT int _wrap_FSPRKStepGetCurrentState(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FSPRKStepGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)SPRKStepGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -611,11 +611,11 @@ SWIGEXPORT int _wrap_FSPRKStepGetCurrentStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FSPRKStepGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)SPRKStepGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -625,11 +625,11 @@ SWIGEXPORT int _wrap_FSPRKStepGetCurrentTime(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FSPRKStepGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)SPRKStepGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -742,18 +742,18 @@ SWIGEXPORT int _wrap_FSPRKStepGetStepStats(void *farg1, long *farg2, double *far int fresult ; void *arg1 = (void *) 0 ; long *arg2 = (long *) 0 ; - realtype *arg3 = (realtype *) 0 ; - realtype *arg4 = (realtype *) 0 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); arg2 = (long *)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (realtype *)(farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); result = (int)SPRKStepGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; diff --git a/src/arkode/xbraid/arkode_xbraid.c b/src/arkode/xbraid/arkode_xbraid.c index da08a0d3ef..c8b9f28169 100644 --- a/src/arkode/xbraid/arkode_xbraid.c +++ b/src/arkode/xbraid/arkode_xbraid.c @@ -81,8 +81,8 @@ int ARKBraid_Create(void *arkode_mem, braid_App *app) /* Initialize XBraid, attach interface functions */ -int ARKBraid_BraidInit(MPI_Comm comm_w, MPI_Comm comm_t, realtype tstart, - realtype tstop, sunindextype ntime, braid_App app, +int ARKBraid_BraidInit(MPI_Comm comm_w, MPI_Comm comm_t, sunrealtype tstart, + sunrealtype tstop, sunindextype ntime, braid_App app, braid_Core *core) { braid_Int braid_flag; @@ -284,7 +284,7 @@ int ARKBraid_GetLastARKStepFlag(braid_App app, int *last_flag) } -int ARKBraid_GetSolution(braid_App app, realtype *tout, N_Vector yout) +int ARKBraid_GetSolution(braid_App app, sunrealtype *tout, N_Vector yout) { ARKBraidContent content; if (app == NULL) return SUNBRAID_ILLINPUT; @@ -311,9 +311,9 @@ int ARKBraid_Step(braid_App app, braid_Vector ustop, braid_Vector fstop, int flag; /* arkode function return flag */ int level; /* current level */ int rfac; /* refinement factor */ - realtype tstart; /* current time */ - realtype tstop; /* evolve to this time */ - realtype hacc; /* accuracy based step size */ + sunrealtype tstart; /* current time */ + sunrealtype tstop; /* evolve to this time */ + sunrealtype hacc; /* accuracy based step size */ ARKBraidContent content; /* ARKBraid app content */ /* Check input */ @@ -371,7 +371,7 @@ int ARKBraid_Step(braid_App app, braid_Vector ustop, braid_Vector fstop, /* Create and initialize vectors */ -int ARKBraid_Init(braid_App app, realtype t, braid_Vector *u_ptr) +int ARKBraid_Init(braid_App app, sunrealtype t, braid_Vector *u_ptr) { int flag; /* return flag */ N_Vector y; /* output N_Vector */ @@ -467,12 +467,12 @@ int ARKBraid_Access(braid_App app, braid_Vector u, /* Force a single step with ARKEvolve */ -int ARKBraid_TakeStep(void *arkode_mem, realtype tstart, realtype tstop, +int ARKBraid_TakeStep(void *arkode_mem, sunrealtype tstart, sunrealtype tstop, N_Vector y, int *ark_flag) { int flag; /* generic return flag */ int tmp_flag; /* evolve return flag */ - realtype tret; /* return time */ + sunrealtype tret; /* return time */ /* Check inputs */ if (arkode_mem == NULL) return ARK_MEM_NULL; diff --git a/src/arkode/xbraid/arkode_xbraid_impl.h b/src/arkode/xbraid/arkode_xbraid_impl.h index b34a58e8e8..544e21becf 100644 --- a/src/arkode/xbraid/arkode_xbraid_impl.h +++ b/src/arkode/xbraid/arkode_xbraid_impl.h @@ -75,7 +75,7 @@ struct _ARKBraidContent int last_flag_arkode; /* Output time and state */ - realtype tout; + sunrealtype tout; N_Vector yout; }; diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index dddf19e171..ded4785102 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -138,15 +138,15 @@ static int cvEwtSetSV(CVodeMem cv_mem, N_Vector ycur, N_Vector weight); #ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS extern int cvEwtSetSS_fused(const booleantype atolmin0, - const realtype reltol, - const realtype Sabstol, + const sunrealtype reltol, + const sunrealtype Sabstol, const N_Vector ycur, N_Vector tempv, N_Vector weight); extern int cvEwtSetSV_fused(const booleantype atolmin0, - const realtype reltol, + const sunrealtype reltol, const N_Vector Vabstol, const N_Vector ycur, N_Vector tempv, @@ -155,9 +155,9 @@ int cvEwtSetSV_fused(const booleantype atolmin0, /* Initial stepsize calculation */ -static int cvHin(CVodeMem cv_mem, realtype tout); -static realtype cvUpperBoundH0(CVodeMem cv_mem, realtype tdist); -static int cvYddNorm(CVodeMem cv_mem, realtype hg, realtype *yddnrm); +static int cvHin(CVodeMem cv_mem, sunrealtype tout); +static sunrealtype cvUpperBoundH0(CVodeMem cv_mem, sunrealtype tdist); +static int cvYddNorm(CVodeMem cv_mem, sunrealtype hg, sunrealtype *yddnrm); /* Main cvStep function */ @@ -174,12 +174,12 @@ static void cvDecreaseBDF(CVodeMem cv_mem); static void cvPredict(CVodeMem cv_mem); static void cvSet(CVodeMem cv_mem); static void cvSetAdams(CVodeMem cv_mem); -static realtype cvAdamsStart(CVodeMem cv_mem, realtype m[]); -static void cvAdamsFinish(CVodeMem cv_mem, realtype m[], realtype M[], realtype hsum); -static realtype cvAltSum(int iend, realtype a[], int k); +static sunrealtype cvAdamsStart(CVodeMem cv_mem, sunrealtype m[]); +static void cvAdamsFinish(CVodeMem cv_mem, sunrealtype m[], sunrealtype M[], sunrealtype hsum); +static sunrealtype cvAltSum(int iend, sunrealtype a[], int k); static void cvSetBDF(CVodeMem cv_mem); -static void cvSetTqBDF(CVodeMem cv_mem, realtype hsum, realtype alpha0, - realtype alpha0_hat, realtype xi_inv, realtype xistar_inv); +static void cvSetTqBDF(CVodeMem cv_mem, sunrealtype hsum, sunrealtype alpha0, + sunrealtype alpha0_hat, sunrealtype xi_inv, sunrealtype xistar_inv); /* Nonlinear solver functions */ @@ -195,21 +195,21 @@ int cvCheckConstraints_fused(const N_Vector c, N_Vector tempv); #endif -static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *ncfPtr); /* Error Test */ static int cvDoErrorTest(CVodeMem cv_mem, int *nflagPtr, - realtype saved_t, int *nefPtr, realtype *dsmPtr); + sunrealtype saved_t, int *nefPtr, sunrealtype *dsmPtr); /* Function called after a successful step */ static void cvCompleteStep(CVodeMem cv_mem); -static void cvPrepareNextStep(CVodeMem cv_mem, realtype dsm); +static void cvPrepareNextStep(CVodeMem cv_mem, sunrealtype dsm); static void cvSetEta(CVodeMem cv_mem); -static realtype cvComputeEtaqm1(CVodeMem cv_mem); -static realtype cvComputeEtaqp1(CVodeMem cv_mem); +static sunrealtype cvComputeEtaqm1(CVodeMem cv_mem); +static sunrealtype cvComputeEtaqp1(CVodeMem cv_mem); static void cvChooseEta(CVodeMem cv_mem); /* Function to handle failures */ @@ -388,7 +388,7 @@ void *CVodeCreate(int lmm, SUNContext sunctx) * errfp and an error flag is returned. Otherwise, it returns CV_SUCCESS */ -int CVodeInit(void *cvode_mem, CVRhsFn f, realtype t0, N_Vector y0) +int CVodeInit(void *cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0) { CVodeMem cv_mem; booleantype nvectorOK, allocOK; @@ -562,7 +562,7 @@ int CVodeInit(void *cvode_mem, CVRhsFn f, realtype t0, N_Vector y0) * a negative value otherwise. */ -int CVodeReInit(void *cvode_mem, realtype t0, N_Vector y0) +int CVodeReInit(void *cvode_mem, sunrealtype t0, N_Vector y0) { CVodeMem cv_mem; int i,k; @@ -667,7 +667,7 @@ int CVodeReInit(void *cvode_mem, realtype t0, N_Vector y0) * which will be called to set the error weight vector. */ -int CVodeSStolerances(void *cvode_mem, realtype reltol, realtype abstol) +int CVodeSStolerances(void *cvode_mem, sunrealtype reltol, sunrealtype abstol) { CVodeMem cv_mem; @@ -714,10 +714,10 @@ int CVodeSStolerances(void *cvode_mem, realtype reltol, realtype abstol) } -int CVodeSVtolerances(void *cvode_mem, realtype reltol, N_Vector abstol) +int CVodeSVtolerances(void *cvode_mem, sunrealtype reltol, N_Vector abstol) { CVodeMem cv_mem; - realtype atolmin; + sunrealtype atolmin; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODE", "CVodeSVtolerances", @@ -891,7 +891,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) /* Allocate necessary memory and return */ cv_mem->cv_glo = NULL; - cv_mem->cv_glo = (realtype *) malloc(nrt*sizeof(realtype)); + cv_mem->cv_glo = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (cv_mem->cv_glo == NULL) { cvProcessError(cv_mem, CV_MEM_FAIL, "CVODE", "CVodeRootInit", MSGCV_MEM_FAIL); @@ -899,7 +899,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) } cv_mem->cv_ghi = NULL; - cv_mem->cv_ghi = (realtype *) malloc(nrt*sizeof(realtype)); + cv_mem->cv_ghi = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (cv_mem->cv_ghi == NULL) { free(cv_mem->cv_glo); cv_mem->cv_glo = NULL; cvProcessError(cv_mem, CV_MEM_FAIL, "CVODE", "CVodeRootInit", @@ -908,7 +908,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) } cv_mem->cv_grout = NULL; - cv_mem->cv_grout = (realtype *) malloc(nrt*sizeof(realtype)); + cv_mem->cv_grout = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (cv_mem->cv_grout == NULL) { free(cv_mem->cv_glo); cv_mem->cv_glo = NULL; free(cv_mem->cv_ghi); cv_mem->cv_ghi = NULL; @@ -988,14 +988,14 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) * In the CV_ONE_STEP mode, it takes one internal step and returns. */ -int CVode(void *cvode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask) +int CVode(void *cvode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask) { CVodeMem cv_mem; long int nstloc; int retval, hflag, kflag, istate, ir, ier, irfndp; int ewtsetOK; - realtype troundoff, tout_hin, rh, nrm; + sunrealtype troundoff, tout_hin, rh, nrm; booleantype inactive_roots; /* @@ -1510,10 +1510,10 @@ int CVode(void *cvode_mem, realtype tout, N_Vector yout, * may also be called directly by the user. */ -int CVodeGetDky(void *cvode_mem, realtype t, int k, N_Vector dky) +int CVodeGetDky(void *cvode_mem, sunrealtype t, int k, N_Vector dky) { - realtype s, r; - realtype tfuzz, tp, tn1; + sunrealtype s, r; + sunrealtype tfuzz, tp, tn1; int i, j, nvec, ier; CVodeMem cv_mem; @@ -1969,11 +1969,11 @@ static int cvInitialSetup(CVodeMem cv_mem) * Finally, we apply a bias (0.5) and verify that h0 is within bounds. */ -static int cvHin(CVodeMem cv_mem, realtype tout) +static int cvHin(CVodeMem cv_mem, sunrealtype tout) { int retval, sign, count1, count2; - realtype tdiff, tdist, tround, hlb, hub; - realtype hg, hgs, hs, hnew, hrat, h0, yddnrm; + sunrealtype tdiff, tdist, tround, hlb, hub; + sunrealtype hg, hgs, hs, hnew, hrat, h0, yddnrm; booleantype hgOK; /* If tout is too close to tn, give up */ @@ -2078,9 +2078,9 @@ static int cvHin(CVodeMem cv_mem, realtype tout) * tdist = tn - t0 and the values of y[i]/y'[i]. */ -static realtype cvUpperBoundH0(CVodeMem cv_mem, realtype tdist) +static sunrealtype cvUpperBoundH0(CVodeMem cv_mem, sunrealtype tdist) { - realtype hub_inv, hub; + sunrealtype hub_inv, hub; N_Vector temp1, temp2; /* @@ -2123,7 +2123,7 @@ static realtype cvUpperBoundH0(CVodeMem cv_mem, realtype tdist) * using a difference quotient, and returns its WRMS norm. */ -static int cvYddNorm(CVodeMem cv_mem, realtype hg, realtype *yddnrm) +static int cvYddNorm(CVodeMem cv_mem, sunrealtype hg, sunrealtype *yddnrm) { int retval; @@ -2169,8 +2169,8 @@ static int cvYddNorm(CVodeMem cv_mem, realtype hg, realtype *yddnrm) static int cvStep(CVodeMem cv_mem) { - realtype saved_t; /* time to restore to if a failure occurs */ - realtype dsm; /* local truncation error estimate */ + sunrealtype saved_t; /* time to restore to if a failure occurs */ + sunrealtype dsm; /* local truncation error estimate */ int ncf; /* corrector failures in this step attempt */ int npf; /* projection failures in this step attempt */ int nef; /* error test failures in this step attempt */ @@ -2334,7 +2334,7 @@ static void cvAdjustOrder(CVodeMem cv_mem, int deltaq) static void cvAdjustAdams(CVodeMem cv_mem, int deltaq) { int i, j; - realtype xi, hsum; + sunrealtype xi, hsum; /* On an order increase, set new column of zn to zero and return */ @@ -2409,7 +2409,7 @@ static void cvAdjustBDF(CVodeMem cv_mem, int deltaq) static void cvIncreaseBDF(CVodeMem cv_mem) { - realtype alpha0, alpha1, prod, xi, xiold, hsum, A1; + sunrealtype alpha0, alpha1, prod, xi, xiold, hsum, A1; int i, j; for (i=0; i <= cv_mem->cv_qmax; i++) cv_mem->cv_l[i] = ZERO; @@ -2451,7 +2451,7 @@ static void cvIncreaseBDF(CVodeMem cv_mem) static void cvDecreaseBDF(CVodeMem cv_mem) { - realtype hsum, xi; + sunrealtype hsum, xi; int i, j; for (i=0; i <= cv_mem->cv_qmax; i++) cv_mem->cv_l[i] = ZERO; @@ -2586,7 +2586,7 @@ static void cvSet(CVodeMem cv_mem) static void cvSetAdams(CVodeMem cv_mem) { - realtype m[L_MAX], M[3], hsum; + sunrealtype m[L_MAX], M[3], hsum; if (cv_mem->cv_q == 1) { cv_mem->cv_l[0] = cv_mem->cv_l[1] = cv_mem->cv_tq[1] = cv_mem->cv_tq[5] = ONE; @@ -2611,9 +2611,9 @@ static void cvSetAdams(CVodeMem cv_mem) * polynomial needed for the Adams l and tq coefficients for q > 1. */ -static realtype cvAdamsStart(CVodeMem cv_mem, realtype m[]) +static sunrealtype cvAdamsStart(CVodeMem cv_mem, sunrealtype m[]) { - realtype hsum, xi_inv, sum; + sunrealtype hsum, xi_inv, sum; int i, j; hsum = cv_mem->cv_h; @@ -2638,10 +2638,10 @@ static realtype cvAdamsStart(CVodeMem cv_mem, realtype m[]) * This routine completes the calculation of the Adams l and tq. */ -static void cvAdamsFinish(CVodeMem cv_mem, realtype m[], realtype M[], realtype hsum) +static void cvAdamsFinish(CVodeMem cv_mem, sunrealtype m[], sunrealtype M[], sunrealtype hsum) { int i; - realtype M0_inv, xi, xi_inv; + sunrealtype M0_inv, xi, xi_inv; M0_inv = ONE / M[0]; @@ -2673,10 +2673,10 @@ static void cvAdamsFinish(CVodeMem cv_mem, realtype m[], realtype M[], realtype * of a polynomial x^(k-1) M(x) given the coefficients of M(x). */ -static realtype cvAltSum(int iend, realtype a[], int k) +static sunrealtype cvAltSum(int iend, sunrealtype a[], int k) { int i, sign; - realtype sum; + sunrealtype sum; if (iend < 0) return(ZERO); @@ -2717,7 +2717,7 @@ static realtype cvAltSum(int iend, realtype a[], int k) static void cvSetBDF(CVodeMem cv_mem) { - realtype alpha0, alpha0_hat, xi_inv, xistar_inv, hsum; + sunrealtype alpha0, alpha0_hat, xi_inv, xistar_inv, hsum; int i,j; cv_mem->cv_l[0] = cv_mem->cv_l[1] = xi_inv = xistar_inv = ONE; @@ -2763,11 +2763,11 @@ static void cvSetBDF(CVodeMem cv_mem) * lmm == CV_BDF. */ -static void cvSetTqBDF(CVodeMem cv_mem, realtype hsum, realtype alpha0, - realtype alpha0_hat, realtype xi_inv, realtype xistar_inv) +static void cvSetTqBDF(CVodeMem cv_mem, sunrealtype hsum, sunrealtype alpha0, + sunrealtype alpha0_hat, sunrealtype xi_inv, sunrealtype xistar_inv) { - realtype A1, A2, A3, A4, A5, A6; - realtype C, Cpinv, Cppinv; + sunrealtype A1, A2, A3, A4, A5, A6; + sunrealtype C, Cpinv, Cppinv; A1 = ONE - alpha0_hat + alpha0; A2 = ONE + cv_mem->cv_q * A1; @@ -2888,7 +2888,7 @@ static int cvNls(CVodeMem cv_mem, int nflag) static int cvCheckConstraints(CVodeMem cv_mem) { booleantype constraintsPassed; - realtype vnorm; + sunrealtype vnorm; N_Vector mm = cv_mem->cv_ftemp; N_Vector tmp = cv_mem->cv_tempv; @@ -2978,7 +2978,7 @@ static int cvCheckConstraints(CVodeMem cv_mem) * */ -static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *ncfPtr) { int nflag; @@ -3032,7 +3032,7 @@ static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, * the same values as before the call to cvPredict. */ -void cvRestore(CVodeMem cv_mem, realtype saved_t) +void cvRestore(CVodeMem cv_mem, sunrealtype saved_t) { int j, k; @@ -3072,10 +3072,10 @@ void cvRestore(CVodeMem cv_mem, realtype saved_t) * */ -static int cvDoErrorTest(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, - int *nefPtr, realtype *dsmPtr) +static int cvDoErrorTest(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, + int *nefPtr, sunrealtype *dsmPtr) { - realtype dsm; + sunrealtype dsm; int retval; dsm = cv_mem->cv_acnrm * cv_mem->cv_tq[2]; @@ -3242,7 +3242,7 @@ static void cvCompleteStep(CVodeMem cv_mem) * related to a change of step size or order. */ -static void cvPrepareNextStep(CVodeMem cv_mem, realtype dsm) +static void cvPrepareNextStep(CVodeMem cv_mem, sunrealtype dsm) { /* If etamax = 1, defer step size or order changes */ if (cv_mem->cv_etamax == ONE) { @@ -3323,9 +3323,9 @@ static void cvSetEta(CVodeMem cv_mem) * possible decrease in order by 1. */ -static realtype cvComputeEtaqm1(CVodeMem cv_mem) +static sunrealtype cvComputeEtaqm1(CVodeMem cv_mem) { - realtype ddn; + sunrealtype ddn; cv_mem->cv_etaqm1 = ZERO; if (cv_mem->cv_q > 1) { @@ -3342,9 +3342,9 @@ static realtype cvComputeEtaqm1(CVodeMem cv_mem) * possible increase in order by 1. */ -static realtype cvComputeEtaqp1(CVodeMem cv_mem) +static sunrealtype cvComputeEtaqp1(CVodeMem cv_mem) { - realtype dup, cquot; + sunrealtype dup, cquot; cv_mem->cv_etaqp1 = ZERO; if (cv_mem->cv_q != cv_mem->cv_qmax) { @@ -3373,7 +3373,7 @@ static realtype cvComputeEtaqp1(CVodeMem cv_mem) static void cvChooseEta(CVodeMem cv_mem) { - realtype etam; + sunrealtype etam; etam = SUNMAX(cv_mem->cv_etaqm1, SUNMAX(cv_mem->cv_etaq, cv_mem->cv_etaqp1)); @@ -3538,7 +3538,7 @@ static int cvHandleFailure(CVodeMem cv_mem, int flag) static void cvBDFStab(CVodeMem cv_mem) { int i,k, ldflag, factorial; - realtype sq, sqm1, sqm2; + sunrealtype sq, sqm1, sqm2; /* If order is 3 or greater, then save scaled derivative data, push old data down in i, then add current values to top. */ @@ -3627,14 +3627,14 @@ static void cvBDFStab(CVodeMem cv_mem) static int cvSLdet(CVodeMem cv_mem) { int i, k, j, it, kmin = 0, kflag = 0; - realtype rat[5][4], rav[4], qkr[4], sigsq[4], smax[4], ssmax[4]; - realtype drr[4], rrc[4],sqmx[4], qjk[4][4], vrat[5], qc[6][4], qco[6][4]; - realtype rr, rrcut, vrrtol, vrrt2, sqtol, rrtol; - realtype smink, smaxk, sumrat, sumrsq, vmin, vmax, drrmax, adrr; - realtype tem, sqmax, saqk, qp, s, sqmaxk, saqj, sqmin; - realtype rsa, rsb, rsc, rsd, rd1a, rd1b, rd1c; - realtype rd2a, rd2b, rd3a, cest1, corr1; - realtype ratp, ratm, qfac1, qfac2, bb, rrb; + sunrealtype rat[5][4], rav[4], qkr[4], sigsq[4], smax[4], ssmax[4]; + sunrealtype drr[4], rrc[4],sqmx[4], qjk[4][4], vrat[5], qc[6][4], qco[6][4]; + sunrealtype rr, rrcut, vrrtol, vrrt2, sqtol, rrtol; + sunrealtype smink, smaxk, sumrat, sumrsq, vmin, vmax, drrmax, adrr; + sunrealtype tem, sqmax, saqk, qp, s, sqmaxk, saqj, sqmin; + sunrealtype rsa, rsb, rsc, rsd, rd1a, rd1b, rd1c; + sunrealtype rd2a, rd2b, rd3a, cest1, corr1; + sunrealtype ratp, ratm, qfac1, qfac2, bb, rrb; /* The following are cutoffs and tolerances used by this routine */ @@ -3919,7 +3919,7 @@ static int cvSLdet(CVodeMem cv_mem) static int cvRcheck1(CVodeMem cv_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; for (i = 0; i < cv_mem->cv_nrtfn; i++) cv_mem->cv_iroots[i] = 0; @@ -3987,7 +3987,7 @@ static int cvRcheck1(CVodeMem cv_mem) static int cvRcheck2(CVodeMem cv_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; if (cv_mem->cv_irfnd == 0) return(CV_SUCCESS); @@ -4182,7 +4182,7 @@ static int cvRcheck3(CVodeMem cv_mem) static int cvRootfind(CVodeMem cv_mem) { - realtype alph, tmid, gfrac, maxfrac, fracint, fracsub; + sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; booleantype zroot, sgnchg; diff --git a/src/cvode/cvode_bandpre.c b/src/cvode/cvode_bandpre.c index 604181346f..414c1fde82 100644 --- a/src/cvode/cvode_bandpre.c +++ b/src/cvode/cvode_bandpre.c @@ -34,19 +34,19 @@ #define TWO RCONST(2.0) /* Prototypes of CVBandPrecSetup and CVBandPrecSolve */ -static int CVBandPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int CVBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bp_data); -static int CVBandPrecSolve(realtype t, N_Vector y, N_Vector fy, + sunrealtype gamma, void *bp_data); +static int CVBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bp_data); /* Prototype for CVBandPrecFree */ static int CVBandPrecFree(CVodeMem cv_mem); /* Prototype for difference quotient Jacobian calculation routine */ -static int CVBandPDQJac(CVBandPrecData pdata, realtype t, N_Vector y, +static int CVBandPDQJac(CVBandPrecData pdata, sunrealtype t, N_Vector y, N_Vector fy, N_Vector ftemp, N_Vector ytemp); @@ -334,9 +334,9 @@ int CVBandPrecGetNumRhsEvals(void *cvode_mem, long int *nfevalsBP) 0 if successful, or 1 if the band factorization failed. -----------------------------------------------------------------*/ -static int CVBandPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int CVBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bp_data) + sunrealtype gamma, void *bp_data) { CVBandPrecData pdata; CVodeMem cv_mem; @@ -428,9 +428,9 @@ static int CVBandPrecSetup(realtype t, N_Vector y, N_Vector fy, The value returned by the CVBandPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int CVBandPrecSolve(realtype t, N_Vector y, N_Vector fy, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *bp_data) +static int CVBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *bp_data) { CVBandPrecData pdata; int retval; @@ -479,14 +479,14 @@ static int CVBandPrecFree(CVodeMem cv_mem) write a simple for loop to set each of the elements of a column in succession. -----------------------------------------------------------------*/ -static int CVBandPDQJac(CVBandPrecData pdata, realtype t, N_Vector y, +static int CVBandPDQJac(CVBandPrecData pdata, sunrealtype t, N_Vector y, N_Vector fy, N_Vector ftemp, N_Vector ytemp) { CVodeMem cv_mem; - realtype fnorm, minInc, inc, inc_inv, yj, srur, conj; + sunrealtype fnorm, minInc, inc, inc_inv, yj, srur, conj; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *col_j, *ewt_data, *fy_data, *ftemp_data; - realtype *y_data, *ytemp_data, *cns_data; + sunrealtype *col_j, *ewt_data, *fy_data, *ftemp_data; + sunrealtype *y_data, *ytemp_data, *cns_data; int retval; /* initialize cns_data to avoid compiler warning */ diff --git a/src/cvode/cvode_bbdpre.c b/src/cvode/cvode_bbdpre.c index 0b160d396f..d9b6302d4c 100644 --- a/src/cvode/cvode_bbdpre.c +++ b/src/cvode/cvode_bbdpre.c @@ -36,19 +36,19 @@ #define TWO RCONST(2.0) /* Prototypes of functions CVBBDPrecSetup and CVBBDPrecSolve */ -static int CVBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bbd_data); -static int CVBBDPrecSolve(realtype t, N_Vector y, N_Vector fy, + sunrealtype gamma, void *bbd_data); +static int CVBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bbd_data); /* Prototype for CVBBDPrecFree */ static int CVBBDPrecFree(CVodeMem cv_mem); /* Prototype for difference quotient Jacobian calculation routine */ -static int CVBBDDQJac(CVBBDPrecData pdata, realtype t, +static int CVBBDDQJac(CVBBDPrecData pdata, sunrealtype t, N_Vector y, N_Vector gy, N_Vector ytemp, N_Vector gtemp); @@ -58,7 +58,7 @@ static int CVBBDDQJac(CVBBDPrecData pdata, realtype t, int CVBBDPrecInit(void *cvode_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dqrely, CVLocalFn gloc, CVCommFn cfn) + sunrealtype dqrely, CVLocalFn gloc, CVCommFn cfn) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -282,7 +282,7 @@ int CVBBDPrecInit(void *cvode_mem, sunindextype Nlocal, int CVBBDPrecReInit(void *cvode_mem, sunindextype mudq, - sunindextype mldq, realtype dqrely) + sunindextype mldq, sunrealtype dqrely) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -444,9 +444,9 @@ int CVBBDPrecGetNumGfnEvals(void *cvode_mem, 0 if successful, 1 for a recoverable error (step will be retried). -----------------------------------------------------------------*/ -static int CVBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bbd_data) + sunrealtype gamma, void *bbd_data) { CVBBDPrecData pdata; CVodeMem cv_mem; @@ -538,9 +538,9 @@ static int CVBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, The value returned by the CVBBDPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int CVBBDPrecSolve(realtype t, N_Vector y, N_Vector fy, +static int CVBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bbd_data) { int retval; @@ -605,14 +605,14 @@ static int CVBBDPrecFree(CVodeMem cv_mem) This routine also assumes that the local elements of a vector are stored contiguously. -----------------------------------------------------------------*/ -static int CVBBDDQJac(CVBBDPrecData pdata, realtype t, N_Vector y, +static int CVBBDDQJac(CVBBDPrecData pdata, sunrealtype t, N_Vector y, N_Vector gy, N_Vector ytemp, N_Vector gtemp) { CVodeMem cv_mem; - realtype gnorm, minInc, inc, inc_inv, yj, conj; + sunrealtype gnorm, minInc, inc, inc_inv, yj, conj; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *y_data, *ewt_data, *gy_data, *gtemp_data; - realtype *ytemp_data, *col_j, *cns_data; + sunrealtype *y_data, *ewt_data, *gy_data, *gtemp_data; + sunrealtype *ytemp_data, *col_j, *cns_data; int retval; /* initialize cns_data to avoid compiler warning */ diff --git a/src/cvode/cvode_bbdpre_impl.h b/src/cvode/cvode_bbdpre_impl.h index e56354b058..3f9371214c 100644 --- a/src/cvode/cvode_bbdpre_impl.h +++ b/src/cvode/cvode_bbdpre_impl.h @@ -36,7 +36,7 @@ typedef struct CVBBDPrecDataRec { /* passed by user to CVBBDPrecInit and used by PrecSetup/PrecSolve */ sunindextype mudq, mldq, mukeep, mlkeep; - realtype dqrely; + sunrealtype dqrely; CVLocalFn gloc; CVCommFn cfn; diff --git a/src/cvode/cvode_diag.c b/src/cvode/cvode_diag.c index ce87591cbe..91685f8a95 100644 --- a/src/cvode/cvode_diag.c +++ b/src/cvode/cvode_diag.c @@ -25,8 +25,8 @@ #ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS extern -int cvDiagSetup_formY(const realtype h, - const realtype r, +int cvDiagSetup_formY(const sunrealtype h, + const sunrealtype r, const N_Vector fpred, const N_Vector zn1, const N_Vector ypred, @@ -34,9 +34,9 @@ int cvDiagSetup_formY(const realtype h, N_Vector y); extern -int cvDiagSetup_buildM(const realtype fract, - const realtype uround, - const realtype h, +int cvDiagSetup_buildM(const sunrealtype fract, + const sunrealtype uround, + const sunrealtype h, const N_Vector ftemp, const N_Vector fpred, const N_Vector ewt, @@ -45,7 +45,7 @@ int cvDiagSetup_buildM(const realtype fract, N_Vector y, N_Vector M); -int cvDiagSolve_updateM(const realtype r, N_Vector M); +int cvDiagSolve_updateM(const sunrealtype r, N_Vector M); #endif /* Other Constants */ @@ -342,7 +342,7 @@ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { - realtype r; + sunrealtype r; N_Vector ftemp, y; booleantype invOK; CVDiagMem cvdiag_mem; @@ -430,7 +430,7 @@ static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur) { booleantype invOK; - realtype r; + sunrealtype r; CVDiagMem cvdiag_mem; cvdiag_mem = (CVDiagMem) lmem; diff --git a/src/cvode/cvode_diag_impl.h b/src/cvode/cvode_diag_impl.h index a3a1fcf0f4..ac2904227b 100644 --- a/src/cvode/cvode_diag_impl.h +++ b/src/cvode/cvode_diag_impl.h @@ -37,7 +37,7 @@ extern "C" { typedef struct { - realtype di_gammasv; /* gammasv = gamma at the last call to setup */ + sunrealtype di_gammasv; /* gammasv = gamma at the last call to setup */ /* or solve */ N_Vector di_M; /* M = (I - gamma J)^{-1} , gamma = h / l1 */ diff --git a/src/cvode/cvode_fused_gpu.cpp b/src/cvode/cvode_fused_gpu.cpp index d8ff76297d..500717b766 100644 --- a/src/cvode/cvode_fused_gpu.cpp +++ b/src/cvode/cvode_fused_gpu.cpp @@ -53,20 +53,20 @@ constexpr auto gpuAssert = SUNDIALS_HIP_Assert; __global__ void cvEwtSetSS_kernel(const sunindextype length, - const realtype reltol, - const realtype Sabstol, - const realtype* ycur, - realtype* tempv, - realtype* weight) + const sunrealtype reltol, + const sunrealtype Sabstol, + const sunrealtype* ycur, + sunrealtype* tempv, + sunrealtype* weight) { - const realtype one = 1.0; + const sunrealtype one = 1.0; GRID_STRIDE_XLOOP(sunindextype, i, length) { // N_VAbs(ycur, cv_mem->cv_tempv); // N_VScale(cv_mem->cv_reltol, cv_mem->cv_tempv, cv_mem->cv_tempv); // N_VAddConst(cv_mem->cv_tempv, cv_mem->cv_Sabstol, cv_mem->cv_tempv); // N_VInv(cv_mem->cv_tempv, weight); - realtype tmp = abs(ycur[i]); + sunrealtype tmp = abs(ycur[i]); tempv[i] = reltol*tmp + Sabstol; weight[i] = one/tempv[i]; } @@ -74,8 +74,8 @@ void cvEwtSetSS_kernel(const sunindextype length, extern "C" int cvEwtSetSS_fused(const booleantype atolMin0, - const realtype reltol, - const realtype Sabstol, + const sunrealtype reltol, + const sunrealtype Sabstol, const N_Vector ycur, N_Vector tempv, N_Vector weight) @@ -113,20 +113,20 @@ int cvEwtSetSS_fused(const booleantype atolMin0, __global__ void cvEwtSetSV_kernel(const sunindextype length, - const realtype reltol, - const realtype* Vabstol, - const realtype* ycur, - realtype* tempv, - realtype* weight) + const sunrealtype reltol, + const sunrealtype* Vabstol, + const sunrealtype* ycur, + sunrealtype* tempv, + sunrealtype* weight) { - const realtype one = 1.0; + const sunrealtype one = 1.0; GRID_STRIDE_XLOOP(sunindextype, i, length) { // N_VAbs(ycur, cv_mem->cv_tempv); // N_VLinearSum(cv_mem->cv_reltol, cv_mem->cv_tempv, ONE, // cv_mem->cv_Vabstol, cv_mem->cv_tempv); // N_VInv(cv_mem->cv_tempv, weight); - realtype tmp = abs(ycur[i]); + sunrealtype tmp = abs(ycur[i]); tempv[i] = reltol*tmp + Vabstol[i]; weight[i] = one/tempv[i]; } @@ -134,7 +134,7 @@ void cvEwtSetSV_kernel(const sunindextype length, extern "C" int cvEwtSetSV_fused(const booleantype atolMin0, - const realtype reltol, + const sunrealtype reltol, const N_Vector Vabstol, const N_Vector ycur, N_Vector tempv, @@ -174,16 +174,16 @@ int cvEwtSetSV_fused(const booleantype atolMin0, __global__ void cvCheckConstraints_kernel(const sunindextype length, - const realtype* c, - const realtype* ewt, - const realtype* y, - const realtype* mm, - realtype* tempv) + const sunrealtype* c, + const sunrealtype* ewt, + const sunrealtype* y, + const sunrealtype* mm, + sunrealtype* tempv) { - static const realtype zero = 0.0; - static const realtype pt1 = 0.1; - static const realtype one = 1.0; - static const realtype onept5 = 1.5; + static const sunrealtype zero = 0.0; + static const sunrealtype pt1 = 0.1; + static const sunrealtype one = 1.0; + static const sunrealtype onept5 = 1.5; GRID_STRIDE_XLOOP(sunindextype, i, length) { // N_VCompare(ONEPT5, cv_mem->cv_constraints, tmp); /* a[i]=1 when |c[i]|=2 */ @@ -191,7 +191,7 @@ void cvCheckConstraints_kernel(const sunindextype length, // N_VDiv(tmp, cv_mem->cv_ewt, tmp); /* a * c * wt */ // N_VLinearSum(ONE, cv_mem->cv_y, -PT1, tmp, tmp); /* y - 0.1 * a * c * wt */ // N_VProd(tmp, mm, tmp); /* v = mm*(y-0.1*a*c*wt) */ - realtype tmp = (abs(c[i]) >= onept5) ? one : zero; + sunrealtype tmp = (abs(c[i]) >= onept5) ? one : zero; tmp = tmp*c[i]; tmp = tmp/ewt[i]; tmp = y[i] - pt1*tmp; @@ -239,25 +239,25 @@ int cvCheckConstraints_fused(const N_Vector c, __global__ void cvNlsResid_kernel(const sunindextype length, - const realtype rl1, - const realtype ngamma, - const realtype* zn1, - const realtype* ycor, - const realtype* ftemp, - realtype* res) + const sunrealtype rl1, + const sunrealtype ngamma, + const sunrealtype* zn1, + const sunrealtype* ycor, + const sunrealtype* ftemp, + sunrealtype* res) { GRID_STRIDE_XLOOP(sunindextype, i, length) { // N_VLinearSum(cv_mem->cv_rl1, cv_mem->cv_zn[1], ONE, ycor, res); // N_VLinearSum(-cv_mem->cv_gamma, cv_mem->cv_ftemp, ONE, res, res); - realtype tmp = rl1*zn1[i] + ycor[i]; + sunrealtype tmp = rl1*zn1[i] + ycor[i]; res[i] = ngamma*ftemp[i] + tmp; } } extern "C" -int cvNlsResid_fused(const realtype rl1, - const realtype ngamma, +int cvNlsResid_fused(const sunrealtype rl1, + const sunrealtype ngamma, const N_Vector zn1, const N_Vector ycor, const N_Vector ftemp, @@ -295,13 +295,13 @@ int cvNlsResid_fused(const realtype rl1, __global__ void cvDiagSetup_formY_kernel(const sunindextype length, - const realtype h, - const realtype r, - const realtype* fpred, - const realtype* zn1, - const realtype* ypred, - realtype* ftemp, - realtype* y) + const sunrealtype h, + const sunrealtype r, + const sunrealtype* fpred, + const sunrealtype* zn1, + const sunrealtype* ypred, + sunrealtype* ftemp, + sunrealtype* y) { // N_VLinearSum(h, fpred, -ONE, zn[1], ftemp); // N_VLinearSum(r, ftemp, ONE, ypred, y); @@ -313,8 +313,8 @@ void cvDiagSetup_formY_kernel(const sunindextype length, } extern "C" -int cvDiagSetup_formY(const realtype h, - const realtype r, +int cvDiagSetup_formY(const sunrealtype h, + const sunrealtype r, const N_Vector fpred, const N_Vector zn1, const N_Vector ypred, @@ -355,19 +355,19 @@ int cvDiagSetup_formY(const realtype h, __global__ void cvDiagSetup_buildM_kernel(const sunindextype length, - const realtype fract, - const realtype uround, - const realtype h, - const realtype* ftemp, - const realtype* fpred, - const realtype* ewt, - realtype* bit, - realtype* bitcomp, - realtype* y, - realtype* M) + const sunrealtype fract, + const sunrealtype uround, + const sunrealtype h, + const sunrealtype* ftemp, + const sunrealtype* fpred, + const sunrealtype* ewt, + sunrealtype* bit, + sunrealtype* bitcomp, + sunrealtype* y, + sunrealtype* M) { - static const realtype zero = 0.0; - static const realtype one = 1.0; + static const sunrealtype zero = 0.0; + static const sunrealtype one = 1.0; GRID_STRIDE_XLOOP(sunindextype, i, length) { // N_VLinearSum(ONE, M, -ONE, fpred, M); @@ -393,9 +393,9 @@ void cvDiagSetup_buildM_kernel(const sunindextype length, } extern "C" -int cvDiagSetup_buildM(const realtype fract, - const realtype uround, - const realtype h, +int cvDiagSetup_buildM(const sunrealtype fract, + const sunrealtype uround, + const sunrealtype h, const N_Vector ftemp, const N_Vector fpred, const N_Vector ewt, @@ -441,23 +441,23 @@ int cvDiagSetup_buildM(const realtype fract, __global__ -void cvDiagSolve_updateM_kernel(const sunindextype length, const realtype r, realtype* M) +void cvDiagSolve_updateM_kernel(const sunindextype length, const sunrealtype r, sunrealtype* M) { - static const realtype one = 1.0; + static const sunrealtype one = 1.0; GRID_STRIDE_XLOOP(sunindextype, i, length) { // N_VInv(M, M); // N_VAddConst(M, -ONE, M); // N_VScale(r, M, M); // N_VAddConst(M, ONE, M); - realtype a = one/M[i] - one; + sunrealtype a = one/M[i] - one; M[i] = r*a + one; } } extern "C" -int cvDiagSolve_updateM(const realtype r, N_Vector M) +int cvDiagSolve_updateM(const sunrealtype r, N_Vector M) { const SUNExecPolicy* exec_policy = ((NVectorContent)M->content)->stream_exec_policy; const sunindextype N = N_VGetLength(M); diff --git a/src/cvode/cvode_fused_stubs.c b/src/cvode/cvode_fused_stubs.c index f972a7bb7f..157bdda9e3 100644 --- a/src/cvode/cvode_fused_stubs.c +++ b/src/cvode/cvode_fused_stubs.c @@ -33,8 +33,8 @@ */ int cvEwtSetSS_fused(const booleantype atolmin0, - const realtype reltol, - const realtype Sabstol, + const sunrealtype reltol, + const sunrealtype Sabstol, const N_Vector ycur, N_Vector tempv, N_Vector weight) @@ -57,7 +57,7 @@ int cvEwtSetSS_fused(const booleantype atolmin0, int cvEwtSetSV_fused(const booleantype atolmin0, - const realtype reltol, + const sunrealtype reltol, const N_Vector Vabstol, const N_Vector ycur, N_Vector tempv, @@ -104,8 +104,8 @@ int cvCheckConstraints_fused(const N_Vector c, */ -int cvNlsResid_fused(const realtype rl1, - const realtype ngamma, +int cvNlsResid_fused(const sunrealtype rl1, + const sunrealtype ngamma, const N_Vector zn1, const N_Vector ycor, const N_Vector ftemp, @@ -122,8 +122,8 @@ int cvNlsResid_fused(const realtype rl1, * ----------------------------------------------------------------- */ -int cvDiagSetup_formY(const realtype h, - const realtype r, +int cvDiagSetup_formY(const sunrealtype h, + const sunrealtype r, const N_Vector fpred, const N_Vector zn1, const N_Vector ypred, @@ -142,9 +142,9 @@ int cvDiagSetup_formY(const realtype h, * ----------------------------------------------------------------- */ -int cvDiagSetup_buildM(const realtype fract, - const realtype uround, - const realtype h, +int cvDiagSetup_buildM(const sunrealtype fract, + const sunrealtype uround, + const sunrealtype h, const N_Vector ftemp, const N_Vector fpred, const N_Vector ewt, @@ -174,7 +174,7 @@ int cvDiagSetup_buildM(const realtype fract, * ----------------------------------------------------------------- */ -int cvDiagSolve_updateM(const realtype r, N_Vector M) +int cvDiagSolve_updateM(const sunrealtype r, N_Vector M) { N_VInv(M, M); N_VAddConst(M, -ONE, M); diff --git a/src/cvode/cvode_hypamgpre.c b/src/cvode/cvode_hypamgpre.c index e1545770df..9b8bb3e261 100644 --- a/src/cvode/cvode_hypamgpre.c +++ b/src/cvode/cvode_hypamgpre.c @@ -50,20 +50,20 @@ /* Prototypes of functions CVBoomerAMGSetup and CVBoomerAMGSolve */ -static int CVBoomerAMGSetup(realtype t, N_Vector y, N_Vector fy, +static int CVBoomerAMGSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *hypamg_data, + sunrealtype gamma, void *hypamg_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -static int CVBoomerAMGSolve(realtype t, N_Vector y, N_Vector fy, +static int CVBoomerAMGSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *hypamg_data, N_Vector tmp); /* Prototype for CVBoomerAMGFree */ static void CVBoomerAMGFree(CVodeMem cv_mem); -static int CVParCsrCreateGammaIdentity(HYPRE_IJMatrix* id_mat, realtype gamma, sunindextype ilower, sunindextype iupper); +static int CVParCsrCreateGammaIdentity(HYPRE_IJMatrix* id_mat, sunrealtype gamma, sunindextype ilower, sunindextype iupper); /* * ----------------------------------------------------------------- @@ -204,9 +204,9 @@ int CVBoomerAMGInit(void *cvode_mem, int ilower, int iupper, int jlower, int jup * ----------------------------------------------------------------- */ -int CVBoomerAMGSetup(realtype t, N_Vector y, N_Vector fy, +int CVBoomerAMGSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *hypamg_data, + sunrealtype gamma, void *hypamg_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { int counter=0; @@ -261,9 +261,9 @@ int CVBoomerAMGSetup(realtype t, N_Vector y, N_Vector fy, * ----------------------------------------------------------------- */ -int CVBoomerAMGSolve(realtype t, N_Vector y, N_Vector fy, +int CVBoomerAMGSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *hypamg_data, N_Vector tmp) { CVBoomerAMGData pdata; @@ -318,7 +318,7 @@ static void CVBoomerAMGFree(CVodeMem cv_mem) } /* -int JacTimes(N_Vector v, N_Vector Jv, realtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) +int JacTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp) { CVodeMem cv_mem; CVSpilsMem cvspils_mem; @@ -405,7 +405,7 @@ int CVParCsrSetSpilsJacTimesVecFn(void *cvode_mem, CVSpilsJacTimesVecFn jparcsr) return(CVSPILS_SUCCESS); } -int CVParCsrCreateGammaIdentity(HYPRE_IJMatrix* id_mat, realtype gamma, sunindextype ilow, sunindextype iup) +int CVParCsrCreateGammaIdentity(HYPRE_IJMatrix* id_mat, sunrealtype gamma, sunindextype ilow, sunindextype iup) { int nnz, i; double values[5]; diff --git a/src/cvode/cvode_hypamgpre_impl.h b/src/cvode/cvode_hypamgpre_impl.h index dbed5fbc3f..7116f628df 100644 --- a/src/cvode/cvode_hypamgpre_impl.h +++ b/src/cvode/cvode_hypamgpre_impl.h @@ -46,7 +46,7 @@ typedef struct CVBoomerAMGDataRec { /* passed by user to CVBoomerAMGAlloc and used by PrecSetup/PrecSolve */ sunindextype mudq, mldq, mukeep, mlkeep; - realtype dqrely; + sunrealtype dqrely; CVParCsrJacFn jacfn; /* set by CVBoomerAMGAlloc and used by CVBoomerAMGSetup */ diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index 966626b715..5e92c5c690 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -201,7 +201,7 @@ typedef struct CVodeMemRec { SUNContext cv_sunctx; - realtype cv_uround; /* machine unit roundoff */ + sunrealtype cv_uround; /* machine unit roundoff */ /*-------------------------- Problem Specification Data @@ -212,8 +212,8 @@ typedef struct CVodeMemRec { int cv_lmm; /* lmm = CV_ADAMS or CV_BDF */ int cv_itol; /* itol = CV_SS, CV_SV, CV_WF, CV_NN */ - realtype cv_reltol; /* relative tolerance */ - realtype cv_Sabstol; /* scalar absolute tolerance */ + sunrealtype cv_reltol; /* relative tolerance */ + sunrealtype cv_Sabstol; /* scalar absolute tolerance */ N_Vector cv_Vabstol; /* vector absolute tolerance */ booleantype cv_atolmin0; /* flag indicating that min(abstol) = 0 */ booleantype cv_user_efun; /* SUNTRUE if user sets efun */ @@ -257,7 +257,7 @@ typedef struct CVodeMemRec { booleantype cv_tstopset; booleantype cv_tstopinterp; - realtype cv_tstop; + sunrealtype cv_tstop; /*--------- Step Data @@ -271,31 +271,31 @@ typedef struct CVodeMemRec { considering a change in q */ int cv_L; /* L = q + 1 */ - realtype cv_hin; /* initial step size */ - realtype cv_h; /* current step size */ - realtype cv_hprime; /* step size to be used on the next step */ - realtype cv_next_h; /* step size to be used on the next step */ - realtype cv_eta; /* eta = hprime / h */ - realtype cv_hscale; /* value of h used in zn */ - realtype cv_tn; /* current internal value of t */ - realtype cv_tretlast; /* last value of t returned by CVode */ + sunrealtype cv_hin; /* initial step size */ + sunrealtype cv_h; /* current step size */ + sunrealtype cv_hprime; /* step size to be used on the next step */ + sunrealtype cv_next_h; /* step size to be used on the next step */ + sunrealtype cv_eta; /* eta = hprime / h */ + sunrealtype cv_hscale; /* value of h used in zn */ + sunrealtype cv_tn; /* current internal value of t */ + sunrealtype cv_tretlast; /* last value of t returned by CVode */ - realtype cv_tau[L_MAX+1]; /* array of previous q+1 successful step + sunrealtype cv_tau[L_MAX+1]; /* array of previous q+1 successful step sizes indexed from 1 to q+1 */ - realtype cv_tq[NUM_TESTS+1]; /* array of test quantities indexed from + sunrealtype cv_tq[NUM_TESTS+1]; /* array of test quantities indexed from 1 to NUM_TESTS(=5) */ - realtype cv_l[L_MAX]; /* coefficients of l(x) (degree q poly) */ + sunrealtype cv_l[L_MAX]; /* coefficients of l(x) (degree q poly) */ - realtype cv_rl1; /* the scalar 1/l[1] */ - realtype cv_gamma; /* gamma = h * rl1 */ - realtype cv_gammap; /* gamma at the last setup call */ - realtype cv_gamrat; /* gamma / gammap */ + sunrealtype cv_rl1; /* the scalar 1/l[1] */ + sunrealtype cv_gamma; /* gamma = h * rl1 */ + sunrealtype cv_gammap; /* gamma at the last setup call */ + sunrealtype cv_gamrat; /* gamma / gammap */ - realtype cv_crate; /* estimated corrector convergence rate */ - realtype cv_delp; /* norm of previous nonlinear solver update */ - realtype cv_acnrm; /* | acor | */ + sunrealtype cv_crate; /* estimated corrector convergence rate */ + sunrealtype cv_delp; /* norm of previous nonlinear solver update */ + sunrealtype cv_acnrm; /* | acor | */ booleantype cv_acnrmcur; /* is | acor | current? */ - realtype cv_nlscoef; /* coeficient in nonlinear convergence test */ + sunrealtype cv_nlscoef; /* coeficient in nonlinear convergence test */ /*------ Limits @@ -308,18 +308,18 @@ typedef struct CVodeMemRec { int cv_maxnef; /* maximum number of error test failures */ int cv_maxncf; /* maximum number of nonlinear convergence failures */ - realtype cv_hmin; /* |h| >= hmin */ - realtype cv_hmax_inv; /* |h| <= 1/hmax_inv */ - realtype cv_etamax; /* eta <= etamax */ - realtype cv_eta_min_fx; /* eta_min_fx < eta < eta_max_fx keep the current h */ - realtype cv_eta_max_fx; - realtype cv_eta_max_fs; /* eta <= eta_max_fs on the first step */ - realtype cv_eta_max_es; /* eta <= eta_max_es on early steps */ - realtype cv_eta_max_gs; /* eta <= eta_max_gs on a general step */ - realtype cv_eta_min; /* eta >= eta_min on a general step */ - realtype cv_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ - realtype cv_eta_max_ef; /* eta on multiple (>= small_nef) error test failures */ - realtype cv_eta_cf; /* eta on a nonlinear solver convergence failure */ + sunrealtype cv_hmin; /* |h| >= hmin */ + sunrealtype cv_hmax_inv; /* |h| <= 1/hmax_inv */ + sunrealtype cv_etamax; /* eta <= etamax */ + sunrealtype cv_eta_min_fx; /* eta_min_fx < eta < eta_max_fx keep the current h */ + sunrealtype cv_eta_max_fx; + sunrealtype cv_eta_max_fs; /* eta <= eta_max_fs on the first step */ + sunrealtype cv_eta_max_es; /* eta <= eta_max_es on early steps */ + sunrealtype cv_eta_max_gs; /* eta <= eta_max_gs on a general step */ + sunrealtype cv_eta_min; /* eta >= eta_min on a general step */ + sunrealtype cv_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ + sunrealtype cv_eta_max_ef; /* eta on multiple (>= small_nef) error test failures */ + sunrealtype cv_eta_cf; /* eta on a nonlinear solver convergence failure */ long int cv_small_nst; /* nst <= small_nst use eta_max_es */ int cv_small_nef; /* nef >= small_nef use eta_max_ef */ @@ -342,17 +342,17 @@ typedef struct CVodeMemRec { Step size ratios ----------------*/ - realtype cv_etaqm1; /* ratio of new to old h for order q-1 */ - realtype cv_etaq; /* ratio of new to old h for order q */ - realtype cv_etaqp1; /* ratio of new to old h for order q+1 */ + sunrealtype cv_etaqm1; /* ratio of new to old h for order q-1 */ + sunrealtype cv_etaq; /* ratio of new to old h for order q */ + sunrealtype cv_etaqp1; /* ratio of new to old h for order q+1 */ /*------------------ Space requirements ------------------*/ - sunindextype cv_lrw1; /* no. of realtype words in 1 N_Vector y */ + sunindextype cv_lrw1; /* no. of sunrealtype words in 1 N_Vector y */ sunindextype cv_liw1; /* no. of integer words in 1 N_Vector y */ - long int cv_lrw; /* no. of realtype words in CVODE work vectors */ + long int cv_lrw; /* no. of sunrealtype words in CVODE work vectors */ long int cv_liw; /* no. of integer words in CVODE work vectors */ /*--------------------- @@ -386,7 +386,7 @@ typedef struct CVodeMemRec { void *cv_lmem; /* linear solver interface memory structure */ long int cv_msbp; /* max number of steps between lsetip calls */ - realtype cv_dgmax_lsetup; /* gamma ratio threshold to signal for a linear + sunrealtype cv_dgmax_lsetup; /* gamma ratio threshold to signal for a linear * solver setup */ /*------------ @@ -395,11 +395,11 @@ typedef struct CVodeMemRec { int cv_qu; /* last successful q value used */ long int cv_nstlp; /* step number of last setup call */ - realtype cv_h0u; /* actual initial stepsize */ - realtype cv_hu; /* last successful h value used */ - realtype cv_saved_tq5; /* saved value of tq[5] */ + sunrealtype cv_h0u; /* actual initial stepsize */ + sunrealtype cv_hu; /* last successful h value used */ + sunrealtype cv_saved_tq5; /* saved value of tq[5] */ booleantype cv_jcur; /* is Jacobian info for linear solver current? */ - realtype cv_tolsf; /* tolerance scale factor */ + sunrealtype cv_tolsf; /* tolerance scale factor */ int cv_qmax_alloc; /* value of qmax used when allocating mem */ int cv_indx_acor; /* index of the zn vector with saved acor */ @@ -430,7 +430,7 @@ typedef struct CVodeMemRec { -------------------------*/ booleantype cv_sldeton; /* is Stability Limit Detection on? */ - realtype cv_ssdat[6][4]; /* scaled data array for STALD */ + sunrealtype cv_ssdat[6][4]; /* scaled data array for STALD */ int cv_nscon; /* counter for STALD method */ long int cv_nor; /* counter for number of order reductions */ @@ -442,14 +442,14 @@ typedef struct CVodeMemRec { int cv_nrtfn; /* number of components of g */ int *cv_iroots; /* array for root information */ int *cv_rootdir; /* array specifying direction of zero-crossing */ - realtype cv_tlo; /* nearest endpoint of interval in root search */ - realtype cv_thi; /* farthest endpoint of interval in root search */ - realtype cv_trout; /* t value returned by rootfinding routine */ - realtype *cv_glo; /* saved array of g values at t = tlo */ - realtype *cv_ghi; /* saved array of g values at t = thi */ - realtype *cv_grout; /* array of g values at t = trout */ - realtype cv_toutc; /* copy of tout (if NORMAL mode) */ - realtype cv_ttol; /* tolerance on root location trout */ + sunrealtype cv_tlo; /* nearest endpoint of interval in root search */ + sunrealtype cv_thi; /* farthest endpoint of interval in root search */ + sunrealtype cv_trout; /* t value returned by rootfinding routine */ + sunrealtype *cv_glo; /* saved array of g values at t = tlo */ + sunrealtype *cv_ghi; /* saved array of g values at t = thi */ + sunrealtype *cv_grout; /* array of g values at t = trout */ + sunrealtype cv_toutc; /* copy of tout (if NORMAL mode) */ + sunrealtype cv_ttol; /* tolerance on root location trout */ int cv_taskc; /* copy of parameter itask */ int cv_irfnd; /* flag showing whether last step had a root */ long int cv_nge; /* counter for g evaluations */ @@ -463,13 +463,13 @@ typedef struct CVodeMemRec { CVodeProjMem proj_mem; /* projection memory structure */ booleantype proj_enabled; /* flag indicating if projection is enabled */ booleantype proj_applied; /* flag indicating if projection was applied */ - realtype proj_p[L_MAX]; /* coefficients of p(x) (degree q poly) */ + sunrealtype proj_p[L_MAX]; /* coefficients of p(x) (degree q poly) */ /*----------------------- Fused Vector Operations -----------------------*/ - realtype cv_cvals[L_MAX]; /* array of scalars */ + sunrealtype cv_cvals[L_MAX]; /* array of scalars */ N_Vector cv_Xvecs[L_MAX]; /* array of vectors */ booleantype cv_usefused; /* flag indicating if CVODE specific fused kernels should be used */ @@ -634,14 +634,14 @@ int cvNlsInit(CVodeMem cv_mem); /* Projection functions */ -int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *npfPtr); int cvProjInit(CVodeProjMem proj_mem); int cvProjFree(CVodeProjMem *proj_mem); /* Restore tn and undo prediction to reattempt a step */ -void cvRestore(CVodeMem cv_mem, realtype saved_t); +void cvRestore(CVodeMem cv_mem, sunrealtype saved_t); /* Reset h and rescale history array to prepare for a step */ diff --git a/src/cvode/cvode_io.c b/src/cvode/cvode_io.c index 174462b552..91513a8d25 100644 --- a/src/cvode/cvode_io.c +++ b/src/cvode/cvode_io.c @@ -40,7 +40,7 @@ * Specifies the gamma ratio threshold to signal for a linear solver setup */ -int CVodeSetDeltaGammaMaxLSetup(void *cvode_mem, realtype dgmax_lsetup) +int CVodeSetDeltaGammaMaxLSetup(void *cvode_mem, sunrealtype dgmax_lsetup) { CVodeMem cv_mem; @@ -304,7 +304,7 @@ int CVodeSetStabLimDet(void *cvode_mem, booleantype sldet) * Specifies the initial step size */ -int CVodeSetInitStep(void *cvode_mem, realtype hin) +int CVodeSetInitStep(void *cvode_mem, sunrealtype hin) { CVodeMem cv_mem; @@ -326,7 +326,7 @@ int CVodeSetInitStep(void *cvode_mem, realtype hin) * Specifies the minimum step size */ -int CVodeSetMinStep(void *cvode_mem, realtype hmin) +int CVodeSetMinStep(void *cvode_mem, sunrealtype hmin) { CVodeMem cv_mem; @@ -364,9 +364,9 @@ int CVodeSetMinStep(void *cvode_mem, realtype hmin) * Specifies the maximum step size */ -int CVodeSetMaxStep(void *cvode_mem, realtype hmax) +int CVodeSetMaxStep(void *cvode_mem, sunrealtype hmax) { - realtype hmax_inv; + sunrealtype hmax_inv; CVodeMem cv_mem; if (cvode_mem==NULL) { @@ -405,8 +405,8 @@ int CVodeSetMaxStep(void *cvode_mem, realtype hmax) */ -int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, - realtype eta_max_fx) +int CVodeSetEtaFixedStepBounds(void* cvode_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx) { CVodeMem cv_mem; @@ -438,7 +438,7 @@ int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, * Specifies the maximum step size change on the first step */ -int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs) +int CVodeSetEtaMaxFirstStep(void* cvode_mem, sunrealtype eta_max_fs) { CVodeMem cv_mem; @@ -466,7 +466,7 @@ int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs) * when nst <= small_nst */ -int CVodeSetEtaMaxEarlyStep(void* cvode_mem, realtype eta_max_es) +int CVodeSetEtaMaxEarlyStep(void* cvode_mem, sunrealtype eta_max_es) { CVodeMem cv_mem; @@ -521,7 +521,7 @@ int CVodeSetNumStepsEtaMaxEarlyStep(void* cvode_mem, long int small_nst) * Specifies the maximum step size change on a general steps (nst > small_nst) */ -int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs) +int CVodeSetEtaMax(void* cvode_mem, sunrealtype eta_max_gs) { CVodeMem cv_mem; @@ -548,7 +548,7 @@ int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs) * Specifies the minimum change on a general steps */ -int CVodeSetEtaMin(void* cvode_mem, realtype eta_min) +int CVodeSetEtaMin(void* cvode_mem, sunrealtype eta_min) { CVodeMem cv_mem; @@ -575,7 +575,7 @@ int CVodeSetEtaMin(void* cvode_mem, realtype eta_min) * Specifies the minimum step size change after an error test failure */ -int CVodeSetEtaMinErrFail(void* cvode_mem, realtype eta_min_ef) +int CVodeSetEtaMinErrFail(void* cvode_mem, sunrealtype eta_min_ef) { CVodeMem cv_mem; @@ -603,7 +603,7 @@ int CVodeSetEtaMinErrFail(void* cvode_mem, realtype eta_min_ef) * test failures */ -int CVodeSetEtaMaxErrFail(void* cvode_mem, realtype eta_max_ef) +int CVodeSetEtaMaxErrFail(void* cvode_mem, sunrealtype eta_max_ef) { CVodeMem cv_mem; @@ -658,7 +658,7 @@ int CVodeSetNumFailsEtaMaxErrFail(void* cvode_mem, int small_nef) * Specifies the step size change after a nonlinear solver failure */ -int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf) +int CVodeSetEtaConvFail(void* cvode_mem, sunrealtype eta_cf) { CVodeMem cv_mem; @@ -685,7 +685,7 @@ int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf) * Specifies the time beyond which the integration is not to proceed. */ -int CVodeSetStopTime(void *cvode_mem, realtype tstop) +int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop) { CVodeMem cv_mem; @@ -835,7 +835,7 @@ int CVodeSetMaxNonlinIters(void *cvode_mem, int maxcor) * test */ -int CVodeSetNonlinConvCoef(void *cvode_mem, realtype nlscoef) +int CVodeSetNonlinConvCoef(void *cvode_mem, sunrealtype nlscoef) { CVodeMem cv_mem; @@ -945,7 +945,7 @@ int CVodeSetNoInactiveRootWarn(void *cvode_mem) int CVodeSetConstraints(void *cvode_mem, N_Vector constraints) { CVodeMem cv_mem; - realtype temptest; + sunrealtype temptest; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODE", "CVodeSetConstraints", MSGCV_NO_MEM); @@ -1183,7 +1183,7 @@ int CVodeGetCurrentOrder(void *cvode_mem, int *qcur) * Returns the value of gamma for the current step. */ -int CVodeGetCurrentGamma(void *cvode_mem, realtype *gamma) +int CVodeGetCurrentGamma(void *cvode_mem, sunrealtype *gamma) { CVodeMem cv_mem; @@ -1231,7 +1231,7 @@ int CVodeGetNumStabLimOrderReds(void *cvode_mem, long int *nslred) * Returns the step size used on the first step */ -int CVodeGetActualInitStep(void *cvode_mem, realtype *hinused) +int CVodeGetActualInitStep(void *cvode_mem, sunrealtype *hinused) { CVodeMem cv_mem; @@ -1253,7 +1253,7 @@ int CVodeGetActualInitStep(void *cvode_mem, realtype *hinused) * Returns the step size used on the last successful step */ -int CVodeGetLastStep(void *cvode_mem, realtype *hlast) +int CVodeGetLastStep(void *cvode_mem, sunrealtype *hlast) { CVodeMem cv_mem; @@ -1275,7 +1275,7 @@ int CVodeGetLastStep(void *cvode_mem, realtype *hlast) * Returns the step size to be attempted on the next step */ -int CVodeGetCurrentStep(void *cvode_mem, realtype *hcur) +int CVodeGetCurrentStep(void *cvode_mem, sunrealtype *hcur) { CVodeMem cv_mem; @@ -1319,7 +1319,7 @@ int CVodeGetCurrentState(void *cvode_mem, N_Vector *y) * Returns the current value of the independent variable */ -int CVodeGetCurrentTime(void *cvode_mem, realtype *tcur) +int CVodeGetCurrentTime(void *cvode_mem, sunrealtype *tcur) { CVodeMem cv_mem; @@ -1341,7 +1341,7 @@ int CVodeGetCurrentTime(void *cvode_mem, realtype *tcur) * Returns a suggested factor for scaling tolerances */ -int CVodeGetTolScaleFactor(void *cvode_mem, realtype *tolsfact) +int CVodeGetTolScaleFactor(void *cvode_mem, sunrealtype *tolsfact) { CVodeMem cv_mem; @@ -1432,8 +1432,8 @@ int CVodeGetWorkSpace(void *cvode_mem, long int *lenrw, long int *leniw) int CVodeGetIntegratorStats(void *cvode_mem, long int *nsteps, long int *nfevals, long int *nlinsetups, long int *netfails, int *qlast, - int *qcur, realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur) + int *qcur, sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur) { CVodeMem cv_mem; @@ -1645,7 +1645,7 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nst > 0) { fprintf(outfile, "NLS iters per step = %"RSYM"\n", - (realtype) cv_mem->cv_nni / (realtype) cv_mem->cv_nst); + (sunrealtype) cv_mem->cv_nni / (sunrealtype) cv_mem->cv_nst); } /* linear solver stats */ @@ -1664,11 +1664,11 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nni > 0) { fprintf(outfile, "LS iters per NLS iter = %"RSYM"\n", - (realtype) cvls_mem->nli / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nli / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, "Jac evals per NLS iter = %"RSYM"\n", - (realtype) cvls_mem->nje / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nje / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, "Prec evals per NLS iter = %"RSYM"\n", - (realtype) cvls_mem->npe / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->npe / (sunrealtype) cv_mem->cv_nni); } } @@ -1706,7 +1706,7 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nst > 0) { fprintf(outfile, ",NLS iters per step,%"RSYM, - (realtype) cv_mem->cv_nni / (realtype) cv_mem->cv_nst); + (sunrealtype) cv_mem->cv_nni / (sunrealtype) cv_mem->cv_nst); } else { @@ -1729,11 +1729,11 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nni > 0) { fprintf(outfile, ",LS iters per NLS iter,%"RSYM, - (realtype) cvls_mem->nli / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nli / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, ",Jac evals per NLS iter,%"RSYM, - (realtype) cvls_mem->nje / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nje / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, ",Prec evals per NLS iter,%"RSYM, - (realtype) cvls_mem->npe / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->npe / (sunrealtype) cv_mem->cv_nni); } else { diff --git a/src/cvode/cvode_ls.c b/src/cvode/cvode_ls.c index a9d986c193..fac370481d 100644 --- a/src/cvode/cvode_ls.c +++ b/src/cvode/cvode_ls.c @@ -38,8 +38,8 @@ PRIVATE FUNCTION PROTOTYPES =================================================================*/ -static int cvLsLinSys(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, realtype gamma, +static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, + booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -309,7 +309,7 @@ int CVodeSetJacFn(void *cvode_mem, CVLsJacFn jac) /* CVodeSetDeltaGammaMaxBadJac specifies the maximum gamma ratio change * after a NLS convergence failure with a potentially bad Jacobian. If * |gamma/gammap-1| < dgmax_jbad then the Jacobian is marked as bad */ -int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, realtype dgmax_jbad) +int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, sunrealtype dgmax_jbad) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -331,7 +331,7 @@ int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, realtype dgmax_jbad) /* CVodeSetEpsLin specifies the nonlinear -> linear tolerance scale factor */ -int CVodeSetEpsLin(void *cvode_mem, realtype eplifac) +int CVodeSetEpsLin(void *cvode_mem, sunrealtype eplifac) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -357,7 +357,7 @@ int CVodeSetEpsLin(void *cvode_mem, realtype eplifac) /* CVodeSetLSNormFactor sets or computes the factor to use when converting from the integrator tolerance to the linear solver tolerance (WRMS to L2 norm). */ -int CVodeSetLSNormFactor(void *cvode_mem, realtype nrmfac) +int CVodeSetLSNormFactor(void *cvode_mem, sunrealtype nrmfac) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -985,7 +985,7 @@ int cvLsPSetup(void *cvode_mem) only case in which the user's psolve routine is allowed to be NULL. -----------------------------------------------------------------*/ -int cvLsPSolve(void *cvode_mem, N_Vector r, N_Vector z, realtype tol, int lr) +int cvLsPSolve(void *cvode_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -1013,7 +1013,7 @@ int cvLsPSolve(void *cvode_mem, N_Vector r, N_Vector z, realtype tol, int lr) implementations of the difference quotient Jacobian approximation routines. ---------------------------------------------------------------*/ -int cvLsDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *cvode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -1074,11 +1074,11 @@ int cvLsDQJac(realtype t, N_Vector y, N_Vector fy, function. Finally, the actual computation of the jth column of the Jacobian is done with a call to N_VLinearSum. -----------------------------------------------------------------*/ -int cvLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1) { - realtype fnorm, minInc, inc, inc_inv, yjsaved, srur, conj; - realtype *y_data, *ewt_data, *cns_data; + sunrealtype fnorm, minInc, inc, inc_inv, yjsaved, srur, conj; + sunrealtype *y_data, *ewt_data, *cns_data; N_Vector ftemp, jthCol; sunindextype j, N; CVLsMem cvls_mem; @@ -1158,13 +1158,13 @@ int cvLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, a simple for loop to set each of the elements of a column in succession. -----------------------------------------------------------------*/ -int cvLsBandDQJac(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, +int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1, N_Vector tmp2) { N_Vector ftemp, ytemp; - realtype fnorm, minInc, inc, inc_inv, srur, conj; - realtype *col_j, *ewt_data, *fy_data, *ftemp_data; - realtype *y_data, *ytemp_data, *cns_data; + sunrealtype fnorm, minInc, inc, inc_inv, srur, conj; + sunrealtype *col_j, *ewt_data, *fy_data, *ftemp_data; + sunrealtype *y_data, *ytemp_data, *cns_data; sunindextype group, i, j, width, ngroups, i1, i2; sunindextype N, mupper, mlower; CVLsMem cvls_mem; @@ -1262,13 +1262,13 @@ int cvLsBandDQJac(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, Jv = [f(y + v*sig) - f(y)]/sig, where sig = 1 / ||v||_WRMS, i.e. the WRMS norm of v*sig is 1. -----------------------------------------------------------------*/ -int cvLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, +int cvLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *cvode_mem, N_Vector work) { CVodeMem cv_mem; CVLsMem cvls_mem; - realtype sig, siginv; + sunrealtype sig, siginv; int iter, retval; /* access CVLsMem structure */ @@ -1310,8 +1310,8 @@ int cvLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, Setup the linear system A = I - gamma J -----------------------------------------------------------------*/ -static int cvLsLinSys(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, realtype gamma, +static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, + booleantype jok, booleantype *jcur, sunrealtype gamma, void *cvode_mem, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { @@ -1535,7 +1535,7 @@ int cvLsSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { CVLsMem cvls_mem; - realtype dgamma; + sunrealtype dgamma; int retval; /* access CVLsMem structure */ @@ -1636,11 +1636,11 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, N_Vector fnow) { CVLsMem cvls_mem; - realtype bnorm = ZERO; - realtype deltar, delta, w_mean; + sunrealtype bnorm = ZERO; + sunrealtype deltar, delta, w_mean; int curiter, nli_inc, retval; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - realtype resnorm; + sunrealtype resnorm; long int nps_inc; #endif diff --git a/src/cvode/cvode_ls_impl.h b/src/cvode/cvode_ls_impl.h index c5fcbfb4e6..f9368fad9f 100644 --- a/src/cvode/cvode_ls_impl.h +++ b/src/cvode/cvode_ls_impl.h @@ -58,15 +58,15 @@ typedef struct CVLsMemRec { CVLsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* user data is passed to jac */ booleantype jbad; /* heuristic suggestion for pset */ - realtype dgmax_jbad; /* if convfail = FAIL_BAD_J and the gamma ratio * + sunrealtype dgmax_jbad; /* if convfail = FAIL_BAD_J and the gamma ratio * * |gamma/gammap-1| < dgmax_jbad then J is bad */ /* Matrix-based solver, scale solution to account for change in gamma */ booleantype scalesol; /* Iterative solver tolerance */ - realtype eplifac; /* nonlinear -> linear tol scaling factor */ - realtype nrmfac; /* integrator -> LS norm conversion factor */ + sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ + sunrealtype nrmfac; /* integrator -> LS norm conversion factor */ /* Linear solver, matrix and vector objects/pointers */ SUNLinearSolver LS; /* generic linear solver object */ @@ -139,19 +139,19 @@ typedef struct CVLsMemRec { int cvLsATimes(void* cvode_mem, N_Vector v, N_Vector z); int cvLsPSetup(void* cvode_mem); int cvLsPSolve(void* cvode_mem, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* Difference quotient approximation for Jac times vector */ -int cvLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, +int cvLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *data, N_Vector work); /* Difference-quotient Jacobian approximation routines */ -int cvLsDQJac(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, +int cvLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int cvLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1); -int cvLsBandDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1, N_Vector tmp2); diff --git a/src/cvode/cvode_nls.c b/src/cvode/cvode_nls.c index 8754fed436..934c88941c 100644 --- a/src/cvode/cvode_nls.c +++ b/src/cvode/cvode_nls.c @@ -37,11 +37,11 @@ static int cvNlsFPFunction(N_Vector ycor, N_Vector res, void* cvode_mem); static int cvNlsLSetup(booleantype jbad, booleantype* jcur, void* cvode_mem); static int cvNlsLSolve(N_Vector delta, void* cvode_mem); static int cvNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* cvode_mem); + sunrealtype tol, N_Vector ewt, void* cvode_mem); #ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS -int cvNlsResid_fused(const realtype rl1, - const realtype ngamma, +int cvNlsResid_fused(const sunrealtype rl1, + const sunrealtype ngamma, const N_Vector zn1, const N_Vector ycor, const N_Vector ftemp, @@ -173,10 +173,10 @@ int CVodeSetNlsRhsFn(void *cvode_mem, CVRhsFn f) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int CVodeGetNonlinearSystemData(void *cvode_mem, realtype *tcur, +int CVodeGetNonlinearSystemData(void *cvode_mem, sunrealtype *tcur, N_Vector *ypred, N_Vector *yn, - N_Vector *fn, realtype *gamma, - realtype *rl1, N_Vector *zn1, + N_Vector *fn, sunrealtype *gamma, + sunrealtype *rl1, N_Vector *zn1, void **user_data) { CVodeMem cv_mem; @@ -305,12 +305,12 @@ static int cvNlsLSolve(N_Vector delta, void* cvode_mem) static int cvNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector delta, - realtype tol, N_Vector ewt, void* cvode_mem) + sunrealtype tol, N_Vector ewt, void* cvode_mem) { CVodeMem cv_mem; int m, retval; - realtype del; - realtype dcon; + sunrealtype del; + sunrealtype dcon; if (cvode_mem == NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODE", "cvNlsConvTest", MSGCV_NO_MEM); diff --git a/src/cvode/cvode_proj.c b/src/cvode/cvode_proj.c index 687b62dd37..12a9ad07f8 100644 --- a/src/cvode/cvode_proj.c +++ b/src/cvode/cvode_proj.c @@ -183,7 +183,7 @@ int CVodeSetMaxNumProjFails(void *cvode_mem, int max_fails) } -int CVodeSetEpsProj(void *cvode_mem, realtype eps) +int CVodeSetEpsProj(void *cvode_mem, sunrealtype eps) { int retval; CVodeMem cv_mem; @@ -210,7 +210,7 @@ int CVodeSetEpsProj(void *cvode_mem, realtype eps) } -int CVodeSetProjFailEta(void *cvode_mem, realtype eta) +int CVodeSetProjFailEta(void *cvode_mem, sunrealtype eta) { int retval; CVodeMem cv_mem; @@ -292,7 +292,7 @@ int CVodeGetNumProjFails(void *cvode_mem, long int *npfails) * until it is potentially used in cvCompleteStep). */ -int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *npfailPtr) { int retval; diff --git a/src/cvode/cvode_proj_impl.h b/src/cvode/cvode_proj_impl.h index a66e49980a..38f6aec5d7 100644 --- a/src/cvode/cvode_proj_impl.h +++ b/src/cvode/cvode_proj_impl.h @@ -60,8 +60,8 @@ typedef struct CVodeProjMemRec { CVProjFn pfun; /* function to perform projection */ - realtype eps_proj; /* projection solve tolerance */ - realtype eta_pfail; /* projection failure step reduction factor */ + sunrealtype eps_proj; /* projection solve tolerance */ + sunrealtype eta_pfail; /* projection failure step reduction factor */ long int nproj; /* number of projections performed */ long int npfails; /* number of projection failures */ diff --git a/src/cvode/fmod/fcvode_mod.c b/src/cvode/fmod/fcvode_mod.c index 5b63d2b605..7ca6b948e5 100644 --- a/src/cvode/fmod/fcvode_mod.c +++ b/src/cvode/fmod/fcvode_mod.c @@ -256,13 +256,13 @@ SWIGEXPORT int _wrap_FCVodeInit(void *farg1, CVRhsFn farg2, double const *farg3, int fresult ; void *arg1 = (void *) 0 ; CVRhsFn arg2 = (CVRhsFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (CVRhsFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeInit(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -273,12 +273,12 @@ SWIGEXPORT int _wrap_FCVodeInit(void *farg1, CVRhsFn farg2, double const *farg3, SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)CVodeReInit(arg1,arg2,arg3); fresult = (int)(result); @@ -289,13 +289,13 @@ SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector far SWIGEXPORT int _wrap_FCVodeSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -305,12 +305,12 @@ SWIGEXPORT int _wrap_FCVodeSStolerances(void *farg1, double const *farg2, double SWIGEXPORT int _wrap_FCVodeSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)CVodeSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -349,11 +349,11 @@ SWIGEXPORT int _wrap_FCVodeSetConstraints(void *farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxLSetup(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetDeltaGammaMaxLSetup(arg1,arg2); fresult = (int)(result); return fresult; @@ -393,11 +393,11 @@ SWIGEXPORT int _wrap_FCVodeSetErrHandlerFn(void *farg1, CVErrHandlerFn farg2, vo SWIGEXPORT int _wrap_FCVodeSetInitStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -505,11 +505,11 @@ SWIGEXPORT int _wrap_FCVodeSetMaxOrd(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeSetMaxStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetMaxStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -519,11 +519,11 @@ SWIGEXPORT int _wrap_FCVodeSetMaxStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetMinStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetMinStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -575,11 +575,11 @@ SWIGEXPORT int _wrap_FCVodeSetNlsRhsFn(void *farg1, CVRhsFn farg2) { SWIGEXPORT int _wrap_FCVodeSetNonlinConvCoef(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetNonlinConvCoef(arg1,arg2); fresult = (int)(result); return fresult; @@ -617,11 +617,11 @@ SWIGEXPORT int _wrap_FCVodeSetStabLimDet(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -685,13 +685,13 @@ SWIGEXPORT int _wrap_FCVodeSetUserData(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetEtaFixedStepBounds(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -701,11 +701,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaFixedStepBounds(void *farg1, double const *farg SWIGEXPORT int _wrap_FCVodeSetEtaMaxFirstStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMaxFirstStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -715,11 +715,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMaxFirstStep(void *farg1, double const *farg2) SWIGEXPORT int _wrap_FCVodeSetEtaMaxEarlyStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMaxEarlyStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -743,11 +743,11 @@ SWIGEXPORT int _wrap_FCVodeSetNumStepsEtaMaxEarlyStep(void *farg1, long const *f SWIGEXPORT int _wrap_FCVodeSetEtaMax(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMax(arg1,arg2); fresult = (int)(result); return fresult; @@ -757,11 +757,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMax(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaMin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMin(arg1,arg2); fresult = (int)(result); return fresult; @@ -771,11 +771,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaMinErrFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMinErrFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -785,11 +785,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMinErrFail(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaMaxErrFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMaxErrFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -813,11 +813,11 @@ SWIGEXPORT int _wrap_FCVodeSetNumFailsEtaMaxErrFail(void *farg1, int const *farg SWIGEXPORT int _wrap_FCVodeSetEtaConvFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaConvFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -869,16 +869,16 @@ SWIGEXPORT int _wrap_FCVodeSetNoInactiveRootWarn(void *farg1) { SWIGEXPORT int _wrap_FCVode(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int arg5 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); arg5 = (int)(*farg5); result = (int)CVode(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -905,13 +905,13 @@ SWIGEXPORT int _wrap_FCVodeComputeState(void *farg1, N_Vector farg2, N_Vector fa SWIGEXPORT int _wrap_FCVodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeGetDky(arg1,arg2,arg3,arg4); @@ -1023,11 +1023,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentOrder(void *farg1, int *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentGamma(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetCurrentGamma(arg1,arg2); fresult = (int)(result); return fresult; @@ -1051,11 +1051,11 @@ SWIGEXPORT int _wrap_FCVodeGetNumStabLimOrderReds(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FCVodeGetActualInitStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetActualInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1065,11 +1065,11 @@ SWIGEXPORT int _wrap_FCVodeGetActualInitStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1079,11 +1079,11 @@ SWIGEXPORT int _wrap_FCVodeGetLastStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1107,11 +1107,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentState(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1121,11 +1121,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentTime(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetTolScaleFactor(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1197,10 +1197,10 @@ SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *fa long *arg5 = (long *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; - realtype *arg8 = (realtype *) 0 ; - realtype *arg9 = (realtype *) 0 ; - realtype *arg10 = (realtype *) 0 ; - realtype *arg11 = (realtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); @@ -1210,10 +1210,10 @@ SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *fa arg5 = (long *)(farg5); arg6 = (int *)(farg6); arg7 = (int *)(farg7); - arg8 = (realtype *)(farg8); - arg9 = (realtype *)(farg9); - arg10 = (realtype *)(farg10); - arg11 = (realtype *)(farg11); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); result = (int)CVodeGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); fresult = (int)(result); return fresult; @@ -1223,23 +1223,23 @@ SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *fa SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, double *farg7, void *farg8, void *farg9) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; - realtype *arg6 = (realtype *) 0 ; - realtype *arg7 = (realtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; N_Vector *arg8 = (N_Vector *) 0 ; void **arg9 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); - arg6 = (realtype *)(farg6); - arg7 = (realtype *)(farg7); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); arg8 = (N_Vector *)(farg8); arg9 = (void **)(farg9); result = (int)CVodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); @@ -1427,7 +1427,7 @@ SWIGEXPORT int _wrap_FCVBBDPrecInit(void *farg1, int64_t const *farg2, int64_t c sunindextype arg4 ; sunindextype arg5 ; sunindextype arg6 ; - realtype arg7 ; + sunrealtype arg7 ; CVLocalFn arg8 = (CVLocalFn) 0 ; CVCommFn arg9 = (CVCommFn) 0 ; int result; @@ -1438,7 +1438,7 @@ SWIGEXPORT int _wrap_FCVBBDPrecInit(void *farg1, int64_t const *farg2, int64_t c arg4 = (sunindextype)(*farg4); arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); - arg7 = (realtype)(*farg7); + arg7 = (sunrealtype)(*farg7); arg8 = (CVLocalFn)(farg8); arg9 = (CVCommFn)(farg9); result = (int)CVBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); @@ -1452,13 +1452,13 @@ SWIGEXPORT int _wrap_FCVBBDPrecReInit(void *farg1, int64_t const *farg2, int64_t void *arg1 = (void *) 0 ; sunindextype arg2 ; sunindextype arg3 ; - realtype arg4 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (sunindextype)(*farg2); arg3 = (sunindextype)(*farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); result = (int)CVBBDPrecReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1625,11 +1625,11 @@ SWIGEXPORT int _wrap_FCVodeSetLinearSolutionScaling(void *farg1, int const *farg SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxBadJac(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetDeltaGammaMaxBadJac(arg1,arg2); fresult = (int)(result); return fresult; @@ -1639,11 +1639,11 @@ SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxBadJac(void *farg1, double const *far SWIGEXPORT int _wrap_FCVodeSetEpsLin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEpsLin(arg1,arg2); fresult = (int)(result); return fresult; @@ -1653,11 +1653,11 @@ SWIGEXPORT int _wrap_FCVodeSetEpsLin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetLSNormFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetLSNormFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1994,11 +1994,11 @@ SWIGEXPORT int _wrap_FCVodeSetMaxNumProjFails(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeSetEpsProj(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEpsProj(arg1,arg2); fresult = (int)(result); return fresult; @@ -2008,11 +2008,11 @@ SWIGEXPORT int _wrap_FCVodeSetEpsProj(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetProjFailEta(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetProjFailEta(arg1,arg2); fresult = (int)(result); return fresult; diff --git a/src/cvodes/cvodea.c b/src/cvodes/cvodea.c index c382e80a2f..9973f95c5a 100644 --- a/src/cvodes/cvodea.c +++ b/src/cvodes/cvodea.c @@ -63,25 +63,25 @@ static void CVAbckpbDelete(CVodeBMem *cvB_memPtr); static int CVAdataStore(CVodeMem cv_mem, CVckpntMem ck_mem); static int CVAckpntGet(CVodeMem cv_mem, CVckpntMem ck_mem); -static int CVAfindIndex(CVodeMem cv_mem, realtype t, +static int CVAfindIndex(CVodeMem cv_mem, sunrealtype t, long int *indx, booleantype *newpoint); static booleantype CVAhermiteMalloc(CVodeMem cv_mem); static void CVAhermiteFree(CVodeMem cv_mem); -static int CVAhermiteGetY(CVodeMem cv_mem, realtype t, N_Vector y, N_Vector *yS); +static int CVAhermiteGetY(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS); static int CVAhermiteStorePnt(CVodeMem cv_mem, CVdtpntMem d); static booleantype CVApolynomialMalloc(CVodeMem cv_mem); static void CVApolynomialFree(CVodeMem cv_mem); -static int CVApolynomialGetY(CVodeMem cv_mem, realtype t, N_Vector y, N_Vector *yS); +static int CVApolynomialGetY(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS); static int CVApolynomialStorePnt(CVodeMem cv_mem, CVdtpntMem d); /* Wrappers */ -static int CVArhs(realtype t, N_Vector yB, +static int CVArhs(sunrealtype t, N_Vector yB, N_Vector yBdot, void *cvode_mem); -static int CVArhsQ(realtype t, N_Vector yB, +static int CVArhsQ(sunrealtype t, N_Vector yB, N_Vector qBdot, void *cvode_mem); /* @@ -375,8 +375,8 @@ void CVodeAdjFree(void *cvode_mem) * ncheckPtr points to the number of check points stored so far. */ -int CVodeF(void *cvode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask, int *ncheckPtr) +int CVodeF(void *cvode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask, int *ncheckPtr) { CVadjMem ca_mem; CVodeMem cv_mem; @@ -385,7 +385,7 @@ int CVodeF(void *cvode_mem, realtype tout, N_Vector yout, long int nstloc; int flag, i; booleantype allocOK, earlyret; - realtype ttest; + sunrealtype ttest; /* Check if cvode_mem exists */ if (cvode_mem == NULL) { @@ -717,7 +717,7 @@ int CVodeCreateB(void *cvode_mem, int lmmB, int *which) int CVodeInitB(void *cvode_mem, int which, CVRhsFnB fB, - realtype tB0, N_Vector yB0) + sunrealtype tB0, N_Vector yB0) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -788,7 +788,7 @@ int CVodeInitB(void *cvode_mem, int which, int CVodeInitBS(void *cvode_mem, int which, CVRhsFnBS fBs, - realtype tB0, N_Vector yB0) + sunrealtype tB0, N_Vector yB0) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -859,7 +859,7 @@ int CVodeInitBS(void *cvode_mem, int which, int CVodeReInitB(void *cvode_mem, int which, - realtype tB0, N_Vector yB0) + sunrealtype tB0, N_Vector yB0) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -909,7 +909,7 @@ int CVodeReInitB(void *cvode_mem, int which, } -int CVodeSStolerancesB(void *cvode_mem, int which, realtype reltolB, realtype abstolB) +int CVodeSStolerancesB(void *cvode_mem, int which, sunrealtype reltolB, sunrealtype abstolB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -958,7 +958,7 @@ int CVodeSStolerancesB(void *cvode_mem, int which, realtype reltolB, realtype ab } -int CVodeSVtolerancesB(void *cvode_mem, int which, realtype reltolB, N_Vector abstolB) +int CVodeSVtolerancesB(void *cvode_mem, int which, sunrealtype reltolB, N_Vector abstolB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -1168,7 +1168,7 @@ int CVodeQuadReInitB(void *cvode_mem, int which, N_Vector yQB0) return(CV_SUCCESS); } -int CVodeQuadSStolerancesB(void *cvode_mem, int which, realtype reltolQB, realtype abstolQB) +int CVodeQuadSStolerancesB(void *cvode_mem, int which, sunrealtype reltolQB, sunrealtype abstolQB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -1215,7 +1215,7 @@ int CVodeQuadSStolerancesB(void *cvode_mem, int which, realtype reltolQB, realty return(flag); } -int CVodeQuadSVtolerancesB(void *cvode_mem, int which, realtype reltolQB, N_Vector abstolQB) +int CVodeQuadSVtolerancesB(void *cvode_mem, int which, sunrealtype reltolQB, N_Vector abstolQB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -1276,14 +1276,14 @@ int CVodeQuadSVtolerancesB(void *cvode_mem, int which, realtype reltolQB, N_Vect * when called in ONE_STEP mode. */ -int CVodeB(void *cvode_mem, realtype tBout, int itaskB) +int CVodeB(void *cvode_mem, sunrealtype tBout, int itaskB) { CVodeMem cv_mem; CVadjMem ca_mem; CVodeBMem cvB_mem, tmp_cvB_mem; CVckpntMem ck_mem; int sign, flag=0; - realtype tfuzz, tBret, tBn; + sunrealtype tfuzz, tBret, tBn; booleantype gotCheckpoint, isActive, reachedTBout; /* Check if cvode_mem exists */ @@ -1517,7 +1517,7 @@ int CVodeB(void *cvode_mem, realtype tBout, int itaskB) } -int CVodeGetB(void *cvode_mem, int which, realtype *tret, N_Vector yB) +int CVodeGetB(void *cvode_mem, int which, sunrealtype *tret, N_Vector yB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -1562,7 +1562,7 @@ int CVodeGetB(void *cvode_mem, int which, realtype *tret, N_Vector yB) * CVodeGetQuadB */ -int CVodeGetQuadB(void *cvode_mem, int which, realtype *tret, N_Vector qB) +int CVodeGetQuadB(void *cvode_mem, int which, sunrealtype *tret, N_Vector qB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -2099,7 +2099,7 @@ static int CVAdataStore(CVodeMem cv_mem, CVckpntMem ck_mem) { CVadjMem ca_mem; CVdtpntMem *dt_mem; - realtype t; + sunrealtype t; long int i; int flag, sign; @@ -2306,7 +2306,7 @@ static int CVAckpntGet(CVodeMem cv_mem, CVckpntMem ck_mem) * find indx (t is too far beyond limits). */ -static int CVAfindIndex(CVodeMem cv_mem, realtype t, +static int CVAfindIndex(CVodeMem cv_mem, sunrealtype t, long int *indx, booleantype *newpoint) { CVadjMem ca_mem; @@ -2390,7 +2390,7 @@ static int CVAfindIndex(CVodeMem cv_mem, realtype t, * The user must allocate space for y. */ -int CVodeGetAdjY(void *cvode_mem, realtype t, N_Vector y) +int CVodeGetAdjY(void *cvode_mem, sunrealtype t, N_Vector y) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -2643,15 +2643,15 @@ static int CVAhermiteStorePnt(CVodeMem cv_mem, CVdtpntMem d) * can be directly called by the user through CVodeGetAdjY */ -static int CVAhermiteGetY(CVodeMem cv_mem, realtype t, +static int CVAhermiteGetY(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS) { CVadjMem ca_mem; CVdtpntMem *dt_mem; CVhermiteDataMem content0, content1; - realtype t0, t1, delta; - realtype factor1, factor2, factor3; + sunrealtype t0, t1, delta; + sunrealtype factor1, factor2, factor3; N_Vector y0, yd0, y1, yd1; N_Vector *yS0=NULL, *ySd0=NULL, *yS1, *ySd1; @@ -2662,7 +2662,7 @@ static int CVAhermiteGetY(CVodeMem cv_mem, realtype t, /* local variables for fused vector oerations */ int retval; - realtype cvals[4]; + sunrealtype cvals[4]; N_Vector Xvecs[4]; N_Vector* XXvecs[4]; @@ -2985,7 +2985,7 @@ static int CVApolynomialStorePnt(CVodeMem cv_mem, CVdtpntMem d) * can be directly called by the user through CVodeGetAdjY. */ -static int CVApolynomialGetY(CVodeMem cv_mem, realtype t, +static int CVApolynomialGetY(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS) { CVadjMem ca_mem; @@ -2995,7 +2995,7 @@ static int CVApolynomialGetY(CVodeMem cv_mem, realtype t, int flag, dir, order, i, j, is, NS, retval; long int indx, base; booleantype newpoint; - realtype dt, factor; + sunrealtype dt, factor; ca_mem = cv_mem->cv_adj_mem; dt_mem = ca_mem->dt_mem; @@ -3130,7 +3130,7 @@ static int CVApolynomialGetY(CVodeMem cv_mem, realtype t, * provided by the user. */ -static int CVArhs(realtype t, N_Vector yB, +static int CVArhs(sunrealtype t, N_Vector yB, N_Vector yBdot, void *cvode_mem) { CVodeMem cv_mem; @@ -3173,7 +3173,7 @@ static int CVArhs(realtype t, N_Vector yB, * provided by the user. */ -static int CVArhsQ(realtype t, N_Vector yB, +static int CVArhsQ(sunrealtype t, N_Vector yB, N_Vector qBdot, void *cvode_mem) { CVodeMem cv_mem; diff --git a/src/cvodes/cvodea_io.c b/src/cvodes/cvodea_io.c index 3cd6ac7af2..1edcfcc809 100644 --- a/src/cvodes/cvodea_io.c +++ b/src/cvodes/cvodea_io.c @@ -290,7 +290,7 @@ int CVodeSetStabLimDetB(void *cvode_mem, int which, booleantype stldetB) return(flag); } -int CVodeSetInitStepB(void *cvode_mem, int which, realtype hinB) +int CVodeSetInitStepB(void *cvode_mem, int which, sunrealtype hinB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -332,7 +332,7 @@ int CVodeSetInitStepB(void *cvode_mem, int which, realtype hinB) return(flag); } -int CVodeSetMinStepB(void *cvode_mem, int which, realtype hminB) +int CVodeSetMinStepB(void *cvode_mem, int which, sunrealtype hminB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -374,7 +374,7 @@ int CVodeSetMinStepB(void *cvode_mem, int which, realtype hminB) return(flag); } -int CVodeSetMaxStepB(void *cvode_mem, int which, realtype hmaxB) +int CVodeSetMaxStepB(void *cvode_mem, int which, sunrealtype hmaxB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -626,7 +626,7 @@ int CVodeGetAdjCheckPointsInfo(void *cvode_mem, CVadjCheckPointRec *ckpnt) */ int CVodeGetAdjDataPointHermite(void *cvode_mem, int which, - realtype *t, N_Vector y, N_Vector yd) + sunrealtype *t, N_Vector y, N_Vector yd) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -675,7 +675,7 @@ int CVodeGetAdjDataPointHermite(void *cvode_mem, int which, */ int CVodeGetAdjDataPointPolynomial(void *cvode_mem, int which, - realtype *t, int *order, N_Vector y) + sunrealtype *t, int *order, N_Vector y) { CVodeMem cv_mem; CVadjMem ca_mem; diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index cd1fabfd3d..48c0c23cad 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -347,9 +347,9 @@ static int cvQuadSensEwtSetSV(CVodeMem cv_mem, N_Vector *yQScur, N_Vector *weigh /* Initial stepsize calculation */ -static int cvHin(CVodeMem cv_mem, realtype tout); -static realtype cvUpperBoundH0(CVodeMem cv_mem, realtype tdist); -static int cvYddNorm(CVodeMem cv_mem, realtype hg, realtype *yddnrm); +static int cvHin(CVodeMem cv_mem, sunrealtype tout); +static sunrealtype cvUpperBoundH0(CVodeMem cv_mem, sunrealtype tdist); +static int cvYddNorm(CVodeMem cv_mem, sunrealtype hg, sunrealtype *yddnrm); /* Main cvStep function */ @@ -366,12 +366,12 @@ static void cvDecreaseBDF(CVodeMem cv_mem); static void cvPredict(CVodeMem cv_mem); static void cvSet(CVodeMem cv_mem); static void cvSetAdams(CVodeMem cv_mem); -static realtype cvAdamsStart(CVodeMem cv_mem, realtype m[]); -static void cvAdamsFinish(CVodeMem cv_mem, realtype m[], realtype M[], realtype hsum); -static realtype cvAltSum(int iend, realtype a[], int k); +static sunrealtype cvAdamsStart(CVodeMem cv_mem, sunrealtype m[]); +static void cvAdamsFinish(CVodeMem cv_mem, sunrealtype m[], sunrealtype M[], sunrealtype hsum); +static sunrealtype cvAltSum(int iend, sunrealtype a[], int k); static void cvSetBDF(CVodeMem cv_mem); -static void cvSetTqBDF(CVodeMem cv_mem, realtype hsum, realtype alpha0, - realtype alpha0_hat, realtype xi_inv, realtype xistar_inv); +static void cvSetTqBDF(CVodeMem cv_mem, sunrealtype hsum, sunrealtype alpha0, + sunrealtype alpha0_hat, sunrealtype xi_inv, sunrealtype xistar_inv); /* Nonlinear solver functions */ @@ -383,22 +383,22 @@ static int cvQuadSensNls(CVodeMem cv_mem); static int cvCheckConstraints(CVodeMem cv_mem); -static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *ncfPtr, long int *ncfnPtr); /* Error Test */ -static int cvDoErrorTest(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, - realtype acor_nrm, - int *nefPtr, long int *netfPtr, realtype *dsmPtr); +static int cvDoErrorTest(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, + sunrealtype acor_nrm, + int *nefPtr, long int *netfPtr, sunrealtype *dsmPtr); /* Function called after a successful step */ static void cvCompleteStep(CVodeMem cv_mem); -static void cvPrepareNextStep(CVodeMem cv_mem, realtype dsm); +static void cvPrepareNextStep(CVodeMem cv_mem, sunrealtype dsm); static void cvSetEta(CVodeMem cv_mem); -static realtype cvComputeEtaqm1(CVodeMem cv_mem); -static realtype cvComputeEtaqp1(CVodeMem cv_mem); +static sunrealtype cvComputeEtaqm1(CVodeMem cv_mem); +static sunrealtype cvComputeEtaqp1(CVodeMem cv_mem); static void cvChooseEta(CVodeMem cv_mem); /* Function to handle failures */ @@ -419,22 +419,22 @@ static int cvRootfind(CVodeMem cv_mem); /* Function for combined norms */ -static realtype cvQuadUpdateNorm(CVodeMem cv_mem, realtype old_nrm, +static sunrealtype cvQuadUpdateNorm(CVodeMem cv_mem, sunrealtype old_nrm, N_Vector xQ, N_Vector wQ); -static realtype cvQuadSensNorm(CVodeMem cv_mem, N_Vector *xQS, N_Vector *wQS); -static realtype cvQuadSensUpdateNorm(CVodeMem cv_mem, realtype old_nrm, +static sunrealtype cvQuadSensNorm(CVodeMem cv_mem, N_Vector *xQS, N_Vector *wQS); +static sunrealtype cvQuadSensUpdateNorm(CVodeMem cv_mem, sunrealtype old_nrm, N_Vector *xQS, N_Vector *wQS); /* Internal sensitivity RHS DQ functions */ -static int cvQuadSensRhsInternalDQ(int Ns, realtype t, +static int cvQuadSensRhsInternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yQdot, N_Vector *yQSdot, void *cvode_mem, N_Vector tmp, N_Vector tmpQ); -static int cvQuadSensRhs1InternalDQ(CVodeMem cv_mem, int is, realtype t, +static int cvQuadSensRhs1InternalDQ(CVodeMem cv_mem, int is, sunrealtype t, N_Vector y, N_Vector yS, N_Vector yQdot, N_Vector yQSdot, N_Vector tmp, N_Vector tmpQ); @@ -674,7 +674,7 @@ void *CVodeCreate(int lmm, SUNContext sunctx) * errfp and an error flag is returned. Otherwise, it returns CV_SUCCESS */ -int CVodeInit(void *cvode_mem, CVRhsFn f, realtype t0, N_Vector y0) +int CVodeInit(void *cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0) { CVodeMem cv_mem; booleantype nvectorOK, allocOK; @@ -738,7 +738,7 @@ int CVodeInit(void *cvode_mem, CVRhsFn f, realtype t0, N_Vector y0) /* Allocate temporary work arrays for fused vector ops */ cv_mem->cv_cvals = NULL; - cv_mem->cv_cvals = (realtype *) malloc(L_MAX*sizeof(realtype)); + cv_mem->cv_cvals = (sunrealtype *) malloc(L_MAX*sizeof(sunrealtype)); cv_mem->cv_Xvecs = NULL; cv_mem->cv_Xvecs = (N_Vector *) malloc(L_MAX*sizeof(N_Vector)); @@ -872,7 +872,7 @@ int CVodeInit(void *cvode_mem, CVRhsFn f, realtype t0, N_Vector y0) * a negative value otherwise. */ -int CVodeReInit(void *cvode_mem, realtype t0, N_Vector y0) +int CVodeReInit(void *cvode_mem, sunrealtype t0, N_Vector y0) { CVodeMem cv_mem; int i,k; @@ -981,7 +981,7 @@ int CVodeReInit(void *cvode_mem, realtype t0, N_Vector y0) * which will be called to set the error weight vector. */ -int CVodeSStolerances(void *cvode_mem, realtype reltol, realtype abstol) +int CVodeSStolerances(void *cvode_mem, sunrealtype reltol, sunrealtype abstol) { CVodeMem cv_mem; @@ -1028,10 +1028,10 @@ int CVodeSStolerances(void *cvode_mem, realtype reltol, realtype abstol) } -int CVodeSVtolerances(void *cvode_mem, realtype reltol, N_Vector abstol) +int CVodeSVtolerances(void *cvode_mem, sunrealtype reltol, N_Vector abstol) { CVodeMem cv_mem; - realtype atolmin; + sunrealtype atolmin; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", "CVodeSVtolerances", @@ -1238,7 +1238,7 @@ int CVodeQuadReInit(void *cvode_mem, N_Vector yQ0) * vector component). */ -int CVodeQuadSStolerances(void *cvode_mem, realtype reltolQ, realtype abstolQ) +int CVodeQuadSStolerances(void *cvode_mem, sunrealtype reltolQ, sunrealtype abstolQ) { CVodeMem cv_mem; @@ -1282,10 +1282,10 @@ int CVodeQuadSStolerances(void *cvode_mem, realtype reltolQ, realtype abstolQ) return(CV_SUCCESS); } -int CVodeQuadSVtolerances(void *cvode_mem, realtype reltolQ, N_Vector abstolQ) +int CVodeQuadSVtolerances(void *cvode_mem, sunrealtype reltolQ, N_Vector abstolQ) { CVodeMem cv_mem; - realtype atolmin; + sunrealtype atolmin; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", @@ -1458,7 +1458,7 @@ int CVodeSensInit(void *cvode_mem, int Ns, int ism, CVSensRhsFn fS, N_Vector *yS free(cv_mem->cv_Xvecs); cv_mem->cv_Xvecs = NULL; free(cv_mem->cv_Zvecs); cv_mem->cv_Zvecs = NULL; - cv_mem->cv_cvals = (realtype *) malloc((Ns*L_MAX)*sizeof(realtype)); + cv_mem->cv_cvals = (sunrealtype *) malloc((Ns*L_MAX)*sizeof(sunrealtype)); cv_mem->cv_Xvecs = (N_Vector *) malloc((Ns*L_MAX)*sizeof(N_Vector)); cv_mem->cv_Zvecs = (N_Vector *) malloc((Ns*L_MAX)*sizeof(N_Vector)); @@ -1670,7 +1670,7 @@ int CVodeSensInit1(void *cvode_mem, int Ns, int ism, CVSensRhs1Fn fS1, N_Vector free(cv_mem->cv_Xvecs); cv_mem->cv_Xvecs = NULL; free(cv_mem->cv_Zvecs); cv_mem->cv_Zvecs = NULL; - cv_mem->cv_cvals = (realtype *) malloc((Ns*L_MAX)*sizeof(realtype)); + cv_mem->cv_cvals = (sunrealtype *) malloc((Ns*L_MAX)*sizeof(sunrealtype)); cv_mem->cv_Xvecs = (N_Vector *) malloc((Ns*L_MAX)*sizeof(N_Vector)); cv_mem->cv_Zvecs = (N_Vector *) malloc((Ns*L_MAX)*sizeof(N_Vector)); @@ -1979,7 +1979,7 @@ int CVodeSensReInit(void *cvode_mem, int ism, N_Vector *yS0) * should be estimated from those provided for the state variables. */ -int CVodeSensSStolerances(void *cvode_mem, realtype reltolS, realtype *abstolS) +int CVodeSensSStolerances(void *cvode_mem, sunrealtype reltolS, sunrealtype *abstolS) { CVodeMem cv_mem; int is; @@ -2028,7 +2028,7 @@ int CVodeSensSStolerances(void *cvode_mem, realtype reltolS, realtype *abstolS) if ( !(cv_mem->cv_SabstolSMallocDone) ) { cv_mem->cv_SabstolS = NULL; - cv_mem->cv_SabstolS = (realtype *)malloc(cv_mem->cv_Ns*sizeof(realtype)); + cv_mem->cv_SabstolS = (sunrealtype *)malloc(cv_mem->cv_Ns*sizeof(sunrealtype)); cv_mem->cv_atolSmin0 = (booleantype *)malloc(cv_mem->cv_Ns*sizeof(booleantype)); cv_mem->cv_lrw += cv_mem->cv_Ns; cv_mem->cv_SabstolSMallocDone = SUNTRUE; @@ -2042,11 +2042,11 @@ int CVodeSensSStolerances(void *cvode_mem, realtype reltolS, realtype *abstolS) return(CV_SUCCESS); } -int CVodeSensSVtolerances(void *cvode_mem, realtype reltolS, N_Vector *abstolS) +int CVodeSensSVtolerances(void *cvode_mem, sunrealtype reltolS, N_Vector *abstolS) { CVodeMem cv_mem; int is, retval; - realtype *atolmin; + sunrealtype *atolmin; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", "CVodeSensSVtolerances", @@ -2083,7 +2083,7 @@ int CVodeSensSVtolerances(void *cvode_mem, realtype reltolS, N_Vector *abstolS) "Missing N_VMin routine from N_Vector"); return(CV_ILL_INPUT); } - atolmin = (realtype *)malloc(cv_mem->cv_Ns*sizeof(realtype)); + atolmin = (sunrealtype *)malloc(cv_mem->cv_Ns*sizeof(sunrealtype)); for (is=0; iscv_Ns; is++) { atolmin[is] = N_VMin(abstolS[is]); if (atolmin[is] < ZERO) { @@ -2315,7 +2315,7 @@ int CVodeQuadSensReInit(void *cvode_mem, N_Vector *yQS0) * specified through a call to one of CVodeQuad**tolerances. */ -int CVodeQuadSensSStolerances(void *cvode_mem, realtype reltolQS, realtype *abstolQS) +int CVodeQuadSensSStolerances(void *cvode_mem, sunrealtype reltolQS, sunrealtype *abstolQS) { CVodeMem cv_mem; int is; @@ -2372,7 +2372,7 @@ int CVodeQuadSensSStolerances(void *cvode_mem, realtype reltolQS, realtype *abst if ( !(cv_mem->cv_SabstolQSMallocDone) ) { cv_mem->cv_SabstolQS = NULL; - cv_mem->cv_SabstolQS = (realtype *)malloc(cv_mem->cv_Ns*sizeof(realtype)); + cv_mem->cv_SabstolQS = (sunrealtype *)malloc(cv_mem->cv_Ns*sizeof(sunrealtype)); cv_mem->cv_atolQSmin0 = (booleantype *)malloc(cv_mem->cv_Ns*sizeof(booleantype)); cv_mem->cv_lrw += cv_mem->cv_Ns; cv_mem->cv_SabstolQSMallocDone = SUNTRUE; @@ -2386,11 +2386,11 @@ int CVodeQuadSensSStolerances(void *cvode_mem, realtype reltolQS, realtype *abst return(CV_SUCCESS); } -int CVodeQuadSensSVtolerances(void *cvode_mem, realtype reltolQS, N_Vector *abstolQS) +int CVodeQuadSensSVtolerances(void *cvode_mem, sunrealtype reltolQS, N_Vector *abstolQS) { CVodeMem cv_mem; int is, retval; - realtype *atolmin; + sunrealtype *atolmin; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", @@ -2435,7 +2435,7 @@ int CVodeQuadSensSVtolerances(void *cvode_mem, realtype reltolQS, N_Vector *abs "Missing N_VMin routine from N_Vector"); return(CV_ILL_INPUT); } - atolmin = (realtype *)malloc(cv_mem->cv_Ns*sizeof(realtype)); + atolmin = (sunrealtype *)malloc(cv_mem->cv_Ns*sizeof(sunrealtype)); for (is=0; iscv_Ns; is++) { atolmin[is] = N_VMin(abstolQS[is]); if (atolmin[is] < ZERO) { @@ -2624,7 +2624,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) /* Allocate necessary memory and return */ cv_mem->cv_glo = NULL; - cv_mem->cv_glo = (realtype *) malloc(nrt*sizeof(realtype)); + cv_mem->cv_glo = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (cv_mem->cv_glo == NULL) { cvProcessError(cv_mem, CV_MEM_FAIL, "CVODES", "CVodeRootInit", MSGCV_MEM_FAIL); @@ -2632,7 +2632,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) } cv_mem->cv_ghi = NULL; - cv_mem->cv_ghi = (realtype *) malloc(nrt*sizeof(realtype)); + cv_mem->cv_ghi = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (cv_mem->cv_ghi == NULL) { free(cv_mem->cv_glo); cv_mem->cv_glo = NULL; cvProcessError(cv_mem, CV_MEM_FAIL, "CVODES", "CVodeRootInit", @@ -2641,7 +2641,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) } cv_mem->cv_grout = NULL; - cv_mem->cv_grout = (realtype *) malloc(nrt*sizeof(realtype)); + cv_mem->cv_grout = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (cv_mem->cv_grout == NULL) { free(cv_mem->cv_glo); cv_mem->cv_glo = NULL; free(cv_mem->cv_ghi); cv_mem->cv_ghi = NULL; @@ -2721,13 +2721,13 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) * In the CV_ONE_STEP mode, it takes one internal step and returns. */ -int CVode(void *cvode_mem, realtype tout, N_Vector yout, - realtype *tret, int itask) +int CVode(void *cvode_mem, sunrealtype tout, N_Vector yout, + sunrealtype *tret, int itask) { CVodeMem cv_mem; long int nstloc; int retval, hflag, kflag, istate, is, ir, ier, irfndp; - realtype troundoff, tout_hin, rh, nrm; + sunrealtype troundoff, tout_hin, rh, nrm; booleantype inactive_roots; /* @@ -3475,10 +3475,10 @@ int CVodeComputeStateSens1(void *cvode_mem, int idx, N_Vector ycorS1, * may also be called directly by the user. */ -int CVodeGetDky(void *cvode_mem, realtype t, int k, N_Vector dky) +int CVodeGetDky(void *cvode_mem, sunrealtype t, int k, N_Vector dky) { - realtype s, r; - realtype tfuzz, tp, tn1; + sunrealtype s, r; + sunrealtype tfuzz, tp, tn1; int i, j, nvec, ier; CVodeMem cv_mem; @@ -3555,7 +3555,7 @@ int CVodeGetDky(void *cvode_mem, realtype t, int k, N_Vector dky) * This is just a wrapper that calls CVodeGetQuadDky with k=0. */ -int CVodeGetQuad(void *cvode_mem, realtype *tret, N_Vector yQout) +int CVodeGetQuad(void *cvode_mem, sunrealtype *tret, N_Vector yQout) { CVodeMem cv_mem; int flag; @@ -3590,10 +3590,10 @@ int CVodeGetQuad(void *cvode_mem, realtype *tret, N_Vector yQout) * computation enabled. */ -int CVodeGetQuadDky(void *cvode_mem, realtype t, int k, N_Vector dkyQ) +int CVodeGetQuadDky(void *cvode_mem, sunrealtype t, int k, N_Vector dkyQ) { - realtype s, r; - realtype tfuzz, tp, tn1; + sunrealtype s, r; + sunrealtype tfuzz, tp, tn1; int i, j, nvec, ier; CVodeMem cv_mem; @@ -3675,7 +3675,7 @@ int CVodeGetQuadDky(void *cvode_mem, realtype t, int k, N_Vector dkyQ) * This is just a wrapper that calls CVodeSensDky with k=0. */ -int CVodeGetSens(void *cvode_mem, realtype *tret, N_Vector *ySout) +int CVodeGetSens(void *cvode_mem, sunrealtype *tret, N_Vector *ySout) { CVodeMem cv_mem; int flag; @@ -3704,7 +3704,7 @@ int CVodeGetSens(void *cvode_mem, realtype *tret, N_Vector *ySout) * This is just a wrapper that calls CVodeSensDky1 with k=0. */ -int CVodeGetSens1(void *cvode_mem, realtype *tret, int is, N_Vector ySout) +int CVodeGetSens1(void *cvode_mem, sunrealtype *tret, int is, N_Vector ySout) { CVodeMem cv_mem; int flag; @@ -3734,7 +3734,7 @@ int CVodeGetSens1(void *cvode_mem, realtype *tret, int is, N_Vector ySout) * ier=CV_BAD_T are possible. */ -int CVodeGetSensDky(void *cvode_mem, realtype t, int k, N_Vector *dkyS) +int CVodeGetSensDky(void *cvode_mem, sunrealtype t, int k, N_Vector *dkyS) { int ier=CV_SUCCESS; int is; @@ -3778,10 +3778,10 @@ int CVodeGetSensDky(void *cvode_mem, realtype t, int k, N_Vector *dkyS) * computation enabled. */ -int CVodeGetSensDky1(void *cvode_mem, realtype t, int k, int is, N_Vector dkyS) +int CVodeGetSensDky1(void *cvode_mem, sunrealtype t, int k, int is, N_Vector dkyS) { - realtype s, r; - realtype tfuzz, tp, tn1; + sunrealtype s, r; + sunrealtype tfuzz, tp, tn1; int i, j, nvec, ier; CVodeMem cv_mem; @@ -3874,7 +3874,7 @@ int CVodeGetSensDky1(void *cvode_mem, realtype t, int k, int is, N_Vector dkyS) * vectors at the time at which CVode returned the ODE solution. */ -int CVodeGetQuadSens(void *cvode_mem, realtype *tret, N_Vector *yQSout) +int CVodeGetQuadSens(void *cvode_mem, sunrealtype *tret, N_Vector *yQSout) { CVodeMem cv_mem; int flag; @@ -3896,7 +3896,7 @@ int CVodeGetQuadSens(void *cvode_mem, realtype *tret, N_Vector *yQSout) return(flag); } -int CVodeGetQuadSens1(void *cvode_mem, realtype *tret, int is, N_Vector yQSout) +int CVodeGetQuadSens1(void *cvode_mem, sunrealtype *tret, int is, N_Vector yQSout) { CVodeMem cv_mem; int flag; @@ -3925,7 +3925,7 @@ int CVodeGetQuadSens1(void *cvode_mem, realtype *tret, int is, N_Vector yQSout) * vectors (or derivative thereof). */ -int CVodeGetQuadSensDky(void *cvode_mem, realtype t, int k, N_Vector *dkyQS_all) +int CVodeGetQuadSensDky(void *cvode_mem, sunrealtype t, int k, N_Vector *dkyQS_all) { int ier=CV_SUCCESS; int is; @@ -3956,10 +3956,10 @@ int CVodeGetQuadSensDky(void *cvode_mem, realtype t, int k, N_Vector *dkyQS_all) return(ier); } -int CVodeGetQuadSensDky1(void *cvode_mem, realtype t, int k, int is, N_Vector dkyQS) +int CVodeGetQuadSensDky1(void *cvode_mem, sunrealtype t, int k, int is, N_Vector dkyQS) { - realtype s, r; - realtype tfuzz, tp, tn1; + sunrealtype s, r; + sunrealtype tfuzz, tp, tn1; int i, j, nvec, ier; CVodeMem cv_mem; @@ -4567,7 +4567,7 @@ static booleantype cvSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl) /* Allocate space for pbar and plist */ cv_mem->cv_pbar = NULL; - cv_mem->cv_pbar = (realtype *)malloc(cv_mem->cv_Ns*sizeof(realtype)); + cv_mem->cv_pbar = (sunrealtype *)malloc(cv_mem->cv_Ns*sizeof(sunrealtype)); if (cv_mem->cv_pbar == NULL) { N_VDestroyVectorArray(cv_mem->cv_yS, cv_mem->cv_Ns); N_VDestroyVectorArray(cv_mem->cv_ewtS, cv_mem->cv_Ns); @@ -5045,11 +5045,11 @@ static int cvInitialSetup(CVodeMem cv_mem) * Finally, we apply a bias (0.5) and verify that h0 is within bounds. */ -static int cvHin(CVodeMem cv_mem, realtype tout) +static int cvHin(CVodeMem cv_mem, sunrealtype tout) { int retval, sign, count1, count2; - realtype tdiff, tdist, tround, hlb, hub; - realtype hg, hgs, hs, hnew, hrat, h0, yddnrm; + sunrealtype tdiff, tdist, tround, hlb, hub; + sunrealtype hg, hgs, hs, hnew, hrat, h0, yddnrm; booleantype hgOK; /* If tout is too close to tn, give up */ @@ -5158,9 +5158,9 @@ static int cvHin(CVodeMem cv_mem, realtype tout) * tdist = tn - t0 and the values of y[i]/y'[i]. */ -static realtype cvUpperBoundH0(CVodeMem cv_mem, realtype tdist) +static sunrealtype cvUpperBoundH0(CVodeMem cv_mem, sunrealtype tdist) { - realtype hub_inv, hubQ_inv, hubS_inv, hubQS_inv, hub; + sunrealtype hub_inv, hubQ_inv, hubS_inv, hubQS_inv, hub; N_Vector temp1, temp2; N_Vector tempQ1, tempQ2; N_Vector *tempS1; @@ -5282,7 +5282,7 @@ static realtype cvUpperBoundH0(CVodeMem cv_mem, realtype tdist) * Y contains all variables included in the error test. */ -static int cvYddNorm(CVodeMem cv_mem, realtype hg, realtype *yddnrm) +static int cvYddNorm(CVodeMem cv_mem, sunrealtype hg, sunrealtype *yddnrm) { int retval; N_Vector wrk1, wrk2; @@ -5406,11 +5406,11 @@ static int cvYddNorm(CVodeMem cv_mem, realtype hg, realtype *yddnrm) static int cvStep(CVodeMem cv_mem) { - realtype saved_t; /* time to restore to if a failure occurs */ - realtype dsm; /* local truncation error estimate */ - realtype dsmQ; /* quadrature error estimate */ - realtype dsmS; /* sensitivity error estimate */ - realtype dsmQS; /* quadrature sensitivity error estimate */ + sunrealtype saved_t; /* time to restore to if a failure occurs */ + sunrealtype dsm; /* local truncation error estimate */ + sunrealtype dsmQ; /* quadrature error estimate */ + sunrealtype dsmS; /* sensitivity error estimate */ + sunrealtype dsmQS; /* quadrature sensitivity error estimate */ int ncf; /* corrector failures in this step attempt */ int ncfS; /* sensitivity corrector failures */ int npf; /* projection failures in this step attempt */ @@ -5743,7 +5743,7 @@ static void cvAdjustOrder(CVodeMem cv_mem, int deltaq) static void cvAdjustAdams(CVodeMem cv_mem, int deltaq) { int i, j; - realtype xi, hsum; + sunrealtype xi, hsum; /* On an order increase, set new column of zn to zero and return */ @@ -5838,7 +5838,7 @@ static void cvAdjustBDF(CVodeMem cv_mem, int deltaq) static void cvIncreaseBDF(CVodeMem cv_mem) { - realtype alpha0, alpha1, prod, xi, xiold, hsum, A1; + sunrealtype alpha0, alpha1, prod, xi, xiold, hsum, A1; int i, j; int is; @@ -5938,7 +5938,7 @@ static void cvIncreaseBDF(CVodeMem cv_mem) static void cvDecreaseBDF(CVodeMem cv_mem) { - realtype hsum, xi; + sunrealtype hsum, xi; int i, j; for (i=0; i <= cv_mem->cv_qmax; i++) cv_mem->cv_l[i] = ZERO; @@ -6180,7 +6180,7 @@ static void cvSet(CVodeMem cv_mem) static void cvSetAdams(CVodeMem cv_mem) { - realtype m[L_MAX], M[3], hsum; + sunrealtype m[L_MAX], M[3], hsum; if (cv_mem->cv_q == 1) { cv_mem->cv_l[0] = cv_mem->cv_l[1] = cv_mem->cv_tq[1] = cv_mem->cv_tq[5] = ONE; @@ -6205,9 +6205,9 @@ static void cvSetAdams(CVodeMem cv_mem) * polynomial needed for the Adams l and tq coefficients for q > 1. */ -static realtype cvAdamsStart(CVodeMem cv_mem, realtype m[]) +static sunrealtype cvAdamsStart(CVodeMem cv_mem, sunrealtype m[]) { - realtype hsum, xi_inv, sum; + sunrealtype hsum, xi_inv, sum; int i, j; hsum = cv_mem->cv_h; @@ -6232,10 +6232,10 @@ static realtype cvAdamsStart(CVodeMem cv_mem, realtype m[]) * This routine completes the calculation of the Adams l and tq. */ -static void cvAdamsFinish(CVodeMem cv_mem, realtype m[], realtype M[], realtype hsum) +static void cvAdamsFinish(CVodeMem cv_mem, sunrealtype m[], sunrealtype M[], sunrealtype hsum) { int i; - realtype M0_inv, xi, xi_inv; + sunrealtype M0_inv, xi, xi_inv; M0_inv = ONE / M[0]; @@ -6267,10 +6267,10 @@ static void cvAdamsFinish(CVodeMem cv_mem, realtype m[], realtype M[], realtype * of a polynomial x^(k-1) M(x) given the coefficients of M(x). */ -static realtype cvAltSum(int iend, realtype a[], int k) +static sunrealtype cvAltSum(int iend, sunrealtype a[], int k) { int i, sign; - realtype sum; + sunrealtype sum; if (iend < 0) return(ZERO); @@ -6311,7 +6311,7 @@ static realtype cvAltSum(int iend, realtype a[], int k) static void cvSetBDF(CVodeMem cv_mem) { - realtype alpha0, alpha0_hat, xi_inv, xistar_inv, hsum; + sunrealtype alpha0, alpha0_hat, xi_inv, xistar_inv, hsum; int i,j; cv_mem->cv_l[0] = cv_mem->cv_l[1] = xi_inv = xistar_inv = ONE; @@ -6357,11 +6357,11 @@ static void cvSetBDF(CVodeMem cv_mem) * lmm == CV_BDF. */ -static void cvSetTqBDF(CVodeMem cv_mem, realtype hsum, realtype alpha0, - realtype alpha0_hat, realtype xi_inv, realtype xistar_inv) +static void cvSetTqBDF(CVodeMem cv_mem, sunrealtype hsum, sunrealtype alpha0, + sunrealtype alpha0_hat, sunrealtype xi_inv, sunrealtype xistar_inv) { - realtype A1, A2, A3, A4, A5, A6; - realtype C, Cpinv, Cppinv; + sunrealtype A1, A2, A3, A4, A5, A6; + sunrealtype C, Cpinv, Cppinv; A1 = ONE - alpha0_hat + alpha0; A2 = ONE + cv_mem->cv_q * A1; @@ -6526,7 +6526,7 @@ static int cvNls(CVodeMem cv_mem, int nflag) static int cvCheckConstraints(CVodeMem cv_mem) { booleantype constraintsPassed; - realtype vnorm; + sunrealtype vnorm; N_Vector mm = cv_mem->cv_ftemp; N_Vector tmp = cv_mem->cv_tempv; @@ -6808,7 +6808,7 @@ static int cvStgr1Nls(CVodeMem cv_mem, int is) * */ -static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *ncfPtr, long int *ncfnPtr) { int nflag; @@ -6868,7 +6868,7 @@ static int cvHandleNFlag(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, * the same values as before the call to cvPredict. */ -void cvRestore(CVodeMem cv_mem, realtype saved_t) +void cvRestore(CVodeMem cv_mem, sunrealtype saved_t) { int j, k; @@ -6939,11 +6939,11 @@ void cvRestore(CVodeMem cv_mem, realtype saved_t) * */ -static int cvDoErrorTest(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, - realtype acor_nrm, - int *nefPtr, long int *netfPtr, realtype *dsmPtr) +static int cvDoErrorTest(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, + sunrealtype acor_nrm, + int *nefPtr, long int *netfPtr, sunrealtype *dsmPtr) { - realtype dsm; + sunrealtype dsm; int retval, is; N_Vector wrk1, wrk2; @@ -7204,7 +7204,7 @@ static void cvCompleteStep(CVodeMem cv_mem) * related to a change of step size or order. */ -static void cvPrepareNextStep(CVodeMem cv_mem, realtype dsm) +static void cvPrepareNextStep(CVodeMem cv_mem, sunrealtype dsm) { /* If etamax = 1, defer step size or order changes */ if (cv_mem->cv_etamax == ONE) { @@ -7285,9 +7285,9 @@ static void cvSetEta(CVodeMem cv_mem) * possible decrease in order by 1. */ -static realtype cvComputeEtaqm1(CVodeMem cv_mem) +static sunrealtype cvComputeEtaqm1(CVodeMem cv_mem) { - realtype ddn; + sunrealtype ddn; cv_mem->cv_etaqm1 = ZERO; if (cv_mem->cv_q > 1) { @@ -7318,9 +7318,9 @@ static realtype cvComputeEtaqm1(CVodeMem cv_mem) * possible increase in order by 1. */ -static realtype cvComputeEtaqp1(CVodeMem cv_mem) +static sunrealtype cvComputeEtaqp1(CVodeMem cv_mem) { - realtype dup, cquot; + sunrealtype dup, cquot; cv_mem->cv_etaqp1 = ZERO; if (cv_mem->cv_q != cv_mem->cv_qmax) { @@ -7375,7 +7375,7 @@ static realtype cvComputeEtaqp1(CVodeMem cv_mem) static void cvChooseEta(CVodeMem cv_mem) { - realtype etam; + sunrealtype etam; int is; etam = SUNMAX(cv_mem->cv_etaqm1, SUNMAX(cv_mem->cv_etaq, cv_mem->cv_etaqp1)); @@ -7598,7 +7598,7 @@ static int cvHandleFailure(CVodeMem cv_mem, int flag) static void cvBDFStab(CVodeMem cv_mem) { int i,k, ldflag, factorial; - realtype sq, sqm1, sqm2; + sunrealtype sq, sqm1, sqm2; /* If order is 3 or greater, then save scaled derivative data, push old data down in i, then add current values to top. */ @@ -7687,14 +7687,14 @@ static void cvBDFStab(CVodeMem cv_mem) static int cvSLdet(CVodeMem cv_mem) { int i, k, j, it, kmin = 0, kflag = 0; - realtype rat[5][4], rav[4], qkr[4], sigsq[4], smax[4], ssmax[4]; - realtype drr[4], rrc[4],sqmx[4], qjk[4][4], vrat[5], qc[6][4], qco[6][4]; - realtype rr, rrcut, vrrtol, vrrt2, sqtol, rrtol; - realtype smink, smaxk, sumrat, sumrsq, vmin, vmax, drrmax, adrr; - realtype tem, sqmax, saqk, qp, s, sqmaxk, saqj, sqmin; - realtype rsa, rsb, rsc, rsd, rd1a, rd1b, rd1c; - realtype rd2a, rd2b, rd3a, cest1, corr1; - realtype ratp, ratm, qfac1, qfac2, bb, rrb; + sunrealtype rat[5][4], rav[4], qkr[4], sigsq[4], smax[4], ssmax[4]; + sunrealtype drr[4], rrc[4],sqmx[4], qjk[4][4], vrat[5], qc[6][4], qco[6][4]; + sunrealtype rr, rrcut, vrrtol, vrrt2, sqtol, rrtol; + sunrealtype smink, smaxk, sumrat, sumrsq, vmin, vmax, drrmax, adrr; + sunrealtype tem, sqmax, saqk, qp, s, sqmaxk, saqj, sqmin; + sunrealtype rsa, rsb, rsc, rsd, rd1a, rd1b, rd1c; + sunrealtype rd2a, rd2b, rd3a, cest1, corr1; + sunrealtype ratp, ratm, qfac1, qfac2, bb, rrb; /* The following are cutoffs and tolerances used by this routine */ @@ -7979,7 +7979,7 @@ static int cvSLdet(CVodeMem cv_mem) static int cvRcheck1(CVodeMem cv_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; for (i = 0; i < cv_mem->cv_nrtfn; i++) cv_mem->cv_iroots[i] = 0; @@ -8047,7 +8047,7 @@ static int cvRcheck1(CVodeMem cv_mem) static int cvRcheck2(CVodeMem cv_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; if (cv_mem->cv_irfnd == 0) return(CV_SUCCESS); @@ -8242,7 +8242,7 @@ static int cvRcheck3(CVodeMem cv_mem) static int cvRootfind(CVodeMem cv_mem) { - realtype alph, tmid, gfrac, maxfrac, fracint, fracsub; + sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; booleantype zroot, sgnchg; @@ -8744,10 +8744,10 @@ static int cvQuadSensEwtSetSV(CVodeMem cv_mem, N_Vector *yQScur, N_Vector *weigh * Updates the norm old_nrm to account for all quadratures. */ -static realtype cvQuadUpdateNorm(CVodeMem cv_mem, realtype old_nrm, +static sunrealtype cvQuadUpdateNorm(CVodeMem cv_mem, sunrealtype old_nrm, N_Vector xQ, N_Vector wQ) { - realtype qnrm; + sunrealtype qnrm; qnrm = N_VWrmsNorm(xQ, wQ); if (old_nrm > qnrm) return(old_nrm); @@ -8766,10 +8766,10 @@ static realtype cvQuadUpdateNorm(CVodeMem cv_mem, realtype old_nrm, * during the NLS solution and before the error test. */ -realtype cvSensNorm(CVodeMem cv_mem, N_Vector *xS, N_Vector *wS) +sunrealtype cvSensNorm(CVodeMem cv_mem, N_Vector *xS, N_Vector *wS) { int is; - realtype nrm; + sunrealtype nrm; (void) N_VWrmsNormVectorArray(cv_mem->cv_Ns, xS, wS, cv_mem->cv_cvals); @@ -8786,10 +8786,10 @@ realtype cvSensNorm(CVodeMem cv_mem, N_Vector *xS, N_Vector *wS) * Updates the norm old_nrm to account for all sensitivities. */ -realtype cvSensUpdateNorm(CVodeMem cv_mem, realtype old_nrm, +sunrealtype cvSensUpdateNorm(CVodeMem cv_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS) { - realtype snrm; + sunrealtype snrm; snrm = cvSensNorm(cv_mem, xS, wS); if (old_nrm > snrm) return(old_nrm); @@ -8807,10 +8807,10 @@ realtype cvSensUpdateNorm(CVodeMem cv_mem, realtype old_nrm, * Called by cvQuadSensUpdateNorm. */ -static realtype cvQuadSensNorm(CVodeMem cv_mem, N_Vector *xQS, N_Vector *wQS) +static sunrealtype cvQuadSensNorm(CVodeMem cv_mem, N_Vector *xQS, N_Vector *wQS) { int is; - realtype nrm; + sunrealtype nrm; (void) N_VWrmsNormVectorArray(cv_mem->cv_Ns, xQS, wQS, cv_mem->cv_cvals); @@ -8827,10 +8827,10 @@ static realtype cvQuadSensNorm(CVodeMem cv_mem, N_Vector *xQS, N_Vector *wQS) * Updates the norm old_nrm to account for all quadrature sensitivities. */ -static realtype cvQuadSensUpdateNorm(CVodeMem cv_mem, realtype old_nrm, +static sunrealtype cvQuadSensUpdateNorm(CVodeMem cv_mem, sunrealtype old_nrm, N_Vector *xQS, N_Vector *wQS) { - realtype snrm; + sunrealtype snrm; snrm = cvQuadSensNorm(cv_mem, xQS, wQS); if (old_nrm > snrm) return(old_nrm); @@ -8863,7 +8863,7 @@ static realtype cvQuadSensUpdateNorm(CVodeMem cv_mem, realtype old_nrm, * */ -int cvSensRhsWrapper(CVodeMem cv_mem, realtype time, +int cvSensRhsWrapper(CVodeMem cv_mem, sunrealtype time, N_Vector ycur, N_Vector fcur, N_Vector *yScur, N_Vector *fScur, N_Vector temp1, N_Vector temp2) @@ -8899,7 +8899,7 @@ int cvSensRhsWrapper(CVodeMem cv_mem, realtype time, * The return value is that of the sensitivity RHS function fS1, */ -int cvSensRhs1Wrapper(CVodeMem cv_mem, realtype time, +int cvSensRhs1Wrapper(CVodeMem cv_mem, sunrealtype time, N_Vector ycur, N_Vector fcur, int is, N_Vector yScur, N_Vector fScur, N_Vector temp1, N_Vector temp2) @@ -8930,7 +8930,7 @@ int cvSensRhs1Wrapper(CVodeMem cv_mem, realtype time, * by finite differences */ -int cvSensRhsInternalDQ(int Ns, realtype t, +int cvSensRhsInternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, N_Vector *yS, N_Vector *ySdot, void *cvode_mem, @@ -8957,7 +8957,7 @@ int cvSensRhsInternalDQ(int Ns, realtype t, * non-zero return value from f(). */ -int cvSensRhs1InternalDQ(int Ns, realtype t, +int cvSensRhs1InternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int is, N_Vector yS, N_Vector ySdot, void *cvode_mem, @@ -8966,15 +8966,15 @@ int cvSensRhs1InternalDQ(int Ns, realtype t, CVodeMem cv_mem; int retval, method; int nfel = 0, which; - realtype psave, pbari; - realtype delta , rdelta; - realtype Deltap, rDeltap, r2Deltap; - realtype Deltay, rDeltay, r2Deltay; - realtype Delta , rDelta , r2Delta ; - realtype norms, ratio; + sunrealtype psave, pbari; + sunrealtype delta , rdelta; + sunrealtype Deltap, rDeltap, r2Deltap; + sunrealtype Deltay, rDeltay, r2Deltay; + sunrealtype Delta , rDelta , r2Delta ; + sunrealtype norms, ratio; /* local variables for fused vector operations */ - realtype cvals[3]; + sunrealtype cvals[3]; N_Vector Xvecs[3]; /* cvode_mem is passed here as user data */ @@ -9131,7 +9131,7 @@ int cvSensRhs1InternalDQ(int Ns, realtype t, * done in cvQuadSensRhs1InternalDQ. */ -static int cvQuadSensRhsInternalDQ(int Ns, realtype t, +static int cvQuadSensRhsInternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yQdot, N_Vector *yQSdot, void *cvode_mem, @@ -9154,19 +9154,19 @@ static int cvQuadSensRhsInternalDQ(int Ns, realtype t, return(0); } -static int cvQuadSensRhs1InternalDQ(CVodeMem cv_mem, int is, realtype t, +static int cvQuadSensRhs1InternalDQ(CVodeMem cv_mem, int is, sunrealtype t, N_Vector y, N_Vector yS, N_Vector yQdot, N_Vector yQSdot, N_Vector tmp, N_Vector tmpQ) { int retval, method; int nfel = 0, which; - realtype psave, pbari; - realtype delta , rdelta; - realtype Deltap; - realtype Deltay, rDeltay; - realtype Delta , rDelta , r2Delta ; - realtype norms; + sunrealtype psave, pbari; + sunrealtype delta , rdelta; + sunrealtype Deltap; + sunrealtype Deltay, rDeltay; + sunrealtype Delta , rDelta , r2Delta ; + sunrealtype norms; delta = SUNRsqrt(SUNMAX(cv_mem->cv_reltol, cv_mem->cv_uround)); rdelta = ONE/delta; diff --git a/src/cvodes/cvodes_bandpre.c b/src/cvodes/cvodes_bandpre.c index 8ae636b94f..a8f38fea29 100644 --- a/src/cvodes/cvodes_bandpre.c +++ b/src/cvodes/cvodes_bandpre.c @@ -33,19 +33,19 @@ #define TWO RCONST(2.0) /* Prototypes of cvBandPrecSetup and cvBandPrecSolve */ -static int cvBandPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int cvBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bp_data); -static int cvBandPrecSolve(realtype t, N_Vector y, N_Vector fy, + sunrealtype gamma, void *bp_data); +static int cvBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bp_data); /* Prototype for cvBandPrecFree */ static int cvBandPrecFree(CVodeMem cv_mem); /* Prototype for difference quotient Jacobian calculation routine */ -static int cvBandPrecDQJac(CVBandPrecData pdata, realtype t, N_Vector y, +static int cvBandPrecDQJac(CVBandPrecData pdata, sunrealtype t, N_Vector y, N_Vector fy, N_Vector ftemp, N_Vector ytemp); @@ -336,9 +336,9 @@ int CVBandPrecGetNumRhsEvals(void *cvode_mem, long int *nfevalsBP) 0 if successful, or 1 if the band factorization failed. -----------------------------------------------------------------*/ -static int cvBandPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int cvBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bp_data) + sunrealtype gamma, void *bp_data) { CVBandPrecData pdata; CVodeMem cv_mem; @@ -430,9 +430,9 @@ static int cvBandPrecSetup(realtype t, N_Vector y, N_Vector fy, The value returned by the cvBandPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int cvBandPrecSolve(realtype t, N_Vector y, N_Vector fy, - N_Vector r, N_Vector z, realtype gamma, - realtype delta, int lr, void *bp_data) +static int cvBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, + N_Vector r, N_Vector z, sunrealtype gamma, + sunrealtype delta, int lr, void *bp_data) { CVBandPrecData pdata; int retval; @@ -481,14 +481,14 @@ static int cvBandPrecFree(CVodeMem cv_mem) write a simple for loop to set each of the elements of a column in succession. -----------------------------------------------------------------*/ -static int cvBandPrecDQJac(CVBandPrecData pdata, realtype t, N_Vector y, +static int cvBandPrecDQJac(CVBandPrecData pdata, sunrealtype t, N_Vector y, N_Vector fy, N_Vector ftemp, N_Vector ytemp) { CVodeMem cv_mem; - realtype fnorm, minInc, inc, inc_inv, yj, srur, conj; + sunrealtype fnorm, minInc, inc, inc_inv, yj, srur, conj; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *col_j, *ewt_data, *fy_data, *ftemp_data; - realtype *y_data, *ytemp_data, *cns_data; + sunrealtype *col_j, *ewt_data, *fy_data, *ftemp_data; + sunrealtype *y_data, *ytemp_data, *cns_data; int retval; /* initialize cns_data to avoid compiler warning */ diff --git a/src/cvodes/cvodes_bbdpre.c b/src/cvodes/cvodes_bbdpre.c index 423319a72b..958c665c66 100644 --- a/src/cvodes/cvodes_bbdpre.c +++ b/src/cvodes/cvodes_bbdpre.c @@ -35,26 +35,26 @@ #define TWO RCONST(2.0) /* Prototypes of functions cvBBDPrecSetup and cvBBDPrecSolve */ -static int cvBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bbd_data); -static int cvBBDPrecSolve(realtype t, N_Vector y, N_Vector fy, + sunrealtype gamma, void *bbd_data); +static int cvBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bbd_data); /* Prototype for cvBBDPrecFree */ static int cvBBDPrecFree(CVodeMem cv_mem); /* Wrapper functions for adjoint code */ -static int cvGlocWrapper(sunindextype NlocalB, realtype t, +static int cvGlocWrapper(sunindextype NlocalB, sunrealtype t, N_Vector yB, N_Vector gB, void *cvadj_mem); -static int cvCfnWrapper(sunindextype NlocalB, realtype t, +static int cvCfnWrapper(sunindextype NlocalB, sunrealtype t, N_Vector yB, void *cvadj_mem); /* Prototype for difference quotient Jacobian calculation routine */ -static int cvBBDDQJac(CVBBDPrecData pdata, realtype t, +static int cvBBDDQJac(CVBBDPrecData pdata, sunrealtype t, N_Vector y, N_Vector gy, N_Vector ytemp, N_Vector gtemp); @@ -72,7 +72,7 @@ static int CVBBDPrecFreeB(CVodeBMem cvB_mem); int CVBBDPrecInit(void *cvode_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dqrely, CVLocalFn gloc, CVCommFn cfn) + sunrealtype dqrely, CVLocalFn gloc, CVCommFn cfn) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -295,7 +295,7 @@ int CVBBDPrecInit(void *cvode_mem, sunindextype Nlocal, int CVBBDPrecReInit(void *cvode_mem, sunindextype mudq, - sunindextype mldq, realtype dqrely) + sunindextype mldq, sunrealtype dqrely) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -457,9 +457,9 @@ int CVBBDPrecGetNumGfnEvals(void *cvode_mem, 0 if successful, 1 for a recoverable error (step will be retried). -----------------------------------------------------------------*/ -static int cvBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, +static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, - realtype gamma, void *bbd_data) + sunrealtype gamma, void *bbd_data) { CVBBDPrecData pdata; CVodeMem cv_mem; @@ -551,9 +551,9 @@ static int cvBBDPrecSetup(realtype t, N_Vector y, N_Vector fy, The value returned by the cvBBDPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int cvBBDPrecSolve(realtype t, N_Vector y, N_Vector fy, +static int cvBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, - realtype gamma, realtype delta, + sunrealtype gamma, sunrealtype delta, int lr, void *bbd_data) { int retval; @@ -618,14 +618,14 @@ static int cvBBDPrecFree(CVodeMem cv_mem) This routine also assumes that the local elements of a vector are stored contiguously. -----------------------------------------------------------------*/ -static int cvBBDDQJac(CVBBDPrecData pdata, realtype t, N_Vector y, +static int cvBBDDQJac(CVBBDPrecData pdata, sunrealtype t, N_Vector y, N_Vector gy, N_Vector ytemp, N_Vector gtemp) { CVodeMem cv_mem; - realtype gnorm, minInc, inc, inc_inv, yj, conj; + sunrealtype gnorm, minInc, inc, inc_inv, yj, conj; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *y_data, *ewt_data, *gy_data, *gtemp_data; - realtype *ytemp_data, *col_j, *cns_data; + sunrealtype *y_data, *ewt_data, *gy_data, *gtemp_data; + sunrealtype *ytemp_data, *col_j, *cns_data; int retval; /* initialize cns_data to avoid compiler warning */ @@ -726,7 +726,7 @@ static int cvBBDDQJac(CVBBDPrecData pdata, realtype t, N_Vector y, int CVBBDPrecInitB(void *cvode_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, - realtype dqrelyB, CVLocalFnB glocB, CVCommFnB cfnB) + sunrealtype dqrelyB, CVLocalFnB glocB, CVCommFnB cfnB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -796,7 +796,7 @@ int CVBBDPrecInitB(void *cvode_mem, int which, sunindextype NlocalB, int CVBBDPrecReInitB(void *cvode_mem, int which, sunindextype mudqB, - sunindextype mldqB, realtype dqrelyB) + sunindextype mldqB, sunrealtype dqrelyB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -856,7 +856,7 @@ static int CVBBDPrecFreeB(CVodeBMem cvB_mem) ----------------------------------------------------------------*/ /* cvGlocWrapper interfaces to the CVLocalFnB routine provided by the user */ -static int cvGlocWrapper(sunindextype NlocalB, realtype t, N_Vector yB, +static int cvGlocWrapper(sunindextype NlocalB, sunrealtype t, N_Vector yB, N_Vector gB, void *cvode_mem) { CVodeMem cv_mem; @@ -885,7 +885,7 @@ static int cvGlocWrapper(sunindextype NlocalB, realtype t, N_Vector yB, /* cvCfnWrapper interfaces to the CVCommFnB routine provided by the user */ -static int cvCfnWrapper(sunindextype NlocalB, realtype t, +static int cvCfnWrapper(sunindextype NlocalB, sunrealtype t, N_Vector yB, void *cvode_mem) { CVodeMem cv_mem; diff --git a/src/cvodes/cvodes_bbdpre_impl.h b/src/cvodes/cvodes_bbdpre_impl.h index 34ff4f1f61..a9ad69c611 100644 --- a/src/cvodes/cvodes_bbdpre_impl.h +++ b/src/cvodes/cvodes_bbdpre_impl.h @@ -36,7 +36,7 @@ typedef struct CVBBDPrecDataRec { /* passed by user to CVBBDPrecInit and used by PrecSetup/PrecSolve */ sunindextype mudq, mldq, mukeep, mlkeep; - realtype dqrely; + sunrealtype dqrely; CVLocalFn gloc; CVCommFn cfn; diff --git a/src/cvodes/cvodes_diag.c b/src/cvodes/cvodes_diag.c index 3da59d0102..d3baf75dcb 100644 --- a/src/cvodes/cvodes_diag.c +++ b/src/cvodes/cvodes_diag.c @@ -327,7 +327,7 @@ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { - realtype r; + sunrealtype r; N_Vector ftemp, y; booleantype invOK; CVDiagMem cvdiag_mem; @@ -397,7 +397,7 @@ static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur) { booleantype invOK; - realtype r; + sunrealtype r; CVDiagMem cvdiag_mem; cvdiag_mem = (CVDiagMem) lmem; diff --git a/src/cvodes/cvodes_diag_impl.h b/src/cvodes/cvodes_diag_impl.h index 975dcf6cc4..a8190eb914 100644 --- a/src/cvodes/cvodes_diag_impl.h +++ b/src/cvodes/cvodes_diag_impl.h @@ -36,7 +36,7 @@ extern "C" { typedef struct { - realtype di_gammasv; /* gammasv = gamma at the last call to setup or solve */ + sunrealtype di_gammasv; /* gammasv = gamma at the last call to setup or solve */ N_Vector di_M; /* M = (I - gamma J)^{-1} , gamma = h / l1 */ diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index c1f9721427..4708e0cfbf 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -231,7 +231,7 @@ typedef struct CVodeMemRec { SUNContext cv_sunctx; - realtype cv_uround; /* machine unit roundoff */ + sunrealtype cv_uround; /* machine unit roundoff */ /*-------------------------- Problem Specification Data @@ -242,8 +242,8 @@ typedef struct CVodeMemRec { int cv_lmm; /* lmm = CV_ADAMS or CV_BDF */ int cv_itol; /* itol = CV_SS, CV_SV, CV_WF, CV_NN */ - realtype cv_reltol; /* relative tolerance */ - realtype cv_Sabstol; /* scalar absolute tolerance */ + sunrealtype cv_reltol; /* relative tolerance */ + sunrealtype cv_Sabstol; /* scalar absolute tolerance */ N_Vector cv_Vabstol; /* vector absolute tolerance */ booleantype cv_atolmin0; /* flag indicating that min(abstol) = 0 */ booleantype cv_user_efun; /* SUNTRUE if user sets efun */ @@ -264,8 +264,8 @@ typedef struct CVodeMemRec { booleantype cv_errconQ; /* SUNTRUE if quadrs. are included in error test */ int cv_itolQ; /* itolQ = CV_SS or CV_SV */ - realtype cv_reltolQ; /* relative tolerance for quadratures */ - realtype cv_SabstolQ; /* scalar absolute tolerance for quadratures */ + sunrealtype cv_reltolQ; /* relative tolerance for quadratures */ + sunrealtype cv_SabstolQ; /* scalar absolute tolerance for quadratures */ N_Vector cv_VabstolQ; /* vector absolute tolerance for quadratures */ booleantype cv_atolQmin0; /* flag indicating that min(abstolQ) = 0 */ @@ -285,17 +285,17 @@ typedef struct CVodeMemRec { booleantype cv_fSDQ; /* SUNTRUE if using internal DQ functions */ int cv_ifS; /* ifS = ALLSENS or ONESENS */ - realtype *cv_p; /* parameters in f(t,y,p) */ - realtype *cv_pbar; /* scale factors for parameters */ + sunrealtype *cv_p; /* parameters in f(t,y,p) */ + sunrealtype *cv_pbar; /* scale factors for parameters */ int *cv_plist; /* list of sensitivities */ int cv_DQtype; /* central/forward finite differences */ - realtype cv_DQrhomax; /* cut-off value for separate/simultaneous FD */ + sunrealtype cv_DQrhomax; /* cut-off value for separate/simultaneous FD */ booleantype cv_errconS; /* SUNTRUE if yS are considered in err. control */ int cv_itolS; - realtype cv_reltolS; /* relative tolerance for sensitivities */ - realtype *cv_SabstolS; /* scalar absolute tolerances for sensi. */ + sunrealtype cv_reltolS; /* relative tolerance for sensitivities */ + sunrealtype *cv_SabstolS; /* scalar absolute tolerances for sensi. */ N_Vector *cv_VabstolS; /* vector absolute tolerances for sensi. */ booleantype *cv_atolSmin0; /* flags indicating that min(abstolS[i]) = 0 */ @@ -312,8 +312,8 @@ typedef struct CVodeMemRec { booleantype cv_errconQS; /* SUNTRUE if yQS are considered in err. con. */ int cv_itolQS; - realtype cv_reltolQS; /* relative tolerance for yQS */ - realtype *cv_SabstolQS; /* scalar absolute tolerances for yQS */ + sunrealtype cv_reltolQS; /* relative tolerance for yQS */ + sunrealtype *cv_SabstolQS; /* scalar absolute tolerances for yQS */ N_Vector *cv_VabstolQS; /* vector absolute tolerances for yQS */ booleantype *cv_atolQSmin0; /* flags indicating that min(abstolQS[i]) = 0 */ @@ -385,7 +385,7 @@ typedef struct CVodeMemRec { booleantype cv_tstopset; booleantype cv_tstopinterp; - realtype cv_tstop; + sunrealtype cv_tstop; /*--------- Step Data @@ -399,36 +399,36 @@ typedef struct CVodeMemRec { considering a change in q */ int cv_L; /* L = q + 1 */ - realtype cv_hin; /* initial step size */ - realtype cv_h; /* current step size */ - realtype cv_hprime; /* step size to be used on the next step */ - realtype cv_next_h; /* step size to be used on the next step */ - realtype cv_eta; /* eta = hprime / h */ - realtype cv_hscale; /* value of h used in zn */ - realtype cv_tn; /* current internal value of t */ - realtype cv_tretlast; /* last value of t returned by CVode */ + sunrealtype cv_hin; /* initial step size */ + sunrealtype cv_h; /* current step size */ + sunrealtype cv_hprime; /* step size to be used on the next step */ + sunrealtype cv_next_h; /* step size to be used on the next step */ + sunrealtype cv_eta; /* eta = hprime / h */ + sunrealtype cv_hscale; /* value of h used in zn */ + sunrealtype cv_tn; /* current internal value of t */ + sunrealtype cv_tretlast; /* last value of t returned by CVode */ - realtype cv_tau[L_MAX+1]; /* array of previous q+1 successful step + sunrealtype cv_tau[L_MAX+1]; /* array of previous q+1 successful step sizes indexed from 1 to q+1 */ - realtype cv_tq[NUM_TESTS+1]; /* array of test quantities indexed from + sunrealtype cv_tq[NUM_TESTS+1]; /* array of test quantities indexed from 1 to NUM_TESTS(=5) */ - realtype cv_l[L_MAX]; /* coefficients of l(x) (degree q poly) */ + sunrealtype cv_l[L_MAX]; /* coefficients of l(x) (degree q poly) */ - realtype cv_rl1; /* the scalar 1/l[1] */ - realtype cv_gamma; /* gamma = h * rl1 */ - realtype cv_gammap; /* gamma at the last setup call */ - realtype cv_gamrat; /* gamma / gammap */ + sunrealtype cv_rl1; /* the scalar 1/l[1] */ + sunrealtype cv_gamma; /* gamma = h * rl1 */ + sunrealtype cv_gammap; /* gamma at the last setup call */ + sunrealtype cv_gamrat; /* gamma / gammap */ - realtype cv_crate; /* estimated corrector convergence rate */ - realtype cv_crateS; /* estimated corrector convergence rate (Stgr) */ - realtype cv_delp; /* norm of previous nonlinear solver update */ - realtype cv_acnrm; /* | acor | */ + sunrealtype cv_crate; /* estimated corrector convergence rate */ + sunrealtype cv_crateS; /* estimated corrector convergence rate (Stgr) */ + sunrealtype cv_delp; /* norm of previous nonlinear solver update */ + sunrealtype cv_acnrm; /* | acor | */ booleantype cv_acnrmcur; /* is | acor | current? */ - realtype cv_acnrmQ; /* | acorQ | */ - realtype cv_acnrmS; /* | acorS | */ + sunrealtype cv_acnrmQ; /* | acorQ | */ + sunrealtype cv_acnrmS; /* | acorS | */ booleantype cv_acnrmScur; /* is | acorS | current? */ - realtype cv_acnrmQS; /* | acorQS | */ - realtype cv_nlscoef; /* coeficient in nonlinear convergence test */ + sunrealtype cv_acnrmQS; /* | acorQS | */ + sunrealtype cv_nlscoef; /* coeficient in nonlinear convergence test */ int *cv_ncfS1; /* Array of Ns local counters for conv. * failures (used in CVStep for STAGGERED1) */ @@ -443,18 +443,18 @@ typedef struct CVodeMemRec { int cv_maxnef; /* maximum number of error test failures */ int cv_maxncf; /* maximum number of nonlinear convergence failures */ - realtype cv_hmin; /* |h| >= hmin */ - realtype cv_hmax_inv; /* |h| <= 1/hmax_inv */ - realtype cv_etamax; /* eta <= etamax */ - realtype cv_eta_min_fx; /* eta_min_fx < eta < eta_max_fx keep the current h */ - realtype cv_eta_max_fx; - realtype cv_eta_max_fs; /* eta <= eta_max_fs on the first step */ - realtype cv_eta_max_es; /* eta <= eta_max_es on early steps */ - realtype cv_eta_max_gs; /* eta <= eta_max_gs on a general step */ - realtype cv_eta_min; /* eta >= eta_min on a general step */ - realtype cv_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ - realtype cv_eta_max_ef; /* eta on multiple (>= small_nef) error test failures */ - realtype cv_eta_cf; /* eta on a nonlinear solver convergence failure */ + sunrealtype cv_hmin; /* |h| >= hmin */ + sunrealtype cv_hmax_inv; /* |h| <= 1/hmax_inv */ + sunrealtype cv_etamax; /* eta <= etamax */ + sunrealtype cv_eta_min_fx; /* eta_min_fx < eta < eta_max_fx keep the current h */ + sunrealtype cv_eta_max_fx; + sunrealtype cv_eta_max_fs; /* eta <= eta_max_fs on the first step */ + sunrealtype cv_eta_max_es; /* eta <= eta_max_es on early steps */ + sunrealtype cv_eta_max_gs; /* eta <= eta_max_gs on a general step */ + sunrealtype cv_eta_min; /* eta >= eta_min on a general step */ + sunrealtype cv_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ + sunrealtype cv_eta_max_ef; /* eta on multiple (>= small_nef) error test failures */ + sunrealtype cv_eta_cf; /* eta on a nonlinear solver convergence failure */ long int cv_small_nst; /* nst <= small_nst use eta_max_es */ int cv_small_nef; /* nef >= small_nef use eta_max_ef */ @@ -499,19 +499,19 @@ typedef struct CVodeMemRec { Step size ratios ----------------*/ - realtype cv_etaqm1; /* ratio of new to old h for order q-1 */ - realtype cv_etaq; /* ratio of new to old h for order q */ - realtype cv_etaqp1; /* ratio of new to old h for order q+1 */ + sunrealtype cv_etaqm1; /* ratio of new to old h for order q-1 */ + sunrealtype cv_etaq; /* ratio of new to old h for order q */ + sunrealtype cv_etaqp1; /* ratio of new to old h for order q+1 */ /*------------------ Space requirements ------------------*/ - sunindextype cv_lrw1; /* no. of realtype words in 1 N_Vector y */ + sunindextype cv_lrw1; /* no. of sunrealtype words in 1 N_Vector y */ sunindextype cv_liw1; /* no. of integer words in 1 N_Vector y */ - sunindextype cv_lrw1Q; /* no. of realtype words in 1 N_Vector yQ */ + sunindextype cv_lrw1Q; /* no. of sunrealtype words in 1 N_Vector yQ */ sunindextype cv_liw1Q; /* no. of integer words in 1 N_Vector yQ */ - long int cv_lrw; /* no. of realtype words in CVODE work vectors */ + long int cv_lrw; /* no. of sunrealtype words in CVODE work vectors */ long int cv_liw; /* no. of integer words in CVODE work vectors */ /*--------------------- @@ -579,7 +579,7 @@ typedef struct CVodeMemRec { void *cv_lmem; /* linear solver interface memory structure */ long int cv_msbp; /* max number of steps between lsetip calls */ - realtype cv_dgmax_lsetup; /* gamma ratio threshold to signal for a linear + sunrealtype cv_dgmax_lsetup; /* gamma ratio threshold to signal for a linear * solver setup */ booleantype cv_forceSetup; /* flag to request a call to the setup routine */ @@ -589,12 +589,12 @@ typedef struct CVodeMemRec { int cv_qu; /* last successful q value used */ long int cv_nstlp; /* step number of last setup call */ - realtype cv_h0u; /* actual initial stepsize */ - realtype cv_hu; /* last successful h value used */ - realtype cv_saved_tq5; /* saved value of tq[5] */ + sunrealtype cv_h0u; /* actual initial stepsize */ + sunrealtype cv_hu; /* last successful h value used */ + sunrealtype cv_saved_tq5; /* saved value of tq[5] */ booleantype cv_jcur; /* is Jacobian info for linear solver current? */ int cv_convfail; /* flag storing previous solver failure mode */ - realtype cv_tolsf; /* tolerance scale factor */ + sunrealtype cv_tolsf; /* tolerance scale factor */ int cv_qmax_alloc; /* value of qmax used when allocating mem */ int cv_qmax_allocQ; /* qmax used when allocating quad. mem */ int cv_qmax_allocS; /* qmax used when allocating sensi. mem */ @@ -640,7 +640,7 @@ typedef struct CVodeMemRec { -------------------------*/ booleantype cv_sldeton; /* is Stability Limit Detection on? */ - realtype cv_ssdat[6][4]; /* scaled data array for STALD */ + sunrealtype cv_ssdat[6][4]; /* scaled data array for STALD */ int cv_nscon; /* counter for STALD method */ long int cv_nor; /* counter for number of order reductions */ @@ -652,14 +652,14 @@ typedef struct CVodeMemRec { int cv_nrtfn; /* number of components of g */ int *cv_iroots; /* array for root information */ int *cv_rootdir; /* array specifying direction of zero-crossing */ - realtype cv_tlo; /* nearest endpoint of interval in root search */ - realtype cv_thi; /* farthest endpoint of interval in root search */ - realtype cv_trout; /* t value returned by rootfinding routine */ - realtype *cv_glo; /* saved array of g values at t = tlo */ - realtype *cv_ghi; /* saved array of g values at t = thi */ - realtype *cv_grout; /* array of g values at t = trout */ - realtype cv_toutc; /* copy of tout (if NORMAL mode) */ - realtype cv_ttol; /* tolerance on root location trout */ + sunrealtype cv_tlo; /* nearest endpoint of interval in root search */ + sunrealtype cv_thi; /* farthest endpoint of interval in root search */ + sunrealtype cv_trout; /* t value returned by rootfinding routine */ + sunrealtype *cv_glo; /* saved array of g values at t = tlo */ + sunrealtype *cv_ghi; /* saved array of g values at t = thi */ + sunrealtype *cv_grout; /* array of g values at t = trout */ + sunrealtype cv_toutc; /* copy of tout (if NORMAL mode) */ + sunrealtype cv_ttol; /* tolerance on root location trout */ int cv_taskc; /* copy of parameter itask */ int cv_irfnd; /* flag showing whether last step had a root */ long int cv_nge; /* counter for g evaluations */ @@ -673,13 +673,13 @@ typedef struct CVodeMemRec { CVodeProjMem proj_mem; /* projection memory structure */ booleantype proj_enabled; /* flag indicating if projection is enabled */ booleantype proj_applied; /* flag indicating if projection was applied */ - realtype proj_p[L_MAX]; /* coefficients of p(x) (degree q poly) */ + sunrealtype proj_p[L_MAX]; /* coefficients of p(x) (degree q poly) */ /*----------------------- Fused Vector Operations -----------------------*/ - realtype* cv_cvals; /* array of scalars */ + sunrealtype* cv_cvals; /* array of scalars */ N_Vector* cv_Xvecs; /* array of vectors */ N_Vector* cv_Zvecs; /* array of vectors */ @@ -715,8 +715,8 @@ typedef struct CVodeMemRec { struct CVckpntMemRec { /* Integration limits */ - realtype ck_t0; - realtype ck_t1; + sunrealtype ck_t0; + sunrealtype ck_t1; /* Nordsieck History Array */ N_Vector ck_zn[L_MAX]; @@ -749,23 +749,23 @@ struct CVckpntMemRec { /* Step data */ long int ck_nst; - realtype ck_tretlast; + sunrealtype ck_tretlast; int ck_q; int ck_qprime; int ck_qwait; int ck_L; - realtype ck_gammap; - realtype ck_h; - realtype ck_hprime; - realtype ck_hscale; - realtype ck_eta; - realtype ck_etamax; - realtype ck_tau[L_MAX+1]; - realtype ck_tq[NUM_TESTS+1]; - realtype ck_l[L_MAX]; + sunrealtype ck_gammap; + sunrealtype ck_h; + sunrealtype ck_hprime; + sunrealtype ck_hscale; + sunrealtype ck_eta; + sunrealtype ck_etamax; + sunrealtype ck_tau[L_MAX+1]; + sunrealtype ck_tq[NUM_TESTS+1]; + sunrealtype ck_l[L_MAX]; /* Saved values */ - realtype ck_saved_tq5; + sunrealtype ck_saved_tq5; /* Pointer to next structure in list */ struct CVckpntMemRec *ck_next; @@ -789,7 +789,7 @@ struct CVckpntMemRec { typedef booleantype (*cvaIMMallocFn)(CVodeMem cv_mem); typedef void (*cvaIMFreeFn)(CVodeMem cv_mem); -typedef int (*cvaIMGetYFn)(CVodeMem cv_mem, realtype t, N_Vector y, N_Vector *yS); +typedef int (*cvaIMGetYFn)(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS); typedef int (*cvaIMStorePntFn)(CVodeMem cv_mem, CVdtpntMem d); /* @@ -803,7 +803,7 @@ typedef int (*cvaIMStorePntFn)(CVodeMem cv_mem, CVdtpntMem d); */ struct CVdtpntMemRec { - realtype t; /* time */ + sunrealtype t; /* time */ void *content; /* IMtype-dependent content */ }; @@ -839,7 +839,7 @@ struct CVodeBMemRec { int cv_index; /* Time at which the backward problem is initialized */ - realtype cv_t0; + sunrealtype cv_t0; /* CVODES memory for this backward problem */ CVodeMem cv_mem; @@ -873,7 +873,7 @@ struct CVodeBMemRec { int (*cv_pfree)(CVodeBMem cvB_mem); /* Time at which to extract solution / quadratures */ - realtype cv_tout; + sunrealtype cv_tout; /* Workspace Nvector */ N_Vector cv_y; @@ -900,19 +900,19 @@ struct CVadjMemRec { * -------------------- */ /* Integration interval */ - realtype ca_tinitial, ca_tfinal; + sunrealtype ca_tinitial, ca_tfinal; /* Flag for first call to CVodeF */ booleantype ca_firstCVodeFcall; /* Flag if CVodeF was called with TSTOP */ booleantype ca_tstopCVodeFcall; - realtype ca_tstopCVodeF; + sunrealtype ca_tstopCVodeF; /* Flag if CVodeF was called in CV_NORMAL_MODE and encountered a root after tout */ booleantype ca_rootret; - realtype ca_troot; + sunrealtype ca_troot; /* ---------------------- * Backward problems data @@ -977,7 +977,7 @@ struct CVadjMemRec { /* Workspace for the interpolation module */ N_Vector ca_Y[L_MAX]; /* pointers to zn[i] */ N_Vector *ca_YS[L_MAX]; /* pointers to znS[i] */ - realtype ca_T[L_MAX]; + sunrealtype ca_T[L_MAX]; /* ------------------------------- * Workspace for wrapper functions @@ -1130,9 +1130,9 @@ struct CVadjMemRec { /* Norm functions */ -realtype cvSensNorm(CVodeMem cv_mem, N_Vector *xS, N_Vector *wS); +sunrealtype cvSensNorm(CVodeMem cv_mem, N_Vector *xS, N_Vector *wS); -realtype cvSensUpdateNorm(CVodeMem cv_mem, realtype old_nrm, +sunrealtype cvSensUpdateNorm(CVodeMem cv_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS); /* Prototype of internal ewtSet function */ @@ -1158,14 +1158,14 @@ int cvNlsInitSensStg1(CVodeMem cv_mem); /* Projection functions */ -int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *npfPtr); int cvProjInit(CVodeProjMem proj_mem); int cvProjFree(CVodeProjMem *proj_mem); /* Restore tn and undo prediction to reattempt a step */ -void cvRestore(CVodeMem cv_mem, realtype saved_t); +void cvRestore(CVodeMem cv_mem, sunrealtype saved_t); /* Reset h and rescale history array to prepare for a step */ @@ -1173,25 +1173,25 @@ void cvRescale(CVodeMem cv_mem); /* Prototypes for internal sensitivity rhs wrappers */ -int cvSensRhsWrapper(CVodeMem cv_mem, realtype time, +int cvSensRhsWrapper(CVodeMem cv_mem, sunrealtype time, N_Vector ycur, N_Vector fcur, N_Vector *yScur, N_Vector *fScur, N_Vector temp1, N_Vector temp2); -int cvSensRhs1Wrapper(CVodeMem cv_mem, realtype time, +int cvSensRhs1Wrapper(CVodeMem cv_mem, sunrealtype time, N_Vector ycur, N_Vector fcur, int is, N_Vector yScur, N_Vector fScur, N_Vector temp1, N_Vector temp2); /* Prototypes for internal sensitivity rhs DQ functions */ -int cvSensRhsInternalDQ(int Ns, realtype t, +int cvSensRhsInternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, N_Vector *yS, N_Vector *ySdot, void *fS_data, N_Vector tempv, N_Vector ftemp); -int cvSensRhs1InternalDQ(int Ns, realtype t, +int cvSensRhs1InternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int is, N_Vector yS, N_Vector ySdot, void *fS_data, diff --git a/src/cvodes/cvodes_io.c b/src/cvodes/cvodes_io.c index 93525e3477..0dabed7db1 100644 --- a/src/cvodes/cvodes_io.c +++ b/src/cvodes/cvodes_io.c @@ -40,7 +40,7 @@ * Specifies the gamma ratio threshold to signal for a linear solver setup */ -int CVodeSetDeltaGammaMaxLSetup(void *cvode_mem, realtype dgmax_lsetup) +int CVodeSetDeltaGammaMaxLSetup(void *cvode_mem, sunrealtype dgmax_lsetup) { CVodeMem cv_mem; @@ -306,7 +306,7 @@ int CVodeSetStabLimDet(void *cvode_mem, booleantype sldet) * Specifies the initial step size */ -int CVodeSetInitStep(void *cvode_mem, realtype hin) +int CVodeSetInitStep(void *cvode_mem, sunrealtype hin) { CVodeMem cv_mem; @@ -328,7 +328,7 @@ int CVodeSetInitStep(void *cvode_mem, realtype hin) * Specifies the minimum step size */ -int CVodeSetMinStep(void *cvode_mem, realtype hmin) +int CVodeSetMinStep(void *cvode_mem, sunrealtype hmin) { CVodeMem cv_mem; @@ -366,9 +366,9 @@ int CVodeSetMinStep(void *cvode_mem, realtype hmin) * Specifies the maximum step size */ -int CVodeSetMaxStep(void *cvode_mem, realtype hmax) +int CVodeSetMaxStep(void *cvode_mem, sunrealtype hmax) { - realtype hmax_inv; + sunrealtype hmax_inv; CVodeMem cv_mem; if (cvode_mem==NULL) { @@ -407,8 +407,8 @@ int CVodeSetMaxStep(void *cvode_mem, realtype hmax) */ -int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, - realtype eta_max_fx) +int CVodeSetEtaFixedStepBounds(void* cvode_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx) { CVodeMem cv_mem; @@ -440,7 +440,7 @@ int CVodeSetEtaFixedStepBounds(void* cvode_mem, realtype eta_min_fx, * Specifies the maximum step size change on the first step */ -int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs) +int CVodeSetEtaMaxFirstStep(void* cvode_mem, sunrealtype eta_max_fs) { CVodeMem cv_mem; @@ -468,7 +468,7 @@ int CVodeSetEtaMaxFirstStep(void* cvode_mem, realtype eta_max_fs) * when nst <= small_nst */ -int CVodeSetEtaMaxEarlyStep(void* cvode_mem, realtype eta_max_es) +int CVodeSetEtaMaxEarlyStep(void* cvode_mem, sunrealtype eta_max_es) { CVodeMem cv_mem; @@ -523,7 +523,7 @@ int CVodeSetNumStepsEtaMaxEarlyStep(void* cvode_mem, long int small_nst) * Specifies the maximum step size change on a general steps (nst > small_nst) */ -int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs) +int CVodeSetEtaMax(void* cvode_mem, sunrealtype eta_max_gs) { CVodeMem cv_mem; @@ -550,7 +550,7 @@ int CVodeSetEtaMax(void* cvode_mem, realtype eta_max_gs) * Specifies the minimum change on a general steps */ -int CVodeSetEtaMin(void* cvode_mem, realtype eta_min) +int CVodeSetEtaMin(void* cvode_mem, sunrealtype eta_min) { CVodeMem cv_mem; @@ -577,7 +577,7 @@ int CVodeSetEtaMin(void* cvode_mem, realtype eta_min) * Specifies the minimum step size change after an error test failure */ -int CVodeSetEtaMinErrFail(void* cvode_mem, realtype eta_min_ef) +int CVodeSetEtaMinErrFail(void* cvode_mem, sunrealtype eta_min_ef) { CVodeMem cv_mem; @@ -605,7 +605,7 @@ int CVodeSetEtaMinErrFail(void* cvode_mem, realtype eta_min_ef) * test failures */ -int CVodeSetEtaMaxErrFail(void* cvode_mem, realtype eta_max_ef) +int CVodeSetEtaMaxErrFail(void* cvode_mem, sunrealtype eta_max_ef) { CVodeMem cv_mem; @@ -660,7 +660,7 @@ int CVodeSetNumFailsEtaMaxErrFail(void* cvode_mem, int small_nef) * Specifies the step size change after a nonlinear solver failure */ -int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf) +int CVodeSetEtaConvFail(void* cvode_mem, sunrealtype eta_cf) { CVodeMem cv_mem; @@ -687,7 +687,7 @@ int CVodeSetEtaConvFail(void* cvode_mem, realtype eta_cf) * Specifies the time beyond which the integration is not to proceed. */ -int CVodeSetStopTime(void *cvode_mem, realtype tstop) +int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop) { CVodeMem cv_mem; @@ -858,7 +858,7 @@ int CVodeSetMaxNonlinIters(void *cvode_mem, int maxcor) * test */ -int CVodeSetNonlinConvCoef(void *cvode_mem, realtype nlscoef) +int CVodeSetNonlinConvCoef(void *cvode_mem, sunrealtype nlscoef) { CVodeMem cv_mem; @@ -968,7 +968,7 @@ int CVodeSetNoInactiveRootWarn(void *cvode_mem) int CVodeSetConstraints(void *cvode_mem, N_Vector constraints) { CVodeMem cv_mem; - realtype temptest; + sunrealtype temptest; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", "CVodeSetConstraints", MSGCV_NO_MEM); @@ -1049,7 +1049,7 @@ int CVodeSetQuadErrCon(void *cvode_mem, booleantype errconQ) * ================================================================= */ -int CVodeSetSensDQMethod(void *cvode_mem, int DQtype, realtype DQrhomax) +int CVodeSetSensDQMethod(void *cvode_mem, int DQtype, sunrealtype DQrhomax) { CVodeMem cv_mem; @@ -1139,7 +1139,7 @@ int CVodeSetSensMaxNonlinIters(void *cvode_mem, int maxcorS) /*-----------------------------------------------------------------*/ -int CVodeSetSensParams(void *cvode_mem, realtype *p, realtype *pbar, int *plist) +int CVodeSetSensParams(void *cvode_mem, sunrealtype *p, sunrealtype *pbar, int *plist) { CVodeMem cv_mem; int is, Ns; @@ -1370,7 +1370,7 @@ int CVodeGetCurrentOrder(void *cvode_mem, int *qcur) * Returns the value of gamma for the current step. */ -int CVodeGetCurrentGamma(void *cvode_mem, realtype *gamma) +int CVodeGetCurrentGamma(void *cvode_mem, sunrealtype *gamma) { CVodeMem cv_mem; @@ -1418,7 +1418,7 @@ int CVodeGetNumStabLimOrderReds(void *cvode_mem, long int *nslred) * Returns the step size used on the first step */ -int CVodeGetActualInitStep(void *cvode_mem, realtype *hinused) +int CVodeGetActualInitStep(void *cvode_mem, sunrealtype *hinused) { CVodeMem cv_mem; @@ -1440,7 +1440,7 @@ int CVodeGetActualInitStep(void *cvode_mem, realtype *hinused) * Returns the step size used on the last successful step */ -int CVodeGetLastStep(void *cvode_mem, realtype *hlast) +int CVodeGetLastStep(void *cvode_mem, sunrealtype *hlast) { CVodeMem cv_mem; @@ -1462,7 +1462,7 @@ int CVodeGetLastStep(void *cvode_mem, realtype *hlast) * Returns the step size to be attempted on the next step */ -int CVodeGetCurrentStep(void *cvode_mem, realtype *hcur) +int CVodeGetCurrentStep(void *cvode_mem, sunrealtype *hcur) { CVodeMem cv_mem; @@ -1551,7 +1551,7 @@ int CVodeGetCurrentSensSolveIndex(void *cvode_mem, int *index) * Returns the current value of the independent variable */ -int CVodeGetCurrentTime(void *cvode_mem, realtype *tcur) +int CVodeGetCurrentTime(void *cvode_mem, sunrealtype *tcur) { CVodeMem cv_mem; @@ -1573,7 +1573,7 @@ int CVodeGetCurrentTime(void *cvode_mem, realtype *tcur) * Returns a suggested factor for scaling tolerances */ -int CVodeGetTolScaleFactor(void *cvode_mem, realtype *tolsfact) +int CVodeGetTolScaleFactor(void *cvode_mem, sunrealtype *tolsfact) { CVodeMem cv_mem; @@ -1664,8 +1664,8 @@ int CVodeGetWorkSpace(void *cvode_mem, long int *lenrw, long int *leniw) int CVodeGetIntegratorStats(void *cvode_mem, long int *nsteps, long int *nfevals, long int *nlinsetups, long int *netfails, int *qlast, - int *qcur, realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur) + int *qcur, sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur) { CVodeMem cv_mem; @@ -2447,7 +2447,7 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nst > 0) { fprintf(outfile, "NLS iters per step = %"RSYM"\n", - (realtype) cv_mem->cv_nni / (realtype) cv_mem->cv_nst); + (sunrealtype) cv_mem->cv_nni / (sunrealtype) cv_mem->cv_nst); } /* linear solver stats */ @@ -2466,11 +2466,11 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nni > 0) { fprintf(outfile, "LS iters per NLS iter = %"RSYM"\n", - (realtype) cvls_mem->nli / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nli / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, "Jac evals per NLS iter = %"RSYM"\n", - (realtype) cvls_mem->nje / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nje / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, "Prec evals per NLS iter = %"RSYM"\n", - (realtype) cvls_mem->npe / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->npe / (sunrealtype) cv_mem->cv_nni); } } @@ -2552,7 +2552,7 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nst > 0) { fprintf(outfile, ",NLS iters per step,%"RSYM, - (realtype) cv_mem->cv_nni / (realtype) cv_mem->cv_nst); + (sunrealtype) cv_mem->cv_nni / (sunrealtype) cv_mem->cv_nst); } else { @@ -2575,11 +2575,11 @@ int CVodePrintAllStats(void *cvode_mem, FILE *outfile, SUNOutputFormat fmt) if (cv_mem->cv_nni > 0) { fprintf(outfile, ",LS iters per NLS iter,%"RSYM, - (realtype) cvls_mem->nli / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nli / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, ",Jac evals per NLS iter,%"RSYM, - (realtype) cvls_mem->nje / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->nje / (sunrealtype) cv_mem->cv_nni); fprintf(outfile, ",Prec evals per NLS iter,%"RSYM, - (realtype) cvls_mem->npe / (realtype) cv_mem->cv_nni); + (sunrealtype) cvls_mem->npe / (sunrealtype) cv_mem->cv_nni); } else { diff --git a/src/cvodes/cvodes_ls.c b/src/cvodes/cvodes_ls.c index 14d12a9bc6..a878afccec 100644 --- a/src/cvodes/cvodes_ls.c +++ b/src/cvodes/cvodes_ls.c @@ -43,8 +43,8 @@ PRIVATE FUNCTION PROTOTYPES - forward problems =================================================================*/ -static int cvLsLinSys(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, realtype gamma, +static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, + booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -55,12 +55,12 @@ static int cvLsLinSys(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, /* cvLsJacBWrapper and cvLsJacBSWrapper have type CVLsJacFn, and wrap around user-provided functions of type CVLsJacFnB and CVLsJacFnBS, respectively */ -static int cvLsJacBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsJacBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int cvLsJacBSWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsJacBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); @@ -68,54 +68,54 @@ static int cvLsJacBSWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsPrecSetupBWrapper and cvLsPrecSetupBSWrapper have type CVLsPrecSetupFn, and wrap around user-provided functions of type CVLsPrecSetupFnB and CVLsPrecSetupFnBS, respectively */ -static int cvLsPrecSetupBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsPrecSetupBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, - realtype gammaB, void *cvode_mem); -static int cvLsPrecSetupBSWrapper(realtype t, N_Vector yB, N_Vector fyB, + sunrealtype gammaB, void *cvode_mem); +static int cvLsPrecSetupBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, - realtype gammaB, void *cvode_mem); + sunrealtype gammaB, void *cvode_mem); /* cvLsPrecSolveBWrapper and cvLsPrecSolveBSWrapper have type CVLsPrecSolveFn, and wrap around user-provided functions of type CVLsPrecSolveFnB and CVLsPrecSolveFnBS, respectively */ -static int cvLsPrecSolveBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsPrecSolveBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, N_Vector rB, N_Vector zB, - realtype gammaB, realtype deltaB, + sunrealtype gammaB, sunrealtype deltaB, int lrB, void *cvode_mem); -static int cvLsPrecSolveBSWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsPrecSolveBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, N_Vector rB, N_Vector zB, - realtype gammaB, realtype deltaB, + sunrealtype gammaB, sunrealtype deltaB, int lrB, void *cvode_mem); /* cvLsJacTimesSetupBWrapper and cvLsJacTimesSetupBSWrapper have type CVLsJacTimesSetupFn, and wrap around user-provided functions of type CVLsJacTimesSetupFnB and CVLsJacTimesSetupFnBS, respectively */ -static int cvLsJacTimesSetupBWrapper(realtype t, N_Vector yB, +static int cvLsJacTimesSetupBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem); -static int cvLsJacTimesSetupBSWrapper(realtype t, N_Vector yB, +static int cvLsJacTimesSetupBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem); /* cvLsJacTimesVecBWrapper and cvLsJacTimesVecBSWrapper have type CVLsJacTimesVecFn, and wrap around user-provided functions of type CVLsJacTimesVecFnB and CVLsJacTimesVecFnBS, respectively */ -static int cvLsJacTimesVecBWrapper(N_Vector vB, N_Vector JvB, realtype t, +static int cvLsJacTimesVecBWrapper(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem, N_Vector tmpB); -static int cvLsJacTimesVecBSWrapper(N_Vector vB, N_Vector JvB, realtype t, +static int cvLsJacTimesVecBSWrapper(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem, N_Vector tmpB); /* cvLsLinSysFnBWrapper and cvLsLinSysFnBSWrapper have type CVLsLinSysFn, and wrap around user-provided functions of type CVLsLinSysFnB and CVLsLinSysFnBS, respectively */ -static int cvLsLinSysBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsLinSysBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, - booleantype *jcurB, realtype gammaB, + booleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int cvLsLinSysBSWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsLinSysBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, - booleantype *jcurB, realtype gammaB, + booleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3); @@ -390,7 +390,7 @@ int CVodeSetJacFn(void *cvode_mem, CVLsJacFn jac) /* CVodeSetDeltaGammaMaxBadJac specifies the maximum gamma ratio change * after a NLS convergence failure with a potentially bad Jacobian. If * |gamma/gammap-1| < dgmax_jbad then the Jacobian is marked as bad */ -int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, realtype dgmax_jbad) +int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, sunrealtype dgmax_jbad) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -412,7 +412,7 @@ int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, realtype dgmax_jbad) /* CVodeSetEpsLin specifies the nonlinear -> linear tolerance scale factor */ -int CVodeSetEpsLin(void *cvode_mem, realtype eplifac) +int CVodeSetEpsLin(void *cvode_mem, sunrealtype eplifac) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -438,7 +438,7 @@ int CVodeSetEpsLin(void *cvode_mem, realtype eplifac) /* CVodeSetLSNormFactor sets or computes the factor to use when converting from the integrator tolerance to the linear solver tolerance (WRMS to L2 norm). */ -int CVodeSetLSNormFactor(void *cvode_mem, realtype nrmfac) +int CVodeSetLSNormFactor(void *cvode_mem, sunrealtype nrmfac) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -1072,7 +1072,7 @@ int cvLsPSetup(void *cvode_mem) only case in which the user's psolve routine is allowed to be NULL. -----------------------------------------------------------------*/ -int cvLsPSolve(void *cvode_mem, N_Vector r, N_Vector z, realtype tol, int lr) +int cvLsPSolve(void *cvode_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -1100,7 +1100,7 @@ int cvLsPSolve(void *cvode_mem, N_Vector r, N_Vector z, realtype tol, int lr) implementations of the difference quotient Jacobian approximation routines. ---------------------------------------------------------------*/ -int cvLsDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *cvode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -1161,11 +1161,11 @@ int cvLsDQJac(realtype t, N_Vector y, N_Vector fy, function. Finally, the actual computation of the jth column of the Jacobian is done with a call to N_VLinearSum. -----------------------------------------------------------------*/ -int cvLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1) { - realtype fnorm, minInc, inc, inc_inv, yjsaved, srur, conj; - realtype *y_data, *ewt_data, *cns_data; + sunrealtype fnorm, minInc, inc, inc_inv, yjsaved, srur, conj; + sunrealtype *y_data, *ewt_data, *cns_data; N_Vector ftemp, jthCol; sunindextype j, N; CVLsMem cvls_mem; @@ -1245,13 +1245,13 @@ int cvLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, a simple for loop to set each of the elements of a column in succession. -----------------------------------------------------------------*/ -int cvLsBandDQJac(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, +int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1, N_Vector tmp2) { N_Vector ftemp, ytemp; - realtype fnorm, minInc, inc, inc_inv, srur, conj; - realtype *col_j, *ewt_data, *fy_data, *ftemp_data; - realtype *y_data, *ytemp_data, *cns_data; + sunrealtype fnorm, minInc, inc, inc_inv, srur, conj; + sunrealtype *col_j, *ewt_data, *fy_data, *ftemp_data; + sunrealtype *y_data, *ytemp_data, *cns_data; sunindextype group, i, j, width, ngroups, i1, i2; sunindextype N, mupper, mlower; CVLsMem cvls_mem; @@ -1349,13 +1349,13 @@ int cvLsBandDQJac(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, Jv = [f(y + v*sig) - f(y)]/sig, where sig = 1 / ||v||_WRMS, i.e. the WRMS norm of v*sig is 1. -----------------------------------------------------------------*/ -int cvLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, +int cvLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *cvode_mem, N_Vector work) { CVodeMem cv_mem; CVLsMem cvls_mem; - realtype sig, siginv; + sunrealtype sig, siginv; int iter, retval; /* access CVLsMem structure */ @@ -1397,8 +1397,8 @@ int cvLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, Setup the linear system A = I - gamma J -----------------------------------------------------------------*/ -static int cvLsLinSys(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, realtype gamma, +static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, + booleantype jok, booleantype *jcur, sunrealtype gamma, void *cvode_mem, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { @@ -1622,7 +1622,7 @@ int cvLsSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { CVLsMem cvls_mem; - realtype dgamma; + sunrealtype dgamma; int retval; /* access CVLsMem structure */ @@ -1723,12 +1723,12 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, N_Vector fnow) { CVLsMem cvls_mem; - realtype bnorm = ZERO; - realtype deltar, delta, w_mean; + sunrealtype bnorm = ZERO; + sunrealtype deltar, delta, w_mean; int curiter, nli_inc, retval; booleantype do_sensi_sim, do_sensi_stg, do_sensi_stg1; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - realtype resnorm; + sunrealtype resnorm; long int nps_inc; #endif @@ -2168,7 +2168,7 @@ int CVodeSetJacFnBS(void *cvode_mem, int which, CVLsJacFnBS jacBS) } -int CVodeSetEpsLinB(void *cvode_mem, int which, realtype eplifacB) +int CVodeSetEpsLinB(void *cvode_mem, int which, sunrealtype eplifacB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -2188,7 +2188,7 @@ int CVodeSetEpsLinB(void *cvode_mem, int which, realtype eplifacB) } -int CVodeSetLSNormFactorB(void *cvode_mem, int which, realtype nrmfacB) +int CVodeSetLSNormFactorB(void *cvode_mem, int which, sunrealtype nrmfacB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -2433,7 +2433,7 @@ int CVodeSetLinSysFnBS(void *cvode_mem, int which, CVLsLinSysFnBS linsysBS) /* cvLsJacBWrapper interfaces to the CVLsJacFnB routine provided by the user. cvLsJacBWrapper is of type CVLsJacFn. */ -static int cvLsJacBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsJacBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { @@ -2463,7 +2463,7 @@ static int cvLsJacBWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsJacBSWrapper interfaces to the CVLsJacFnBS routine provided by the user. cvLsJacBSWrapper is of type CVLsJacFn. */ -static int cvLsJacBSWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsJacBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix JB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { @@ -2497,9 +2497,9 @@ static int cvLsJacBSWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsPrecSetupBWrapper interfaces to the CVLsPrecSetupFnB routine provided by the user */ -static int cvLsPrecSetupBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsPrecSetupBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, - realtype gammaB, void *cvode_mem) + sunrealtype gammaB, void *cvode_mem) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -2527,9 +2527,9 @@ static int cvLsPrecSetupBWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsPrecSetupBSWrapper interfaces to the CVLsPrecSetupFnBS routine provided by the user */ -static int cvLsPrecSetupBSWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsPrecSetupBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, - realtype gammaB, void *cvode_mem) + sunrealtype gammaB, void *cvode_mem) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -2562,9 +2562,9 @@ static int cvLsPrecSetupBSWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsPrecSolveBWrapper interfaces to the CVLsPrecSolveFnB routine provided by the user */ -static int cvLsPrecSolveBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsPrecSolveBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, N_Vector rB, N_Vector zB, - realtype gammaB, realtype deltaB, + sunrealtype gammaB, sunrealtype deltaB, int lrB, void *cvode_mem) { CVodeMem cv_mem; @@ -2594,9 +2594,9 @@ static int cvLsPrecSolveBWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsPrecSolveBSWrapper interfaces to the CVLsPrecSolveFnBS routine provided by the user */ -static int cvLsPrecSolveBSWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsPrecSolveBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, N_Vector rB, N_Vector zB, - realtype gammaB, realtype deltaB, + sunrealtype gammaB, sunrealtype deltaB, int lrB, void *cvode_mem) { CVodeMem cv_mem; @@ -2630,7 +2630,7 @@ static int cvLsPrecSolveBSWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsJacTimesSetupBWrapper interfaces to the CVLsJacTimesSetupFnB routine provided by the user */ -static int cvLsJacTimesSetupBWrapper(realtype t, N_Vector yB, +static int cvLsJacTimesSetupBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem) { CVodeMem cv_mem; @@ -2660,7 +2660,7 @@ static int cvLsJacTimesSetupBWrapper(realtype t, N_Vector yB, /* cvLsJacTimesSetupBSWrapper interfaces to the CVLsJacTimesSetupFnBS routine provided by the user */ -static int cvLsJacTimesSetupBSWrapper(realtype t, N_Vector yB, +static int cvLsJacTimesSetupBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem) { CVodeMem cv_mem; @@ -2694,7 +2694,7 @@ static int cvLsJacTimesSetupBSWrapper(realtype t, N_Vector yB, /* cvLsJacTimesVecBWrapper interfaces to the CVLsJacTimesVecFnB routine provided by the user */ -static int cvLsJacTimesVecBWrapper(N_Vector vB, N_Vector JvB, realtype t, +static int cvLsJacTimesVecBWrapper(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem, N_Vector tmpB) { @@ -2725,7 +2725,7 @@ static int cvLsJacTimesVecBWrapper(N_Vector vB, N_Vector JvB, realtype t, /* cvLsJacTimesVecBSWrapper interfaces to the CVLsJacTimesVecFnBS routine provided by the user */ -static int cvLsJacTimesVecBSWrapper(N_Vector vB, N_Vector JvB, realtype t, +static int cvLsJacTimesVecBSWrapper(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector yB, N_Vector fyB, void *cvode_mem, N_Vector tmpB) { @@ -2760,9 +2760,9 @@ static int cvLsJacTimesVecBSWrapper(N_Vector vB, N_Vector JvB, realtype t, /* cvLsLinSysBWrapper interfaces to the CVLsLinSysFnB routine provided by the user. cvLsLinSysBWrapper is of type CVLsLinSysFn. */ -static int cvLsLinSysBWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsLinSysBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, - booleantype *jcurB, realtype gammaB, + booleantype *jcurB, sunrealtype gammaB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { @@ -2794,9 +2794,9 @@ static int cvLsLinSysBWrapper(realtype t, N_Vector yB, N_Vector fyB, /* cvLsLinSysBSWrapper interfaces to the CVLsLinSysFnBS routine provided by the user. cvLsLinSysBSWrapper is of type CVLsLinSysFn. */ -static int cvLsLinSysBSWrapper(realtype t, N_Vector yB, N_Vector fyB, +static int cvLsLinSysBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, - booleantype *jcurB, realtype gammaB, + booleantype *jcurB, sunrealtype gammaB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { diff --git a/src/cvodes/cvodes_ls_impl.h b/src/cvodes/cvodes_ls_impl.h index 2617f2d984..c6055245ba 100644 --- a/src/cvodes/cvodes_ls_impl.h +++ b/src/cvodes/cvodes_ls_impl.h @@ -62,15 +62,15 @@ typedef struct CVLsMemRec { CVLsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* user data is passed to jac */ booleantype jbad; /* heuristic suggestion for pset */ - realtype dgmax_jbad; /* if convfail = FAIL_BAD_J and the gamma ratio * + sunrealtype dgmax_jbad; /* if convfail = FAIL_BAD_J and the gamma ratio * * |gamma/gammap-1| < dgmax_jbad then J is bad */ /* Matrix-based solver, scale solution to account for change in gamma */ booleantype scalesol; /* Iterative solver tolerance */ - realtype eplifac; /* nonlinear -> linear tol scaling factor */ - realtype nrmfac; /* integrator -> LS norm conversion factor */ + sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ + sunrealtype nrmfac; /* integrator -> LS norm conversion factor */ /* Linear solver, matrix and vector objects/pointers */ SUNLinearSolver LS; /* generic linear solver object */ @@ -143,19 +143,19 @@ typedef struct CVLsMemRec { int cvLsATimes(void* cvode_mem, N_Vector v, N_Vector z); int cvLsPSetup(void* cvode_mem); int cvLsPSolve(void* cvode_mem, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* Difference quotient approximation for Jac times vector */ -int cvLsDQJtimes(N_Vector v, N_Vector Jv, realtype t, +int cvLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *data, N_Vector work); /* Difference-quotient Jacobian approximation routines */ -int cvLsDQJac(realtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, +int cvLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void *data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int cvLsDenseDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1); -int cvLsBandDQJac(realtype t, N_Vector y, N_Vector fy, +int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, CVodeMem cv_mem, N_Vector tmp1, N_Vector tmp2); diff --git a/src/cvodes/cvodes_nls.c b/src/cvodes/cvodes_nls.c index 59b4ffdce2..97e798b10c 100644 --- a/src/cvodes/cvodes_nls.c +++ b/src/cvodes/cvodes_nls.c @@ -28,7 +28,7 @@ static int cvNlsFPFunction(N_Vector ycor, N_Vector res, void* cvode_mem); static int cvNlsLSetup(booleantype jbad, booleantype* jcur, void* cvode_mem); static int cvNlsLSolve(N_Vector delta, void* cvode_mem); static int cvNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* cvode_mem); + sunrealtype tol, N_Vector ewt, void* cvode_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -155,10 +155,10 @@ int CVodeSetNlsRhsFn(void *cvode_mem, CVRhsFn f) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int CVodeGetNonlinearSystemData(void *cvode_mem, realtype *tcur, +int CVodeGetNonlinearSystemData(void *cvode_mem, sunrealtype *tcur, N_Vector *ypred, N_Vector *yn, - N_Vector *fn, realtype *gamma, - realtype *rl1, N_Vector *zn1, + N_Vector *fn, sunrealtype *gamma, + sunrealtype *rl1, N_Vector *zn1, void **user_data) { CVodeMem cv_mem; @@ -289,12 +289,12 @@ static int cvNlsLSolve(N_Vector delta, void* cvode_mem) static int cvNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector delta, - realtype tol, N_Vector ewt, void* cvode_mem) + sunrealtype tol, N_Vector ewt, void* cvode_mem) { CVodeMem cv_mem; int m, retval; - realtype del; - realtype dcon; + sunrealtype del; + sunrealtype dcon; if (cvode_mem == NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODE", "cvNlsConvTest", MSGCV_NO_MEM); diff --git a/src/cvodes/cvodes_nls_sim.c b/src/cvodes/cvodes_nls_sim.c index b965df0d8a..dfdf38ee62 100644 --- a/src/cvodes/cvodes_nls_sim.c +++ b/src/cvodes/cvodes_nls_sim.c @@ -41,7 +41,7 @@ static int cvNlsLSetupSensSim(booleantype jbad, booleantype* jcur, static int cvNlsLSolveSensSim(N_Vector deltaSim, void* cvode_mem); static int cvNlsConvTestSensSim(SUNNonlinearSolver NLS, N_Vector ycorSim, N_Vector delSim, - realtype tol, N_Vector ewtSim, void* cvode_mem); + sunrealtype tol, N_Vector ewtSim, void* cvode_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -206,9 +206,9 @@ int CVodeSetNonlinearSolverSensSim(void *cvode_mem, SUNNonlinearSolver NLS) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int CVodeGetNonlinearSystemDataSens(void *cvode_mem, realtype *tcur, +int CVodeGetNonlinearSystemDataSens(void *cvode_mem, sunrealtype *tcur, N_Vector **ySpred, N_Vector **ySn, - realtype *gamma, realtype *rl1, + sunrealtype *gamma, sunrealtype *rl1, N_Vector **znS1, void **user_data) { CVodeMem cv_mem; @@ -362,12 +362,12 @@ static int cvNlsLSolveSensSim(N_Vector deltaSim, void* cvode_mem) static int cvNlsConvTestSensSim(SUNNonlinearSolver NLS, N_Vector ycorSim, N_Vector deltaSim, - realtype tol, N_Vector ewtSim, void* cvode_mem) + sunrealtype tol, N_Vector ewtSim, void* cvode_mem) { CVodeMem cv_mem; int m, retval; - realtype del, delS, Del; - realtype dcon; + sunrealtype del, delS, Del; + sunrealtype dcon; N_Vector ycor, delta, ewt; N_Vector *deltaS, *ewtS; @@ -442,7 +442,7 @@ static int cvNlsResidualSensSim(N_Vector ycorSim, N_Vector resSim, void* cvode_m int retval; N_Vector ycor, res; N_Vector *ycorS, *resS; - realtype cvals[3]; + sunrealtype cvals[3]; N_Vector* XXvecs[3]; if (cvode_mem == NULL) { diff --git a/src/cvodes/cvodes_nls_stg.c b/src/cvodes/cvodes_nls_stg.c index 8f3d7bf471..04ab9bb7e7 100644 --- a/src/cvodes/cvodes_nls_stg.c +++ b/src/cvodes/cvodes_nls_stg.c @@ -32,7 +32,7 @@ static int cvNlsLSetupSensStg(booleantype jbad, booleantype* jcur, static int cvNlsLSolveSensStg(N_Vector deltaStg, void* cvode_mem); static int cvNlsConvTestSensStg(SUNNonlinearSolver NLS, N_Vector ycorStg, N_Vector delStg, - realtype tol, N_Vector ewtStg, void* cvode_mem); + sunrealtype tol, N_Vector ewtStg, void* cvode_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -296,12 +296,12 @@ static int cvNlsLSolveSensStg(N_Vector deltaStg, void* cvode_mem) static int cvNlsConvTestSensStg(SUNNonlinearSolver NLS, N_Vector ycorStg, N_Vector deltaStg, - realtype tol, N_Vector ewtStg, void* cvode_mem) + sunrealtype tol, N_Vector ewtStg, void* cvode_mem) { CVodeMem cv_mem; int m, retval; - realtype Del; - realtype dcon; + sunrealtype Del; + sunrealtype dcon; N_Vector *ycorS, *deltaS, *ewtS; if (cvode_mem == NULL) { @@ -365,7 +365,7 @@ static int cvNlsResidualSensStg(N_Vector ycorStg, N_Vector resStg, void* cvode_m CVodeMem cv_mem; int retval; N_Vector *ycorS, *resS; - realtype cvals[3]; + sunrealtype cvals[3]; N_Vector* XXvecs[3]; if (cvode_mem == NULL) { diff --git a/src/cvodes/cvodes_nls_stg1.c b/src/cvodes/cvodes_nls_stg1.c index 5f00a00f99..ee31fd2b5b 100644 --- a/src/cvodes/cvodes_nls_stg1.c +++ b/src/cvodes/cvodes_nls_stg1.c @@ -31,7 +31,7 @@ static int cvNlsLSetupSensStg1(booleantype jbad, booleantype* jcur, static int cvNlsLSolveSensStg1(N_Vector delta, void* cvode_mem); static int cvNlsConvTestSensStg1(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* cvode_mem); + sunrealtype tol, N_Vector ewt, void* cvode_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -258,12 +258,12 @@ static int cvNlsLSolveSensStg1(N_Vector delta, void* cvode_mem) static int cvNlsConvTestSensStg1(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector delta, - realtype tol, N_Vector ewt, void* cvode_mem) + sunrealtype tol, N_Vector ewt, void* cvode_mem) { CVodeMem cv_mem; int m, retval; - realtype del; - realtype dcon; + sunrealtype del; + sunrealtype dcon; if (cvode_mem == NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", diff --git a/src/cvodes/cvodes_proj.c b/src/cvodes/cvodes_proj.c index b55310c3d4..2c8d8a23d6 100644 --- a/src/cvodes/cvodes_proj.c +++ b/src/cvodes/cvodes_proj.c @@ -183,7 +183,7 @@ int CVodeSetMaxNumProjFails(void *cvode_mem, int max_fails) } -int CVodeSetEpsProj(void *cvode_mem, realtype eps) +int CVodeSetEpsProj(void *cvode_mem, sunrealtype eps) { int retval; CVodeMem cv_mem; @@ -210,7 +210,7 @@ int CVodeSetEpsProj(void *cvode_mem, realtype eps) } -int CVodeSetProjFailEta(void *cvode_mem, realtype eta) +int CVodeSetProjFailEta(void *cvode_mem, sunrealtype eta) { int retval; CVodeMem cv_mem; @@ -292,7 +292,7 @@ int CVodeGetNumProjFails(void *cvode_mem, long int *npfails) * until it is potentially used in cvCompleteStep). */ -int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, realtype saved_t, +int cvDoProjection(CVodeMem cv_mem, int *nflagPtr, sunrealtype saved_t, int *npfailPtr) { int retval; diff --git a/src/cvodes/cvodes_proj_impl.h b/src/cvodes/cvodes_proj_impl.h index 6debbd5f7f..7de121a5ee 100644 --- a/src/cvodes/cvodes_proj_impl.h +++ b/src/cvodes/cvodes_proj_impl.h @@ -60,8 +60,8 @@ typedef struct CVodeProjMemRec { CVProjFn pfun; /* function to perform projection */ - realtype eps_proj; /* projection solve tolerance */ - realtype eta_pfail; /* projection failure step reduction factor */ + sunrealtype eps_proj; /* projection solve tolerance */ + sunrealtype eta_pfail; /* projection failure step reduction factor */ long int nproj; /* number of projections performed */ long int npfails; /* number of projection failures */ diff --git a/src/cvodes/fmod/fcvodes_mod.c b/src/cvodes/fmod/fcvodes_mod.c index 7c5b85e0af..2011945585 100644 --- a/src/cvodes/fmod/fcvodes_mod.c +++ b/src/cvodes/fmod/fcvodes_mod.c @@ -330,13 +330,13 @@ SWIGEXPORT int _wrap_FCVodeInit(void *farg1, CVRhsFn farg2, double const *farg3, int fresult ; void *arg1 = (void *) 0 ; CVRhsFn arg2 = (CVRhsFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (CVRhsFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeInit(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -347,12 +347,12 @@ SWIGEXPORT int _wrap_FCVodeInit(void *farg1, CVRhsFn farg2, double const *farg3, SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)CVodeReInit(arg1,arg2,arg3); fresult = (int)(result); @@ -363,13 +363,13 @@ SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector far SWIGEXPORT int _wrap_FCVodeSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -379,12 +379,12 @@ SWIGEXPORT int _wrap_FCVodeSStolerances(void *farg1, double const *farg2, double SWIGEXPORT int _wrap_FCVodeSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)CVodeSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -423,11 +423,11 @@ SWIGEXPORT int _wrap_FCVodeSetConstraints(void *farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxLSetup(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetDeltaGammaMaxLSetup(arg1,arg2); fresult = (int)(result); return fresult; @@ -467,11 +467,11 @@ SWIGEXPORT int _wrap_FCVodeSetErrHandlerFn(void *farg1, CVErrHandlerFn farg2, vo SWIGEXPORT int _wrap_FCVodeSetInitStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -579,11 +579,11 @@ SWIGEXPORT int _wrap_FCVodeSetMaxOrd(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeSetMaxStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetMaxStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -593,11 +593,11 @@ SWIGEXPORT int _wrap_FCVodeSetMaxStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetMinStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetMinStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -649,11 +649,11 @@ SWIGEXPORT int _wrap_FCVodeSetNlsRhsFn(void *farg1, CVRhsFn farg2) { SWIGEXPORT int _wrap_FCVodeSetNonlinConvCoef(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetNonlinConvCoef(arg1,arg2); fresult = (int)(result); return fresult; @@ -691,11 +691,11 @@ SWIGEXPORT int _wrap_FCVodeSetStabLimDet(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -745,13 +745,13 @@ SWIGEXPORT int _wrap_FCVodeSetUserData(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetEtaFixedStepBounds(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -761,11 +761,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaFixedStepBounds(void *farg1, double const *farg SWIGEXPORT int _wrap_FCVodeSetEtaMaxFirstStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMaxFirstStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -775,11 +775,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMaxFirstStep(void *farg1, double const *farg2) SWIGEXPORT int _wrap_FCVodeSetEtaMaxEarlyStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMaxEarlyStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -803,11 +803,11 @@ SWIGEXPORT int _wrap_FCVodeSetNumStepsEtaMaxEarlyStep(void *farg1, long const *f SWIGEXPORT int _wrap_FCVodeSetEtaMax(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMax(arg1,arg2); fresult = (int)(result); return fresult; @@ -817,11 +817,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMax(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaMin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMin(arg1,arg2); fresult = (int)(result); return fresult; @@ -831,11 +831,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaMinErrFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMinErrFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -845,11 +845,11 @@ SWIGEXPORT int _wrap_FCVodeSetEtaMinErrFail(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetEtaMaxErrFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaMaxErrFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -873,11 +873,11 @@ SWIGEXPORT int _wrap_FCVodeSetNumFailsEtaMaxErrFail(void *farg1, int const *farg SWIGEXPORT int _wrap_FCVodeSetEtaConvFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEtaConvFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -929,16 +929,16 @@ SWIGEXPORT int _wrap_FCVodeSetNoInactiveRootWarn(void *farg1) { SWIGEXPORT int _wrap_FCVode(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int arg5 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); arg5 = (int)(*farg5); result = (int)CVode(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -999,13 +999,13 @@ SWIGEXPORT int _wrap_FCVodeComputeStateSens1(void *farg1, int const *farg2, N_Ve SWIGEXPORT int _wrap_FCVodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeGetDky(arg1,arg2,arg3,arg4); @@ -1117,11 +1117,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentOrder(void *farg1, int *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentGamma(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetCurrentGamma(arg1,arg2); fresult = (int)(result); return fresult; @@ -1145,11 +1145,11 @@ SWIGEXPORT int _wrap_FCVodeGetNumStabLimOrderReds(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FCVodeGetActualInitStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetActualInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1159,11 +1159,11 @@ SWIGEXPORT int _wrap_FCVodeGetActualInitStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1173,11 +1173,11 @@ SWIGEXPORT int _wrap_FCVodeGetLastStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1229,11 +1229,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentSensSolveIndex(void *farg1, int *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1243,11 +1243,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentTime(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetTolScaleFactor(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)CVodeGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1319,10 +1319,10 @@ SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *fa long *arg5 = (long *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; - realtype *arg8 = (realtype *) 0 ; - realtype *arg9 = (realtype *) 0 ; - realtype *arg10 = (realtype *) 0 ; - realtype *arg11 = (realtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); @@ -1332,10 +1332,10 @@ SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *fa arg5 = (long *)(farg5); arg6 = (int *)(farg6); arg7 = (int *)(farg7); - arg8 = (realtype *)(farg8); - arg9 = (realtype *)(farg9); - arg10 = (realtype *)(farg10); - arg11 = (realtype *)(farg11); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); result = (int)CVodeGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); fresult = (int)(result); return fresult; @@ -1345,23 +1345,23 @@ SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *fa SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, double *farg7, void *farg8, void *farg9) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; - realtype *arg6 = (realtype *) 0 ; - realtype *arg7 = (realtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; N_Vector *arg8 = (N_Vector *) 0 ; void **arg9 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); - arg6 = (realtype *)(farg6); - arg7 = (realtype *)(farg7); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); arg8 = (N_Vector *)(farg8); arg9 = (void **)(farg9); result = (int)CVodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); @@ -1373,21 +1373,21 @@ SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemData(void *farg1, double *farg2, vo SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemDataSens(void *farg1, double *farg2, void *farg3, void *farg4, double *farg5, double *farg6, void *farg7, void *farg8) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector **arg3 = (N_Vector **) 0 ; N_Vector **arg4 = (N_Vector **) 0 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; N_Vector **arg7 = (N_Vector **) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector **)(farg3); arg4 = (N_Vector **)(farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); arg7 = (N_Vector **)(farg7); arg8 = (void **)(farg8); result = (int)CVodeGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); @@ -1552,13 +1552,13 @@ SWIGEXPORT int _wrap_FCVodeQuadReInit(void *farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FCVodeQuadSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeQuadSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1568,12 +1568,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSStolerances(void *farg1, double const *farg2, do SWIGEXPORT int _wrap_FCVodeQuadSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)CVodeQuadSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -1598,12 +1598,12 @@ SWIGEXPORT int _wrap_FCVodeSetQuadErrCon(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeGetQuad(void *farg1, double *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); result = (int)CVodeGetQuad(arg1,arg2,arg3); fresult = (int)(result); @@ -1614,13 +1614,13 @@ SWIGEXPORT int _wrap_FCVodeGetQuad(void *farg1, double *farg2, N_Vector farg3) { SWIGEXPORT int _wrap_FCVodeGetQuadDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeGetQuadDky(arg1,arg2,arg3,arg4); @@ -1754,13 +1754,13 @@ SWIGEXPORT int _wrap_FCVodeSensReInit(void *farg1, int const *farg2, void *farg3 SWIGEXPORT int _wrap_FCVodeSensSStolerances(void *farg1, double const *farg2, double *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); result = (int)CVodeSensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1770,12 +1770,12 @@ SWIGEXPORT int _wrap_FCVodeSensSStolerances(void *farg1, double const *farg2, do SWIGEXPORT int _wrap_FCVodeSensSVtolerances(void *farg1, double const *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)CVodeSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -1799,12 +1799,12 @@ SWIGEXPORT int _wrap_FCVodeSetSensDQMethod(void *farg1, int const *farg2, double int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetSensDQMethod(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1842,14 +1842,14 @@ SWIGEXPORT int _wrap_FCVodeSetSensMaxNonlinIters(void *farg1, int const *farg2) SWIGEXPORT int _wrap_FCVodeSetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int *arg4 = (int *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype *)(farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (int *)(farg4); result = (int)CVodeSetSensParams(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -1914,12 +1914,12 @@ SWIGEXPORT int _wrap_FCVodeSensToggleOff(void *farg1) { SWIGEXPORT int _wrap_FCVodeGetSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); result = (int)CVodeGetSens(arg1,arg2,arg3); fresult = (int)(result); @@ -1930,13 +1930,13 @@ SWIGEXPORT int _wrap_FCVodeGetSens(void *farg1, double *farg2, void *farg3) { SWIGEXPORT int _wrap_FCVodeGetSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeGetSens1(arg1,arg2,arg3,arg4); @@ -1948,13 +1948,13 @@ SWIGEXPORT int _wrap_FCVodeGetSens1(void *farg1, double *farg2, int const *farg3 SWIGEXPORT int _wrap_FCVodeGetSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector *)(farg4); result = (int)CVodeGetSensDky(arg1,arg2,arg3,arg4); @@ -1966,14 +1966,14 @@ SWIGEXPORT int _wrap_FCVodeGetSensDky(void *farg1, double const *farg2, int cons SWIGEXPORT int _wrap_FCVodeGetSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; int arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (N_Vector)(farg5); @@ -2230,13 +2230,13 @@ SWIGEXPORT int _wrap_FCVodeQuadSensReInit(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FCVodeQuadSensSStolerances(void *farg1, double const *farg2, double *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); result = (int)CVodeQuadSensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2246,12 +2246,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSensSStolerances(void *farg1, double const *farg2 SWIGEXPORT int _wrap_FCVodeQuadSensSVtolerances(void *farg1, double const *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)CVodeQuadSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -2288,12 +2288,12 @@ SWIGEXPORT int _wrap_FCVodeSetQuadSensErrCon(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeGetQuadSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); result = (int)CVodeGetQuadSens(arg1,arg2,arg3); fresult = (int)(result); @@ -2304,13 +2304,13 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSens(void *farg1, double *farg2, void *farg3) SWIGEXPORT int _wrap_FCVodeGetQuadSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeGetQuadSens1(arg1,arg2,arg3,arg4); @@ -2322,13 +2322,13 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSens1(void *farg1, double *farg2, int const *f SWIGEXPORT int _wrap_FCVodeGetQuadSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector *)(farg4); result = (int)CVodeGetQuadSensDky(arg1,arg2,arg3,arg4); @@ -2340,14 +2340,14 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSensDky(void *farg1, double const *farg2, int SWIGEXPORT int _wrap_FCVodeGetQuadSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; int arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (N_Vector)(farg5); @@ -2480,14 +2480,14 @@ SWIGEXPORT int _wrap_FCVodeInitB(void *farg1, int const *farg2, CVRhsFnB farg3, void *arg1 = (void *) 0 ; int arg2 ; CVRhsFnB arg3 = (CVRhsFnB) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (CVRhsFnB)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector)(farg5); result = (int)CVodeInitB(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -2500,14 +2500,14 @@ SWIGEXPORT int _wrap_FCVodeInitBS(void *farg1, int const *farg2, CVRhsFnBS farg3 void *arg1 = (void *) 0 ; int arg2 ; CVRhsFnBS arg3 = (CVRhsFnBS) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (CVRhsFnBS)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector)(farg5); result = (int)CVodeInitBS(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); @@ -2519,13 +2519,13 @@ SWIGEXPORT int _wrap_FCVodeReInitB(void *farg1, int const *farg2, double const * int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeReInitB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2537,14 +2537,14 @@ SWIGEXPORT int _wrap_FCVodeSStolerancesB(void *farg1, int const *farg2, double c int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; - realtype arg4 ; + sunrealtype arg3 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); - arg4 = (realtype)(*farg4); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); result = (int)CVodeSStolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2555,13 +2555,13 @@ SWIGEXPORT int _wrap_FCVodeSVtolerancesB(void *farg1, int const *farg2, double c int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeSVtolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2625,14 +2625,14 @@ SWIGEXPORT int _wrap_FCVodeQuadSStolerancesB(void *farg1, int const *farg2, doub int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; - realtype arg4 ; + sunrealtype arg3 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); - arg4 = (realtype)(*farg4); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); result = (int)CVodeQuadSStolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2643,13 +2643,13 @@ SWIGEXPORT int _wrap_FCVodeQuadSVtolerancesB(void *farg1, int const *farg2, doub int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeQuadSVtolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2660,17 +2660,17 @@ SWIGEXPORT int _wrap_FCVodeQuadSVtolerancesB(void *farg1, int const *farg2, doub SWIGEXPORT int _wrap_FCVodeF(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5, int *farg6) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int arg5 ; int *arg6 = (int *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); arg5 = (int)(*farg5); arg6 = (int *)(farg6); result = (int)CVodeF(arg1,arg2,arg3,arg4,arg5,arg6); @@ -2682,12 +2682,12 @@ SWIGEXPORT int _wrap_FCVodeF(void *farg1, double const *farg2, N_Vector farg3, d SWIGEXPORT int _wrap_FCVodeB(void *farg1, double const *farg2, int const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); result = (int)CVodeB(arg1,arg2,arg3); fresult = (int)(result); @@ -2775,12 +2775,12 @@ SWIGEXPORT int _wrap_FCVodeSetInitStepB(void *farg1, int const *farg2, double co int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetInitStepB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2791,12 +2791,12 @@ SWIGEXPORT int _wrap_FCVodeSetMinStepB(void *farg1, int const *farg2, double con int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetMinStepB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2807,12 +2807,12 @@ SWIGEXPORT int _wrap_FCVodeSetMaxStepB(void *farg1, int const *farg2, double con int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetMaxStepB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2871,13 +2871,13 @@ SWIGEXPORT int _wrap_FCVodeGetB(void *farg1, int const *farg2, double *farg3, N_ int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeGetB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2889,13 +2889,13 @@ SWIGEXPORT int _wrap_FCVodeGetQuadB(void *farg1, int const *farg2, double *farg3 int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); result = (int)CVodeGetQuadB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2920,12 +2920,12 @@ SWIGEXPORT void * _wrap_FCVodeGetAdjCVodeBmem(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FCVodeGetAdjY(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)CVodeGetAdjY(arg1,arg2,arg3); fresult = (int)(result); @@ -2983,11 +2983,11 @@ SWIGEXPORT void * _wrap_CVadjCheckPointRec_next_addr_get(SwigClassWrapper const SWIGEXPORT void _wrap_CVadjCheckPointRec_t0_set(SwigClassWrapper const *farg1, double const *farg2) { CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t0", return ); arg1 = (CVadjCheckPointRec *)(farg1->cptr); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); if (arg1) (arg1)->t0 = arg2; } @@ -2995,23 +2995,23 @@ SWIGEXPORT void _wrap_CVadjCheckPointRec_t0_set(SwigClassWrapper const *farg1, d SWIGEXPORT double _wrap_CVadjCheckPointRec_t0_get(SwigClassWrapper const *farg1) { double fresult ; CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; - realtype result; + sunrealtype result; SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t0", return 0); arg1 = (CVadjCheckPointRec *)(farg1->cptr); - result = (realtype) ((arg1)->t0); - fresult = (realtype)(result); + result = (sunrealtype) ((arg1)->t0); + fresult = (sunrealtype)(result); return fresult; } SWIGEXPORT void _wrap_CVadjCheckPointRec_t1_set(SwigClassWrapper const *farg1, double const *farg2) { CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t1", return ); arg1 = (CVadjCheckPointRec *)(farg1->cptr); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); if (arg1) (arg1)->t1 = arg2; } @@ -3019,12 +3019,12 @@ SWIGEXPORT void _wrap_CVadjCheckPointRec_t1_set(SwigClassWrapper const *farg1, d SWIGEXPORT double _wrap_CVadjCheckPointRec_t1_get(SwigClassWrapper const *farg1) { double fresult ; CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; - realtype result; + sunrealtype result; SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t1", return 0); arg1 = (CVadjCheckPointRec *)(farg1->cptr); - result = (realtype) ((arg1)->t1); - fresult = (realtype)(result); + result = (sunrealtype) ((arg1)->t1); + fresult = (sunrealtype)(result); return fresult; } @@ -3079,11 +3079,11 @@ SWIGEXPORT int _wrap_CVadjCheckPointRec_order_get(SwigClassWrapper const *farg1) SWIGEXPORT void _wrap_CVadjCheckPointRec_step_set(SwigClassWrapper const *farg1, double const *farg2) { CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::step", return ); arg1 = (CVadjCheckPointRec *)(farg1->cptr); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); if (arg1) (arg1)->step = arg2; } @@ -3091,12 +3091,12 @@ SWIGEXPORT void _wrap_CVadjCheckPointRec_step_set(SwigClassWrapper const *farg1, SWIGEXPORT double _wrap_CVadjCheckPointRec_step_get(SwigClassWrapper const *farg1) { double fresult ; CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; - realtype result; + sunrealtype result; SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::step", return 0); arg1 = (CVadjCheckPointRec *)(farg1->cptr); - result = (realtype) ((arg1)->step); - fresult = (realtype)(result); + result = (sunrealtype) ((arg1)->step); + fresult = (sunrealtype)(result); return fresult; } @@ -3167,14 +3167,14 @@ SWIGEXPORT int _wrap_FCVodeGetAdjDataPointHermite(void *farg1, int const *farg2, int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); result = (int)CVodeGetAdjDataPointHermite(arg1,arg2,arg3,arg4,arg5); @@ -3187,14 +3187,14 @@ SWIGEXPORT int _wrap_FCVodeGetAdjDataPointPolynomial(void *farg1, int const *far int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int *arg4 = (int *) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (int *)(farg4); arg5 = (N_Vector)(farg5); result = (int)CVodeGetAdjDataPointPolynomial(arg1,arg2,arg3,arg4,arg5); @@ -3293,7 +3293,7 @@ SWIGEXPORT int _wrap_FCVBBDPrecInit(void *farg1, int64_t const *farg2, int64_t c sunindextype arg4 ; sunindextype arg5 ; sunindextype arg6 ; - realtype arg7 ; + sunrealtype arg7 ; CVLocalFn arg8 = (CVLocalFn) 0 ; CVCommFn arg9 = (CVCommFn) 0 ; int result; @@ -3304,7 +3304,7 @@ SWIGEXPORT int _wrap_FCVBBDPrecInit(void *farg1, int64_t const *farg2, int64_t c arg4 = (sunindextype)(*farg4); arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); - arg7 = (realtype)(*farg7); + arg7 = (sunrealtype)(*farg7); arg8 = (CVLocalFn)(farg8); arg9 = (CVCommFn)(farg9); result = (int)CVBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); @@ -3318,13 +3318,13 @@ SWIGEXPORT int _wrap_FCVBBDPrecReInit(void *farg1, int64_t const *farg2, int64_t void *arg1 = (void *) 0 ; sunindextype arg2 ; sunindextype arg3 ; - realtype arg4 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (sunindextype)(*farg2); arg3 = (sunindextype)(*farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); result = (int)CVBBDPrecReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -3370,7 +3370,7 @@ SWIGEXPORT int _wrap_FCVBBDPrecInitB(void *farg1, int const *farg2, int64_t cons sunindextype arg5 ; sunindextype arg6 ; sunindextype arg7 ; - realtype arg8 ; + sunrealtype arg8 ; CVLocalFnB arg9 = (CVLocalFnB) 0 ; CVCommFnB arg10 = (CVCommFnB) 0 ; int result; @@ -3382,7 +3382,7 @@ SWIGEXPORT int _wrap_FCVBBDPrecInitB(void *farg1, int const *farg2, int64_t cons arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); arg7 = (sunindextype)(*farg7); - arg8 = (realtype)(*farg8); + arg8 = (sunrealtype)(*farg8); arg9 = (CVLocalFnB)(farg9); arg10 = (CVCommFnB)(farg10); result = (int)CVBBDPrecInitB(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); @@ -3397,14 +3397,14 @@ SWIGEXPORT int _wrap_FCVBBDPrecReInitB(void *farg1, int const *farg2, int64_t co int arg2 ; sunindextype arg3 ; sunindextype arg4 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (sunindextype)(*farg3); arg4 = (sunindextype)(*farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)CVBBDPrecReInitB(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -3555,11 +3555,11 @@ SWIGEXPORT int _wrap_FCVodeSetLinearSolutionScaling(void *farg1, int const *farg SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxBadJac(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetDeltaGammaMaxBadJac(arg1,arg2); fresult = (int)(result); return fresult; @@ -3569,11 +3569,11 @@ SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxBadJac(void *farg1, double const *far SWIGEXPORT int _wrap_FCVodeSetEpsLin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetEpsLin(arg1,arg2); fresult = (int)(result); return fresult; @@ -3583,11 +3583,11 @@ SWIGEXPORT int _wrap_FCVodeSetEpsLin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FCVodeSetLSNormFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)CVodeSetLSNormFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -3919,12 +3919,12 @@ SWIGEXPORT int _wrap_FCVodeSetEpsLinB(void *farg1, int const *farg2, double cons int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetEpsLinB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -3935,12 +3935,12 @@ SWIGEXPORT int _wrap_FCVodeSetLSNormFactorB(void *farg1, int const *farg2, doubl int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)CVodeSetLSNormFactorB(arg1,arg2,arg3); fresult = (int)(result); return fresult; diff --git a/src/ida/fmod/fida_mod.c b/src/ida/fmod/fida_mod.c index 4712e19298..a9fb0ea73c 100644 --- a/src/ida/fmod/fida_mod.c +++ b/src/ida/fmod/fida_mod.c @@ -251,14 +251,14 @@ SWIGEXPORT int _wrap_FIDAInit(void *farg1, IDAResFn farg2, double const *farg3, int fresult ; void *arg1 = (void *) 0 ; IDAResFn arg2 = (IDAResFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (IDAResFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); result = (int)IDAInit(arg1,arg2,arg3,arg4,arg5); @@ -270,13 +270,13 @@ SWIGEXPORT int _wrap_FIDAInit(void *farg1, IDAResFn farg2, double const *farg3, SWIGEXPORT int _wrap_FIDAReInit(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); result = (int)IDAReInit(arg1,arg2,arg3,arg4); @@ -288,13 +288,13 @@ SWIGEXPORT int _wrap_FIDAReInit(void *farg1, double const *farg2, N_Vector farg3 SWIGEXPORT int _wrap_FIDASStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)IDASStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -304,12 +304,12 @@ SWIGEXPORT int _wrap_FIDASStolerances(void *farg1, double const *farg2, double c SWIGEXPORT int _wrap_FIDASVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)IDASVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -335,12 +335,12 @@ SWIGEXPORT int _wrap_FIDACalcIC(void *farg1, int const *farg2, double const *far int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDACalcIC(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -350,11 +350,11 @@ SWIGEXPORT int _wrap_FIDACalcIC(void *farg1, int const *farg2, double const *far SWIGEXPORT int _wrap_FIDASetNonlinConvCoefIC(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetNonlinConvCoefIC(arg1,arg2); fresult = (int)(result); return fresult; @@ -420,11 +420,11 @@ SWIGEXPORT int _wrap_FIDASetLineSearchOffIC(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDASetStepToleranceIC(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetStepToleranceIC(arg1,arg2); fresult = (int)(result); return fresult; @@ -448,11 +448,11 @@ SWIGEXPORT int _wrap_FIDASetMaxBacksIC(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDASetDeltaCjLSetup(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetDeltaCjLSetup(arg1,arg2); fresult = (int)(result); return fresult; @@ -534,11 +534,11 @@ SWIGEXPORT int _wrap_FIDASetMaxNumSteps(void *farg1, long const *farg2) { SWIGEXPORT int _wrap_FIDASetInitStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -548,11 +548,11 @@ SWIGEXPORT int _wrap_FIDASetInitStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetMaxStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetMaxStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -562,11 +562,11 @@ SWIGEXPORT int _wrap_FIDASetMaxStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetMinStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetMinStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -576,11 +576,11 @@ SWIGEXPORT int _wrap_FIDASetMinStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -658,13 +658,13 @@ SWIGEXPORT int _wrap_FIDASetConstraints(void *farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FIDASetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetEtaFixedStepBounds(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -674,11 +674,11 @@ SWIGEXPORT int _wrap_FIDASetEtaFixedStepBounds(void *farg1, double const *farg2, SWIGEXPORT int _wrap_FIDASetEtaMin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaMin(arg1,arg2); fresult = (int)(result); return fresult; @@ -688,11 +688,11 @@ SWIGEXPORT int _wrap_FIDASetEtaMin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaMax(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaMax(arg1,arg2); fresult = (int)(result); return fresult; @@ -702,11 +702,11 @@ SWIGEXPORT int _wrap_FIDASetEtaMax(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaLow(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaLow(arg1,arg2); fresult = (int)(result); return fresult; @@ -716,11 +716,11 @@ SWIGEXPORT int _wrap_FIDASetEtaLow(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaMinErrFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaMinErrFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -730,11 +730,11 @@ SWIGEXPORT int _wrap_FIDASetEtaMinErrFail(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaConvFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaConvFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -786,11 +786,11 @@ SWIGEXPORT int _wrap_FIDASetNlsResFn(void *farg1, IDAResFn farg2) { SWIGEXPORT int _wrap_FIDASetNonlinConvCoef(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetNonlinConvCoef(arg1,arg2); fresult = (int)(result); return fresult; @@ -856,16 +856,16 @@ SWIGEXPORT int _wrap_FIDASetNoInactiveRootWarn(void *farg1) { SWIGEXPORT int _wrap_FIDASolve(void *farg1, double const *farg2, double *farg3, N_Vector farg4, N_Vector farg5, int const *farg6) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int arg6 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); arg6 = (int)(*farg6); @@ -910,13 +910,13 @@ SWIGEXPORT int _wrap_FIDAComputeYp(void *farg1, N_Vector farg2, N_Vector farg3) SWIGEXPORT int _wrap_FIDAGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)IDAGetDky(arg1,arg2,arg3,arg4); @@ -1058,11 +1058,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentOrder(void *farg1, int *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentCj(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetCurrentCj(arg1,arg2); fresult = (int)(result); return fresult; @@ -1100,11 +1100,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentYp(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FIDAGetActualInitStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetActualInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1114,11 +1114,11 @@ SWIGEXPORT int _wrap_FIDAGetActualInitStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1128,11 +1128,11 @@ SWIGEXPORT int _wrap_FIDAGetLastStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1142,11 +1142,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1156,11 +1156,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentTime(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetTolScaleFactor(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1232,10 +1232,10 @@ SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg long *arg5 = (long *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; - realtype *arg8 = (realtype *) 0 ; - realtype *arg9 = (realtype *) 0 ; - realtype *arg10 = (realtype *) 0 ; - realtype *arg11 = (realtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); @@ -1245,10 +1245,10 @@ SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg arg5 = (long *)(farg5); arg6 = (int *)(farg6); arg7 = (int *)(farg7); - arg8 = (realtype *)(farg8); - arg9 = (realtype *)(farg9); - arg10 = (realtype *)(farg10); - arg11 = (realtype *)(farg11); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); result = (int)IDAGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); fresult = (int)(result); return fresult; @@ -1258,24 +1258,24 @@ SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg SWIGEXPORT int _wrap_FIDAGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, void *farg6, void *farg7, double *farg8, void *farg9) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; N_Vector *arg6 = (N_Vector *) 0 ; N_Vector *arg7 = (N_Vector *) 0 ; - realtype *arg8 = (realtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; void **arg9 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); arg6 = (N_Vector *)(farg6); arg7 = (N_Vector *)(farg7); - arg8 = (realtype *)(farg8); + arg8 = (sunrealtype *)(farg8); arg9 = (void **)(farg9); result = (int)IDAGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); fresult = (int)(result); @@ -1414,7 +1414,7 @@ SWIGEXPORT int _wrap_FIDABBDPrecInit(void *farg1, int64_t const *farg2, int64_t sunindextype arg4 ; sunindextype arg5 ; sunindextype arg6 ; - realtype arg7 ; + sunrealtype arg7 ; IDABBDLocalFn arg8 = (IDABBDLocalFn) 0 ; IDABBDCommFn arg9 = (IDABBDCommFn) 0 ; int result; @@ -1425,7 +1425,7 @@ SWIGEXPORT int _wrap_FIDABBDPrecInit(void *farg1, int64_t const *farg2, int64_t arg4 = (sunindextype)(*farg4); arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); - arg7 = (realtype)(*farg7); + arg7 = (sunrealtype)(*farg7); arg8 = (IDABBDLocalFn)(farg8); arg9 = (IDABBDCommFn)(farg9); result = (int)IDABBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); @@ -1439,13 +1439,13 @@ SWIGEXPORT int _wrap_FIDABBDPrecReInit(void *farg1, int64_t const *farg2, int64_ void *arg1 = (void *) 0 ; sunindextype arg2 ; sunindextype arg3 ; - realtype arg4 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (sunindextype)(*farg2); arg3 = (sunindextype)(*farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); result = (int)IDABBDPrecReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1547,11 +1547,11 @@ SWIGEXPORT int _wrap_FIDASetJacTimes(void *farg1, IDALsJacTimesSetupFn farg2, ID SWIGEXPORT int _wrap_FIDASetEpsLin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEpsLin(arg1,arg2); fresult = (int)(result); return fresult; @@ -1561,11 +1561,11 @@ SWIGEXPORT int _wrap_FIDASetEpsLin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetLSNormFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetLSNormFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1589,11 +1589,11 @@ SWIGEXPORT int _wrap_FIDASetLinearSolutionScaling(void *farg1, int const *farg2) SWIGEXPORT int _wrap_FIDASetIncrementFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetIncrementFactor(arg1,arg2); fresult = (int)(result); return fresult; diff --git a/src/ida/ida.c b/src/ida/ida.c index 2250bd6937..b96631fb77 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -203,7 +203,7 @@ static int IDAStep(IDAMem IDA_mem); /* Function called at beginning of step */ -static void IDASetCoeffs(IDAMem IDA_mem, realtype *ck); +static void IDASetCoeffs(IDAMem IDA_mem, sunrealtype *ck); /* Nonlinear solver functions */ @@ -212,29 +212,29 @@ static int IDANls(IDAMem IDA_mem); /* Error test */ -static int IDATestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1); +static int IDATestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1); /* Handling of convergence and/or error test failures */ -static void IDARestore(IDAMem IDA_mem, realtype saved_t); -static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, realtype err_k, realtype err_km1, +static void IDARestore(IDAMem IDA_mem, sunrealtype saved_t); +static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, sunrealtype err_km1, long int *ncfnPtr, int *ncfPtr, long int *netfPtr, int *nefPtr); static void IDAReset(IDAMem IDA_mem); /* Function called after a successful step */ -static void IDACompleteStep(IDAMem IDA_mem, realtype err_k, realtype err_km1); +static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_km1); /* Function called to evaluate the solutions y(t) and y'(t) at t */ -int IDAGetSolution(void *ida_mem, realtype t, N_Vector yret, N_Vector ypret); +int IDAGetSolution(void *ida_mem, sunrealtype t, N_Vector yret, N_Vector ypret); /* Stopping tests and failure handling */ -static int IDAStopTest1(IDAMem IDA_mem, realtype tout,realtype *tret, +static int IDAStopTest1(IDAMem IDA_mem, sunrealtype tout,sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask); -static int IDAStopTest2(IDAMem IDA_mem, realtype tout, realtype *tret, +static int IDAStopTest2(IDAMem IDA_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask); static int IDAHandleFailure(IDAMem IDA_mem, int sflag); @@ -371,7 +371,7 @@ void *IDACreate(SUNContext sunctx) */ int IDAInit(void *ida_mem, IDAResFn res, - realtype t0, N_Vector yy0, N_Vector yp0) + sunrealtype t0, N_Vector yy0, N_Vector yp0) { int retval; IDAMem IDA_mem; @@ -548,7 +548,7 @@ int IDAInit(void *ida_mem, IDAResFn res, */ int IDAReInit(void *ida_mem, - realtype t0, N_Vector yy0, N_Vector yp0) + sunrealtype t0, N_Vector yy0, N_Vector yp0) { IDAMem IDA_mem; @@ -639,7 +639,7 @@ int IDAReInit(void *ida_mem, * which will be called to set the error weight vector. */ -int IDASStolerances(void *ida_mem, realtype reltol, realtype abstol) +int IDASStolerances(void *ida_mem, sunrealtype reltol, sunrealtype abstol) { IDAMem IDA_mem; @@ -682,10 +682,10 @@ int IDASStolerances(void *ida_mem, realtype reltol, realtype abstol) } -int IDASVtolerances(void *ida_mem, realtype reltol, N_Vector abstol) +int IDASVtolerances(void *ida_mem, sunrealtype reltol, N_Vector abstol) { IDAMem IDA_mem; - realtype atolmin; + sunrealtype atolmin; if (ida_mem==NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDA", "IDASVtolerances", MSG_NO_MEM); @@ -859,7 +859,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) /* Allocate necessary memory and return */ IDA_mem->ida_glo = NULL; - IDA_mem->ida_glo = (realtype *) malloc(nrt*sizeof(realtype)); + IDA_mem->ida_glo = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (IDA_mem->ida_glo == NULL) { IDAProcessError(IDA_mem, IDA_MEM_FAIL, "IDA", "IDARootInit", MSG_MEM_FAIL); SUNDIALS_MARK_FUNCTION_END(IDA_PROFILER); @@ -867,7 +867,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) } IDA_mem->ida_ghi = NULL; - IDA_mem->ida_ghi = (realtype *) malloc(nrt*sizeof(realtype)); + IDA_mem->ida_ghi = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (IDA_mem->ida_ghi == NULL) { free(IDA_mem->ida_glo); IDA_mem->ida_glo = NULL; IDAProcessError(IDA_mem, IDA_MEM_FAIL, "IDA", "IDARootInit", MSG_MEM_FAIL); @@ -876,7 +876,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) } IDA_mem->ida_grout = NULL; - IDA_mem->ida_grout = (realtype *) malloc(nrt*sizeof(realtype)); + IDA_mem->ida_grout = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (IDA_mem->ida_grout == NULL) { free(IDA_mem->ida_glo); IDA_mem->ida_glo = NULL; free(IDA_mem->ida_ghi); IDA_mem->ida_ghi = NULL; @@ -979,12 +979,12 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) * IDA_RES_FAIL */ -int IDASolve(void *ida_mem, realtype tout, realtype *tret, +int IDASolve(void *ida_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask) { long int nstloc; int sflag, istate, ier, irfndp, ir; - realtype tdist, troundoff, ypnorm, rh, nrm; + sunrealtype tdist, troundoff, ypnorm, rh, nrm; IDAMem IDA_mem; booleantype inactive_roots; @@ -1358,13 +1358,13 @@ int IDASolve(void *ida_mem, realtype tout, realtype *tret, * */ -int IDAGetDky(void *ida_mem, realtype t, int k, N_Vector dky) +int IDAGetDky(void *ida_mem, sunrealtype t, int k, N_Vector dky) { IDAMem IDA_mem; - realtype tfuzz, tp, delt, psij_1; + sunrealtype tfuzz, tp, delt, psij_1; int i, j, retval; - realtype cjk [MXORDP1]; - realtype cjk_1[MXORDP1]; + sunrealtype cjk [MXORDP1]; + sunrealtype cjk_1[MXORDP1]; /* Check ida_mem */ if (ida_mem == NULL) { @@ -1971,11 +1971,11 @@ static int IDAEwtSetSV(IDAMem IDA_mem, N_Vector ycur, N_Vector weight) * the next step to reach tstop exactly. */ -static int IDAStopTest1(IDAMem IDA_mem, realtype tout, realtype *tret, +static int IDAStopTest1(IDAMem IDA_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask) { int ier; - realtype troundoff; + sunrealtype troundoff; if (IDA_mem->ida_tstopset) { @@ -2073,11 +2073,11 @@ static int IDAStopTest1(IDAMem IDA_mem, realtype tout, realtype *tret, * because the same test was made prior to the step. */ -static int IDAStopTest2(IDAMem IDA_mem, realtype tout, realtype *tret, +static int IDAStopTest2(IDAMem IDA_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask) { /* int ier; */ - realtype troundoff; + sunrealtype troundoff; if (IDA_mem->ida_tstopset) { @@ -2264,8 +2264,8 @@ static int IDAHandleFailure(IDAMem IDA_mem, int sflag) static int IDAStep(IDAMem IDA_mem) { - realtype saved_t, ck; - realtype err_k, err_km1; + sunrealtype saved_t, ck; + sunrealtype err_k, err_km1; int ncf, nef; int nflag, kflag; @@ -2383,10 +2383,10 @@ static int IDAStep(IDAMem IDA_mem) * Also, IDACompleteStep prohibits an order increase until ns = k + 2. */ -static void IDASetCoeffs(IDAMem IDA_mem, realtype *ck) +static void IDASetCoeffs(IDAMem IDA_mem, sunrealtype *ck) { int i; - realtype temp1, temp2, alpha0, alphas; + sunrealtype temp1, temp2, alpha0, alphas; /* Set coefficients for the current stepsize h */ @@ -2470,7 +2470,7 @@ static int IDANls(IDAMem IDA_mem) { int retval; booleantype constraintsPassed, callLSetup; - realtype temp1, temp2, vnorm; + sunrealtype temp1, temp2, vnorm; N_Vector mm, tmp; long int nni_inc = 0; long int nnf_inc = 0; @@ -2619,12 +2619,12 @@ static void IDAPredict(IDAMem IDA_mem) * IDATestError returns either IDA_SUCCESS or ERROR_TEST_FAIL. */ -static int IDATestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1) +static int IDATestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1) { - realtype err_km2; /* estimated error at k-2 */ - realtype enorm_k, enorm_km1, enorm_km2; /* error norms */ - realtype terr_k, terr_km1, terr_km2; /* local truncation error norms */ + sunrealtype err_km2; /* estimated error at k-2 */ + sunrealtype enorm_k, enorm_km1, enorm_km2; /* error norms */ + sunrealtype terr_k, terr_km1, terr_km2; /* local truncation error norms */ /* Compute error for order k. */ enorm_k = IDAWrmsNorm(IDA_mem, IDA_mem->ida_ee, IDA_mem->ida_ewt, IDA_mem->ida_suppressalg); @@ -2709,7 +2709,7 @@ static int IDATestError(IDAMem IDA_mem, realtype ck, * It changes back phi-star to phi (changed in IDASetCoeffs) */ -static void IDARestore(IDAMem IDA_mem, realtype saved_t) +static void IDARestore(IDAMem IDA_mem, sunrealtype saved_t) { int j; @@ -2774,10 +2774,10 @@ static void IDARestore(IDAMem IDA_mem, realtype saved_t) * IDA_LSOLVE_FAIL */ -static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, realtype err_k, realtype err_km1, +static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, sunrealtype err_km1, long int *ncfnPtr, int *ncfPtr, long int *netfPtr, int *nefPtr) { - realtype err_knew; + sunrealtype err_knew; IDA_mem->ida_phase = 1; @@ -2927,12 +2927,12 @@ static void IDAReset(IDAMem IDA_mem) * stepsize and order for the next step, and updates the phi array. */ -static void IDACompleteStep(IDAMem IDA_mem, realtype err_k, realtype err_km1) +static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_km1) { int j, kdiff, action; - realtype terr_k, terr_km1, terr_kp1; - realtype err_knew, err_kp1; - realtype enorm, tmp, hnew; + sunrealtype terr_k, terr_km1, terr_kp1; + sunrealtype err_knew, err_kp1; + sunrealtype enorm, tmp, hnew; IDA_mem->ida_nst++; kdiff = IDA_mem->ida_kk - IDA_mem->ida_kused; @@ -3132,10 +3132,10 @@ static void IDACompleteStep(IDAMem IDA_mem, realtype err_k, realtype err_km1) * IDA_BAD_T if t is not within the interval of the last step taken. */ -int IDAGetSolution(void *ida_mem, realtype t, N_Vector yret, N_Vector ypret) +int IDAGetSolution(void *ida_mem, sunrealtype t, N_Vector yret, N_Vector ypret) { IDAMem IDA_mem; - realtype tfuzz, tp, delt, c, d, gam; + sunrealtype tfuzz, tp, delt, c, d, gam; int j, kord, retval; if (ida_mem == NULL) { @@ -3206,10 +3206,10 @@ int IDAGetSolution(void *ida_mem, realtype t, N_Vector yret, N_Vector ypret) * mask = suppressalg otherwise. */ -realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, +sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, booleantype mask) { - realtype nrm; + sunrealtype nrm; if (mask) nrm = N_VWrmsNormMask(x, w, IDA_mem->ida_id); else nrm = N_VWrmsNorm(x, w); @@ -3238,7 +3238,7 @@ realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, static int IDARcheck1(IDAMem IDA_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; for (i = 0; i < IDA_mem->ida_nrtfn; i++) @@ -3307,7 +3307,7 @@ static int IDARcheck1(IDAMem IDA_mem) static int IDARcheck2(IDAMem IDA_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; if (IDA_mem->ida_irfnd == 0) return(IDA_SUCCESS); @@ -3502,7 +3502,7 @@ static int IDARcheck3(IDAMem IDA_mem) static int IDARootfind(IDAMem IDA_mem) { - realtype alph, tmid, gfrac, maxfrac, fracint, fracsub; + sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; booleantype zroot, sgnchg; diff --git a/src/ida/ida_bbdpre.c b/src/ida/ida_bbdpre.c index 510a2c4740..1a2c07ffe3 100644 --- a/src/ida/ida_bbdpre.c +++ b/src/ida/ida_bbdpre.c @@ -39,17 +39,17 @@ #define TWO RCONST(2.0) /* Prototypes of functions IDABBDPrecSetup and IDABBDPrecSolve */ -static int IDABBDPrecSetup(realtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, realtype c_j, void *prec_data); -static int IDABBDPrecSolve(realtype tt, N_Vector yy, N_Vector yp, +static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, + N_Vector rr, sunrealtype c_j, void *prec_data); +static int IDABBDPrecSolve(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data); + sunrealtype c_j, sunrealtype delta, void *prec_data); /* Prototype for IDABBDPrecFree */ static int IDABBDPrecFree(IDAMem ida_mem); /* Prototype for difference quotient Jacobian calculation routine */ -static int IBBDDQJac(IBBDPrecData pdata, realtype tt, realtype cj, +static int IBBDDQJac(IBBDPrecData pdata, sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector gref, N_Vector ytemp, N_Vector yptemp, N_Vector gtemp); @@ -59,7 +59,7 @@ static int IBBDDQJac(IBBDPrecData pdata, realtype tt, realtype cj, int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dq_rel_yy, + sunrealtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm) { IDAMem IDA_mem; @@ -282,7 +282,7 @@ int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, /*-------------------------------------------------------------*/ int IDABBDPrecReInit(void *ida_mem, sunindextype mudq, - sunindextype mldq, realtype dq_rel_yy) + sunindextype mldq, sunrealtype dq_rel_yy) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -433,8 +433,8 @@ int IDABBDPrecGetNumGfnEvals(void *ida_mem, > 0 for a recoverable error (step will be retried), or < 0 for a nonrecoverable error (step fails). ----------------------------------------------------------------*/ -static int IDABBDPrecSetup(realtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, realtype c_j, void *bbd_data) +static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, + N_Vector rr, sunrealtype c_j, void *bbd_data) { IBBDPrecData pdata; IDAMem IDA_mem; @@ -483,9 +483,9 @@ static int IDABBDPrecSetup(realtype tt, N_Vector yy, N_Vector yp, IDABBDPrecSolve returns the value returned from the linear solver object. ---------------------------------------------------------------*/ -static int IDABBDPrecSolve(realtype tt, N_Vector yy, N_Vector yp, +static int IDABBDPrecSolve(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *bbd_data) + sunrealtype c_j, sunrealtype delta, void *bbd_data) { IBBDPrecData pdata; int retval; @@ -554,17 +554,17 @@ static int IDABBDPrecFree(IDAMem IDA_mem) Return values are: 0 (success), > 0 (recoverable error), or < 0 (nonrecoverable error). ----------------------------------------------------------------*/ -static int IBBDDQJac(IBBDPrecData pdata, realtype tt, realtype cj, +static int IBBDDQJac(IBBDPrecData pdata, sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector gref, N_Vector ytemp, N_Vector yptemp, N_Vector gtemp) { IDAMem IDA_mem; - realtype inc, inc_inv; + sunrealtype inc, inc_inv; int retval; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *ydata, *ypdata, *ytempdata, *yptempdata, *grefdata, *gtempdata; - realtype *cnsdata = NULL, *ewtdata; - realtype *col_j, conj, yj, ypj, ewtj; + sunrealtype *ydata, *ypdata, *ytempdata, *yptempdata, *grefdata, *gtempdata; + sunrealtype *cnsdata = NULL, *ewtdata; + sunrealtype *col_j, conj, yj, ypj, ewtj; IDA_mem = (IDAMem) pdata->ida_mem; diff --git a/src/ida/ida_bbdpre_impl.h b/src/ida/ida_bbdpre_impl.h index f7037fcaad..ee5607ab8e 100644 --- a/src/ida/ida_bbdpre_impl.h +++ b/src/ida/ida_bbdpre_impl.h @@ -40,7 +40,7 @@ typedef struct IBBDPrecDataRec { /* passed by user to IDABBDPrecAlloc and used by IDABBDPrecSetup/IDABBDPrecSolve functions */ sunindextype mudq, mldq, mukeep, mlkeep; - realtype rel_yy; + sunrealtype rel_yy; IDABBDLocalFn glocal; IDABBDCommFn gcomm; diff --git a/src/ida/ida_ic.c b/src/ida/ida_ic.c index e3877960dd..7c7fcb7059 100644 --- a/src/ida/ida_ic.c +++ b/src/ida/ida_ic.c @@ -58,14 +58,14 @@ */ extern int IDAInitialSetup(IDAMem IDA_mem); -extern realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, +extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, booleantype mask); static int IDAnlsIC(IDAMem IDA_mem); static int IDANewtonIC(IDAMem IDA_mem); -static int IDALineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm); -static int IDAfnorm(IDAMem IDA_mem, realtype *fnorm); -static int IDANewyyp(IDAMem IDA_mem, realtype lambda); +static int IDALineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm); +static int IDAfnorm(IDAMem IDA_mem, sunrealtype *fnorm); +static int IDANewyyp(IDAMem IDA_mem, sunrealtype lambda); static int IDANewy(IDAMem IDA_mem); static int IDAICFailFlag(IDAMem IDA_mem, int retval); @@ -103,11 +103,11 @@ static int IDAICFailFlag(IDAMem IDA_mem, int retval); * ----------------------------------------------------------------- */ -int IDACalcIC(void *ida_mem, int icopt, realtype tout1) +int IDACalcIC(void *ida_mem, int icopt, sunrealtype tout1) { int ewtsetOK; int ier, nwt, nh, mxnh, icret, retval=0; - realtype tdist, troundoff, minid, hic, ypnorm; + sunrealtype tdist, troundoff, minid, hic, ypnorm; IDAMem IDA_mem; /* Check if IDA memory exists */ @@ -381,7 +381,7 @@ static int IDAnlsIC (IDAMem IDA_mem) static int IDANewtonIC(IDAMem IDA_mem) { int retval, mnewt; - realtype delnorm, fnorm, fnorm0, oldfnrm, rate; + sunrealtype delnorm, fnorm, fnorm0, oldfnrm, rate; /* Set pointer for vector delnew */ IDA_mem->ida_delnew = IDA_mem->ida_phi[2]; @@ -459,11 +459,11 @@ static int IDANewtonIC(IDAMem IDA_mem) * ----------------------------------------------------------------- */ -static int IDALineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm) +static int IDALineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm) { booleantype conOK; int retval, nbacks; - realtype f1norm, fnormp, f1normp, ratio, lambda, minlam, slpi; + sunrealtype f1norm, fnormp, f1normp, ratio, lambda, minlam, slpi; N_Vector mc; /* Initialize work space pointers, f1norm, ratio. @@ -551,7 +551,7 @@ static int IDALineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm) * ----------------------------------------------------------------- */ -static int IDAfnorm(IDAMem IDA_mem, realtype *fnorm) +static int IDAfnorm(IDAMem IDA_mem, sunrealtype *fnorm) { int retval; @@ -593,7 +593,7 @@ static int IDAfnorm(IDAMem IDA_mem, realtype *fnorm) * ----------------------------------------------------------------- */ -static int IDANewyyp(IDAMem IDA_mem, realtype lambda) +static int IDANewyyp(IDAMem IDA_mem, sunrealtype lambda) { /* IDA_YA_YDP_INIT case: ynew = yy0 - lambda*delta where id_i = 0 diff --git a/src/ida/ida_impl.h b/src/ida/ida_impl.h index 016f037a80..c8f98fd8e7 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -91,7 +91,7 @@ typedef struct IDAMemRec { SUNContext ida_sunctx; - realtype ida_uround; /* machine unit roundoff */ + sunrealtype ida_uround; /* machine unit roundoff */ /*-------------------------- Problem Specification Data @@ -101,8 +101,8 @@ typedef struct IDAMemRec { void *ida_user_data; /* user pointer passed to res */ int ida_itol; /* itol = IDA_SS, IDA_SV, IDA_WF, IDA_NN */ - realtype ida_rtol; /* relative tolerance */ - realtype ida_Satol; /* scalar absolute tolerance */ + sunrealtype ida_rtol; /* relative tolerance */ + sunrealtype ida_Satol; /* scalar absolute tolerance */ N_Vector ida_Vatol; /* vector absolute tolerance */ booleantype ida_atolmin0; /* flag indicating that min(atol) = 0 */ booleantype ida_user_efun; /* SUNTRUE if user provides efun */ @@ -120,11 +120,11 @@ typedef struct IDAMemRec { N_Vector ida_phi[MXORDP1]; /* phi = (maxord+1) arrays of divided differences */ - realtype ida_psi[MXORDP1]; /* differences in t (sums of recent step sizes) */ - realtype ida_alpha[MXORDP1]; /* ratios of current stepsize to psi values */ - realtype ida_beta[MXORDP1]; /* ratios of current to previous product of psi's */ - realtype ida_sigma[MXORDP1]; /* product successive alpha values and factorial */ - realtype ida_gamma[MXORDP1]; /* sum of reciprocals of psi values */ + sunrealtype ida_psi[MXORDP1]; /* differences in t (sums of recent step sizes) */ + sunrealtype ida_alpha[MXORDP1]; /* ratios of current stepsize to psi values */ + sunrealtype ida_beta[MXORDP1]; /* ratios of current to previous product of psi's */ + sunrealtype ida_sigma[MXORDP1]; /* product successive alpha values and factorial */ + sunrealtype ida_gamma[MXORDP1]; /* sum of reciprocals of psi values */ /*------------------------- N_Vectors for integration @@ -154,7 +154,7 @@ typedef struct IDAMemRec { Variables for use by IDACalcIC ------------------------------*/ - realtype ida_t0; /* initial t */ + sunrealtype ida_t0; /* initial t */ N_Vector ida_yy0; /* initial y vector (user-supplied). */ N_Vector ida_yp0; /* initial y' vector (user-supplied). */ @@ -166,14 +166,14 @@ typedef struct IDAMemRec { int ida_nbacktr; /* number of IC linesearch backtrack operations */ int ida_sysindex; /* computed system index (0 or 1) */ int ida_maxbacks; /* max backtracks per Newton step */ - realtype ida_epiccon; /* IC nonlinear convergence test constant */ - realtype ida_steptol; /* minimum Newton step size in IC calculation */ - realtype ida_tscale; /* time scale factor = abs(tout1 - t0) */ + sunrealtype ida_epiccon; /* IC nonlinear convergence test constant */ + sunrealtype ida_steptol; /* minimum Newton step size in IC calculation */ + sunrealtype ida_tscale; /* time scale factor = abs(tout1 - t0) */ /* Tstop information */ booleantype ida_tstopset; - realtype ida_tstop; + sunrealtype ida_tstop; /* Step Data */ @@ -183,22 +183,22 @@ typedef struct IDAMemRec { int ida_phase; /* flag to trigger step doubling in first few steps */ int ida_ns; /* counts steps at fixed stepsize and order */ - realtype ida_hin; /* initial step */ - realtype ida_h0u; /* actual initial stepsize */ - realtype ida_hh; /* current step size h */ - realtype ida_hused; /* step size used on last successful step */ - realtype ida_eta; /* eta = hnext / hused */ - realtype ida_tn; /* current internal value of t */ - realtype ida_tretlast; /* value of tret previously returned by IDASolve */ - realtype ida_cj; /* current value of scalar (-alphas/hh) in Jacobian */ - realtype ida_cjlast; /* cj value saved from last successful step */ - realtype ida_cjold; /* cj value saved from last call to lsetup */ - realtype ida_cjratio; /* ratio of cj values: cj/cjold */ - realtype ida_ss; /* scalar used in Newton iteration convergence test */ - realtype ida_oldnrm; /* norm of previous nonlinear solver update */ - realtype ida_epsNewt; /* test constant in Newton convergence test */ - realtype ida_epcon; /* coeficient of the Newton covergence test */ - realtype ida_toldel; /* tolerance in direct test on Newton corrections */ + sunrealtype ida_hin; /* initial step */ + sunrealtype ida_h0u; /* actual initial stepsize */ + sunrealtype ida_hh; /* current step size h */ + sunrealtype ida_hused; /* step size used on last successful step */ + sunrealtype ida_eta; /* eta = hnext / hused */ + sunrealtype ida_tn; /* current internal value of t */ + sunrealtype ida_tretlast; /* value of tret previously returned by IDASolve */ + sunrealtype ida_cj; /* current value of scalar (-alphas/hh) in Jacobian */ + sunrealtype ida_cjlast; /* cj value saved from last successful step */ + sunrealtype ida_cjold; /* cj value saved from last call to lsetup */ + sunrealtype ida_cjratio; /* ratio of cj values: cj/cjold */ + sunrealtype ida_ss; /* scalar used in Newton iteration convergence test */ + sunrealtype ida_oldnrm; /* norm of previous nonlinear solver update */ + sunrealtype ida_epsNewt; /* test constant in Newton convergence test */ + sunrealtype ida_epcon; /* coeficient of the Newton covergence test */ + sunrealtype ida_toldel; /* tolerance in direct test on Newton corrections */ /*------ Limits @@ -210,16 +210,16 @@ typedef struct IDAMemRec { int ida_maxord; /* max value of method order k: */ int ida_maxord_alloc; /* value of maxord used when allocating memory */ long int ida_mxstep; /* max number of internal steps for one user call */ - realtype ida_hmax_inv; /* inverse of max. step size hmax (default = 0.0) */ - realtype ida_hmin; /* min step size hmin (default = 0.0) */ + sunrealtype ida_hmax_inv; /* inverse of max. step size hmax (default = 0.0) */ + sunrealtype ida_hmin; /* min step size hmin (default = 0.0) */ - realtype ida_eta_max_fx; /* threshold to increase step size */ - realtype ida_eta_min_fx; /* threshold to decrease step size */ - realtype ida_eta_max; /* max step size increase factor */ - realtype ida_eta_min; /* min step size decrease factor */ - realtype ida_eta_low; /* upper bound on decrease factor */ - realtype ida_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ - realtype ida_eta_cf; /* eta on a nonlinear solver convergence failure */ + sunrealtype ida_eta_max_fx; /* threshold to increase step size */ + sunrealtype ida_eta_min_fx; /* threshold to decrease step size */ + sunrealtype ida_eta_max; /* max step size increase factor */ + sunrealtype ida_eta_min; /* min step size decrease factor */ + sunrealtype ida_eta_low; /* upper bound on decrease factor */ + sunrealtype ida_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ + sunrealtype ida_eta_cf; /* eta on a nonlinear solver convergence failure */ /*-------- Counters @@ -237,12 +237,12 @@ typedef struct IDAMemRec { Space requirements ------------------*/ - sunindextype ida_lrw1; /* no. of realtype words in 1 N_Vector */ + sunindextype ida_lrw1; /* no. of sunrealtype words in 1 N_Vector */ sunindextype ida_liw1; /* no. of integer words in 1 N_Vector */ - long int ida_lrw; /* number of realtype words in IDA work vectors */ + long int ida_lrw; /* number of sunrealtype words in IDA work vectors */ long int ida_liw; /* no. of integer words in IDA work vectors */ - realtype ida_tolsf; /* tolerance scale factor (saved value) */ + sunrealtype ida_tolsf; /* tolerance scale factor (saved value) */ /*------------------------------------------- Error handler function and error ouput file @@ -296,7 +296,7 @@ typedef struct IDAMemRec { /* Linear Solver specific memory */ void *ida_lmem; /* linear solver interface structure */ - realtype ida_dcj; /* parameter that determines cj ratio thresholds for calling + sunrealtype ida_dcj; /* parameter that determines cj ratio thresholds for calling * the linear solver setup function */ /* Flag to indicate successful ida_linit call */ @@ -311,14 +311,14 @@ typedef struct IDAMemRec { int ida_nrtfn; /* number of components of g */ int *ida_iroots; /* array for root information */ int *ida_rootdir; /* array specifying direction of zero-crossing */ - realtype ida_tlo; /* nearest endpoint of interval in root search */ - realtype ida_thi; /* farthest endpoint of interval in root search */ - realtype ida_trout; /* t return value from rootfinder routine */ - realtype *ida_glo; /* saved array of g values at t = tlo */ - realtype *ida_ghi; /* saved array of g values at t = thi */ - realtype *ida_grout; /* array of g values at t = trout */ - realtype ida_toutc; /* copy of tout (if NORMAL mode) */ - realtype ida_ttol; /* tolerance on root location */ + sunrealtype ida_tlo; /* nearest endpoint of interval in root search */ + sunrealtype ida_thi; /* farthest endpoint of interval in root search */ + sunrealtype ida_trout; /* t return value from rootfinder routine */ + sunrealtype *ida_glo; /* saved array of g values at t = tlo */ + sunrealtype *ida_ghi; /* saved array of g values at t = thi */ + sunrealtype *ida_grout; /* array of g values at t = trout */ + sunrealtype ida_toutc; /* copy of tout (if NORMAL mode) */ + sunrealtype ida_ttol; /* tolerance on root location */ int ida_taskc; /* copy of parameter itask */ int ida_irfnd; /* flag showing whether last step had a root */ long int ida_nge; /* counter for g evaluations */ @@ -328,8 +328,8 @@ typedef struct IDAMemRec { /* Arrays for Fused Vector Operations */ /* scalar arrays */ - realtype ida_cvals[MXORDP1]; - realtype ida_dvals[MAXORD_DEFAULT]; + sunrealtype ida_cvals[MXORDP1]; + sunrealtype ida_dvals[MAXORD_DEFAULT]; /* vector arrays */ N_Vector ida_Xvecs[MXORDP1]; @@ -451,7 +451,7 @@ void IDAErrHandler(int error_code, const char *module, const char *function, /* Norm functions. Also used for IC, so they are global.*/ -realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, +sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, booleantype mask); /* Nonlinear solver initialization */ diff --git a/src/ida/ida_io.c b/src/ida/ida_io.c index 528aab8694..f03ff875fe 100644 --- a/src/ida/ida_io.c +++ b/src/ida/ida_io.c @@ -35,7 +35,7 @@ * ================================================================= */ -int IDASetDeltaCjLSetup(void *ida_mem, realtype dcj) +int IDASetDeltaCjLSetup(void *ida_mem, sunrealtype dcj) { IDAMem IDA_mem; @@ -109,8 +109,8 @@ int IDASetUserData(void *ida_mem, void *user_data) /*-----------------------------------------------------------------*/ -int IDASetEtaFixedStepBounds(void *ida_mem, realtype eta_min_fx, - realtype eta_max_fx) +int IDASetEtaFixedStepBounds(void *ida_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx) { IDAMem IDA_mem; @@ -137,7 +137,7 @@ int IDASetEtaFixedStepBounds(void *ida_mem, realtype eta_min_fx, /*-----------------------------------------------------------------*/ -int IDASetEtaMax(void *ida_mem, realtype eta_max) +int IDASetEtaMax(void *ida_mem, sunrealtype eta_max) { IDAMem IDA_mem; @@ -159,7 +159,7 @@ int IDASetEtaMax(void *ida_mem, realtype eta_max) /*-----------------------------------------------------------------*/ -int IDASetEtaMin(void *ida_mem, realtype eta_min) +int IDASetEtaMin(void *ida_mem, sunrealtype eta_min) { IDAMem IDA_mem; @@ -181,7 +181,7 @@ int IDASetEtaMin(void *ida_mem, realtype eta_min) /*-----------------------------------------------------------------*/ -int IDASetEtaLow(void *ida_mem, realtype eta_low) +int IDASetEtaLow(void *ida_mem, sunrealtype eta_low) { IDAMem IDA_mem; @@ -203,7 +203,7 @@ int IDASetEtaLow(void *ida_mem, realtype eta_low) /*-----------------------------------------------------------------*/ -int IDASetEtaMinErrFail(void *ida_mem, realtype eta_min_ef) +int IDASetEtaMinErrFail(void *ida_mem, sunrealtype eta_min_ef) { IDAMem IDA_mem; @@ -225,7 +225,7 @@ int IDASetEtaMinErrFail(void *ida_mem, realtype eta_min_ef) /*-----------------------------------------------------------------*/ -int IDASetEtaConvFail(void *ida_mem, realtype eta_cf) +int IDASetEtaConvFail(void *ida_mem, sunrealtype eta_cf) { IDAMem IDA_mem; @@ -303,7 +303,7 @@ int IDASetMaxNumSteps(void *ida_mem, long int mxsteps) /*-----------------------------------------------------------------*/ -int IDASetInitStep(void *ida_mem, realtype hin) +int IDASetInitStep(void *ida_mem, sunrealtype hin) { IDAMem IDA_mem; @@ -321,7 +321,7 @@ int IDASetInitStep(void *ida_mem, realtype hin) /*-----------------------------------------------------------------*/ -int IDASetMaxStep(void *ida_mem, realtype hmax) +int IDASetMaxStep(void *ida_mem, sunrealtype hmax) { IDAMem IDA_mem; @@ -350,7 +350,7 @@ int IDASetMaxStep(void *ida_mem, realtype hmax) /*-----------------------------------------------------------------*/ -int IDASetMinStep(void *ida_mem, realtype hmin) +int IDASetMinStep(void *ida_mem, sunrealtype hmin) { IDAMem IDA_mem; @@ -380,7 +380,7 @@ int IDASetMinStep(void *ida_mem, realtype hmin) /*-----------------------------------------------------------------*/ -int IDASetStopTime(void *ida_mem, realtype tstop) +int IDASetStopTime(void *ida_mem, sunrealtype tstop) { IDAMem IDA_mem; @@ -430,7 +430,7 @@ int IDAClearStopTime(void *ida_mem) /*-----------------------------------------------------------------*/ -int IDASetNonlinConvCoef(void *ida_mem, realtype epcon) +int IDASetNonlinConvCoef(void *ida_mem, sunrealtype epcon) { IDAMem IDA_mem; @@ -571,7 +571,7 @@ int IDASetId(void *ida_mem, N_Vector id) int IDASetConstraints(void *ida_mem, N_Vector constraints) { IDAMem IDA_mem; - realtype temptest; + sunrealtype temptest; if (ida_mem==NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDA", "IDASetConstraints", MSG_NO_MEM); @@ -686,7 +686,7 @@ int IDASetNoInactiveRootWarn(void *ida_mem) * ================================================================= */ -int IDASetNonlinConvCoefIC(void *ida_mem, realtype epiccon) +int IDASetNonlinConvCoefIC(void *ida_mem, sunrealtype epiccon) { IDAMem IDA_mem; @@ -819,7 +819,7 @@ int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff) /*-----------------------------------------------------------------*/ -int IDASetStepToleranceIC(void *ida_mem, realtype steptol) +int IDASetStepToleranceIC(void *ida_mem, sunrealtype steptol) { IDAMem IDA_mem; @@ -996,7 +996,7 @@ int IDAGetCurrentOrder(void *ida_mem, int *kcur) /*-----------------------------------------------------------------*/ -int IDAGetCurrentCj(void *ida_mem, realtype *cj) +int IDAGetCurrentCj(void *ida_mem, sunrealtype *cj) { IDAMem IDA_mem; @@ -1050,7 +1050,7 @@ int IDAGetCurrentYp(void *ida_mem, N_Vector *ypcur) /*-----------------------------------------------------------------*/ -int IDAGetActualInitStep(void *ida_mem, realtype *hinused) +int IDAGetActualInitStep(void *ida_mem, sunrealtype *hinused) { IDAMem IDA_mem; @@ -1068,7 +1068,7 @@ int IDAGetActualInitStep(void *ida_mem, realtype *hinused) /*-----------------------------------------------------------------*/ -int IDAGetLastStep(void *ida_mem, realtype *hlast) +int IDAGetLastStep(void *ida_mem, sunrealtype *hlast) { IDAMem IDA_mem; @@ -1086,7 +1086,7 @@ int IDAGetLastStep(void *ida_mem, realtype *hlast) /*-----------------------------------------------------------------*/ -int IDAGetCurrentStep(void *ida_mem, realtype *hcur) +int IDAGetCurrentStep(void *ida_mem, sunrealtype *hcur) { IDAMem IDA_mem; @@ -1104,7 +1104,7 @@ int IDAGetCurrentStep(void *ida_mem, realtype *hcur) /*-----------------------------------------------------------------*/ -int IDAGetCurrentTime(void *ida_mem, realtype *tcur) +int IDAGetCurrentTime(void *ida_mem, sunrealtype *tcur) { IDAMem IDA_mem; @@ -1122,7 +1122,7 @@ int IDAGetCurrentTime(void *ida_mem, realtype *tcur) /*-----------------------------------------------------------------*/ -int IDAGetTolScaleFactor(void *ida_mem, realtype *tolsfact) +int IDAGetTolScaleFactor(void *ida_mem, sunrealtype *tolsfact) { IDAMem IDA_mem; @@ -1196,8 +1196,8 @@ int IDAGetWorkSpace(void *ida_mem, long int *lenrw, long int *leniw) int IDAGetIntegratorStats(void *ida_mem, long int *nsteps, long int *nrevals, long int *nlinsetups, long int *netfails, - int *klast, int *kcur, realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur) + int *klast, int *kcur, sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur) { IDAMem IDA_mem; @@ -1397,7 +1397,7 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nst > 0) { fprintf(outfile, "NLS iters per step = %"RSYM"\n", - (realtype) IDA_mem->ida_nre / (realtype) IDA_mem->ida_nst); + (sunrealtype) IDA_mem->ida_nre / (sunrealtype) IDA_mem->ida_nst); } /* linear solver stats */ @@ -1416,11 +1416,11 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nni > 0) { fprintf(outfile, "LS iters per NLS iter = %"RSYM"\n", - (realtype) idals_mem->nli / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nli / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, "Jac evals per NLS iter = %"RSYM"\n", - (realtype) idals_mem->nje / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nje / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, "Prec evals per NLS iter = %"RSYM"\n", - (realtype) idals_mem->npe / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->npe / (sunrealtype) IDA_mem->ida_nni); } } @@ -1452,7 +1452,7 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nst > 0) { fprintf(outfile, ",NLS iters per step,%"RSYM, - (realtype) IDA_mem->ida_nre / (realtype) IDA_mem->ida_nst); + (sunrealtype) IDA_mem->ida_nre / (sunrealtype) IDA_mem->ida_nst); } else { @@ -1475,11 +1475,11 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nni > 0) { fprintf(outfile, ",LS iters per NLS iter,%"RSYM, - (realtype) idals_mem->nli / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nli / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, ",Jac evals per NLS iter,%"RSYM, - (realtype) idals_mem->nje / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nje / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, ",Prec evals per NLS iter,%"RSYM, - (realtype) idals_mem->npe / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->npe / (sunrealtype) IDA_mem->ida_nni); } else { diff --git a/src/ida/ida_ls.c b/src/ida/ida_ls.c index 0dece17d19..14ba727f24 100644 --- a/src/ida/ida_ls.c +++ b/src/ida/ida_ls.c @@ -304,7 +304,7 @@ int IDASetJacFn(void *ida_mem, IDALsJacFn jac) /* IDASetEpsLin specifies the nonlinear -> linear tolerance scale factor */ -int IDASetEpsLin(void *ida_mem, realtype eplifac) +int IDASetEpsLin(void *ida_mem, sunrealtype eplifac) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -330,7 +330,7 @@ int IDASetEpsLin(void *ida_mem, realtype eplifac) /* IDASetWRMSNormFactor sets or computes the factor to use when converting from the integrator tolerance to the linear solver tolerance (WRMS to L2 norm). */ -int IDASetLSNormFactor(void *ida_mem, realtype nrmfac) +int IDASetLSNormFactor(void *ida_mem, sunrealtype nrmfac) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -381,7 +381,7 @@ int IDASetLinearSolutionScaling(void *ida_mem, booleantype onoff) /* IDASetIncrementFactor specifies increment factor for DQ approximations to Jv */ -int IDASetIncrementFactor(void *ida_mem, realtype dqincfac) +int IDASetIncrementFactor(void *ida_mem, sunrealtype dqincfac) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -890,7 +890,7 @@ int idaLsPSetup(void *ida_mem) is the only case in which the user's psolve routine is allowed to be NULL. ---------------------------------------------------------------*/ -int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, realtype tol, int lr) +int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -918,7 +918,7 @@ int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, realtype tol, int lr) implementations of the difference quotient Jacobian approximation routines. ---------------------------------------------------------------*/ -int idaLsDQJac(realtype t, realtype c_j, N_Vector y, N_Vector yp, +int idaLsDQJac(sunrealtype t, sunrealtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *ida_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -980,12 +980,12 @@ int idaLsDQJac(realtype t, realtype c_j, N_Vector y, N_Vector yp, actual computation of the jth column of the Jacobian is done with a call to N_VLinearSum. ---------------------------------------------------------------*/ -int idaLsDenseDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsDenseDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1) { - realtype inc, inc_inv, yj, ypj, srur, conj; - realtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; + sunrealtype inc, inc_inv, yj, ypj, srur, conj; + sunrealtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; N_Vector rtemp, jthCol; sunindextype j, N; IDALsMem idals_mem; @@ -1076,14 +1076,14 @@ int idaLsDenseDQJac(realtype tt, realtype c_j, N_Vector yy, The return value is either IDABAND_SUCCESS = 0, or the nonzero value returned by the res routine, if any. ---------------------------------------------------------------*/ -int idaLsBandDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsBandDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype inc, inc_inv, yj, ypj, srur, conj, ewtj; - realtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; - realtype *ytemp_data, *yptemp_data, *rtemp_data, *r_data, *col_j; + sunrealtype inc, inc_inv, yj, ypj, srur, conj, ewtj; + sunrealtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; + sunrealtype *ytemp_data, *yptemp_data, *rtemp_data, *r_data, *col_j; N_Vector rtemp, ytemp, yptemp; sunindextype i, j, i1, i2, width, ngroups, group; sunindextype N, mupper, mlower; @@ -1203,14 +1203,14 @@ int idaLsBandDQJac(realtype tt, realtype c_j, N_Vector yy, The return value from the call to res is saved in order to set the return flag from idaLsSolve. ---------------------------------------------------------------*/ -int idaLsDQJtimes(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - N_Vector v, N_Vector Jv, realtype c_j, +int idaLsDQJtimes(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + N_Vector v, N_Vector Jv, sunrealtype c_j, void *ida_mem, N_Vector work1, N_Vector work2) { IDAMem IDA_mem; IDALsMem idals_mem; N_Vector y_tmp, yp_tmp; - realtype sig, siginv; + sunrealtype sig, siginv; int iter, retval; SUNLinearSolver_ID LSID; @@ -1435,7 +1435,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, { IDALsMem idals_mem; int nli_inc, retval; - realtype tol, w_mean; + sunrealtype tol, w_mean; /* access IDALsMem structure */ if (IDA_mem->ida_lmem == NULL) { @@ -1593,7 +1593,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, int idaLsPerf(IDAMem IDA_mem, int perftask) { IDALsMem idals_mem; - realtype rcfn, rcfl; + sunrealtype rcfn, rcfl; long int nstd, nnid; booleantype lcfn, lcfl; @@ -1626,8 +1626,8 @@ int idaLsPerf(IDAMem IDA_mem, int perftask) nnid = IDA_mem->ida_nni - idals_mem->nni0; if (nstd == 0 || nnid == 0) return(0); - rcfn = ((realtype) (IDA_mem->ida_ncfn - idals_mem->ncfn0)) / ((realtype) nstd); - rcfl = ((realtype) (idals_mem->ncfl - idals_mem->ncfl0)) / ((realtype) nnid); + rcfn = ((sunrealtype) (IDA_mem->ida_ncfn - idals_mem->ncfn0)) / ((sunrealtype) nstd); + rcfl = ((sunrealtype) (idals_mem->ncfl - idals_mem->ncfl0)) / ((sunrealtype) nnid); lcfn = (rcfn > PT9); lcfl = (rcfl > PT9); if (!(lcfn || lcfl)) return(0); diff --git a/src/ida/ida_ls_impl.h b/src/ida/ida_ls_impl.h index a32222e38a..767b19efa2 100644 --- a/src/ida/ida_ls_impl.h +++ b/src/ida/ida_ls_impl.h @@ -57,11 +57,11 @@ typedef struct IDALsMemRec { booleantype scalesol; /* Iterative solver tolerance */ - realtype eplifac; /* nonlinear -> linear tol scaling factor */ - realtype nrmfac; /* integrator -> LS norm conversion factor */ + sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ + sunrealtype nrmfac; /* integrator -> LS norm conversion factor */ /* Statistics and associated parameters */ - realtype dqincfac; /* dqincfac = optional increment factor in Jv */ + sunrealtype dqincfac; /* dqincfac = optional increment factor in Jv */ long int nje; /* nje = no. of calls to jac */ long int npe; /* npe = total number of precond calls */ long int nli; /* nli = total number of linear iterations */ @@ -116,22 +116,22 @@ typedef struct IDALsMemRec { int idaLsATimes(void *ida_mem, N_Vector v, N_Vector z); int idaLsPSetup(void *ida_mem); int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* Difference quotient approximation for Jac times vector */ -int idaLsDQJtimes(realtype tt, N_Vector yy, N_Vector yp, +int idaLsDQJtimes(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, - realtype c_j, void *data, + sunrealtype c_j, void *data, N_Vector work1, N_Vector work2); /* Difference-quotient Jacobian approximation routines */ -int idaLsDQJac(realtype tt, realtype c_j, N_Vector yy, N_Vector yp, +int idaLsDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, void *data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int idaLsDenseDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsDenseDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1); -int idaLsBandDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsBandDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); diff --git a/src/ida/ida_nls.c b/src/ida/ida_nls.c index 4424c3ad28..34c31edc76 100644 --- a/src/ida/ida_nls.c +++ b/src/ida/ida_nls.c @@ -31,7 +31,7 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem); static int idaNlsLSetup(booleantype jbad, booleantype* jcur, void* ida_mem); static int idaNlsLSolve(N_Vector delta, void* ida_mem); static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem); + sunrealtype tol, N_Vector ewt, void* ida_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -160,9 +160,9 @@ int IDASetNlsResFn(void *ida_mem, IDAResFn res) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int IDAGetNonlinearSystemData(void *ida_mem, realtype *tcur, N_Vector *yypred, +int IDAGetNonlinearSystemData(void *ida_mem, sunrealtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, - N_Vector *res, realtype *cj, void **user_data) + N_Vector *res, sunrealtype *cj, void **user_data) { IDAMem IDA_mem; @@ -319,12 +319,12 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem) static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem) + sunrealtype tol, N_Vector ewt, void* ida_mem) { IDAMem IDA_mem; int m, retval; - realtype delnrm; - realtype rate; + sunrealtype delnrm; + sunrealtype rate; if (ida_mem == NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDA", "idaNlsConvTest", MSG_NO_MEM); diff --git a/src/idas/fmod/fidas_mod.c b/src/idas/fmod/fidas_mod.c index 029d76752f..165f47ecd6 100644 --- a/src/idas/fmod/fidas_mod.c +++ b/src/idas/fmod/fidas_mod.c @@ -326,14 +326,14 @@ SWIGEXPORT int _wrap_FIDAInit(void *farg1, IDAResFn farg2, double const *farg3, int fresult ; void *arg1 = (void *) 0 ; IDAResFn arg2 = (IDAResFn) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (IDAResFn)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); result = (int)IDAInit(arg1,arg2,arg3,arg4,arg5); @@ -345,13 +345,13 @@ SWIGEXPORT int _wrap_FIDAInit(void *farg1, IDAResFn farg2, double const *farg3, SWIGEXPORT int _wrap_FIDAReInit(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); result = (int)IDAReInit(arg1,arg2,arg3,arg4); @@ -363,13 +363,13 @@ SWIGEXPORT int _wrap_FIDAReInit(void *farg1, double const *farg2, N_Vector farg3 SWIGEXPORT int _wrap_FIDASStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)IDASStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -379,12 +379,12 @@ SWIGEXPORT int _wrap_FIDASStolerances(void *farg1, double const *farg2, double c SWIGEXPORT int _wrap_FIDASVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)IDASVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -410,12 +410,12 @@ SWIGEXPORT int _wrap_FIDACalcIC(void *farg1, int const *farg2, double const *far int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDACalcIC(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -425,11 +425,11 @@ SWIGEXPORT int _wrap_FIDACalcIC(void *farg1, int const *farg2, double const *far SWIGEXPORT int _wrap_FIDASetNonlinConvCoefIC(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetNonlinConvCoefIC(arg1,arg2); fresult = (int)(result); return fresult; @@ -495,11 +495,11 @@ SWIGEXPORT int _wrap_FIDASetLineSearchOffIC(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDASetStepToleranceIC(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetStepToleranceIC(arg1,arg2); fresult = (int)(result); return fresult; @@ -523,11 +523,11 @@ SWIGEXPORT int _wrap_FIDASetMaxBacksIC(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDASetDeltaCjLSetup(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetDeltaCjLSetup(arg1,arg2); fresult = (int)(result); return fresult; @@ -609,11 +609,11 @@ SWIGEXPORT int _wrap_FIDASetMaxNumSteps(void *farg1, long const *farg2) { SWIGEXPORT int _wrap_FIDASetInitStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -623,11 +623,11 @@ SWIGEXPORT int _wrap_FIDASetInitStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetMaxStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetMaxStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -637,11 +637,11 @@ SWIGEXPORT int _wrap_FIDASetMaxStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetMinStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetMinStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -651,11 +651,11 @@ SWIGEXPORT int _wrap_FIDASetMinStep(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetStopTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -733,13 +733,13 @@ SWIGEXPORT int _wrap_FIDASetConstraints(void *farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FIDASetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetEtaFixedStepBounds(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -749,11 +749,11 @@ SWIGEXPORT int _wrap_FIDASetEtaFixedStepBounds(void *farg1, double const *farg2, SWIGEXPORT int _wrap_FIDASetEtaMin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaMin(arg1,arg2); fresult = (int)(result); return fresult; @@ -763,11 +763,11 @@ SWIGEXPORT int _wrap_FIDASetEtaMin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaMax(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaMax(arg1,arg2); fresult = (int)(result); return fresult; @@ -777,11 +777,11 @@ SWIGEXPORT int _wrap_FIDASetEtaMax(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaLow(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaLow(arg1,arg2); fresult = (int)(result); return fresult; @@ -791,11 +791,11 @@ SWIGEXPORT int _wrap_FIDASetEtaLow(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaMinErrFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaMinErrFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -805,11 +805,11 @@ SWIGEXPORT int _wrap_FIDASetEtaMinErrFail(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetEtaConvFail(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEtaConvFail(arg1,arg2); fresult = (int)(result); return fresult; @@ -861,11 +861,11 @@ SWIGEXPORT int _wrap_FIDASetNlsResFn(void *farg1, IDAResFn farg2) { SWIGEXPORT int _wrap_FIDASetNonlinConvCoef(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetNonlinConvCoef(arg1,arg2); fresult = (int)(result); return fresult; @@ -931,16 +931,16 @@ SWIGEXPORT int _wrap_FIDASetNoInactiveRootWarn(void *farg1) { SWIGEXPORT int _wrap_FIDASolve(void *farg1, double const *farg2, double *farg3, N_Vector farg4, N_Vector farg5, int const *farg6) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int arg6 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); arg6 = (int)(*farg6); @@ -1017,13 +1017,13 @@ SWIGEXPORT int _wrap_FIDAComputeYpSens(void *farg1, void *farg2, void *farg3) { SWIGEXPORT int _wrap_FIDAGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)IDAGetDky(arg1,arg2,arg3,arg4); @@ -1165,11 +1165,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentOrder(void *farg1, int *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentCj(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetCurrentCj(arg1,arg2); fresult = (int)(result); return fresult; @@ -1235,11 +1235,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentYpSens(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FIDAGetActualInitStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetActualInitStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1249,11 +1249,11 @@ SWIGEXPORT int _wrap_FIDAGetActualInitStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1263,11 +1263,11 @@ SWIGEXPORT int _wrap_FIDAGetLastStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -1277,11 +1277,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentTime(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetCurrentTime(arg1,arg2); fresult = (int)(result); return fresult; @@ -1291,11 +1291,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentTime(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FIDAGetTolScaleFactor(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)IDAGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -1367,10 +1367,10 @@ SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg long *arg5 = (long *) 0 ; int *arg6 = (int *) 0 ; int *arg7 = (int *) 0 ; - realtype *arg8 = (realtype *) 0 ; - realtype *arg9 = (realtype *) 0 ; - realtype *arg10 = (realtype *) 0 ; - realtype *arg11 = (realtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); @@ -1380,10 +1380,10 @@ SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg arg5 = (long *)(farg5); arg6 = (int *)(farg6); arg7 = (int *)(farg7); - arg8 = (realtype *)(farg8); - arg9 = (realtype *)(farg9); - arg10 = (realtype *)(farg10); - arg11 = (realtype *)(farg11); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); result = (int)IDAGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); fresult = (int)(result); return fresult; @@ -1393,24 +1393,24 @@ SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg SWIGEXPORT int _wrap_FIDAGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, void *farg6, void *farg7, double *farg8, void *farg9) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; N_Vector *arg6 = (N_Vector *) 0 ; N_Vector *arg7 = (N_Vector *) 0 ; - realtype *arg8 = (realtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; void **arg9 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); arg6 = (N_Vector *)(farg6); arg7 = (N_Vector *)(farg7); - arg8 = (realtype *)(farg8); + arg8 = (sunrealtype *)(farg8); arg9 = (void **)(farg9); result = (int)IDAGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); fresult = (int)(result); @@ -1421,22 +1421,22 @@ SWIGEXPORT int _wrap_FIDAGetNonlinearSystemData(void *farg1, double *farg2, void SWIGEXPORT int _wrap_FIDAGetNonlinearSystemDataSens(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, void *farg6, double *farg7, void *farg8) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector **arg3 = (N_Vector **) 0 ; N_Vector **arg4 = (N_Vector **) 0 ; N_Vector **arg5 = (N_Vector **) 0 ; N_Vector **arg6 = (N_Vector **) 0 ; - realtype *arg7 = (realtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector **)(farg3); arg4 = (N_Vector **)(farg4); arg5 = (N_Vector **)(farg5); arg6 = (N_Vector **)(farg6); - arg7 = (realtype *)(farg7); + arg7 = (sunrealtype *)(farg7); arg8 = (void **)(farg8); result = (int)IDAGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); fresult = (int)(result); @@ -1600,13 +1600,13 @@ SWIGEXPORT int _wrap_FIDAQuadReInit(void *farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FIDAQuadSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)IDAQuadSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1616,12 +1616,12 @@ SWIGEXPORT int _wrap_FIDAQuadSStolerances(void *farg1, double const *farg2, doub SWIGEXPORT int _wrap_FIDAQuadSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); result = (int)IDAQuadSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -1646,12 +1646,12 @@ SWIGEXPORT int _wrap_FIDASetQuadErrCon(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDAGetQuad(void *farg1, double *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); result = (int)IDAGetQuad(arg1,arg2,arg3); fresult = (int)(result); @@ -1662,13 +1662,13 @@ SWIGEXPORT int _wrap_FIDAGetQuad(void *farg1, double *farg2, N_Vector farg3) { SWIGEXPORT int _wrap_FIDAGetQuadDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)IDAGetQuadDky(arg1,arg2,arg3,arg4); @@ -1786,13 +1786,13 @@ SWIGEXPORT int _wrap_FIDASensReInit(void *farg1, int const *farg2, void *farg3, SWIGEXPORT int _wrap_FIDASensSStolerances(void *farg1, double const *farg2, double *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); result = (int)IDASensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1802,12 +1802,12 @@ SWIGEXPORT int _wrap_FIDASensSStolerances(void *farg1, double const *farg2, doub SWIGEXPORT int _wrap_FIDASensSVtolerances(void *farg1, double const *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)IDASensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -1847,12 +1847,12 @@ SWIGEXPORT int _wrap_FIDASetSensDQMethod(void *farg1, int const *farg2, double c int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetSensDQMethod(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1890,14 +1890,14 @@ SWIGEXPORT int _wrap_FIDASetSensMaxNonlinIters(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDASetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int *arg4 = (int *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype *)(farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (int *)(farg4); result = (int)IDASetSensParams(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -1948,12 +1948,12 @@ SWIGEXPORT int _wrap_FIDASensToggleOff(void *farg1) { SWIGEXPORT int _wrap_FIDAGetSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); result = (int)IDAGetSens(arg1,arg2,arg3); fresult = (int)(result); @@ -1964,13 +1964,13 @@ SWIGEXPORT int _wrap_FIDAGetSens(void *farg1, double *farg2, void *farg3) { SWIGEXPORT int _wrap_FIDAGetSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)IDAGetSens1(arg1,arg2,arg3,arg4); @@ -1982,13 +1982,13 @@ SWIGEXPORT int _wrap_FIDAGetSens1(void *farg1, double *farg2, int const *farg3, SWIGEXPORT int _wrap_FIDAGetSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector *)(farg4); result = (int)IDAGetSensDky(arg1,arg2,arg3,arg4); @@ -2000,14 +2000,14 @@ SWIGEXPORT int _wrap_FIDAGetSensDky(void *farg1, double const *farg2, int const SWIGEXPORT int _wrap_FIDAGetSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; int arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (N_Vector)(farg5); @@ -2206,13 +2206,13 @@ SWIGEXPORT int _wrap_FIDAQuadSensReInit(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FIDAQuadSensSStolerances(void *farg1, double const *farg2, double *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); result = (int)IDAQuadSensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2222,12 +2222,12 @@ SWIGEXPORT int _wrap_FIDAQuadSensSStolerances(void *farg1, double const *farg2, SWIGEXPORT int _wrap_FIDAQuadSensSVtolerances(void *farg1, double const *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)IDAQuadSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); @@ -2264,12 +2264,12 @@ SWIGEXPORT int _wrap_FIDASetQuadSensErrCon(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDAGetQuadSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); result = (int)IDAGetQuadSens(arg1,arg2,arg3); fresult = (int)(result); @@ -2280,13 +2280,13 @@ SWIGEXPORT int _wrap_FIDAGetQuadSens(void *farg1, double *farg2, void *farg3) { SWIGEXPORT int _wrap_FIDAGetQuadSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (int)(*farg3); arg4 = (N_Vector)(farg4); result = (int)IDAGetQuadSens1(arg1,arg2,arg3,arg4); @@ -2298,13 +2298,13 @@ SWIGEXPORT int _wrap_FIDAGetQuadSens1(void *farg1, double *farg2, int const *far SWIGEXPORT int _wrap_FIDAGetQuadSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (N_Vector *)(farg4); result = (int)IDAGetQuadSensDky(arg1,arg2,arg3,arg4); @@ -2316,14 +2316,14 @@ SWIGEXPORT int _wrap_FIDAGetQuadSensDky(void *farg1, double const *farg2, int co SWIGEXPORT int _wrap_FIDAGetQuadSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; int arg4 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (N_Vector)(farg5); @@ -2454,7 +2454,7 @@ SWIGEXPORT int _wrap_FIDAInitB(void *farg1, int const *farg2, IDAResFnB farg3, d void *arg1 = (void *) 0 ; int arg2 ; IDAResFnB arg3 = (IDAResFnB) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector arg5 = (N_Vector) 0 ; N_Vector arg6 = (N_Vector) 0 ; int result; @@ -2462,7 +2462,7 @@ SWIGEXPORT int _wrap_FIDAInitB(void *farg1, int const *farg2, IDAResFnB farg3, d arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (IDAResFnB)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector)(farg5); arg6 = (N_Vector)(farg6); result = (int)IDAInitB(arg1,arg2,arg3,arg4,arg5,arg6); @@ -2476,7 +2476,7 @@ SWIGEXPORT int _wrap_FIDAInitBS(void *farg1, int const *farg2, IDAResFnBS farg3, void *arg1 = (void *) 0 ; int arg2 ; IDAResFnBS arg3 = (IDAResFnBS) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector arg5 = (N_Vector) 0 ; N_Vector arg6 = (N_Vector) 0 ; int result; @@ -2484,7 +2484,7 @@ SWIGEXPORT int _wrap_FIDAInitBS(void *farg1, int const *farg2, IDAResFnBS farg3, arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (IDAResFnBS)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector)(farg5); arg6 = (N_Vector)(farg6); result = (int)IDAInitBS(arg1,arg2,arg3,arg4,arg5,arg6); @@ -2497,14 +2497,14 @@ SWIGEXPORT int _wrap_FIDAReInitB(void *farg1, int const *farg2, double const *fa int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); result = (int)IDAReInitB(arg1,arg2,arg3,arg4,arg5); @@ -2517,14 +2517,14 @@ SWIGEXPORT int _wrap_FIDASStolerancesB(void *farg1, int const *farg2, double con int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; - realtype arg4 ; + sunrealtype arg3 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); - arg4 = (realtype)(*farg4); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); result = (int)IDASStolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2535,13 +2535,13 @@ SWIGEXPORT int _wrap_FIDASVtolerancesB(void *farg1, int const *farg2, double con int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)IDASVtolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2605,14 +2605,14 @@ SWIGEXPORT int _wrap_FIDAQuadSStolerancesB(void *farg1, int const *farg2, double int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; - realtype arg4 ; + sunrealtype arg3 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); - arg4 = (realtype)(*farg4); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); result = (int)IDAQuadSStolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2623,13 +2623,13 @@ SWIGEXPORT int _wrap_FIDAQuadSVtolerancesB(void *farg1, int const *farg2, double int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); result = (int)IDAQuadSVtolerancesB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2641,14 +2641,14 @@ SWIGEXPORT int _wrap_FIDACalcICB(void *farg1, int const *farg2, double const *fa int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); result = (int)IDACalcICB(arg1,arg2,arg3,arg4,arg5); @@ -2661,7 +2661,7 @@ SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *f int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; N_Vector *arg6 = (N_Vector *) 0 ; @@ -2670,7 +2670,7 @@ SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *f arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); arg6 = (N_Vector *)(farg6); @@ -2684,8 +2684,8 @@ SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *f SWIGEXPORT int _wrap_FIDASolveF(void *farg1, double const *farg2, double *farg3, N_Vector farg4, N_Vector farg5, int const *farg6, int *farg7) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int arg6 ; @@ -2693,8 +2693,8 @@ SWIGEXPORT int _wrap_FIDASolveF(void *farg1, double const *farg2, double *farg3, int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); arg6 = (int)(*farg6); @@ -2708,12 +2708,12 @@ SWIGEXPORT int _wrap_FIDASolveF(void *farg1, double const *farg2, double *farg3, SWIGEXPORT int _wrap_FIDASolveB(void *farg1, double const *farg2, int const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); result = (int)IDASolveB(arg1,arg2,arg3); fresult = (int)(result); @@ -2785,12 +2785,12 @@ SWIGEXPORT int _wrap_FIDASetInitStepB(void *farg1, int const *farg2, double cons int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetInitStepB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2801,12 +2801,12 @@ SWIGEXPORT int _wrap_FIDASetMaxStepB(void *farg1, int const *farg2, double const int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetMaxStepB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2897,14 +2897,14 @@ SWIGEXPORT int _wrap_FIDAGetB(void *farg1, int const *farg2, double *farg3, N_Ve int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); result = (int)IDAGetB(arg1,arg2,arg3,arg4,arg5); @@ -2917,13 +2917,13 @@ SWIGEXPORT int _wrap_FIDAGetQuadB(void *farg1, int const *farg2, double *farg3, int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); result = (int)IDAGetQuadB(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -2966,13 +2966,13 @@ SWIGEXPORT int _wrap_FIDAGetConsistentICB(void *farg1, int const *farg2, N_Vecto SWIGEXPORT int _wrap_FIDAGetAdjY(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); result = (int)IDAGetAdjY(arg1,arg2,arg3,arg4); @@ -3031,11 +3031,11 @@ SWIGEXPORT void * _wrap_IDAadjCheckPointRec_next_addr_get(SwigClassWrapper const SWIGEXPORT void _wrap_IDAadjCheckPointRec_t0_set(SwigClassWrapper const *farg1, double const *farg2) { IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t0", return ); arg1 = (IDAadjCheckPointRec *)(farg1->cptr); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); if (arg1) (arg1)->t0 = arg2; } @@ -3043,23 +3043,23 @@ SWIGEXPORT void _wrap_IDAadjCheckPointRec_t0_set(SwigClassWrapper const *farg1, SWIGEXPORT double _wrap_IDAadjCheckPointRec_t0_get(SwigClassWrapper const *farg1) { double fresult ; IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; - realtype result; + sunrealtype result; SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t0", return 0); arg1 = (IDAadjCheckPointRec *)(farg1->cptr); - result = (realtype) ((arg1)->t0); - fresult = (realtype)(result); + result = (sunrealtype) ((arg1)->t0); + fresult = (sunrealtype)(result); return fresult; } SWIGEXPORT void _wrap_IDAadjCheckPointRec_t1_set(SwigClassWrapper const *farg1, double const *farg2) { IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t1", return ); arg1 = (IDAadjCheckPointRec *)(farg1->cptr); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); if (arg1) (arg1)->t1 = arg2; } @@ -3067,12 +3067,12 @@ SWIGEXPORT void _wrap_IDAadjCheckPointRec_t1_set(SwigClassWrapper const *farg1, SWIGEXPORT double _wrap_IDAadjCheckPointRec_t1_get(SwigClassWrapper const *farg1) { double fresult ; IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; - realtype result; + sunrealtype result; SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t1", return 0); arg1 = (IDAadjCheckPointRec *)(farg1->cptr); - result = (realtype) ((arg1)->t1); - fresult = (realtype)(result); + result = (sunrealtype) ((arg1)->t1); + fresult = (sunrealtype)(result); return fresult; } @@ -3127,11 +3127,11 @@ SWIGEXPORT int _wrap_IDAadjCheckPointRec_order_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_IDAadjCheckPointRec_step_set(SwigClassWrapper const *farg1, double const *farg2) { IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::step", return ); arg1 = (IDAadjCheckPointRec *)(farg1->cptr); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); if (arg1) (arg1)->step = arg2; } @@ -3139,12 +3139,12 @@ SWIGEXPORT void _wrap_IDAadjCheckPointRec_step_set(SwigClassWrapper const *farg1 SWIGEXPORT double _wrap_IDAadjCheckPointRec_step_get(SwigClassWrapper const *farg1) { double fresult ; IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; - realtype result; + sunrealtype result; SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::step", return 0); arg1 = (IDAadjCheckPointRec *)(farg1->cptr); - result = (realtype) ((arg1)->step); - fresult = (realtype)(result); + result = (sunrealtype) ((arg1)->step); + fresult = (sunrealtype)(result); return fresult; } @@ -3215,14 +3215,14 @@ SWIGEXPORT int _wrap_FIDAGetAdjDataPointHermite(void *farg1, int const *farg2, d int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); result = (int)IDAGetAdjDataPointHermite(arg1,arg2,arg3,arg4,arg5); @@ -3235,14 +3235,14 @@ SWIGEXPORT int _wrap_FIDAGetAdjDataPointPolynomial(void *farg1, int const *farg2 int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int *arg4 = (int *) 0 ; N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); arg4 = (int *)(farg4); arg5 = (N_Vector)(farg5); result = (int)IDAGetAdjDataPointPolynomial(arg1,arg2,arg3,arg4,arg5); @@ -3273,7 +3273,7 @@ SWIGEXPORT int _wrap_FIDABBDPrecInit(void *farg1, int64_t const *farg2, int64_t sunindextype arg4 ; sunindextype arg5 ; sunindextype arg6 ; - realtype arg7 ; + sunrealtype arg7 ; IDABBDLocalFn arg8 = (IDABBDLocalFn) 0 ; IDABBDCommFn arg9 = (IDABBDCommFn) 0 ; int result; @@ -3284,7 +3284,7 @@ SWIGEXPORT int _wrap_FIDABBDPrecInit(void *farg1, int64_t const *farg2, int64_t arg4 = (sunindextype)(*farg4); arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); - arg7 = (realtype)(*farg7); + arg7 = (sunrealtype)(*farg7); arg8 = (IDABBDLocalFn)(farg8); arg9 = (IDABBDCommFn)(farg9); result = (int)IDABBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); @@ -3298,13 +3298,13 @@ SWIGEXPORT int _wrap_FIDABBDPrecReInit(void *farg1, int64_t const *farg2, int64_ void *arg1 = (void *) 0 ; sunindextype arg2 ; sunindextype arg3 ; - realtype arg4 ; + sunrealtype arg4 ; int result; arg1 = (void *)(farg1); arg2 = (sunindextype)(*farg2); arg3 = (sunindextype)(*farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); result = (int)IDABBDPrecReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -3350,7 +3350,7 @@ SWIGEXPORT int _wrap_FIDABBDPrecInitB(void *farg1, int const *farg2, int64_t con sunindextype arg5 ; sunindextype arg6 ; sunindextype arg7 ; - realtype arg8 ; + sunrealtype arg8 ; IDABBDLocalFnB arg9 = (IDABBDLocalFnB) 0 ; IDABBDCommFnB arg10 = (IDABBDCommFnB) 0 ; int result; @@ -3362,7 +3362,7 @@ SWIGEXPORT int _wrap_FIDABBDPrecInitB(void *farg1, int const *farg2, int64_t con arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); arg7 = (sunindextype)(*farg7); - arg8 = (realtype)(*farg8); + arg8 = (sunrealtype)(*farg8); arg9 = (IDABBDLocalFnB)(farg9); arg10 = (IDABBDCommFnB)(farg10); result = (int)IDABBDPrecInitB(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); @@ -3377,14 +3377,14 @@ SWIGEXPORT int _wrap_FIDABBDPrecReInitB(void *farg1, int const *farg2, int64_t c int arg2 ; sunindextype arg3 ; sunindextype arg4 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (sunindextype)(*farg3); arg4 = (sunindextype)(*farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)IDABBDPrecReInitB(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -3456,11 +3456,11 @@ SWIGEXPORT int _wrap_FIDASetJacTimes(void *farg1, IDALsJacTimesSetupFn farg2, ID SWIGEXPORT int _wrap_FIDASetEpsLin(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetEpsLin(arg1,arg2); fresult = (int)(result); return fresult; @@ -3470,11 +3470,11 @@ SWIGEXPORT int _wrap_FIDASetEpsLin(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FIDASetLSNormFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetLSNormFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -3498,11 +3498,11 @@ SWIGEXPORT int _wrap_FIDASetLinearSolutionScaling(void *farg1, int const *farg2) SWIGEXPORT int _wrap_FIDASetIncrementFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)IDASetIncrementFactor(arg1,arg2); fresult = (int)(result); return fresult; @@ -3774,12 +3774,12 @@ SWIGEXPORT int _wrap_FIDASetEpsLinB(void *farg1, int const *farg2, double const int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetEpsLinB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -3790,12 +3790,12 @@ SWIGEXPORT int _wrap_FIDASetLSNormFactorB(void *farg1, int const *farg2, double int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetLSNormFactorB(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -3822,12 +3822,12 @@ SWIGEXPORT int _wrap_FIDASetIncrementFactorB(void *farg1, int const *farg2, doub int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - realtype arg3 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); result = (int)IDASetIncrementFactorB(arg1,arg2,arg3); fresult = (int)(result); return fresult; diff --git a/src/idas/idaa.c b/src/idas/idaa.c index 64ccdd45b1..09d10f1ba3 100644 --- a/src/idas/idaa.c +++ b/src/idas/idaa.c @@ -63,32 +63,32 @@ static int IDAAckpntGet(IDAMem IDA_mem, IDAckpntMem ck_mem); static booleantype IDAAhermiteMalloc(IDAMem IDA_mem); static void IDAAhermiteFree(IDAMem IDA_mem); static int IDAAhermiteStorePnt(IDAMem IDA_mem, IDAdtpntMem d); -static int IDAAhermiteGetY(IDAMem IDA_mem, realtype t, +static int IDAAhermiteGetY(IDAMem IDA_mem, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS); static booleantype IDAApolynomialMalloc(IDAMem IDA_mem); static void IDAApolynomialFree(IDAMem IDA_mem); static int IDAApolynomialStorePnt(IDAMem IDA_mem, IDAdtpntMem d); -static int IDAApolynomialGetY(IDAMem IDA_mem, realtype t, +static int IDAApolynomialGetY(IDAMem IDA_mem, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS); -static int IDAAfindIndex(IDAMem ida_mem, realtype t, +static int IDAAfindIndex(IDAMem ida_mem, sunrealtype t, long int *indx, booleantype *newpoint); -static int IDAAres(realtype tt, +static int IDAAres(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector resvalB, void *ida_mem); -static int IDAArhsQ(realtype tt, +static int IDAArhsQ(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrQB, void *ida_mem); static int IDAAGettnSolutionYp(IDAMem IDA_mem, N_Vector yp); static int IDAAGettnSolutionYpS(IDAMem IDA_mem, N_Vector *ypS); -extern int IDAGetSolution(void *ida_mem, realtype t, N_Vector yret, N_Vector ypret); +extern int IDAGetSolution(void *ida_mem, sunrealtype t, N_Vector yret, N_Vector ypret); /*=================================================================*/ @@ -355,7 +355,7 @@ static void IDAAbckpbDelete(IDABMem *IDAB_memPtr) * ncheckPtr points to the number of check points stored so far. */ -int IDASolveF(void *ida_mem, realtype tout, realtype *tret, +int IDASolveF(void *ida_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask, int *ncheckPtr) { IDAadjMem IDAADJ_mem; @@ -365,7 +365,7 @@ int IDASolveF(void *ida_mem, realtype tout, realtype *tret, long int nstloc; int flag, i; booleantype allocOK, earlyret; - realtype ttest; + sunrealtype ttest; /* Is the mem OK? */ if (ida_mem == NULL) { @@ -696,7 +696,7 @@ int IDACreateB(void *ida_mem, int *which) } int IDAInitB(void *ida_mem, int which, IDAResFnB resB, - realtype tB0, N_Vector yyB0, N_Vector ypB0) + sunrealtype tB0, N_Vector yyB0, N_Vector ypB0) { IDAadjMem IDAADJ_mem; IDAMem IDA_mem; @@ -770,7 +770,7 @@ int IDAInitB(void *ida_mem, int which, IDAResFnB resB, } int IDAInitBS(void *ida_mem, int which, IDAResFnBS resS, - realtype tB0, N_Vector yyB0, N_Vector ypB0) + sunrealtype tB0, N_Vector yyB0, N_Vector ypB0) { IDAadjMem IDAADJ_mem; IDAMem IDA_mem; @@ -851,7 +851,7 @@ int IDAInitBS(void *ida_mem, int which, IDAResFnBS resS, int IDAReInitB(void *ida_mem, int which, - realtype tB0, N_Vector yyB0, N_Vector ypB0) + sunrealtype tB0, N_Vector yyB0, N_Vector ypB0) { IDAadjMem IDAADJ_mem; @@ -910,7 +910,7 @@ int IDAReInitB(void *ida_mem, int which, } int IDASStolerancesB(void *ida_mem, int which, - realtype relTolB, realtype absTolB) + sunrealtype relTolB, sunrealtype absTolB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -953,7 +953,7 @@ int IDASStolerancesB(void *ida_mem, int which, } int IDASVtolerancesB(void *ida_mem, int which, - realtype relTolB, N_Vector absTolB) + sunrealtype relTolB, N_Vector absTolB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -996,7 +996,7 @@ int IDASVtolerancesB(void *ida_mem, int which, } int IDAQuadSStolerancesB(void *ida_mem, int which, - realtype reltolQB, realtype abstolQB) + sunrealtype reltolQB, sunrealtype abstolQB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -1037,7 +1037,7 @@ int IDAQuadSStolerancesB(void *ida_mem, int which, int IDAQuadSVtolerancesB(void *ida_mem, int which, - realtype reltolQB, N_Vector abstolQB) + sunrealtype reltolQB, N_Vector abstolQB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -1253,7 +1253,7 @@ int IDAQuadReInitB(void *ida_mem, int which, N_Vector yQB0) * a call to IDACalcIC is NOT necessary (for index-one problems). */ -int IDACalcICB(void *ida_mem, int which, realtype tout1, +int IDACalcICB(void *ida_mem, int which, sunrealtype tout1, N_Vector yy0, N_Vector yp0) { IDAMem IDA_mem; @@ -1328,7 +1328,7 @@ int IDACalcICB(void *ida_mem, int which, realtype tout1, * It calls IDACalcIC for the 'which' backward problem. */ -int IDACalcICBS(void *ida_mem, int which, realtype tout1, +int IDACalcICBS(void *ida_mem, int which, sunrealtype tout1, N_Vector yy0, N_Vector yp0, N_Vector *yyS0, N_Vector *ypS0) { @@ -1447,14 +1447,14 @@ int IDACalcICBS(void *ida_mem, int which, realtype tout1, * when called in ONE_STEP mode. */ -int IDASolveB(void *ida_mem, realtype tBout, int itaskB) +int IDASolveB(void *ida_mem, sunrealtype tBout, int itaskB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; IDAckpntMem ck_mem; IDABMem IDAB_mem, tmp_IDAB_mem; int flag=0, sign; - realtype tfuzz, tBret, tBn; + sunrealtype tfuzz, tBret, tBn; booleantype gotCkpnt, reachedTBout, isActive; /* Is the mem OK? */ @@ -1682,7 +1682,7 @@ int IDASolveB(void *ida_mem, realtype tBout, int itaskB) * in tret) as that at which IDASolveBreturned the solution. */ -int IDAGetB(void* ida_mem, int which, realtype *tret, +int IDAGetB(void* ida_mem, int which, sunrealtype *tret, N_Vector yy, N_Vector yp) { IDAMem IDA_mem; @@ -1734,7 +1734,7 @@ int IDAGetB(void* ida_mem, int which, realtype *tret, * returned the solution. */ -int IDAGetQuadB(void *ida_mem, int which, realtype *tret, N_Vector qB) +int IDAGetQuadB(void *ida_mem, int which, sunrealtype *tret, N_Vector qB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -2170,7 +2170,7 @@ static int IDAAdataStore(IDAMem IDA_mem, IDAckpntMem ck_mem) { IDAadjMem IDAADJ_mem; IDAdtpntMem *dt_mem; - realtype t; + sunrealtype t; long int i; int flag, sign; @@ -2554,7 +2554,7 @@ static int IDAAhermiteStorePnt(IDAMem IDA_mem, IDAdtpntMem d) * can be directly called by the user through IDAGetAdjY */ -static int IDAAhermiteGetY(IDAMem IDA_mem, realtype t, +static int IDAAhermiteGetY(IDAMem IDA_mem, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS) { @@ -2562,8 +2562,8 @@ static int IDAAhermiteGetY(IDAMem IDA_mem, realtype t, IDAdtpntMem *dt_mem; IDAhermiteDataMem content0, content1; - realtype t0, t1, delta; - realtype factor1, factor2, factor3; + sunrealtype t0, t1, delta; + sunrealtype factor1, factor2, factor3; N_Vector y0, yd0, y1, yd1; N_Vector *yS0=NULL, *ySd0=NULL, *yS1, *ySd1; @@ -2574,7 +2574,7 @@ static int IDAAhermiteGetY(IDAMem IDA_mem, realtype t, /* local variables for fused vector oerations */ int retval; - realtype cvals[4]; + sunrealtype cvals[4]; N_Vector Xvecs[4]; N_Vector* XXvecs[4]; @@ -3008,7 +3008,7 @@ static int IDAApolynomialStorePnt(IDAMem IDA_mem, IDAdtpntMem d) * can be directly called by the user through CVodeGetAdjY. */ -static int IDAApolynomialGetY(IDAMem IDA_mem, realtype t, +static int IDAApolynomialGetY(IDAMem IDA_mem, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS) { @@ -3019,7 +3019,7 @@ static int IDAApolynomialGetY(IDAMem IDA_mem, realtype t, int flag, dir, order, i, j, is, NS, retval; long int indx, base; booleantype newpoint; - realtype delt, factor, Psi, Psiprime; + sunrealtype delt, factor, Psi, Psiprime; IDAADJ_mem = IDA_mem->ida_adj_mem; dt_mem = IDAADJ_mem->dt_mem; @@ -3190,7 +3190,7 @@ static int IDAApolynomialGetY(IDAMem IDA_mem, realtype t, static int IDAAGettnSolutionYp(IDAMem IDA_mem, N_Vector yp) { int j, kord, retval; - realtype C, D, gam; + sunrealtype C, D, gam; if (IDA_mem->ida_nst==0) { @@ -3233,7 +3233,7 @@ static int IDAAGettnSolutionYp(IDAMem IDA_mem, N_Vector yp) static int IDAAGettnSolutionYpS(IDAMem IDA_mem, N_Vector *ypS) { int j, kord, is, retval; - realtype C, D, gam; + sunrealtype C, D, gam; if (IDA_mem->ida_nst==0) { @@ -3284,7 +3284,7 @@ static int IDAAGettnSolutionYpS(IDAMem IDA_mem, N_Vector *ypS) * find indx (t is too far beyond limits). */ -static int IDAAfindIndex(IDAMem ida_mem, realtype t, +static int IDAAfindIndex(IDAMem ida_mem, sunrealtype t, long int *indx, booleantype *newpoint) { IDAadjMem IDAADJ_mem; @@ -3367,7 +3367,7 @@ static int IDAAfindIndex(IDAMem ida_mem, realtype t, * The user must allocate space for y. */ -int IDAGetAdjY(void *ida_mem, realtype t, N_Vector yy, N_Vector yp) +int IDAGetAdjY(void *ida_mem, sunrealtype t, N_Vector yy, N_Vector yp) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -3396,7 +3396,7 @@ int IDAGetAdjY(void *ida_mem, realtype t, N_Vector yy, N_Vector yp) * the user. */ -static int IDAAres(realtype tt, +static int IDAAres(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, void *ida_mem) { @@ -3447,7 +3447,7 @@ static int IDAAres(realtype tt, * be of IDAQuadRhsFn type. */ -static int IDAArhsQ(realtype tt, +static int IDAArhsQ(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector resvalQB, void *ida_mem) { diff --git a/src/idas/idaa_io.c b/src/idas/idaa_io.c index 4af2ec0e05..2a3a54c238 100644 --- a/src/idas/idaa_io.c +++ b/src/idas/idaa_io.c @@ -246,7 +246,7 @@ int IDASetMaxNumStepsB(void *ida_mem, int which, long int mxstepsB) return IDASetMaxNumSteps(ida_memB, mxstepsB); } -int IDASetInitStepB(void *ida_mem, int which, realtype hinB) +int IDASetInitStepB(void *ida_mem, int which, sunrealtype hinB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -285,7 +285,7 @@ int IDASetInitStepB(void *ida_mem, int which, realtype hinB) return IDASetInitStep(ida_memB, hinB); } -int IDASetMaxStepB(void *ida_mem, int which, realtype hmaxB) +int IDASetMaxStepB(void *ida_mem, int which, sunrealtype hmaxB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -661,7 +661,7 @@ int IDAGetConsistentICB(void *ida_mem, int which, N_Vector yyB0_mod, N_Vector yp * */ int IDAGetAdjDataPointHermite(void *ida_mem, int which, - realtype *t, N_Vector yy, N_Vector yd) + sunrealtype *t, N_Vector yy, N_Vector yd) { IDAMem IDA_mem; @@ -712,7 +712,7 @@ int IDAGetAdjDataPointHermite(void *ida_mem, int which, int IDAGetAdjDataPointPolynomial(void *ida_mem, int which, - realtype *t, int *order, N_Vector y) + sunrealtype *t, int *order, N_Vector y) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; diff --git a/src/idas/idas.c b/src/idas/idas.c index 0008a13375..21460165dd 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -285,7 +285,7 @@ static int IDAStep(IDAMem IDA_mem); /* Function called at beginning of step */ -static void IDASetCoeffs(IDAMem IDA_mem, realtype *ck); +static void IDASetCoeffs(IDAMem IDA_mem, sunrealtype *ck); /* Nonlinear solver functions */ @@ -302,45 +302,45 @@ static int IDAQuadSensNls(IDAMem IDA_mem); /* Error test */ -static int IDATestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2); -static int IDAQuadTestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2); -static int IDASensTestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2); -static int IDAQuadSensTestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2); +static int IDATestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2); +static int IDAQuadTestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2); +static int IDASensTestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2); +static int IDAQuadSensTestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2); /* Handling of convergence and/or error test failures */ -static void IDARestore(IDAMem IDA_mem, realtype saved_t); -static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, realtype err_k, realtype err_km1, +static void IDARestore(IDAMem IDA_mem, sunrealtype saved_t); +static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, sunrealtype err_km1, long int *ncfnPtr, int *ncfPtr, long int *netfPtr, int *nefPtr); static void IDAReset(IDAMem IDA_mem); /* Function called after a successful step */ -static void IDACompleteStep(IDAMem IDA_mem, realtype err_k, realtype err_km1); +static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_km1); /* Function called to evaluate the solutions y(t) and y'(t) at t. Also used in IDAA */ -int IDAGetSolution(void *ida_mem, realtype t, N_Vector yret, N_Vector ypret); +int IDAGetSolution(void *ida_mem, sunrealtype t, N_Vector yret, N_Vector ypret); /* Stopping tests and failure handling */ -static int IDAStopTest1(IDAMem IDA_mem, realtype tout,realtype *tret, +static int IDAStopTest1(IDAMem IDA_mem, sunrealtype tout,sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask); -static int IDAStopTest2(IDAMem IDA_mem, realtype tout, realtype *tret, +static int IDAStopTest2(IDAMem IDA_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask); static int IDAHandleFailure(IDAMem IDA_mem, int sflag); /* Norm functions */ -static realtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, +static sunrealtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector xQ, N_Vector wQ); -static realtype IDAQuadSensWrmsNorm(IDAMem IDA_mem, N_Vector *xQS, N_Vector *wQS); -static realtype IDAQuadSensWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, +static sunrealtype IDAQuadSensWrmsNorm(IDAMem IDA_mem, N_Vector *xQS, N_Vector *wQS); +static sunrealtype IDAQuadSensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xQS, N_Vector *wQS); /* Functions for rootfinding */ @@ -352,21 +352,21 @@ static int IDARootfind(IDAMem IDA_mem); /* Sensitivity residual DQ function */ -static int IDASensRes1DQ(int Ns, realtype t, +static int IDASensRes1DQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, int iS, N_Vector yyS, N_Vector ypS, N_Vector resvalS, void *user_dataS, N_Vector ytemp, N_Vector yptemp, N_Vector restemp); -static int IDAQuadSensRhsInternalDQ(int Ns, realtype t, +static int IDAQuadSensRhsInternalDQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *resvalQS, void *ida_mem, N_Vector yytmp, N_Vector yptmp, N_Vector tmpQS); -static int IDAQuadSensRhs1InternalDQ(IDAMem IDA_mem, int is, realtype t, +static int IDAQuadSensRhs1InternalDQ(IDAMem IDA_mem, int is, sunrealtype t, N_Vector yy, N_Vector y, N_Vector yyS, N_Vector ypS, N_Vector resvalQ, N_Vector resvalQS, @@ -559,7 +559,7 @@ void *IDACreate(SUNContext sunctx) */ int IDAInit(void *ida_mem, IDAResFn res, - realtype t0, N_Vector yy0, N_Vector yp0) + sunrealtype t0, N_Vector yy0, N_Vector yp0) { int retval; IDAMem IDA_mem; @@ -628,7 +628,7 @@ int IDAInit(void *ida_mem, IDAResFn res, /* Allocate temporary work arrays for fused vector ops */ IDA_mem->ida_cvals = NULL; - IDA_mem->ida_cvals = (realtype *) malloc(MXORDP1*sizeof(realtype)); + IDA_mem->ida_cvals = (sunrealtype *) malloc(MXORDP1*sizeof(sunrealtype)); IDA_mem->ida_Xvecs = NULL; IDA_mem->ida_Xvecs = (N_Vector *) malloc(MXORDP1*sizeof(N_Vector)); @@ -759,7 +759,7 @@ int IDAInit(void *ida_mem, IDAResFn res, */ int IDAReInit(void *ida_mem, - realtype t0, N_Vector yy0, N_Vector yp0) + sunrealtype t0, N_Vector yy0, N_Vector yp0) { IDAMem IDA_mem; @@ -854,7 +854,7 @@ int IDAReInit(void *ida_mem, * which will be called to set the error weight vector. */ -int IDASStolerances(void *ida_mem, realtype reltol, realtype abstol) +int IDASStolerances(void *ida_mem, sunrealtype reltol, sunrealtype abstol) { IDAMem IDA_mem; @@ -897,10 +897,10 @@ int IDASStolerances(void *ida_mem, realtype reltol, realtype abstol) } -int IDASVtolerances(void *ida_mem, realtype reltol, N_Vector abstol) +int IDASVtolerances(void *ida_mem, sunrealtype reltol, N_Vector abstol) { IDAMem IDA_mem; - realtype atolmin; + sunrealtype atolmin; if (ida_mem==NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDAS", "IDASVtolerances", MSG_NO_MEM); @@ -1113,7 +1113,7 @@ int IDAQuadReInit(void *ida_mem, N_Vector yQ0) * absolute tolerance (a potentially different absolute tolerance * for each vector component). */ -int IDAQuadSStolerances(void *ida_mem, realtype reltolQ, realtype abstolQ) +int IDAQuadSStolerances(void *ida_mem, sunrealtype reltolQ, sunrealtype abstolQ) { IDAMem IDA_mem; @@ -1152,10 +1152,10 @@ int IDAQuadSStolerances(void *ida_mem, realtype reltolQ, realtype abstolQ) return (IDA_SUCCESS); } -int IDAQuadSVtolerances(void *ida_mem, realtype reltolQ, N_Vector abstolQ) +int IDAQuadSVtolerances(void *ida_mem, sunrealtype reltolQ, N_Vector abstolQ) { IDAMem IDA_mem; - realtype atolmin; + sunrealtype atolmin; /*Check ida mem*/ if (ida_mem==NULL) { @@ -1290,7 +1290,7 @@ int IDASensInit(void *ida_mem, int Ns, int ism, free(IDA_mem->ida_Xvecs); IDA_mem->ida_Xvecs = NULL; free(IDA_mem->ida_Zvecs); IDA_mem->ida_Zvecs = NULL; - IDA_mem->ida_cvals = (realtype *) malloc((Ns*MXORDP1)*sizeof(realtype)); + IDA_mem->ida_cvals = (sunrealtype *) malloc((Ns*MXORDP1)*sizeof(sunrealtype)); IDA_mem->ida_Xvecs = (N_Vector *) malloc((Ns*MXORDP1)*sizeof(N_Vector)); IDA_mem->ida_Zvecs = (N_Vector *) malloc((Ns*MXORDP1)*sizeof(N_Vector)); @@ -1570,7 +1570,7 @@ int IDASensReInit(void *ida_mem, int ism, N_Vector *yS0, N_Vector *ypS0) */ -int IDASensSStolerances(void *ida_mem, realtype reltolS, realtype *abstolS) +int IDASensSStolerances(void *ida_mem, sunrealtype reltolS, sunrealtype *abstolS) { IDAMem IDA_mem; int is; @@ -1615,7 +1615,7 @@ int IDASensSStolerances(void *ida_mem, realtype reltolS, realtype *abstolS) if ( !(IDA_mem->ida_SatolSMallocDone) ) { IDA_mem->ida_SatolS = NULL; - IDA_mem->ida_SatolS = (realtype *)malloc(IDA_mem->ida_Ns*sizeof(realtype)); + IDA_mem->ida_SatolS = (sunrealtype *)malloc(IDA_mem->ida_Ns*sizeof(sunrealtype)); IDA_mem->ida_atolSmin0 = (booleantype *)malloc(IDA_mem->ida_Ns*sizeof(booleantype)); IDA_mem->ida_lrw += IDA_mem->ida_Ns; IDA_mem->ida_SatolSMallocDone = SUNTRUE; @@ -1630,11 +1630,11 @@ int IDASensSStolerances(void *ida_mem, realtype reltolS, realtype *abstolS) } -int IDASensSVtolerances(void *ida_mem, realtype reltolS, N_Vector *abstolS) +int IDASensSVtolerances(void *ida_mem, sunrealtype reltolS, N_Vector *abstolS) { IDAMem IDA_mem; int is, retval; - realtype *atolmin; + sunrealtype *atolmin; /* Check ida_mem pointer */ if (ida_mem == NULL) { @@ -1662,7 +1662,7 @@ int IDASensSVtolerances(void *ida_mem, realtype reltolS, N_Vector *abstolS) return(IDA_ILL_INPUT); } - atolmin = (realtype *)malloc(IDA_mem->ida_Ns*sizeof(realtype)); + atolmin = (sunrealtype *)malloc(IDA_mem->ida_Ns*sizeof(sunrealtype)); for (is=0; isida_Ns; is++) { atolmin[is] = N_VMin(abstolS[is]); if (atolmin[is] < ZERO) { @@ -1870,7 +1870,7 @@ int IDAQuadSensReInit(void *ida_mem, N_Vector *yQS0) * specified through a call to one of IDAQuad**tolerances. */ -int IDAQuadSensSStolerances(void *ida_mem, realtype reltolQS, realtype *abstolQS) +int IDAQuadSensSStolerances(void *ida_mem, sunrealtype reltolQS, sunrealtype *abstolQS) { IDAMem IDA_mem; int is; @@ -1916,7 +1916,7 @@ int IDAQuadSensSStolerances(void *ida_mem, realtype reltolQS, realtype *abstolQS IDA_mem->ida_rtolQS = reltolQS; if ( !(IDA_mem->ida_SatolQSMallocDone) ) { - IDA_mem->ida_SatolQS = (realtype *)malloc(IDA_mem->ida_Ns*sizeof(realtype)); + IDA_mem->ida_SatolQS = (sunrealtype *)malloc(IDA_mem->ida_Ns*sizeof(sunrealtype)); IDA_mem->ida_atolQSmin0 = (booleantype *)malloc(IDA_mem->ida_Ns*sizeof(booleantype)); IDA_mem->ida_lrw += IDA_mem->ida_Ns; IDA_mem->ida_SatolQSMallocDone = SUNTRUE; @@ -1930,11 +1930,11 @@ int IDAQuadSensSStolerances(void *ida_mem, realtype reltolQS, realtype *abstolQS return(IDA_SUCCESS); } -int IDAQuadSensSVtolerances(void *ida_mem, realtype reltolQS, N_Vector *abstolQS) +int IDAQuadSensSVtolerances(void *ida_mem, sunrealtype reltolQS, N_Vector *abstolQS) { IDAMem IDA_mem; int is, retval; - realtype *atolmin; + sunrealtype *atolmin; if (ida_mem==NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDAS", "IDAQuadSensSVtolerances", MSG_NO_MEM); @@ -1966,7 +1966,7 @@ int IDAQuadSensSVtolerances(void *ida_mem, realtype reltolQS, N_Vector *abstolQS return(IDA_ILL_INPUT); } - atolmin = (realtype *)malloc(IDA_mem->ida_Ns*sizeof(realtype)); + atolmin = (sunrealtype *)malloc(IDA_mem->ida_Ns*sizeof(sunrealtype)); for (is=0; isida_Ns; is++) { atolmin[is] = N_VMin(abstolQS[is]); if (atolmin[is] < ZERO) { @@ -2152,7 +2152,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) /* Allocate necessary memory and return */ IDA_mem->ida_glo = NULL; - IDA_mem->ida_glo = (realtype *) malloc(nrt*sizeof(realtype)); + IDA_mem->ida_glo = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (IDA_mem->ida_glo == NULL) { IDAProcessError(IDA_mem, IDA_MEM_FAIL, "IDAS", "IDARootInit", MSG_MEM_FAIL); SUNDIALS_MARK_FUNCTION_END(IDA_PROFILER); @@ -2160,7 +2160,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) } IDA_mem->ida_ghi = NULL; - IDA_mem->ida_ghi = (realtype *) malloc(nrt*sizeof(realtype)); + IDA_mem->ida_ghi = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (IDA_mem->ida_ghi == NULL) { free(IDA_mem->ida_glo); IDA_mem->ida_glo = NULL; IDAProcessError(IDA_mem, IDA_MEM_FAIL, "IDAS", "IDARootInit", MSG_MEM_FAIL); @@ -2169,7 +2169,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) } IDA_mem->ida_grout = NULL; - IDA_mem->ida_grout = (realtype *) malloc(nrt*sizeof(realtype)); + IDA_mem->ida_grout = (sunrealtype *) malloc(nrt*sizeof(sunrealtype)); if (IDA_mem->ida_grout == NULL) { free(IDA_mem->ida_glo); IDA_mem->ida_glo = NULL; free(IDA_mem->ida_ghi); IDA_mem->ida_ghi = NULL; @@ -2272,12 +2272,12 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) * IDA_RES_FAIL */ -int IDASolve(void *ida_mem, realtype tout, realtype *tret, +int IDASolve(void *ida_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask) { long int nstloc; int sflag, istate, ier, irfndp, ir, is; - realtype tdist, troundoff, ypnorm, rh, nrm; + sunrealtype tdist, troundoff, ypnorm, rh, nrm; IDAMem IDA_mem; booleantype inactive_roots; @@ -2756,13 +2756,13 @@ int IDASolve(void *ida_mem, realtype tout, realtype *tret, * */ -int IDAGetDky(void *ida_mem, realtype t, int k, N_Vector dky) +int IDAGetDky(void *ida_mem, sunrealtype t, int k, N_Vector dky) { IDAMem IDA_mem; - realtype tfuzz, tp, delt, psij_1; + sunrealtype tfuzz, tp, delt, psij_1; int i, j, retval; - realtype cjk [MXORDP1]; - realtype cjk_1[MXORDP1]; + sunrealtype cjk [MXORDP1]; + sunrealtype cjk_1[MXORDP1]; /* Check ida_mem */ if (ida_mem == NULL) { @@ -2870,7 +2870,7 @@ int IDAGetDky(void *ida_mem, realtype t, int k, N_Vector dky) * This is just a wrapper that calls IDAGetQuadDky with k=0. */ -int IDAGetQuad(void *ida_mem, realtype *ptret, N_Vector yQout) +int IDAGetQuad(void *ida_mem, sunrealtype *ptret, N_Vector yQout) { IDAMem IDA_mem; int retval; @@ -2898,13 +2898,13 @@ int IDAGetQuad(void *ida_mem, realtype *ptret, N_Vector yQout) * derivatives up to the current method order) at any time within * the last integration step (dense output). */ -int IDAGetQuadDky(void *ida_mem, realtype t, int k, N_Vector dkyQ) +int IDAGetQuadDky(void *ida_mem, sunrealtype t, int k, N_Vector dkyQ) { IDAMem IDA_mem; - realtype tfuzz, tp, delt, psij_1; + sunrealtype tfuzz, tp, delt, psij_1; int i, j, retval; - realtype cjk [MXORDP1]; - realtype cjk_1[MXORDP1]; + sunrealtype cjk [MXORDP1]; + sunrealtype cjk_1[MXORDP1]; /* Check ida_mem */ if (ida_mem == NULL) { @@ -2995,7 +2995,7 @@ int IDAGetQuadDky(void *ida_mem, realtype t, int k, N_Vector dkyQ) * is=0, 1, ... ,NS-1. */ -int IDAGetSens(void *ida_mem, realtype *ptret, N_Vector *yySout) +int IDAGetSens(void *ida_mem, sunrealtype *ptret, N_Vector *yySout) { IDAMem IDA_mem; int is, ierr=0; @@ -3040,7 +3040,7 @@ int IDAGetSens(void *ida_mem, realtype *ptret, N_Vector *yySout) * a pointer to N_Vector and must be allocated by the user to hold at * least Ns vectors. */ -int IDAGetSensDky(void *ida_mem, realtype t, int k, N_Vector *dkySout) +int IDAGetSensDky(void *ida_mem, sunrealtype t, int k, N_Vector *dkySout) { int is, ier=0; IDAMem IDA_mem; @@ -3091,7 +3091,7 @@ int IDAGetSensDky(void *ida_mem, realtype t, int k, N_Vector *dkySout) * This is just a wrapper that calls IDASensDky1 with k=0. */ -int IDAGetSens1(void *ida_mem, realtype *ptret, int is, N_Vector yySret) +int IDAGetSens1(void *ida_mem, sunrealtype *ptret, int is, N_Vector yySret) { IDAMem IDA_mem; int retval; @@ -3125,13 +3125,13 @@ int IDAGetSens1(void *ida_mem, realtype *ptret, int is, N_Vector yySret) * function after a successful return from IDASolve with sensitivity * computation enabled. */ -int IDAGetSensDky1(void *ida_mem, realtype t, int k, int is, N_Vector dkyS) +int IDAGetSensDky1(void *ida_mem, sunrealtype t, int k, int is, N_Vector dkyS) { IDAMem IDA_mem; - realtype tfuzz, tp, delt, psij_1; + sunrealtype tfuzz, tp, delt, psij_1; int i, j, retval; - realtype cjk [MXORDP1]; - realtype cjk_1[MXORDP1]; + sunrealtype cjk [MXORDP1]; + sunrealtype cjk_1[MXORDP1]; /* Check all inputs for legality */ if (ida_mem == NULL) { @@ -3232,7 +3232,7 @@ int IDAGetSensDky1(void *ida_mem, realtype t, int k, int is, N_Vector dkyS) * is=0, 1, ... ,NS-1. */ -int IDAGetQuadSens(void *ida_mem, realtype *ptret, N_Vector *yyQSout) +int IDAGetQuadSens(void *ida_mem, sunrealtype *ptret, N_Vector *yyQSout) { IDAMem IDA_mem; int is, ierr=0; @@ -3277,7 +3277,7 @@ int IDAGetQuadSens(void *ida_mem, realtype *ptret, N_Vector *yyQSout) * a pointer to N_Vector and must be allocated by the user to hold at * least Ns vectors. */ -int IDAGetQuadSensDky(void *ida_mem, realtype t, int k, N_Vector *dkyQSout) +int IDAGetQuadSensDky(void *ida_mem, sunrealtype t, int k, N_Vector *dkyQSout) { int is, ier=0; IDAMem IDA_mem; @@ -3334,7 +3334,7 @@ int IDAGetQuadSensDky(void *ida_mem, realtype t, int k, N_Vector *dkyQSout) * This is just a wrapper that calls IDASensDky1 with k=0. */ -int IDAGetQuadSens1(void *ida_mem, realtype *ptret, int is, N_Vector yyQSret) +int IDAGetQuadSens1(void *ida_mem, sunrealtype *ptret, int is, N_Vector yyQSret) { IDAMem IDA_mem; int retval; @@ -3386,13 +3386,13 @@ int IDAGetQuadSens1(void *ida_mem, realtype *ptret, int is, N_Vector yyQSret) * function after a successful return from IDASolve with sensitivity * computation enabled. */ -int IDAGetQuadSensDky1(void *ida_mem, realtype t, int k, int is, N_Vector dkyQS) +int IDAGetQuadSensDky1(void *ida_mem, sunrealtype t, int k, int is, N_Vector dkyQS) { IDAMem IDA_mem; - realtype tfuzz, tp, delt, psij_1; + sunrealtype tfuzz, tp, delt, psij_1; int i, j, retval; - realtype cjk [MXORDP1]; - realtype cjk_1[MXORDP1]; + sunrealtype cjk [MXORDP1]; + sunrealtype cjk_1[MXORDP1]; /* Check all inputs for legality */ if (ida_mem == NULL) { @@ -4180,7 +4180,7 @@ static booleantype IDASensAllocVectors(IDAMem IDA_mem, N_Vector tmpl) /* Allocate space for pbar and plist */ IDA_mem->ida_pbar = NULL; - IDA_mem->ida_pbar = (realtype *)malloc(IDA_mem->ida_Ns*sizeof(realtype)); + IDA_mem->ida_pbar = (sunrealtype *)malloc(IDA_mem->ida_Ns*sizeof(sunrealtype)); if (IDA_mem->ida_pbar == NULL) { N_VDestroy(IDA_mem->ida_tmpS3); N_VDestroyVectorArray(IDA_mem->ida_ewtS, IDA_mem->ida_Ns); @@ -4979,11 +4979,11 @@ static int IDAQuadSensEwtSetSV(IDAMem IDA_mem, N_Vector *yQScur, N_Vector *weigh * the next step to reach tstop exactly. */ -static int IDAStopTest1(IDAMem IDA_mem, realtype tout, realtype *tret, +static int IDAStopTest1(IDAMem IDA_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask) { int ier; - realtype troundoff; + sunrealtype troundoff; if (IDA_mem->ida_tstopset) { @@ -5081,11 +5081,11 @@ static int IDAStopTest1(IDAMem IDA_mem, realtype tout, realtype *tret, * because the same test was made prior to the step. */ -static int IDAStopTest2(IDAMem IDA_mem, realtype tout, realtype *tret, +static int IDAStopTest2(IDAMem IDA_mem, sunrealtype tout, sunrealtype *tret, N_Vector yret, N_Vector ypret, int itask) { /* int ier; */ - realtype troundoff; + sunrealtype troundoff; if (IDA_mem->ida_tstopset) { @@ -5302,8 +5302,8 @@ static int IDAHandleFailure(IDAMem IDA_mem, int sflag) static int IDAStep(IDAMem IDA_mem) { - realtype saved_t, ck; - realtype err_k, err_km1, err_km2; + sunrealtype saved_t, ck; + sunrealtype err_k, err_km1, err_km2; int ncf, nef; int nflag, kflag; int retval; @@ -5534,10 +5534,10 @@ static int IDAStep(IDAMem IDA_mem) * Also, IDACompleteStep prohibits an order increase until ns = k + 2. */ -static void IDASetCoeffs(IDAMem IDA_mem, realtype *ck) +static void IDASetCoeffs(IDAMem IDA_mem, sunrealtype *ck) { int i, j, is; - realtype temp1, temp2, alpha0, alphas; + sunrealtype temp1, temp2, alpha0, alphas; /* Set coefficients for the current stepsize h */ @@ -5667,7 +5667,7 @@ static int IDANls(IDAMem IDA_mem) { int retval; booleantype constraintsPassed, callLSetup, sensi_sim; - realtype temp1, temp2, vnorm; + sunrealtype temp1, temp2, vnorm; N_Vector mm, tmp; long int nni_inc = 0; long int nnf_inc = 0; @@ -6064,11 +6064,11 @@ static void IDAQuadSensPredict(IDAMem IDA_mem, N_Vector *yQS, N_Vector *ypQS) * IDATestError returns either IDA_SUCCESS or ERROR_TEST_FAIL. */ -static int IDATestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2) +static int IDATestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2) { - realtype enorm_k, enorm_km1, enorm_km2; /* error norms */ - realtype terr_k, terr_km1, terr_km2; /* local truncation error norms */ + sunrealtype enorm_k, enorm_km1, enorm_km2; /* error norms */ + sunrealtype terr_k, terr_km1, terr_km2; /* local truncation error norms */ /* Compute error for order k. */ enorm_k = IDAWrmsNorm(IDA_mem, IDA_mem->ida_ee, IDA_mem->ida_ewt, IDA_mem->ida_suppressalg); @@ -6159,12 +6159,12 @@ static int IDATestError(IDAMem IDA_mem, realtype ck, * The return flag can be either IDA_SUCCESS or ERROR_TEST_FAIL. */ -static int IDAQuadTestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2) +static int IDAQuadTestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2) { - realtype enormQ; - realtype errQ_k, errQ_km1, errQ_km2; - realtype terr_k, terr_km1, terr_km2; + sunrealtype enormQ; + sunrealtype errQ_k, errQ_km1, errQ_km2; + sunrealtype terr_k, terr_km1, terr_km2; N_Vector tempv; booleantype check_for_reduction = SUNFALSE; @@ -6242,12 +6242,12 @@ static int IDAQuadTestError(IDAMem IDA_mem, realtype ck, * The return flag can be either IDA_SUCCESS or ERROR_TEST_FAIL. */ -static int IDASensTestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2) +static int IDASensTestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2) { - realtype enormS; - realtype errS_k, errS_km1, errS_km2; - realtype terr_k, terr_km1, terr_km2; + sunrealtype enormS; + sunrealtype errS_k, errS_km1, errS_km2; + sunrealtype terr_k, terr_km1, terr_km2; N_Vector *tempv; booleantype check_for_reduction = SUNFALSE; int retval; @@ -6340,12 +6340,12 @@ static int IDASensTestError(IDAMem IDA_mem, realtype ck, * The return flag can be either IDA_SUCCESS or ERROR_TEST_FAIL. */ -static int IDAQuadSensTestError(IDAMem IDA_mem, realtype ck, - realtype *err_k, realtype *err_km1, realtype *err_km2) +static int IDAQuadSensTestError(IDAMem IDA_mem, sunrealtype ck, + sunrealtype *err_k, sunrealtype *err_km1, sunrealtype *err_km2) { - realtype enormQS; - realtype errQS_k, errQS_km1, errQS_km2; - realtype terr_k, terr_km1, terr_km2; + sunrealtype enormQS; + sunrealtype errQS_k, errQS_km1, errQS_km2; + sunrealtype terr_k, terr_km1, terr_km2; N_Vector *tempv; booleantype check_for_reduction = SUNFALSE; int retval; @@ -6422,7 +6422,7 @@ static int IDAQuadSensTestError(IDAMem IDA_mem, realtype ck, * It changes back phi-star to phi (changed in IDASetCoeffs) */ -static void IDARestore(IDAMem IDA_mem, realtype saved_t) +static void IDARestore(IDAMem IDA_mem, sunrealtype saved_t) { int i, j, is; @@ -6534,10 +6534,10 @@ static void IDARestore(IDAMem IDA_mem, realtype saved_t) * IDA_REP_QRHS_ERR */ -static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, realtype err_k, realtype err_km1, +static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, sunrealtype err_km1, long int *ncfnPtr, int *ncfPtr, long int *netfPtr, int *nefPtr) { - realtype err_knew; + sunrealtype err_knew; IDA_mem->ida_phase = 1; @@ -6710,12 +6710,12 @@ static void IDAReset(IDAMem IDA_mem) * stepsize and order for the next step, and updates the phi array. */ -static void IDACompleteStep(IDAMem IDA_mem, realtype err_k, realtype err_km1) +static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_km1) { int i, j, is, kdiff, action; - realtype terr_k, terr_km1, terr_kp1; - realtype err_knew, err_kp1; - realtype enorm, tmp, hnew; + sunrealtype terr_k, terr_km1, terr_kp1; + sunrealtype err_knew, err_kp1; + sunrealtype enorm, tmp, hnew; N_Vector tempvQ, *tempvS; IDA_mem->ida_nst++; @@ -7022,10 +7022,10 @@ static void IDACompleteStep(IDAMem IDA_mem, realtype err_k, realtype err_km1) * IDA_BAD_T if t is not within the interval of the last step taken. */ -int IDAGetSolution(void *ida_mem, realtype t, N_Vector yret, N_Vector ypret) +int IDAGetSolution(void *ida_mem, sunrealtype t, N_Vector yret, N_Vector ypret) { IDAMem IDA_mem; - realtype tfuzz, tp, delt, c, d, gam; + sunrealtype tfuzz, tp, delt, c, d, gam; int j, kord, retval; if (ida_mem == NULL) { @@ -7096,10 +7096,10 @@ int IDAGetSolution(void *ida_mem, realtype t, N_Vector yret, N_Vector ypret) * mask = suppressalg otherwise. */ -realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, +sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, booleantype mask) { - realtype nrm; + sunrealtype nrm; if (mask) nrm = N_VWrmsNormMask(x, w, IDA_mem->ida_id); else nrm = N_VWrmsNorm(x, w); @@ -7121,11 +7121,11 @@ realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, * Declared global for use in the computation of IC for sensitivities. */ -realtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, +sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, booleantype mask) { int is; - realtype nrm; + sunrealtype nrm; if (mask) (void) N_VWrmsNormMaskVectorArray(IDA_mem->ida_Ns, xS, wS, @@ -7150,10 +7150,10 @@ realtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, * max { wrms(xQS[0],wQS[0]) ... wrms(xQS[Ns-1],wQS[Ns-1]) } */ -static realtype IDAQuadSensWrmsNorm(IDAMem IDA_mem, N_Vector *xQS, N_Vector *wQS) +static sunrealtype IDAQuadSensWrmsNorm(IDAMem IDA_mem, N_Vector *xQS, N_Vector *wQS) { int is; - realtype nrm; + sunrealtype nrm; (void) N_VWrmsNormVectorArray(IDA_mem->ida_Ns, xQS, wQS, IDA_mem->ida_cvals); @@ -7171,10 +7171,10 @@ static realtype IDAQuadSensWrmsNorm(IDAMem IDA_mem, N_Vector *xQS, N_Vector *wQS * Updates the norm old_nrm to account for all quadratures. */ -static realtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, +static sunrealtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector xQ, N_Vector wQ) { - realtype qnrm; + sunrealtype qnrm; qnrm = N_VWrmsNorm(xQ, wQ); if (old_nrm > qnrm) return(old_nrm); @@ -7190,21 +7190,21 @@ static realtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, * IC for sensitivities, */ -realtype IDASensWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, +sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS, booleantype mask) { - realtype snrm; + sunrealtype snrm; snrm = IDASensWrmsNorm(IDA_mem, xS, wS, mask); if (old_nrm > snrm) return(old_nrm); else return(snrm); } -static realtype IDAQuadSensWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, +static sunrealtype IDAQuadSensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xQS, N_Vector *wQS) { - realtype qsnrm; + sunrealtype qsnrm; qsnrm = IDAQuadSensWrmsNorm(IDA_mem, xQS, wQS); if (old_nrm > qsnrm) return(old_nrm); @@ -7232,7 +7232,7 @@ static realtype IDAQuadSensWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, static int IDARcheck1(IDAMem IDA_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; for (i = 0; i < IDA_mem->ida_nrtfn; i++) @@ -7301,7 +7301,7 @@ static int IDARcheck1(IDAMem IDA_mem) static int IDARcheck2(IDAMem IDA_mem) { int i, retval; - realtype smallh, hratio, tplus; + sunrealtype smallh, hratio, tplus; booleantype zroot; if (IDA_mem->ida_irfnd == 0) return(IDA_SUCCESS); @@ -7496,7 +7496,7 @@ static int IDARcheck3(IDAMem IDA_mem) static int IDARootfind(IDAMem IDA_mem) { - realtype alph, tmid, gfrac, maxfrac, fracint, fracsub; + sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; booleantype zroot, sgnchg; @@ -7681,7 +7681,7 @@ static int IDARootfind(IDAMem IDA_mem) * >0 for a recoverable error. */ -int IDASensResDQ(int Ns, realtype t, +int IDASensResDQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_dataS, @@ -7710,7 +7710,7 @@ int IDASensResDQ(int Ns, realtype t, * (<0 if res fails unrecoverably, >0 if res has a recoverable error). */ -static int IDASensRes1DQ(int Ns, realtype t, +static int IDASensRes1DQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, int is, N_Vector yyS, N_Vector ypS, N_Vector resvalS, @@ -7721,12 +7721,12 @@ static int IDASensRes1DQ(int Ns, realtype t, int method; int which; int retval; - realtype psave, pbari; - realtype del , rdel; - realtype Delp, rDelp, r2Delp; - realtype Dely, rDely, r2Dely; - realtype Del , rDel , r2Del ; - realtype norms, ratio; + sunrealtype psave, pbari; + sunrealtype del , rdel; + sunrealtype Delp, rDelp, r2Delp; + sunrealtype Dely, rDely, r2Dely; + sunrealtype Del , rDel , r2Del ; + sunrealtype norms, ratio; /* user_dataS points to IDA_mem */ IDA_mem = (IDAMem) user_dataS; @@ -7908,7 +7908,7 @@ static int IDASensRes1DQ(int Ns, realtype t, * done in IDAQuadSensRhs1InternalDQ. */ -static int IDAQuadSensRhsInternalDQ(int Ns, realtype t, +static int IDAQuadSensRhsInternalDQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector rrQ, N_Vector *resvalQS, @@ -7932,7 +7932,7 @@ static int IDAQuadSensRhsInternalDQ(int Ns, realtype t, return(0); } -static int IDAQuadSensRhs1InternalDQ(IDAMem IDA_mem, int is, realtype t, +static int IDAQuadSensRhs1InternalDQ(IDAMem IDA_mem, int is, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector yyS, N_Vector ypS, N_Vector resvalQ, N_Vector resvalQS, @@ -7940,12 +7940,12 @@ static int IDAQuadSensRhs1InternalDQ(IDAMem IDA_mem, int is, realtype t, { int retval, method; int nfel = 0, which; - realtype psave, pbari; - realtype del , rdel; - realtype Delp; - realtype Dely, rDely; - realtype Del , r2Del ; - realtype norms; + sunrealtype psave, pbari; + sunrealtype del , rdel; + sunrealtype Delp; + sunrealtype Dely, rDely; + sunrealtype Del , r2Del ; + sunrealtype norms; del = SUNRsqrt(SUNMAX(IDA_mem->ida_rtol, IDA_mem->ida_uround)); rdel = ONE/del; diff --git a/src/idas/idas_bbdpre.c b/src/idas/idas_bbdpre.c index 230762dbbd..d3b50a3bea 100644 --- a/src/idas/idas_bbdpre.c +++ b/src/idas/idas_bbdpre.c @@ -39,25 +39,25 @@ #define TWO RCONST(2.0) /* Prototypes of IDABBDPrecSetup and IDABBDPrecSolve */ -static int IDABBDPrecSetup(realtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, realtype c_j, void *prec_data); -static int IDABBDPrecSolve(realtype tt, N_Vector yy, N_Vector yp, +static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, + N_Vector rr, sunrealtype c_j, void *prec_data); +static int IDABBDPrecSolve(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *prec_data); + sunrealtype c_j, sunrealtype delta, void *prec_data); /* Prototype for IDABBDPrecFree */ static int IDABBDPrecFree(IDAMem ida_mem); /* Prototype for difference quotient Jacobian calculation routine */ -static int IBBDDQJac(IBBDPrecData pdata, realtype tt, realtype cj, +static int IBBDDQJac(IBBDPrecData pdata, sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector gref, N_Vector ytemp, N_Vector yptemp, N_Vector gtemp); /* Wrapper functions for adjoint code */ -static int IDAAglocal(sunindextype NlocalB, realtype tt, N_Vector yyB, +static int IDAAglocal(sunindextype NlocalB, sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector gvalB, void *user_dataB); -static int IDAAgcomm(sunindextype NlocalB, realtype tt, N_Vector yyB, +static int IDAAgcomm(sunindextype NlocalB, sunrealtype tt, N_Vector yyB, N_Vector ypB, void *user_dataB); /* Prototype for the pfree routine for backward problems. */ @@ -74,7 +74,7 @@ static int IDABBDPrecFreeB(IDABMem IDAB_mem); int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dq_rel_yy, + sunrealtype dq_rel_yy, IDABBDLocalFn Gres, IDABBDCommFn Gcomm) { IDAMem IDA_mem; @@ -296,7 +296,7 @@ int IDABBDPrecInit(void *ida_mem, sunindextype Nlocal, /*-------------------------------------------------------------*/ int IDABBDPrecReInit(void *ida_mem, sunindextype mudq, - sunindextype mldq, realtype dq_rel_yy) + sunindextype mldq, sunrealtype dq_rel_yy) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -449,8 +449,8 @@ int IDABBDPrecGetNumGfnEvals(void *ida_mem, > 0 for a recoverable error (step will be retried), or < 0 for a nonrecoverable error (step fails). ----------------------------------------------------------------*/ -static int IDABBDPrecSetup(realtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, realtype c_j, void *bbd_data) +static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, + N_Vector rr, sunrealtype c_j, void *bbd_data) { IBBDPrecData pdata; IDAMem IDA_mem; @@ -499,9 +499,9 @@ static int IDABBDPrecSetup(realtype tt, N_Vector yy, N_Vector yp, IDABBDPrecSolve returns the value returned from the linear solver object. ---------------------------------------------------------------*/ -static int IDABBDPrecSolve(realtype tt, N_Vector yy, N_Vector yp, +static int IDABBDPrecSolve(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector rvec, N_Vector zvec, - realtype c_j, realtype delta, void *bbd_data) + sunrealtype c_j, sunrealtype delta, void *bbd_data) { IBBDPrecData pdata; int retval; @@ -570,17 +570,17 @@ static int IDABBDPrecFree(IDAMem IDA_mem) Return values are: 0 (success), > 0 (recoverable error), or < 0 (nonrecoverable error). ----------------------------------------------------------------*/ -static int IBBDDQJac(IBBDPrecData pdata, realtype tt, realtype cj, +static int IBBDDQJac(IBBDPrecData pdata, sunrealtype tt, sunrealtype cj, N_Vector yy, N_Vector yp, N_Vector gref, N_Vector ytemp, N_Vector yptemp, N_Vector gtemp) { IDAMem IDA_mem; - realtype inc, inc_inv; + sunrealtype inc, inc_inv; int retval; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *ydata, *ypdata, *ytempdata, *yptempdata, *grefdata, *gtempdata; - realtype *cnsdata = NULL, *ewtdata; - realtype *col_j, conj, yj, ypj, ewtj; + sunrealtype *ydata, *ypdata, *ytempdata, *yptempdata, *grefdata, *gtempdata; + sunrealtype *cnsdata = NULL, *ewtdata; + sunrealtype *col_j, conj, yj, ypj, ewtj; IDA_mem = (IDAMem) pdata->ida_mem; @@ -691,7 +691,7 @@ static int IBBDDQJac(IBBDPrecData pdata, realtype tt, realtype cj, int IDABBDPrecInitB(void *ida_mem, int which, sunindextype NlocalB, sunindextype mudqB, sunindextype mldqB, sunindextype mukeepB, sunindextype mlkeepB, - realtype dq_rel_yyB, IDABBDLocalFnB glocalB, + sunrealtype dq_rel_yyB, IDABBDLocalFnB glocalB, IDABBDCommFnB gcommB) { IDAMem IDA_mem; @@ -763,7 +763,7 @@ int IDABBDPrecInitB(void *ida_mem, int which, sunindextype NlocalB, /*-------------------------------------------------------------*/ int IDABBDPrecReInitB(void *ida_mem, int which, sunindextype mudqB, - sunindextype mldqB, realtype dq_rel_yyB) + sunindextype mldqB, sunrealtype dq_rel_yyB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -829,7 +829,7 @@ static int IDABBDPrecFreeB(IDABMem IDAB_mem) This routine interfaces to the IDALocalFnB routine provided by the user. ----------------------------------------------------------------*/ -static int IDAAglocal(sunindextype NlocalB, realtype tt, N_Vector yyB, +static int IDAAglocal(sunindextype NlocalB, sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector gvalB, void *ida_mem) { IDAMem IDA_mem; @@ -870,7 +870,7 @@ static int IDAAglocal(sunindextype NlocalB, realtype tt, N_Vector yyB, This routine interfaces to the IDACommFnB routine provided by the user. ----------------------------------------------------------------*/ -static int IDAAgcomm(sunindextype NlocalB, realtype tt, +static int IDAAgcomm(sunindextype NlocalB, sunrealtype tt, N_Vector yyB, N_Vector ypB, void *ida_mem) { IDAMem IDA_mem; diff --git a/src/idas/idas_bbdpre_impl.h b/src/idas/idas_bbdpre_impl.h index c2263b68e3..d63e44e608 100644 --- a/src/idas/idas_bbdpre_impl.h +++ b/src/idas/idas_bbdpre_impl.h @@ -40,7 +40,7 @@ typedef struct IBBDPrecDataRec { /* passed by user to IDABBDPrecAlloc and used by IDABBDPrecSetup/IDABBDPrecSolve functions */ sunindextype mudq, mldq, mukeep, mlkeep; - realtype rel_yy; + sunrealtype rel_yy; IDABBDLocalFn glocal; IDABBDCommFn gcomm; diff --git a/src/idas/idas_ic.c b/src/idas/idas_ic.c index 0d273414be..b5f2476450 100644 --- a/src/idas/idas_ic.c +++ b/src/idas/idas_ic.c @@ -58,11 +58,11 @@ */ extern int IDAInitialSetup(IDAMem IDA_mem); -extern realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, +extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, booleantype mask); -extern realtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, +extern sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, booleantype mask); -extern realtype IDASensWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, +extern sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS, booleantype mask); @@ -71,15 +71,15 @@ extern int IDASensEwtSet(IDAMem IDA_mem, N_Vector *yScur, N_Vector *weightS); static int IDANlsIC(IDAMem IDA_mem); static int IDANewtonIC(IDAMem IDA_mem); -static int IDALineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm); -static int IDAfnorm(IDAMem IDA_mem, realtype *fnorm); -static int IDANewyyp(IDAMem IDA_mem, realtype lambda); +static int IDALineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm); +static int IDAfnorm(IDAMem IDA_mem, sunrealtype *fnorm); +static int IDANewyyp(IDAMem IDA_mem, sunrealtype lambda); static int IDANewy(IDAMem IDA_mem); static int IDASensNewtonIC(IDAMem IDA_mem); -static int IDASensLineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm); -static int IDASensNewyyp(IDAMem IDA_mem, realtype lambda); -static int IDASensfnorm(IDAMem IDA_mem, realtype *fnorm); +static int IDASensLineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm); +static int IDASensNewyyp(IDAMem IDA_mem, sunrealtype lambda); +static int IDASensfnorm(IDAMem IDA_mem, sunrealtype *fnorm); static int IDASensNlsIC(IDAMem IDA_mem); static int IDAICFailFlag(IDAMem IDA_mem, int retval); @@ -119,12 +119,12 @@ static int IDAICFailFlag(IDAMem IDA_mem, int retval); * ----------------------------------------------------------------- */ -int IDACalcIC(void *ida_mem, int icopt, realtype tout1) +int IDACalcIC(void *ida_mem, int icopt, sunrealtype tout1) { int ewtsetOK; int ier, nwt, nh, mxnh, icret, retval=0; int is; - realtype tdist, troundoff, minid, hic, ypnorm; + sunrealtype tdist, troundoff, minid, hic, ypnorm; IDAMem IDA_mem; booleantype sensi_stg, sensi_sim; @@ -592,7 +592,7 @@ static int IDANlsIC(IDAMem IDA_mem) static int IDANewtonIC(IDAMem IDA_mem) { int retval, mnewt, is; - realtype delnorm, fnorm, fnorm0, oldfnrm, rate; + sunrealtype delnorm, fnorm, fnorm0, oldfnrm, rate; booleantype sensi_sim; /* Are we computing sensitivities with the IDA_SIMULTANEOUS approach? */ @@ -695,11 +695,11 @@ static int IDANewtonIC(IDAMem IDA_mem) * ----------------------------------------------------------------- */ -static int IDALineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm) +static int IDALineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm) { booleantype conOK; int retval, is, nbacks; - realtype f1norm, fnormp, f1normp, ratio, lambda, minlam, slpi; + sunrealtype f1norm, fnormp, f1normp, ratio, lambda, minlam, slpi; N_Vector mc; booleantype sensi_sim; @@ -812,7 +812,7 @@ static int IDALineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm) * ----------------------------------------------------------------- */ -static int IDAfnorm(IDAMem IDA_mem, realtype *fnorm) +static int IDAfnorm(IDAMem IDA_mem, sunrealtype *fnorm) { int retval, is; @@ -896,7 +896,7 @@ static int IDAfnorm(IDAMem IDA_mem, realtype *fnorm) * ----------------------------------------------------------------- */ -static int IDANewyyp(IDAMem IDA_mem, realtype lambda) +static int IDANewyyp(IDAMem IDA_mem, sunrealtype lambda) { int retval; @@ -1070,7 +1070,7 @@ static int IDASensNlsIC(IDAMem IDA_mem) static int IDASensNewtonIC(IDAMem IDA_mem) { int retval, is, mnewt; - realtype delnorm, fnorm, fnorm0, oldfnrm, rate; + sunrealtype delnorm, fnorm, fnorm0, oldfnrm, rate; for(is=0;isida_Ns;is++) { @@ -1147,11 +1147,11 @@ static int IDASensNewtonIC(IDAMem IDA_mem) * ----------------------------------------------------------------- */ -static int IDASensLineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm) +static int IDASensLineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm) { int is, retval, nbacks; - realtype f1norm, fnormp, f1normp, slpi, minlam; - realtype lambda, ratio; + sunrealtype f1norm, fnormp, f1normp, slpi, minlam; + sunrealtype lambda, ratio; /* Set work space pointer. */ IDA_mem->ida_dtemp = IDA_mem->ida_phi[3]; @@ -1218,7 +1218,7 @@ static int IDASensLineSrch(IDAMem IDA_mem, realtype *delnorm, realtype *fnorm) * ----------------------------------------------------------------- */ -static int IDASensfnorm(IDAMem IDA_mem, realtype *fnorm) +static int IDASensfnorm(IDAMem IDA_mem, sunrealtype *fnorm) { int is, retval; @@ -1271,7 +1271,7 @@ static int IDASensfnorm(IDAMem IDA_mem, realtype *fnorm) * ----------------------------------------------------------------- */ -static int IDASensNewyyp(IDAMem IDA_mem, realtype lambda) +static int IDASensNewyyp(IDAMem IDA_mem, sunrealtype lambda) { int is; diff --git a/src/idas/idas_impl.h b/src/idas/idas_impl.h index ee29def3ea..81fce140c2 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -101,7 +101,7 @@ typedef struct IDAMemRec { SUNContext ida_sunctx; - realtype ida_uround; /* machine unit roundoff */ + sunrealtype ida_uround; /* machine unit roundoff */ /*-------------------------- Problem Specification Data @@ -111,8 +111,8 @@ typedef struct IDAMemRec { void *ida_user_data; /* user pointer passed to res */ int ida_itol; /* itol = IDA_SS, IDA_SV, IDA_WF, IDA_NN */ - realtype ida_rtol; /* relative tolerance */ - realtype ida_Satol; /* scalar absolute tolerance */ + sunrealtype ida_rtol; /* relative tolerance */ + sunrealtype ida_Satol; /* scalar absolute tolerance */ N_Vector ida_Vatol; /* vector absolute tolerance */ booleantype ida_atolmin0; /* flag indicating that min(atol) = 0 */ booleantype ida_user_efun; /* SUNTRUE if user provides efun */ @@ -136,8 +136,8 @@ typedef struct IDAMemRec { booleantype ida_errconQ; int ida_itolQ; - realtype ida_rtolQ; - realtype ida_SatolQ; /* scalar absolute tolerance for quadratures */ + sunrealtype ida_rtolQ; + sunrealtype ida_SatolQ; /* scalar absolute tolerance for quadratures */ N_Vector ida_VatolQ; /* vector absolute tolerance for quadratures */ booleantype ida_atolQmin0; /* flag indicating that min(atolQ) = 0 */ @@ -153,17 +153,17 @@ typedef struct IDAMemRec { void *ida_user_dataS; booleantype ida_resSDQ; - realtype *ida_p; - realtype *ida_pbar; + sunrealtype *ida_p; + sunrealtype *ida_pbar; int *ida_plist; int ida_DQtype; - realtype ida_DQrhomax; + sunrealtype ida_DQrhomax; booleantype ida_errconS; /* SUNTRUE if sensitivities in err. control */ int ida_itolS; - realtype ida_rtolS; /* relative tolerance for sensitivities */ - realtype *ida_SatolS; /* scalar absolute tolerances for sensi. */ + sunrealtype ida_rtolS; /* relative tolerance for sensitivities */ + sunrealtype *ida_SatolS; /* scalar absolute tolerances for sensi. */ N_Vector *ida_VatolS; /* vector absolute tolerances for sensi. */ booleantype *ida_atolSmin0; /* flag indicating that min(atolS[is]) = 0 */ @@ -180,8 +180,8 @@ typedef struct IDAMemRec { booleantype ida_errconQS; /* SUNTRUE if yQS are considered in err. con. */ int ida_itolQS; - realtype ida_rtolQS; /* relative tolerance for yQS */ - realtype *ida_SatolQS; /* scalar absolute tolerances for yQS */ + sunrealtype ida_rtolQS; /* relative tolerance for yQS */ + sunrealtype *ida_SatolQS; /* scalar absolute tolerances for yQS */ N_Vector *ida_VatolQS; /* vector absolute tolerances for yQS */ booleantype *ida_atolQSmin0; /* flag indicating that min(atolQS[is]) = 0 */ @@ -191,11 +191,11 @@ typedef struct IDAMemRec { N_Vector ida_phi[MXORDP1]; /* phi = (maxord+1) arrays of divided differences */ - realtype ida_psi[MXORDP1]; /* differences in t (sums of recent step sizes) */ - realtype ida_alpha[MXORDP1]; /* ratios of current stepsize to psi values */ - realtype ida_beta[MXORDP1]; /* ratios of current to previous product of psi's */ - realtype ida_sigma[MXORDP1]; /* product successive alpha values and factorial */ - realtype ida_gamma[MXORDP1]; /* sum of reciprocals of psi values */ + sunrealtype ida_psi[MXORDP1]; /* differences in t (sums of recent step sizes) */ + sunrealtype ida_alpha[MXORDP1]; /* ratios of current stepsize to psi values */ + sunrealtype ida_beta[MXORDP1]; /* ratios of current to previous product of psi's */ + sunrealtype ida_sigma[MXORDP1]; /* product successive alpha values and factorial */ + sunrealtype ida_gamma[MXORDP1]; /* sum of reciprocals of psi values */ /*------------------------- N_Vectors for integration @@ -277,7 +277,7 @@ typedef struct IDAMemRec { Variables for use by IDACalcIC ------------------------------*/ - realtype ida_t0; /* initial t */ + sunrealtype ida_t0; /* initial t */ N_Vector ida_yy0; /* initial y vector (user-supplied). */ N_Vector ida_yp0; /* initial y' vector (user-supplied). */ @@ -289,14 +289,14 @@ typedef struct IDAMemRec { int ida_nbacktr; /* number of IC linesearch backtrack operations */ int ida_sysindex; /* computed system index (0 or 1) */ int ida_maxbacks; /* max backtracks per Newton step */ - realtype ida_epiccon; /* IC nonlinear convergence test constant */ - realtype ida_steptol; /* minimum Newton step size in IC calculation */ - realtype ida_tscale; /* time scale factor = abs(tout1 - t0) */ + sunrealtype ida_epiccon; /* IC nonlinear convergence test constant */ + sunrealtype ida_steptol; /* minimum Newton step size in IC calculation */ + sunrealtype ida_tscale; /* time scale factor = abs(tout1 - t0) */ /* Tstop information */ booleantype ida_tstopset; - realtype ida_tstop; + sunrealtype ida_tstop; /* Step Data */ @@ -306,24 +306,24 @@ typedef struct IDAMemRec { int ida_phase; /* flag to trigger step doubling in first few steps */ int ida_ns; /* counts steps at fixed stepsize and order */ - realtype ida_hin; /* initial step */ - realtype ida_h0u; /* actual initial stepsize */ - realtype ida_hh; /* current step size h */ - realtype ida_hused; /* step size used on last successful step */ - realtype ida_eta; /* eta = hnext / hused */ - realtype ida_tn; /* current internal value of t */ - realtype ida_tretlast; /* value of tret previously returned by IDASolve */ - realtype ida_cj; /* current value of scalar (-alphas/hh) in Jacobian */ - realtype ida_cjlast; /* cj value saved from last successful step */ - realtype ida_cjold; /* cj value saved from last call to lsetup */ - realtype ida_cjratio; /* ratio of cj values: cj/cjold */ - realtype ida_ss; /* scalar used in Newton iteration convergence test */ - realtype ida_oldnrm; /* norm of previous nonlinear solver update */ - realtype ida_epsNewt; /* test constant in Newton convergence test */ - realtype ida_epcon; /* coeficient of the Newton covergence test */ - realtype ida_toldel; /* tolerance in direct test on Newton corrections */ - - realtype ida_ssS; /* scalar ss for staggered sensitivities */ + sunrealtype ida_hin; /* initial step */ + sunrealtype ida_h0u; /* actual initial stepsize */ + sunrealtype ida_hh; /* current step size h */ + sunrealtype ida_hused; /* step size used on last successful step */ + sunrealtype ida_eta; /* eta = hnext / hused */ + sunrealtype ida_tn; /* current internal value of t */ + sunrealtype ida_tretlast; /* value of tret previously returned by IDASolve */ + sunrealtype ida_cj; /* current value of scalar (-alphas/hh) in Jacobian */ + sunrealtype ida_cjlast; /* cj value saved from last successful step */ + sunrealtype ida_cjold; /* cj value saved from last call to lsetup */ + sunrealtype ida_cjratio; /* ratio of cj values: cj/cjold */ + sunrealtype ida_ss; /* scalar used in Newton iteration convergence test */ + sunrealtype ida_oldnrm; /* norm of previous nonlinear solver update */ + sunrealtype ida_epsNewt; /* test constant in Newton convergence test */ + sunrealtype ida_epcon; /* coeficient of the Newton covergence test */ + sunrealtype ida_toldel; /* tolerance in direct test on Newton corrections */ + + sunrealtype ida_ssS; /* scalar ss for staggered sensitivities */ /*------ Limits @@ -335,16 +335,16 @@ typedef struct IDAMemRec { int ida_maxord; /* max value of method order k: */ int ida_maxord_alloc; /* value of maxord used when allocating memory */ long int ida_mxstep; /* max number of internal steps for one user call */ - realtype ida_hmax_inv; /* inverse of max. step size hmax (default = 0.0) */ - realtype ida_hmin; /* min step size hmin (default = 0.0) */ + sunrealtype ida_hmax_inv; /* inverse of max. step size hmax (default = 0.0) */ + sunrealtype ida_hmin; /* min step size hmin (default = 0.0) */ - realtype ida_eta_max_fx; /* threshold to increase step size */ - realtype ida_eta_min_fx; /* threshold to decrease step size */ - realtype ida_eta_max; /* max step size increase factor */ - realtype ida_eta_min; /* min step size decrease factor */ - realtype ida_eta_low; /* upper bound on decrease factor */ - realtype ida_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ - realtype ida_eta_cf; /* eta on a nonlinear solver convergence failure */ + sunrealtype ida_eta_max_fx; /* threshold to increase step size */ + sunrealtype ida_eta_min_fx; /* threshold to decrease step size */ + sunrealtype ida_eta_max; /* max step size increase factor */ + sunrealtype ida_eta_min; /* min step size decrease factor */ + sunrealtype ida_eta_low; /* upper bound on decrease factor */ + sunrealtype ida_eta_min_ef; /* eta >= eta_min_ef after an error test failure */ + sunrealtype ida_eta_cf; /* eta on a nonlinear solver convergence failure */ /*-------- Counters @@ -382,14 +382,14 @@ typedef struct IDAMemRec { Space requirements ------------------*/ - sunindextype ida_lrw1; /* no. of realtype words in 1 N_Vector */ + sunindextype ida_lrw1; /* no. of sunrealtype words in 1 N_Vector */ sunindextype ida_liw1; /* no. of integer words in 1 N_Vector */ sunindextype ida_lrw1Q; sunindextype ida_liw1Q; - long int ida_lrw; /* number of realtype words in IDA work vectors */ + long int ida_lrw; /* number of sunrealtype words in IDA work vectors */ long int ida_liw; /* no. of integer words in IDA work vectors */ - realtype ida_tolsf; /* tolerance scale factor (saved value) */ + sunrealtype ida_tolsf; /* tolerance scale factor (saved value) */ /*------------------------------------------- Error handler function and error ouput file @@ -482,7 +482,7 @@ typedef struct IDAMemRec { /* Linear Solver specific memory */ void *ida_lmem; /* linear solver interface structure */ - realtype ida_dcj; /* parameter that determines cj ratio thresholds for calling + sunrealtype ida_dcj; /* parameter that determines cj ratio thresholds for calling * the linear solver setup function */ /* Flag to request a call to the setup routine */ @@ -501,14 +501,14 @@ typedef struct IDAMemRec { int ida_nrtfn; /* number of components of g */ int *ida_iroots; /* array for root information */ int *ida_rootdir; /* array specifying direction of zero-crossing */ - realtype ida_tlo; /* nearest endpoint of interval in root search */ - realtype ida_thi; /* farthest endpoint of interval in root search */ - realtype ida_trout; /* t return value from rootfinder routine */ - realtype *ida_glo; /* saved array of g values at t = tlo */ - realtype *ida_ghi; /* saved array of g values at t = thi */ - realtype *ida_grout; /* array of g values at t = trout */ - realtype ida_toutc; /* copy of tout (if NORMAL mode) */ - realtype ida_ttol; /* tolerance on root location */ + sunrealtype ida_tlo; /* nearest endpoint of interval in root search */ + sunrealtype ida_thi; /* farthest endpoint of interval in root search */ + sunrealtype ida_trout; /* t return value from rootfinder routine */ + sunrealtype *ida_glo; /* saved array of g values at t = tlo */ + sunrealtype *ida_ghi; /* saved array of g values at t = thi */ + sunrealtype *ida_grout; /* array of g values at t = trout */ + sunrealtype ida_toutc; /* copy of tout (if NORMAL mode) */ + sunrealtype ida_ttol; /* tolerance on root location */ int ida_taskc; /* copy of parameter itask */ int ida_irfnd; /* flag showing whether last step had a root */ long int ida_nge; /* counter for g evaluations */ @@ -518,8 +518,8 @@ typedef struct IDAMemRec { /* Arrays for Fused Vector Operations */ /* scalar arrays */ - realtype* ida_cvals; - realtype ida_dvals[MAXORD_DEFAULT]; + sunrealtype* ida_cvals; + sunrealtype ida_dvals[MAXORD_DEFAULT]; /* vector arrays */ N_Vector* ida_Xvecs; @@ -571,7 +571,7 @@ typedef struct IDABMemRec *IDABMem; typedef booleantype (*IDAAMMallocFn)(IDAMem IDA_mem); typedef void (*IDAAMFreeFn)(IDAMem IDA_mem); -typedef int (*IDAAGetYFn)(IDAMem IDA_mem, realtype t, +typedef int (*IDAAGetYFn)(IDAMem IDA_mem, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS); typedef int (*IDAAStorePntFn)(IDAMem IDA_mem, IDAdtpntMem d); @@ -589,8 +589,8 @@ typedef int (*IDAAStorePntFn)(IDAMem IDA_mem, IDAdtpntMem d); struct IDAckpntMemRec { /* Integration limits */ - realtype ck_t0; - realtype ck_t1; + sunrealtype ck_t0; + sunrealtype ck_t1; /* Modified divided difference array */ N_Vector ck_phi[MXORDP1]; @@ -619,28 +619,28 @@ struct IDAckpntMemRec { /* Step data */ long int ck_nst; - realtype ck_tretlast; + sunrealtype ck_tretlast; int ck_ns; int ck_kk; int ck_kused; int ck_knew; int ck_phase; - realtype ck_hh; - realtype ck_hused; - realtype ck_eta; - realtype ck_cj; - realtype ck_cjlast; - realtype ck_cjold; - realtype ck_cjratio; - realtype ck_ss; - realtype ck_ssS; - - realtype ck_psi[MXORDP1]; - realtype ck_alpha[MXORDP1]; - realtype ck_beta[MXORDP1]; - realtype ck_sigma[MXORDP1]; - realtype ck_gamma[MXORDP1]; + sunrealtype ck_hh; + sunrealtype ck_hused; + sunrealtype ck_eta; + sunrealtype ck_cj; + sunrealtype ck_cjlast; + sunrealtype ck_cjold; + sunrealtype ck_cjratio; + sunrealtype ck_ss; + sunrealtype ck_ssS; + + sunrealtype ck_psi[MXORDP1]; + sunrealtype ck_alpha[MXORDP1]; + sunrealtype ck_beta[MXORDP1]; + sunrealtype ck_sigma[MXORDP1]; + sunrealtype ck_gamma[MXORDP1]; /* How many phi, phiS, phiQ and phiQS were allocated? */ int ck_phi_alloc; @@ -660,7 +660,7 @@ struct IDAckpntMemRec { */ struct IDAdtpntMemRec { - realtype t; /* time */ + sunrealtype t; /* time */ void *content; /* interpType-dependent content */ }; @@ -699,7 +699,7 @@ struct IDABMemRec { int ida_index; /* Time at which the backward problem is initialized. */ - realtype ida_t0; + sunrealtype ida_t0; /* Memory for this backward problem */ IDAMem IDA_mem; @@ -735,7 +735,7 @@ struct IDABMemRec { int (*ida_pfree)(IDABMem IDAB_mem); /* Time at which to extract solution / quadratures */ - realtype ida_tout; + sunrealtype ida_tout; /* Workspace Nvectors */ N_Vector ida_yy; @@ -763,19 +763,19 @@ struct IDAadjMemRec { * -------------------- */ /* Integration interval */ - realtype ia_tinitial, ia_tfinal; + sunrealtype ia_tinitial, ia_tfinal; /* Flag for first call to IDASolveF */ booleantype ia_firstIDAFcall; /* Flag if IDASolveF was called with TSTOP */ booleantype ia_tstopIDAFcall; - realtype ia_tstopIDAF; + sunrealtype ia_tstopIDAF; /* Flag if IDASolveF was called in IDA_NORMAL_MODE and encountered a root after tout */ booleantype ia_rootret; - realtype ia_troot; + sunrealtype ia_troot; /* ---------------------- * Backward problems data @@ -845,7 +845,7 @@ struct IDAadjMemRec { /* Workspace for polynomial interpolation */ N_Vector ia_Y[MXORDP1]; /* pointers phi[i] */ N_Vector *ia_YS[MXORDP1]; /* pointers phiS[i] */ - realtype ia_T[MXORDP1]; + sunrealtype ia_T[MXORDP1]; /* Workspace for wrapper functions */ N_Vector ia_yyTmp, ia_ypTmp; @@ -968,13 +968,13 @@ void IDAErrHandler(int error_code, const char *module, const char *function, /* Norm functions. Also used for IC, so they are global.*/ -realtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, +sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, booleantype mask); -realtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, +sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, booleantype mask); -realtype IDASensWrmsNormUpdate(IDAMem IDA_mem, realtype old_nrm, +sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS, booleantype mask); @@ -986,7 +986,7 @@ int idaNlsInitSensStg(IDAMem IDA_mem); /* Prototype for internal sensitivity residual DQ function */ -int IDASensResDQ(int Ns, realtype t, +int IDASensResDQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector resval, N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS, void *user_dataS, diff --git a/src/idas/idas_io.c b/src/idas/idas_io.c index 6abe42efe3..2540823149 100644 --- a/src/idas/idas_io.c +++ b/src/idas/idas_io.c @@ -34,7 +34,7 @@ * ================================================================= */ -int IDASetDeltaCjLSetup(void *ida_mem, realtype dcj) +int IDASetDeltaCjLSetup(void *ida_mem, sunrealtype dcj) { IDAMem IDA_mem; @@ -109,8 +109,8 @@ int IDASetUserData(void *ida_mem, void *user_data) /*-----------------------------------------------------------------*/ -int IDASetEtaFixedStepBounds(void *ida_mem, realtype eta_min_fx, - realtype eta_max_fx) +int IDASetEtaFixedStepBounds(void *ida_mem, sunrealtype eta_min_fx, + sunrealtype eta_max_fx) { IDAMem IDA_mem; @@ -137,7 +137,7 @@ int IDASetEtaFixedStepBounds(void *ida_mem, realtype eta_min_fx, /*-----------------------------------------------------------------*/ -int IDASetEtaMax(void *ida_mem, realtype eta_max) +int IDASetEtaMax(void *ida_mem, sunrealtype eta_max) { IDAMem IDA_mem; @@ -159,7 +159,7 @@ int IDASetEtaMax(void *ida_mem, realtype eta_max) /*-----------------------------------------------------------------*/ -int IDASetEtaMin(void *ida_mem, realtype eta_min) +int IDASetEtaMin(void *ida_mem, sunrealtype eta_min) { IDAMem IDA_mem; @@ -181,7 +181,7 @@ int IDASetEtaMin(void *ida_mem, realtype eta_min) /*-----------------------------------------------------------------*/ -int IDASetEtaLow(void *ida_mem, realtype eta_low) +int IDASetEtaLow(void *ida_mem, sunrealtype eta_low) { IDAMem IDA_mem; @@ -203,7 +203,7 @@ int IDASetEtaLow(void *ida_mem, realtype eta_low) /*-----------------------------------------------------------------*/ -int IDASetEtaMinErrFail(void *ida_mem, realtype eta_min_ef) +int IDASetEtaMinErrFail(void *ida_mem, sunrealtype eta_min_ef) { IDAMem IDA_mem; @@ -225,7 +225,7 @@ int IDASetEtaMinErrFail(void *ida_mem, realtype eta_min_ef) /*-----------------------------------------------------------------*/ -int IDASetEtaConvFail(void *ida_mem, realtype eta_cf) +int IDASetEtaConvFail(void *ida_mem, sunrealtype eta_cf) { IDAMem IDA_mem; @@ -303,7 +303,7 @@ int IDASetMaxNumSteps(void *ida_mem, long int mxsteps) /*-----------------------------------------------------------------*/ -int IDASetInitStep(void *ida_mem, realtype hin) +int IDASetInitStep(void *ida_mem, sunrealtype hin) { IDAMem IDA_mem; @@ -321,7 +321,7 @@ int IDASetInitStep(void *ida_mem, realtype hin) /*-----------------------------------------------------------------*/ -int IDASetMaxStep(void *ida_mem, realtype hmax) +int IDASetMaxStep(void *ida_mem, sunrealtype hmax) { IDAMem IDA_mem; @@ -350,7 +350,7 @@ int IDASetMaxStep(void *ida_mem, realtype hmax) /*-----------------------------------------------------------------*/ -int IDASetMinStep(void *ida_mem, realtype hmin) +int IDASetMinStep(void *ida_mem, sunrealtype hmin) { IDAMem IDA_mem; @@ -380,7 +380,7 @@ int IDASetMinStep(void *ida_mem, realtype hmin) /*-----------------------------------------------------------------*/ -int IDASetStopTime(void *ida_mem, realtype tstop) +int IDASetStopTime(void *ida_mem, sunrealtype tstop) { IDAMem IDA_mem; @@ -430,7 +430,7 @@ int IDAClearStopTime(void *ida_mem) /*-----------------------------------------------------------------*/ -int IDASetNonlinConvCoef(void *ida_mem, realtype epcon) +int IDASetNonlinConvCoef(void *ida_mem, sunrealtype epcon) { IDAMem IDA_mem; @@ -589,7 +589,7 @@ int IDASetId(void *ida_mem, N_Vector id) int IDASetConstraints(void *ida_mem, N_Vector constraints) { IDAMem IDA_mem; - realtype temptest; + sunrealtype temptest; if (ida_mem==NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDAS", "IDASetConstraints", MSG_NO_MEM); @@ -704,7 +704,7 @@ int IDASetNoInactiveRootWarn(void *ida_mem) * ================================================================= */ -int IDASetNonlinConvCoefIC(void *ida_mem, realtype epiccon) +int IDASetNonlinConvCoefIC(void *ida_mem, sunrealtype epiccon) { IDAMem IDA_mem; @@ -837,7 +837,7 @@ int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff) /*-----------------------------------------------------------------*/ -int IDASetStepToleranceIC(void *ida_mem, realtype steptol) +int IDASetStepToleranceIC(void *ida_mem, sunrealtype steptol) { IDAMem IDA_mem; @@ -892,7 +892,7 @@ int IDASetQuadErrCon(void *ida_mem, booleantype errconQ) * ================================================================= */ -int IDASetSensDQMethod(void *ida_mem, int DQtype, realtype DQrhomax) +int IDASetSensDQMethod(void *ida_mem, int DQtype, sunrealtype DQrhomax) { IDAMem IDA_mem; @@ -962,7 +962,7 @@ int IDASetSensMaxNonlinIters(void *ida_mem, int maxcorS) /*-----------------------------------------------------------------*/ -int IDASetSensParams(void *ida_mem, realtype *p, realtype *pbar, int *plist) +int IDASetSensParams(void *ida_mem, sunrealtype *p, sunrealtype *pbar, int *plist) { IDAMem IDA_mem; int Ns, is; @@ -1209,7 +1209,7 @@ int IDAGetCurrentOrder(void *ida_mem, int *kcur) /*-----------------------------------------------------------------*/ -int IDAGetCurrentCj(void *ida_mem, realtype *cj) +int IDAGetCurrentCj(void *ida_mem, sunrealtype *cj) { IDAMem IDA_mem; @@ -1299,7 +1299,7 @@ int IDAGetCurrentYpSens(void *ida_mem, N_Vector **ypS) /*-----------------------------------------------------------------*/ -int IDAGetActualInitStep(void *ida_mem, realtype *hinused) +int IDAGetActualInitStep(void *ida_mem, sunrealtype *hinused) { IDAMem IDA_mem; @@ -1317,7 +1317,7 @@ int IDAGetActualInitStep(void *ida_mem, realtype *hinused) /*-----------------------------------------------------------------*/ -int IDAGetLastStep(void *ida_mem, realtype *hlast) +int IDAGetLastStep(void *ida_mem, sunrealtype *hlast) { IDAMem IDA_mem; @@ -1335,7 +1335,7 @@ int IDAGetLastStep(void *ida_mem, realtype *hlast) /*-----------------------------------------------------------------*/ -int IDAGetCurrentStep(void *ida_mem, realtype *hcur) +int IDAGetCurrentStep(void *ida_mem, sunrealtype *hcur) { IDAMem IDA_mem; @@ -1353,7 +1353,7 @@ int IDAGetCurrentStep(void *ida_mem, realtype *hcur) /*-----------------------------------------------------------------*/ -int IDAGetCurrentTime(void *ida_mem, realtype *tcur) +int IDAGetCurrentTime(void *ida_mem, sunrealtype *tcur) { IDAMem IDA_mem; @@ -1371,7 +1371,7 @@ int IDAGetCurrentTime(void *ida_mem, realtype *tcur) /*-----------------------------------------------------------------*/ -int IDAGetTolScaleFactor(void *ida_mem, realtype *tolsfact) +int IDAGetTolScaleFactor(void *ida_mem, sunrealtype *tolsfact) { IDAMem IDA_mem; @@ -1445,8 +1445,8 @@ int IDAGetWorkSpace(void *ida_mem, long int *lenrw, long int *leniw) int IDAGetIntegratorStats(void *ida_mem, long int *nsteps, long int *nrevals, long int *nlinsetups, long int *netfails, - int *klast, int *kcur, realtype *hinused, realtype *hlast, - realtype *hcur, realtype *tcur) + int *klast, int *kcur, sunrealtype *hinused, sunrealtype *hlast, + sunrealtype *hcur, sunrealtype *tcur) { IDAMem IDA_mem; @@ -2132,7 +2132,7 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nst > 0) { fprintf(outfile, "NLS iters per step = %"RSYM"\n", - (realtype) IDA_mem->ida_nre / (realtype) IDA_mem->ida_nst); + (sunrealtype) IDA_mem->ida_nre / (sunrealtype) IDA_mem->ida_nst); } /* linear solver stats */ @@ -2151,11 +2151,11 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nni > 0) { fprintf(outfile, "LS iters per NLS iter = %"RSYM"\n", - (realtype) idals_mem->nli / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nli / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, "Jac evals per NLS iter = %"RSYM"\n", - (realtype) idals_mem->nje / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nje / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, "Prec evals per NLS iter = %"RSYM"\n", - (realtype) idals_mem->npe / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->npe / (sunrealtype) IDA_mem->ida_nni); } } @@ -2216,7 +2216,7 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nst > 0) { fprintf(outfile, ",NLS iters per step,%"RSYM, - (realtype) IDA_mem->ida_nre / (realtype) IDA_mem->ida_nst); + (sunrealtype) IDA_mem->ida_nre / (sunrealtype) IDA_mem->ida_nst); } else { @@ -2239,11 +2239,11 @@ int IDAPrintAllStats(void *ida_mem, FILE *outfile, SUNOutputFormat fmt) if (IDA_mem->ida_nni > 0) { fprintf(outfile, ",LS iters per NLS iter,%"RSYM, - (realtype) idals_mem->nli / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nli / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, ",Jac evals per NLS iter,%"RSYM, - (realtype) idals_mem->nje / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->nje / (sunrealtype) IDA_mem->ida_nni); fprintf(outfile, ",Prec evals per NLS iter,%"RSYM, - (realtype) idals_mem->npe / (realtype) IDA_mem->ida_nni); + (sunrealtype) idals_mem->npe / (sunrealtype) IDA_mem->ida_nni); } else { diff --git a/src/idas/idas_ls.c b/src/idas/idas_ls.c index 09ac481fa6..ae7772a49c 100644 --- a/src/idas/idas_ls.c +++ b/src/idas/idas_ls.c @@ -41,49 +41,49 @@ PRIVATE FUNCTION PROTOTYPES =================================================================*/ -static int idaLsJacBWrapper(realtype tt, realtype c_jB, N_Vector yyB, +static int idaLsJacBWrapper(sunrealtype tt, sunrealtype c_jB, N_Vector yyB, N_Vector ypB, N_Vector rBr, SUNMatrix JacB, void *ida_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int idaLsJacBSWrapper(realtype tt, realtype c_jB, N_Vector yyB, +static int idaLsJacBSWrapper(sunrealtype tt, sunrealtype c_jB, N_Vector yyB, N_Vector ypB, N_Vector rBr, SUNMatrix JacB, void *ida_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -static int idaLsPrecSetupB(realtype tt, N_Vector yyB, +static int idaLsPrecSetupB(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *idaadj_mem); -static int idaLsPrecSetupBS(realtype tt, N_Vector yyB, + sunrealtype c_jB, void *idaadj_mem); +static int idaLsPrecSetupBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *idaadj_mem); + sunrealtype c_jB, void *idaadj_mem); -static int idaLsPrecSolveB(realtype tt, N_Vector yyB, +static int idaLsPrecSolveB(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector rvecB, N_Vector zvecB, - realtype c_jB, realtype deltaB, + sunrealtype c_jB, sunrealtype deltaB, void *idaadj_mem); -static int idaLsPrecSolveBS(realtype tt, N_Vector yyB, +static int idaLsPrecSolveBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector rvecB, N_Vector zvecB, - realtype c_jB, realtype deltaB, + sunrealtype c_jB, sunrealtype deltaB, void *idaadj_mem); -static int idaLsJacTimesSetupB(realtype tt, N_Vector yyB, +static int idaLsJacTimesSetupB(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *idaadj_mem); -static int idaLsJacTimesSetupBS(realtype tt, N_Vector yyB, + sunrealtype c_jB, void *idaadj_mem); +static int idaLsJacTimesSetupBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, - realtype c_jB, void *idaadj_mem); + sunrealtype c_jB, void *idaadj_mem); -static int idaLsJacTimesVecB(realtype tt, N_Vector yyB, +static int idaLsJacTimesVecB(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector vB, N_Vector JvB, - realtype c_jB, void *idaadj_mem, + sunrealtype c_jB, void *idaadj_mem, N_Vector tmp1B, N_Vector tmp2B); -static int idaLsJacTimesVecBS(realtype tt, N_Vector yyB, +static int idaLsJacTimesVecBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector vB, N_Vector JvB, - realtype c_jB, void *idaadj_mem, + sunrealtype c_jB, void *idaadj_mem, N_Vector tmp1B, N_Vector tmp2B); @@ -355,7 +355,7 @@ int IDASetJacFn(void *ida_mem, IDALsJacFn jac) /* IDASetEpsLin specifies the nonlinear -> linear tolerance scale factor */ -int IDASetEpsLin(void *ida_mem, realtype eplifac) +int IDASetEpsLin(void *ida_mem, sunrealtype eplifac) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -381,7 +381,7 @@ int IDASetEpsLin(void *ida_mem, realtype eplifac) /* IDASetWRMSNormFactor sets or computes the factor to use when converting from the integrator tolerance to the linear solver tolerance (WRMS to L2 norm). */ -int IDASetLSNormFactor(void *ida_mem, realtype nrmfac) +int IDASetLSNormFactor(void *ida_mem, sunrealtype nrmfac) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -432,7 +432,7 @@ int IDASetLinearSolutionScaling(void *ida_mem, booleantype onoff) /* IDASetIncrementFactor specifies increment factor for DQ approximations to Jv */ -int IDASetIncrementFactor(void *ida_mem, realtype dqincfac) +int IDASetIncrementFactor(void *ida_mem, sunrealtype dqincfac) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -941,7 +941,7 @@ int idaLsPSetup(void *ida_mem) is the only case in which the user's psolve routine is allowed to be NULL. ---------------------------------------------------------------*/ -int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, realtype tol, int lr) +int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -969,7 +969,7 @@ int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, realtype tol, int lr) implementations of the difference quotient Jacobian approximation routines. ---------------------------------------------------------------*/ -int idaLsDQJac(realtype t, realtype c_j, N_Vector y, N_Vector yp, +int idaLsDQJac(sunrealtype t, sunrealtype c_j, N_Vector y, N_Vector yp, N_Vector r, SUNMatrix Jac, void *ida_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { @@ -1031,12 +1031,12 @@ int idaLsDQJac(realtype t, realtype c_j, N_Vector y, N_Vector yp, actual computation of the jth column of the Jacobian is done with a call to N_VLinearSum. ---------------------------------------------------------------*/ -int idaLsDenseDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsDenseDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1) { - realtype inc, inc_inv, yj, ypj, srur, conj; - realtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; + sunrealtype inc, inc_inv, yj, ypj, srur, conj; + sunrealtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; N_Vector rtemp, jthCol; sunindextype j, N; IDALsMem idals_mem; @@ -1127,14 +1127,14 @@ int idaLsDenseDQJac(realtype tt, realtype c_j, N_Vector yy, The return value is either IDABAND_SUCCESS = 0, or the nonzero value returned by the res routine, if any. ---------------------------------------------------------------*/ -int idaLsBandDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsBandDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype inc, inc_inv, yj, ypj, srur, conj, ewtj; - realtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; - realtype *ytemp_data, *yptemp_data, *rtemp_data, *r_data, *col_j; + sunrealtype inc, inc_inv, yj, ypj, srur, conj, ewtj; + sunrealtype *y_data, *yp_data, *ewt_data, *cns_data = NULL; + sunrealtype *ytemp_data, *yptemp_data, *rtemp_data, *r_data, *col_j; N_Vector rtemp, ytemp, yptemp; sunindextype i, j, i1, i2, width, ngroups, group; sunindextype N, mupper, mlower; @@ -1254,14 +1254,14 @@ int idaLsBandDQJac(realtype tt, realtype c_j, N_Vector yy, The return value from the call to res is saved in order to set the return flag from idaLsSolve. ---------------------------------------------------------------*/ -int idaLsDQJtimes(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, - N_Vector v, N_Vector Jv, realtype c_j, +int idaLsDQJtimes(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, + N_Vector v, N_Vector Jv, sunrealtype c_j, void *ida_mem, N_Vector work1, N_Vector work2) { IDAMem IDA_mem; IDALsMem idals_mem; N_Vector y_tmp, yp_tmp; - realtype sig, siginv; + sunrealtype sig, siginv; int iter, retval; SUNLinearSolver_ID LSID; @@ -1486,7 +1486,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, { IDALsMem idals_mem; int nli_inc, retval; - realtype tol, w_mean; + sunrealtype tol, w_mean; /* access IDALsMem structure */ if (IDA_mem->ida_lmem == NULL) { @@ -1644,7 +1644,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, int idaLsPerf(IDAMem IDA_mem, int perftask) { IDALsMem idals_mem; - realtype rcfn, rcfl; + sunrealtype rcfn, rcfl; long int nstd, nnid; booleantype lcfn, lcfl; @@ -1677,8 +1677,8 @@ int idaLsPerf(IDAMem IDA_mem, int perftask) nnid = IDA_mem->ida_nni - idals_mem->nni0; if (nstd == 0 || nnid == 0) return(0); - rcfn = ((realtype) (IDA_mem->ida_ncfn - idals_mem->ncfn0)) / ((realtype) nstd); - rcfl = ((realtype) (idals_mem->ncfl - idals_mem->ncfl0)) / ((realtype) nnid); + rcfn = ((sunrealtype) (IDA_mem->ida_ncfn - idals_mem->ncfn0)) / ((sunrealtype) nstd); + rcfl = ((sunrealtype) (idals_mem->ncfl - idals_mem->ncfl0)) / ((sunrealtype) nnid); lcfn = (rcfn > PT9); lcfl = (rcfl > PT9); if (!(lcfn || lcfl)) return(0); @@ -1938,7 +1938,7 @@ int IDASetJacFnBS(void *ida_mem, int which, IDALsJacFnBS jacBS) } -int IDASetEpsLinB(void *ida_mem, int which, realtype eplifacB) +int IDASetEpsLinB(void *ida_mem, int which, sunrealtype eplifacB) { IDAadjMem IDAADJ_mem; IDAMem IDA_mem; @@ -1958,7 +1958,7 @@ int IDASetEpsLinB(void *ida_mem, int which, realtype eplifacB) } -int IDASetLSNormFactorB(void *ida_mem, int which, realtype nrmfacB) +int IDASetLSNormFactorB(void *ida_mem, int which, sunrealtype nrmfacB) { IDAadjMem IDAADJ_mem; IDAMem IDA_mem; @@ -1998,7 +1998,7 @@ int IDASetLinearSolutionScalingB(void *ida_mem, int which, booleantype onoffB) } -int IDASetIncrementFactorB(void *ida_mem, int which, realtype dqincfacB) +int IDASetIncrementFactorB(void *ida_mem, int which, sunrealtype dqincfacB) { IDAadjMem IDAADJ_mem; IDAMem IDA_mem; @@ -2164,7 +2164,7 @@ int IDASetJacTimesResFnB(void *ida_mem, int which, IDAResFn jtimesResFn) /* idaLsJacBWrapper interfaces to the IDAJacFnB routine provided by the user. idaLsJacBWrapper is of type IDALsJacFn. */ -static int idaLsJacBWrapper(realtype tt, realtype c_jB, N_Vector yyB, +static int idaLsJacBWrapper(sunrealtype tt, sunrealtype c_jB, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *ida_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) @@ -2203,7 +2203,7 @@ static int idaLsJacBWrapper(realtype tt, realtype c_jB, N_Vector yyB, /* idaLsJacBSWrapper interfaces to the IDAJacFnBS routine provided by the user. idaLsJacBSWrapper is of type IDALsJacFn. */ -static int idaLsJacBSWrapper(realtype tt, realtype c_jB, N_Vector yyB, +static int idaLsJacBSWrapper(sunrealtype tt, sunrealtype c_jB, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *ida_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) @@ -2249,8 +2249,8 @@ static int idaLsJacBSWrapper(realtype tt, realtype c_jB, N_Vector yyB, /* idaLsPrecSetupB interfaces to the IDALsPrecSetupFnB routine provided by the user */ -static int idaLsPrecSetupB(realtype tt, N_Vector yyB, N_Vector ypB, - N_Vector rrB, realtype c_jB, void *ida_mem) +static int idaLsPrecSetupB(sunrealtype tt, N_Vector yyB, N_Vector ypB, + N_Vector rrB, sunrealtype c_jB, void *ida_mem) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -2286,8 +2286,8 @@ static int idaLsPrecSetupB(realtype tt, N_Vector yyB, N_Vector ypB, /* idaLsPrecSetupBS interfaces to the IDALsPrecSetupFnBS routine provided by the user */ -static int idaLsPrecSetupBS(realtype tt, N_Vector yyB, N_Vector ypB, - N_Vector rrB, realtype c_jB, void *ida_mem) +static int idaLsPrecSetupBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, + N_Vector rrB, sunrealtype c_jB, void *ida_mem) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -2331,10 +2331,10 @@ static int idaLsPrecSetupBS(realtype tt, N_Vector yyB, N_Vector ypB, /* idaLsPrecSolveB interfaces to the IDALsPrecSolveFnB routine provided by the user */ -static int idaLsPrecSolveB(realtype tt, N_Vector yyB, N_Vector ypB, +static int idaLsPrecSolveB(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector rvecB, - N_Vector zvecB, realtype c_jB, - realtype deltaB, void *ida_mem) + N_Vector zvecB, sunrealtype c_jB, + sunrealtype deltaB, void *ida_mem) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -2371,10 +2371,10 @@ static int idaLsPrecSolveB(realtype tt, N_Vector yyB, N_Vector ypB, /* idaLsPrecSolveBS interfaces to the IDALsPrecSolveFnBS routine provided by the user */ -static int idaLsPrecSolveBS(realtype tt, N_Vector yyB, N_Vector ypB, +static int idaLsPrecSolveBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector rvecB, - N_Vector zvecB, realtype c_jB, - realtype deltaB, void *ida_mem) + N_Vector zvecB, sunrealtype c_jB, + sunrealtype deltaB, void *ida_mem) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -2419,8 +2419,8 @@ static int idaLsPrecSolveBS(realtype tt, N_Vector yyB, N_Vector ypB, /* idaLsJacTimesSetupB interfaces to the IDALsJacTimesSetupFnB routine provided by the user */ -static int idaLsJacTimesSetupB(realtype tt, N_Vector yyB, N_Vector ypB, - N_Vector rrB, realtype c_jB, void *ida_mem) +static int idaLsJacTimesSetupB(sunrealtype tt, N_Vector yyB, N_Vector ypB, + N_Vector rrB, sunrealtype c_jB, void *ida_mem) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -2455,8 +2455,8 @@ static int idaLsJacTimesSetupB(realtype tt, N_Vector yyB, N_Vector ypB, /* idaLsJacTimesSetupBS interfaces to the IDALsJacTimesSetupFnBS routine provided by the user */ -static int idaLsJacTimesSetupBS(realtype tt, N_Vector yyB, N_Vector ypB, - N_Vector rrB, realtype c_jB, void *ida_mem) +static int idaLsJacTimesSetupBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, + N_Vector rrB, sunrealtype c_jB, void *ida_mem) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; @@ -2501,9 +2501,9 @@ static int idaLsJacTimesSetupBS(realtype tt, N_Vector yyB, N_Vector ypB, /* idaLsJacTimesVecB interfaces to the IDALsJacTimesVecFnB routine provided by the user */ -static int idaLsJacTimesVecB(realtype tt, N_Vector yyB, N_Vector ypB, +static int idaLsJacTimesVecB(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector vB, N_Vector JvB, - realtype c_jB, void *ida_mem, + sunrealtype c_jB, void *ida_mem, N_Vector tmp1B, N_Vector tmp2B) { IDAMem IDA_mem; @@ -2542,9 +2542,9 @@ static int idaLsJacTimesVecB(realtype tt, N_Vector yyB, N_Vector ypB, /* idaLsJacTimesVecBS interfaces to the IDALsJacTimesVecFnBS routine provided by the user */ -static int idaLsJacTimesVecBS(realtype tt, N_Vector yyB, N_Vector ypB, +static int idaLsJacTimesVecBS(sunrealtype tt, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector vB, N_Vector JvB, - realtype c_jB, void *ida_mem, + sunrealtype c_jB, void *ida_mem, N_Vector tmp1B, N_Vector tmp2B) { IDAMem IDA_mem; diff --git a/src/idas/idas_ls_impl.h b/src/idas/idas_ls_impl.h index 42b7062329..a72dea9c48 100644 --- a/src/idas/idas_ls_impl.h +++ b/src/idas/idas_ls_impl.h @@ -57,11 +57,11 @@ typedef struct IDALsMemRec { booleantype scalesol; /* Iterative solver tolerance */ - realtype eplifac; /* nonlinear -> linear tol scaling factor */ - realtype nrmfac; /* integrator -> LS norm conversion factor */ + sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ + sunrealtype nrmfac; /* integrator -> LS norm conversion factor */ /* Statistics and associated parameters */ - realtype dqincfac; /* dqincfac = optional increment factor in Jv */ + sunrealtype dqincfac; /* dqincfac = optional increment factor in Jv */ long int nje; /* nje = no. of calls to jac */ long int npe; /* npe = total number of precond calls */ long int nli; /* nli = total number of linear iterations */ @@ -116,22 +116,22 @@ typedef struct IDALsMemRec { int idaLsATimes(void *ida_mem, N_Vector v, N_Vector z); int idaLsPSetup(void *ida_mem); int idaLsPSolve(void *ida_mem, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* Difference quotient approximation for Jac times vector */ -int idaLsDQJtimes(realtype tt, N_Vector yy, N_Vector yp, +int idaLsDQJtimes(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, N_Vector v, N_Vector Jv, - realtype c_j, void *data, + sunrealtype c_j, void *data, N_Vector work1, N_Vector work2); /* Difference-quotient Jacobian approximation routines */ -int idaLsDQJac(realtype tt, realtype c_j, N_Vector yy, N_Vector yp, +int idaLsDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, void *data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); -int idaLsDenseDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsDenseDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1); -int idaLsBandDQJac(realtype tt, realtype c_j, N_Vector yy, +int idaLsBandDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, N_Vector rr, SUNMatrix Jac, IDAMem IDA_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); diff --git a/src/idas/idas_nls.c b/src/idas/idas_nls.c index 9a8cbf7593..6b848b33f6 100644 --- a/src/idas/idas_nls.c +++ b/src/idas/idas_nls.c @@ -31,7 +31,7 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem); static int idaNlsLSetup(booleantype jbad, booleantype* jcur, void* ida_mem); static int idaNlsLSolve(N_Vector delta, void* ida_mem); static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem); + sunrealtype tol, N_Vector ewt, void* ida_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -160,9 +160,9 @@ int IDASetNlsResFn(void *ida_mem, IDAResFn res) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int IDAGetNonlinearSystemData(void *ida_mem, realtype *tcur, N_Vector *yypred, +int IDAGetNonlinearSystemData(void *ida_mem, sunrealtype *tcur, N_Vector *yypred, N_Vector *yppred, N_Vector *yyn, N_Vector *ypn, - N_Vector *res, realtype *cj, void **user_data) + N_Vector *res, sunrealtype *cj, void **user_data) { IDAMem IDA_mem; @@ -322,12 +322,12 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem) static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem) + sunrealtype tol, N_Vector ewt, void* ida_mem) { IDAMem IDA_mem; int m, retval; - realtype delnrm; - realtype rate; + sunrealtype delnrm; + sunrealtype rate; if (ida_mem == NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDAS", "idaNlsConvTest", MSG_NO_MEM); diff --git a/src/idas/idas_nls_sim.c b/src/idas/idas_nls_sim.c index 6ec372a18a..62e97e9dea 100644 --- a/src/idas/idas_nls_sim.c +++ b/src/idas/idas_nls_sim.c @@ -33,7 +33,7 @@ static int idaNlsLSetupSensSim(booleantype jbad, booleantype* jcur, void* ida_mem); static int idaNlsLSolveSensSim(N_Vector delta, void* ida_mem); static int idaNlsConvTestSensSim(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem); + sunrealtype tol, N_Vector ewt, void* ida_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -193,10 +193,10 @@ int IDASetNonlinearSolverSensSim(void *ida_mem, SUNNonlinearSolver NLS) This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int IDAGetNonlinearSystemDataSens(void *ida_mem, realtype *tcur, +int IDAGetNonlinearSystemDataSens(void *ida_mem, sunrealtype *tcur, N_Vector **yySpred, N_Vector **ypSpred, N_Vector **yySn, N_Vector **ypSn, - realtype *cj, void **user_data) + sunrealtype *cj, void **user_data) { IDAMem IDA_mem; @@ -408,12 +408,12 @@ static int idaNlsResidualSensSim(N_Vector ycorSim, N_Vector resSim, void* ida_me static int idaNlsConvTestSensSim(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem) + sunrealtype tol, N_Vector ewt, void* ida_mem) { IDAMem IDA_mem; int m, retval; - realtype delnrm; - realtype rate; + sunrealtype delnrm; + sunrealtype rate; if (ida_mem == NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDAS", "idaNlsConvTestSensSim", MSG_NO_MEM); diff --git a/src/idas/idas_nls_stg.c b/src/idas/idas_nls_stg.c index 82dbaa87b1..a6b14d91d3 100644 --- a/src/idas/idas_nls_stg.c +++ b/src/idas/idas_nls_stg.c @@ -33,7 +33,7 @@ static int idaNlsLSetupSensStg(booleantype jbad, booleantype* jcur, void* ida_mem); static int idaNlsLSolveSensStg(N_Vector delta, void* ida_mem); static int idaNlsConvTestSensStg(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem); + sunrealtype tol, N_Vector ewt, void* ida_mem); /* ----------------------------------------------------------------------------- * Exported functions @@ -313,12 +313,12 @@ static int idaNlsResidualSensStg(N_Vector ycorStg, N_Vector resStg, void* ida_me static int idaNlsConvTestSensStg(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, - realtype tol, N_Vector ewt, void* ida_mem) + sunrealtype tol, N_Vector ewt, void* ida_mem) { IDAMem IDA_mem; int m, retval; - realtype delnrm; - realtype rate; + sunrealtype delnrm; + sunrealtype rate; if (ida_mem == NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDAS", "idaNlsConvTestSensStg", MSG_NO_MEM); diff --git a/src/kinsol/fmod/fkinsol_mod.c b/src/kinsol/fmod/fkinsol_mod.c index 29e070fbb6..ca1b5e31a9 100644 --- a/src/kinsol/fmod/fkinsol_mod.c +++ b/src/kinsol/fmod/fkinsol_mod.c @@ -300,11 +300,11 @@ SWIGEXPORT int _wrap_FKINSetUserData(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FKINSetDamping(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetDamping(arg1,arg2); fresult = (int)(result); return fresult; @@ -356,11 +356,11 @@ SWIGEXPORT int _wrap_FKINSetDelayAA(void *farg1, long const *farg2) { SWIGEXPORT int _wrap_FKINSetDampingAA(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetDampingAA(arg1,arg2); fresult = (int)(result); return fresult; @@ -468,11 +468,11 @@ SWIGEXPORT int _wrap_FKINSetEtaForm(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FKINSetEtaConstValue(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetEtaConstValue(arg1,arg2); fresult = (int)(result); return fresult; @@ -482,13 +482,13 @@ SWIGEXPORT int _wrap_FKINSetEtaConstValue(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FKINSetEtaParams(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)KINSetEtaParams(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -498,13 +498,13 @@ SWIGEXPORT int _wrap_FKINSetEtaParams(void *farg1, double const *farg2, double c SWIGEXPORT int _wrap_FKINSetResMonParams(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; - realtype arg3 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); - arg3 = (realtype)(*farg3); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); result = (int)KINSetResMonParams(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -514,11 +514,11 @@ SWIGEXPORT int _wrap_FKINSetResMonParams(void *farg1, double const *farg2, doubl SWIGEXPORT int _wrap_FKINSetResMonConstValue(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetResMonConstValue(arg1,arg2); fresult = (int)(result); return fresult; @@ -542,11 +542,11 @@ SWIGEXPORT int _wrap_FKINSetNoMinEps(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FKINSetMaxNewtonStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetMaxNewtonStep(arg1,arg2); fresult = (int)(result); return fresult; @@ -570,11 +570,11 @@ SWIGEXPORT int _wrap_FKINSetMaxBetaFails(void *farg1, long const *farg2) { SWIGEXPORT int _wrap_FKINSetRelErrFunc(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetRelErrFunc(arg1,arg2); fresult = (int)(result); return fresult; @@ -584,11 +584,11 @@ SWIGEXPORT int _wrap_FKINSetRelErrFunc(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FKINSetFuncNormTol(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetFuncNormTol(arg1,arg2); fresult = (int)(result); return fresult; @@ -598,11 +598,11 @@ SWIGEXPORT int _wrap_FKINSetFuncNormTol(void *farg1, double const *farg2) { SWIGEXPORT int _wrap_FKINSetScaledStepTol(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)KINSetScaledStepTol(arg1,arg2); fresult = (int)(result); return fresult; @@ -800,11 +800,11 @@ SWIGEXPORT int _wrap_FKINGetNumBacktrackOps(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FKINGetFuncNorm(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)KINGetFuncNorm(arg1,arg2); fresult = (int)(result); return fresult; @@ -814,11 +814,11 @@ SWIGEXPORT int _wrap_FKINGetFuncNorm(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FKINGetStepLength(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); result = (int)KINGetStepLength(arg1,arg2); fresult = (int)(result); return fresult; @@ -898,7 +898,7 @@ SWIGEXPORT int _wrap_FKINBBDPrecInit(void *farg1, int64_t const *farg2, int64_t sunindextype arg4 ; sunindextype arg5 ; sunindextype arg6 ; - realtype arg7 ; + sunrealtype arg7 ; KINBBDLocalFn arg8 = (KINBBDLocalFn) 0 ; KINBBDCommFn arg9 = (KINBBDCommFn) 0 ; int result; @@ -909,7 +909,7 @@ SWIGEXPORT int _wrap_FKINBBDPrecInit(void *farg1, int64_t const *farg2, int64_t arg4 = (sunindextype)(*farg4); arg5 = (sunindextype)(*farg5); arg6 = (sunindextype)(*farg6); - arg7 = (realtype)(*farg7); + arg7 = (sunrealtype)(*farg7); arg8 = (KINBBDLocalFn)(farg8); arg9 = (KINBBDCommFn)(farg9); result = (int)KINBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 10e200c49c..d0ce7a3bc5 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -166,25 +166,25 @@ static booleantype KINCheckNvector(N_Vector tmpl); static booleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl); static int KINSolInit(KINMem kin_mem); static int KINConstraint(KINMem kin_mem ); -static void KINForcingTerm(KINMem kin_mem, realtype fnormp); +static void KINForcingTerm(KINMem kin_mem, sunrealtype fnormp); static void KINFreeVectors(KINMem kin_mem); -static int KINFullNewton(KINMem kin_mem, realtype *fnormp, - realtype *f1normp, booleantype *maxStepTaken); -static int KINLineSearch(KINMem kin_mem, realtype *fnormp, - realtype *f1normp, booleantype *maxStepTaken); +static int KINFullNewton(KINMem kin_mem, sunrealtype *fnormp, + sunrealtype *f1normp, booleantype *maxStepTaken); +static int KINLineSearch(KINMem kin_mem, sunrealtype *fnormp, + sunrealtype *f1normp, booleantype *maxStepTaken); static int KINPicardAA(KINMem kin_mem); static int KINFP(KINMem kin_mem); static int KINLinSolDrv(KINMem kinmem); static int KINPicardFcnEval(KINMem kin_mem, N_Vector gval, N_Vector uval, N_Vector fval1); -static realtype KINScFNorm(KINMem kin_mem, N_Vector v, N_Vector scale); -static realtype KINScSNorm(KINMem kin_mem, N_Vector v, N_Vector u); +static sunrealtype KINScFNorm(KINMem kin_mem, N_Vector v, N_Vector scale); +static sunrealtype KINScSNorm(KINMem kin_mem, N_Vector v, N_Vector u); static int KINStop(KINMem kin_mem, booleantype maxStepTaken, int sflag); static int AndersonAcc(KINMem kin_mem, N_Vector gval, N_Vector fv, N_Vector x, - N_Vector x_old, long int iter, realtype *R, realtype *gamma); + N_Vector x_old, long int iter, sunrealtype *R, sunrealtype *gamma); /* * ================================================================= @@ -211,7 +211,7 @@ static int AndersonAcc(KINMem kin_mem, N_Vector gval, N_Vector fv, N_Vector x, void *KINCreate(SUNContext sunctx) { KINMem kin_mem; - realtype uround; + sunrealtype uround; /* Test inputs */ if (sunctx == NULL) { @@ -479,7 +479,7 @@ int KINInit(void *kinmem, KINSysFn func, N_Vector tmpl) int KINSol(void *kinmem, N_Vector u, int strategy_in, N_Vector u_scale, N_Vector f_scale) { - realtype fnormp, f1normp, epsmin; + sunrealtype fnormp, f1normp, epsmin; KINMem kin_mem; int ret, sflag; booleantype maxStepTaken; @@ -885,7 +885,7 @@ static booleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl) if (kin_mem->kin_m_aa) { if (kin_mem->kin_R_aa == NULL) { - kin_mem->kin_R_aa = (realtype *) malloc((kin_mem->kin_m_aa*kin_mem->kin_m_aa) * sizeof(realtype)); + kin_mem->kin_R_aa = (sunrealtype *) malloc((kin_mem->kin_m_aa*kin_mem->kin_m_aa) * sizeof(sunrealtype)); if (kin_mem->kin_R_aa == NULL) { KINProcessError(kin_mem, 0, "KINSOL", "KINAllocVectors", MSG_MEM_FAIL); N_VDestroy(kin_mem->kin_unew); @@ -900,7 +900,7 @@ static booleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl) } if (kin_mem->kin_gamma_aa == NULL) { - kin_mem->kin_gamma_aa = (realtype *) malloc(kin_mem->kin_m_aa * sizeof(realtype)); + kin_mem->kin_gamma_aa = (sunrealtype *) malloc(kin_mem->kin_m_aa * sizeof(sunrealtype)); if (kin_mem->kin_gamma_aa == NULL) { KINProcessError(kin_mem, 0, "KINSOL", "KINAllocVectors", MSG_MEM_FAIL); N_VDestroy(kin_mem->kin_unew); @@ -933,7 +933,7 @@ static booleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl) } if (kin_mem->kin_cv == NULL) { - kin_mem->kin_cv = (realtype *) malloc(2 * (kin_mem->kin_m_aa+1) * sizeof(realtype)); + kin_mem->kin_cv = (sunrealtype *) malloc(2 * (kin_mem->kin_m_aa+1) * sizeof(sunrealtype)); if (kin_mem->kin_cv == NULL) { KINProcessError(kin_mem, 0, "KINSOL", "KINAllocVectors", MSG_MEM_FAIL); N_VDestroy(kin_mem->kin_unew); @@ -1142,7 +1142,7 @@ static booleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl) if (kin_mem->kin_orth_aa == KIN_ORTH_ICWY) { if (kin_mem->kin_T_aa == NULL) { - kin_mem->kin_T_aa = (realtype *) malloc(((kin_mem->kin_m_aa*kin_mem->kin_m_aa)) * sizeof(realtype)); + kin_mem->kin_T_aa = (sunrealtype *) malloc(((kin_mem->kin_m_aa*kin_mem->kin_m_aa)) * sizeof(sunrealtype)); if (kin_mem->kin_T_aa == NULL) { KINProcessError(kin_mem, 0, "KINSOL", "KINAllocVectors", MSG_MEM_FAIL); N_VDestroy(kin_mem->kin_unew); @@ -1341,7 +1341,7 @@ static void KINFreeVectors(KINMem kin_mem) static int KINSolInit(KINMem kin_mem) { int retval; - realtype fmax; + sunrealtype fmax; /* check for illegal input parameters */ @@ -1573,10 +1573,10 @@ static int KINLinSolDrv(KINMem kin_mem) * violated, or if the norm of pp is greater than mxnewtstep. */ -static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, +static int KINFullNewton(KINMem kin_mem, sunrealtype *fnormp, sunrealtype *f1normp, booleantype *maxStepTaken) { - realtype pnorm, ratio; + sunrealtype pnorm, ratio; booleantype fOK; int ircvr, retval; @@ -1706,12 +1706,12 @@ static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, * condition, as rl can only decrease from 1 at that stage) */ -static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, +static int KINLineSearch(KINMem kin_mem, sunrealtype *fnormp, sunrealtype *f1normp, booleantype *maxStepTaken) { - realtype pnorm, ratio, slpi, rlmin, rlength, rl, rlmax, rldiff; - realtype rltmp, rlprev, pt1trl, f1nprv, rllo, rlinc, alpha, beta; - realtype alpha_cond, beta_cond, rl_a, tmp1, rl_b, tmp2, disc; + sunrealtype pnorm, ratio, slpi, rlmin, rlength, rl, rlmax, rldiff; + sunrealtype rltmp, rlprev, pt1trl, f1nprv, rllo, rlinc, alpha, beta; + sunrealtype alpha_cond, beta_cond, rl_a, tmp1, rl_b, tmp2, disc; int ircvr, nbktrk_l, retval; booleantype firstBacktrack, fOK; @@ -2042,7 +2042,7 @@ static int KINConstraint(KINMem kin_mem) static int KINStop(KINMem kin_mem, booleantype maxStepTaken, int sflag) { - realtype fmax, rlength, omexp; + sunrealtype fmax, rlength, omexp; N_Vector delta; /* Check for too small a step */ @@ -2181,9 +2181,9 @@ static int KINStop(KINMem kin_mem, booleantype maxStepTaken, int sflag) * 6/94/75 of the same title. */ -static void KINForcingTerm(KINMem kin_mem, realtype fnormp) +static void KINForcingTerm(KINMem kin_mem, sunrealtype fnormp) { - realtype eta_max, eta_min, eta_safe, linmodel_norm; + sunrealtype eta_max, eta_min, eta_safe, linmodel_norm; eta_max = POINT9; eta_min = POINT0001; @@ -2242,7 +2242,7 @@ static void KINForcingTerm(KINMem kin_mem, realtype fnormp) * functions from the vector module. */ -static realtype KINScFNorm(KINMem kin_mem, N_Vector v, N_Vector scale) +static sunrealtype KINScFNorm(KINMem kin_mem, N_Vector v, N_Vector scale) { N_VProd(scale, v, kin_mem->kin_vtemp1); return(N_VMaxNorm(kin_mem->kin_vtemp1)); @@ -2255,9 +2255,9 @@ static realtype KINScFNorm(KINMem kin_mem, N_Vector v, N_Vector scale) * Here ucur is the current step and usc is the u scale factor. */ -static realtype KINScSNorm(KINMem kin_mem, N_Vector v, N_Vector u) +static sunrealtype KINScSNorm(KINMem kin_mem, N_Vector v, N_Vector u) { - realtype length; + sunrealtype length; N_VInv(kin_mem->kin_uscale, kin_mem->kin_vtemp1); N_VAbs(u, kin_mem->kin_vtemp2); @@ -2491,8 +2491,8 @@ static int KINPicardAA(KINMem kin_mem) int ret; /* iteration status */ long int iter_aa; /* iteration count for AA */ N_Vector delta; /* temporary workspace vector */ - realtype epsmin; - realtype fnormp; + sunrealtype epsmin; + sunrealtype fnormp; delta = kin_mem->kin_vtemp1; ret = CONTINUE_ITERATIONS; @@ -2685,7 +2685,7 @@ static int KINFP(KINMem kin_mem) int retval; /* return value from user func */ int ret; /* iteration status */ long int iter_aa; /* iteration count for AA */ - realtype tolfac; /* tolerance adjustment factor */ + sunrealtype tolfac; /* tolerance adjustment factor */ N_Vector delta; /* temporary workspace vector */ delta = kin_mem->kin_vtemp1; @@ -2829,19 +2829,19 @@ static int KINFP(KINMem kin_mem) static int AndersonAcc(KINMem kin_mem, N_Vector gval, N_Vector fv, N_Vector x, N_Vector xold, - long int iter, realtype *R, realtype *gamma) + long int iter, sunrealtype *R, sunrealtype *gamma) { int retval; long int i_pt, i, j, lAA; long int *ipt_map; - realtype alfa; - realtype onembeta; - realtype a, b, temp, c, s; + sunrealtype alfa; + sunrealtype onembeta; + sunrealtype a, b, temp, c, s; booleantype dotprodSB = SUNFALSE; /* local shortcuts for fused vector operation */ int nvec=0; - realtype* cv=kin_mem->kin_cv; + sunrealtype* cv=kin_mem->kin_cv; N_Vector* Xv=kin_mem->kin_Xv; /* local dot product flag for single buffer reductions */ diff --git a/src/kinsol/kinsol_bbdpre.c b/src/kinsol/kinsol_bbdpre.c index 9a15448228..0978ce4678 100644 --- a/src/kinsol/kinsol_bbdpre.c +++ b/src/kinsol/kinsol_bbdpre.c @@ -63,7 +63,7 @@ static int KBBDDQJac(KBBDPrecData pdata, int KINBBDPrecInit(void *kinmem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, - realtype dq_rel_uu, + sunrealtype dq_rel_uu, KINBBDLocalFn gloc, KINBBDCommFn gcomm) { KINMem kin_mem; @@ -448,8 +448,8 @@ static int KINBBDPrecSolve(N_Vector uu, N_Vector uscale, N_Vector vv, void *bbd_data) { KBBDPrecData pdata; - realtype *vd; - realtype *zd; + sunrealtype *vd; + sunrealtype *zd; int i, retval; pdata = (KBBDPrecData) bbd_data; @@ -520,10 +520,10 @@ static int KBBDDQJac(KBBDPrecData pdata, N_Vector gu, N_Vector gtemp, N_Vector utemp) { KINMem kin_mem; - realtype inc, inc_inv; + sunrealtype inc, inc_inv; int retval; sunindextype group, i, j, width, ngroups, i1, i2; - realtype *udata, *uscdata, *gudata, *gtempdata, *utempdata, *col_j; + sunrealtype *udata, *uscdata, *gudata, *gtempdata, *utempdata, *col_j; kin_mem = (KINMem) pdata->kin_mem; diff --git a/src/kinsol/kinsol_bbdpre_impl.h b/src/kinsol/kinsol_bbdpre_impl.h index ac5276b777..b490f8a7c5 100644 --- a/src/kinsol/kinsol_bbdpre_impl.h +++ b/src/kinsol/kinsol_bbdpre_impl.h @@ -35,7 +35,7 @@ typedef struct KBBDPrecDataRec { /* passed by user to KINBBDPrecAlloc, used by pset/psolve functions */ sunindextype mudq, mldq, mukeep, mlkeep; - realtype rel_uu; /* relative error for the Jacobian DQ routine */ + sunrealtype rel_uu; /* relative error for the Jacobian DQ routine */ KINBBDLocalFn gloc; KINBBDCommFn gcomm; diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index 47a684cc73..bfd2773ba1 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -78,16 +78,16 @@ typedef struct KINMemRec { SUNContext kin_sunctx; - realtype kin_uround; /* machine epsilon (or unit roundoff error) + sunrealtype kin_uround; /* machine epsilon (or unit roundoff error) (defined in sundials_types.h) */ /* problem specification data */ KINSysFn kin_func; /* nonlinear system function implementation */ void *kin_user_data; /* work space available to func routine */ - realtype kin_fnormtol; /* stopping tolerance on L2-norm of function + sunrealtype kin_fnormtol; /* stopping tolerance on L2-norm of function value */ - realtype kin_scsteptol; /* scaled step length tolerance */ + sunrealtype kin_scsteptol; /* scaled step length tolerance */ int kin_globalstrategy; /* choices are KIN_NONE, KIN_LINESEARCH KIN_PICARD and KIN_FP */ int kin_printfl; /* level of verbosity of output */ @@ -118,21 +118,21 @@ typedef struct KINMemRec { updated (set by residual monitoring algorithm) */ - realtype kin_mxnewtstep; /* maximum allowable scaled step length */ - realtype kin_mxnstepin; /* input (or preset) value for mxnewtstep */ - realtype kin_sqrt_relfunc; /* relative error bound for func(u) */ - realtype kin_stepl; /* scaled length of current step */ - realtype kin_stepmul; /* step scaling factor */ - realtype kin_eps; /* current value of eps */ - realtype kin_eta; /* current value of eta */ - realtype kin_eta_gamma; /* gamma value used in eta calculation + sunrealtype kin_mxnewtstep; /* maximum allowable scaled step length */ + sunrealtype kin_mxnstepin; /* input (or preset) value for mxnewtstep */ + sunrealtype kin_sqrt_relfunc; /* relative error bound for func(u) */ + sunrealtype kin_stepl; /* scaled length of current step */ + sunrealtype kin_stepmul; /* step scaling factor */ + sunrealtype kin_eps; /* current value of eps */ + sunrealtype kin_eta; /* current value of eta */ + sunrealtype kin_eta_gamma; /* gamma value used in eta calculation (choice #2) */ - realtype kin_eta_alpha; /* alpha value used in eta calculation + sunrealtype kin_eta_alpha; /* alpha value used in eta calculation (choice #2) */ booleantype kin_noInitSetup; /* flag controlling whether or not the KINSol routine makes an initial call to the linear solver setup routine (lsetup) */ - realtype kin_sthrsh; /* threshold value for calling the linear + sunrealtype kin_sthrsh; /* threshold value for calling the linear solver setup routine */ /* counters */ @@ -174,7 +174,7 @@ typedef struct KINMemRec { /* fixed point and Picard options */ booleantype kin_ret_newest; /* return the newest FP iteration */ booleantype kin_damping; /* flag to apply damping in FP/Picard */ - realtype kin_beta; /* damping parameter for FP/Picard */ + sunrealtype kin_beta; /* damping parameter for FP/Picard */ /* space requirements for AA, Broyden and NLEN */ N_Vector kin_fold_aa; /* vector needed for AA, Broyden, and NLEN */ @@ -182,10 +182,10 @@ typedef struct KINMemRec { N_Vector *kin_df_aa; /* vector array needed for AA, Broyden, and NLEN */ N_Vector *kin_dg_aa; /* vector array needed for AA, Broyden and NLEN */ N_Vector *kin_q_aa; /* vector array needed for AA */ - realtype kin_beta_aa; /* beta damping parameter for AA */ - realtype *kin_gamma_aa; /* array of size maa used in AA */ - realtype *kin_R_aa; /* array of size maa*maa used in AA */ - realtype *kin_T_aa; /* array of size maa*maa used in AA with ICWY MGS */ + sunrealtype kin_beta_aa; /* beta damping parameter for AA */ + sunrealtype *kin_gamma_aa; /* array of size maa used in AA */ + sunrealtype *kin_R_aa; /* array of size maa*maa used in AA */ + sunrealtype *kin_T_aa; /* array of size maa*maa used in AA with ICWY MGS */ long int *kin_ipt_map; /* array of size maa*maa/2 used in AA */ long int kin_m_aa; /* parameter for AA, Broyden or NLEN */ long int kin_delay_aa; /* number of iterations to delay AA */ @@ -199,16 +199,16 @@ typedef struct KINMemRec { SUNQRData kin_qr_data; /* Additional parameters required for QRAdd routine set for AA */ booleantype kin_damping_aa; /* flag to apply damping in AA */ - realtype *kin_cv; /* scalar array for fused vector operations */ + sunrealtype *kin_cv; /* scalar array for fused vector operations */ N_Vector *kin_Xv; /* vector array for fused vector operations */ /* space requirements for vector storage */ - sunindextype kin_lrw1; /* number of realtype-sized memory blocks needed + sunindextype kin_lrw1; /* number of sunrealtype-sized memory blocks needed for a single N_Vector */ sunindextype kin_liw1; /* number of int-sized memory blocks needed for a single N_Vecotr */ - long int kin_lrw; /* total number of realtype-sized memory blocks + long int kin_lrw; /* total number of sunrealtype-sized memory blocks needed for all KINSOL work vectors */ long int kin_liw; /* total number of int-sized memory blocks needed for all KINSOL work vectors */ @@ -222,7 +222,7 @@ typedef struct KINMemRec { int (*kin_lsetup)(struct KINMemRec *kin_mem); int (*kin_lsolve)(struct KINMemRec *kin_mem, N_Vector xx, N_Vector bb, - realtype *sJpnorm, realtype *sFdotJp); + sunrealtype *sJpnorm, sunrealtype *sFdotJp); int (*kin_lfree)(struct KINMemRec *kin_mem); @@ -233,22 +233,22 @@ typedef struct KINMemRec { void *kin_lmem; /* pointer to linear solver memory block */ - realtype kin_fnorm; /* value of L2-norm of fscale*fval */ - realtype kin_f1norm; /* f1norm = 0.5*(fnorm)^2 */ - realtype kin_sFdotJp; /* value of scaled F(u) vector (fscale*fval) + sunrealtype kin_fnorm; /* value of L2-norm of fscale*fval */ + sunrealtype kin_f1norm; /* f1norm = 0.5*(fnorm)^2 */ + sunrealtype kin_sFdotJp; /* value of scaled F(u) vector (fscale*fval) dotted with scaled J(u)*pp vector (set by lsolve) */ - realtype kin_sJpnorm; /* value of L2-norm of fscale*(J(u)*pp) + sunrealtype kin_sJpnorm; /* value of L2-norm of fscale*(J(u)*pp) (set by lsolve) */ - realtype kin_fnorm_sub; /* value of L2-norm of fscale*fval (subinterval) */ + sunrealtype kin_fnorm_sub; /* value of L2-norm of fscale*fval (subinterval) */ booleantype kin_eval_omega; /* flag indicating that omega must be evaluated. */ - realtype kin_omega; /* constant value for real scalar used in test to + sunrealtype kin_omega; /* constant value for real scalar used in test to determine if reduction of norm of nonlinear residual is sufficient. Unless a valid constant value is specified by the user, omega is estimated from omega_min and omega_max at each iteration. */ - realtype kin_omega_min; /* lower bound on omega */ - realtype kin_omega_max; /* upper bound on omega */ + sunrealtype kin_omega_min; /* lower bound on omega */ + sunrealtype kin_omega_max; /* upper bound on omega */ /* * ----------------------------------------------------------------- @@ -341,7 +341,7 @@ typedef struct KINMemRec { /* * ----------------------------------------------------------------- * Function : int (*kin_lsolve)(KINMem kin_mem, N_Vector xx, - * N_Vector bb, realtype *sJpnorm, realtype *sFdotJp) + * N_Vector bb, sunrealtype *sJpnorm, sunrealtype *sFdotJp) * ----------------------------------------------------------------- * kin_lsolve interfaces with the subroutine implementing the * numerical method to be used to solve the linear system J*xx = bb, diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index 6645333d90..aee2d5c5f5 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -162,7 +162,7 @@ int KINSetUserData(void *kinmem, void *user_data) * ----------------------------------------------------------------- */ -int KINSetDamping(void *kinmem, realtype beta) +int KINSetDamping(void *kinmem, sunrealtype beta) { KINMem kin_mem; @@ -287,7 +287,7 @@ int KINSetOrthAA(void *kinmem, int orthaa) * ----------------------------------------------------------------- */ -int KINSetDampingAA(void *kinmem, realtype beta) +int KINSetDampingAA(void *kinmem, sunrealtype beta) { KINMem kin_mem; @@ -507,7 +507,7 @@ int KINSetEtaForm(void *kinmem, int etachoice) * ----------------------------------------------------------------- */ -int KINSetEtaConstValue(void *kinmem, realtype eta) +int KINSetEtaConstValue(void *kinmem, sunrealtype eta) { KINMem kin_mem; @@ -537,7 +537,7 @@ int KINSetEtaConstValue(void *kinmem, realtype eta) * ----------------------------------------------------------------- */ -int KINSetEtaParams(void *kinmem, realtype egamma, realtype ealpha) +int KINSetEtaParams(void *kinmem, sunrealtype egamma, sunrealtype ealpha) { KINMem kin_mem; @@ -579,7 +579,7 @@ int KINSetEtaParams(void *kinmem, realtype egamma, realtype ealpha) * ----------------------------------------------------------------- */ -int KINSetResMonParams(void *kinmem, realtype omegamin, realtype omegamax) +int KINSetResMonParams(void *kinmem, sunrealtype omegamin, sunrealtype omegamax) { KINMem kin_mem; @@ -636,7 +636,7 @@ int KINSetResMonParams(void *kinmem, realtype omegamin, realtype omegamax) * ----------------------------------------------------------------- */ -int KINSetResMonConstValue(void *kinmem, realtype omegaconst) +int KINSetResMonConstValue(void *kinmem, sunrealtype omegaconst) { KINMem kin_mem; @@ -687,7 +687,7 @@ int KINSetNoMinEps(void *kinmem, booleantype noMinEps) * ----------------------------------------------------------------- */ -int KINSetMaxNewtonStep(void *kinmem, realtype mxnewtstep) +int KINSetMaxNewtonStep(void *kinmem, sunrealtype mxnewtstep) { KINMem kin_mem; @@ -748,10 +748,10 @@ int KINSetMaxBetaFails(void *kinmem, long int mxnbcf) * ----------------------------------------------------------------- */ -int KINSetRelErrFunc(void *kinmem, realtype relfunc) +int KINSetRelErrFunc(void *kinmem, sunrealtype relfunc) { KINMem kin_mem; - realtype uround; + sunrealtype uround; if (kinmem == NULL) { KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetRelErrFunc", MSG_NO_MEM); @@ -781,10 +781,10 @@ int KINSetRelErrFunc(void *kinmem, realtype relfunc) * ----------------------------------------------------------------- */ -int KINSetFuncNormTol(void *kinmem, realtype fnormtol) +int KINSetFuncNormTol(void *kinmem, sunrealtype fnormtol) { KINMem kin_mem; - realtype uround; + sunrealtype uround; if (kinmem == NULL) { KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetFuncNormTol", MSG_NO_MEM); @@ -814,10 +814,10 @@ int KINSetFuncNormTol(void *kinmem, realtype fnormtol) * ----------------------------------------------------------------- */ -int KINSetScaledStepTol(void *kinmem, realtype scsteptol) +int KINSetScaledStepTol(void *kinmem, sunrealtype scsteptol) { KINMem kin_mem; - realtype uround; + sunrealtype uround; if (kinmem == NULL) { KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetScaledStepTol", MSG_NO_MEM); @@ -850,7 +850,7 @@ int KINSetScaledStepTol(void *kinmem, realtype scsteptol) int KINSetConstraints(void *kinmem, N_Vector constraints) { KINMem kin_mem; - realtype temptest; + sunrealtype temptest; if (kinmem == NULL) { KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetConstraints", MSG_NO_MEM); @@ -1038,7 +1038,7 @@ int KINGetNumBacktrackOps(void *kinmem, long int *nbacktr) * ----------------------------------------------------------------- */ -int KINGetFuncNorm(void *kinmem, realtype *funcnorm) +int KINGetFuncNorm(void *kinmem, sunrealtype *funcnorm) { KINMem kin_mem; @@ -1059,7 +1059,7 @@ int KINGetFuncNorm(void *kinmem, realtype *funcnorm) * ----------------------------------------------------------------- */ -int KINGetStepLength(void *kinmem, realtype *steplength) +int KINGetStepLength(void *kinmem, sunrealtype *steplength) { KINMem kin_mem; @@ -1140,11 +1140,11 @@ int KINPrintAllStats(void *kinmem, FILE* outfile, SUNOutputFormat fmt) if (kin_mem->kin_nni > 0) { fprintf(outfile, "LS iters per NLS iter = %"RSYM"\n", - (realtype) kinls_mem->nli / (realtype) kin_mem->kin_nni); + (sunrealtype) kinls_mem->nli / (sunrealtype) kin_mem->kin_nni); fprintf(outfile, "Jac evals per NLS iter = %"RSYM"\n", - (realtype) kinls_mem->nje / (realtype) kin_mem->kin_nni); + (sunrealtype) kinls_mem->nje / (sunrealtype) kin_mem->kin_nni); fprintf(outfile, "Prec evals per NLS iter = %"RSYM"\n", - (realtype) kinls_mem->npe / (realtype) kin_mem->kin_nni); + (sunrealtype) kinls_mem->npe / (sunrealtype) kin_mem->kin_nni); } } @@ -1172,11 +1172,11 @@ int KINPrintAllStats(void *kinmem, FILE* outfile, SUNOutputFormat fmt) if (kin_mem->kin_nni > 0) { fprintf(outfile, ",LS iters per NLS iter,%"RSYM, - (realtype) kinls_mem->nli / (realtype) kin_mem->kin_nni); + (sunrealtype) kinls_mem->nli / (sunrealtype) kin_mem->kin_nni); fprintf(outfile, ",Jac evals per NLS iter,%"RSYM, - (realtype) kinls_mem->nje / (realtype) kin_mem->kin_nni); + (sunrealtype) kinls_mem->nje / (sunrealtype) kin_mem->kin_nni); fprintf(outfile, ",Prec evals per NLS iter,%"RSYM, - (realtype) kinls_mem->npe / (realtype) kin_mem->kin_nni); + (sunrealtype) kinls_mem->npe / (sunrealtype) kin_mem->kin_nni); } else { diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index 61e9f8f659..3ddebf62dc 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -694,7 +694,7 @@ int kinLsPSetup(void *kinmem) in the case in which preconditioning is not done. This is the only case in which the user's psolve routine is allowed to be NULL. ------------------------------------------------------------------*/ -int kinLsPSolve(void *kinmem, N_Vector r, N_Vector z, realtype tol, int lr) +int kinLsPSolve(void *kinmem, N_Vector r, N_Vector z, sunrealtype tol, int lr) { KINMem kin_mem; KINLsMem kinls_mem; @@ -786,8 +786,8 @@ int kinLsDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, int kinLsDenseDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, KINMem kin_mem, N_Vector tmp1, N_Vector tmp2) { - realtype inc, inc_inv, ujsaved, ujscale, sign; - realtype *tmp2_data, *u_data, *uscale_data; + sunrealtype inc, inc_inv, ujsaved, ujscale, sign; + sunrealtype *tmp2_data, *u_data, *uscale_data; N_Vector ftemp, jthCol; sunindextype j, N; KINLsMem kinls_mem; @@ -864,11 +864,11 @@ int kinLsDenseDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, int kinLsBandDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, KINMem kin_mem, N_Vector tmp1, N_Vector tmp2) { - realtype inc, inc_inv; + sunrealtype inc, inc_inv; N_Vector futemp, utemp; sunindextype group, i, j, width, ngroups, i1, i2; sunindextype N, mupper, mlower; - realtype *col_j, *fu_data, *futemp_data, *u_data, *utemp_data, *uscale_data; + sunrealtype *col_j, *fu_data, *futemp_data, *u_data, *utemp_data, *uscale_data; KINLsMem kinls_mem; int retval = 0; @@ -953,7 +953,7 @@ int kinLsBandDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, int kinLsDQJtimes(N_Vector v, N_Vector Jv, N_Vector u, booleantype *new_u, void *kinmem) { - realtype sigma, sigma_inv, sutsv, sq1norm, sign, vtv; + sunrealtype sigma, sigma_inv, sutsv, sq1norm, sign, vtv; KINMem kin_mem; KINLsMem kinls_mem; int retval; @@ -1204,11 +1204,11 @@ int kinLsSetup(KINMem kin_mem) SUNLinearSolver object ------------------------------------------------------------------*/ int kinLsSolve(KINMem kin_mem, N_Vector xx, N_Vector bb, - realtype *sJpnorm, realtype *sFdotJp) + sunrealtype *sJpnorm, sunrealtype *sFdotJp) { KINLsMem kinls_mem; int nli_inc, retval; - realtype res_norm, tol; + sunrealtype res_norm, tol; /* Access KINLsMem structure */ if (kin_mem->kin_lmem == NULL) { diff --git a/src/kinsol/kinsol_ls_impl.h b/src/kinsol/kinsol_ls_impl.h index 2124649a4a..773540cbab 100644 --- a/src/kinsol/kinsol_ls_impl.h +++ b/src/kinsol/kinsol_ls_impl.h @@ -56,7 +56,7 @@ typedef struct KINLsMemRec { SUNMatrix J; /* problem Jacobian */ /* Solver tolerance adjustment factor (if needed, see kinLsSolve) */ - realtype tol_fac; + sunrealtype tol_fac; /* Statistics and associated parameters */ long int nje; /* no. of calls to jac */ @@ -110,7 +110,7 @@ typedef struct KINLsMemRec { int kinLsATimes(void *kinmem, N_Vector v, N_Vector z); int kinLsPSetup(void *kinmem); int kinLsPSolve(void *kinmem, N_Vector r, N_Vector z, - realtype tol, int lr); + sunrealtype tol, int lr); /* Difference quotient approximation for Jacobian times vector */ int kinLsDQJtimes(N_Vector v, N_Vector Jv, N_Vector u, @@ -130,7 +130,7 @@ int kinLsBandDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, int kinLsInitialize(KINMem kin_mem); int kinLsSetup(KINMem kin_mem); int kinLsSolve(KINMem kin_mem, N_Vector x, N_Vector b, - realtype *sJpnorm, realtype *sFdotJp); + sunrealtype *sJpnorm, sunrealtype *sFdotJp); int kinLsFree(KINMem kin_mem); /* Auxilliary functions */ diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index 469e62de65..de68c2a010 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -45,18 +45,18 @@ static int AllocateData(N_Vector v); // Reduction buffer functions static int InitializeDeviceCounter(N_Vector v); static int FreeDeviceCounter(N_Vector v); -static int InitializeReductionBuffer(N_Vector v, realtype value, size_t n = 1); +static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n = 1); static void FreeReductionBuffer(N_Vector v); static int CopyReductionBufferFromDevice(N_Vector v, size_t n = 1); // Fused operation buffer functions static int FusedBuffer_Init(N_Vector v, int nreal, int nptr); -static int FusedBuffer_CopyRealArray(N_Vector v, realtype *r_data, int nval, - realtype **shortcut); +static int FusedBuffer_CopyRealArray(N_Vector v, sunrealtype *r_data, int nval, + sunrealtype **shortcut); static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, - realtype ***shortcut); + sunrealtype ***shortcut); static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, - int nsum, realtype ***shortcut); + int nsum, sunrealtype ***shortcut); static int FusedBuffer_CopyToDevice(N_Vector v); static int FusedBuffer_Free(N_Vector v); @@ -73,16 +73,16 @@ static void PostKernelLaunch(); // Macros to access vector content #define NVEC_CUDA_CONTENT(x) ((N_VectorContent_Cuda)(x->content)) -#define NVEC_CUDA_MEMSIZE(x) (NVEC_CUDA_CONTENT(x)->length * sizeof(realtype)) +#define NVEC_CUDA_MEMSIZE(x) (NVEC_CUDA_CONTENT(x)->length * sizeof(sunrealtype)) #define NVEC_CUDA_MEMHELP(x) (NVEC_CUDA_CONTENT(x)->mem_helper) -#define NVEC_CUDA_HDATAp(x) ((realtype*) NVEC_CUDA_CONTENT(x)->host_data->ptr) -#define NVEC_CUDA_DDATAp(x) ((realtype*) NVEC_CUDA_CONTENT(x)->device_data->ptr) +#define NVEC_CUDA_HDATAp(x) ((sunrealtype*) NVEC_CUDA_CONTENT(x)->host_data->ptr) +#define NVEC_CUDA_DDATAp(x) ((sunrealtype*) NVEC_CUDA_CONTENT(x)->device_data->ptr) #define NVEC_CUDA_STREAM(x) (NVEC_CUDA_CONTENT(x)->stream_exec_policy->stream()) // Macros to access vector private content #define NVEC_CUDA_PRIVATE(x) ((N_PrivateVectorContent_Cuda)(NVEC_CUDA_CONTENT(x)->priv)) -#define NVEC_CUDA_HBUFFERp(x) ((realtype*) NVEC_CUDA_PRIVATE(x)->reduce_buffer_host->ptr) -#define NVEC_CUDA_DBUFFERp(x) ((realtype*) NVEC_CUDA_PRIVATE(x)->reduce_buffer_dev->ptr) +#define NVEC_CUDA_HBUFFERp(x) ((sunrealtype*) NVEC_CUDA_PRIVATE(x)->reduce_buffer_host->ptr) +#define NVEC_CUDA_DBUFFERp(x) ((sunrealtype*) NVEC_CUDA_PRIVATE(x)->reduce_buffer_dev->ptr) #define NVEC_CUDA_DCOUNTERp(x) ((unsigned int*) NVEC_CUDA_PRIVATE(x)->device_counter->ptr) /* @@ -322,7 +322,7 @@ N_Vector N_VNewManaged_Cuda(sunindextype length, SUNContext sunctx) return(v); } -N_Vector N_VMake_Cuda(sunindextype length, realtype *h_vdata, realtype *d_vdata, SUNContext sunctx) +N_Vector N_VMake_Cuda(sunindextype length, sunrealtype *h_vdata, sunrealtype *d_vdata, SUNContext sunctx) { N_Vector v; @@ -359,7 +359,7 @@ N_Vector N_VMake_Cuda(sunindextype length, realtype *h_vdata, realtype *d_vdata, return(v); } -N_Vector N_VMakeManaged_Cuda(sunindextype length, realtype *vdata, SUNContext sunctx) +N_Vector N_VMakeManaged_Cuda(sunindextype length, sunrealtype *vdata, SUNContext sunctx) { N_Vector v; @@ -400,7 +400,7 @@ N_Vector N_VMakeManaged_Cuda(sunindextype length, realtype *vdata, SUNContext su * Set pointer to the raw host data. Does not free the existing pointer. */ -void N_VSetHostArrayPointer_Cuda(realtype* h_vdata, N_Vector v) +void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v) { if (N_VIsManagedMemory_Cuda(v)) { @@ -432,7 +432,7 @@ void N_VSetHostArrayPointer_Cuda(realtype* h_vdata, N_Vector v) * Set pointer to the raw device data */ -void N_VSetDeviceArrayPointer_Cuda(realtype* d_vdata, N_Vector v) +void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) { if (N_VIsManagedMemory_Cuda(v)) { @@ -698,7 +698,7 @@ void N_VSpace_Cuda(N_Vector X, sunindextype *lrw, sunindextype *liw) *liw = 2; } -void N_VConst_Cuda(realtype a, N_Vector X) +void N_VConst_Cuda(sunrealtype a, N_Vector X) { size_t grid, block, shMemSize; cudaStream_t stream; @@ -717,7 +717,7 @@ void N_VConst_Cuda(realtype a, N_Vector X) PostKernelLaunch(); } -void N_VLinearSum_Cuda(realtype a, N_Vector X, realtype b, N_Vector Y, N_Vector Z) +void N_VLinearSum_Cuda(sunrealtype a, N_Vector X, sunrealtype b, N_Vector Y, N_Vector Z) { size_t grid, block, shMemSize; cudaStream_t stream; @@ -780,7 +780,7 @@ void N_VDiv_Cuda(N_Vector X, N_Vector Y, N_Vector Z) PostKernelLaunch(); } -void N_VScale_Cuda(realtype a, N_Vector X, N_Vector Z) +void N_VScale_Cuda(sunrealtype a, N_Vector X, N_Vector Z) { size_t grid, block, shMemSize; cudaStream_t stream; @@ -838,7 +838,7 @@ void N_VInv_Cuda(N_Vector X, N_Vector Z) PostKernelLaunch(); } -void N_VAddConst_Cuda(N_Vector X, realtype b, N_Vector Z) +void N_VAddConst_Cuda(N_Vector X, sunrealtype b, N_Vector Z) { size_t grid, block, shMemSize; cudaStream_t stream; @@ -858,13 +858,13 @@ void N_VAddConst_Cuda(N_Vector X, realtype b, N_Vector Z) PostKernelLaunch(); } -realtype N_VDotProd_Cuda(N_Vector X, N_Vector Y) +sunrealtype N_VDotProd_Cuda(N_Vector X, N_Vector Y) { bool atomic; size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -880,7 +880,7 @@ realtype N_VDotProd_Cuda(N_Vector X, N_Vector Y) if (atomic) { - dotProdKernel<<>> + dotProdKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(Y), @@ -891,7 +891,7 @@ realtype N_VDotProd_Cuda(N_Vector X, N_Vector Y) } else { - dotProdKernel<<>> + dotProdKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(Y), @@ -909,13 +909,13 @@ realtype N_VDotProd_Cuda(N_Vector X, N_Vector Y) return gpu_result; } -realtype N_VMaxNorm_Cuda(N_Vector X) +sunrealtype N_VMaxNorm_Cuda(N_Vector X) { bool atomic; size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -931,7 +931,7 @@ realtype N_VMaxNorm_Cuda(N_Vector X) if (atomic) { - maxNormKernel<<>> + maxNormKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DBUFFERp(X), @@ -941,7 +941,7 @@ realtype N_VMaxNorm_Cuda(N_Vector X) } else { - maxNormKernel<<>> + maxNormKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DBUFFERp(X), @@ -959,13 +959,13 @@ realtype N_VMaxNorm_Cuda(N_Vector X) return gpu_result; } -realtype N_VWSqrSumLocal_Cuda(N_Vector X, N_Vector W) +sunrealtype N_VWSqrSumLocal_Cuda(N_Vector X, N_Vector W) { bool atomic; size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -980,7 +980,7 @@ realtype N_VWSqrSumLocal_Cuda(N_Vector X, N_Vector W) if (atomic) { - wL2NormSquareKernel<<>> + wL2NormSquareKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(W), @@ -991,7 +991,7 @@ realtype N_VWSqrSumLocal_Cuda(N_Vector X, N_Vector W) } else { - wL2NormSquareKernel<<>> + wL2NormSquareKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(W), @@ -1010,19 +1010,19 @@ realtype N_VWSqrSumLocal_Cuda(N_Vector X, N_Vector W) return gpu_result; } -realtype N_VWrmsNorm_Cuda(N_Vector X, N_Vector W) +sunrealtype N_VWrmsNorm_Cuda(N_Vector X, N_Vector W) { - const realtype sum = N_VWSqrSumLocal_Cuda(X, W); + const sunrealtype sum = N_VWSqrSumLocal_Cuda(X, W); return std::sqrt(sum/NVEC_CUDA_CONTENT(X)->length); } -realtype N_VWSqrSumMaskLocal_Cuda(N_Vector X, N_Vector W, N_Vector Id) +sunrealtype N_VWSqrSumMaskLocal_Cuda(N_Vector X, N_Vector W, N_Vector Id) { bool atomic; size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1037,7 +1037,7 @@ realtype N_VWSqrSumMaskLocal_Cuda(N_Vector X, N_Vector W, N_Vector Id) if (atomic) { - wL2NormSquareMaskKernel<<>> + wL2NormSquareMaskKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(W), @@ -1049,7 +1049,7 @@ realtype N_VWSqrSumMaskLocal_Cuda(N_Vector X, N_Vector W, N_Vector Id) } else { - wL2NormSquareMaskKernel<<>> + wL2NormSquareMaskKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(W), @@ -1069,19 +1069,19 @@ realtype N_VWSqrSumMaskLocal_Cuda(N_Vector X, N_Vector W, N_Vector Id) return gpu_result; } -realtype N_VWrmsNormMask_Cuda(N_Vector X, N_Vector W, N_Vector Id) +sunrealtype N_VWrmsNormMask_Cuda(N_Vector X, N_Vector W, N_Vector Id) { - const realtype sum = N_VWSqrSumMaskLocal_Cuda(X, W, Id); + const sunrealtype sum = N_VWSqrSumMaskLocal_Cuda(X, W, Id); return std::sqrt(sum/NVEC_CUDA_CONTENT(X)->length); } -realtype N_VMin_Cuda(N_Vector X) +sunrealtype N_VMin_Cuda(N_Vector X) { bool atomic; size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = std::numeric_limits::max(); + sunrealtype gpu_result = std::numeric_limits::max(); if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1096,7 +1096,7 @@ realtype N_VMin_Cuda(N_Vector X) if (atomic) { - findMinKernel<<>> + findMinKernel<<>> ( gpu_result, NVEC_CUDA_DDATAp(X), @@ -1107,7 +1107,7 @@ realtype N_VMin_Cuda(N_Vector X) } else { - findMinKernel<<>> + findMinKernel<<>> ( gpu_result, NVEC_CUDA_DDATAp(X), @@ -1126,19 +1126,19 @@ realtype N_VMin_Cuda(N_Vector X) return gpu_result; } -realtype N_VWL2Norm_Cuda(N_Vector X, N_Vector W) +sunrealtype N_VWL2Norm_Cuda(N_Vector X, N_Vector W) { - const realtype sum = N_VWSqrSumLocal_Cuda(X, W); + const sunrealtype sum = N_VWSqrSumLocal_Cuda(X, W); return std::sqrt(sum); } -realtype N_VL1Norm_Cuda(N_Vector X) +sunrealtype N_VL1Norm_Cuda(N_Vector X) { bool atomic; size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1153,7 +1153,7 @@ realtype N_VL1Norm_Cuda(N_Vector X) if (atomic) { - L1NormKernel<<>> + L1NormKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DBUFFERp(X), @@ -1163,7 +1163,7 @@ realtype N_VL1Norm_Cuda(N_Vector X) } else { - L1NormKernel<<>> + L1NormKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DBUFFERp(X), @@ -1181,7 +1181,7 @@ realtype N_VL1Norm_Cuda(N_Vector X) return gpu_result; } -void N_VCompare_Cuda(realtype c, N_Vector X, N_Vector Z) +void N_VCompare_Cuda(sunrealtype c, N_Vector X, N_Vector Z) { size_t grid, block, shMemSize; cudaStream_t stream; @@ -1207,7 +1207,7 @@ booleantype N_VInvTest_Cuda(N_Vector X, N_Vector Z) size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1222,7 +1222,7 @@ booleantype N_VInvTest_Cuda(N_Vector X, N_Vector Z) if (atomic) { - invTestKernel<<>> + invTestKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(Z), @@ -1233,7 +1233,7 @@ booleantype N_VInvTest_Cuda(N_Vector X, N_Vector Z) } else { - invTestKernel<<>> + invTestKernel<<>> ( NVEC_CUDA_DDATAp(X), NVEC_CUDA_DDATAp(Z), @@ -1258,7 +1258,7 @@ booleantype N_VConstrMask_Cuda(N_Vector C, N_Vector X, N_Vector M) size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1273,7 +1273,7 @@ booleantype N_VConstrMask_Cuda(N_Vector C, N_Vector X, N_Vector M) if (atomic) { - constrMaskKernel<<>> + constrMaskKernel<<>> ( NVEC_CUDA_DDATAp(C), NVEC_CUDA_DDATAp(X), @@ -1285,7 +1285,7 @@ booleantype N_VConstrMask_Cuda(N_Vector C, N_Vector X, N_Vector M) } else { - constrMaskKernel<<>> + constrMaskKernel<<>> ( NVEC_CUDA_DDATAp(C), NVEC_CUDA_DDATAp(X), @@ -1305,13 +1305,13 @@ booleantype N_VConstrMask_Cuda(N_Vector C, N_Vector X, N_Vector M) return (gpu_result < HALF); } -realtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom) { bool atomic; size_t grid, block, shMemSize; cudaStream_t stream; - realtype gpu_result = std::numeric_limits::max();; + sunrealtype gpu_result = std::numeric_limits::max();; if (GetKernelParameters(num, true, grid, block, shMemSize, stream, atomic)) { @@ -1326,7 +1326,7 @@ realtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom) if (atomic) { - minQuotientKernel<<>> + minQuotientKernel<<>> ( gpu_result, NVEC_CUDA_DDATAp(num), @@ -1338,7 +1338,7 @@ realtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom) } else { - minQuotientKernel<<>> + minQuotientKernel<<>> ( gpu_result, NVEC_CUDA_DDATAp(num), @@ -1366,11 +1366,11 @@ realtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom) */ -int N_VLinearCombination_Cuda(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_Cuda(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { // Fused op workspace shortcuts - realtype* cdata = NULL; - realtype** xdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(z, nvec, nvec)) @@ -1421,13 +1421,13 @@ int N_VLinearCombination_Cuda(int nvec, realtype* c, N_Vector* X, N_Vector z) } -int N_VScaleAddMulti_Cuda(int nvec, realtype* c, N_Vector x, N_Vector* Y, +int N_VScaleAddMulti_Cuda(int nvec, sunrealtype* c, N_Vector x, N_Vector* Y, N_Vector* Z) { // Shortcuts to the fused op workspace - realtype* cdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(x, nvec, 2 * nvec)) @@ -1485,10 +1485,10 @@ int N_VScaleAddMulti_Cuda(int nvec, realtype* c, N_Vector x, N_Vector* Y, } -int N_VDotProdMulti_Cuda(int nvec, N_Vector x, N_Vector* Y, realtype* dots) +int N_VDotProdMulti_Cuda(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dots) { // Fused op workspace shortcuts - realtype** ydata = NULL; + sunrealtype** ydata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(x, 0, nvec)) @@ -1525,7 +1525,7 @@ int N_VDotProdMulti_Cuda(int nvec, N_Vector x, N_Vector* Y, realtype* dots) SUNDIALS_DEBUG_PRINT("ERROR in N_VDotProd_Cuda: InitializeReductionBuffer returned nonzero\n"); } - dotProdMultiKernel<<>> + dotProdMultiKernel<<>> ( nvec, NVEC_CUDA_DDATAp(x), @@ -1555,14 +1555,14 @@ int N_VDotProdMulti_Cuda(int nvec, N_Vector x, N_Vector* Y, realtype* dots) int N_VLinearSumVectorArray_Cuda(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { // Shortcuts to the fused op workspace - realtype** xdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], 0, 3 * nvec)) @@ -1621,12 +1621,12 @@ int N_VLinearSumVectorArray_Cuda(int nvec, } -int N_VScaleVectorArray_Cuda(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_Cuda(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { // Shortcuts to the fused op workspace arrays - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], nvec, 2 * nvec)) @@ -1683,10 +1683,10 @@ int N_VScaleVectorArray_Cuda(int nvec, realtype* c, N_Vector* X, N_Vector* Z) } -int N_VConstVectorArray_Cuda(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_Cuda(int nvec, sunrealtype c, N_Vector* Z) { // Shortcuts to the fused op workspace arrays - realtype** zdata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], 0, nvec)) @@ -1731,11 +1731,11 @@ int N_VConstVectorArray_Cuda(int nvec, realtype c, N_Vector* Z) int N_VWrmsNormVectorArray_Cuda(int nvec, N_Vector* X, N_Vector* W, - realtype* norms) + sunrealtype* norms) { // Fused op workspace shortcuts - realtype** xdata = NULL; - realtype** wdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** wdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(W[0], 0, 2 * nvec)) @@ -1778,7 +1778,7 @@ int N_VWrmsNormVectorArray_Cuda(int nvec, N_Vector* X, N_Vector* W, } grid = nvec; - wL2NormSquareVectorArrayKernel<<>> + wL2NormSquareVectorArrayKernel<<>> ( nvec, xdata, @@ -1801,11 +1801,11 @@ int N_VWrmsNormVectorArray_Cuda(int nvec, N_Vector* X, N_Vector* W, int N_VWrmsNormMaskVectorArray_Cuda(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, realtype* norms) + N_Vector id, sunrealtype* norms) { // Fused op workspace shortcuts - realtype** xdata = NULL; - realtype** wdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** wdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(W[0], 0, 2 * nvec)) @@ -1848,7 +1848,7 @@ int N_VWrmsNormMaskVectorArray_Cuda(int nvec, N_Vector* X, N_Vector* W, } grid = nvec; - wL2NormSquareMaskVectorArrayKernel<<>> + wL2NormSquareMaskVectorArrayKernel<<>> ( nvec, xdata, @@ -1871,14 +1871,14 @@ int N_VWrmsNormMaskVectorArray_Cuda(int nvec, N_Vector* X, N_Vector* W, } -int N_VScaleAddMultiVectorArray_Cuda(int nvec, int nsum, realtype* c, +int N_VScaleAddMultiVectorArray_Cuda(int nvec, int nsum, sunrealtype* c, N_Vector* X, N_Vector** Y, N_Vector** Z) { // Shortcuts to the fused op workspace - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(X[0], nsum, nvec + 2 * nvec * nsum)) @@ -1943,13 +1943,13 @@ int N_VScaleAddMultiVectorArray_Cuda(int nvec, int nsum, realtype* c, } -int N_VLinearCombinationVectorArray_Cuda(int nvec, int nsum, realtype* c, +int N_VLinearCombinationVectorArray_Cuda(int nvec, int nsum, sunrealtype* c, N_Vector** X, N_Vector* Z) { // Shortcuts to the fused op workspace arrays - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], nsum, nvec + nvec * nsum)) @@ -2275,12 +2275,12 @@ static int AllocateData(N_Vector v) * of the vector is increased. The buffer is initialized to the * value given. */ -static int InitializeReductionBuffer(N_Vector v, realtype value, size_t n) +static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) { int alloc_fail = 0; int copy_fail = 0; booleantype alloc_mem = SUNFALSE; - size_t bytes = n * sizeof(realtype); + size_t bytes = n * sizeof(sunrealtype); // Get the vector private memory structure N_PrivateVectorContent_Cuda vcp = NVEC_CUDA_PRIVATE(v); @@ -2329,7 +2329,7 @@ static int InitializeReductionBuffer(N_Vector v, realtype value, size_t n) // Initialize the host memory with the value for (int i = 0; i < n; ++i) - ((realtype*)vcp->reduce_buffer_host->ptr)[i] = value; + ((sunrealtype*)vcp->reduce_buffer_host->ptr)[i] = value; // Initialize the device memory with the value copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(v), @@ -2379,7 +2379,7 @@ static int CopyReductionBufferFromDevice(N_Vector v, size_t n) copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_PRIVATE(v)->reduce_buffer_host, NVEC_CUDA_PRIVATE(v)->reduce_buffer_dev, - n * sizeof(realtype), + n * sizeof(sunrealtype), (void*) NVEC_CUDA_STREAM(v)); if (copy_fail) @@ -2400,9 +2400,9 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // pad buffer with single precision data #if defined(SUNDIALS_SINGLE_PRECISION) - size_t bytes = nreal * 2 * sizeof(realtype) + nptr * sizeof(realtype*); + size_t bytes = nreal * 2 * sizeof(sunrealtype) + nptr * sizeof(sunrealtype*); #elif defined(SUNDIALS_DOUBLE_PRECISION) - size_t bytes = nreal * sizeof(realtype) + nptr * sizeof(realtype*); + size_t bytes = nreal * sizeof(sunrealtype) + nptr * sizeof(sunrealtype*); #else #error Incompatible precision for CUDA #endif @@ -2459,8 +2459,8 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) } -static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, - realtype **shortcut) +static int FusedBuffer_CopyRealArray(N_Vector v, sunrealtype *rdata, int nval, + sunrealtype **shortcut) { // Get the vector private memory structure N_PrivateVectorContent_Cuda vcp = NVEC_CUDA_PRIVATE(v); @@ -2472,7 +2472,7 @@ static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, return -1; } - realtype* h_buffer = (realtype*) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype* h_buffer = (sunrealtype*) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nval; j++) @@ -2481,14 +2481,14 @@ static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, } // Set shortcut to the device buffer and update offset - *shortcut = (realtype*) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype*) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); // accounting for buffer padding #if defined(SUNDIALS_SINGLE_PRECISION) - vcp->fused_buffer_offset += nval * 2 * sizeof(realtype); + vcp->fused_buffer_offset += nval * 2 * sizeof(sunrealtype); #elif defined(SUNDIALS_DOUBLE_PRECISION) - vcp->fused_buffer_offset += nval * sizeof(realtype); + vcp->fused_buffer_offset += nval * sizeof(sunrealtype); #else #error Incompatible precision for CUDA #endif @@ -2498,7 +2498,7 @@ static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, - realtype ***shortcut) + sunrealtype ***shortcut) { // Get the vector private memory structure N_PrivateVectorContent_Cuda vcp = NVEC_CUDA_PRIVATE(v); @@ -2510,7 +2510,7 @@ static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, return -1; } - realtype** h_buffer = (realtype**) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype** h_buffer = (sunrealtype**) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) @@ -2519,17 +2519,17 @@ static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, } // Set shortcut to the device buffer and update offset - *shortcut = (realtype**) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype**) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); - vcp->fused_buffer_offset += nvec * sizeof(realtype*); + vcp->fused_buffer_offset += nvec * sizeof(sunrealtype*); return 0; } static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, - int nsum, realtype ***shortcut) + int nsum, sunrealtype ***shortcut) { // Get the vector private memory structure N_PrivateVectorContent_Cuda vcp = NVEC_CUDA_PRIVATE(v); @@ -2541,7 +2541,7 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, return -1; } - realtype** h_buffer = (realtype**) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype** h_buffer = (sunrealtype**) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) @@ -2553,11 +2553,11 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, } // Set shortcut to the device buffer and update offset - *shortcut = (realtype**) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype**) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); // Update the offset - vcp->fused_buffer_offset += nvec * nsum * sizeof(realtype*); + vcp->fused_buffer_offset += nvec * nsum * sizeof(sunrealtype*); return 0; } diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index ca660fb89d..dc2cf952d4 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -45,7 +45,7 @@ static int AllocateData(N_Vector v); // Reduction buffer functions static int InitializeDeviceCounter(N_Vector v); static int FreeDeviceCounter(N_Vector v); -static int InitializeReductionBuffer(N_Vector v, realtype value, size_t n = 1); +static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n = 1); static void FreeReductionBuffer(N_Vector v); static int CopyReductionBufferFromDevice(N_Vector v, size_t n = 1); @@ -62,16 +62,16 @@ static void PostKernelLaunch(); // Macros to access vector content #define NVEC_HIP_CONTENT(x) ((N_VectorContent_Hip)(x->content)) -#define NVEC_HIP_MEMSIZE(x) (NVEC_HIP_CONTENT(x)->length * sizeof(realtype)) +#define NVEC_HIP_MEMSIZE(x) (NVEC_HIP_CONTENT(x)->length * sizeof(sunrealtype)) #define NVEC_HIP_MEMHELP(x) (NVEC_HIP_CONTENT(x)->mem_helper) -#define NVEC_HIP_HDATAp(x) ((realtype*) NVEC_HIP_CONTENT(x)->host_data->ptr) -#define NVEC_HIP_DDATAp(x) ((realtype*) NVEC_HIP_CONTENT(x)->device_data->ptr) +#define NVEC_HIP_HDATAp(x) ((sunrealtype*) NVEC_HIP_CONTENT(x)->host_data->ptr) +#define NVEC_HIP_DDATAp(x) ((sunrealtype*) NVEC_HIP_CONTENT(x)->device_data->ptr) #define NVEC_HIP_STREAM(x) (NVEC_HIP_CONTENT(x)->stream_exec_policy->stream()) // Macros to access vector private content #define NVEC_HIP_PRIVATE(x) ((N_PrivateVectorContent_Hip)(NVEC_HIP_CONTENT(x)->priv)) -#define NVEC_HIP_HBUFFERp(x) ((realtype*) NVEC_HIP_PRIVATE(x)->reduce_buffer_host->ptr) -#define NVEC_HIP_DBUFFERp(x) ((realtype*) NVEC_HIP_PRIVATE(x)->reduce_buffer_dev->ptr) +#define NVEC_HIP_HBUFFERp(x) ((sunrealtype*) NVEC_HIP_PRIVATE(x)->reduce_buffer_host->ptr) +#define NVEC_HIP_DBUFFERp(x) ((sunrealtype*) NVEC_HIP_PRIVATE(x)->reduce_buffer_dev->ptr) #define NVEC_HIP_DCOUNTERp(x) ((unsigned int*) NVEC_HIP_PRIVATE(x)->device_counter->ptr) /* @@ -299,7 +299,7 @@ N_Vector N_VNewManaged_Hip(sunindextype length, SUNContext sunctx) return(v); } -N_Vector N_VMake_Hip(sunindextype length, realtype *h_vdata, realtype *d_vdata, SUNContext sunctx) +N_Vector N_VMake_Hip(sunindextype length, sunrealtype *h_vdata, sunrealtype *d_vdata, SUNContext sunctx) { N_Vector v; @@ -336,7 +336,7 @@ N_Vector N_VMake_Hip(sunindextype length, realtype *h_vdata, realtype *d_vdata, return(v); } -N_Vector N_VMakeManaged_Hip(sunindextype length, realtype *vdata, SUNContext sunctx) +N_Vector N_VMakeManaged_Hip(sunindextype length, sunrealtype *vdata, SUNContext sunctx) { N_Vector v; @@ -377,7 +377,7 @@ N_Vector N_VMakeManaged_Hip(sunindextype length, realtype *vdata, SUNContext sun * Set pointer to the raw host data. Does not free the existing pointer. */ -void N_VSetHostArrayPointer_Hip(realtype* h_vdata, N_Vector v) +void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) { if (N_VIsManagedMemory_Hip(v)) { @@ -409,7 +409,7 @@ void N_VSetHostArrayPointer_Hip(realtype* h_vdata, N_Vector v) * Set pointer to the raw device data */ -void N_VSetDeviceArrayPointer_Hip(realtype* d_vdata, N_Vector v) +void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) { if (N_VIsManagedMemory_Hip(v)) { @@ -674,7 +674,7 @@ void N_VSpace_Hip(N_Vector X, sunindextype *lrw, sunindextype *liw) *liw = 2; } -void N_VConst_Hip(realtype a, N_Vector X) +void N_VConst_Hip(sunrealtype a, N_Vector X) { size_t grid, block, shMemSize; hipStream_t stream; @@ -693,7 +693,7 @@ void N_VConst_Hip(realtype a, N_Vector X) PostKernelLaunch(); } -void N_VLinearSum_Hip(realtype a, N_Vector X, realtype b, N_Vector Y, N_Vector Z) +void N_VLinearSum_Hip(sunrealtype a, N_Vector X, sunrealtype b, N_Vector Y, N_Vector Z) { size_t grid, block, shMemSize; hipStream_t stream; @@ -756,7 +756,7 @@ void N_VDiv_Hip(N_Vector X, N_Vector Y, N_Vector Z) PostKernelLaunch(); } -void N_VScale_Hip(realtype a, N_Vector X, N_Vector Z) +void N_VScale_Hip(sunrealtype a, N_Vector X, N_Vector Z) { size_t grid, block, shMemSize; hipStream_t stream; @@ -814,7 +814,7 @@ void N_VInv_Hip(N_Vector X, N_Vector Z) PostKernelLaunch(); } -void N_VAddConst_Hip(N_Vector X, realtype b, N_Vector Z) +void N_VAddConst_Hip(N_Vector X, sunrealtype b, N_Vector Z) { size_t grid, block, shMemSize; hipStream_t stream; @@ -834,13 +834,13 @@ void N_VAddConst_Hip(N_Vector X, realtype b, N_Vector Z) PostKernelLaunch(); } -realtype N_VDotProd_Hip(N_Vector X, N_Vector Y) +sunrealtype N_VDotProd_Hip(N_Vector X, N_Vector Y) { bool atomic; size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -856,7 +856,7 @@ realtype N_VDotProd_Hip(N_Vector X, N_Vector Y) if (atomic) { - dotProdKernel<<>> + dotProdKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(Y), @@ -867,7 +867,7 @@ realtype N_VDotProd_Hip(N_Vector X, N_Vector Y) } else { - dotProdKernel<<>> + dotProdKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(Y), @@ -885,13 +885,13 @@ realtype N_VDotProd_Hip(N_Vector X, N_Vector Y) return gpu_result; } -realtype N_VMaxNorm_Hip(N_Vector X) +sunrealtype N_VMaxNorm_Hip(N_Vector X) { bool atomic; size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -907,7 +907,7 @@ realtype N_VMaxNorm_Hip(N_Vector X) if (atomic) { - maxNormKernel<<>> + maxNormKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DBUFFERp(X), @@ -917,7 +917,7 @@ realtype N_VMaxNorm_Hip(N_Vector X) } else { - maxNormKernel<<>> + maxNormKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DBUFFERp(X), @@ -935,13 +935,13 @@ realtype N_VMaxNorm_Hip(N_Vector X) return gpu_result; } -realtype N_VWSqrSumLocal_Hip(N_Vector X, N_Vector W) +sunrealtype N_VWSqrSumLocal_Hip(N_Vector X, N_Vector W) { bool atomic; size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -956,7 +956,7 @@ realtype N_VWSqrSumLocal_Hip(N_Vector X, N_Vector W) if (atomic) { - wL2NormSquareKernel<<>> + wL2NormSquareKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(W), @@ -967,7 +967,7 @@ realtype N_VWSqrSumLocal_Hip(N_Vector X, N_Vector W) } else { - wL2NormSquareKernel<<>> + wL2NormSquareKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(W), @@ -986,19 +986,19 @@ realtype N_VWSqrSumLocal_Hip(N_Vector X, N_Vector W) return gpu_result; } -realtype N_VWrmsNorm_Hip(N_Vector X, N_Vector W) +sunrealtype N_VWrmsNorm_Hip(N_Vector X, N_Vector W) { - const realtype sum = N_VWSqrSumLocal_Hip(X, W); + const sunrealtype sum = N_VWSqrSumLocal_Hip(X, W); return std::sqrt(sum/NVEC_HIP_CONTENT(X)->length); } -realtype N_VWSqrSumMaskLocal_Hip(N_Vector X, N_Vector W, N_Vector Id) +sunrealtype N_VWSqrSumMaskLocal_Hip(N_Vector X, N_Vector W, N_Vector Id) { bool atomic; size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1013,7 +1013,7 @@ realtype N_VWSqrSumMaskLocal_Hip(N_Vector X, N_Vector W, N_Vector Id) if (atomic) { - wL2NormSquareMaskKernel<<>> + wL2NormSquareMaskKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(W), @@ -1025,7 +1025,7 @@ realtype N_VWSqrSumMaskLocal_Hip(N_Vector X, N_Vector W, N_Vector Id) } else { - wL2NormSquareMaskKernel<<>> + wL2NormSquareMaskKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(W), @@ -1045,19 +1045,19 @@ realtype N_VWSqrSumMaskLocal_Hip(N_Vector X, N_Vector W, N_Vector Id) return gpu_result; } -realtype N_VWrmsNormMask_Hip(N_Vector X, N_Vector W, N_Vector Id) +sunrealtype N_VWrmsNormMask_Hip(N_Vector X, N_Vector W, N_Vector Id) { - const realtype sum = N_VWSqrSumMaskLocal_Hip(X, W, Id); + const sunrealtype sum = N_VWSqrSumMaskLocal_Hip(X, W, Id); return std::sqrt(sum/NVEC_HIP_CONTENT(X)->length); } -realtype N_VMin_Hip(N_Vector X) +sunrealtype N_VMin_Hip(N_Vector X) { bool atomic; size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = std::numeric_limits::max(); + sunrealtype gpu_result = std::numeric_limits::max(); if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1072,7 +1072,7 @@ realtype N_VMin_Hip(N_Vector X) if (atomic) { - findMinKernel<<>> + findMinKernel<<>> ( gpu_result, NVEC_HIP_DDATAp(X), @@ -1083,7 +1083,7 @@ realtype N_VMin_Hip(N_Vector X) } else { - findMinKernel<<>> + findMinKernel<<>> ( gpu_result, NVEC_HIP_DDATAp(X), @@ -1102,19 +1102,19 @@ realtype N_VMin_Hip(N_Vector X) return gpu_result; } -realtype N_VWL2Norm_Hip(N_Vector X, N_Vector W) +sunrealtype N_VWL2Norm_Hip(N_Vector X, N_Vector W) { - const realtype sum = N_VWSqrSumLocal_Hip(X, W); + const sunrealtype sum = N_VWSqrSumLocal_Hip(X, W); return std::sqrt(sum); } -realtype N_VL1Norm_Hip(N_Vector X) +sunrealtype N_VL1Norm_Hip(N_Vector X) { bool atomic; size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1129,7 +1129,7 @@ realtype N_VL1Norm_Hip(N_Vector X) if (atomic) { - L1NormKernel<<>> + L1NormKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DBUFFERp(X), @@ -1139,7 +1139,7 @@ realtype N_VL1Norm_Hip(N_Vector X) } else { - L1NormKernel<<>> + L1NormKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DBUFFERp(X), @@ -1157,7 +1157,7 @@ realtype N_VL1Norm_Hip(N_Vector X) return gpu_result; } -void N_VCompare_Hip(realtype c, N_Vector X, N_Vector Z) +void N_VCompare_Hip(sunrealtype c, N_Vector X, N_Vector Z) { size_t grid, block, shMemSize; hipStream_t stream; @@ -1183,7 +1183,7 @@ booleantype N_VInvTest_Hip(N_Vector X, N_Vector Z) size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1198,7 +1198,7 @@ booleantype N_VInvTest_Hip(N_Vector X, N_Vector Z) if (atomic) { - invTestKernel<<>> + invTestKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(Z), @@ -1209,7 +1209,7 @@ booleantype N_VInvTest_Hip(N_Vector X, N_Vector Z) } else { - invTestKernel<<>> + invTestKernel<<>> ( NVEC_HIP_DDATAp(X), NVEC_HIP_DDATAp(Z), @@ -1234,7 +1234,7 @@ booleantype N_VConstrMask_Hip(N_Vector C, N_Vector X, N_Vector M) size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = ZERO; + sunrealtype gpu_result = ZERO; if (GetKernelParameters(X, true, grid, block, shMemSize, stream, atomic)) { @@ -1249,7 +1249,7 @@ booleantype N_VConstrMask_Hip(N_Vector C, N_Vector X, N_Vector M) if (atomic) { - constrMaskKernel<<>> + constrMaskKernel<<>> ( NVEC_HIP_DDATAp(C), NVEC_HIP_DDATAp(X), @@ -1261,7 +1261,7 @@ booleantype N_VConstrMask_Hip(N_Vector C, N_Vector X, N_Vector M) } else { - constrMaskKernel<<>> + constrMaskKernel<<>> ( NVEC_HIP_DDATAp(C), NVEC_HIP_DDATAp(X), @@ -1281,13 +1281,13 @@ booleantype N_VConstrMask_Hip(N_Vector C, N_Vector X, N_Vector M) return (gpu_result < HALF); } -realtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom) { bool atomic; size_t grid, block, shMemSize; hipStream_t stream; - realtype gpu_result = std::numeric_limits::max();; + sunrealtype gpu_result = std::numeric_limits::max();; if (GetKernelParameters(num, true, grid, block, shMemSize, stream, atomic)) { @@ -1302,7 +1302,7 @@ realtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom) if (atomic) { - minQuotientKernel<<>> + minQuotientKernel<<>> ( gpu_result, NVEC_HIP_DDATAp(num), @@ -1314,7 +1314,7 @@ realtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom) } else { - minQuotientKernel<<>> + minQuotientKernel<<>> ( gpu_result, NVEC_HIP_DDATAp(num), @@ -1341,27 +1341,27 @@ realtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom) * ----------------------------------------------------------------- */ -int N_VLinearCombination_Hip(int nvec, realtype* c, N_Vector* X, N_Vector Z) +int N_VLinearCombination_Hip(int nvec, sunrealtype* c, N_Vector* X, N_Vector Z) { hipError_t err; // Copy c array to device - realtype* d_c; - err = hipMalloc((void**) &d_c, nvec*sizeof(realtype)); + sunrealtype* d_c; + err = hipMalloc((void**) &d_c, nvec*sizeof(sunrealtype)); if (!SUNDIALS_HIP_VERIFY(err)) return(-1); - err = hipMemcpy(d_c, c, nvec*sizeof(realtype), hipMemcpyHostToDevice); + err = hipMemcpy(d_c, c, nvec*sizeof(sunrealtype), hipMemcpyHostToDevice); if (!SUNDIALS_HIP_VERIFY(err)) return(-1); // Create array of device pointers on host - realtype** h_Xd = new realtype*[nvec]; + sunrealtype** h_Xd = new sunrealtype*[nvec]; for (int i=0; i<<>>( + dotProdMultiKernel<<>>( nvec, NVEC_HIP_DDATAp(X), d_Yd, @@ -1494,7 +1494,7 @@ int N_VDotProdMulti_Hip(int nvec, N_Vector X, N_Vector* Y, realtype* dots) PostKernelLaunch(); // Copy GPU result to the cpu. - err = hipMemcpy(dots, d_buff, grid*sizeof(realtype), hipMemcpyDeviceToHost); + err = hipMemcpy(dots, d_buff, grid*sizeof(sunrealtype), hipMemcpyDeviceToHost); if (!SUNDIALS_HIP_VERIFY(err)) return(-1); // Free host array @@ -1516,41 +1516,41 @@ int N_VDotProdMulti_Hip(int nvec, N_Vector X, N_Vector* Y, realtype* dots) * ----------------------------------------------------------------------------- */ -int N_VLinearSumVectorArray_Hip(int nvec, realtype a, N_Vector* X, realtype b, +int N_VLinearSumVectorArray_Hip(int nvec, sunrealtype a, N_Vector* X, sunrealtype b, N_Vector* Y, N_Vector* Z) { hipError_t err; // Create array of device pointers on host - realtype** h_Xd = new realtype*[nvec]; + sunrealtype** h_Xd = new sunrealtype*[nvec]; for (int i=0; i<<>>( + wL2NormSquareVectorArrayKernel<<>>( nvec, d_Xd, d_Wd, @@ -1736,7 +1736,7 @@ int N_VWrmsNormVectorArray_Hip(int nvec, N_Vector* X, N_Vector* W, PostKernelLaunch(); // Copy GPU result to the cpu. - err = hipMemcpy(norms, d_buff, grid*sizeof(realtype), hipMemcpyDeviceToHost); + err = hipMemcpy(norms, d_buff, grid*sizeof(sunrealtype), hipMemcpyDeviceToHost); if (!SUNDIALS_HIP_VERIFY(err)) return(-1); // Finish computation @@ -1759,30 +1759,30 @@ int N_VWrmsNormVectorArray_Hip(int nvec, N_Vector* X, N_Vector* W, } int N_VWrmsNormMaskVectorArray_Hip(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, realtype* norms) + N_Vector id, sunrealtype* norms) { hipError_t err; // Create array of device pointers on host - realtype** h_Xd = new realtype*[nvec]; + sunrealtype** h_Xd = new sunrealtype*[nvec]; for (int i=0; i<<>>( + wL2NormSquareMaskVectorArrayKernel<<>>( nvec, d_Xd, d_Wd, @@ -1810,7 +1810,7 @@ int N_VWrmsNormMaskVectorArray_Hip(int nvec, N_Vector* X, N_Vector* W, PostKernelLaunch(); // Copy GPU result to the cpu. - err = hipMemcpy(norms, d_buff, grid*sizeof(realtype), hipMemcpyDeviceToHost); + err = hipMemcpy(norms, d_buff, grid*sizeof(sunrealtype), hipMemcpyDeviceToHost); if (!SUNDIALS_HIP_VERIFY(err)) return(-1); // Finish computation @@ -1832,50 +1832,50 @@ int N_VWrmsNormMaskVectorArray_Hip(int nvec, N_Vector* X, N_Vector* W, return(0); } -int N_VScaleAddMultiVectorArray_Hip(int nvec, int nsum, realtype* c, +int N_VScaleAddMultiVectorArray_Hip(int nvec, int nsum, sunrealtype* c, N_Vector* X, N_Vector** Y, N_Vector** Z) { hipError_t err; // Copy c array to device - realtype* d_c; - err = hipMalloc((void**) &d_c, nsum*sizeof(realtype)); + sunrealtype* d_c; + err = hipMalloc((void**) &d_c, nsum*sizeof(sunrealtype)); if (!SUNDIALS_HIP_VERIFY(err)) return(-1); - err = hipMemcpy(d_c, c, nsum*sizeof(realtype), hipMemcpyHostToDevice); + err = hipMemcpy(d_c, c, nsum*sizeof(sunrealtype), hipMemcpyHostToDevice); if (!SUNDIALS_HIP_VERIFY(err)) return(-1); // Create array of device pointers on host - realtype** h_Xd = new realtype*[nvec]; + sunrealtype** h_Xd = new sunrealtype*[nvec]; for (int i=0; ireduce_buffer_host->ptr)[i] = value; + ((sunrealtype*)vcp->reduce_buffer_host->ptr)[i] = value; // Initialize the device memory with the value copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(v), @@ -2438,7 +2438,7 @@ static int CopyReductionBufferFromDevice(N_Vector v, size_t n) copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(v), NVEC_HIP_PRIVATE(v)->reduce_buffer_host, NVEC_HIP_PRIVATE(v)->reduce_buffer_dev, - n * sizeof(realtype), + n * sizeof(sunrealtype), (void*) NVEC_HIP_STREAM(v)); if (copy_fail) diff --git a/src/nvector/manyvector/fmod/fnvector_manyvector_mod.c b/src/nvector/manyvector/fmod/fnvector_manyvector_mod.c index 5509af24c4..2b4ed1cf4b 100644 --- a/src/nvector/manyvector/fmod/fnvector_manyvector_mod.c +++ b/src/nvector/manyvector/fmod/fnvector_manyvector_mod.c @@ -240,12 +240,12 @@ SWIGEXPORT N_Vector _wrap_FN_VGetSubvector_ManyVector(N_Vector farg1, int64_t co SWIGEXPORT int _wrap_FN_VSetSubvectorArrayPointer_ManyVector(double *farg1, N_Vector farg2, int64_t const *farg3) { int fresult ; - realtype *arg1 = (realtype *) 0 ; + sunrealtype *arg1 = (sunrealtype *) 0 ; N_Vector arg2 = (N_Vector) 0 ; sunindextype arg3 ; int result; - arg1 = (realtype *)(farg1); + arg1 = (sunrealtype *)(farg1); arg2 = (N_Vector)(farg2); arg3 = (sunindextype)(*farg3); result = (int)N_VSetSubvectorArrayPointer_ManyVector(arg1,arg2,arg3); @@ -367,15 +367,15 @@ SWIGEXPORT int64_t _wrap_FN_VGetSubvectorLocalLength_ManyVector(N_Vector farg1, SWIGEXPORT void _wrap_FN_VLinearSum_ManyVector(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); N_VLinearSum_ManyVector(arg1,arg2,arg3,arg4,arg5); @@ -383,10 +383,10 @@ SWIGEXPORT void _wrap_FN_VLinearSum_ManyVector(double const *farg1, N_Vector far SWIGEXPORT void _wrap_FN_VConst_ManyVector(double const *farg1, N_Vector farg2) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); N_VConst_ManyVector(arg1,arg2); } @@ -417,11 +417,11 @@ SWIGEXPORT void _wrap_FN_VDiv_ManyVector(N_Vector farg1, N_Vector farg2, N_Vecto SWIGEXPORT void _wrap_FN_VScale_ManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VScale_ManyVector(arg1,arg2,arg3); @@ -450,11 +450,11 @@ SWIGEXPORT void _wrap_FN_VInv_ManyVector(N_Vector farg1, N_Vector farg2) { SWIGEXPORT void _wrap_FN_VAddConst_ManyVector(N_Vector farg1, double const *farg2, N_Vector farg3) { N_Vector arg1 = (N_Vector) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; arg1 = (N_Vector)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); N_VAddConst_ManyVector(arg1,arg2,arg3); } @@ -464,12 +464,12 @@ SWIGEXPORT double _wrap_FN_VWrmsNorm_ManyVector(N_Vector farg1, N_Vector farg2) double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWrmsNorm_ManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNorm_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -479,13 +479,13 @@ SWIGEXPORT double _wrap_FN_VWrmsNormMask_ManyVector(N_Vector farg1, N_Vector far N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWrmsNormMask_ManyVector(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNormMask_ManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -494,22 +494,22 @@ SWIGEXPORT double _wrap_FN_VWL2Norm_ManyVector(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWL2Norm_ManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWL2Norm_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } SWIGEXPORT void _wrap_FN_VCompare_ManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VCompare_ManyVector(arg1,arg2,arg3); @@ -519,13 +519,13 @@ SWIGEXPORT void _wrap_FN_VCompare_ManyVector(double const *farg1, N_Vector farg2 SWIGEXPORT int _wrap_FN_VLinearCombination_ManyVector(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); result = (int)N_VLinearCombination_ManyVector(arg1,arg2,arg3,arg4); @@ -537,14 +537,14 @@ SWIGEXPORT int _wrap_FN_VLinearCombination_ManyVector(int const *farg1, double * SWIGEXPORT int _wrap_FN_VScaleAddMulti_ManyVector(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); @@ -559,13 +559,13 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti_ManyVector(int const *farg1, N_Vector farg int arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VDotProdMulti_ManyVector(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -575,17 +575,17 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti_ManyVector(int const *farg1, N_Vector farg SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_ManyVector(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector *arg5 = (N_Vector *) 0 ; N_Vector *arg6 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector *)(farg5); arg6 = (N_Vector *)(farg6); result = (int)N_VLinearSumVectorArray_ManyVector(arg1,arg2,arg3,arg4,arg5,arg6); @@ -597,13 +597,13 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_ManyVector(int const *farg1, doubl SWIGEXPORT int _wrap_FN_VScaleVectorArray_ManyVector(int const *farg1, double *farg2, void *farg3, void *farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); result = (int)N_VScaleVectorArray_ManyVector(arg1,arg2,arg3,arg4); @@ -615,12 +615,12 @@ SWIGEXPORT int _wrap_FN_VScaleVectorArray_ManyVector(int const *farg1, double *f SWIGEXPORT int _wrap_FN_VConstVectorArray_ManyVector(int const *farg1, double const *farg2, void *farg3) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)N_VConstVectorArray_ManyVector(arg1,arg2,arg3); fresult = (int)(result); @@ -633,13 +633,13 @@ SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_ManyVector(int const *farg1, void * int arg1 ; N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VWrmsNormVectorArray_ManyVector(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -652,14 +652,14 @@ SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_ManyVector(int const *farg1, vo N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype *arg5 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype *)(farg5); + arg5 = (sunrealtype *)(farg5); result = (int)N_VWrmsNormMaskVectorArray_ManyVector(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -670,12 +670,12 @@ SWIGEXPORT double _wrap_FN_VDotProdLocal_ManyVector(N_Vector farg1, N_Vector far double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VDotProdLocal_ManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VDotProdLocal_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -683,11 +683,11 @@ SWIGEXPORT double _wrap_FN_VDotProdLocal_ManyVector(N_Vector farg1, N_Vector far SWIGEXPORT double _wrap_FN_VMaxNormLocal_ManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMaxNormLocal_ManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMaxNormLocal_ManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -695,11 +695,11 @@ SWIGEXPORT double _wrap_FN_VMaxNormLocal_ManyVector(N_Vector farg1) { SWIGEXPORT double _wrap_FN_VMinLocal_ManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMinLocal_ManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinLocal_ManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -707,11 +707,11 @@ SWIGEXPORT double _wrap_FN_VMinLocal_ManyVector(N_Vector farg1) { SWIGEXPORT double _wrap_FN_VL1NormLocal_ManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VL1NormLocal_ManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VL1NormLocal_ManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -720,12 +720,12 @@ SWIGEXPORT double _wrap_FN_VWSqrSumLocal_ManyVector(N_Vector farg1, N_Vector far double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWSqrSumLocal_ManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumLocal_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -735,13 +735,13 @@ SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_ManyVector(N_Vector farg1, N_Vector N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWSqrSumMaskLocal_ManyVector(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumMaskLocal_ManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -780,12 +780,12 @@ SWIGEXPORT double _wrap_FN_VMinQuotientLocal_ManyVector(N_Vector farg1, N_Vector double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VMinQuotientLocal_ManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinQuotientLocal_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -795,13 +795,13 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiLocal_ManyVector(int const *farg1, N_Vector int arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VDotProdMultiLocal_ManyVector(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -995,11 +995,11 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1 double * fresult ; N_Vector arg1 = (N_Vector) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); fresult = result; return fresult; } diff --git a/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c b/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c index 7e50b664f1..314eee4d75 100644 --- a/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c +++ b/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c @@ -262,12 +262,12 @@ SWIGEXPORT N_Vector _wrap_FN_VGetSubvector_MPIManyVector(N_Vector farg1, int64_t SWIGEXPORT int _wrap_FN_VSetSubvectorArrayPointer_MPIManyVector(double *farg1, N_Vector farg2, int64_t const *farg3) { int fresult ; - realtype *arg1 = (realtype *) 0 ; + sunrealtype *arg1 = (sunrealtype *) 0 ; N_Vector arg2 = (N_Vector) 0 ; sunindextype arg3 ; int result; - arg1 = (realtype *)(farg1); + arg1 = (sunrealtype *)(farg1); arg2 = (N_Vector)(farg2); arg3 = (sunindextype)(*farg3); result = (int)N_VSetSubvectorArrayPointer_MPIManyVector(arg1,arg2,arg3); @@ -401,15 +401,15 @@ SWIGEXPORT int64_t _wrap_FN_VGetSubvectorLocalLength_MPIManyVector(N_Vector farg SWIGEXPORT void _wrap_FN_VLinearSum_MPIManyVector(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); N_VLinearSum_MPIManyVector(arg1,arg2,arg3,arg4,arg5); @@ -417,10 +417,10 @@ SWIGEXPORT void _wrap_FN_VLinearSum_MPIManyVector(double const *farg1, N_Vector SWIGEXPORT void _wrap_FN_VConst_MPIManyVector(double const *farg1, N_Vector farg2) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); N_VConst_MPIManyVector(arg1,arg2); } @@ -451,11 +451,11 @@ SWIGEXPORT void _wrap_FN_VDiv_MPIManyVector(N_Vector farg1, N_Vector farg2, N_Ve SWIGEXPORT void _wrap_FN_VScale_MPIManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VScale_MPIManyVector(arg1,arg2,arg3); @@ -484,11 +484,11 @@ SWIGEXPORT void _wrap_FN_VInv_MPIManyVector(N_Vector farg1, N_Vector farg2) { SWIGEXPORT void _wrap_FN_VAddConst_MPIManyVector(N_Vector farg1, double const *farg2, N_Vector farg3) { N_Vector arg1 = (N_Vector) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; arg1 = (N_Vector)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); N_VAddConst_MPIManyVector(arg1,arg2,arg3); } @@ -498,12 +498,12 @@ SWIGEXPORT double _wrap_FN_VDotProd_MPIManyVector(N_Vector farg1, N_Vector farg2 double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VDotProd_MPIManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VDotProd_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -511,11 +511,11 @@ SWIGEXPORT double _wrap_FN_VDotProd_MPIManyVector(N_Vector farg1, N_Vector farg2 SWIGEXPORT double _wrap_FN_VMaxNorm_MPIManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMaxNorm_MPIManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMaxNorm_MPIManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -524,12 +524,12 @@ SWIGEXPORT double _wrap_FN_VWrmsNorm_MPIManyVector(N_Vector farg1, N_Vector farg double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWrmsNorm_MPIManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNorm_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -539,13 +539,13 @@ SWIGEXPORT double _wrap_FN_VWrmsNormMask_MPIManyVector(N_Vector farg1, N_Vector N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWrmsNormMask_MPIManyVector(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNormMask_MPIManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -553,11 +553,11 @@ SWIGEXPORT double _wrap_FN_VWrmsNormMask_MPIManyVector(N_Vector farg1, N_Vector SWIGEXPORT double _wrap_FN_VMin_MPIManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMin_MPIManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMin_MPIManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -566,12 +566,12 @@ SWIGEXPORT double _wrap_FN_VWL2Norm_MPIManyVector(N_Vector farg1, N_Vector farg2 double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWL2Norm_MPIManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWL2Norm_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -579,21 +579,21 @@ SWIGEXPORT double _wrap_FN_VWL2Norm_MPIManyVector(N_Vector farg1, N_Vector farg2 SWIGEXPORT double _wrap_FN_VL1Norm_MPIManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VL1Norm_MPIManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VL1Norm_MPIManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } SWIGEXPORT void _wrap_FN_VCompare_MPIManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VCompare_MPIManyVector(arg1,arg2,arg3); @@ -634,12 +634,12 @@ SWIGEXPORT double _wrap_FN_VMinQuotient_MPIManyVector(N_Vector farg1, N_Vector f double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VMinQuotient_MPIManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinQuotient_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -647,13 +647,13 @@ SWIGEXPORT double _wrap_FN_VMinQuotient_MPIManyVector(N_Vector farg1, N_Vector f SWIGEXPORT int _wrap_FN_VLinearCombination_MPIManyVector(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); result = (int)N_VLinearCombination_MPIManyVector(arg1,arg2,arg3,arg4); @@ -665,14 +665,14 @@ SWIGEXPORT int _wrap_FN_VLinearCombination_MPIManyVector(int const *farg1, doubl SWIGEXPORT int _wrap_FN_VScaleAddMulti_MPIManyVector(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); @@ -687,13 +687,13 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti_MPIManyVector(int const *farg1, N_Vector f int arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VDotProdMulti_MPIManyVector(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -705,13 +705,13 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiLocal_MPIManyVector(int const *farg1, N_Vec int arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VDotProdMultiLocal_MPIManyVector(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -722,12 +722,12 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce_MPIManyVector(int const *farg1, N int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); result = (int)N_VDotProdMultiAllReduce_MPIManyVector(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -737,17 +737,17 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce_MPIManyVector(int const *farg1, N SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_MPIManyVector(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector *arg5 = (N_Vector *) 0 ; N_Vector *arg6 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector *)(farg5); arg6 = (N_Vector *)(farg6); result = (int)N_VLinearSumVectorArray_MPIManyVector(arg1,arg2,arg3,arg4,arg5,arg6); @@ -759,13 +759,13 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_MPIManyVector(int const *farg1, do SWIGEXPORT int _wrap_FN_VScaleVectorArray_MPIManyVector(int const *farg1, double *farg2, void *farg3, void *farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); result = (int)N_VScaleVectorArray_MPIManyVector(arg1,arg2,arg3,arg4); @@ -777,12 +777,12 @@ SWIGEXPORT int _wrap_FN_VScaleVectorArray_MPIManyVector(int const *farg1, double SWIGEXPORT int _wrap_FN_VConstVectorArray_MPIManyVector(int const *farg1, double const *farg2, void *farg3) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)N_VConstVectorArray_MPIManyVector(arg1,arg2,arg3); fresult = (int)(result); @@ -795,13 +795,13 @@ SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_MPIManyVector(int const *farg1, voi int arg1 ; N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VWrmsNormVectorArray_MPIManyVector(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -814,14 +814,14 @@ SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_MPIManyVector(int const *farg1, N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype *arg5 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype *)(farg5); + arg5 = (sunrealtype *)(farg5); result = (int)N_VWrmsNormMaskVectorArray_MPIManyVector(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -832,12 +832,12 @@ SWIGEXPORT double _wrap_FN_VDotProdLocal_MPIManyVector(N_Vector farg1, N_Vector double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VDotProdLocal_MPIManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VDotProdLocal_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -845,11 +845,11 @@ SWIGEXPORT double _wrap_FN_VDotProdLocal_MPIManyVector(N_Vector farg1, N_Vector SWIGEXPORT double _wrap_FN_VMaxNormLocal_MPIManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMaxNormLocal_MPIManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMaxNormLocal_MPIManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -857,11 +857,11 @@ SWIGEXPORT double _wrap_FN_VMaxNormLocal_MPIManyVector(N_Vector farg1) { SWIGEXPORT double _wrap_FN_VMinLocal_MPIManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMinLocal_MPIManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinLocal_MPIManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -869,11 +869,11 @@ SWIGEXPORT double _wrap_FN_VMinLocal_MPIManyVector(N_Vector farg1) { SWIGEXPORT double _wrap_FN_VL1NormLocal_MPIManyVector(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VL1NormLocal_MPIManyVector(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VL1NormLocal_MPIManyVector(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -882,12 +882,12 @@ SWIGEXPORT double _wrap_FN_VWSqrSumLocal_MPIManyVector(N_Vector farg1, N_Vector double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWSqrSumLocal_MPIManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumLocal_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -897,13 +897,13 @@ SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_MPIManyVector(N_Vector farg1, N_Vec N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWSqrSumMaskLocal_MPIManyVector(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumMaskLocal_MPIManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -942,12 +942,12 @@ SWIGEXPORT double _wrap_FN_VMinQuotientLocal_MPIManyVector(N_Vector farg1, N_Vec double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VMinQuotientLocal_MPIManyVector(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinQuotientLocal_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -1139,11 +1139,11 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector fa double * fresult ; N_Vector arg1 = (N_Vector) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); fresult = result; return fresult; } diff --git a/src/nvector/manyvector/nvector_manyvector.c b/src/nvector/manyvector/nvector_manyvector.c index c663f2ced3..dd4bed94f6 100644 --- a/src/nvector/manyvector/nvector_manyvector.c +++ b/src/nvector/manyvector/nvector_manyvector.c @@ -399,7 +399,7 @@ N_Vector MVAPPEND(N_VGetSubvector)(N_Vector v, sunindextype vec_num) the N_Vector array. If vec_num is outside of applicable bounds, or if the subvector does not support the N_VGetArrayPointer routine, then NULL is returned. */ -realtype *MVAPPEND(N_VGetSubvectorArrayPointer)(N_Vector v, sunindextype vec_num) +sunrealtype *MVAPPEND(N_VGetSubvectorArrayPointer)(N_Vector v, sunindextype vec_num) { if ( (vec_num < 0) || (vec_num > MANYVECTOR_NUM_SUBVECS(v)) ) return(NULL); @@ -413,7 +413,7 @@ realtype *MVAPPEND(N_VGetSubvectorArrayPointer)(N_Vector v, sunindextype vec_num the N_Vector array. If vec_num is outside of applicable bounds, or if the subvector does not support the N_VSetArrayPointer routine, then -1 is returned; otherwise this routine returns 0. */ -int MVAPPEND(N_VSetSubvectorArrayPointer)(realtype *v_data, N_Vector v, sunindextype vec_num) +int MVAPPEND(N_VSetSubvectorArrayPointer)(sunrealtype *v_data, N_Vector v, sunindextype vec_num) { if ( (vec_num < 0) || (vec_num > MANYVECTOR_NUM_SUBVECS(v)) ) return(-1); @@ -570,7 +570,7 @@ sunindextype MVAPPEND(N_VGetSubvectorLocalLength)(N_Vector v, sunindextype vec_n /* Performs the linear sum z = a*x + b*y by calling N_VLinearSum on all subvectors; this routine does not check that x, y and z are ManyVectors, if they have the same number of subvectors, or if these subvectors are compatible. */ -void MVAPPEND(N_VLinearSum)(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void MVAPPEND(N_VLinearSum)(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { sunindextype i; for (i=0; i 0) NV_DATA_OMP(v) = v_data; @@ -426,10 +426,10 @@ void N_VSetArrayPointer_OpenMP(realtype *v_data, N_Vector v) * Compute linear combination z[i] = a*x[i]+b*y[i] */ -void N_VLinearSum_OpenMP(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum_OpenMP(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { sunindextype i, N; - realtype c, *xd, *yd, *zd; + sunrealtype c, *xd, *yd, *zd; N_Vector v1, v2; booleantype test; @@ -521,10 +521,10 @@ void N_VLinearSum_OpenMP(realtype a, N_Vector x, realtype b, N_Vector y, N_Vecto * Assigns constant value to all vector elements, z[i] = c */ -void N_VConst_OpenMP(realtype c, N_Vector z) +void N_VConst_OpenMP(sunrealtype c, N_Vector z) { sunindextype i, N; - realtype *zd; + sunrealtype *zd; i = 0; /* initialize to suppress clang warning */ zd = NULL; @@ -547,7 +547,7 @@ void N_VConst_OpenMP(realtype c, N_Vector z) void N_VProd_OpenMP(N_Vector x, N_Vector y, N_Vector z) { sunindextype i, N; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; i = 0; /* initialize to suppress clang warning */ xd = yd = zd = NULL; @@ -573,7 +573,7 @@ void N_VProd_OpenMP(N_Vector x, N_Vector y, N_Vector z) void N_VDiv_OpenMP(N_Vector x, N_Vector y, N_Vector z) { sunindextype i, N; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; i = 0; /* initialize to suppress clang warning */ xd = yd = zd = NULL; @@ -596,10 +596,10 @@ void N_VDiv_OpenMP(N_Vector x, N_Vector y, N_Vector z) * Compute scaler multiplication z[i] = c*x[i] */ -void N_VScale_OpenMP(realtype c, N_Vector x, N_Vector z) +void N_VScale_OpenMP(sunrealtype c, N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; i = 0; /* initialize to suppress clang warning */ xd = zd = NULL; @@ -635,7 +635,7 @@ void N_VScale_OpenMP(realtype c, N_Vector x, N_Vector z) void N_VAbs_OpenMP(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; i = 0; /* initialize to suppress clang warning */ xd = zd = NULL; @@ -659,7 +659,7 @@ void N_VAbs_OpenMP(N_Vector x, N_Vector z) void N_VInv_OpenMP(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; i = 0; /* initialize to suppress clang warning */ xd = zd = NULL; @@ -681,10 +681,10 @@ void N_VInv_OpenMP(N_Vector x, N_Vector z) * Compute componentwise addition of a scaler to a vector z[i] = x[i] + b */ -void N_VAddConst_OpenMP(N_Vector x, realtype b, N_Vector z) +void N_VAddConst_OpenMP(N_Vector x, sunrealtype b, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; i = 0; /* initialize to suppress clang warning */ xd = zd = NULL; @@ -706,10 +706,10 @@ void N_VAddConst_OpenMP(N_Vector x, realtype b, N_Vector z) * Computes the dot product of two vectors, a = sum(x[i]*y[i]) */ -realtype N_VDotProd_OpenMP(N_Vector x, N_Vector y) +sunrealtype N_VDotProd_OpenMP(N_Vector x, N_Vector y) { sunindextype i, N; - realtype sum, *xd, *yd; + sunrealtype sum, *xd, *yd; i = 0; /* initialize to suppress clang warning */ sum = ZERO; @@ -733,10 +733,10 @@ realtype N_VDotProd_OpenMP(N_Vector x, N_Vector y) * Computes max norm of a vector */ -realtype N_VMaxNorm_OpenMP(N_Vector x) +sunrealtype N_VMaxNorm_OpenMP(N_Vector x) { sunindextype i, N; - realtype tmax, max, *xd; + sunrealtype tmax, max, *xd; i = 0; /* initialize to suppress clang warning */ max = ZERO; @@ -767,7 +767,7 @@ realtype N_VMaxNorm_OpenMP(N_Vector x) * Computes weighted root mean square norm of a vector */ -realtype N_VWrmsNorm_OpenMP(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_OpenMP(N_Vector x, N_Vector w) { return(SUNRsqrt(N_VWSqrSumLocal_OpenMP(x, w)/(NV_LENGTH_OMP(x)))); } @@ -777,7 +777,7 @@ realtype N_VWrmsNorm_OpenMP(N_Vector x, N_Vector w) * Computes weighted root mean square norm of a masked vector */ -realtype N_VWrmsNormMask_OpenMP(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_OpenMP(N_Vector x, N_Vector w, N_Vector id) { return(SUNRsqrt(N_VWSqrSumMaskLocal_OpenMP(x, w, id)/(NV_LENGTH_OMP(x)))); } @@ -787,11 +787,11 @@ realtype N_VWrmsNormMask_OpenMP(N_Vector x, N_Vector w, N_Vector id) * Finds the minimun component of a vector */ -realtype N_VMin_OpenMP(N_Vector x) +sunrealtype N_VMin_OpenMP(N_Vector x) { sunindextype i, N; - realtype min, *xd; - realtype tmin; + sunrealtype min, *xd; + sunrealtype tmin; i = 0; /* initialize to suppress clang warning */ xd = NULL; @@ -825,10 +825,10 @@ realtype N_VMin_OpenMP(N_Vector x) * Computes weighted L2 norm of a vector */ -realtype N_VWL2Norm_OpenMP(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_OpenMP(N_Vector x, N_Vector w) { sunindextype i, N; - realtype sum, *xd, *wd; + sunrealtype sum, *xd, *wd; i = 0; /* initialize to suppress clang warning */ sum = ZERO; @@ -852,10 +852,10 @@ realtype N_VWL2Norm_OpenMP(N_Vector x, N_Vector w) * Computes L1 norm of a vector */ -realtype N_VL1Norm_OpenMP(N_Vector x) +sunrealtype N_VL1Norm_OpenMP(N_Vector x) { sunindextype i, N; - realtype sum, *xd; + sunrealtype sum, *xd; i = 0; /* initialize to suppress clang warning */ sum = ZERO; @@ -877,10 +877,10 @@ realtype N_VL1Norm_OpenMP(N_Vector x) * Compare vector component values to a scaler */ -void N_VCompare_OpenMP(realtype c, N_Vector x, N_Vector z) +void N_VCompare_OpenMP(sunrealtype c, N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; i = 0; /* initialize to suppress clang warning */ xd = zd = NULL; @@ -906,7 +906,7 @@ void N_VCompare_OpenMP(realtype c, N_Vector x, N_Vector z) booleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd, val; + sunrealtype *xd, *zd, val; i = 0; /* initialize to suppress clang warning */ xd = zd = NULL; @@ -940,8 +940,8 @@ booleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z) booleantype N_VConstrMask_OpenMP(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; - realtype temp; - realtype *cd, *xd, *md; + sunrealtype temp; + sunrealtype *cd, *xd, *md; booleantype test; i = 0; /* initialize to suppress clang warning */ @@ -979,10 +979,10 @@ booleantype N_VConstrMask_OpenMP(N_Vector c, N_Vector x, N_Vector m) * Compute minimum componentwise quotient */ -realtype N_VMinQuotient_OpenMP(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_OpenMP(N_Vector num, N_Vector denom) { sunindextype i, N; - realtype *nd, *dd, min, tmin, val; + sunrealtype *nd, *dd, min, tmin, val; i = 0; /* initialize to suppress clang warning */ nd = dd = NULL; @@ -1020,10 +1020,10 @@ realtype N_VMinQuotient_OpenMP(N_Vector num, N_Vector denom) * Computes weighted square sum of a vector */ -realtype N_VWSqrSumLocal_OpenMP(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal_OpenMP(N_Vector x, N_Vector w) { sunindextype i, N; - realtype sum, *xd, *wd; + sunrealtype sum, *xd, *wd; i = 0; /* initialize to suppress clang warning */ sum = ZERO; @@ -1047,10 +1047,10 @@ realtype N_VWSqrSumLocal_OpenMP(N_Vector x, N_Vector w) * Computes weighted square sum of a masked vector */ -realtype N_VWSqrSumMaskLocal_OpenMP(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal_OpenMP(N_Vector x, N_Vector w, N_Vector id) { sunindextype i, N; - realtype sum, *xd, *wd, *idd; + sunrealtype sum, *xd, *wd, *idd; i = 0; /* initialize to suppress clang warning */ sum = ZERO; @@ -1079,12 +1079,12 @@ realtype N_VWSqrSumMaskLocal_OpenMP(N_Vector x, N_Vector w, N_Vector id) * ----------------------------------------------------------------- */ -int N_VLinearCombination_OpenMP(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_OpenMP(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { int i; sunindextype j, N; - realtype* zd=NULL; - realtype* xd=NULL; + sunrealtype* zd=NULL; + sunrealtype* xd=NULL; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -1174,13 +1174,13 @@ int N_VLinearCombination_OpenMP(int nvec, realtype* c, N_Vector* X, N_Vector z) } -int N_VScaleAddMulti_OpenMP(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) +int N_VScaleAddMulti_OpenMP(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -1235,13 +1235,13 @@ int N_VScaleAddMulti_OpenMP(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Ve } -int N_VDotProdMulti_OpenMP(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) +int N_VDotProdMulti_OpenMP(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods) { int i; sunindextype j, N; - realtype sum; - realtype* xd=NULL; - realtype* yd=NULL; + sunrealtype sum; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -1293,16 +1293,16 @@ int N_VDotProdMulti_OpenMP(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods */ int N_VLinearSumVectorArray_OpenMP(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; - realtype c; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; + sunrealtype c; N_Vector* V1; N_Vector* V2; booleantype test; @@ -1397,12 +1397,12 @@ int N_VLinearSumVectorArray_OpenMP(int nvec, } -int N_VScaleVectorArray_OpenMP(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_OpenMP(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* zd=NULL; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -1456,11 +1456,11 @@ int N_VScaleVectorArray_OpenMP(int nvec, realtype* c, N_Vector* X, N_Vector* Z) } -int N_VConstVectorArray_OpenMP(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_OpenMP(int nvec, sunrealtype c, N_Vector* Z) { int i; sunindextype j, N; - realtype* zd=NULL; + sunrealtype* zd=NULL; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -1494,13 +1494,13 @@ int N_VConstVectorArray_OpenMP(int nvec, realtype c, N_Vector* Z) } -int N_VWrmsNormVectorArray_OpenMP(int nvec, N_Vector* X, N_Vector* W, realtype* nrm) +int N_VWrmsNormVectorArray_OpenMP(int nvec, N_Vector* X, N_Vector* W, sunrealtype* nrm) { int i; sunindextype j, N; - realtype sum; - realtype* wd=NULL; - realtype* xd=NULL; + sunrealtype sum; + sunrealtype* wd=NULL; + sunrealtype* xd=NULL; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -1550,14 +1550,14 @@ int N_VWrmsNormVectorArray_OpenMP(int nvec, N_Vector* X, N_Vector* W, realtype* int N_VWrmsNormMaskVectorArray_OpenMP(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, realtype* nrm) + N_Vector id, sunrealtype* nrm) { int i; sunindextype j, N; - realtype sum; - realtype* wd=NULL; - realtype* xd=NULL; - realtype* idd=NULL; + sunrealtype sum; + sunrealtype* wd=NULL; + sunrealtype* xd=NULL; + sunrealtype* idd=NULL; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -1608,14 +1608,14 @@ int N_VWrmsNormMaskVectorArray_OpenMP(int nvec, N_Vector* X, N_Vector* W, } -int N_VScaleAddMultiVectorArray_OpenMP(int nvec, int nsum, realtype* a, +int N_VScaleAddMultiVectorArray_OpenMP(int nvec, int nsum, sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z) { int i, j; sunindextype k, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; int retval; N_Vector* YY; @@ -1717,7 +1717,7 @@ int N_VScaleAddMultiVectorArray_OpenMP(int nvec, int nsum, realtype* a, int N_VLinearCombinationVectorArray_OpenMP(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z) { @@ -1725,10 +1725,10 @@ int N_VLinearCombinationVectorArray_OpenMP(int nvec, int nsum, int j; /* vector index in vector array [0,nvec) */ sunindextype k; /* element index in vector [0,N) */ sunindextype N; - realtype* zd=NULL; - realtype* xd=NULL; + sunrealtype* zd=NULL; + sunrealtype* xd=NULL; - realtype* ctmp; + sunrealtype* ctmp; N_Vector* Y; i = 0; /* initialize to suppress clang warning */ @@ -1776,7 +1776,7 @@ int N_VLinearCombinationVectorArray_OpenMP(int nvec, int nsum, /* should have called N_VScaleVectorArray */ if (nsum == 1) { - ctmp = (realtype*) malloc(nvec * sizeof(realtype)); + ctmp = (sunrealtype*) malloc(nvec * sizeof(sunrealtype)); for (j=0; j 0) NV_DATA_P(v) = v_data; @@ -435,10 +435,10 @@ void *N_VGetCommunicator_Parallel(N_Vector v) return((void *) &(NV_COMM_P(v))); } -void N_VLinearSum_Parallel(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum_Parallel(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { sunindextype i, N; - realtype c, *xd, *yd, *zd; + sunrealtype c, *xd, *yd, *zd; N_Vector v1, v2; booleantype test; @@ -522,10 +522,10 @@ void N_VLinearSum_Parallel(realtype a, N_Vector x, realtype b, N_Vector y, N_Vec return; } -void N_VConst_Parallel(realtype c, N_Vector z) +void N_VConst_Parallel(sunrealtype c, N_Vector z) { sunindextype i, N; - realtype *zd; + sunrealtype *zd; zd = NULL; @@ -540,7 +540,7 @@ void N_VConst_Parallel(realtype c, N_Vector z) void N_VProd_Parallel(N_Vector x, N_Vector y, N_Vector z) { sunindextype i, N; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; xd = yd = zd = NULL; @@ -558,7 +558,7 @@ void N_VProd_Parallel(N_Vector x, N_Vector y, N_Vector z) void N_VDiv_Parallel(N_Vector x, N_Vector y, N_Vector z) { sunindextype i, N; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; xd = yd = zd = NULL; @@ -573,10 +573,10 @@ void N_VDiv_Parallel(N_Vector x, N_Vector y, N_Vector z) return; } -void N_VScale_Parallel(realtype c, N_Vector x, N_Vector z) +void N_VScale_Parallel(sunrealtype c, N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -603,7 +603,7 @@ void N_VScale_Parallel(realtype c, N_Vector x, N_Vector z) void N_VAbs_Parallel(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -620,7 +620,7 @@ void N_VAbs_Parallel(N_Vector x, N_Vector z) void N_VInv_Parallel(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -634,10 +634,10 @@ void N_VInv_Parallel(N_Vector x, N_Vector z) return; } -void N_VAddConst_Parallel(N_Vector x, realtype b, N_Vector z) +void N_VAddConst_Parallel(N_Vector x, sunrealtype b, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -650,10 +650,10 @@ void N_VAddConst_Parallel(N_Vector x, realtype b, N_Vector z) return; } -realtype N_VDotProdLocal_Parallel(N_Vector x, N_Vector y) +sunrealtype N_VDotProdLocal_Parallel(N_Vector x, N_Vector y) { sunindextype i, N; - realtype sum, *xd, *yd; + sunrealtype sum, *xd, *yd; sum = ZERO; xd = yd = NULL; @@ -666,18 +666,18 @@ realtype N_VDotProdLocal_Parallel(N_Vector x, N_Vector y) return(sum); } -realtype N_VDotProd_Parallel(N_Vector x, N_Vector y) +sunrealtype N_VDotProd_Parallel(N_Vector x, N_Vector y) { - realtype lsum, gsum; + sunrealtype lsum, gsum; lsum = N_VDotProdLocal_Parallel(x,y); MPI_Allreduce(&lsum, &gsum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_P(x)); return(gsum); } -realtype N_VMaxNormLocal_Parallel(N_Vector x) +sunrealtype N_VMaxNormLocal_Parallel(N_Vector x) { sunindextype i, N; - realtype max, *xd; + sunrealtype max, *xd; xd = NULL; @@ -692,18 +692,18 @@ realtype N_VMaxNormLocal_Parallel(N_Vector x) return(max); } -realtype N_VMaxNorm_Parallel(N_Vector x) +sunrealtype N_VMaxNorm_Parallel(N_Vector x) { - realtype lmax, gmax; + sunrealtype lmax, gmax; lmax = N_VMaxNormLocal_Parallel(x); MPI_Allreduce(&lmax, &gmax, 1, MPI_SUNREALTYPE, MPI_MAX, NV_COMM_P(x)); return(gmax); } -realtype N_VWSqrSumLocal_Parallel(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal_Parallel(N_Vector x, N_Vector w) { sunindextype i, N; - realtype sum, prodi, *xd, *wd; + sunrealtype sum, prodi, *xd, *wd; sum = ZERO; xd = wd = NULL; @@ -720,18 +720,18 @@ realtype N_VWSqrSumLocal_Parallel(N_Vector x, N_Vector w) return(sum); } -realtype N_VWrmsNorm_Parallel(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_Parallel(N_Vector x, N_Vector w) { - realtype lsum, gsum; + sunrealtype lsum, gsum; lsum = N_VWSqrSumLocal_Parallel(x, w); MPI_Allreduce(&lsum, &gsum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_P(x)); return(SUNRsqrt(gsum/(NV_GLOBLENGTH_P(x)))); } -realtype N_VWSqrSumMaskLocal_Parallel(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal_Parallel(N_Vector x, N_Vector w, N_Vector id) { sunindextype i, N; - realtype sum, prodi, *xd, *wd, *idd; + sunrealtype sum, prodi, *xd, *wd, *idd; sum = ZERO; xd = wd = idd = NULL; @@ -750,18 +750,18 @@ realtype N_VWSqrSumMaskLocal_Parallel(N_Vector x, N_Vector w, N_Vector id) return(sum); } -realtype N_VWrmsNormMask_Parallel(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_Parallel(N_Vector x, N_Vector w, N_Vector id) { - realtype lsum, gsum; + sunrealtype lsum, gsum; lsum = N_VWSqrSumMaskLocal_Parallel(x, w, id); MPI_Allreduce(&lsum, &gsum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_P(x)); return(SUNRsqrt(gsum/(NV_GLOBLENGTH_P(x)))); } -realtype N_VMinLocal_Parallel(N_Vector x) +sunrealtype N_VMinLocal_Parallel(N_Vector x) { sunindextype i, N; - realtype min, *xd; + sunrealtype min, *xd; xd = NULL; N = NV_LOCLENGTH_P(x); @@ -776,26 +776,26 @@ realtype N_VMinLocal_Parallel(N_Vector x) return(min); } -realtype N_VMin_Parallel(N_Vector x) +sunrealtype N_VMin_Parallel(N_Vector x) { - realtype lmin, gmin; + sunrealtype lmin, gmin; lmin = N_VMinLocal_Parallel(x); MPI_Allreduce(&lmin, &gmin, 1, MPI_SUNREALTYPE, MPI_MIN, NV_COMM_P(x)); return(gmin); } -realtype N_VWL2Norm_Parallel(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_Parallel(N_Vector x, N_Vector w) { - realtype lsum, gsum; + sunrealtype lsum, gsum; lsum = N_VWSqrSumLocal_Parallel(x, w); MPI_Allreduce(&lsum, &gsum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_P(x)); return(SUNRsqrt(gsum)); } -realtype N_VL1NormLocal_Parallel(N_Vector x) +sunrealtype N_VL1NormLocal_Parallel(N_Vector x) { sunindextype i, N; - realtype sum, *xd; + sunrealtype sum, *xd; sum = ZERO; xd = NULL; @@ -808,18 +808,18 @@ realtype N_VL1NormLocal_Parallel(N_Vector x) return(sum); } -realtype N_VL1Norm_Parallel(N_Vector x) +sunrealtype N_VL1Norm_Parallel(N_Vector x) { - realtype lsum, gsum; + sunrealtype lsum, gsum; lsum = N_VL1NormLocal_Parallel(x); MPI_Allreduce(&lsum, &gsum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_P(x)); return(gsum); } -void N_VCompare_Parallel(realtype c, N_Vector x, N_Vector z) +void N_VCompare_Parallel(sunrealtype c, N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -837,7 +837,7 @@ void N_VCompare_Parallel(realtype c, N_Vector x, N_Vector z) booleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd, val; + sunrealtype *xd, *zd, val; xd = zd = NULL; @@ -861,7 +861,7 @@ booleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z) booleantype N_VInvTest_Parallel(N_Vector x, N_Vector z) { - realtype val, gval; + sunrealtype val, gval; val = (N_VInvTestLocal_Parallel(x, z)) ? ONE : ZERO; MPI_Allreduce(&val, &gval, 1, MPI_SUNREALTYPE, MPI_MIN, NV_COMM_P(x)); if (gval == ZERO) @@ -873,8 +873,8 @@ booleantype N_VInvTest_Parallel(N_Vector x, N_Vector z) booleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; - realtype temp; - realtype *cd, *xd, *md; + sunrealtype temp; + sunrealtype *cd, *xd, *md; booleantype test; cd = xd = md = NULL; @@ -907,17 +907,17 @@ booleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, N_Vector m) booleantype N_VConstrMask_Parallel(N_Vector c, N_Vector x, N_Vector m) { - realtype temp, temp2; + sunrealtype temp, temp2; temp = (N_VConstrMaskLocal_Parallel(c, x, m)) ? ZERO : ONE; MPI_Allreduce(&temp, &temp2, 1, MPI_SUNREALTYPE, MPI_MAX, NV_COMM_P(x)); return (temp2 == ONE) ? SUNFALSE : SUNTRUE; } -realtype N_VMinQuotientLocal_Parallel(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotientLocal_Parallel(N_Vector num, N_Vector denom) { booleantype notEvenOnce; sunindextype i, N; - realtype *nd, *dd, min; + sunrealtype *nd, *dd, min; nd = dd = NULL; @@ -941,9 +941,9 @@ realtype N_VMinQuotientLocal_Parallel(N_Vector num, N_Vector denom) return(min); } -realtype N_VMinQuotient_Parallel(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Parallel(N_Vector num, N_Vector denom) { - realtype lmin, gmin; + sunrealtype lmin, gmin; lmin = N_VMinQuotientLocal_Parallel(num, denom); MPI_Allreduce(&lmin, &gmin, 1, MPI_SUNREALTYPE, MPI_MIN, NV_COMM_P(num)); return(gmin); @@ -956,12 +956,12 @@ realtype N_VMinQuotient_Parallel(N_Vector num, N_Vector denom) * ----------------------------------------------------------------- */ -int N_VLinearCombination_Parallel(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_Parallel(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { int i; sunindextype j, N; - realtype* zd=NULL; - realtype* xd=NULL; + sunrealtype* zd=NULL; + sunrealtype* xd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1028,13 +1028,13 @@ int N_VLinearCombination_Parallel(int nvec, realtype* c, N_Vector* X, N_Vector z } -int N_VScaleAddMulti_Parallel(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) +int N_VScaleAddMulti_Parallel(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1076,12 +1076,12 @@ int N_VScaleAddMulti_Parallel(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_ } -int N_VDotProdMulti_Parallel(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) +int N_VDotProdMulti_Parallel(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods) { int i, retval; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; MPI_Comm comm; /* invalid number of vectors */ @@ -1120,12 +1120,12 @@ int N_VDotProdMulti_Parallel(int nvec, N_Vector x, N_Vector* Y, realtype* dotpro int N_VDotProdMultiLocal_Parallel(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods) + sunrealtype* dotprods) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1147,7 +1147,7 @@ int N_VDotProdMultiLocal_Parallel(int nvec, N_Vector x, N_Vector* Y, } -int N_VDotProdMultiAllReduce_Parallel(int nvec_total, N_Vector x, realtype* sum) +int N_VDotProdMultiAllReduce_Parallel(int nvec_total, N_Vector x, sunrealtype* sum) { int retval; MPI_Comm comm; @@ -1173,16 +1173,16 @@ int N_VDotProdMultiAllReduce_Parallel(int nvec_total, N_Vector x, realtype* sum) */ int N_VLinearSumVectorArray_Parallel(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; - realtype c; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; + sunrealtype c; N_Vector* V1; N_Vector* V2; booleantype test; @@ -1269,12 +1269,12 @@ int N_VLinearSumVectorArray_Parallel(int nvec, } -int N_VScaleVectorArray_Parallel(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_Parallel(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* zd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1315,11 +1315,11 @@ int N_VScaleVectorArray_Parallel(int nvec, realtype* c, N_Vector* X, N_Vector* Z } -int N_VConstVectorArray_Parallel(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_Parallel(int nvec, sunrealtype c, N_Vector* Z) { int i; sunindextype j, N; - realtype* zd=NULL; + sunrealtype* zd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1345,12 +1345,12 @@ int N_VConstVectorArray_Parallel(int nvec, realtype c, N_Vector* Z) } -int N_VWrmsNormVectorArray_Parallel(int nvec, N_Vector* X, N_Vector* W, realtype* nrm) +int N_VWrmsNormVectorArray_Parallel(int nvec, N_Vector* X, N_Vector* W, sunrealtype* nrm) { int i, retval; sunindextype j, Nl, Ng; - realtype* wd=NULL; - realtype* xd=NULL; + sunrealtype* wd=NULL; + sunrealtype* xd=NULL; MPI_Comm comm; /* invalid number of vectors */ @@ -1386,13 +1386,13 @@ int N_VWrmsNormVectorArray_Parallel(int nvec, N_Vector* X, N_Vector* W, realtype int N_VWrmsNormMaskVectorArray_Parallel(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, realtype* nrm) + N_Vector id, sunrealtype* nrm) { int i, retval; sunindextype j, Nl, Ng; - realtype* wd=NULL; - realtype* xd=NULL; - realtype* idd=NULL; + sunrealtype* wd=NULL; + sunrealtype* xd=NULL; + sunrealtype* idd=NULL; MPI_Comm comm; /* invalid number of vectors */ @@ -1429,14 +1429,14 @@ int N_VWrmsNormMaskVectorArray_Parallel(int nvec, N_Vector* X, N_Vector* W, } -int N_VScaleAddMultiVectorArray_Parallel(int nvec, int nsum, realtype* a, +int N_VScaleAddMultiVectorArray_Parallel(int nvec, int nsum, sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z) { int i, j; sunindextype k, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; int retval; N_Vector* YY; @@ -1525,7 +1525,7 @@ int N_VScaleAddMultiVectorArray_Parallel(int nvec, int nsum, realtype* a, int N_VLinearCombinationVectorArray_Parallel(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z) { @@ -1533,10 +1533,10 @@ int N_VLinearCombinationVectorArray_Parallel(int nvec, int nsum, int j; /* vector index in vector array [0,nvec) */ sunindextype k; /* element index in vector [0,N) */ sunindextype N; - realtype* zd=NULL; - realtype* xd=NULL; + sunrealtype* zd=NULL; + sunrealtype* xd=NULL; - realtype* ctmp; + sunrealtype* ctmp; N_Vector* Y; /* invalid number of vectors */ @@ -1581,7 +1581,7 @@ int N_VLinearCombinationVectorArray_Parallel(int nvec, int nsum, /* should have called N_VScaleVectorArray */ if (nsum == 1) { - ctmp = (realtype*) malloc(nvec * sizeof(realtype)); + ctmp = (sunrealtype*) malloc(nvec * sizeof(sunrealtype)); for (j=0; j max) max = PetscAbsScalar(xd[i]); } VecRestoreArray(xv, &xd); - return ((realtype) max); + return ((sunrealtype) max); } -realtype N_VMaxNorm_Petsc(N_Vector x) +sunrealtype N_VMaxNorm_Petsc(N_Vector x) { Vec xv = NV_PVEC_PTC(x); PetscReal norm; @@ -621,7 +621,7 @@ realtype N_VMaxNorm_Petsc(N_Vector x) return norm; } -realtype N_VWSqrSumLocal_Petsc(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal_Petsc(N_Vector x, N_Vector w) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); @@ -638,19 +638,19 @@ realtype N_VWSqrSumLocal_Petsc(N_Vector x, N_Vector w) } VecRestoreArray(xv, &xd); VecRestoreArray(wv, &wd); - return ((realtype) sum); + return ((sunrealtype) sum); } -realtype N_VWrmsNorm_Petsc(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_Petsc(N_Vector x, N_Vector w) { - realtype global_sum; + sunrealtype global_sum; sunindextype N_global = NV_GLOBLENGTH_PTC(x); - realtype sum = N_VWSqrSumLocal_Petsc(x, w); + sunrealtype sum = N_VWSqrSumLocal_Petsc(x, w); (void) MPI_Allreduce(&sum, &global_sum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_PTC(x)); return (SUNRsqrt(global_sum/N_global)); } -realtype N_VWSqrSumMaskLocal_Petsc(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal_Petsc(N_Vector x, N_Vector w, N_Vector id) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); @@ -677,16 +677,16 @@ realtype N_VWSqrSumMaskLocal_Petsc(N_Vector x, N_Vector w, N_Vector id) return sum; } -realtype N_VWrmsNormMask_Petsc(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_Petsc(N_Vector x, N_Vector w, N_Vector id) { - realtype global_sum; + sunrealtype global_sum; sunindextype N_global = NV_GLOBLENGTH_PTC(x); - realtype sum = N_VWSqrSumMaskLocal_Petsc(x, w, id); + sunrealtype sum = N_VWSqrSumMaskLocal_Petsc(x, w, id); (void) MPI_Allreduce(&sum, &global_sum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_PTC(x)); return (SUNRsqrt(global_sum/N_global)); } -realtype N_VMinLocal_Petsc(N_Vector x) +sunrealtype N_VMinLocal_Petsc(N_Vector x) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); @@ -699,10 +699,10 @@ realtype N_VMinLocal_Petsc(N_Vector x) if (xd[i] < min) min = xd[i]; } VecRestoreArray(xv, &xd); - return ((realtype) min); + return ((sunrealtype) min); } -realtype N_VMin_Petsc(N_Vector x) +sunrealtype N_VMin_Petsc(N_Vector x) { Vec xv = NV_PVEC_PTC(x); PetscReal minval; @@ -712,15 +712,15 @@ realtype N_VMin_Petsc(N_Vector x) return minval; } -realtype N_VWL2Norm_Petsc(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_Petsc(N_Vector x, N_Vector w) { - realtype global_sum; - realtype sum = N_VWSqrSumLocal_Petsc(x, w); + sunrealtype global_sum; + sunrealtype sum = N_VWSqrSumLocal_Petsc(x, w); (void) MPI_Allreduce(&sum, &global_sum, 1, MPI_SUNREALTYPE, MPI_SUM, NV_COMM_PTC(x)); return (SUNRsqrt(global_sum)); } -realtype N_VL1NormLocal_Petsc(N_Vector x) +sunrealtype N_VL1NormLocal_Petsc(N_Vector x) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); @@ -733,10 +733,10 @@ realtype N_VL1NormLocal_Petsc(N_Vector x) sum += PetscAbsScalar(xd[i]); } VecRestoreArray(xv, &xd); - return ((realtype) sum); + return ((sunrealtype) sum); } -realtype N_VL1Norm_Petsc(N_Vector x) +sunrealtype N_VL1Norm_Petsc(N_Vector x) { Vec xv = NV_PVEC_PTC(x); PetscReal norm; @@ -745,13 +745,13 @@ realtype N_VL1Norm_Petsc(N_Vector x) return norm; } -void N_VCompare_Petsc(realtype c, N_Vector x, N_Vector z) +void N_VCompare_Petsc(sunrealtype c, N_Vector x, N_Vector z) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); Vec xv = NV_PVEC_PTC(x); Vec zv = NV_PVEC_PTC(z); - PetscReal cpet = c; /* <~ realtype should typedef to PETScReal */ + PetscReal cpet = c; /* <~ sunrealtype should typedef to PETScReal */ PetscScalar *xdata; PetscScalar *zdata; @@ -795,8 +795,8 @@ booleantype N_VInvTestLocal_Petsc(N_Vector x, N_Vector z) booleantype N_VInvTest_Petsc(N_Vector x, N_Vector z) { - realtype val2; - realtype val = (N_VInvTestLocal_Petsc(x, z)) ? ONE : ZERO; + sunrealtype val2; + sunrealtype val = (N_VInvTestLocal_Petsc(x, z)) ? ONE : ZERO; (void) MPI_Allreduce(&val, &val2, 1, MPI_SUNREALTYPE, MPI_MIN, NV_COMM_PTC(x)); if (val2 == ZERO) return(SUNFALSE); @@ -808,7 +808,7 @@ booleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, N_Vector m) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); - realtype temp; + sunrealtype temp; booleantype test; Vec xv = NV_PVEC_PTC(x); Vec cv = NV_PVEC_PTC(c); @@ -848,13 +848,13 @@ booleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, N_Vector m) booleantype N_VConstrMask_Petsc(N_Vector c, N_Vector x, N_Vector m) { - realtype temp2; - realtype temp = (N_VConstrMaskLocal_Petsc(c, x, m)) ? ZERO : ONE; + sunrealtype temp2; + sunrealtype temp = (N_VConstrMaskLocal_Petsc(c, x, m)) ? ZERO : ONE; (void) MPI_Allreduce(&temp, &temp2, 1, MPI_SUNREALTYPE, MPI_MAX, NV_COMM_PTC(x)); return (temp2 == ONE) ? SUNFALSE : SUNTRUE; } -realtype N_VMinQuotientLocal_Petsc(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotientLocal_Petsc(N_Vector num, N_Vector denom) { booleantype notEvenOnce = SUNTRUE; sunindextype i; @@ -884,13 +884,13 @@ realtype N_VMinQuotientLocal_Petsc(N_Vector num, N_Vector denom) } VecRestoreArray(nv, &nd); VecRestoreArray(dv, &dd); - return((realtype) minval); + return((sunrealtype) minval); } -realtype N_VMinQuotient_Petsc(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Petsc(N_Vector num, N_Vector denom) { PetscReal gmin; - realtype minval = N_VMinQuotientLocal_Petsc(num, denom); + sunrealtype minval = N_VMinQuotientLocal_Petsc(num, denom); (void) MPI_Allreduce(&minval, &gmin, 1, MPI_SUNREALTYPE, MPI_MIN, NV_COMM_PTC(num)); return(gmin); } @@ -903,7 +903,7 @@ realtype N_VMinQuotient_Petsc(N_Vector num, N_Vector denom) */ -int N_VLinearCombination_Petsc(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_Petsc(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { int i; Vec* xv; @@ -961,7 +961,7 @@ int N_VLinearCombination_Petsc(int nvec, realtype* c, N_Vector* X, N_Vector z) } -int N_VScaleAddMulti_Petsc(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) +int N_VScaleAddMulti_Petsc(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) { int i; sunindextype j, N; @@ -1010,7 +1010,7 @@ int N_VScaleAddMulti_Petsc(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vec } -int N_VDotProdMulti_Petsc(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) +int N_VDotProdMulti_Petsc(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods) { int i; Vec* yv; @@ -1045,7 +1045,7 @@ int N_VDotProdMulti_Petsc(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) */ int N_VDotProdMultiLocal_Petsc(int nvec, N_Vector x, N_Vector* Y, - realtype* dotprods) + sunrealtype* dotprods) { int j; sunindextype i; @@ -1070,7 +1070,7 @@ int N_VDotProdMultiLocal_Petsc(int nvec, N_Vector x, N_Vector* Y, return (0); } -int N_VDotProdMultiAllReduce_Petsc(int nvec, N_Vector x, realtype* dotprods) +int N_VDotProdMultiAllReduce_Petsc(int nvec, N_Vector x, sunrealtype* dotprods) { int retval; retval = MPI_Allreduce(MPI_IN_PLACE, dotprods, nvec, MPI_SUNREALTYPE, @@ -1085,8 +1085,8 @@ int N_VDotProdMultiAllReduce_Petsc(int nvec, N_Vector x, realtype* dotprods) */ int N_VLinearSumVectorArray_Petsc(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { int i; @@ -1122,7 +1122,7 @@ int N_VLinearSumVectorArray_Petsc(int nvec, } -int N_VScaleVectorArray_Petsc(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_Petsc(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { int i; sunindextype j, N; @@ -1170,7 +1170,7 @@ int N_VScaleVectorArray_Petsc(int nvec, realtype* c, N_Vector* X, N_Vector* Z) } -int N_VConstVectorArray_Petsc(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_Petsc(int nvec, sunrealtype c, N_Vector* Z) { int i; sunindextype j, N; @@ -1201,12 +1201,12 @@ int N_VConstVectorArray_Petsc(int nvec, realtype c, N_Vector* Z) } -int N_VWrmsNormVectorArray_Petsc(int nvec, N_Vector* X, N_Vector* W, realtype* nrm) +int N_VWrmsNormVectorArray_Petsc(int nvec, N_Vector* X, N_Vector* W, sunrealtype* nrm) { int i, retval; sunindextype j, Nl, Ng; - realtype* wd=NULL; - realtype* xd=NULL; + sunrealtype* wd=NULL; + sunrealtype* xd=NULL; MPI_Comm comm; /* invalid number of vectors */ @@ -1244,7 +1244,7 @@ int N_VWrmsNormVectorArray_Petsc(int nvec, N_Vector* X, N_Vector* W, realtype* n int N_VWrmsNormMaskVectorArray_Petsc(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, realtype* nrm) + N_Vector id, sunrealtype* nrm) { int i, retval; sunindextype j, Nl, Ng; @@ -1289,7 +1289,7 @@ int N_VWrmsNormMaskVectorArray_Petsc(int nvec, N_Vector* X, N_Vector* W, } -int N_VScaleAddMultiVectorArray_Petsc(int nvec, int nsum, realtype* a, +int N_VScaleAddMultiVectorArray_Petsc(int nvec, int nsum, sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z) { int i, j; @@ -1389,7 +1389,7 @@ int N_VScaleAddMultiVectorArray_Petsc(int nvec, int nsum, realtype* a, int N_VLinearCombinationVectorArray_Petsc(int nvec, int nsum, - realtype* c, + sunrealtype* c, N_Vector** X, N_Vector* Z) { @@ -1399,7 +1399,7 @@ int N_VLinearCombinationVectorArray_Petsc(int nvec, int nsum, sunindextype N; PetscScalar *zd, *xd; - realtype* ctmp; + sunrealtype* ctmp; N_Vector* Y; /* invalid number of vectors */ @@ -1444,7 +1444,7 @@ int N_VLinearCombinationVectorArray_Petsc(int nvec, int nsum, /* should have called N_VScaleVectorArray */ if (nsum == 1) { - ctmp = (realtype*) malloc(nvec * sizeof(realtype)); + ctmp = (sunrealtype*) malloc(nvec * sizeof(sunrealtype)); for (j=0; j 0) NV_DATA_PT(v) = v_data; @@ -493,7 +493,7 @@ void N_VSetArrayPointer_Pthreads(realtype *v_data, N_Vector v) * Compute linear sum z[i] = a*x[i]+b*y[i] */ -void N_VLinearSum_Pthreads(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum_Pthreads(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { sunindextype N; int i, nthreads; @@ -501,7 +501,7 @@ void N_VLinearSum_Pthreads(realtype a, N_Vector x, realtype b, N_Vector y, N_Vec Pthreads_Data *thread_data; pthread_attr_t attr; - realtype c; + sunrealtype c; N_Vector v1, v2; booleantype test; @@ -620,8 +620,8 @@ void N_VLinearSum_Pthreads(realtype a, N_Vector x, realtype b, N_Vector y, N_Vec static void *N_VLinearSum_PT(void *thread_data) { sunindextype i, start, end; - realtype a, b; - realtype *xd, *yd, *zd; + sunrealtype a, b; + sunrealtype *xd, *yd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -650,7 +650,7 @@ static void *N_VLinearSum_PT(void *thread_data) * Assigns constant value to all vector elements, z[i] = c */ -void N_VConst_Pthreads(realtype c, N_Vector z) +void N_VConst_Pthreads(sunrealtype c, N_Vector z) { sunindextype N; int i, nthreads; @@ -704,8 +704,8 @@ void N_VConst_Pthreads(realtype c, N_Vector z) static void *N_VConst_PT(void *thread_data) { sunindextype i, start, end; - realtype c; - realtype *zd; + sunrealtype c; + sunrealtype *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -784,7 +784,7 @@ void N_VProd_Pthreads(N_Vector x, N_Vector y, N_Vector z) static void *N_VProd_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -865,7 +865,7 @@ void N_VDiv_Pthreads(N_Vector x, N_Vector y, N_Vector z) static void *N_VDiv_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -891,7 +891,7 @@ static void *N_VDiv_PT(void *thread_data) * Compute scaler multiplication z[i] = c*x[i] */ -void N_VScale_Pthreads(realtype c, N_Vector x, N_Vector z) +void N_VScale_Pthreads(sunrealtype c, N_Vector x, N_Vector z) { sunindextype N; int i, nthreads; @@ -957,8 +957,8 @@ void N_VScale_Pthreads(realtype c, N_Vector x, N_Vector z) static void *N_VScale_PT(void *thread_data) { sunindextype i, start, end; - realtype c; - realtype *xd, *zd; + sunrealtype c; + sunrealtype *xd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -1038,7 +1038,7 @@ void N_VAbs_Pthreads(N_Vector x, N_Vector z) static void *N_VAbs_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *zd; + sunrealtype *xd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -1117,7 +1117,7 @@ void N_VInv_Pthreads(N_Vector x, N_Vector z) static void *N_VInv_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *zd; + sunrealtype *xd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -1142,7 +1142,7 @@ static void *N_VInv_PT(void *thread_data) * Compute componentwise addition of a scaler to a vector z[i] = x[i] + b */ -void N_VAddConst_Pthreads(N_Vector x, realtype b, N_Vector z) +void N_VAddConst_Pthreads(N_Vector x, sunrealtype b, N_Vector z) { sunindextype N; int i, nthreads; @@ -1197,8 +1197,8 @@ void N_VAddConst_Pthreads(N_Vector x, realtype b, N_Vector z) static void *N_VAddConst_PT(void *thread_data) { sunindextype i, start, end; - realtype b; - realtype *xd, *zd; + sunrealtype b; + sunrealtype *xd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -1224,7 +1224,7 @@ static void *N_VAddConst_PT(void *thread_data) * Computes the dot product of two vectors, a = sum(x[i]*y[i]) */ -realtype N_VDotProd_Pthreads(N_Vector x, N_Vector y) +sunrealtype N_VDotProd_Pthreads(N_Vector x, N_Vector y) { sunindextype N; int i, nthreads; @@ -1232,7 +1232,7 @@ realtype N_VDotProd_Pthreads(N_Vector x, N_Vector y) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype sum = ZERO; + sunrealtype sum = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -1286,8 +1286,8 @@ realtype N_VDotProd_Pthreads(N_Vector x, N_Vector y) static void *N_VDotProd_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *yd; - realtype local_sum, *global_sum; + sunrealtype *xd, *yd; + sunrealtype local_sum, *global_sum; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -1322,7 +1322,7 @@ static void *N_VDotProd_PT(void *thread_data) * Computes max norm of the vector */ -realtype N_VMaxNorm_Pthreads(N_Vector x) +sunrealtype N_VMaxNorm_Pthreads(N_Vector x) { sunindextype N; int i, nthreads; @@ -1330,7 +1330,7 @@ realtype N_VMaxNorm_Pthreads(N_Vector x) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype max = ZERO; + sunrealtype max = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -1383,8 +1383,8 @@ realtype N_VMaxNorm_Pthreads(N_Vector x) static void *N_VMaxNorm_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd; - realtype local_max, *global_max; + sunrealtype *xd; + sunrealtype local_max, *global_max; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -1420,7 +1420,7 @@ static void *N_VMaxNorm_PT(void *thread_data) * Computes weighted root mean square norm of a vector */ -realtype N_VWrmsNorm_Pthreads(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_Pthreads(N_Vector x, N_Vector w) { return(SUNRsqrt(N_VWSqrSumLocal_Pthreads(x, w)/(NV_LENGTH_PT(x)))); } @@ -1430,7 +1430,7 @@ realtype N_VWrmsNorm_Pthreads(N_Vector x, N_Vector w) * Computes weighted square sum of a vector */ -realtype N_VWSqrSumLocal_Pthreads(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal_Pthreads(N_Vector x, N_Vector w) { sunindextype N; int i, nthreads; @@ -1438,7 +1438,7 @@ realtype N_VWSqrSumLocal_Pthreads(N_Vector x, N_Vector w) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype sum = ZERO; + sunrealtype sum = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -1492,8 +1492,8 @@ realtype N_VWSqrSumLocal_Pthreads(N_Vector x, N_Vector w) static void *N_VWSqrSum_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *wd; - realtype local_sum, *global_sum; + sunrealtype *xd, *wd; + sunrealtype local_sum, *global_sum; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -1528,7 +1528,7 @@ static void *N_VWSqrSum_PT(void *thread_data) * Computes weighted root mean square norm of a masked vector */ -realtype N_VWrmsNormMask_Pthreads(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_Pthreads(N_Vector x, N_Vector w, N_Vector id) { return(SUNRsqrt(N_VWSqrSumMaskLocal_Pthreads(x, w, id)/(NV_LENGTH_PT(x)))); } @@ -1538,7 +1538,7 @@ realtype N_VWrmsNormMask_Pthreads(N_Vector x, N_Vector w, N_Vector id) * Computes weighted square sum of a masked vector */ -realtype N_VWSqrSumMaskLocal_Pthreads(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal_Pthreads(N_Vector x, N_Vector w, N_Vector id) { sunindextype N; int i, nthreads; @@ -1546,7 +1546,7 @@ realtype N_VWSqrSumMaskLocal_Pthreads(N_Vector x, N_Vector w, N_Vector id) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype sum = ZERO; + sunrealtype sum = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -1601,8 +1601,8 @@ realtype N_VWSqrSumMaskLocal_Pthreads(N_Vector x, N_Vector w, N_Vector id) static void *N_VWSqrSumMask_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *wd, *idd; - realtype local_sum, *global_sum; + sunrealtype *xd, *wd, *idd; + sunrealtype local_sum, *global_sum; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -1640,7 +1640,7 @@ static void *N_VWSqrSumMask_PT(void *thread_data) * Finds the minimun component of a vector */ -realtype N_VMin_Pthreads(N_Vector x) +sunrealtype N_VMin_Pthreads(N_Vector x) { sunindextype N; int i, nthreads; @@ -1648,7 +1648,7 @@ realtype N_VMin_Pthreads(N_Vector x) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype min; + sunrealtype min; /* initialize global min */ min = NV_Ith_PT(x,0); @@ -1704,8 +1704,8 @@ realtype N_VMin_Pthreads(N_Vector x) static void *N_VMin_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd; - realtype local_min, *global_min; + sunrealtype *xd; + sunrealtype local_min, *global_min; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -1742,7 +1742,7 @@ static void *N_VMin_PT(void *thread_data) * Computes weighted L2 norm of a vector */ -realtype N_VWL2Norm_Pthreads(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_Pthreads(N_Vector x, N_Vector w) { sunindextype N; int i, nthreads; @@ -1750,7 +1750,7 @@ realtype N_VWL2Norm_Pthreads(N_Vector x, N_Vector w) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype sum = ZERO; + sunrealtype sum = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -1804,8 +1804,8 @@ realtype N_VWL2Norm_Pthreads(N_Vector x, N_Vector w) static void *N_VWL2Norm_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *wd; - realtype local_sum, *global_sum; + sunrealtype *xd, *wd; + sunrealtype local_sum, *global_sum; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -1840,7 +1840,7 @@ static void *N_VWL2Norm_PT(void *thread_data) * Computes L1 norm of a vector */ -realtype N_VL1Norm_Pthreads(N_Vector x) +sunrealtype N_VL1Norm_Pthreads(N_Vector x) { sunindextype N; int i, nthreads; @@ -1848,7 +1848,7 @@ realtype N_VL1Norm_Pthreads(N_Vector x) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype sum = ZERO; + sunrealtype sum = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -1901,8 +1901,8 @@ realtype N_VL1Norm_Pthreads(N_Vector x) static void *N_VL1Norm_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd; - realtype local_sum, *global_sum; + sunrealtype *xd; + sunrealtype local_sum, *global_sum; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -1936,7 +1936,7 @@ static void *N_VL1Norm_PT(void *thread_data) * Compare vector component values to a scaler */ -void N_VCompare_Pthreads(realtype c, N_Vector x, N_Vector z) +void N_VCompare_Pthreads(sunrealtype c, N_Vector x, N_Vector z) { sunindextype N; int i, nthreads; @@ -1990,8 +1990,8 @@ void N_VCompare_Pthreads(realtype c, N_Vector x, N_Vector z) static void *N_VCompare_PT(void *thread_data) { sunindextype i, start, end; - realtype c; - realtype *xd, *zd; + sunrealtype c; + sunrealtype *xd, *zd; Pthreads_Data *my_data; /* extract thread data */ @@ -2025,7 +2025,7 @@ booleantype N_VInvTest_Pthreads(N_Vector x, N_Vector z) Pthreads_Data *thread_data; pthread_attr_t attr; - realtype val = ZERO; + sunrealtype val = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -2077,8 +2077,8 @@ booleantype N_VInvTest_Pthreads(N_Vector x, N_Vector z) static void *N_VInvTest_PT(void *thread_data) { sunindextype i, start, end; - realtype *xd, *zd; - realtype local_val, *global_val; + sunrealtype *xd, *zd; + sunrealtype local_val, *global_val; Pthreads_Data *my_data; /* extract thread data */ @@ -2123,7 +2123,7 @@ booleantype N_VConstrMask_Pthreads(N_Vector c, N_Vector x, N_Vector m) Pthreads_Data *thread_data; pthread_attr_t attr; - realtype val = ZERO; + sunrealtype val = ZERO; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(x); @@ -2176,8 +2176,8 @@ booleantype N_VConstrMask_Pthreads(N_Vector c, N_Vector x, N_Vector m) static void *N_VConstrMask_PT(void *thread_data) { sunindextype i, start, end; - realtype *cd, *xd, *md; - realtype local_val, *global_val; + sunrealtype *cd, *xd, *md; + sunrealtype local_val, *global_val; Pthreads_Data *my_data; /* extract thread data */ @@ -2222,7 +2222,7 @@ static void *N_VConstrMask_PT(void *thread_data) * Compute minimum componentwise quotient */ -realtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom) { sunindextype N; int i, nthreads; @@ -2230,7 +2230,7 @@ realtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - realtype min = BIG_REAL; + sunrealtype min = BIG_REAL; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(num); @@ -2284,8 +2284,8 @@ realtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom) static void *N_VMinQuotient_PT(void *thread_data) { sunindextype i, start, end; - realtype *nd, *dd; - realtype local_min, *global_min; + sunrealtype *nd, *dd; + sunrealtype local_min, *global_min; Pthreads_Data *my_data; pthread_mutex_t *global_mutex; @@ -2331,7 +2331,7 @@ static void *N_VMinQuotient_PT(void *thread_data) * Compute the linear combination z = c[i]*X[i] */ -int N_VLinearCombination_Pthreads(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_Pthreads(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { sunindextype N; int i, nthreads; @@ -2405,9 +2405,9 @@ static void *N_VLinearCombination_PT(void *thread_data) sunindextype j, start, end; int i; - realtype* c=NULL; - realtype* xd=NULL; - realtype* zd=NULL; + sunrealtype* c=NULL; + sunrealtype* xd=NULL; + sunrealtype* zd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -2468,7 +2468,7 @@ static void *N_VLinearCombination_PT(void *thread_data) * Compute multiple linear sums Z[i] = Y[i] + a*x */ -int N_VScaleAddMulti_Pthreads(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) +int N_VScaleAddMulti_Pthreads(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -2537,10 +2537,10 @@ static void *N_VScaleAddMulti_PT(void *thread_data) sunindextype j, start, end; int i; - realtype* a=NULL; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* a=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -2582,7 +2582,7 @@ static void *N_VScaleAddMulti_PT(void *thread_data) * Compute the dot product of a vector with multiple vectors, a[i] = sum(x*Y[i]) */ -int N_VDotProdMulti_Pthreads(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) +int N_VDotProdMulti_Pthreads(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods) { sunindextype N; int i, nthreads; @@ -2662,10 +2662,10 @@ static void *N_VDotProdMulti_PT(void *thread_data) pthread_mutex_t *lock; int i; - realtype sum; - realtype* dotprods=NULL; - realtype* xd=NULL; - realtype* yd=NULL; + sunrealtype sum; + sunrealtype* dotprods=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -2706,8 +2706,8 @@ static void *N_VDotProdMulti_PT(void *thread_data) * Compute multiple linear sums Z[i] = a*X[i] + b*Y[i] */ -int N_VLinearSumVectorArray_Pthreads(int nvec, realtype a, N_Vector* X, - realtype b, N_Vector* Y, N_Vector* Z) +int N_VLinearSumVectorArray_Pthreads(int nvec, sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -2715,7 +2715,7 @@ int N_VLinearSumVectorArray_Pthreads(int nvec, realtype a, N_Vector* X, Pthreads_Data *thread_data; pthread_attr_t attr; - realtype c; + sunrealtype c; N_Vector* V1; N_Vector* V2; booleantype test; @@ -2839,10 +2839,10 @@ static void *N_VLinearSumVectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype a, b; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype a, b; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -2872,7 +2872,7 @@ static void *N_VLinearSumVectorArray_PT(void *thread_data) * Scale multiple vectors Z[i] = c[i]*X[i] */ -int N_VScaleVectorArray_Pthreads(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_Pthreads(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -2941,9 +2941,9 @@ static void *N_VScaleVectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype* c; - realtype* xd=NULL; - realtype* zd=NULL; + sunrealtype* c; + sunrealtype* xd=NULL; + sunrealtype* zd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -2984,7 +2984,7 @@ static void *N_VScaleVectorArray_PT(void *thread_data) * Set multiple vectors to a constant value Z[i] = c */ -int N_VConstVectorArray_Pthreads(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_Pthreads(int nvec, sunrealtype c, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -3052,7 +3052,7 @@ static void *N_VConstVectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype* zd=NULL; + sunrealtype* zd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -3077,7 +3077,7 @@ static void *N_VConstVectorArray_PT(void *thread_data) * Compute the weighted root mean square norm of multiple vectors */ -int N_VWrmsNormVectorArray_Pthreads(int nvec, N_Vector* X, N_Vector* W, realtype* nrm) +int N_VWrmsNormVectorArray_Pthreads(int nvec, N_Vector* X, N_Vector* W, sunrealtype* nrm) { sunindextype N; int i, nthreads; @@ -3162,10 +3162,10 @@ static void *N_VWrmsNormVectorArray_PT(void *thread_data) pthread_mutex_t *lock; int i; - realtype sum; - realtype* nrm=NULL; - realtype* xd=NULL; - realtype* wd=NULL; + sunrealtype sum; + sunrealtype* nrm=NULL; + sunrealtype* xd=NULL; + sunrealtype* wd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -3200,7 +3200,7 @@ static void *N_VWrmsNormVectorArray_PT(void *thread_data) */ int N_VWrmsNormMaskVectorArray_Pthreads(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, realtype* nrm) + N_Vector id, sunrealtype* nrm) { sunindextype N; int i, nthreads; @@ -3286,11 +3286,11 @@ static void *N_VWrmsNormMaskVectorArray_PT(void *thread_data) pthread_mutex_t *lock; int i; - realtype sum; - realtype* nrm=NULL; - realtype* xd=NULL; - realtype* wd=NULL; - realtype* idd=NULL; + sunrealtype sum; + sunrealtype* nrm=NULL; + sunrealtype* xd=NULL; + sunrealtype* wd=NULL; + sunrealtype* idd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -3326,7 +3326,7 @@ static void *N_VWrmsNormMaskVectorArray_PT(void *thread_data) * Scale and add a vector to multiple vectors Z = Y + a*X */ -int N_VScaleAddMultiVectorArray_Pthreads(int nvec, int nsum, realtype* a, +int N_VScaleAddMultiVectorArray_Pthreads(int nvec, int nsum, sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z) { sunindextype N; @@ -3439,10 +3439,10 @@ static void *N_VScaleAddMultiVectorArray_PT(void *thread_data) sunindextype k, start, end; int i, j; - realtype* a=NULL; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* a=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; /* extract thread data */ my_data = (Pthreads_Data *) thread_data; @@ -3489,7 +3489,7 @@ static void *N_VScaleAddMultiVectorArray_PT(void *thread_data) * Compute a linear combination for multiple vectors */ -int N_VLinearCombinationVectorArray_Pthreads(int nvec, int nsum, realtype* c, +int N_VLinearCombinationVectorArray_Pthreads(int nvec, int nsum, sunrealtype* c, N_Vector** X, N_Vector* Z) { sunindextype N; @@ -3499,7 +3499,7 @@ int N_VLinearCombinationVectorArray_Pthreads(int nvec, int nsum, realtype* c, pthread_attr_t attr; int retval; - realtype* ctmp; + sunrealtype* ctmp; N_Vector* Y; /* invalid number of vectors */ @@ -3544,7 +3544,7 @@ int N_VLinearCombinationVectorArray_Pthreads(int nvec, int nsum, realtype* c, /* should have called N_VScaleVectorArray */ if (nsum == 1) { - ctmp = (realtype*) malloc(nvec * sizeof(realtype)); + ctmp = (sunrealtype*) malloc(nvec * sizeof(sunrealtype)); for (j=0; jstart; @@ -4836,9 +4836,9 @@ static void *VDiffVectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; my_data = (Pthreads_Data *) thread_data; start = my_data->start; @@ -4856,7 +4856,7 @@ static void *VDiffVectorArray_PT(void *thread_data) } -static int VScaleSumVectorArray_Pthreads(int nvec, realtype c, N_Vector* X, N_Vector* Y, N_Vector* Z) +static int VScaleSumVectorArray_Pthreads(int nvec, sunrealtype c, N_Vector* X, N_Vector* Y, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -4907,10 +4907,10 @@ static void *VScaleSumVectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype c; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype c; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; my_data = (Pthreads_Data *) thread_data; start = my_data->start; @@ -4929,7 +4929,7 @@ static void *VScaleSumVectorArray_PT(void *thread_data) } -static int VScaleDiffVectorArray_Pthreads(int nvec, realtype c, N_Vector* X, N_Vector* Y, N_Vector* Z) +static int VScaleDiffVectorArray_Pthreads(int nvec, sunrealtype c, N_Vector* X, N_Vector* Y, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -4980,10 +4980,10 @@ static void *VScaleDiffVectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype c; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype c; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; my_data = (Pthreads_Data *) thread_data; start = my_data->start; @@ -5002,7 +5002,7 @@ static void *VScaleDiffVectorArray_PT(void *thread_data) } -static int VLin1VectorArray_Pthreads(int nvec, realtype a, N_Vector* X, N_Vector* Y, N_Vector* Z) +static int VLin1VectorArray_Pthreads(int nvec, sunrealtype a, N_Vector* X, N_Vector* Y, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -5053,10 +5053,10 @@ static void *VLin1VectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype a; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype a; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; my_data = (Pthreads_Data *) thread_data; start = my_data->start; @@ -5075,7 +5075,7 @@ static void *VLin1VectorArray_PT(void *thread_data) } -static int VLin2VectorArray_Pthreads(int nvec, realtype a, N_Vector* X, N_Vector* Y, N_Vector* Z) +static int VLin2VectorArray_Pthreads(int nvec, sunrealtype a, N_Vector* X, N_Vector* Y, N_Vector* Z) { sunindextype N; int i, nthreads; @@ -5126,10 +5126,10 @@ static void *VLin2VectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype a; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype a; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; my_data = (Pthreads_Data *) thread_data; start = my_data->start; @@ -5148,7 +5148,7 @@ static void *VLin2VectorArray_PT(void *thread_data) } -static int VaxpyVectorArray_Pthreads(int nvec, realtype a, N_Vector* X, N_Vector* Y) +static int VaxpyVectorArray_Pthreads(int nvec, sunrealtype a, N_Vector* X, N_Vector* Y) { sunindextype N; int i, nthreads; @@ -5198,9 +5198,9 @@ static void *VaxpyVectorArray_PT(void *thread_data) sunindextype j, start, end; int i; - realtype a; - realtype* xd=NULL; - realtype* yd=NULL; + sunrealtype a; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; my_data = (Pthreads_Data *) thread_data; start = my_data->start; diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index 4227739660..6e65519e44 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -67,15 +67,15 @@ static constexpr sunindextype zeroIdx = 0; // Helpful macros #define NVEC_RAJA_CONTENT(x) ((N_VectorContent_Raja)(x->content)) -#define NVEC_RAJA_MEMSIZE(x) (NVEC_RAJA_CONTENT(x)->length * sizeof(realtype)) +#define NVEC_RAJA_MEMSIZE(x) (NVEC_RAJA_CONTENT(x)->length * sizeof(sunrealtype)) #define NVEC_RAJA_MEMHELP(x) (NVEC_RAJA_CONTENT(x)->mem_helper) -#define NVEC_RAJA_HDATAp(x) ((realtype*) NVEC_RAJA_CONTENT(x)->host_data->ptr) -#define NVEC_RAJA_DDATAp(x) ((realtype*) NVEC_RAJA_CONTENT(x)->device_data->ptr) +#define NVEC_RAJA_HDATAp(x) ((sunrealtype*) NVEC_RAJA_CONTENT(x)->host_data->ptr) +#define NVEC_RAJA_DDATAp(x) ((sunrealtype*) NVEC_RAJA_CONTENT(x)->device_data->ptr) // Macros to access vector private content #define NVEC_RAJA_PRIVATE(x) ((N_PrivateVectorContent_Raja)(NVEC_RAJA_CONTENT(x)->priv)) -#define NVEC_RAJA_HBUFFERp(x) ((realtype*) NVEC_RAJA_PRIVATE(x)->reduce_buffer_host->ptr) -#define NVEC_RAJA_DBUFFERp(x) ((realtype*) NVEC_RAJA_PRIVATE(x)->reduce_buffer_dev->ptr) +#define NVEC_RAJA_HBUFFERp(x) ((sunrealtype*) NVEC_RAJA_PRIVATE(x)->reduce_buffer_host->ptr) +#define NVEC_RAJA_DBUFFERp(x) ((sunrealtype*) NVEC_RAJA_PRIVATE(x)->reduce_buffer_dev->ptr) /* * Private structure definition @@ -105,12 +105,12 @@ static int AllocateData(N_Vector v); // Fused operation buffer functions static int FusedBuffer_Init(N_Vector v, int nreal, int nptr); -static int FusedBuffer_CopyRealArray(N_Vector v, realtype *r_data, int nval, - realtype **shortcut); +static int FusedBuffer_CopyRealArray(N_Vector v, sunrealtype *r_data, int nval, + sunrealtype **shortcut); static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, - realtype ***shortcut); + sunrealtype ***shortcut); static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, - int nsum, realtype ***shortcut); + int nsum, sunrealtype ***shortcut); static int FusedBuffer_CopyToDevice(N_Vector v); static int FusedBuffer_Free(N_Vector v); @@ -326,7 +326,7 @@ N_Vector N_VNewManaged_Raja(sunindextype length, SUNContext sunctx) return(v); } -N_Vector N_VMake_Raja(sunindextype length, realtype *h_vdata, realtype *d_vdata, +N_Vector N_VMake_Raja(sunindextype length, sunrealtype *h_vdata, sunrealtype *d_vdata, SUNContext sunctx) { N_Vector v; @@ -369,7 +369,7 @@ N_Vector N_VMake_Raja(sunindextype length, realtype *h_vdata, realtype *d_vdata, return(v); } -N_Vector N_VMakeManaged_Raja(sunindextype length, realtype *vdata, +N_Vector N_VMakeManaged_Raja(sunindextype length, sunrealtype *vdata, SUNContext sunctx) { N_Vector v; @@ -424,7 +424,7 @@ extern sunindextype N_VGetLength_Raja(N_Vector v); * we just mark it as extern here. */ -extern realtype *N_VGetHostArrayPointer_Raja(N_Vector x); +extern sunrealtype *N_VGetHostArrayPointer_Raja(N_Vector x); /* ---------------------------------------------------------------------------- * Return pointer to the raw device data. @@ -432,14 +432,14 @@ extern realtype *N_VGetHostArrayPointer_Raja(N_Vector x); * we just mark it as extern here. */ -extern realtype *N_VGetDeviceArrayPointer_Raja(N_Vector x); +extern sunrealtype *N_VGetDeviceArrayPointer_Raja(N_Vector x); /* ---------------------------------------------------------------------------- * Set pointer to the raw host data. Does not free the existing pointer. */ -void N_VSetHostArrayPointer_Raja(realtype* h_vdata, N_Vector v) +void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v) { if (N_VIsManagedMemory_Raja(v)) { @@ -471,7 +471,7 @@ void N_VSetHostArrayPointer_Raja(realtype* h_vdata, N_Vector v) * Set pointer to the raw device data */ -void N_VSetDeviceArrayPointer_Raja(realtype* d_vdata, N_Vector v) +void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) { if (N_VIsManagedMemory_Raja(v)) { @@ -727,22 +727,22 @@ void N_VSpace_Raja(N_Vector X, sunindextype *lrw, sunindextype *liw) *liw = 2; } -void N_VConst_Raja(realtype c, N_Vector Z) +void N_VConst_Raja(sunrealtype c, N_Vector Z) { const sunindextype N = NVEC_RAJA_CONTENT(Z)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { zdata[i] = c; }); } -void N_VLinearSum_Raja(realtype a, N_Vector X, realtype b, N_Vector Y, N_Vector Z) +void N_VLinearSum_Raja(sunrealtype a, N_Vector X, sunrealtype b, N_Vector Y, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); - const realtype *ydata = NVEC_RAJA_DDATAp(Y); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *ydata = NVEC_RAJA_DDATAp(Y); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -753,10 +753,10 @@ void N_VLinearSum_Raja(realtype a, N_Vector X, realtype b, N_Vector Y, N_Vector void N_VProd_Raja(N_Vector X, N_Vector Y, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); - const realtype *ydata = NVEC_RAJA_DDATAp(Y); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *ydata = NVEC_RAJA_DDATAp(Y); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -767,10 +767,10 @@ void N_VProd_Raja(N_Vector X, N_Vector Y, N_Vector Z) void N_VDiv_Raja(N_Vector X, N_Vector Y, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); - const realtype *ydata = NVEC_RAJA_DDATAp(Y); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *ydata = NVEC_RAJA_DDATAp(Y); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -779,11 +779,11 @@ void N_VDiv_Raja(N_Vector X, N_Vector Y, N_Vector Z) ); } -void N_VScale_Raja(realtype c, N_Vector X, N_Vector Z) +void N_VScale_Raja(sunrealtype c, N_Vector X, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -794,9 +794,9 @@ void N_VScale_Raja(realtype c, N_Vector X, N_Vector Z) void N_VAbs_Raja(N_Vector X, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -807,9 +807,9 @@ void N_VAbs_Raja(N_Vector X, N_Vector Z) void N_VInv_Raja(N_Vector X, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -818,11 +818,11 @@ void N_VInv_Raja(N_Vector X, N_Vector Z) ); } -void N_VAddConst_Raja(N_Vector X, realtype b, N_Vector Z) +void N_VAddConst_Raja(N_Vector X, sunrealtype b, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -831,68 +831,68 @@ void N_VAddConst_Raja(N_Vector X, realtype b, N_Vector Z) ); } -realtype N_VDotProd_Raja(N_Vector X, N_Vector Y) +sunrealtype N_VDotProd_Raja(N_Vector X, N_Vector Y) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); - const realtype *ydata = NVEC_RAJA_DDATAp(Y); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *ydata = NVEC_RAJA_DDATAp(Y); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(0.0); + RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(0.0); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { gpu_result += xdata[i] * ydata[i] ; } ); - return (static_cast(gpu_result)); + return (static_cast(gpu_result)); } -realtype N_VMaxNorm_Raja(N_Vector X) +sunrealtype N_VMaxNorm_Raja(N_Vector X) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - RAJA::ReduceMax< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(0.0); + RAJA::ReduceMax< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(0.0); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { gpu_result.max(abs(xdata[i])); } ); - return (static_cast(gpu_result)); + return (static_cast(gpu_result)); } -realtype N_VWSqrSumLocal_Raja(N_Vector X, N_Vector W) +sunrealtype N_VWSqrSumLocal_Raja(N_Vector X, N_Vector W) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); - const realtype *wdata = NVEC_RAJA_DDATAp(W); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *wdata = NVEC_RAJA_DDATAp(W); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(0.0); + RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(0.0); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { gpu_result += (xdata[i] * wdata[i] * xdata[i] * wdata[i]); } ); - return (static_cast(gpu_result)); + return (static_cast(gpu_result)); } -realtype N_VWrmsNorm_Raja(N_Vector X, N_Vector W) +sunrealtype N_VWrmsNorm_Raja(N_Vector X, N_Vector W) { - const realtype sum = N_VWSqrSumLocal_Raja(X, W); + const sunrealtype sum = N_VWSqrSumLocal_Raja(X, W); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; return std::sqrt(sum/N); } -realtype N_VWSqrSumMaskLocal_Raja(N_Vector X, N_Vector W, N_Vector ID) +sunrealtype N_VWSqrSumMaskLocal_Raja(N_Vector X, N_Vector W, N_Vector ID) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); - const realtype *wdata = NVEC_RAJA_DDATAp(W); - const realtype *iddata = NVEC_RAJA_DDATAp(ID); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *wdata = NVEC_RAJA_DDATAp(W); + const sunrealtype *iddata = NVEC_RAJA_DDATAp(ID); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(0.0); + RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(0.0); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { if (iddata[i] > ZERO) @@ -900,56 +900,56 @@ realtype N_VWSqrSumMaskLocal_Raja(N_Vector X, N_Vector W, N_Vector ID) } ); - return (static_cast(gpu_result)); + return (static_cast(gpu_result)); } -realtype N_VWrmsNormMask_Raja(N_Vector X, N_Vector W, N_Vector ID) +sunrealtype N_VWrmsNormMask_Raja(N_Vector X, N_Vector W, N_Vector ID) { - const realtype sum = N_VWSqrSumMaskLocal_Raja(X, W, ID); + const sunrealtype sum = N_VWSqrSumMaskLocal_Raja(X, W, ID); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; return std::sqrt(sum/N); } -realtype N_VMin_Raja(N_Vector X) +sunrealtype N_VMin_Raja(N_Vector X) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - RAJA::ReduceMin< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(std::numeric_limits::max()); + RAJA::ReduceMin< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(std::numeric_limits::max()); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { gpu_result.min(xdata[i]); } ); - return (static_cast(gpu_result)); + return (static_cast(gpu_result)); } -realtype N_VWL2Norm_Raja(N_Vector X, N_Vector W) +sunrealtype N_VWL2Norm_Raja(N_Vector X, N_Vector W) { return std::sqrt(N_VWSqrSumLocal_Raja(X, W)); } -realtype N_VL1Norm_Raja(N_Vector X) +sunrealtype N_VL1Norm_Raja(N_Vector X) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(0.0); + RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(0.0); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { gpu_result += (abs(xdata[i])); } ); - return (static_cast(gpu_result)); + return (static_cast(gpu_result)); } -void N_VCompare_Raja(realtype c, N_Vector X, N_Vector Z) +void N_VCompare_Raja(sunrealtype c, N_Vector X, N_Vector Z) { - const realtype *xdata = NVEC_RAJA_DDATAp(X); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(X); const sunindextype N = NVEC_RAJA_CONTENT(X)->length; - realtype *zdata = NVEC_RAJA_DDATAp(Z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(Z); RAJA::forall< SUNDIALS_RAJA_EXEC_STREAM >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { @@ -960,11 +960,11 @@ void N_VCompare_Raja(realtype c, N_Vector X, N_Vector Z) booleantype N_VInvTest_Raja(N_Vector x, N_Vector z) { - const realtype *xdata = NVEC_RAJA_DDATAp(x); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(x); const sunindextype N = NVEC_RAJA_CONTENT(x)->length; - realtype *zdata = NVEC_RAJA_DDATAp(z); + sunrealtype *zdata = NVEC_RAJA_DDATAp(z); - RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(ZERO); + RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(ZERO); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { if (xdata[i] == ZERO) { @@ -974,18 +974,18 @@ booleantype N_VInvTest_Raja(N_Vector x, N_Vector z) } } ); - realtype minimum = static_cast(gpu_result); + sunrealtype minimum = static_cast(gpu_result); return (minimum < HALF); } booleantype N_VConstrMask_Raja(N_Vector c, N_Vector x, N_Vector m) { - const realtype *cdata = NVEC_RAJA_DDATAp(c); - const realtype *xdata = NVEC_RAJA_DDATAp(x); + const sunrealtype *cdata = NVEC_RAJA_DDATAp(c); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(x); const sunindextype N = NVEC_RAJA_CONTENT(x)->length; - realtype *mdata = NVEC_RAJA_DDATAp(m); + sunrealtype *mdata = NVEC_RAJA_DDATAp(m); - RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(ZERO); + RAJA::ReduceSum< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(ZERO); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { bool test = (abs(cdata[i]) > ONEPT5 && cdata[i]*xdata[i] <= ZERO) || @@ -995,24 +995,24 @@ booleantype N_VConstrMask_Raja(N_Vector c, N_Vector x, N_Vector m) } ); - realtype sum = static_cast(gpu_result); + sunrealtype sum = static_cast(gpu_result); return(sum < HALF); } -realtype N_VMinQuotient_Raja(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Raja(N_Vector num, N_Vector denom) { - const realtype *ndata = NVEC_RAJA_DDATAp(num); - const realtype *ddata = NVEC_RAJA_DDATAp(denom); + const sunrealtype *ndata = NVEC_RAJA_DDATAp(num); + const sunrealtype *ddata = NVEC_RAJA_DDATAp(denom); const sunindextype N = NVEC_RAJA_CONTENT(num)->length; - RAJA::ReduceMin< SUNDIALS_RAJA_REDUCE, realtype> gpu_result(std::numeric_limits::max()); + RAJA::ReduceMin< SUNDIALS_RAJA_REDUCE, sunrealtype> gpu_result(std::numeric_limits::max()); RAJA::forall< SUNDIALS_RAJA_EXEC_REDUCE >(RAJA::RangeSegment(zeroIdx, N), [=] RAJA_DEVICE (sunindextype i) { if (ddata[i] != ZERO) gpu_result.min(ndata[i]/ddata[i]); } ); - return (static_cast(gpu_result)); + return (static_cast(gpu_result)); } @@ -1023,14 +1023,14 @@ realtype N_VMinQuotient_Raja(N_Vector num, N_Vector denom) */ -int N_VLinearCombination_Raja(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_Raja(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { const sunindextype N = NVEC_RAJA_CONTENT(z)->length; - realtype* zdata = NVEC_RAJA_DDATAp(z); + sunrealtype* zdata = NVEC_RAJA_DDATAp(z); // Fused op workspace shortcuts - realtype* cdata = NULL; - realtype** xdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(z, nvec, nvec)) @@ -1069,16 +1069,16 @@ int N_VLinearCombination_Raja(int nvec, realtype* c, N_Vector* X, N_Vector z) } -int N_VScaleAddMulti_Raja(int nvec, realtype* c, N_Vector x, N_Vector* Y, +int N_VScaleAddMulti_Raja(int nvec, sunrealtype* c, N_Vector x, N_Vector* Y, N_Vector* Z) { const sunindextype N = NVEC_RAJA_CONTENT(x)->length; - const realtype *xdata = NVEC_RAJA_DDATAp(x); + const sunrealtype *xdata = NVEC_RAJA_DDATAp(x); // Shortcuts to the fused op workspace - realtype* cdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(x, nvec, 2 * nvec)) @@ -1130,16 +1130,16 @@ int N_VScaleAddMulti_Raja(int nvec, realtype* c, N_Vector x, N_Vector* Y, int N_VLinearSumVectorArray_Raja(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { const sunindextype N = NVEC_RAJA_CONTENT(Z[0])->length; // Shortcuts to the fused op workspace - realtype** xdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], 0, 3 * nvec)) @@ -1183,14 +1183,14 @@ int N_VLinearSumVectorArray_Raja(int nvec, } -int N_VScaleVectorArray_Raja(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_Raja(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { const sunindextype N = NVEC_RAJA_CONTENT(Z[0])->length; // Shortcuts to the fused op workspace arrays - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], nvec, 2 * nvec)) @@ -1234,12 +1234,12 @@ int N_VScaleVectorArray_Raja(int nvec, realtype* c, N_Vector* X, N_Vector* Z) } -int N_VConstVectorArray_Raja(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_Raja(int nvec, sunrealtype c, N_Vector* Z) { const sunindextype N = NVEC_RAJA_CONTENT(Z[0])->length; // Shortcuts to the fused op workspace arrays - realtype** zdata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], 0, nvec)) @@ -1271,16 +1271,16 @@ int N_VConstVectorArray_Raja(int nvec, realtype c, N_Vector* Z) } -int N_VScaleAddMultiVectorArray_Raja(int nvec, int nsum, realtype* c, +int N_VScaleAddMultiVectorArray_Raja(int nvec, int nsum, sunrealtype* c, N_Vector* X, N_Vector** Y, N_Vector** Z) { const sunindextype N = NVEC_RAJA_CONTENT(X[0])->length; // Shortcuts to the fused op workspace - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(X[0], nsum, nvec + 2 * nvec * nsum)) @@ -1332,15 +1332,15 @@ int N_VScaleAddMultiVectorArray_Raja(int nvec, int nsum, realtype* c, } -int N_VLinearCombinationVectorArray_Raja(int nvec, int nsum, realtype* c, +int N_VLinearCombinationVectorArray_Raja(int nvec, int nsum, sunrealtype* c, N_Vector** X, N_Vector* Z) { const sunindextype N = NVEC_RAJA_CONTENT(Z[0])->length; // Shortcuts to the fused op workspace arrays - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** zdata = NULL; // Setup the fused op workspace if (FusedBuffer_Init(Z[0], nsum, nvec + nvec * nsum)) @@ -1718,7 +1718,7 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) { int alloc_fail = 0; booleantype alloc_mem = SUNFALSE; - size_t bytes = nreal * sizeof(realtype) + nptr * sizeof(realtype*); + size_t bytes = nreal * sizeof(sunrealtype) + nptr * sizeof(sunrealtype*); // Get the vector private memory structure N_PrivateVectorContent_Raja vcp = NVEC_RAJA_PRIVATE(v); @@ -1778,8 +1778,8 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) } -static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, - realtype **shortcut) +static int FusedBuffer_CopyRealArray(N_Vector v, sunrealtype *rdata, int nval, + sunrealtype **shortcut) { // Get the vector private memory structure N_PrivateVectorContent_Raja vcp = NVEC_RAJA_PRIVATE(v); @@ -1791,7 +1791,7 @@ static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, return -1; } - realtype* h_buffer = (realtype*) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype* h_buffer = (sunrealtype*) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nval; j++) @@ -1800,17 +1800,17 @@ static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, } // Set shortcut to the device buffer and update offset - *shortcut = (realtype*) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype*) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); - vcp->fused_buffer_offset += nval * sizeof(realtype); + vcp->fused_buffer_offset += nval * sizeof(sunrealtype); return 0; } static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, - realtype ***shortcut) + sunrealtype ***shortcut) { // Get the vector private memory structure N_PrivateVectorContent_Raja vcp = NVEC_RAJA_PRIVATE(v); @@ -1822,7 +1822,7 @@ static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, return -1; } - realtype** h_buffer = (realtype**) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype** h_buffer = (sunrealtype**) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) @@ -1831,17 +1831,17 @@ static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, } // Set shortcut to the device buffer and update offset - *shortcut = (realtype**) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype**) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); - vcp->fused_buffer_offset += nvec * sizeof(realtype*); + vcp->fused_buffer_offset += nvec * sizeof(sunrealtype*); return 0; } static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, - int nsum, realtype ***shortcut) + int nsum, sunrealtype ***shortcut) { // Get the vector private memory structure N_PrivateVectorContent_Raja vcp = NVEC_RAJA_PRIVATE(v); @@ -1853,7 +1853,7 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, return -1; } - realtype** h_buffer = (realtype**) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype** h_buffer = (sunrealtype**) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) @@ -1865,11 +1865,11 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, } // Set shortcut to the device buffer and update offset - *shortcut = (realtype**) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype**) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); // Update the offset - vcp->fused_buffer_offset += nvec * nsum * sizeof(realtype*); + vcp->fused_buffer_offset += nvec * nsum * sizeof(sunrealtype*); return 0; } diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.c b/src/nvector/serial/fmod/fnvector_serial_mod.c index ed9a774185..48754ff3da 100644 --- a/src/nvector/serial/fmod/fnvector_serial_mod.c +++ b/src/nvector/serial/fmod/fnvector_serial_mod.c @@ -239,12 +239,12 @@ SWIGEXPORT N_Vector _wrap_FN_VNewEmpty_Serial(int64_t const *farg1, void *farg2) SWIGEXPORT N_Vector _wrap_FN_VMake_Serial(int64_t const *farg1, double *farg2, void *farg3) { N_Vector fresult ; sunindextype arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; SUNContext arg3 = (SUNContext) 0 ; N_Vector result; arg1 = (sunindextype)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (SUNContext)(farg3); result = (N_Vector)N_VMake_Serial(arg1,arg2,arg3); fresult = result; @@ -339,25 +339,25 @@ SWIGEXPORT void _wrap_FN_VSpace_Serial(N_Vector farg1, int64_t *farg2, int64_t * SWIGEXPORT void _wrap_FN_VSetArrayPointer_Serial(double *farg1, N_Vector farg2) { - realtype *arg1 = (realtype *) 0 ; + sunrealtype *arg1 = (sunrealtype *) 0 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (realtype *)(farg1); + arg1 = (sunrealtype *)(farg1); arg2 = (N_Vector)(farg2); N_VSetArrayPointer_Serial(arg1,arg2); } SWIGEXPORT void _wrap_FN_VLinearSum_Serial(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); N_VLinearSum_Serial(arg1,arg2,arg3,arg4,arg5); @@ -365,10 +365,10 @@ SWIGEXPORT void _wrap_FN_VLinearSum_Serial(double const *farg1, N_Vector farg2, SWIGEXPORT void _wrap_FN_VConst_Serial(double const *farg1, N_Vector farg2) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); N_VConst_Serial(arg1,arg2); } @@ -399,11 +399,11 @@ SWIGEXPORT void _wrap_FN_VDiv_Serial(N_Vector farg1, N_Vector farg2, N_Vector fa SWIGEXPORT void _wrap_FN_VScale_Serial(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VScale_Serial(arg1,arg2,arg3); @@ -432,11 +432,11 @@ SWIGEXPORT void _wrap_FN_VInv_Serial(N_Vector farg1, N_Vector farg2) { SWIGEXPORT void _wrap_FN_VAddConst_Serial(N_Vector farg1, double const *farg2, N_Vector farg3) { N_Vector arg1 = (N_Vector) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; arg1 = (N_Vector)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); N_VAddConst_Serial(arg1,arg2,arg3); } @@ -446,12 +446,12 @@ SWIGEXPORT double _wrap_FN_VDotProd_Serial(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VDotProd_Serial(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VDotProd_Serial(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -459,11 +459,11 @@ SWIGEXPORT double _wrap_FN_VDotProd_Serial(N_Vector farg1, N_Vector farg2) { SWIGEXPORT double _wrap_FN_VMaxNorm_Serial(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMaxNorm_Serial(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMaxNorm_Serial(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -472,12 +472,12 @@ SWIGEXPORT double _wrap_FN_VWrmsNorm_Serial(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWrmsNorm_Serial(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNorm_Serial(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -487,13 +487,13 @@ SWIGEXPORT double _wrap_FN_VWrmsNormMask_Serial(N_Vector farg1, N_Vector farg2, N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWrmsNormMask_Serial(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNormMask_Serial(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -501,11 +501,11 @@ SWIGEXPORT double _wrap_FN_VWrmsNormMask_Serial(N_Vector farg1, N_Vector farg2, SWIGEXPORT double _wrap_FN_VMin_Serial(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMin_Serial(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMin_Serial(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -514,12 +514,12 @@ SWIGEXPORT double _wrap_FN_VWL2Norm_Serial(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWL2Norm_Serial(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWL2Norm_Serial(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -527,21 +527,21 @@ SWIGEXPORT double _wrap_FN_VWL2Norm_Serial(N_Vector farg1, N_Vector farg2) { SWIGEXPORT double _wrap_FN_VL1Norm_Serial(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VL1Norm_Serial(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VL1Norm_Serial(arg1); + fresult = (sunrealtype)(result); return fresult; } SWIGEXPORT void _wrap_FN_VCompare_Serial(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VCompare_Serial(arg1,arg2,arg3); @@ -582,12 +582,12 @@ SWIGEXPORT double _wrap_FN_VMinQuotient_Serial(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VMinQuotient_Serial(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinQuotient_Serial(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -595,13 +595,13 @@ SWIGEXPORT double _wrap_FN_VMinQuotient_Serial(N_Vector farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FN_VLinearCombination_Serial(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); result = (int)N_VLinearCombination_Serial(arg1,arg2,arg3,arg4); @@ -613,14 +613,14 @@ SWIGEXPORT int _wrap_FN_VLinearCombination_Serial(int const *farg1, double *farg SWIGEXPORT int _wrap_FN_VScaleAddMulti_Serial(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); @@ -635,13 +635,13 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti_Serial(int const *farg1, N_Vector farg2, v int arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VDotProdMulti_Serial(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -651,17 +651,17 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti_Serial(int const *farg1, N_Vector farg2, v SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_Serial(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector *arg5 = (N_Vector *) 0 ; N_Vector *arg6 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector *)(farg5); arg6 = (N_Vector *)(farg6); result = (int)N_VLinearSumVectorArray_Serial(arg1,arg2,arg3,arg4,arg5,arg6); @@ -673,13 +673,13 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_Serial(int const *farg1, double co SWIGEXPORT int _wrap_FN_VScaleVectorArray_Serial(int const *farg1, double *farg2, void *farg3, void *farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); result = (int)N_VScaleVectorArray_Serial(arg1,arg2,arg3,arg4); @@ -691,12 +691,12 @@ SWIGEXPORT int _wrap_FN_VScaleVectorArray_Serial(int const *farg1, double *farg2 SWIGEXPORT int _wrap_FN_VConstVectorArray_Serial(int const *farg1, double const *farg2, void *farg3) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)N_VConstVectorArray_Serial(arg1,arg2,arg3); fresult = (int)(result); @@ -709,13 +709,13 @@ SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_Serial(int const *farg1, void *farg int arg1 ; N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VWrmsNormVectorArray_Serial(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -728,14 +728,14 @@ SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_Serial(int const *farg1, void * N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype *arg5 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype *)(farg5); + arg5 = (sunrealtype *)(farg5); result = (int)N_VWrmsNormMaskVectorArray_Serial(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -746,12 +746,12 @@ SWIGEXPORT double _wrap_FN_VWSqrSumLocal_Serial(N_Vector farg1, N_Vector farg2) double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWSqrSumLocal_Serial(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumLocal_Serial(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -761,13 +761,13 @@ SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_Serial(N_Vector farg1, N_Vector far N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWSqrSumMaskLocal_Serial(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumMaskLocal_Serial(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -982,10 +982,10 @@ SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Serial(void *farg1, int const *farg SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Serial(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer_Serial(arg1); + result = (sunrealtype *)N_VGetArrayPointer_Serial(arg1); fresult = result; return fresult; } diff --git a/src/nvector/serial/nvector_serial.c b/src/nvector/serial/nvector_serial.c index 980363fbb6..b2c15adc09 100644 --- a/src/nvector/serial/nvector_serial.c +++ b/src/nvector/serial/nvector_serial.c @@ -33,21 +33,21 @@ static void VCopy_Serial(N_Vector x, N_Vector z); / static void VSum_Serial(N_Vector x, N_Vector y, N_Vector z); /* z=x+y */ static void VDiff_Serial(N_Vector x, N_Vector y, N_Vector z); /* z=x-y */ static void VNeg_Serial(N_Vector x, N_Vector z); /* z=-x */ -static void VScaleSum_Serial(realtype c, N_Vector x, N_Vector y, N_Vector z); /* z=c(x+y) */ -static void VScaleDiff_Serial(realtype c, N_Vector x, N_Vector y, N_Vector z); /* z=c(x-y) */ -static void VLin1_Serial(realtype a, N_Vector x, N_Vector y, N_Vector z); /* z=ax+y */ -static void VLin2_Serial(realtype a, N_Vector x, N_Vector y, N_Vector z); /* z=ax-y */ -static void Vaxpy_Serial(realtype a, N_Vector x, N_Vector y); /* y <- ax+y */ -static void VScaleBy_Serial(realtype a, N_Vector x); /* x <- ax */ +static void VScaleSum_Serial(sunrealtype c, N_Vector x, N_Vector y, N_Vector z); /* z=c(x+y) */ +static void VScaleDiff_Serial(sunrealtype c, N_Vector x, N_Vector y, N_Vector z); /* z=c(x-y) */ +static void VLin1_Serial(sunrealtype a, N_Vector x, N_Vector y, N_Vector z); /* z=ax+y */ +static void VLin2_Serial(sunrealtype a, N_Vector x, N_Vector y, N_Vector z); /* z=ax-y */ +static void Vaxpy_Serial(sunrealtype a, N_Vector x, N_Vector y); /* y <- ax+y */ +static void VScaleBy_Serial(sunrealtype a, N_Vector x); /* x <- ax */ /* Private functions for special cases of vector array operations */ static int VSumVectorArray_Serial(int nvec, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=X+Y */ static int VDiffVectorArray_Serial(int nvec, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=X-Y */ -static int VScaleSumVectorArray_Serial(int nvec, realtype c, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=c(X+Y) */ -static int VScaleDiffVectorArray_Serial(int nvec, realtype c, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=c(X-Y) */ -static int VLin1VectorArray_Serial(int nvec, realtype a, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=aX+Y */ -static int VLin2VectorArray_Serial(int nvec, realtype a, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=aX-Y */ -static int VaxpyVectorArray_Serial(int nvec, realtype a, N_Vector* X, N_Vector* Y); /* Y <- aX+Y */ +static int VScaleSumVectorArray_Serial(int nvec, sunrealtype c, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=c(X+Y) */ +static int VScaleDiffVectorArray_Serial(int nvec, sunrealtype c, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=c(X-Y) */ +static int VLin1VectorArray_Serial(int nvec, sunrealtype a, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=aX+Y */ +static int VLin2VectorArray_Serial(int nvec, sunrealtype a, N_Vector* X, N_Vector* Y, N_Vector* Z); /* Z=aX-Y */ +static int VaxpyVectorArray_Serial(int nvec, sunrealtype a, N_Vector* X, N_Vector* Y); /* Y <- aX+Y */ /* * ----------------------------------------------------------------- @@ -160,7 +160,7 @@ N_Vector N_VNewEmpty_Serial(sunindextype length, SUNContext sunctx) N_Vector N_VNew_Serial(sunindextype length, SUNContext sunctx) { N_Vector v; - realtype *data; + sunrealtype *data; v = NULL; v = N_VNewEmpty_Serial(length, sunctx); @@ -171,7 +171,7 @@ N_Vector N_VNew_Serial(sunindextype length, SUNContext sunctx) /* Allocate memory */ data = NULL; - data = (realtype *) malloc(length * sizeof(realtype)); + data = (sunrealtype *) malloc(length * sizeof(sunrealtype)); if(data == NULL) { N_VDestroy_Serial(v); return(NULL); } /* Attach data */ @@ -187,7 +187,7 @@ N_Vector N_VNew_Serial(sunindextype length, SUNContext sunctx) * Function to create a serial N_Vector with user data component */ -N_Vector N_VMake_Serial(sunindextype length, realtype *v_data, SUNContext sunctx) +N_Vector N_VMake_Serial(sunindextype length, sunrealtype *v_data, SUNContext sunctx) { N_Vector v; @@ -256,7 +256,7 @@ void N_VPrint_Serial(N_Vector x) void N_VPrintFile_Serial(N_Vector x, FILE* outfile) { sunindextype i, N; - realtype *xd; + sunrealtype *xd; xd = NULL; @@ -317,7 +317,7 @@ N_Vector N_VCloneEmpty_Serial(N_Vector w) N_Vector N_VClone_Serial(N_Vector w) { N_Vector v; - realtype *data; + sunrealtype *data; sunindextype length; v = NULL; @@ -331,7 +331,7 @@ N_Vector N_VClone_Serial(N_Vector w) /* Allocate memory */ data = NULL; - data = (realtype *) malloc(length * sizeof(realtype)); + data = (sunrealtype *) malloc(length * sizeof(sunrealtype)); if(data == NULL) { N_VDestroy_Serial(v); return(NULL); } /* Attach data */ @@ -373,22 +373,22 @@ void N_VSpace_Serial(N_Vector v, sunindextype *lrw, sunindextype *liw) return; } -realtype *N_VGetArrayPointer_Serial(N_Vector v) +sunrealtype *N_VGetArrayPointer_Serial(N_Vector v) { - return((realtype *) NV_DATA_S(v)); + return((sunrealtype *) NV_DATA_S(v)); } -void N_VSetArrayPointer_Serial(realtype *v_data, N_Vector v) +void N_VSetArrayPointer_Serial(sunrealtype *v_data, N_Vector v) { if (NV_LENGTH_S(v) > 0) NV_DATA_S(v) = v_data; return; } -void N_VLinearSum_Serial(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum_Serial(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { sunindextype i, N; - realtype c, *xd, *yd, *zd; + sunrealtype c, *xd, *yd, *zd; N_Vector v1, v2; booleantype test; @@ -472,10 +472,10 @@ void N_VLinearSum_Serial(realtype a, N_Vector x, realtype b, N_Vector y, N_Vecto return; } -void N_VConst_Serial(realtype c, N_Vector z) +void N_VConst_Serial(sunrealtype c, N_Vector z) { sunindextype i, N; - realtype *zd; + sunrealtype *zd; zd = NULL; @@ -490,7 +490,7 @@ void N_VConst_Serial(realtype c, N_Vector z) void N_VProd_Serial(N_Vector x, N_Vector y, N_Vector z) { sunindextype i, N; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; xd = yd = zd = NULL; @@ -508,7 +508,7 @@ void N_VProd_Serial(N_Vector x, N_Vector y, N_Vector z) void N_VDiv_Serial(N_Vector x, N_Vector y, N_Vector z) { sunindextype i, N; - realtype *xd, *yd, *zd; + sunrealtype *xd, *yd, *zd; xd = yd = zd = NULL; @@ -523,10 +523,10 @@ void N_VDiv_Serial(N_Vector x, N_Vector y, N_Vector z) return; } -void N_VScale_Serial(realtype c, N_Vector x, N_Vector z) +void N_VScale_Serial(sunrealtype c, N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -553,7 +553,7 @@ void N_VScale_Serial(realtype c, N_Vector x, N_Vector z) void N_VAbs_Serial(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -570,7 +570,7 @@ void N_VAbs_Serial(N_Vector x, N_Vector z) void N_VInv_Serial(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -584,10 +584,10 @@ void N_VInv_Serial(N_Vector x, N_Vector z) return; } -void N_VAddConst_Serial(N_Vector x, realtype b, N_Vector z) +void N_VAddConst_Serial(N_Vector x, sunrealtype b, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -601,10 +601,10 @@ void N_VAddConst_Serial(N_Vector x, realtype b, N_Vector z) return; } -realtype N_VDotProd_Serial(N_Vector x, N_Vector y) +sunrealtype N_VDotProd_Serial(N_Vector x, N_Vector y) { sunindextype i, N; - realtype sum, *xd, *yd; + sunrealtype sum, *xd, *yd; sum = ZERO; xd = yd = NULL; @@ -619,10 +619,10 @@ realtype N_VDotProd_Serial(N_Vector x, N_Vector y) return(sum); } -realtype N_VMaxNorm_Serial(N_Vector x) +sunrealtype N_VMaxNorm_Serial(N_Vector x) { sunindextype i, N; - realtype max, *xd; + sunrealtype max, *xd; max = ZERO; xd = NULL; @@ -637,15 +637,15 @@ realtype N_VMaxNorm_Serial(N_Vector x) return(max); } -realtype N_VWrmsNorm_Serial(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_Serial(N_Vector x, N_Vector w) { return(SUNRsqrt(N_VWSqrSumLocal_Serial(x, w)/(NV_LENGTH_S(x)))); } -realtype N_VWSqrSumLocal_Serial(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal_Serial(N_Vector x, N_Vector w) { sunindextype i, N; - realtype sum, prodi, *xd, *wd; + sunrealtype sum, prodi, *xd, *wd; sum = ZERO; xd = wd = NULL; @@ -662,15 +662,15 @@ realtype N_VWSqrSumLocal_Serial(N_Vector x, N_Vector w) return(sum); } -realtype N_VWrmsNormMask_Serial(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_Serial(N_Vector x, N_Vector w, N_Vector id) { return(SUNRsqrt(N_VWSqrSumMaskLocal_Serial(x, w, id) / (NV_LENGTH_S(x)))); } -realtype N_VWSqrSumMaskLocal_Serial(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal_Serial(N_Vector x, N_Vector w, N_Vector id) { sunindextype i, N; - realtype sum, prodi, *xd, *wd, *idd; + sunrealtype sum, prodi, *xd, *wd, *idd; sum = ZERO; xd = wd = idd = NULL; @@ -690,10 +690,10 @@ realtype N_VWSqrSumMaskLocal_Serial(N_Vector x, N_Vector w, N_Vector id) return(sum); } -realtype N_VMin_Serial(N_Vector x) +sunrealtype N_VMin_Serial(N_Vector x) { sunindextype i, N; - realtype min, *xd; + sunrealtype min, *xd; xd = NULL; @@ -709,10 +709,10 @@ realtype N_VMin_Serial(N_Vector x) return(min); } -realtype N_VWL2Norm_Serial(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_Serial(N_Vector x, N_Vector w) { sunindextype i, N; - realtype sum, prodi, *xd, *wd; + sunrealtype sum, prodi, *xd, *wd; sum = ZERO; xd = wd = NULL; @@ -729,10 +729,10 @@ realtype N_VWL2Norm_Serial(N_Vector x, N_Vector w) return(SUNRsqrt(sum)); } -realtype N_VL1Norm_Serial(N_Vector x) +sunrealtype N_VL1Norm_Serial(N_Vector x) { sunindextype i, N; - realtype sum, *xd; + sunrealtype sum, *xd; sum = ZERO; xd = NULL; @@ -746,10 +746,10 @@ realtype N_VL1Norm_Serial(N_Vector x) return(sum); } -void N_VCompare_Serial(realtype c, N_Vector x, N_Vector z) +void N_VCompare_Serial(sunrealtype c, N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; xd = zd = NULL; @@ -767,7 +767,7 @@ void N_VCompare_Serial(realtype c, N_Vector x, N_Vector z) booleantype N_VInvTest_Serial(N_Vector x, N_Vector z) { sunindextype i, N; - realtype *xd, *zd; + sunrealtype *xd, *zd; booleantype no_zero_found; xd = zd = NULL; @@ -790,8 +790,8 @@ booleantype N_VInvTest_Serial(N_Vector x, N_Vector z) booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; - realtype temp; - realtype *cd, *xd, *md; + sunrealtype temp; + sunrealtype *cd, *xd, *md; booleantype test; cd = xd = md = NULL; @@ -822,11 +822,11 @@ booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m) return (temp == ONE) ? SUNFALSE : SUNTRUE; } -realtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom) { booleantype notEvenOnce; sunindextype i, N; - realtype *nd, *dd, min; + sunrealtype *nd, *dd, min; nd = dd = NULL; @@ -858,12 +858,12 @@ realtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom) * ----------------------------------------------------------------- */ -int N_VLinearCombination_Serial(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_Serial(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { int i; sunindextype j, N; - realtype* zd=NULL; - realtype* xd=NULL; + sunrealtype* zd=NULL; + sunrealtype* xd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -930,13 +930,13 @@ int N_VLinearCombination_Serial(int nvec, realtype* c, N_Vector* X, N_Vector z) } -int N_VScaleAddMulti_Serial(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) +int N_VScaleAddMulti_Serial(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -978,12 +978,12 @@ int N_VScaleAddMulti_Serial(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Ve } -int N_VDotProdMulti_Serial(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) +int N_VDotProdMulti_Serial(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1018,16 +1018,16 @@ int N_VDotProdMulti_Serial(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods */ int N_VLinearSumVectorArray_Serial(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; - realtype c; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; + sunrealtype c; N_Vector* V1; N_Vector* V2; booleantype test; @@ -1114,12 +1114,12 @@ int N_VLinearSumVectorArray_Serial(int nvec, } -int N_VScaleVectorArray_Serial(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_Serial(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { int i; sunindextype j, N; - realtype* xd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* zd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1160,11 +1160,11 @@ int N_VScaleVectorArray_Serial(int nvec, realtype* c, N_Vector* X, N_Vector* Z) } -int N_VConstVectorArray_Serial(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_Serial(int nvec, sunrealtype c, N_Vector* Z) { int i; sunindextype j, N; - realtype* zd=NULL; + sunrealtype* zd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1191,12 +1191,12 @@ int N_VConstVectorArray_Serial(int nvec, realtype c, N_Vector* Z) int N_VWrmsNormVectorArray_Serial(int nvec, N_Vector* X, N_Vector* W, - realtype* nrm) + sunrealtype* nrm) { int i; sunindextype j, N; - realtype* wd=NULL; - realtype* xd=NULL; + sunrealtype* wd=NULL; + sunrealtype* xd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1226,13 +1226,13 @@ int N_VWrmsNormVectorArray_Serial(int nvec, N_Vector* X, N_Vector* W, int N_VWrmsNormMaskVectorArray_Serial(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, realtype* nrm) + N_Vector id, sunrealtype* nrm) { int i; sunindextype j, N; - realtype* wd=NULL; - realtype* xd=NULL; - realtype* idd=NULL; + sunrealtype* wd=NULL; + sunrealtype* xd=NULL; + sunrealtype* idd=NULL; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1263,14 +1263,14 @@ int N_VWrmsNormMaskVectorArray_Serial(int nvec, N_Vector* X, N_Vector* W, } -int N_VScaleAddMultiVectorArray_Serial(int nvec, int nsum, realtype* a, +int N_VScaleAddMultiVectorArray_Serial(int nvec, int nsum, sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z) { int i, j; sunindextype k, N; - realtype* xd=NULL; - realtype* yd=NULL; - realtype* zd=NULL; + sunrealtype* xd=NULL; + sunrealtype* yd=NULL; + sunrealtype* zd=NULL; int retval; N_Vector* YY; @@ -1358,18 +1358,18 @@ int N_VScaleAddMultiVectorArray_Serial(int nvec, int nsum, realtype* a, } -int N_VLinearCombinationVectorArray_Serial(int nvec, int nsum, realtype* c, +int N_VLinearCombinationVectorArray_Serial(int nvec, int nsum, sunrealtype* c, N_Vector** X, N_Vector* Z) { int i; /* vector arrays index in summation [0,nsum) */ int j; /* vector index in vector array [0,nvec) */ sunindextype k; /* element index in vector [0,N) */ sunindextype N; - realtype* zd=NULL; - realtype* xd=NULL; + sunrealtype* zd=NULL; + sunrealtype* xd=NULL; int retval; - realtype* ctmp; + sunrealtype* ctmp; N_Vector* Y; /* invalid number of vectors */ @@ -1414,7 +1414,7 @@ int N_VLinearCombinationVectorArray_Serial(int nvec, int nsum, realtype* c, /* should have called N_VScaleVectorArray */ if (nsum == 1) { - ctmp = (realtype*) malloc(nvec * sizeof(realtype)); + ctmp = (sunrealtype*) malloc(nvec * sizeof(sunrealtype)); for (j=0; jcontent)) #define NVEC_SYCL_LENGTH(x) (NVEC_SYCL_CONTENT(x)->length) #define NVEC_SYCL_MEMHELP(x) (NVEC_SYCL_CONTENT(x)->mem_helper) -#define NVEC_SYCL_MEMSIZE(x) (NVEC_SYCL_CONTENT(x)->length * sizeof(realtype)) -#define NVEC_SYCL_HDATAp(x) ((realtype*) NVEC_SYCL_CONTENT(x)->host_data->ptr) -#define NVEC_SYCL_DDATAp(x) ((realtype*) NVEC_SYCL_CONTENT(x)->device_data->ptr) +#define NVEC_SYCL_MEMSIZE(x) (NVEC_SYCL_CONTENT(x)->length * sizeof(sunrealtype)) +#define NVEC_SYCL_HDATAp(x) ((sunrealtype*) NVEC_SYCL_CONTENT(x)->host_data->ptr) +#define NVEC_SYCL_DDATAp(x) ((sunrealtype*) NVEC_SYCL_CONTENT(x)->device_data->ptr) #define NVEC_SYCL_QUEUE(x) (NVEC_SYCL_CONTENT(x)->queue) /* Macros to access vector private content */ #define NVEC_SYCL_PRIVATE(x) ((N_PrivateVectorContent_Sycl)(NVEC_SYCL_CONTENT(x)->priv)) -#define NVEC_SYCL_HBUFFERp(x) ((realtype*) NVEC_SYCL_PRIVATE(x)->reduce_buffer_host->ptr) -#define NVEC_SYCL_DBUFFERp(x) ((realtype*) NVEC_SYCL_PRIVATE(x)->reduce_buffer_dev->ptr) +#define NVEC_SYCL_HBUFFERp(x) ((sunrealtype*) NVEC_SYCL_PRIVATE(x)->reduce_buffer_host->ptr) +#define NVEC_SYCL_DBUFFERp(x) ((sunrealtype*) NVEC_SYCL_PRIVATE(x)->reduce_buffer_dev->ptr) /* -------------------------------------------------------------------------- @@ -92,19 +92,19 @@ typedef struct _N_PrivateVectorContent_Sycl *N_PrivateVectorContent_Sycl; static int AllocateData(N_Vector v); /* Reduction buffer functions */ -static int InitializeReductionBuffer(N_Vector v, const realtype value, +static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t n = 1); static void FreeReductionBuffer(N_Vector v); static int CopyReductionBufferFromDevice(N_Vector v, size_t n = 1); /* Fused operation buffer functions */ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr); -static int FusedBuffer_CopyRealArray(N_Vector v, realtype *r_data, int nval, - realtype **shortcut); +static int FusedBuffer_CopyRealArray(N_Vector v, sunrealtype *r_data, int nval, + sunrealtype **shortcut); static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, - realtype ***shortcut); + sunrealtype ***shortcut); static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, - int nsum, realtype ***shortcut); + int nsum, sunrealtype ***shortcut); static int FusedBuffer_CopyToDevice(N_Vector v); static int FusedBuffer_Free(N_Vector v); @@ -388,7 +388,7 @@ N_Vector N_VNewManaged_Sycl(sunindextype length, ::sycl::queue *Q, } -N_Vector N_VMake_Sycl(sunindextype length, realtype *h_vdata, realtype *d_vdata, +N_Vector N_VMake_Sycl(sunindextype length, sunrealtype *h_vdata, sunrealtype *d_vdata, ::sycl::queue *Q, SUNContext sunctx) { /* Check inputs */ @@ -448,7 +448,7 @@ N_Vector N_VMake_Sycl(sunindextype length, realtype *h_vdata, realtype *d_vdata, } -N_Vector N_VMakeManaged_Sycl(sunindextype length, realtype *vdata, +N_Vector N_VMakeManaged_Sycl(sunindextype length, sunrealtype *vdata, ::sycl::queue *Q, SUNContext sunctx) { /* Check inputs */ @@ -520,16 +520,16 @@ extern sunindextype N_VGetLength_Sycl(N_Vector v); /* Return pointer to the raw host data. This is defined as an inline function in * nvector_sycl.h, so we just mark it as extern here. */ -extern realtype *N_VGetHostArrayPointer_Sycl(N_Vector x); +extern sunrealtype *N_VGetHostArrayPointer_Sycl(N_Vector x); /* Return pointer to the raw device data. This is defined as an inline function * in nvector_sycl.h, so we just mark it as extern here. */ -extern realtype *N_VGetDeviceArrayPointer_Sycl(N_Vector x); +extern sunrealtype *N_VGetDeviceArrayPointer_Sycl(N_Vector x); /* Set pointer to the raw host data. Does not free the existing pointer. */ -void N_VSetHostArrayPointer_Sycl(realtype* h_vdata, N_Vector v) +void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) { if (N_VIsManagedMemory_Sycl(v)) { @@ -559,7 +559,7 @@ void N_VSetHostArrayPointer_Sycl(realtype* h_vdata, N_Vector v) /* Set pointer to the raw device data */ -void N_VSetDeviceArrayPointer_Sycl(realtype* d_vdata, N_Vector v) +void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) { if (N_VIsManagedMemory_Sycl(v)) { @@ -845,10 +845,10 @@ void N_VSpace_Sycl(N_Vector X, sunindextype *lrw, sunindextype *liw) } -void N_VConst_Sycl(realtype c, N_Vector z) +void N_VConst_Sycl(sunrealtype c, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - realtype *zdata = NVEC_SYCL_DDATAp(z); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -865,12 +865,12 @@ void N_VConst_Sycl(realtype c, N_Vector z) } -void N_VLinearSum_Sycl(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum_Sycl(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - const realtype *ydata = NVEC_SYCL_DDATAp(y); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *ydata = NVEC_SYCL_DDATAp(y); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -890,9 +890,9 @@ void N_VLinearSum_Sycl(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector void N_VProd_Sycl(N_Vector x, N_Vector y, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - const realtype *ydata = NVEC_SYCL_DDATAp(y); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *ydata = NVEC_SYCL_DDATAp(y); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -912,9 +912,9 @@ void N_VProd_Sycl(N_Vector x, N_Vector y, N_Vector z) void N_VDiv_Sycl(N_Vector x, N_Vector y, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - const realtype *ydata = NVEC_SYCL_DDATAp(y); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *ydata = NVEC_SYCL_DDATAp(y); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -931,11 +931,11 @@ void N_VDiv_Sycl(N_Vector x, N_Vector y, N_Vector z) } -void N_VScale_Sycl(realtype c, N_Vector x, N_Vector z) +void N_VScale_Sycl(sunrealtype c, N_Vector x, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -955,8 +955,8 @@ void N_VScale_Sycl(realtype c, N_Vector x, N_Vector z) void N_VAbs_Sycl(N_Vector x, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -976,8 +976,8 @@ void N_VAbs_Sycl(N_Vector x, N_Vector z) void N_VInv_Sycl(N_Vector x, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -994,11 +994,11 @@ void N_VInv_Sycl(N_Vector x, N_Vector z) } -void N_VAddConst_Sycl(N_Vector x, realtype b, N_Vector z) +void N_VAddConst_Sycl(N_Vector x, sunrealtype b, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -1015,11 +1015,11 @@ void N_VAddConst_Sycl(N_Vector x, realtype b, N_Vector z) } -realtype N_VDotProd_Sycl(N_Vector x, N_Vector y) +sunrealtype N_VDotProd_Sycl(N_Vector x, N_Vector y) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - const realtype *ydata = NVEC_SYCL_DDATAp(y); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *ydata = NVEC_SYCL_DDATAp(y); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; @@ -1034,10 +1034,10 @@ realtype N_VDotProd_Sycl(N_Vector x, N_Vector y) } /* Shortcut to the reduction buffer */ - realtype *sum = NVEC_SYCL_DBUFFERp(x); + sunrealtype *sum = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - sum, ::sycl::plus(), + sum, ::sycl::plus(), GRID_STRIDE_XLOOP(item, i, N) { sum += xdata[i] * ydata[i]; @@ -1052,10 +1052,10 @@ realtype N_VDotProd_Sycl(N_Vector x, N_Vector y) } -realtype N_VMaxNorm_Sycl(N_Vector x) +sunrealtype N_VMaxNorm_Sycl(N_Vector x) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; @@ -1070,10 +1070,10 @@ realtype N_VMaxNorm_Sycl(N_Vector x) } /* Shortcut to the reduction buffer */ - realtype *max = NVEC_SYCL_DBUFFERp(x); + sunrealtype *max = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - max, ::sycl::maximum(), + max, ::sycl::maximum(), GRID_STRIDE_XLOOP(item, i, N) { max.combine(abs(xdata[i])); @@ -1088,11 +1088,11 @@ realtype N_VMaxNorm_Sycl(N_Vector x) } -realtype N_VWSqrSumLocal_Sycl(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal_Sycl(N_Vector x, N_Vector w) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - const realtype *wdata = NVEC_SYCL_DDATAp(w); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *wdata = NVEC_SYCL_DDATAp(w); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; @@ -1107,10 +1107,10 @@ realtype N_VWSqrSumLocal_Sycl(N_Vector x, N_Vector w) } /* Shortcut to the reduction buffer */ - realtype *sum = NVEC_SYCL_DBUFFERp(x); + sunrealtype *sum = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - sum, ::sycl::plus(), + sum, ::sycl::plus(), GRID_STRIDE_XLOOP(item, i, N) { sum += xdata[i] * wdata[i] * xdata[i] * wdata[i]; @@ -1125,20 +1125,20 @@ realtype N_VWSqrSumLocal_Sycl(N_Vector x, N_Vector w) } -realtype N_VWrmsNorm_Sycl(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_Sycl(N_Vector x, N_Vector w) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype sum = N_VWSqrSumLocal_Sycl(x, w); + const sunrealtype sum = N_VWSqrSumLocal_Sycl(x, w); return std::sqrt(sum/N); } -realtype N_VWSqrSumMaskLocal_Sycl(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal_Sycl(N_Vector x, N_Vector w, N_Vector id) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - const realtype *wdata = NVEC_SYCL_DDATAp(w); - const realtype *iddata = NVEC_SYCL_DDATAp(id); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *wdata = NVEC_SYCL_DDATAp(w); + const sunrealtype *iddata = NVEC_SYCL_DDATAp(id); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; @@ -1153,10 +1153,10 @@ realtype N_VWSqrSumMaskLocal_Sycl(N_Vector x, N_Vector w, N_Vector id) } /* Shortcut to the reduction buffer */ - realtype *sum = NVEC_SYCL_DBUFFERp(x); + sunrealtype *sum = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - sum, ::sycl::plus(), + sum, ::sycl::plus(), GRID_STRIDE_XLOOP(item, i, N) { if (iddata[i] > ZERO) @@ -1172,22 +1172,22 @@ realtype N_VWSqrSumMaskLocal_Sycl(N_Vector x, N_Vector w, N_Vector id) } -realtype N_VWrmsNormMask_Sycl(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_Sycl(N_Vector x, N_Vector w, N_Vector id) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype sum = N_VWSqrSumMaskLocal_Sycl(x, w, id); + const sunrealtype sum = N_VWSqrSumMaskLocal_Sycl(x, w, id); return std::sqrt(sum/N); } -realtype N_VMin_Sycl(N_Vector x) +sunrealtype N_VMin_Sycl(N_Vector x) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; - if (InitializeReductionBuffer(x, std::numeric_limits::max())) + if (InitializeReductionBuffer(x, std::numeric_limits::max())) { SUNDIALS_DEBUG_PRINT("ERROR in N_VMin_Sycl: InitializeReductionBuffer returned nonzero\n"); } @@ -1198,10 +1198,10 @@ realtype N_VMin_Sycl(N_Vector x) } /* Shortcut to the reduction buffer */ - realtype *min = NVEC_SYCL_DBUFFERp(x); + sunrealtype *min = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - min, ::sycl::minimum(), + min, ::sycl::minimum(), GRID_STRIDE_XLOOP(item, i, N) { min.combine(xdata[i]); @@ -1216,16 +1216,16 @@ realtype N_VMin_Sycl(N_Vector x) } -realtype N_VWL2Norm_Sycl(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_Sycl(N_Vector x, N_Vector w) { return std::sqrt(N_VWSqrSumLocal_Sycl(x, w)); } -realtype N_VL1Norm_Sycl(N_Vector x) +sunrealtype N_VL1Norm_Sycl(N_Vector x) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; @@ -1240,10 +1240,10 @@ realtype N_VL1Norm_Sycl(N_Vector x) } /* Shortcut to the reduction buffer */ - realtype *sum = NVEC_SYCL_DBUFFERp(x); + sunrealtype *sum = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - sum, ::sycl::plus(), + sum, ::sycl::plus(), GRID_STRIDE_XLOOP(item, i, N) { sum += abs(xdata[i]); @@ -1258,11 +1258,11 @@ realtype N_VL1Norm_Sycl(N_Vector x) } -void N_VCompare_Sycl(realtype c, N_Vector x, N_Vector z) +void N_VCompare_Sycl(sunrealtype c, N_Vector x, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -1282,8 +1282,8 @@ void N_VCompare_Sycl(realtype c, N_Vector x, N_Vector z) booleantype N_VInvTest_Sycl(N_Vector x, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - realtype *zdata = NVEC_SYCL_DDATAp(z); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; @@ -1298,10 +1298,10 @@ booleantype N_VInvTest_Sycl(N_Vector x, N_Vector z) } /* Shortcut to the reduction buffer */ - realtype *sum = NVEC_SYCL_DBUFFERp(x); + sunrealtype *sum = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - sum, ::sycl::plus(), + sum, ::sycl::plus(), GRID_STRIDE_XLOOP(item, i, N) { if (xdata[i] == ZERO) @@ -1326,9 +1326,9 @@ booleantype N_VInvTest_Sycl(N_Vector x, N_Vector z) booleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, N_Vector m) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *cdata = NVEC_SYCL_DDATAp(c); - const realtype *xdata = NVEC_SYCL_DDATAp(x); - realtype *mdata = NVEC_SYCL_DDATAp(m); + const sunrealtype *cdata = NVEC_SYCL_DDATAp(c); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); + sunrealtype *mdata = NVEC_SYCL_DDATAp(m); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; @@ -1343,10 +1343,10 @@ booleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, N_Vector m) } /* Shortcut to the reduction buffer */ - realtype *sum = NVEC_SYCL_DBUFFERp(x); + sunrealtype *sum = NVEC_SYCL_DBUFFERp(x); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - sum, ::sycl::plus(), + sum, ::sycl::plus(), GRID_STRIDE_XLOOP(item, i, N) { bool test = @@ -1365,15 +1365,15 @@ booleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, N_Vector m) } -realtype N_VMinQuotient_Sycl(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Sycl(N_Vector num, N_Vector denom) { const sunindextype N = NVEC_SYCL_LENGTH(num); - const realtype *ndata = NVEC_SYCL_DDATAp(num); - const realtype *ddata = NVEC_SYCL_DDATAp(denom); + const sunrealtype *ndata = NVEC_SYCL_DDATAp(num); + const sunrealtype *ddata = NVEC_SYCL_DDATAp(denom); ::sycl::queue *Q = NVEC_SYCL_QUEUE(num); size_t nthreads_total, nthreads_per_block; - if (InitializeReductionBuffer(num, std::numeric_limits::max())) + if (InitializeReductionBuffer(num, std::numeric_limits::max())) { SUNDIALS_DEBUG_PRINT("ERROR in N_VMinQuotient_Sycl: InitializeReductionBuffer returned nonzero\n"); } @@ -1384,10 +1384,10 @@ realtype N_VMinQuotient_Sycl(N_Vector num, N_Vector denom) } /* Shortcut to the reduction buffer */ - realtype *min = NVEC_SYCL_DBUFFERp(num); + sunrealtype *min = NVEC_SYCL_DBUFFERp(num); SYCL_FOR_REDUCE(Q, nthreads_total, nthreads_per_block, item, - min, ::sycl::minimum(), + min, ::sycl::minimum(), GRID_STRIDE_XLOOP(item, i, N) { if (ddata[i] != ZERO) @@ -1408,16 +1408,16 @@ realtype N_VMinQuotient_Sycl(N_Vector num, N_Vector denom) * -------------------------------------------------------------------------- */ -int N_VLinearCombination_Sycl(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination_Sycl(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); - realtype *zdata = NVEC_SYCL_DDATAp(z); + sunrealtype *zdata = NVEC_SYCL_DDATAp(z); ::sycl::queue *Q = NVEC_SYCL_QUEUE(z); size_t nthreads_total, nthreads_per_block; /* Fused op workspace shortcuts */ - realtype* cdata = NULL; - realtype** xdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; /* Setup the fused op workspace */ if (FusedBuffer_Init(z, nvec, nvec)) @@ -1464,18 +1464,18 @@ int N_VLinearCombination_Sycl(int nvec, realtype* c, N_Vector* X, N_Vector z) } -int N_VScaleAddMulti_Sycl(int nvec, realtype* c, N_Vector x, N_Vector* Y, +int N_VScaleAddMulti_Sycl(int nvec, sunrealtype* c, N_Vector x, N_Vector* Y, N_Vector* Z) { const sunindextype N = NVEC_SYCL_LENGTH(x); - const realtype *xdata = NVEC_SYCL_DDATAp(x); + const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); ::sycl::queue *Q = NVEC_SYCL_QUEUE(x); size_t nthreads_total, nthreads_per_block; /* Shortcuts to the fused op workspace */ - realtype* cdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; /* Setup the fused op workspace */ if (FusedBuffer_Init(x, nvec, 2 * nvec)) @@ -1533,8 +1533,8 @@ int N_VScaleAddMulti_Sycl(int nvec, realtype* c, N_Vector x, N_Vector* Y, int N_VLinearSumVectorArray_Sycl(int nvec, - realtype a, N_Vector* X, - realtype b, N_Vector* Y, + sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { const sunindextype N = NVEC_SYCL_LENGTH(Z[0]); @@ -1542,9 +1542,9 @@ int N_VLinearSumVectorArray_Sycl(int nvec, size_t nthreads_total, nthreads_per_block; /* Shortcuts to the fused op workspace */ - realtype** xdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; /* Setup the fused op workspace */ if (FusedBuffer_Init(Z[0], 0, 3 * nvec)) @@ -1596,16 +1596,16 @@ int N_VLinearSumVectorArray_Sycl(int nvec, } -int N_VScaleVectorArray_Sycl(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray_Sycl(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { const sunindextype N = NVEC_SYCL_LENGTH(Z[0]); ::sycl::queue *Q = NVEC_SYCL_QUEUE(Z[0]); size_t nthreads_total, nthreads_per_block; /* Shortcuts to the fused op workspace arrays */ - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** zdata = NULL; /* Setup the fused op workspace */ if (FusedBuffer_Init(Z[0], nvec, 2 * nvec)) @@ -1657,14 +1657,14 @@ int N_VScaleVectorArray_Sycl(int nvec, realtype* c, N_Vector* X, N_Vector* Z) } -int N_VConstVectorArray_Sycl(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray_Sycl(int nvec, sunrealtype c, N_Vector* Z) { const sunindextype N = NVEC_SYCL_LENGTH(Z[0]); ::sycl::queue *Q = NVEC_SYCL_QUEUE(Z[0]); size_t nthreads_total, nthreads_per_block; /* Shortcuts to the fused op workspace arrays */ - realtype** zdata = NULL; + sunrealtype** zdata = NULL; /* Setup the fused op workspace */ if (FusedBuffer_Init(Z[0], 0, nvec)) @@ -1704,7 +1704,7 @@ int N_VConstVectorArray_Sycl(int nvec, realtype c, N_Vector* Z) } -int N_VScaleAddMultiVectorArray_Sycl(int nvec, int nsum, realtype* c, +int N_VScaleAddMultiVectorArray_Sycl(int nvec, int nsum, sunrealtype* c, N_Vector* X, N_Vector** Y, N_Vector** Z) { const sunindextype N = NVEC_SYCL_LENGTH(X[0]); @@ -1712,10 +1712,10 @@ int N_VScaleAddMultiVectorArray_Sycl(int nvec, int nsum, realtype* c, size_t nthreads_total, nthreads_per_block; /* Shortcuts to the fused op workspace */ - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** ydata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** ydata = NULL; + sunrealtype** zdata = NULL; /* Setup the fused op workspace */ if (FusedBuffer_Init(X[0], nsum, nvec + 2 * nvec * nsum)) @@ -1777,7 +1777,7 @@ int N_VScaleAddMultiVectorArray_Sycl(int nvec, int nsum, realtype* c, } -int N_VLinearCombinationVectorArray_Sycl(int nvec, int nsum, realtype* c, +int N_VLinearCombinationVectorArray_Sycl(int nvec, int nsum, sunrealtype* c, N_Vector** X, N_Vector* Z) { const sunindextype N = NVEC_SYCL_LENGTH(Z[0]); @@ -1785,9 +1785,9 @@ int N_VLinearCombinationVectorArray_Sycl(int nvec, int nsum, realtype* c, size_t nthreads_total, nthreads_per_block; /* Shortcuts to the fused op workspace arrays */ - realtype* cdata = NULL; - realtype** xdata = NULL; - realtype** zdata = NULL; + sunrealtype* cdata = NULL; + sunrealtype** xdata = NULL; + sunrealtype** zdata = NULL; /* Setup the fused op workspace */ if (FusedBuffer_Init(Z[0], nsum, nvec + nvec * nsum)) @@ -2063,12 +2063,12 @@ static int AllocateData(N_Vector v) /* Allocate and initializes the internal memory used for reductions */ -static int InitializeReductionBuffer(N_Vector v, const realtype value, size_t n) +static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t n) { int alloc_fail = 0; int copy_fail = 0; booleantype alloc_mem = SUNFALSE; - size_t bytes = n * sizeof(realtype); + size_t bytes = n * sizeof(sunrealtype); /* Get the vector private memory structure */ N_PrivateVectorContent_Sycl vcp = NVEC_SYCL_PRIVATE(v); @@ -2171,7 +2171,7 @@ static int CopyReductionBufferFromDevice(N_Vector v, size_t n) copy_fail = SUNMemoryHelper_CopyAsync(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_PRIVATE(v)->reduce_buffer_host, NVEC_SYCL_PRIVATE(v)->reduce_buffer_dev, - n * sizeof(realtype), + n * sizeof(sunrealtype), (void*) NVEC_SYCL_QUEUE(v)); if (copy_fail) @@ -2190,7 +2190,7 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) { int alloc_fail = 0; booleantype alloc_mem = SUNFALSE; - size_t bytes = nreal * sizeof(realtype) + nptr * sizeof(realtype*); + size_t bytes = nreal * sizeof(sunrealtype) + nptr * sizeof(sunrealtype*); /* Get the vector private memory structure */ N_PrivateVectorContent_Sycl vcp = NVEC_SYCL_PRIVATE(v); @@ -2244,8 +2244,8 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) } -static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, - realtype **shortcut) +static int FusedBuffer_CopyRealArray(N_Vector v, sunrealtype *rdata, int nval, + sunrealtype **shortcut) { /* Get the vector private memory structure */ N_PrivateVectorContent_Sycl vcp = NVEC_SYCL_PRIVATE(v); @@ -2257,7 +2257,7 @@ static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, return -1; } - realtype* h_buffer = (realtype*) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype* h_buffer = (sunrealtype*) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nval; j++) @@ -2266,17 +2266,17 @@ static int FusedBuffer_CopyRealArray(N_Vector v, realtype *rdata, int nval, } /* Set shortcut to the device buffer and update offset*/ - *shortcut = (realtype*) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype*) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); - vcp->fused_buffer_offset += nval * sizeof(realtype); + vcp->fused_buffer_offset += nval * sizeof(sunrealtype); return 0; } static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, - realtype ***shortcut) + sunrealtype ***shortcut) { /* Get the vector private memory structure */ N_PrivateVectorContent_Sycl vcp = NVEC_SYCL_PRIVATE(v); @@ -2288,7 +2288,7 @@ static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, return -1; } - realtype** h_buffer = (realtype**) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype** h_buffer = (sunrealtype**) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) @@ -2297,17 +2297,17 @@ static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector *X, int nvec, } /* Set shortcut to the device buffer and update offset*/ - *shortcut = (realtype**) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype**) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); - vcp->fused_buffer_offset += nvec * sizeof(realtype*); + vcp->fused_buffer_offset += nvec * sizeof(sunrealtype*); return 0; } static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, - int nsum, realtype ***shortcut) + int nsum, sunrealtype ***shortcut) { /* Get the vector private memory structure */ N_PrivateVectorContent_Sycl vcp = NVEC_SYCL_PRIVATE(v); @@ -2319,7 +2319,7 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, return -1; } - realtype** h_buffer = (realtype**) ((char*)(vcp->fused_buffer_host->ptr) + + sunrealtype** h_buffer = (sunrealtype**) ((char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) @@ -2331,11 +2331,11 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector **X, int nvec, } /* Set shortcut to the device buffer and update offset*/ - *shortcut = (realtype**) ((char*)(vcp->fused_buffer_dev->ptr) + + *shortcut = (sunrealtype**) ((char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); /* Update the offset */ - vcp->fused_buffer_offset += nvec * nsum * sizeof(realtype*); + vcp->fused_buffer_offset += nvec * nsum * sizeof(sunrealtype*); return 0; } diff --git a/src/nvector/trilinos/nvector_trilinos.cpp b/src/nvector/trilinos/nvector_trilinos.cpp index cdcab30b34..7c0dfc8590 100644 --- a/src/nvector/trilinos/nvector_trilinos.cpp +++ b/src/nvector/trilinos/nvector_trilinos.cpp @@ -250,7 +250,7 @@ sunindextype N_VGetLength_Trilinos(N_Vector x) /* * Linear combination of two vectors: z = a*x + b*y */ -void N_VLinearSum_Trilinos(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum_Trilinos(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP yv = N_VGetVector_Trilinos(y); @@ -269,7 +269,7 @@ void N_VLinearSum_Trilinos(realtype a, N_Vector x, realtype b, N_Vector y, N_Vec /* * Set all vector elements to a constant: z[i] = c */ -void N_VConst_Trilinos(realtype c, N_Vector z) +void N_VConst_Trilinos(sunrealtype c, N_Vector z) { Teuchos::RCP zv = N_VGetVector_Trilinos(z); @@ -303,7 +303,7 @@ void N_VDiv_Trilinos(N_Vector x, N_Vector y, N_Vector z) /* * Scale vector: z = c*x */ -void N_VScale_Trilinos(realtype c, N_Vector x, N_Vector z) +void N_VScale_Trilinos(sunrealtype c, N_Vector x, N_Vector z) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP zv = N_VGetVector_Trilinos(z); @@ -336,7 +336,7 @@ void N_VInv_Trilinos(N_Vector x, N_Vector z) /* * Add constant: z = x + b */ -void N_VAddConst_Trilinos(N_Vector x, realtype b, N_Vector z) +void N_VAddConst_Trilinos(N_Vector x, sunrealtype b, N_Vector z) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP zv = N_VGetVector_Trilinos(z); @@ -347,7 +347,7 @@ void N_VAddConst_Trilinos(N_Vector x, realtype b, N_Vector z) /* * Scalar product of vectors x and y */ -realtype N_VDotProd_Trilinos(N_Vector x, N_Vector y) +sunrealtype N_VDotProd_Trilinos(N_Vector x, N_Vector y) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP yv = N_VGetVector_Trilinos(y); @@ -358,7 +358,7 @@ realtype N_VDotProd_Trilinos(N_Vector x, N_Vector y) /* * Max norm (L infinity) of vector x */ -realtype N_VMaxNorm_Trilinos(N_Vector x) +sunrealtype N_VMaxNorm_Trilinos(N_Vector x) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); @@ -368,7 +368,7 @@ realtype N_VMaxNorm_Trilinos(N_Vector x) /* * Weighted RMS norm */ -realtype N_VWrmsNorm_Trilinos(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_Trilinos(N_Vector x, N_Vector w) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP wv = N_VGetVector_Trilinos(w); @@ -379,7 +379,7 @@ realtype N_VWrmsNorm_Trilinos(N_Vector x, N_Vector w) /* * Masked weighted RMS norm */ -realtype N_VWrmsNormMask_Trilinos(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_Trilinos(N_Vector x, N_Vector w, N_Vector id) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP wv = N_VGetVector_Trilinos(w); @@ -391,7 +391,7 @@ realtype N_VWrmsNormMask_Trilinos(N_Vector x, N_Vector w, N_Vector id) /* * Returns minimum vector element */ -realtype N_VMin_Trilinos(N_Vector x) +sunrealtype N_VMin_Trilinos(N_Vector x) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); @@ -401,7 +401,7 @@ realtype N_VMin_Trilinos(N_Vector x) /* * Weighted L2 norm */ -realtype N_VWL2Norm_Trilinos(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_Trilinos(N_Vector x, N_Vector w) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP wv = N_VGetVector_Trilinos(w); @@ -412,7 +412,7 @@ realtype N_VWL2Norm_Trilinos(N_Vector x, N_Vector w) /* * L1 norm */ -realtype N_VL1Norm_Trilinos(N_Vector x) +sunrealtype N_VL1Norm_Trilinos(N_Vector x) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); @@ -422,7 +422,7 @@ realtype N_VL1Norm_Trilinos(N_Vector x) /* * Elementwise z[i] = |x[i]| >= c ? 1 : 0 */ -void N_VCompare_Trilinos(realtype c, N_Vector x, N_Vector z) +void N_VCompare_Trilinos(sunrealtype c, N_Vector x, N_Vector z) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP zv = N_VGetVector_Trilinos(z); @@ -457,7 +457,7 @@ booleantype N_VConstrMask_Trilinos(N_Vector c, N_Vector x, N_Vector m) /* * Find minimum quotient: minq = min ( num[i]/denom[i]), denom[i] != 0. */ -realtype N_VMinQuotient_Trilinos(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_Trilinos(N_Vector num, N_Vector denom) { Teuchos::RCP numv = N_VGetVector_Trilinos(num); Teuchos::RCP denv = N_VGetVector_Trilinos(denom); @@ -468,7 +468,7 @@ realtype N_VMinQuotient_Trilinos(N_Vector num, N_Vector denom) /* * MPI task-local dot product */ -realtype N_VDotProdLocal_Trilinos(N_Vector x, N_Vector y) +sunrealtype N_VDotProdLocal_Trilinos(N_Vector x, N_Vector y) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP yv = N_VGetVector_Trilinos(y); @@ -479,7 +479,7 @@ realtype N_VDotProdLocal_Trilinos(N_Vector x, N_Vector y) /* * MPI task-local maximum norm */ -realtype N_VMaxNormLocal_Trilinos(N_Vector x) +sunrealtype N_VMaxNormLocal_Trilinos(N_Vector x) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); @@ -489,7 +489,7 @@ realtype N_VMaxNormLocal_Trilinos(N_Vector x) /* * MPI task-local minimum element */ -realtype N_VMinLocal_Trilinos(N_Vector x) +sunrealtype N_VMinLocal_Trilinos(N_Vector x) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); @@ -499,7 +499,7 @@ realtype N_VMinLocal_Trilinos(N_Vector x) /* * MPI task-local L1 norm */ -realtype N_VL1NormLocal_Trilinos(N_Vector x) +sunrealtype N_VL1NormLocal_Trilinos(N_Vector x) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); @@ -509,7 +509,7 @@ realtype N_VL1NormLocal_Trilinos(N_Vector x) /* * MPI task-local weighted squared sum */ -realtype N_VWSqrSumLocal_Trilinos(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal_Trilinos(N_Vector x, N_Vector w) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP wv = N_VGetVector_Trilinos(w); @@ -520,7 +520,7 @@ realtype N_VWSqrSumLocal_Trilinos(N_Vector x, N_Vector w) /* * MPI task-local weighted masked squared sum */ -realtype N_VWSqrSumMaskLocal_Trilinos(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal_Trilinos(N_Vector x, N_Vector w, N_Vector id) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP wv = N_VGetVector_Trilinos(w); @@ -556,7 +556,7 @@ booleantype N_VConstrMaskLocal_Trilinos(N_Vector c, N_Vector x, N_Vector m) /* * MPI task-local minimum quotient: minq = min ( num[i]/denom[i]), denom[i] != 0. */ -realtype N_VMinQuotientLocal_Trilinos(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotientLocal_Trilinos(N_Vector num, N_Vector denom) { Teuchos::RCP numv = N_VGetVector_Trilinos(num); Teuchos::RCP denv = N_VGetVector_Trilinos(denom); diff --git a/src/sundials/fmod/fsundials_linearsolver_mod.c b/src/sundials/fmod/fsundials_linearsolver_mod.c index c755ea1949..aaf21e5143 100644 --- a/src/sundials/fmod/fsundials_linearsolver_mod.c +++ b/src/sundials/fmod/fsundials_linearsolver_mod.c @@ -194,17 +194,17 @@ SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; int arg3 ; int arg4 ; - realtype *arg5 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); + arg2 = (sunrealtype **)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); + arg5 = (sunrealtype *)(farg5); result = (int)SUNModifiedGS(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -214,17 +214,17 @@ SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, SWIGEXPORT int _wrap_FModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; int arg3 ; int arg4 ; - realtype *arg5 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); + arg2 = (sunrealtype **)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); + arg5 = (sunrealtype *)(farg5); result = (int)ModifiedGS(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -234,20 +234,20 @@ SWIGEXPORT int _wrap_FModifiedGS(void *farg1, void *farg2, int const *farg3, int SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; int arg3 ; int arg4 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; N_Vector *arg7 = (N_Vector *) 0 ; int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); + arg2 = (sunrealtype **)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); arg7 = (N_Vector *)(farg7); result = (int)SUNClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = (int)(result); @@ -258,20 +258,20 @@ SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, SWIGEXPORT int _wrap_FClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; int arg3 ; int arg4 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; N_Vector *arg7 = (N_Vector *) 0 ; int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); + arg2 = (sunrealtype **)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); arg7 = (N_Vector *)(farg7); result = (int)ClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = (int)(result); @@ -282,14 +282,14 @@ SWIGEXPORT int _wrap_FClassicalGS(void *farg1, void *farg2, int const *farg3, in SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { int fresult ; int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int arg4 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype **)(farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (int)(*farg4); result = (int)SUNQRfact(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -300,14 +300,14 @@ SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, in SWIGEXPORT int _wrap_FQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { int fresult ; int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int arg4 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); + arg2 = (sunrealtype **)(farg2); + arg3 = (sunrealtype *)(farg3); arg4 = (int)(*farg4); result = (int)QRfact(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -318,15 +318,15 @@ SWIGEXPORT int _wrap_FQRfact(int const *farg1, void *farg2, double *farg3, int c SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { int fresult ; int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (realtype *)(farg4); + arg2 = (sunrealtype **)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); result = (int)SUNQRsol(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -336,15 +336,15 @@ SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, dou SWIGEXPORT int _wrap_FQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { int fresult ; int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (realtype *)(farg4); + arg2 = (sunrealtype **)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); result = (int)QRsol(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -354,7 +354,7 @@ SWIGEXPORT int _wrap_FQRsol(int const *farg1, void *farg2, double *farg3, double SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; @@ -362,7 +362,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, i int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -376,7 +376,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, i SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; @@ -384,7 +384,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -398,7 +398,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; @@ -406,7 +406,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -420,7 +420,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; @@ -428,7 +428,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -442,7 +442,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; @@ -450,7 +450,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -464,7 +464,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; @@ -472,7 +472,7 @@ SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2_SB(void *farg1, double *farg2, N_Vector far int result; arg1 = (N_Vector *)(farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -623,14 +623,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve(SUNLinearSolver farg1, SUNMatrix farg2, N_V SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -652,11 +652,11 @@ SWIGEXPORT int _wrap_FSUNLinSolNumIters(SUNLinearSolver farg1) { SWIGEXPORT double _wrap_FSUNLinSolResNorm(SUNLinearSolver farg1) { double fresult ; SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - realtype result; + sunrealtype result; arg1 = (SUNLinearSolver)(farg1); - result = (realtype)SUNLinSolResNorm(arg1); - fresult = (realtype)(result); + result = (sunrealtype)SUNLinSolResNorm(arg1); + fresult = (sunrealtype)(result); return fresult; } diff --git a/src/sundials/fmod/fsundials_matrix_mod.c b/src/sundials/fmod/fsundials_matrix_mod.c index 1376f3fe58..279e17bf31 100644 --- a/src/sundials/fmod/fsundials_matrix_mod.c +++ b/src/sundials/fmod/fsundials_matrix_mod.c @@ -284,12 +284,12 @@ SWIGEXPORT int _wrap_FSUNMatCopy(SUNMatrix farg1, SUNMatrix farg2) { SWIGEXPORT int _wrap_FSUNMatScaleAdd(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; SUNMatrix arg3 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); arg3 = (SUNMatrix)(farg3); result = (int)SUNMatScaleAdd(arg1,arg2,arg3); @@ -300,11 +300,11 @@ SWIGEXPORT int _wrap_FSUNMatScaleAdd(double const *farg1, SUNMatrix farg2, SUNMa SWIGEXPORT int _wrap_FSUNMatScaleAddI(double const *farg1, SUNMatrix farg2) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); result = (int)SUNMatScaleAddI(arg1,arg2); fresult = (int)(result); diff --git a/src/sundials/fmod/fsundials_nonlinearsolver_mod.c b/src/sundials/fmod/fsundials_nonlinearsolver_mod.c index 6f0d545336..de0f8abcf8 100644 --- a/src/sundials/fmod/fsundials_nonlinearsolver_mod.c +++ b/src/sundials/fmod/fsundials_nonlinearsolver_mod.c @@ -256,7 +256,7 @@ SWIGEXPORT int _wrap_FSUNNonlinSolSolve(SUNNonlinearSolver farg1, N_Vector farg2 N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int arg6 ; void *arg7 = (void *) 0 ; int result; @@ -265,7 +265,7 @@ SWIGEXPORT int _wrap_FSUNNonlinSolSolve(SUNNonlinearSolver farg1, N_Vector farg2 arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); arg6 = (int)(*farg6); arg7 = (void *)(farg7); result = (int)SUNNonlinSolSolve(arg1,arg2,arg3,arg4,arg5,arg6,arg7); diff --git a/src/sundials/fmod/fsundials_nvector_mod.c b/src/sundials/fmod/fsundials_nvector_mod.c index b653ff48ea..3cc84776ff 100644 --- a/src/sundials/fmod/fsundials_nvector_mod.c +++ b/src/sundials/fmod/fsundials_nvector_mod.c @@ -281,10 +281,10 @@ SWIGEXPORT void _wrap_FN_VSpace(N_Vector farg1, int64_t *farg2, int64_t *farg3) SWIGEXPORT void _wrap_FN_VSetArrayPointer(double *farg1, N_Vector farg2) { - realtype *arg1 = (realtype *) 0 ; + sunrealtype *arg1 = (sunrealtype *) 0 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (realtype *)(farg1); + arg1 = (sunrealtype *)(farg1); arg2 = (N_Vector)(farg2); N_VSetArrayPointer(arg1,arg2); } @@ -327,15 +327,15 @@ SWIGEXPORT int64_t _wrap_FN_VGetLocalLength(N_Vector farg1) { SWIGEXPORT void _wrap_FN_VLinearSum(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - realtype arg3 ; + sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype)(*farg3); + arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); N_VLinearSum(arg1,arg2,arg3,arg4,arg5); @@ -343,10 +343,10 @@ SWIGEXPORT void _wrap_FN_VLinearSum(double const *farg1, N_Vector farg2, double SWIGEXPORT void _wrap_FN_VConst(double const *farg1, N_Vector farg2) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); N_VConst(arg1,arg2); } @@ -377,11 +377,11 @@ SWIGEXPORT void _wrap_FN_VDiv(N_Vector farg1, N_Vector farg2, N_Vector farg3) { SWIGEXPORT void _wrap_FN_VScale(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VScale(arg1,arg2,arg3); @@ -410,11 +410,11 @@ SWIGEXPORT void _wrap_FN_VInv(N_Vector farg1, N_Vector farg2) { SWIGEXPORT void _wrap_FN_VAddConst(N_Vector farg1, double const *farg2, N_Vector farg3) { N_Vector arg1 = (N_Vector) 0 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector arg3 = (N_Vector) 0 ; arg1 = (N_Vector)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector)(farg3); N_VAddConst(arg1,arg2,arg3); } @@ -424,12 +424,12 @@ SWIGEXPORT double _wrap_FN_VDotProd(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VDotProd(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VDotProd(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -437,11 +437,11 @@ SWIGEXPORT double _wrap_FN_VDotProd(N_Vector farg1, N_Vector farg2) { SWIGEXPORT double _wrap_FN_VMaxNorm(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMaxNorm(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMaxNorm(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -450,12 +450,12 @@ SWIGEXPORT double _wrap_FN_VWrmsNorm(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWrmsNorm(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNorm(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -465,13 +465,13 @@ SWIGEXPORT double _wrap_FN_VWrmsNormMask(N_Vector farg1, N_Vector farg2, N_Vecto N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWrmsNormMask(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWrmsNormMask(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -479,11 +479,11 @@ SWIGEXPORT double _wrap_FN_VWrmsNormMask(N_Vector farg1, N_Vector farg2, N_Vecto SWIGEXPORT double _wrap_FN_VMin(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMin(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMin(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -492,12 +492,12 @@ SWIGEXPORT double _wrap_FN_VWL2Norm(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWL2Norm(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWL2Norm(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -505,21 +505,21 @@ SWIGEXPORT double _wrap_FN_VWL2Norm(N_Vector farg1, N_Vector farg2) { SWIGEXPORT double _wrap_FN_VL1Norm(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VL1Norm(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VL1Norm(arg1); + fresult = (sunrealtype)(result); return fresult; } SWIGEXPORT void _wrap_FN_VCompare(double const *farg1, N_Vector farg2, N_Vector farg3) { - realtype arg1 ; + sunrealtype arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); N_VCompare(arg1,arg2,arg3); @@ -560,12 +560,12 @@ SWIGEXPORT double _wrap_FN_VMinQuotient(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VMinQuotient(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinQuotient(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -573,13 +573,13 @@ SWIGEXPORT double _wrap_FN_VMinQuotient(N_Vector farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FN_VLinearCombination(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); result = (int)N_VLinearCombination(arg1,arg2,arg3,arg4); @@ -591,14 +591,14 @@ SWIGEXPORT int _wrap_FN_VLinearCombination(int const *farg1, double *farg2, void SWIGEXPORT int _wrap_FN_VScaleAddMulti(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; N_Vector *arg5 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector *)(farg4); arg5 = (N_Vector *)(farg5); @@ -613,13 +613,13 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti(int const *farg1, N_Vector farg2, void *fa int arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VDotProdMulti(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -629,17 +629,17 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti(int const *farg1, N_Vector farg2, void *fa SWIGEXPORT int _wrap_FN_VLinearSumVectorArray(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype arg4 ; + sunrealtype arg4 ; N_Vector *arg5 = (N_Vector *) 0 ; N_Vector *arg6 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype)(*farg4); + arg4 = (sunrealtype)(*farg4); arg5 = (N_Vector *)(farg5); arg6 = (N_Vector *)(farg6); result = (int)N_VLinearSumVectorArray(arg1,arg2,arg3,arg4,arg5,arg6); @@ -651,13 +651,13 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray(int const *farg1, double const *fa SWIGEXPORT int _wrap_FN_VScaleVectorArray(int const *farg1, double *farg2, void *farg3, void *farg4) { int fresult ; int arg1 ; - realtype *arg2 = (realtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector *arg4 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype *)(farg2); + arg2 = (sunrealtype *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector *)(farg4); result = (int)N_VScaleVectorArray(arg1,arg2,arg3,arg4); @@ -669,12 +669,12 @@ SWIGEXPORT int _wrap_FN_VScaleVectorArray(int const *farg1, double *farg2, void SWIGEXPORT int _wrap_FN_VConstVectorArray(int const *farg1, double const *farg2, void *farg3) { int fresult ; int arg1 ; - realtype arg2 ; + sunrealtype arg2 ; N_Vector *arg3 = (N_Vector *) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (N_Vector *)(farg3); result = (int)N_VConstVectorArray(arg1,arg2,arg3); fresult = (int)(result); @@ -687,13 +687,13 @@ SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray(int const *farg1, void *farg2, void int arg1 ; N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VWrmsNormVectorArray(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -706,14 +706,14 @@ SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray(int const *farg1, void *farg2, N_Vector *arg2 = (N_Vector *) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype *arg5 = (realtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector *)(farg2); arg3 = (N_Vector *)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype *)(farg5); + arg5 = (sunrealtype *)(farg5); result = (int)N_VWrmsNormMaskVectorArray(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -724,12 +724,12 @@ SWIGEXPORT double _wrap_FN_VDotProdLocal(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VDotProdLocal(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VDotProdLocal(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -737,11 +737,11 @@ SWIGEXPORT double _wrap_FN_VDotProdLocal(N_Vector farg1, N_Vector farg2) { SWIGEXPORT double _wrap_FN_VMaxNormLocal(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMaxNormLocal(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMaxNormLocal(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -749,11 +749,11 @@ SWIGEXPORT double _wrap_FN_VMaxNormLocal(N_Vector farg1) { SWIGEXPORT double _wrap_FN_VMinLocal(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VMinLocal(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinLocal(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -761,11 +761,11 @@ SWIGEXPORT double _wrap_FN_VMinLocal(N_Vector farg1) { SWIGEXPORT double _wrap_FN_VL1NormLocal(N_Vector farg1) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); - result = (realtype)N_VL1NormLocal(arg1); - fresult = (realtype)(result); + result = (sunrealtype)N_VL1NormLocal(arg1); + fresult = (sunrealtype)(result); return fresult; } @@ -774,12 +774,12 @@ SWIGEXPORT double _wrap_FN_VWSqrSumLocal(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VWSqrSumLocal(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumLocal(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -789,13 +789,13 @@ SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal(N_Vector farg1, N_Vector farg2, N_V N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); - result = (realtype)N_VWSqrSumMaskLocal(arg1,arg2,arg3); - fresult = (realtype)(result); + result = (sunrealtype)N_VWSqrSumMaskLocal(arg1,arg2,arg3); + fresult = (sunrealtype)(result); return fresult; } @@ -834,12 +834,12 @@ SWIGEXPORT double _wrap_FN_VMinQuotientLocal(N_Vector farg1, N_Vector farg2) { double fresult ; N_Vector arg1 = (N_Vector) 0 ; N_Vector arg2 = (N_Vector) 0 ; - realtype result; + sunrealtype result; arg1 = (N_Vector)(farg1); arg2 = (N_Vector)(farg2); - result = (realtype)N_VMinQuotientLocal(arg1,arg2); - fresult = (realtype)(result); + result = (sunrealtype)N_VMinQuotientLocal(arg1,arg2); + fresult = (sunrealtype)(result); return fresult; } @@ -849,13 +849,13 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiLocal(int const *farg1, N_Vector farg2, voi int arg1 ; N_Vector arg2 = (N_Vector) 0 ; N_Vector *arg3 = (N_Vector *) 0 ; - realtype *arg4 = (realtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); arg3 = (N_Vector *)(farg3); - arg4 = (realtype *)(farg4); + arg4 = (sunrealtype *)(farg4); result = (int)N_VDotProdMultiLocal(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -866,12 +866,12 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce(int const *farg1, N_Vector farg2, int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - realtype *arg3 = (realtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; int result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (realtype *)(farg3); + arg3 = (sunrealtype *)(farg3); result = (int)N_VDotProdMultiAllReduce(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1018,10 +1018,10 @@ SWIGEXPORT void _wrap_FN_VPrintFile(N_Vector farg1, void *farg2) { SWIGEXPORT double * _wrap_FN_VGetArrayPointer(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer(arg1); + result = (sunrealtype *)N_VGetArrayPointer(arg1); fresult = result; return fresult; } @@ -1030,10 +1030,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer(N_Vector farg1) { SWIGEXPORT double * _wrap_FN_VGetDeviceArrayPointer(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetDeviceArrayPointer(arg1); + result = (sunrealtype *)N_VGetDeviceArrayPointer(arg1); fresult = result; return fresult; } diff --git a/src/sundials/sundials_band.c b/src/sundials/sundials_band.c index e874e5f575..9451e05700 100644 --- a/src/sundials/sundials_band.c +++ b/src/sundials/sundials_band.c @@ -47,12 +47,12 @@ sunindextype BandGBTRF(SUNDlsMat A, sunindextype *p) return(SUNDlsMat_bandGBTRF(A->cols, A->M, A->mu, A->ml, A->s_mu, p)); } -void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype *p, realtype *b) +void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype *p, sunrealtype *b) { SUNDlsMat_bandGBTRS(A->cols, A->M, A->s_mu, A->ml, p, b); } -void BandGBTRS(SUNDlsMat A, sunindextype *p, realtype *b) +void BandGBTRS(SUNDlsMat A, sunindextype *p, sunrealtype *b) { SUNDlsMat_bandGBTRS(A->cols, A->M, A->s_mu, A->ml, p, b); } @@ -67,43 +67,43 @@ void BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml SUNDlsMat_bandCopy(A->cols, B->cols, A->M, A->s_mu, B->s_mu, copymu, copyml); } -void SUNDlsMat_BandScale(realtype c, SUNDlsMat A) +void SUNDlsMat_BandScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_bandScale(c, A->cols, A->M, A->mu, A->ml, A->s_mu); } -void BandScale(realtype c, SUNDlsMat A) +void BandScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_bandScale(c, A->cols, A->M, A->mu, A->ml, A->s_mu); } -void SUNDlsMat_BandMatvec(SUNDlsMat A, realtype *x, realtype *y) +void SUNDlsMat_BandMatvec(SUNDlsMat A, sunrealtype *x, sunrealtype *y) { SUNDlsMat_bandMatvec(A->cols, x, y, A->M, A->mu, A->ml, A->s_mu); } -void BandMatvec(SUNDlsMat A, realtype *x, realtype *y) +void BandMatvec(SUNDlsMat A, sunrealtype *x, sunrealtype *y) { SUNDlsMat_bandMatvec(A->cols, x, y, A->M, A->mu, A->ml, A->s_mu); } /* * ----------------------------------------------------- - * Functions working on realtype** + * Functions working on sunrealtype** * ----------------------------------------------------- */ -sunindextype bandGBTRF(realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype *p) +sunindextype bandGBTRF(sunrealtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype *p) { return(SUNDlsMat_bandGBTRF(a, n, mu, ml, smu, p)); } -sunindextype SUNDlsMat_bandGBTRF(realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype *p) +sunindextype SUNDlsMat_bandGBTRF(sunrealtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype *p) { sunindextype c, r, num_rows; sunindextype i, j, k, l, storage_l, storage_k, last_col_k, last_row_k; - realtype *a_c, *col_k, *diag_k, *sub_diag_k, *col_j, *kptr, *jptr; - realtype max, temp, mult, a_kj; + sunrealtype *a_c, *col_k, *diag_k, *sub_diag_k, *col_j, *kptr, *jptr; + sunrealtype max, temp, mult, a_kj; booleantype swap; /* zero out the first smu - mu rows of the rectangular array a */ @@ -204,16 +204,16 @@ sunindextype SUNDlsMat_bandGBTRF(realtype **a, sunindextype n, sunindextype mu, return(0); } -void bandGBTRS(realtype **a, sunindextype n, sunindextype smu, - sunindextype ml, sunindextype *p, realtype *b) +void bandGBTRS(sunrealtype **a, sunindextype n, sunindextype smu, + sunindextype ml, sunindextype *p, sunrealtype *b) { SUNDlsMat_bandGBTRS(a, n, smu, ml, p, b); } -void SUNDlsMat_bandGBTRS(realtype **a, sunindextype n, sunindextype smu, sunindextype ml, sunindextype *p, realtype *b) +void SUNDlsMat_bandGBTRS(sunrealtype **a, sunindextype n, sunindextype smu, sunindextype ml, sunindextype *p, sunrealtype *b) { sunindextype k, l, i, first_row_k, last_row_k; - realtype mult, *diag_k; + sunrealtype mult, *diag_k; /* Solve Ly = Pb, store solution y in b */ @@ -242,17 +242,17 @@ void SUNDlsMat_bandGBTRS(realtype **a, sunindextype n, sunindextype smu, suninde } } -void bandCopy(realtype **a, realtype **b, sunindextype n, sunindextype a_smu, sunindextype b_smu, +void bandCopy(sunrealtype **a, sunrealtype **b, sunindextype n, sunindextype a_smu, sunindextype b_smu, sunindextype copymu, sunindextype copyml) { SUNDlsMat_bandCopy(a, b, n, a_smu, b_smu, copymu, copyml); } -void SUNDlsMat_bandCopy(realtype **a, realtype **b, sunindextype n, sunindextype a_smu, sunindextype b_smu, +void SUNDlsMat_bandCopy(sunrealtype **a, sunrealtype **b, sunindextype n, sunindextype a_smu, sunindextype b_smu, sunindextype copymu, sunindextype copyml) { sunindextype i, j, copySize; - realtype *a_col_j, *b_col_j; + sunrealtype *a_col_j, *b_col_j; copySize = copymu + copyml + 1; @@ -264,15 +264,15 @@ void SUNDlsMat_bandCopy(realtype **a, realtype **b, sunindextype n, sunindextype } } -void bandScale(realtype c, realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) +void bandScale(sunrealtype c, sunrealtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) { SUNDlsMat_bandScale(c, a, n, mu, ml, smu); } -void SUNDlsMat_bandScale(realtype c, realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) +void SUNDlsMat_bandScale(sunrealtype c, sunrealtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) { sunindextype i, j, colSize; - realtype *col_j; + sunrealtype *col_j; colSize = mu + ml + 1; @@ -283,12 +283,12 @@ void SUNDlsMat_bandScale(realtype c, realtype **a, sunindextype n, sunindextype } } -void bandAddIdentity(realtype **a, sunindextype n, sunindextype smu) +void bandAddIdentity(sunrealtype **a, sunindextype n, sunindextype smu) { SUNDlsMat_bandAddIdentity(a, n, smu); } -void SUNDlsMat_bandAddIdentity(realtype **a, sunindextype n, sunindextype smu) +void SUNDlsMat_bandAddIdentity(sunrealtype **a, sunindextype n, sunindextype smu) { sunindextype j; @@ -296,17 +296,17 @@ void SUNDlsMat_bandAddIdentity(realtype **a, sunindextype n, sunindextype smu) a[j][smu] += ONE; } -void bandMatvec(realtype **a, realtype *x, realtype *y, sunindextype n, +void bandMatvec(sunrealtype **a, sunrealtype *x, sunrealtype *y, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) { SUNDlsMat_bandMatvec(a, x, y, n, mu, ml, smu); } -void SUNDlsMat_bandMatvec(realtype **a, realtype *x, realtype *y, sunindextype n, +void SUNDlsMat_bandMatvec(sunrealtype **a, sunrealtype *x, sunrealtype *y, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) { sunindextype i, j, is, ie; - realtype *col_j; + sunrealtype *col_j; for (i=0; icols, A->M, A->N, p)); } -void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype *p, realtype *b) +void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype *p, sunrealtype *b) { SUNDlsMat_denseGETRS(A->cols, A->N, p, b); } -void DenseGETRS(SUNDlsMat A, sunindextype *p, realtype *b) +void DenseGETRS(SUNDlsMat A, sunindextype *p, sunrealtype *b) { SUNDlsMat_denseGETRS(A->cols, A->N, p, b); } @@ -67,32 +67,32 @@ sunindextype DensePOTRF(SUNDlsMat A) return(SUNDlsMat_densePOTRF(A->cols, A->M)); } -void SUNDlsMat_DensePOTRS(SUNDlsMat A, realtype *b) +void SUNDlsMat_DensePOTRS(SUNDlsMat A, sunrealtype *b) { SUNDlsMat_densePOTRS(A->cols, A->M, b); } -void DensePOTRS(SUNDlsMat A, realtype *b) +void DensePOTRS(SUNDlsMat A, sunrealtype *b) { SUNDlsMat_densePOTRS(A->cols, A->M, b); } -int SUNDlsMat_DenseGEQRF(SUNDlsMat A, realtype *beta, realtype *wrk) +int SUNDlsMat_DenseGEQRF(SUNDlsMat A, sunrealtype *beta, sunrealtype *wrk) { return(SUNDlsMat_denseGEQRF(A->cols, A->M, A->N, beta, wrk)); } -int DenseGEQRF(SUNDlsMat A, realtype *beta, realtype *wrk) +int DenseGEQRF(SUNDlsMat A, sunrealtype *beta, sunrealtype *wrk) { return(SUNDlsMat_denseGEQRF(A->cols, A->M, A->N, beta, wrk)); } -int SUNDlsMat_DenseORMQR(SUNDlsMat A, realtype *beta, realtype *vn, realtype *vm, realtype *wrk) +int SUNDlsMat_DenseORMQR(SUNDlsMat A, sunrealtype *beta, sunrealtype *vn, sunrealtype *vm, sunrealtype *wrk) { return(SUNDlsMat_denseORMQR(A->cols, A->M, A->N, beta, vn, vm, wrk)); } -int DenseORMQR(SUNDlsMat A, realtype *beta, realtype *vn, realtype *vm, realtype *wrk) +int DenseORMQR(SUNDlsMat A, sunrealtype *beta, sunrealtype *vn, sunrealtype *vm, sunrealtype *wrk) { return(SUNDlsMat_denseORMQR(A->cols, A->M, A->N, beta, vn, vm, wrk)); } @@ -107,36 +107,36 @@ void DenseCopy(SUNDlsMat A, SUNDlsMat B) SUNDlsMat_denseCopy(A->cols, B->cols, A->M, A->N); } -void SUNDlsMat_DenseScale(realtype c, SUNDlsMat A) +void SUNDlsMat_DenseScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_denseScale(c, A->cols, A->M, A->N); } -void DenseScale(realtype c, SUNDlsMat A) +void DenseScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_denseScale(c, A->cols, A->M, A->N); } -void SUNDlsMat_DenseMatvec(SUNDlsMat A, realtype *x, realtype *y) +void SUNDlsMat_DenseMatvec(SUNDlsMat A, sunrealtype *x, sunrealtype *y) { SUNDlsMat_denseMatvec(A->cols, x, y, A->M, A->N); } -void DenseMatvec(SUNDlsMat A, realtype *x, realtype *y) +void DenseMatvec(SUNDlsMat A, sunrealtype *x, sunrealtype *y) { SUNDlsMat_denseMatvec(A->cols, x, y, A->M, A->N); } -sunindextype denseGETRF(realtype **a, sunindextype m, sunindextype n, sunindextype *p) +sunindextype denseGETRF(sunrealtype **a, sunindextype m, sunindextype n, sunindextype *p) { return(SUNDlsMat_denseGETRF(a, m, n, p)); } -sunindextype SUNDlsMat_denseGETRF(realtype **a, sunindextype m, sunindextype n, sunindextype *p) +sunindextype SUNDlsMat_denseGETRF(sunrealtype **a, sunindextype m, sunindextype n, sunindextype *p) { sunindextype i, j, k, l; - realtype *col_j, *col_k; - realtype temp, mult, a_kj; + sunrealtype *col_j, *col_k; + sunrealtype temp, mult, a_kj; /* k-th elimination step number */ for (k=0; k < n; k++) { @@ -195,15 +195,15 @@ sunindextype SUNDlsMat_denseGETRF(realtype **a, sunindextype m, sunindextype n, return(0); } -void denseGETRS(realtype **a, sunindextype n, sunindextype *p, realtype *b) +void denseGETRS(sunrealtype **a, sunindextype n, sunindextype *p, sunrealtype *b) { SUNDlsMat_denseGETRS(a, n, p, b); } -void SUNDlsMat_denseGETRS(realtype **a, sunindextype n, sunindextype *p, realtype *b) +void SUNDlsMat_denseGETRS(sunrealtype **a, sunindextype n, sunindextype *p, sunrealtype *b) { sunindextype i, k, pk; - realtype *col_k, tmp; + sunrealtype *col_k, tmp; /* Permute b, based on pivot information in p */ for (k=0; kdata = (realtype *) malloc(M * N * sizeof(realtype)); + A->data = (sunrealtype *) malloc(M * N * sizeof(sunrealtype)); if (A->data == NULL) { free(A); A = NULL; return(NULL); } - A->cols = (realtype **) malloc(N * sizeof(realtype *)); + A->cols = (sunrealtype **) malloc(N * sizeof(sunrealtype *)); if (A->cols == NULL) { free(A->data); A->data = NULL; free(A); A = NULL; @@ -64,24 +64,24 @@ SUNDlsMat SUNDlsMat_NewDenseMat(sunindextype M, sunindextype N) return(A); } -realtype** newDenseMat(sunindextype m, sunindextype n) +sunrealtype** newDenseMat(sunindextype m, sunindextype n) { return(SUNDlsMat_newDenseMat(m, n)); } -realtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n) +sunrealtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n) { sunindextype j; - realtype **a; + sunrealtype **a; if ( (n <= 0) || (m <= 0) ) return(NULL); a = NULL; - a = (realtype **) malloc(n * sizeof(realtype *)); + a = (sunrealtype **) malloc(n * sizeof(sunrealtype *)); if (a == NULL) return(NULL); a[0] = NULL; - a[0] = (realtype *) malloc(m * n * sizeof(realtype)); + a[0] = (sunrealtype *) malloc(m * n * sizeof(sunrealtype)); if (a[0] == NULL) { free(a); a = NULL; return(NULL); @@ -111,14 +111,14 @@ SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, colSize = smu + ml + 1; A->data = NULL; - A->data = (realtype *) malloc(N * colSize * sizeof(realtype)); + A->data = (sunrealtype *) malloc(N * colSize * sizeof(sunrealtype)); if (A->data == NULL) { free(A); A = NULL; return(NULL); } A->cols = NULL; - A->cols = (realtype **) malloc(N * sizeof(realtype *)); + A->cols = (sunrealtype **) malloc(N * sizeof(sunrealtype *)); if (A->cols == NULL) { free(A->data); free(A); A = NULL; @@ -140,25 +140,25 @@ SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, return(A); } -realtype** newBandMat(sunindextype n, sunindextype smu, sunindextype ml) +sunrealtype** newBandMat(sunindextype n, sunindextype smu, sunindextype ml) { return(SUNDlsMat_newBandMat(n, smu, ml)); } -realtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, sunindextype ml) +sunrealtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, sunindextype ml) { - realtype **a; + sunrealtype **a; sunindextype j, colSize; if (n <= 0) return(NULL); a = NULL; - a = (realtype **) malloc(n * sizeof(realtype *)); + a = (sunrealtype **) malloc(n * sizeof(sunrealtype *)); if (a == NULL) return(NULL); colSize = smu + ml + 1; a[0] = NULL; - a[0] = (realtype *) malloc(n * colSize * sizeof(realtype)); + a[0] = (sunrealtype *) malloc(n * colSize * sizeof(sunrealtype)); if (a[0] == NULL) { free(a); a = NULL; return(NULL); @@ -181,12 +181,12 @@ void SUNDlsMat_DestroyMat(SUNDlsMat A) free(A); A = NULL; } -void destroyMat(realtype **a) +void destroyMat(sunrealtype **a) { SUNDlsMat_destroyMat(a); } -void SUNDlsMat_destroyMat(realtype **a) +void SUNDlsMat_destroyMat(sunrealtype **a) { free(a[0]); a[0] = NULL; free(a); a = NULL; @@ -260,36 +260,36 @@ sunindextype* SUNDlsMat_newIndexArray(sunindextype n) return(v); } -realtype* NewRealArray(sunindextype N) +sunrealtype* NewRealArray(sunindextype N) { return(SUNDlsMat_NewRealArray(N)); } -realtype* SUNDlsMat_NewRealArray(sunindextype N) +sunrealtype* SUNDlsMat_NewRealArray(sunindextype N) { - realtype *vec; + sunrealtype *vec; if (N <= 0) return(NULL); vec = NULL; - vec = (realtype *) malloc(N * sizeof(realtype)); + vec = (sunrealtype *) malloc(N * sizeof(sunrealtype)); return(vec); } -realtype* newRealArray(sunindextype N) +sunrealtype* newRealArray(sunindextype N) { return(SUNDlsMat_newRealArray(N)); } -realtype* SUNDlsMat_newRealArray(sunindextype m) +sunrealtype* SUNDlsMat_newRealArray(sunindextype m) { - realtype *v; + sunrealtype *v; if (m <= 0) return(NULL); v = NULL; - v = (realtype *) malloc(m * sizeof(realtype)); + v = (sunrealtype *) malloc(m * sizeof(sunrealtype)); return(v); } @@ -347,7 +347,7 @@ void SetToZero(SUNDlsMat A) void SUNDlsMat_SetToZero(SUNDlsMat A) { sunindextype i, j, colSize; - realtype *col_j; + sunrealtype *col_j; switch (A->type) { @@ -384,7 +384,7 @@ void PrintMat(SUNDlsMat A, FILE *outfile) void SUNDlsMat_PrintMat(SUNDlsMat A, FILE *outfile) { sunindextype i, j, start, finish; - realtype **a; + sunrealtype **a; switch (A->type) { diff --git a/src/sundials/sundials_iterative.c b/src/sundials/sundials_iterative.c index 6772db83e9..ffd041389f 100644 --- a/src/sundials/sundials_iterative.c +++ b/src/sundials/sundials_iterative.c @@ -37,17 +37,17 @@ * ----------------------------------------------------------------- */ -int ModifiedGS(N_Vector *v, realtype **h, int k, int p, - realtype *new_vk_norm) +int ModifiedGS(N_Vector *v, sunrealtype **h, int k, int p, + sunrealtype *new_vk_norm) { return(SUNModifiedGS(v, h, k, p, new_vk_norm)); } -int SUNModifiedGS(N_Vector *v, realtype **h, int k, int p, - realtype *new_vk_norm) +int SUNModifiedGS(N_Vector *v, sunrealtype **h, int k, int p, + sunrealtype *new_vk_norm) { int i, k_minus_1, i0; - realtype new_norm_2, new_product, vk_norm, temp; + sunrealtype new_norm_2, new_product, vk_norm, temp; vk_norm = SUNRsqrt(N_VDotProd(v[k],v[k])); k_minus_1 = k - 1; @@ -101,17 +101,17 @@ int SUNModifiedGS(N_Vector *v, realtype **h, int k, int p, * ----------------------------------------------------------------- */ -int ClassicalGS(N_Vector *v, realtype **h, int k, int p, realtype *new_vk_norm, - realtype *stemp, N_Vector *vtemp) +int ClassicalGS(N_Vector *v, sunrealtype **h, int k, int p, sunrealtype *new_vk_norm, + sunrealtype *stemp, N_Vector *vtemp) { return(SUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp)); } -int SUNClassicalGS(N_Vector *v, realtype **h, int k, int p, realtype *new_vk_norm, - realtype *stemp, N_Vector *vtemp) +int SUNClassicalGS(N_Vector *v, sunrealtype **h, int k, int p, sunrealtype *new_vk_norm, + sunrealtype *stemp, N_Vector *vtemp) { int i, i0, k_minus_1, retval; - realtype vk_norm; + sunrealtype vk_norm; k_minus_1 = k - 1; i0 = SUNMAX(k-p,0); @@ -170,14 +170,14 @@ int SUNClassicalGS(N_Vector *v, realtype **h, int k, int p, realtype *new_vk_nor * ----------------------------------------------------------------- */ -int QRfact(int n, realtype **h, realtype *q, int job) +int QRfact(int n, sunrealtype **h, sunrealtype *q, int job) { return(SUNQRfact(n, h, q, job)); } -int SUNQRfact(int n, realtype **h, realtype *q, int job) +int SUNQRfact(int n, sunrealtype **h, sunrealtype *q, int job) { - realtype c, s, temp1, temp2, temp3; + sunrealtype c, s, temp1, temp2, temp3; int i, j, k, q_ptr, n_minus_1, code=0; switch (job) { @@ -279,14 +279,14 @@ int SUNQRfact(int n, realtype **h, realtype *q, int job) * ----------------------------------------------------------------- */ -int QRsol(int n, realtype **h, realtype *q, realtype *b) +int QRsol(int n, sunrealtype **h, sunrealtype *q, sunrealtype *b) { return(SUNQRsol(n, h, q, b)); } -int SUNQRsol(int n, realtype **h, realtype *q, realtype *b) +int SUNQRsol(int n, sunrealtype **h, sunrealtype *q, sunrealtype *b) { - realtype c, s, temp1, temp2; + sunrealtype c, s, temp1, temp2; int i, k, q_ptr, code=0; /* Compute Q*b */ @@ -324,7 +324,7 @@ int SUNQRsol(int n, realtype **h, realtype *q, realtype *b) * ----------------------------------------------------------------- */ -int SUNQRAdd_MGS(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_MGS(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata) { sunindextype j; @@ -351,7 +351,7 @@ int SUNQRAdd_MGS(N_Vector *Q, realtype *R, N_Vector df, * ----------------------------------------------------------------- */ -int SUNQRAdd_ICWY(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_ICWY(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata) { sunindextype j, k; @@ -401,7 +401,7 @@ int SUNQRAdd_ICWY(N_Vector *Q, realtype *R, N_Vector df, * ----------------------------------------------------------------- */ -int SUNQRAdd_ICWY_SB(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_ICWY_SB(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata) { sunindextype j, k; @@ -458,7 +458,7 @@ int SUNQRAdd_ICWY_SB(N_Vector *Q, realtype *R, N_Vector df, * ----------------------------------------------------------------- */ -int SUNQRAdd_CGS2(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_CGS2(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata) { sunindextype j; @@ -467,7 +467,7 @@ int SUNQRAdd_CGS2(N_Vector *Q, realtype *R, N_Vector df, N_VScale(ONE, df, qrdata->vtemp); /* temp = df */ if (m > 0) { - /* s_k = Q_k-1^T df_aa -- update with sdata as a realtype* array */ + /* s_k = Q_k-1^T df_aa -- update with sdata as a sunrealtype* array */ N_VDotProdMulti(m, qrdata->vtemp, Q, R + m * mMax); /* y = df - Q_k-1 s_k */ @@ -505,7 +505,7 @@ int SUNQRAdd_CGS2(N_Vector *Q, realtype *R, N_Vector df, * ----------------------------------------------------------------- */ -int SUNQRAdd_DCGS2(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_DCGS2(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata) { sunindextype j; @@ -554,7 +554,7 @@ int SUNQRAdd_DCGS2(N_Vector *Q, realtype *R, N_Vector df, * ----------------------------------------------------------------- */ -int SUNQRAdd_DCGS2_SB(N_Vector *Q, realtype *R, N_Vector df, +int SUNQRAdd_DCGS2_SB(N_Vector *Q, sunrealtype *R, N_Vector df, int m, int mMax, void *QRdata) { sunindextype j; diff --git a/src/sundials/sundials_iterative_impl.h b/src/sundials/sundials_iterative_impl.h index 45fad78e98..3d1551947b 100644 --- a/src/sundials/sundials_iterative_impl.h +++ b/src/sundials/sundials_iterative_impl.h @@ -20,8 +20,8 @@ /* ----------------------------------------------------------------------------- * Type: SUNQRData * ----------------------------------------------------------------------------- - * A SUNQRData struct holds temporary workspace vectors and realtype arrays for - * a SUNQRAddFn. The N_Vectors and realtype arrays it contains are created by + * A SUNQRData struct holds temporary workspace vectors and sunrealtype arrays for + * a SUNQRAddFn. The N_Vectors and sunrealtype arrays it contains are created by * the routine calling a SUNQRAdd function. * ---------------------------------------------------------------------------*/ @@ -31,5 +31,5 @@ struct _SUNQRData { N_Vector vtemp; N_Vector vtemp2; - realtype *temp_array; + sunrealtype *temp_array; }; diff --git a/src/sundials/sundials_linearsolver.c b/src/sundials/sundials_linearsolver.c index 75d4b6baa2..0aac6e9de7 100644 --- a/src/sundials/sundials_linearsolver.c +++ b/src/sundials/sundials_linearsolver.c @@ -183,7 +183,7 @@ int SUNLinSolSetup(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { int ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(S)); @@ -202,7 +202,7 @@ int SUNLinSolNumIters(SUNLinearSolver S) return(ier); } -realtype SUNLinSolResNorm(SUNLinearSolver S) +sunrealtype SUNLinSolResNorm(SUNLinearSolver S) { double result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(S)); diff --git a/src/sundials/sundials_matrix.c b/src/sundials/sundials_matrix.c index bc399ce08d..4be9a7135a 100644 --- a/src/sundials/sundials_matrix.c +++ b/src/sundials/sundials_matrix.c @@ -173,7 +173,7 @@ int SUNMatCopy(SUNMatrix A, SUNMatrix B) return(ier); } -int SUNMatScaleAdd(realtype c, SUNMatrix A, SUNMatrix B) +int SUNMatScaleAdd(sunrealtype c, SUNMatrix A, SUNMatrix B) { int ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(A)); @@ -182,7 +182,7 @@ int SUNMatScaleAdd(realtype c, SUNMatrix A, SUNMatrix B) return(ier); } -int SUNMatScaleAddI(realtype c, SUNMatrix A) +int SUNMatScaleAddI(sunrealtype c, SUNMatrix A) { int ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(A)); diff --git a/src/sundials/sundials_nonlinearsolver.c b/src/sundials/sundials_nonlinearsolver.c index 63863026ef..c2ed026b0a 100644 --- a/src/sundials/sundials_nonlinearsolver.c +++ b/src/sundials/sundials_nonlinearsolver.c @@ -124,7 +124,7 @@ int SUNNonlinSolSetup(SUNNonlinearSolver NLS, N_Vector y, void* mem) int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem) { int ier; diff --git a/src/sundials/sundials_nvector.c b/src/sundials/sundials_nvector.c index f526ed4f87..f60e96f441 100644 --- a/src/sundials/sundials_nvector.c +++ b/src/sundials/sundials_nvector.c @@ -320,20 +320,20 @@ void N_VSpace(N_Vector v, sunindextype *lrw, sunindextype *liw) return; } -realtype *N_VGetArrayPointer(N_Vector v) +sunrealtype *N_VGetArrayPointer(N_Vector v) { - return((realtype *) v->ops->nvgetarraypointer(v)); + return((sunrealtype *) v->ops->nvgetarraypointer(v)); } -realtype *N_VGetDeviceArrayPointer(N_Vector v) +sunrealtype *N_VGetDeviceArrayPointer(N_Vector v) { if (v->ops->nvgetdevicearraypointer) - return((realtype *) v->ops->nvgetdevicearraypointer(v)); + return((sunrealtype *) v->ops->nvgetdevicearraypointer(v)); else return(NULL); } -void N_VSetArrayPointer(realtype *v_data, N_Vector v) +void N_VSetArrayPointer(sunrealtype *v_data, N_Vector v) { v->ops->nvsetarraypointer(v_data, v); return; @@ -361,7 +361,7 @@ sunindextype N_VGetLocalLength(N_Vector v) * standard vector operations * -----------------------------------------------------------------*/ -void N_VLinearSum(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); z->ops->nvlinearsum(a, x, b, y, z); @@ -369,7 +369,7 @@ void N_VLinearSum(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) return; } -void N_VConst(realtype c, N_Vector z) +void N_VConst(sunrealtype c, N_Vector z) { SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(z)); z->ops->nvconst(c, z); @@ -393,7 +393,7 @@ void N_VDiv(N_Vector x, N_Vector y, N_Vector z) return; } -void N_VScale(realtype c, N_Vector x, N_Vector z) +void N_VScale(sunrealtype c, N_Vector x, N_Vector z) { SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); z->ops->nvscale(c, x, z); @@ -417,7 +417,7 @@ void N_VInv(N_Vector x, N_Vector z) return; } -void N_VAddConst(N_Vector x, realtype b, N_Vector z) +void N_VAddConst(N_Vector x, sunrealtype b, N_Vector z) { SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); z->ops->nvaddconst(x, b, z); @@ -425,70 +425,70 @@ void N_VAddConst(N_Vector x, realtype b, N_Vector z) return; } -realtype N_VDotProd(N_Vector x, N_Vector y) +sunrealtype N_VDotProd(N_Vector x, N_Vector y) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) y->ops->nvdotprod(x, y)); + result = ((sunrealtype) y->ops->nvdotprod(x, y)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VMaxNorm(N_Vector x) +sunrealtype N_VMaxNorm(N_Vector x) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvmaxnorm(x)); + result = ((sunrealtype) x->ops->nvmaxnorm(x)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VWrmsNorm(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm(N_Vector x, N_Vector w) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvwrmsnorm(x, w)); + result = ((sunrealtype) x->ops->nvwrmsnorm(x, w)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VWrmsNormMask(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask(N_Vector x, N_Vector w, N_Vector id) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvwrmsnormmask(x, w, id)); + result = ((sunrealtype) x->ops->nvwrmsnormmask(x, w, id)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VMin(N_Vector x) +sunrealtype N_VMin(N_Vector x) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvmin(x)); + result = ((sunrealtype) x->ops->nvmin(x)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VWL2Norm(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm(N_Vector x, N_Vector w) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvwl2norm(x, w)); + result = ((sunrealtype) x->ops->nvwl2norm(x, w)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VL1Norm(N_Vector x) +sunrealtype N_VL1Norm(N_Vector x) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvl1norm(x)); + result = ((sunrealtype) x->ops->nvl1norm(x)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -void N_VCompare(realtype c, N_Vector x, N_Vector z) +void N_VCompare(sunrealtype c, N_Vector x, N_Vector z) { SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); z->ops->nvcompare(c, x, z); @@ -514,11 +514,11 @@ booleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m) return(result); } -realtype N_VMinQuotient(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient(N_Vector num, N_Vector denom) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(num)); - result = ((realtype) num->ops->nvminquotient(num, denom)); + result = ((sunrealtype) num->ops->nvminquotient(num, denom)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(num)); return(result); } @@ -529,7 +529,7 @@ realtype N_VMinQuotient(N_Vector num, N_Vector denom) * OPTIONAL fused vector operations * -----------------------------------------------------------------*/ -int N_VLinearCombination(int nvec, realtype* c, N_Vector* X, N_Vector z) +int N_VLinearCombination(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(X[0])); @@ -552,7 +552,7 @@ int N_VLinearCombination(int nvec, realtype* c, N_Vector* X, N_Vector z) return(ier); } -int N_VScaleAddMulti(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) +int N_VScaleAddMulti(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector* Z) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); @@ -574,7 +574,7 @@ int N_VScaleAddMulti(int nvec, realtype* a, N_Vector x, N_Vector* Y, N_Vector* Z return(ier); } -int N_VDotProdMulti(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) +int N_VDotProdMulti(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); @@ -600,8 +600,8 @@ int N_VDotProdMulti(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) * OPTIONAL vector array operations * -----------------------------------------------------------------*/ -int N_VLinearSumVectorArray(int nvec, realtype a, N_Vector* X, - realtype b, N_Vector* Y, N_Vector* Z) +int N_VLinearSumVectorArray(int nvec, sunrealtype a, N_Vector* X, + sunrealtype b, N_Vector* Y, N_Vector* Z) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(X[0])); @@ -623,7 +623,7 @@ int N_VLinearSumVectorArray(int nvec, realtype a, N_Vector* X, return(ier); } -int N_VScaleVectorArray(int nvec, realtype* c, N_Vector* X, N_Vector* Z) +int N_VScaleVectorArray(int nvec, sunrealtype* c, N_Vector* X, N_Vector* Z) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(X[0])); @@ -645,7 +645,7 @@ int N_VScaleVectorArray(int nvec, realtype* c, N_Vector* X, N_Vector* Z) return(ier); } -int N_VConstVectorArray(int nvec, realtype c, N_Vector* Z) +int N_VConstVectorArray(int nvec, sunrealtype c, N_Vector* Z) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(Z[0])); @@ -667,7 +667,7 @@ int N_VConstVectorArray(int nvec, realtype c, N_Vector* Z) return(ier); } -int N_VWrmsNormVectorArray(int nvec, N_Vector* X, N_Vector* W, realtype* nrm) +int N_VWrmsNormVectorArray(int nvec, N_Vector* X, N_Vector* W, sunrealtype* nrm) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(X[0])); @@ -690,7 +690,7 @@ int N_VWrmsNormVectorArray(int nvec, N_Vector* X, N_Vector* W, realtype* nrm) } int N_VWrmsNormMaskVectorArray(int nvec, N_Vector* X, N_Vector* W, N_Vector id, - realtype* nrm) + sunrealtype* nrm) { int i, ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(X[0])); @@ -712,7 +712,7 @@ int N_VWrmsNormMaskVectorArray(int nvec, N_Vector* X, N_Vector* W, N_Vector id, return(ier); } -int N_VScaleAddMultiVectorArray(int nvec, int nsum, realtype* a, N_Vector* X, +int N_VScaleAddMultiVectorArray(int nvec, int nsum, sunrealtype* a, N_Vector* X, N_Vector** Y, N_Vector** Z) { int i, j, ier; @@ -759,7 +759,7 @@ int N_VScaleAddMultiVectorArray(int nvec, int nsum, realtype* a, N_Vector* X, return(ier); } -int N_VLinearCombinationVectorArray(int nvec, int nsum, realtype* c, +int N_VLinearCombinationVectorArray(int nvec, int nsum, sunrealtype* c, N_Vector** X, N_Vector* Z) { int i, j, ier; @@ -807,56 +807,56 @@ int N_VLinearCombinationVectorArray(int nvec, int nsum, realtype* c, * OPTIONAL local reduction kernels (no parallel communication) * -----------------------------------------------------------------*/ -realtype N_VDotProdLocal(N_Vector x, N_Vector y) +sunrealtype N_VDotProdLocal(N_Vector x, N_Vector y) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) y->ops->nvdotprodlocal(x, y)); + result = ((sunrealtype) y->ops->nvdotprodlocal(x, y)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VMaxNormLocal(N_Vector x) +sunrealtype N_VMaxNormLocal(N_Vector x) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvmaxnormlocal(x)); + result = ((sunrealtype) x->ops->nvmaxnormlocal(x)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VMinLocal(N_Vector x) +sunrealtype N_VMinLocal(N_Vector x) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvminlocal(x)); + result = ((sunrealtype) x->ops->nvminlocal(x)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VL1NormLocal(N_Vector x) +sunrealtype N_VL1NormLocal(N_Vector x) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvl1normlocal(x)); + result = ((sunrealtype) x->ops->nvl1normlocal(x)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VWSqrSumLocal(N_Vector x, N_Vector w) +sunrealtype N_VWSqrSumLocal(N_Vector x, N_Vector w) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvwsqrsumlocal(x,w)); + result = ((sunrealtype) x->ops->nvwsqrsumlocal(x,w)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -realtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((realtype) x->ops->nvwsqrsummasklocal(x,w,id)); + result = ((sunrealtype) x->ops->nvwsqrsummasklocal(x,w,id)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } @@ -879,11 +879,11 @@ booleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m) return(result); } -realtype N_VMinQuotientLocal(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotientLocal(N_Vector num, N_Vector denom) { - realtype result; + sunrealtype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(num)); - result = ((realtype) num->ops->nvminquotientlocal(num,denom)); + result = ((sunrealtype) num->ops->nvminquotientlocal(num,denom)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(num)); return(result); } @@ -892,7 +892,7 @@ realtype N_VMinQuotientLocal(N_Vector num, N_Vector denom) * OPTIONAL single buffer reduction operations * -------------------------------------------*/ -int N_VDotProdMultiLocal(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) +int N_VDotProdMultiLocal(int nvec, N_Vector x, N_Vector* Y, sunrealtype* dotprods) { int i; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); @@ -911,7 +911,7 @@ int N_VDotProdMultiLocal(int nvec, N_Vector x, N_Vector* Y, realtype* dotprods) return(-1); } -int N_VDotProdMultiAllReduce(int nvec, N_Vector x, realtype* sum) +int N_VDotProdMultiAllReduce(int nvec, N_Vector x, sunrealtype* sum) { SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); if (x->ops->nvdotprodmultiallreduce) diff --git a/src/sundials/sundials_nvector_senswrapper.c b/src/sundials/sundials_nvector_senswrapper.c index d8f0ac6826..e8677a0e93 100644 --- a/src/sundials/sundials_nvector_senswrapper.c +++ b/src/sundials/sundials_nvector_senswrapper.c @@ -267,7 +267,7 @@ void N_VDestroy_SensWrapper(N_Vector v) Standard vector operations ============================================================================*/ -void N_VLinearSum_SensWrapper(realtype a, N_Vector x, realtype b, N_Vector y, N_Vector z) +void N_VLinearSum_SensWrapper(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z) { int i; @@ -278,7 +278,7 @@ void N_VLinearSum_SensWrapper(realtype a, N_Vector x, realtype b, N_Vector y, N_ } -void N_VConst_SensWrapper(realtype c, N_Vector z) +void N_VConst_SensWrapper(sunrealtype c, N_Vector z) { int i; @@ -311,7 +311,7 @@ void N_VDiv_SensWrapper(N_Vector x, N_Vector y, N_Vector z) } -void N_VScale_SensWrapper(realtype c, N_Vector x, N_Vector z) +void N_VScale_SensWrapper(sunrealtype c, N_Vector x, N_Vector z) { int i; @@ -344,7 +344,7 @@ void N_VInv_SensWrapper(N_Vector x, N_Vector z) } -void N_VAddConst_SensWrapper(N_Vector x, realtype b, N_Vector z) +void N_VAddConst_SensWrapper(N_Vector x, sunrealtype b, N_Vector z) { int i; @@ -355,10 +355,10 @@ void N_VAddConst_SensWrapper(N_Vector x, realtype b, N_Vector z) } -realtype N_VDotProd_SensWrapper(N_Vector x, N_Vector y) +sunrealtype N_VDotProd_SensWrapper(N_Vector x, N_Vector y) { int i; - realtype sum; + sunrealtype sum; sum = ZERO; @@ -369,10 +369,10 @@ realtype N_VDotProd_SensWrapper(N_Vector x, N_Vector y) } -realtype N_VMaxNorm_SensWrapper(N_Vector x) +sunrealtype N_VMaxNorm_SensWrapper(N_Vector x) { int i; - realtype max, tmp; + sunrealtype max, tmp; max = ZERO; @@ -385,10 +385,10 @@ realtype N_VMaxNorm_SensWrapper(N_Vector x) } -realtype N_VWrmsNorm_SensWrapper(N_Vector x, N_Vector w) +sunrealtype N_VWrmsNorm_SensWrapper(N_Vector x, N_Vector w) { int i; - realtype nrm, tmp; + sunrealtype nrm, tmp; nrm = ZERO; @@ -401,10 +401,10 @@ realtype N_VWrmsNorm_SensWrapper(N_Vector x, N_Vector w) } -realtype N_VWrmsNormMask_SensWrapper(N_Vector x, N_Vector w, N_Vector id) +sunrealtype N_VWrmsNormMask_SensWrapper(N_Vector x, N_Vector w, N_Vector id) { int i; - realtype nrm, tmp; + sunrealtype nrm, tmp; nrm = ZERO; @@ -417,10 +417,10 @@ realtype N_VWrmsNormMask_SensWrapper(N_Vector x, N_Vector w, N_Vector id) } -realtype N_VMin_SensWrapper(N_Vector x) +sunrealtype N_VMin_SensWrapper(N_Vector x) { int i; - realtype min, tmp; + sunrealtype min, tmp; min = N_VMin(NV_VEC_SW(x,0)); @@ -433,10 +433,10 @@ realtype N_VMin_SensWrapper(N_Vector x) } -realtype N_VWL2Norm_SensWrapper(N_Vector x, N_Vector w) +sunrealtype N_VWL2Norm_SensWrapper(N_Vector x, N_Vector w) { int i; - realtype nrm, tmp; + sunrealtype nrm, tmp; nrm = ZERO; @@ -449,10 +449,10 @@ realtype N_VWL2Norm_SensWrapper(N_Vector x, N_Vector w) } -realtype N_VL1Norm_SensWrapper(N_Vector x) +sunrealtype N_VL1Norm_SensWrapper(N_Vector x) { int i; - realtype nrm, tmp; + sunrealtype nrm, tmp; nrm = ZERO; @@ -465,7 +465,7 @@ realtype N_VL1Norm_SensWrapper(N_Vector x) } -void N_VCompare_SensWrapper(realtype c, N_Vector x, N_Vector z) +void N_VCompare_SensWrapper(sunrealtype c, N_Vector x, N_Vector z) { int i; @@ -508,10 +508,10 @@ booleantype N_VConstrMask_SensWrapper(N_Vector c, N_Vector x, N_Vector m) } -realtype N_VMinQuotient_SensWrapper(N_Vector num, N_Vector denom) +sunrealtype N_VMinQuotient_SensWrapper(N_Vector num, N_Vector denom) { int i; - realtype min, tmp; + sunrealtype min, tmp; min = N_VMinQuotient(NV_VEC_SW(num,0), NV_VEC_SW(denom,0)); diff --git a/src/sundials/sundials_profiler.c b/src/sundials/sundials_profiler.c index 2761b9e3dc..98b817b3ef 100644 --- a/src/sundials/sundials_profiler.c +++ b/src/sundials/sundials_profiler.c @@ -465,7 +465,7 @@ int sunCollectTimers(SUNProfiler p) /* Update the values that are in this rank's hash map. */ for (i = 0; i < p->map->size; ++i) { - values[i]->average = reduced[i].average / (realtype) nranks; + values[i]->average = reduced[i].average / (sunrealtype) nranks; values[i]->maximum = reduced[i].maximum; } diff --git a/src/sunlinsol/band/fmod/fsunlinsol_band_mod.c b/src/sunlinsol/band/fmod/fsunlinsol_band_mod.c index b137b1101d..99f9a333c0 100644 --- a/src/sunlinsol/band/fmod/fsunlinsol_band_mod.c +++ b/src/sunlinsol/band/fmod/fsunlinsol_band_mod.c @@ -280,14 +280,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_Band(SUNLinearSolver farg1, SUNMatrix farg2 SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_Band(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; diff --git a/src/sunlinsol/band/sunlinsol_band.c b/src/sunlinsol/band/sunlinsol_band.c index 9ea45b6dff..6e67312ada 100644 --- a/src/sunlinsol/band/sunlinsol_band.c +++ b/src/sunlinsol/band/sunlinsol_band.c @@ -131,7 +131,7 @@ int SUNLinSolInitialize_Band(SUNLinearSolver S) int SUNLinSolSetup_Band(SUNLinearSolver S, SUNMatrix A) { - realtype **A_cols; + sunrealtype **A_cols; sunindextype *pivots; /* check for valid inputs */ @@ -171,9 +171,9 @@ int SUNLinSolSetup_Band(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_Band(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { - realtype **A_cols, *xdata; + sunrealtype **A_cols, *xdata; sunindextype *pivots; /* check for valid inputs */ diff --git a/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu b/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu index d7a351f974..9b25dc67fe 100644 --- a/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu +++ b/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu @@ -181,7 +181,7 @@ int SUNLinSolSetup_cuSolverSp_batchQR(SUNLinearSolver S, SUNMatrix A) { int blockrows, blockcols, blocknnz, nblock; int *d_rowptr, *d_colind; - realtype *d_data; + sunrealtype *d_data; cusparseMatDescr_t mat_descr; cudaError_t cuerr; cusolverStatus_t status; @@ -269,12 +269,12 @@ int SUNLinSolSetup_cuSolverSp_batchQR(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_cuSolverSp_batchQR(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol) + N_Vector x, N_Vector b, sunrealtype tol) { cusolverStatus_t status; int blockrows, blockcols, blocknnz, nblock; int *d_rowptr, *d_colind; - realtype *d_data; + sunrealtype *d_data; cusparseMatDescr_t mat_descr; if ((S == NULL) || (A == NULL) || (x == NULL) || (b == NULL)) @@ -282,8 +282,8 @@ int SUNLinSolSolve_cuSolverSp_batchQR(SUNLinearSolver S, SUNMatrix A, SUN_CUSP_LASTFLAG(S) = SUNLS_SUCCESS; - realtype* device_b = N_VGetDeviceArrayPointer(b); - realtype* device_x = N_VGetDeviceArrayPointer(x); + sunrealtype* device_b = N_VGetDeviceArrayPointer(b); + sunrealtype* device_x = N_VGetDeviceArrayPointer(x); if (SUN_CUSP_LASTFLAG(S) != SUNLS_SUCCESS) return SUN_CUSP_LASTFLAG(S); diff --git a/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c b/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c index 82ad5846c6..14a61798fe 100644 --- a/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c +++ b/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c @@ -280,14 +280,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_Dense(SUNLinearSolver farg1, SUNMatrix farg SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_Dense(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; diff --git a/src/sunlinsol/dense/sunlinsol_dense.c b/src/sunlinsol/dense/sunlinsol_dense.c index bed6afb5b0..55a7139738 100644 --- a/src/sunlinsol/dense/sunlinsol_dense.c +++ b/src/sunlinsol/dense/sunlinsol_dense.c @@ -122,7 +122,7 @@ int SUNLinSolInitialize_Dense(SUNLinearSolver S) int SUNLinSolSetup_Dense(SUNLinearSolver S, SUNMatrix A) { - realtype **A_cols; + sunrealtype **A_cols; sunindextype *pivots; /* check for valid inputs */ @@ -156,9 +156,9 @@ int SUNLinSolSetup_Dense(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_Dense(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { - realtype **A_cols, *xdata; + sunrealtype **A_cols, *xdata; sunindextype *pivots; if ( (A == NULL) || (S == NULL) || (x == NULL) || (b == NULL) ) diff --git a/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c b/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c index 939d70b048..105aa042ed 100644 --- a/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c +++ b/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c @@ -372,14 +372,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_KLU(SUNLinearSolver farg1, SUNMatrix farg2, SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_KLU(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; diff --git a/src/sunlinsol/klu/sunlinsol_klu.c b/src/sunlinsol/klu/sunlinsol_klu.c index 502d9b1014..dc7c754a76 100644 --- a/src/sunlinsol/klu/sunlinsol_klu.c +++ b/src/sunlinsol/klu/sunlinsol_klu.c @@ -244,7 +244,7 @@ int SUNLinSolInitialize_KLU(SUNLinearSolver S) int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) { int retval; - realtype uround_twothirds; + sunrealtype uround_twothirds; uround_twothirds = SUNRpowerR(UNIT_ROUNDOFF,TWOTHIRDS); @@ -350,10 +350,10 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_KLU(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { int flag; - realtype *xdata; + sunrealtype *xdata; /* check for valid inputs */ if ( (A == NULL) || (S == NULL) || (x == NULL) || (b == NULL) ) diff --git a/src/sunlinsol/lapackband/sunlinsol_lapackband.c b/src/sunlinsol/lapackband/sunlinsol_lapackband.c index 0affcb5474..785431586a 100644 --- a/src/sunlinsol/lapackband/sunlinsol_lapackband.c +++ b/src/sunlinsol/lapackband/sunlinsol_lapackband.c @@ -24,7 +24,7 @@ #include "sundials_lapack_defs.h" -/* Interfaces to match 'realtype' with the correct LAPACK functions */ +/* Interfaces to match 'sunrealtype' with the correct LAPACK functions */ #if defined(SUNDIALS_DOUBLE_PRECISION) #define xgbtrf_f77 dgbtrf_f77 #define xgbtrs_f77 dgbtrs_f77 @@ -32,7 +32,7 @@ #define xgbtrf_f77 sgbtrf_f77 #define xgbtrs_f77 sgbtrs_f77 #else -#error Incompatible realtype for LAPACK; disable LAPACK and rebuild +#error Incompatible sunrealtype for LAPACK; disable LAPACK and rebuild #endif #define ZERO RCONST(0.0) @@ -172,10 +172,10 @@ int SUNLinSolSetup_LapackBand(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_LapackBand(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { sunindextype n, ml, mu, ldim, one, ier; - realtype *xdata; + sunrealtype *xdata; /* check for valid inputs */ if ( (A == NULL) || (S == NULL) || (x == NULL) || (b == NULL) ) diff --git a/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c index d89e4ebfe5..8de0ffb748 100644 --- a/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c +++ b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c @@ -24,7 +24,7 @@ #include "sundials_lapack_defs.h" -/* Interfaces to match 'realtype' with the correct LAPACK functions */ +/* Interfaces to match 'sunrealtype' with the correct LAPACK functions */ #if defined(SUNDIALS_DOUBLE_PRECISION) #define xgetrf_f77 dgetrf_f77 #define xgetrs_f77 dgetrs_f77 @@ -32,7 +32,7 @@ #define xgetrf_f77 sgetrf_f77 #define xgetrs_f77 sgetrs_f77 #else -#error Incompatible realtype for LAPACK; disable LAPACK and rebuild +#error Incompatible sunrealtype for LAPACK; disable LAPACK and rebuild #endif #define ZERO RCONST(0.0) @@ -167,10 +167,10 @@ int SUNLinSolSetup_LapackDense(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_LapackDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { sunindextype n, one, ier; - realtype *xdata; + sunrealtype *xdata; if ( (A == NULL) || (S == NULL) || (x == NULL) || (b == NULL) ) return(SUNLS_MEM_NULL); diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index 4d9f2ab46b..7e2eabc414 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -19,7 +19,7 @@ #include #include -/* Interfaces to match 'realtype' with the correct MAGMA functions */ +/* Interfaces to match 'sunrealtype' with the correct MAGMA functions */ #if defined(SUNDIALS_DOUBLE_PRECISION) #define xgetrf magma_dgetrf_gpu #define xgetrf_batched magma_dgetrf_batched @@ -33,7 +33,7 @@ #define xgetrs_batched magma_sgetrs_batched #define xset_pointer magma_sset_pointer #else -#error Incompatible realtype for MAGMA +#error Incompatible sunrealtype for MAGMA #endif #define ZERO RCONST(0.0) @@ -50,7 +50,7 @@ #define QUEUE(S) ( MAGMADENSE_CONTENT(S)->q ) #define PIVOTS(S) ( (sunindextype*)MAGMADENSE_CONTENT(S)->pivots->ptr ) #define PIVOTSARRAY(S) ( (sunindextype**)MAGMADENSE_CONTENT(S)->pivotsarr->ptr ) -#define RHSARRAY(S) ( (realtype**)MAGMADENSE_CONTENT(S)->rhsarr->ptr ) +#define RHSARRAY(S) ( (sunrealtype**)MAGMADENSE_CONTENT(S)->rhsarr->ptr ) #define INFOARRAY(S) ( (sunindextype*)MAGMADENSE_CONTENT(S)->infoarr->ptr ) #define LASTFLAG(S) ( MAGMADENSE_CONTENT(S)->last_flag ) #define ASYNCHRONOUS(S) ( MAGMADENSE_CONTENT(S)->async) @@ -175,7 +175,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc if (retval) { SUNLinSolFree(S); return(NULL); } retval = SUNMemoryHelper_Alloc(content->memhelp, &content->rhsarr, - nblocks * sizeof(realtype*), + nblocks * sizeof(sunrealtype*), SUNMEMTYPE_DEVICE, nullptr); if (retval) { SUNLinSolFree(S); return(NULL); } } @@ -253,7 +253,7 @@ int SUNLinSolSetup_MagmaDense(SUNLinearSolver S, SUNMatrix A) nblocks, QUEUE(S)); #else - realtype** blocks = SUNMatrix_MagmaDense_BlockData(A); + sunrealtype** blocks = SUNMatrix_MagmaDense_BlockData(A); for (int k = 0; k < nblocks; k++) { xgetrf(M, /* number of rows */ @@ -298,7 +298,7 @@ int SUNLinSolSetup_MagmaDense(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_MagmaDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { /* Check for valid inputs */ if (S == NULL) return(SUNLS_MEM_NULL); @@ -324,7 +324,7 @@ int SUNLinSolSolve_MagmaDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_VScale(ONE, b, x); /* Access x data array */ - realtype* xdata = N_VGetDeviceArrayPointer(x); + sunrealtype* xdata = N_VGetDeviceArrayPointer(x); if (xdata == NULL) { LASTFLAG(S) = SUNLS_MEM_FAIL; diff --git a/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp b/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp index 72e87f53f9..2fb53eb772 100644 --- a/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp +++ b/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp @@ -51,12 +51,12 @@ using namespace oneapi::mkl::lapack; // Getrf scratch space size and memory #define LS_F_SCRATCH_SIZE(S) (LS_CONTENT(S)->f_scratch_size) #define LS_F_SCRATCH(S) (LS_CONTENT(S)->f_scratchpad) -#define LS_F_SCRATCHp(S) ((realtype*) LS_CONTENT(S)->f_scratchpad->ptr) +#define LS_F_SCRATCHp(S) ((sunrealtype*) LS_CONTENT(S)->f_scratchpad->ptr) // Getrs scratch space size and memory #define LS_S_SCRATCH_SIZE(S) (LS_CONTENT(S)->s_scratch_size) #define LS_S_SCRATCH(S) (LS_CONTENT(S)->s_scratchpad) -#define LS_S_SCRATCHp(S) ((realtype*) LS_CONTENT(S)->s_scratchpad->ptr) +#define LS_S_SCRATCHp(S) ((sunrealtype*) LS_CONTENT(S)->s_scratchpad->ptr) // Memory type, helper, and SYCL queue #define LS_MEM_TYPE(S) (LS_CONTENT(S)->mem_type) @@ -182,13 +182,13 @@ SUNLinearSolver SUNLinSol_OneMklDense(N_Vector y, SUNMatrix Amat, SUNContext sun { #ifdef SUNDIALS_ONEMKL_USE_GETRF_LOOP LS_F_SCRATCH_SIZE(S) = - getrf_scratchpad_size(*queue, // device queue + getrf_scratchpad_size(*queue, // device queue M, // rows in A_i N, // columns in A_i M); // leading dimension #else LS_F_SCRATCH_SIZE(S) = - getrf_batch_scratchpad_size(*queue, // device queue + getrf_batch_scratchpad_size(*queue, // device queue M, // rows in A_i N, // columns in A_i M, // leading dimension @@ -199,7 +199,7 @@ SUNLinearSolver SUNLinSol_OneMklDense(N_Vector y, SUNMatrix Amat, SUNContext sun #ifdef SUNDIALS_ONEMKL_USE_GETRS_LOOP LS_S_SCRATCH_SIZE(S) = - getrs_scratchpad_size(*queue, // device queue + getrs_scratchpad_size(*queue, // device queue oneapi::mkl::transpose::nontrans, M, // number of rows in A 1, // number of right-hand sizes @@ -207,7 +207,7 @@ SUNLinearSolver SUNLinSol_OneMklDense(N_Vector y, SUNMatrix Amat, SUNContext sun M); // leading dimension of B #else LS_S_SCRATCH_SIZE(S)= - getrs_batch_scratchpad_size(*queue, // device queue + getrs_batch_scratchpad_size(*queue, // device queue oneapi::mkl::transpose::nontrans, M, // number of rows in A_i 1, // number of right-hand sides @@ -222,13 +222,13 @@ SUNLinearSolver SUNLinSol_OneMklDense(N_Vector y, SUNMatrix Amat, SUNContext sun else { LS_F_SCRATCH_SIZE(S) = - getrf_scratchpad_size(*queue, // device queue + getrf_scratchpad_size(*queue, // device queue M, // rows in A_i N, // columns in A_i M); // leading dimension LS_S_SCRATCH_SIZE(S) = - getrs_scratchpad_size(*queue, // device queue + getrs_scratchpad_size(*queue, // device queue oneapi::mkl::transpose::nontrans, M, // number of rows in A 1, // number of right-hand sizes @@ -238,7 +238,7 @@ SUNLinearSolver SUNLinSol_OneMklDense(N_Vector y, SUNMatrix Amat, SUNContext sun // Allocate factorization scratchpad if necessary retval = SUNMemoryHelper_Alloc(LS_MEM_HELPER(S), &(LS_F_SCRATCH(S)), - LS_F_SCRATCH_SIZE(S) * sizeof(realtype), + LS_F_SCRATCH_SIZE(S) * sizeof(sunrealtype), LS_MEM_TYPE(S), queue); if (retval) { @@ -249,7 +249,7 @@ SUNLinearSolver SUNLinSol_OneMklDense(N_Vector y, SUNMatrix Amat, SUNContext sun // Allocate solve scratchpad if necessary retval = SUNMemoryHelper_Alloc(LS_MEM_HELPER(S), &(LS_S_SCRATCH(S)), - LS_S_SCRATCH_SIZE(S) * sizeof(realtype), + LS_S_SCRATCH_SIZE(S) * sizeof(sunrealtype), LS_MEM_TYPE(S), queue); if (retval) { @@ -306,7 +306,7 @@ int SUNLinSolSetup_OneMklDense(SUNLinearSolver S, SUNMatrix A) } // Access A matrix data array - realtype* Adata = SUNMatrix_OneMklDense_Data(A); + sunrealtype* Adata = SUNMatrix_OneMklDense_Data(A); if (!Adata) { SUNDIALS_DEBUG_ERROR("Matrix data array is NULL\n"); @@ -330,7 +330,7 @@ int SUNLinSolSetup_OneMklDense(SUNLinearSolver S, SUNMatrix A) sunindextype N = SUNMatrix_OneMklDense_BlockColumns(A); sunindextype num_blocks = SUNMatrix_OneMklDense_NumBlocks(A); sunindextype scratch_size = LS_F_SCRATCH_SIZE(S); - realtype* scratchpad = LS_F_SCRATCHp(S); + sunrealtype* scratchpad = LS_F_SCRATCHp(S); if (num_blocks > 1) { @@ -441,7 +441,7 @@ int SUNLinSolSetup_OneMklDense(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { // Check for valid inputs if (!S) @@ -469,7 +469,7 @@ int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_VScale(RCONST(1.0), b, x); // Access x vector data array - realtype* xdata = N_VGetDeviceArrayPointer(x); + sunrealtype* xdata = N_VGetDeviceArrayPointer(x); if (!xdata) { SUNDIALS_DEBUG_ERROR("Vector data array is NULL\n"); @@ -478,7 +478,7 @@ int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, } // Access A matrix data array - realtype* Adata = SUNMatrix_OneMklDense_Data(A); + sunrealtype* Adata = SUNMatrix_OneMklDense_Data(A); if (!Adata) { SUNDIALS_DEBUG_ERROR("Matrix data array is NULL\n"); @@ -502,7 +502,7 @@ int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, sunindextype N = SUNMatrix_OneMklDense_BlockColumns(A); sunindextype num_blocks = SUNMatrix_OneMklDense_NumBlocks(A); sunindextype scratch_size = LS_S_SCRATCH_SIZE(S); - realtype* scratchpad = LS_S_SCRATCHp(S); + sunrealtype* scratchpad = LS_S_SCRATCHp(S); if (num_blocks > 1) { diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c index 3bdb6ea15f..880b808399 100644 --- a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c +++ b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c @@ -374,14 +374,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_PCG(SUNLinearSolver farg1, SUNMatrix farg2, SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_PCG(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -403,11 +403,11 @@ SWIGEXPORT int _wrap_FSUNLinSolNumIters_PCG(SUNLinearSolver farg1) { SWIGEXPORT double _wrap_FSUNLinSolResNorm_PCG(SUNLinearSolver farg1) { double fresult ; SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - realtype result; + sunrealtype result; arg1 = (SUNLinearSolver)(farg1); - result = (realtype)SUNLinSolResNorm_PCG(arg1); - fresult = (realtype)(result); + result = (sunrealtype)SUNLinSolResNorm_PCG(arg1); + fresult = (sunrealtype)(result); return fresult; } diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index eb21a71da2..0c6d517fc7 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -297,10 +297,10 @@ int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNMatrix nul) int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, N_Vector x, - N_Vector b, realtype delta) + N_Vector b, sunrealtype delta) { /* local data and shortcut variables */ - realtype alpha, beta, r0_norm, rho, rz, rz_old; + sunrealtype alpha, beta, r0_norm, rho, rz, rz_old; N_Vector r, p, z, Ap, w; booleantype UsePrec, UseScaling, converged; booleantype *zeroguess; @@ -308,7 +308,7 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, N_Vector x, void *A_data, *P_data; SUNATimesFn atimes; SUNPSolveFn psolve; - realtype *res_norm; + sunrealtype *res_norm; int *nli; /* Make local shorcuts to solver variables. */ @@ -515,7 +515,7 @@ int SUNLinSolNumIters_PCG(SUNLinearSolver S) } -realtype SUNLinSolResNorm_PCG(SUNLinearSolver S) +sunrealtype SUNLinSolResNorm_PCG(SUNLinearSolver S) { /* return the stored 'resnorm' value */ if (S == NULL) return(-ONE); diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c index 1d58f0c9b1..bc5daa8f6f 100644 --- a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c +++ b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c @@ -374,14 +374,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_SPBCGS(SUNLinearSolver farg1, SUNMatrix far SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_SPBCGS(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -403,11 +403,11 @@ SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPBCGS(SUNLinearSolver farg1) { SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPBCGS(SUNLinearSolver farg1) { double fresult ; SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - realtype result; + sunrealtype result; arg1 = (SUNLinearSolver)(farg1); - result = (realtype)SUNLinSolResNorm_SPBCGS(arg1); - fresult = (realtype)(result); + result = (sunrealtype)SUNLinSolResNorm_SPBCGS(arg1); + fresult = (sunrealtype)(result); return fresult; } diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index f2e6360251..3479b82f38 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -319,10 +319,10 @@ int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype delta) + N_Vector b, sunrealtype delta) { /* local data and shortcut variables */ - realtype alpha, beta, omega, omega_denom, beta_num, beta_denom, r_norm, rho; + sunrealtype alpha, beta, omega, omega_denom, beta_num, beta_denom, r_norm, rho; N_Vector r_star, r, p, q, u, Ap, vtemp; booleantype preOnLeft, preOnRight, scale_x, scale_b, converged; booleantype *zeroguess; @@ -331,11 +331,11 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector sx, sb; SUNATimesFn atimes; SUNPSolveFn psolve; - realtype *res_norm; + sunrealtype *res_norm; int *nli; /* local variables for fused vector operations */ - realtype cv[3]; + sunrealtype cv[3]; N_Vector Xv[3]; /* Make local shorcuts to solver variables. */ @@ -701,7 +701,7 @@ int SUNLinSolNumIters_SPBCGS(SUNLinearSolver S) } -realtype SUNLinSolResNorm_SPBCGS(SUNLinearSolver S) +sunrealtype SUNLinSolResNorm_SPBCGS(SUNLinearSolver S) { /* return the stored 'resnorm' value */ if (S == NULL) return(-ONE); diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c index 8332d7967a..4d24389307 100644 --- a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c +++ b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c @@ -388,14 +388,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_SPFGMR(SUNLinearSolver farg1, SUNMatrix far SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_SPFGMR(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -417,11 +417,11 @@ SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPFGMR(SUNLinearSolver farg1) { SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPFGMR(SUNLinearSolver farg1) { double fresult ; SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - realtype result; + sunrealtype result; arg1 = (SUNLinearSolver)(farg1); - result = (realtype)SUNLinSolResNorm_SPFGMR(arg1); - fresult = (realtype)(result); + result = (sunrealtype)SUNLinSolResNorm_SPFGMR(arg1); + fresult = (sunrealtype)(result); return fresult; } diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index 23ce66f615..827e34580b 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -270,7 +270,7 @@ int SUNLinSolInitialize_SPFGMR(SUNLinearSolver S) /* Hessenberg matrix Hes */ if (content->Hes == NULL) { - content->Hes = (realtype **) malloc((content->maxl+1)*sizeof(realtype *)); + content->Hes = (sunrealtype **) malloc((content->maxl+1)*sizeof(sunrealtype *)); if (content->Hes == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -278,7 +278,7 @@ int SUNLinSolInitialize_SPFGMR(SUNLinearSolver S) for (k=0; k<=content->maxl; k++) { content->Hes[k] = NULL; - content->Hes[k] = (realtype *) malloc(content->maxl*sizeof(realtype)); + content->Hes[k] = (sunrealtype *) malloc(content->maxl*sizeof(sunrealtype)); if (content->Hes[k] == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -288,7 +288,7 @@ int SUNLinSolInitialize_SPFGMR(SUNLinearSolver S) /* Givens rotation components */ if (content->givens == NULL) { - content->givens = (realtype *) malloc(2*content->maxl*sizeof(realtype)); + content->givens = (sunrealtype *) malloc(2*content->maxl*sizeof(sunrealtype)); if (content->givens == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -297,7 +297,7 @@ int SUNLinSolInitialize_SPFGMR(SUNLinearSolver S) /* y and g vectors */ if (content->yg == NULL) { - content->yg = (realtype *) malloc((content->maxl+1)*sizeof(realtype)); + content->yg = (sunrealtype *) malloc((content->maxl+1)*sizeof(sunrealtype)); if (content->yg == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -306,7 +306,7 @@ int SUNLinSolInitialize_SPFGMR(SUNLinearSolver S) /* cv vector for fused vector ops */ if (content->cv == NULL) { - content->cv = (realtype *) malloc((content->maxl+1)*sizeof(realtype)); + content->cv = (sunrealtype *) malloc((content->maxl+1)*sizeof(sunrealtype)); if (content->cv == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -406,12 +406,12 @@ int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype delta) + N_Vector b, sunrealtype delta) { /* local data and shortcut variables */ N_Vector *V, *Z, xcor, vtemp, s1, s2; - realtype **Hes, *givens, *yg, *res_norm; - realtype beta, rotation_product, r_norm, s_product, rho; + sunrealtype **Hes, *givens, *yg, *res_norm; + sunrealtype beta, rotation_product, r_norm, s_product, rho; booleantype preOnRight, scale1, scale2, converged; booleantype *zeroguess; int i, j, k, l, l_max, krydim, ier, ntries, max_restarts, gstype; @@ -421,7 +421,7 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, SUNPSolveFn psolve; /* local shortcuts for fused vector operations */ - realtype* cv; + sunrealtype* cv; N_Vector* Xv; /* Initialize some variables */ @@ -722,7 +722,7 @@ int SUNLinSolNumIters_SPFGMR(SUNLinearSolver S) } -realtype SUNLinSolResNorm_SPFGMR(SUNLinearSolver S) +sunrealtype SUNLinSolResNorm_SPFGMR(SUNLinearSolver S) { /* return the stored 'resnorm' value */ if (S == NULL) return(-ONE); diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c index eec1e72e4a..35611eb64d 100644 --- a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c +++ b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c @@ -388,14 +388,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_SPGMR(SUNLinearSolver farg1, SUNMatrix farg SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_SPGMR(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -417,11 +417,11 @@ SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPGMR(SUNLinearSolver farg1) { SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPGMR(SUNLinearSolver farg1) { double fresult ; SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - realtype result; + sunrealtype result; arg1 = (SUNLinearSolver)(farg1); - result = (realtype)SUNLinSolResNorm_SPGMR(arg1); - fresult = (realtype)(result); + result = (sunrealtype)SUNLinSolResNorm_SPGMR(arg1); + fresult = (sunrealtype)(result); return fresult; } diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 3aa0934c13..56accfb679 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -258,7 +258,7 @@ int SUNLinSolInitialize_SPGMR(SUNLinearSolver S) /* Hessenberg matrix Hes */ if (content->Hes == NULL) { - content->Hes = (realtype **) malloc((content->maxl+1)*sizeof(realtype *)); + content->Hes = (sunrealtype **) malloc((content->maxl+1)*sizeof(sunrealtype *)); if (content->Hes == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -266,7 +266,7 @@ int SUNLinSolInitialize_SPGMR(SUNLinearSolver S) for (k=0; k<=content->maxl; k++) { content->Hes[k] = NULL; - content->Hes[k] = (realtype *) malloc(content->maxl*sizeof(realtype)); + content->Hes[k] = (sunrealtype *) malloc(content->maxl*sizeof(sunrealtype)); if (content->Hes[k] == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -276,7 +276,7 @@ int SUNLinSolInitialize_SPGMR(SUNLinearSolver S) /* Givens rotation components */ if (content->givens == NULL) { - content->givens = (realtype *) malloc(2*content->maxl*sizeof(realtype)); + content->givens = (sunrealtype *) malloc(2*content->maxl*sizeof(sunrealtype)); if (content->givens == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -285,7 +285,7 @@ int SUNLinSolInitialize_SPGMR(SUNLinearSolver S) /* y and g vectors */ if (content->yg == NULL) { - content->yg = (realtype *) malloc((content->maxl+1)*sizeof(realtype)); + content->yg = (sunrealtype *) malloc((content->maxl+1)*sizeof(sunrealtype)); if (content->yg == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -294,7 +294,7 @@ int SUNLinSolInitialize_SPGMR(SUNLinearSolver S) /* cv vector for fused vector ops */ if (content->cv == NULL) { - content->cv = (realtype *) malloc((content->maxl+1)*sizeof(realtype)); + content->cv = (sunrealtype *) malloc((content->maxl+1)*sizeof(sunrealtype)); if (content->cv == NULL) { content->last_flag = SUNLS_MEM_FAIL; return(SUNLS_MEM_FAIL); @@ -394,12 +394,12 @@ int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype delta) + N_Vector b, sunrealtype delta) { /* local data and shortcut variables */ N_Vector *V, xcor, vtemp, s1, s2; - realtype **Hes, *givens, *yg, *res_norm; - realtype beta, rotation_product, r_norm, s_product, rho; + sunrealtype **Hes, *givens, *yg, *res_norm; + sunrealtype beta, rotation_product, r_norm, s_product, rho; booleantype preOnLeft, preOnRight, scale2, scale1, converged; booleantype *zeroguess; int i, j, k, l, l_plus_1, l_max, krydim, ier, ntries, max_restarts, gstype; @@ -409,7 +409,7 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, SUNPSolveFn psolve; /* local shortcuts for fused vector operations */ - realtype* cv; + sunrealtype* cv; N_Vector* Xv; /* Initialize some variables */ @@ -775,7 +775,7 @@ int SUNLinSolNumIters_SPGMR(SUNLinearSolver S) } -realtype SUNLinSolResNorm_SPGMR(SUNLinearSolver S) +sunrealtype SUNLinSolResNorm_SPGMR(SUNLinearSolver S) { /* return the stored 'resnorm' value */ if (S == NULL) return(-ONE); diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c index ebc9c85d8b..b8def5d190 100644 --- a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c +++ b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c @@ -374,14 +374,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_SPTFQMR(SUNLinearSolver farg1, SUNMatrix fa SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_SPTFQMR(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -403,11 +403,11 @@ SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPTFQMR(SUNLinearSolver farg1) { SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPTFQMR(SUNLinearSolver farg1) { double fresult ; SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - realtype result; + sunrealtype result; arg1 = (SUNLinearSolver)(farg1); - result = (realtype)SUNLinSolResNorm_SPTFQMR(arg1); - fresult = (realtype)(result); + result = (sunrealtype)SUNLinSolResNorm_SPTFQMR(arg1); + fresult = (sunrealtype)(result); return fresult; } diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 47c6544819..2a8049d9a5 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -333,25 +333,25 @@ int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype delta) + N_Vector b, sunrealtype delta) { /* local data and shortcut variables */ - realtype alpha, tau, eta, beta, c, sigma, v_bar, omega; - realtype rho[2]; - realtype r_init_norm, r_curr_norm; - realtype temp_val; + sunrealtype alpha, tau, eta, beta, c, sigma, v_bar, omega; + sunrealtype rho[2]; + sunrealtype r_init_norm, r_curr_norm; + sunrealtype temp_val; booleantype preOnLeft, preOnRight, scale_x, scale_b, converged, b_ok; booleantype *zeroguess; int n, m, ier, l_max; void *A_data, *P_data; SUNATimesFn atimes; SUNPSolveFn psolve; - realtype *res_norm; + sunrealtype *res_norm; int *nli; N_Vector sx, sb, r_star, q, d, v, p, *r, u, vtemp1, vtemp2, vtemp3; /* local variables for fused vector operations */ - realtype cv[3]; + sunrealtype cv[3]; N_Vector Xv[3]; /* Make local shorcuts to solver variables. */ @@ -817,7 +817,7 @@ int SUNLinSolNumIters_SPTFQMR(SUNLinearSolver S) } -realtype SUNLinSolResNorm_SPTFQMR(SUNLinearSolver S) +sunrealtype SUNLinSolResNorm_SPTFQMR(SUNLinearSolver S) { /* return the stored 'resnorm' value */ if (S == NULL) return(-ONE); diff --git a/src/sunlinsol/superludist/sunlinsol_superludist.c b/src/sunlinsol/superludist/sunlinsol_superludist.c index 4540f413a5..051a462cb2 100644 --- a/src/sunlinsol/superludist/sunlinsol_superludist.c +++ b/src/sunlinsol/superludist/sunlinsol_superludist.c @@ -118,7 +118,7 @@ SUNLinearSolver SUNLinSol_SuperLUDIST(N_Vector y, SUNMatrix A, gridinfo_t *grid, * ----------------------------------------------------------------- */ -realtype SUNLinSol_SuperLUDIST_GetBerr(SUNLinearSolver LS) +sunrealtype SUNLinSol_SuperLUDIST_GetBerr(SUNLinearSolver LS) { return(SLU_BERR(LS)); } @@ -199,10 +199,10 @@ int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_SuperLUDIST(SUNLinearSolver S, SUNMatrix A, - N_Vector x, N_Vector b, realtype tol) + N_Vector x, N_Vector b, sunrealtype tol) { int retval; - realtype *xdata; + sunrealtype *xdata; SuperMatrix *Asuper; NRformat_loc *Astore; diff --git a/src/sunlinsol/superlumt/sunlinsol_superlumt.c b/src/sunlinsol/superlumt/sunlinsol_superlumt.c index c63a46a171..b4a758c0fa 100644 --- a/src/sunlinsol/superlumt/sunlinsol_superlumt.c +++ b/src/sunlinsol/superlumt/sunlinsol_superlumt.c @@ -281,10 +281,10 @@ int SUNLinSolSetup_SuperLUMT(SUNLinearSolver S, SUNMatrix A) int SUNLinSolSolve_SuperLUMT(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { int_t retval; - realtype *xdata; + sunrealtype *xdata; DNformat *Bstore; trans_t trans; diff --git a/src/sunmatrix/band/fmod/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod/fsunmatrix_band_mod.c index edae3c0c1e..b22e62ca89 100644 --- a/src/sunmatrix/band/fmod/fsunmatrix_band_mod.c +++ b/src/sunmatrix/band/fmod/fsunmatrix_band_mod.c @@ -343,10 +343,10 @@ SWIGEXPORT int64_t _wrap_FSUNBandMatrix_LData(SUNMatrix farg1) { SWIGEXPORT void * _wrap_FSUNBandMatrix_Cols(SUNMatrix farg1) { void * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype **result = 0 ; + sunrealtype **result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype **)SUNBandMatrix_Cols(arg1); + result = (sunrealtype **)SUNBandMatrix_Cols(arg1); fresult = result; return fresult; } @@ -412,12 +412,12 @@ SWIGEXPORT int _wrap_FSUNMatCopy_Band(SUNMatrix farg1, SUNMatrix farg2) { SWIGEXPORT int _wrap_FSUNMatScaleAdd_Band(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; SUNMatrix arg3 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); arg3 = (SUNMatrix)(farg3); result = (int)SUNMatScaleAdd_Band(arg1,arg2,arg3); @@ -428,11 +428,11 @@ SWIGEXPORT int _wrap_FSUNMatScaleAdd_Band(double const *farg1, SUNMatrix farg2, SWIGEXPORT int _wrap_FSUNMatScaleAddI_Band(double const *farg1, SUNMatrix farg2) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); result = (int)SUNMatScaleAddI_Band(arg1,arg2); fresult = (int)(result); @@ -476,10 +476,10 @@ SWIGEXPORT int _wrap_FSUNMatSpace_Band(SUNMatrix farg1, long *farg2, long *farg3 SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype *)SUNBandMatrix_Data(arg1); + result = (sunrealtype *)SUNBandMatrix_Data(arg1); fresult = result; return fresult; } @@ -488,11 +488,11 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const * double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)SUNBandMatrix_Column(arg1,arg2); + result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); fresult = result; return fresult; } diff --git a/src/sunmatrix/band/sunmatrix_band.c b/src/sunmatrix/band/sunmatrix_band.c index 0b5dd613f0..cbf2a29a20 100644 --- a/src/sunmatrix/band/sunmatrix_band.c +++ b/src/sunmatrix/band/sunmatrix_band.c @@ -33,7 +33,7 @@ /* Private function prototypes */ static booleantype SMCompatible_Band(SUNMatrix A, SUNMatrix B); static booleantype SMCompatible2_Band(SUNMatrix A, N_Vector x, N_Vector y); -static int SMScaleAddNew_Band(realtype c, SUNMatrix A, SUNMatrix B); +static int SMScaleAddNew_Band(sunrealtype c, SUNMatrix A, SUNMatrix B); /* @@ -104,10 +104,10 @@ SUNMatrix SUNBandMatrixStorage(sunindextype N, sunindextype mu, content->cols = NULL; /* Allocate content */ - content->data = (realtype *) calloc(N * colSize, sizeof(realtype)); + content->data = (sunrealtype *) calloc(N * colSize, sizeof(sunrealtype)); if (content->data == NULL) { SUNMatDestroy(A); return(NULL); } - content->cols = (realtype **) malloc(N * sizeof(realtype *)); + content->cols = (sunrealtype **) malloc(N * sizeof(sunrealtype *)); if (content->cols == NULL) { SUNMatDestroy(A); return(NULL); } for (j=0; jcols[j] = content->data + j * colSize; @@ -209,7 +209,7 @@ sunindextype SUNBandMatrix_LData(SUNMatrix A) return SUNMAT_ILL_INPUT; } -realtype* SUNBandMatrix_Data(SUNMatrix A) +sunrealtype* SUNBandMatrix_Data(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_BAND) return SM_DATA_B(A); @@ -217,7 +217,7 @@ realtype* SUNBandMatrix_Data(SUNMatrix A) return NULL; } -realtype** SUNBandMatrix_Cols(SUNMatrix A) +sunrealtype** SUNBandMatrix_Cols(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_BAND) return SM_COLS_B(A); @@ -225,7 +225,7 @@ realtype** SUNBandMatrix_Cols(SUNMatrix A) return NULL; } -realtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j) +sunrealtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j) { if (SUNMatGetID(A) == SUNMATRIX_BAND) return SM_COLUMN_B(A,j); @@ -282,7 +282,7 @@ void SUNMatDestroy_Band(SUNMatrix A) int SUNMatZero_Band(SUNMatrix A) { sunindextype i; - realtype *Adata; + sunrealtype *Adata; /* Verify that A is a band matrix */ if (SUNMatGetID(A) != SUNMATRIX_BAND) @@ -298,7 +298,7 @@ int SUNMatZero_Band(SUNMatrix A) int SUNMatCopy_Band(SUNMatrix A, SUNMatrix B) { sunindextype i, j, colSize, ml, mu, smu; - realtype *A_colj, *B_colj; + sunrealtype *A_colj, *B_colj; /* Verify that A and B have compatible dimensions */ if (!SMCompatible_Band(A, B)) @@ -316,8 +316,8 @@ int SUNMatCopy_Band(SUNMatrix A, SUNMatrix B) SM_CONTENT_B(B)->s_mu = smu; SM_CONTENT_B(B)->ldim = colSize; SM_CONTENT_B(B)->ldata = SM_COLUMNS_B(B) * colSize; - SM_CONTENT_B(B)->data = (realtype *) - realloc(SM_CONTENT_B(B)->data, SM_COLUMNS_B(B) * colSize*sizeof(realtype)); + SM_CONTENT_B(B)->data = (sunrealtype *) + realloc(SM_CONTENT_B(B)->data, SM_COLUMNS_B(B) * colSize*sizeof(sunrealtype)); for (j=0; jcols[j] = SM_CONTENT_B(B)->data + j * colSize; } @@ -334,10 +334,10 @@ int SUNMatCopy_Band(SUNMatrix A, SUNMatrix B) return SUNMAT_SUCCESS; } -int SUNMatScaleAddI_Band(realtype c, SUNMatrix A) +int SUNMatScaleAddI_Band(sunrealtype c, SUNMatrix A) { sunindextype i, j; - realtype *A_colj; + sunrealtype *A_colj; /* Verify that A is a band matrix */ if (SUNMatGetID(A) != SUNMATRIX_BAND) @@ -353,10 +353,10 @@ int SUNMatScaleAddI_Band(realtype c, SUNMatrix A) return SUNMAT_SUCCESS; } -int SUNMatScaleAdd_Band(realtype c, SUNMatrix A, SUNMatrix B) +int SUNMatScaleAdd_Band(sunrealtype c, SUNMatrix A, SUNMatrix B) { sunindextype i, j; - realtype *A_colj, *B_colj; + sunrealtype *A_colj, *B_colj; /* Verify that A and B are compatible */ if (!SMCompatible_Band(A, B)) @@ -381,7 +381,7 @@ int SUNMatScaleAdd_Band(realtype c, SUNMatrix A, SUNMatrix B) int SUNMatMatvec_Band(SUNMatrix A, N_Vector x, N_Vector y) { sunindextype i, j, is, ie; - realtype *col_j, *xd, *yd; + sunrealtype *col_j, *xd, *yd; /* Verify that A, x and y are compatible */ if (!SMCompatible2_Band(A, x, y)) @@ -458,10 +458,10 @@ static booleantype SMCompatible2_Band(SUNMatrix A, N_Vector x, N_Vector y) } -int SMScaleAddNew_Band(realtype c, SUNMatrix A, SUNMatrix B) +int SMScaleAddNew_Band(sunrealtype c, SUNMatrix A, SUNMatrix B) { sunindextype i, j, ml, mu, smu; - realtype *A_colj, *B_colj, *C_colj; + sunrealtype *A_colj, *B_colj, *C_colj; SUNMatrix C; /* create new matrix large enough to hold both A and B */ diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index a986fe7041..db8dd635c5 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -71,7 +71,7 @@ static cusparseStatus_t CreateSpMatDescr(SUNMatrix, cusparseSpMatDescr_t*); #define SMCU_SPARSETYPE(A) ( SMCU_CONTENT(A)->sparse_type ) #define SMCU_OWNMATD(A) ( SMCU_CONTENT(A)->own_matd ) #define SMCU_DATA(A) ( SMCU_CONTENT(A)->data ) -#define SMCU_DATAp(A) ( (realtype*)SMCU_CONTENT(A)->data->ptr ) +#define SMCU_DATAp(A) ( (sunrealtype*)SMCU_CONTENT(A)->data->ptr ) #define SMCU_INDEXVALS(A) ( SMCU_CONTENT(A)->colind ) #define SMCU_INDEXPTRS(A) ( SMCU_CONTENT(A)->rowptrs ) #define SMCU_INDEXVALSp(A) ( (int*) SMCU_CONTENT(A)->colind->ptr ) @@ -170,7 +170,7 @@ SUNMatrix SUNMatrix_cuSparse_NewCSR(int M, int N, int NNZ, cusparseHandle_t cusp sizeof(int)*(M+1), SUNMEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, - sizeof(realtype)*NNZ, SUNMEMTYPE_DEVICE, + sizeof(sunrealtype)*NNZ, SUNMEMTYPE_DEVICE, nullptr); if (alloc_fail) { @@ -265,7 +265,7 @@ SUNMatrix SUNMatrix_cuSparse_NewCSR(int M, int N, int NNZ, cusparseHandle_t cusp SUNMatrix SUNMatrix_cuSparse_MakeCSR(cusparseMatDescr_t mat_descr, int M, int N, int NNZ, - int *rowptrs , int *colind , realtype *data, + int *rowptrs , int *colind , sunrealtype *data, cusparseHandle_t cusp, SUNContext sunctx) { /* return with NULL matrix on illegal input */ @@ -403,7 +403,7 @@ SUNMatrix SUNMatrix_cuSparse_NewBlockCSR(int nblocks, int blockrows, int blockco sizeof(int)*(blockrows + 1), SUNMEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, - sizeof(realtype)*blocknnz*nblocks, + sizeof(sunrealtype)*blocknnz*nblocks, SUNMEMTYPE_DEVICE, nullptr); if (alloc_fail) { @@ -548,7 +548,7 @@ int* SUNMatrix_cuSparse_IndexValues(SUNMatrix A) return(NULL); } -realtype* SUNMatrix_cuSparse_Data(SUNMatrix A) +sunrealtype* SUNMatrix_cuSparse_Data(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_CUSPARSE) return(SMCU_DATAp(A)); @@ -588,9 +588,9 @@ int SUNMatrix_cuSparse_BlockNNZ(SUNMatrix A) return(SUNMAT_ILL_INPUT); } -realtype* SUNMatrix_cuSparse_BlockData(SUNMatrix A, int blockidx) +sunrealtype* SUNMatrix_cuSparse_BlockData(SUNMatrix A, int blockidx) { - realtype *matdata; + sunrealtype *matdata; int offset; if (SUNMatGetID(A) != SUNMATRIX_CUSPARSE) @@ -640,7 +640,7 @@ int SUNMatrix_cuSparse_SetKernelExecPolicy(SUNMatrix A, SUNCudaExecPolicy* exec_ } -int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, realtype* h_data, +int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, int* h_idxptrs, int* h_idxvals) { int retval; @@ -659,7 +659,7 @@ int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, realtype* h_data, retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_DATA(dA), _h_data, - SMCU_NNZ(dA)*sizeof(realtype), + SMCU_NNZ(dA)*sizeof(sunrealtype), (void*) stream); SUNMemoryHelper_Dealloc(SMCU_MEMHELP(dA), _h_data, nullptr); if (retval != 0) return(SUNMAT_OPERATION_FAIL); @@ -708,7 +708,7 @@ int SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, realtype* h_data, } -int SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, realtype* h_data, +int SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, int* h_idxptrs, int* h_idxvals) { int retval; @@ -727,7 +727,7 @@ int SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, realtype* h_data, retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_data, SMCU_DATA(dA), - SMCU_NNZ(dA)*sizeof(realtype), + SMCU_NNZ(dA)*sizeof(sunrealtype), (void*) stream); SUNMemoryHelper_Dealloc(SMCU_MEMHELP(dA), _h_data, nullptr); if (retval != 0) return(SUNMAT_OPERATION_FAIL); @@ -876,7 +876,7 @@ int SUNMatZero_cuSparse(SUNMatrix A) stream = *SMCU_EXECPOLICY(A)->stream(); /* set all data to zero */ - cuerr = cudaMemsetAsync(SMCU_DATAp(A), 0, SMCU_NNZ(A)*sizeof(realtype), stream); + cuerr = cudaMemsetAsync(SMCU_DATAp(A), 0, SMCU_NNZ(A)*sizeof(sunrealtype), stream); if (!SUNDIALS_CUDA_VERIFY(cuerr)) return(SUNMAT_OPERATION_FAIL); /* set all rowptrs to zero unless the sparsity pattern is fixed */ @@ -929,7 +929,7 @@ int SUNMatCopy_cuSparse(SUNMatrix src, SUNMatrix dst) retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(src), SMCU_DATA(dst), SMCU_DATA(src), - SMCU_NNZ(src)*sizeof(realtype), + SMCU_NNZ(src)*sizeof(sunrealtype), (void*) stream); if (retval) return(SUNMAT_OPERATION_FAIL); @@ -954,7 +954,7 @@ int SUNMatCopy_cuSparse(SUNMatrix src, SUNMatrix dst) /* Performs A = cA + I. Requires the diagonal to be allocated already. */ -int SUNMatScaleAddI_cuSparse(realtype c, SUNMatrix A) +int SUNMatScaleAddI_cuSparse(sunrealtype c, SUNMatrix A) { unsigned threadsPerBlock, gridSize; cudaStream_t stream = *SMCU_EXECPOLICY(A)->stream(); @@ -967,7 +967,7 @@ int SUNMatScaleAddI_cuSparse(realtype c, SUNMatrix A) that results in enough threads to have one per 2 columns. */ threadsPerBlock = SMCU_EXECPOLICY(A)->blockSize(SMCU_COLUMNS(A)/2); gridSize = SMCU_EXECPOLICY(A)->gridSize(SMCU_ROWS(A)*SMCU_COLUMNS(A)/2, threadsPerBlock); - scaleAddIKernelCSR + scaleAddIKernelCSR <<>>(SMCU_ROWS(A), c, SMCU_DATAp(A), @@ -980,7 +980,7 @@ int SUNMatScaleAddI_cuSparse(realtype c, SUNMatrix A) that results in enough threads to have one per row of the block. */ threadsPerBlock = SMCU_EXECPOLICY(A)->blockSize(SMCU_BLOCKROWS(A)); gridSize = SMCU_EXECPOLICY(A)->gridSize(SMCU_NBLOCKS(A)*SMCU_BLOCKROWS(A), threadsPerBlock); - scaleAddIKernelBCSR + scaleAddIKernelBCSR <<>>(SMCU_BLOCKROWS(A), SMCU_NBLOCKS(A), SMCU_BLOCKNNZ(A), @@ -1004,7 +1004,7 @@ int SUNMatScaleAddI_cuSparse(realtype c, SUNMatrix A) /* Performs A = cA + B */ -int SUNMatScaleAdd_cuSparse(realtype c, SUNMatrix A, SUNMatrix B) +int SUNMatScaleAdd_cuSparse(sunrealtype c, SUNMatrix A, SUNMatrix B) { cudaStream_t stream; unsigned threadsPerBlock, gridSize; @@ -1025,7 +1025,7 @@ int SUNMatScaleAdd_cuSparse(realtype c, SUNMatrix A, SUNMatrix B) that results in enough threads to have one per 2 columns. */ threadsPerBlock = SMCU_EXECPOLICY(A)->blockSize(SMCU_COLUMNS(A)/2); gridSize = SMCU_EXECPOLICY(A)->gridSize(SMCU_ROWS(A)*SMCU_COLUMNS(A)/2, threadsPerBlock); - scaleAddKernelCSR + scaleAddKernelCSR <<>>(SMCU_NNZ(A), c, SMCU_DATAp(A), @@ -1037,7 +1037,7 @@ int SUNMatScaleAdd_cuSparse(realtype c, SUNMatrix A, SUNMatrix B) that results in enough threads to have one per row of the block. */ threadsPerBlock = SMCU_EXECPOLICY(A)->blockSize(SMCU_BLOCKROWS(A)); gridSize = SMCU_EXECPOLICY(A)->gridSize(SMCU_NBLOCKS(A)*SMCU_BLOCKROWS(A), threadsPerBlock); - scaleAddKernelCSR + scaleAddKernelCSR <<>>(SMCU_NNZ(A), c, SMCU_DATAp(A), @@ -1060,8 +1060,8 @@ int SUNMatScaleAdd_cuSparse(realtype c, SUNMatrix A, SUNMatrix B) int SUNMatMatvecSetup_cuSparse(SUNMatrix A) { #if CUDART_VERSION >= 11000 - realtype placeholder[1]; - const realtype one = ONE; + sunrealtype placeholder[1]; + const sunrealtype one = ONE; /* Check if setup has already been done */ if (!(SMCU_CONTENT(A)->matvec_issetup)) @@ -1102,12 +1102,12 @@ int SUNMatMatvec_cuSparse(SUNMatrix A, N_Vector x, N_Vector y) return(SUNMAT_ILL_INPUT); } - realtype *d_xdata = N_VGetDeviceArrayPointer(x); - realtype *d_ydata = N_VGetDeviceArrayPointer(y); + sunrealtype *d_xdata = N_VGetDeviceArrayPointer(x); + sunrealtype *d_ydata = N_VGetDeviceArrayPointer(y); if (SMCU_SPARSETYPE(A) == SUNMAT_CUSPARSE_CSR) { - const realtype one = ONE; + const sunrealtype one = ONE; /* Zero result vector */ N_VConst(ZERO, y); @@ -1153,7 +1153,7 @@ int SUNMatMatvec_cuSparse(SUNMatrix A, N_Vector x, N_Vector y) that results in enough threads to have one per row of the block. */ threadsPerBlock = SMCU_EXECPOLICY(A)->blockSize(SMCU_COLUMNS(A)/2); gridSize = SMCU_EXECPOLICY(A)->gridSize(SMCU_ROWS(A)*SMCU_COLUMNS(A)/2, threadsPerBlock); - matvecBCSR + matvecBCSR <<>>(SMCU_BLOCKROWS(A), SMCU_NBLOCKS(A), SMCU_BLOCKNNZ(A), diff --git a/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c index 215c9eb8a0..2575f53579 100644 --- a/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c +++ b/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c @@ -273,10 +273,10 @@ SWIGEXPORT int64_t _wrap_FSUNDenseMatrix_LData(SUNMatrix farg1) { SWIGEXPORT void * _wrap_FSUNDenseMatrix_Cols(SUNMatrix farg1) { void * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype **result = 0 ; + sunrealtype **result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype **)SUNDenseMatrix_Cols(arg1); + result = (sunrealtype **)SUNDenseMatrix_Cols(arg1); fresult = result; return fresult; } @@ -342,12 +342,12 @@ SWIGEXPORT int _wrap_FSUNMatCopy_Dense(SUNMatrix farg1, SUNMatrix farg2) { SWIGEXPORT int _wrap_FSUNMatScaleAdd_Dense(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; SUNMatrix arg3 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); arg3 = (SUNMatrix)(farg3); result = (int)SUNMatScaleAdd_Dense(arg1,arg2,arg3); @@ -358,11 +358,11 @@ SWIGEXPORT int _wrap_FSUNMatScaleAdd_Dense(double const *farg1, SUNMatrix farg2, SWIGEXPORT int _wrap_FSUNMatScaleAddI_Dense(double const *farg1, SUNMatrix farg2) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); result = (int)SUNMatScaleAddI_Dense(arg1,arg2); fresult = (int)(result); @@ -406,10 +406,10 @@ SWIGEXPORT int _wrap_FSUNMatSpace_Dense(SUNMatrix farg1, long *farg2, long *farg SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype *)SUNDenseMatrix_Data(arg1); + result = (sunrealtype *)SUNDenseMatrix_Data(arg1); fresult = result; return fresult; } @@ -418,11 +418,11 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)SUNDenseMatrix_Column(arg1,arg2); + result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); fresult = result; return fresult; } diff --git a/src/sunmatrix/dense/sunmatrix_dense.c b/src/sunmatrix/dense/sunmatrix_dense.c index 43fa9507ef..5cc404da17 100644 --- a/src/sunmatrix/dense/sunmatrix_dense.c +++ b/src/sunmatrix/dense/sunmatrix_dense.c @@ -86,13 +86,13 @@ SUNMatrix SUNDenseMatrix(sunindextype M, sunindextype N, SUNContext sunctx) content->cols = NULL; /* Allocate content */ - content->data = (realtype*)calloc(M * N, sizeof(realtype)); + content->data = (sunrealtype*)calloc(M * N, sizeof(sunrealtype)); if (content->data == NULL) { SUNMatDestroy(A); return (NULL); } - content->cols = (realtype**)malloc(N * sizeof(realtype*)); + content->cols = (sunrealtype**)malloc(N * sizeof(sunrealtype*)); if (content->cols == NULL) { SUNMatDestroy(A); return (NULL); @@ -162,7 +162,7 @@ sunindextype SUNDenseMatrix_LData(SUNMatrix A) return SUNMAT_ILL_INPUT; } -realtype* SUNDenseMatrix_Data(SUNMatrix A) +sunrealtype* SUNDenseMatrix_Data(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_DENSE) return SM_DATA_D(A); @@ -170,7 +170,7 @@ realtype* SUNDenseMatrix_Data(SUNMatrix A) return NULL; } -realtype** SUNDenseMatrix_Cols(SUNMatrix A) +sunrealtype** SUNDenseMatrix_Cols(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_DENSE) return SM_COLS_D(A); @@ -178,7 +178,7 @@ realtype** SUNDenseMatrix_Cols(SUNMatrix A) return NULL; } -realtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j) +sunrealtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j) { if (SUNMatGetID(A) == SUNMATRIX_DENSE) return SM_COLUMN_D(A, j); @@ -236,7 +236,7 @@ void SUNMatDestroy_Dense(SUNMatrix A) int SUNMatZero_Dense(SUNMatrix A) { sunindextype i; - realtype* Adata; + sunrealtype* Adata; /* Perform operation A_ij = 0 */ Adata = SM_DATA_D(A); @@ -261,7 +261,7 @@ int SUNMatCopy_Dense(SUNMatrix A, SUNMatrix B) return SUNMAT_SUCCESS; } -int SUNMatScaleAddI_Dense(realtype c, SUNMatrix A) +int SUNMatScaleAddI_Dense(sunrealtype c, SUNMatrix A) { sunindextype i, j; @@ -277,7 +277,7 @@ int SUNMatScaleAddI_Dense(realtype c, SUNMatrix A) return SUNMAT_SUCCESS; } -int SUNMatScaleAdd_Dense(realtype c, SUNMatrix A, SUNMatrix B) +int SUNMatScaleAdd_Dense(sunrealtype c, SUNMatrix A, SUNMatrix B) { sunindextype i, j; @@ -295,7 +295,7 @@ int SUNMatScaleAdd_Dense(realtype c, SUNMatrix A, SUNMatrix B) int SUNMatMatvec_Dense(SUNMatrix A, N_Vector x, N_Vector y) { sunindextype i, j; - realtype *col_j, *xd, *yd; + sunrealtype *col_j, *xd, *yd; if (!compatibleMatrixAndVectors(A, x, y)) return SUNMAT_ILL_INPUT; diff --git a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp index 1f9274af1d..b0b041a4e8 100644 --- a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp +++ b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp @@ -145,19 +145,19 @@ SUNMatrix SUNMatrix_MagmaDenseBlock(sunindextype nblocks, sunindextype M, sunind /* Allocate data */ retval = SUNMemoryHelper_Alloc(A->memhelp, &A->data, - sizeof(realtype) * A->ldata, memtype, nullptr); + sizeof(sunrealtype) * A->ldata, memtype, nullptr); if (retval) { SUNMatDestroy(Amat); return(NULL); } if (A->nblocks > 1) { /* Allocate array of pointers to block data */ retval = SUNMemoryHelper_Alloc(A->memhelp, &A->blocks, - sizeof(realtype*) * A->nblocks, memtype, + sizeof(sunrealtype*) * A->nblocks, memtype, nullptr); if (retval) { SUNMatDestroy(Amat); return(NULL); } /* Initialize array of pointers to block data */ - magma_xset_pointer(A->q, (realtype**)A->blocks->ptr, (realtype*)A->data->ptr, + magma_xset_pointer(A->q, (sunrealtype**)A->blocks->ptr, (sunrealtype*)A->data->ptr, A->M, 0, 0, A->M*A->N, A->nblocks); } @@ -238,31 +238,31 @@ sunindextype SUNMatrix_MagmaDense_BlockLData(SUNMatrix Amat) return SUNMAT_ILL_INPUT; } -realtype* SUNMatrix_MagmaDense_Data(SUNMatrix Amat) +sunrealtype* SUNMatrix_MagmaDense_Data(SUNMatrix Amat) { SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); if (SUNMatGetID(Amat) == SUNMATRIX_MAGMADENSE) - return((realtype*) A->data->ptr); + return((sunrealtype*) A->data->ptr); else return(NULL); } -realtype** SUNMatrix_MagmaDense_BlockData(SUNMatrix Amat) +sunrealtype** SUNMatrix_MagmaDense_BlockData(SUNMatrix Amat) { SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); if (SUNMatGetID(Amat) == SUNMATRIX_MAGMADENSE) - return((realtype**) A->blocks->ptr); + return((sunrealtype**) A->blocks->ptr); else return(NULL); } -extern realtype* SUNMatrix_MagmaDense_Block(SUNMatrix Amat, sunindextype k); +extern sunrealtype* SUNMatrix_MagmaDense_Block(SUNMatrix Amat, sunindextype k); -extern realtype* SUNMatrix_MagmaDense_Column(SUNMatrix Amat, sunindextype j); +extern sunrealtype* SUNMatrix_MagmaDense_Column(SUNMatrix Amat, sunindextype j); -extern realtype* SUNMatrix_MagmaDense_BlockColumn(SUNMatrix Amat, sunindextype k, sunindextype j); +extern sunrealtype* SUNMatrix_MagmaDense_BlockColumn(SUNMatrix Amat, sunindextype k, sunindextype j); /* * Utility functions @@ -278,7 +278,7 @@ void SUNMatrix_MagmaDense_Print(SUNMatrix Amat) xprint(A->q, A->M, A->N, SUNMatrix_MagmaDense_Block(Amat,k), A->M); } -int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix Amat, realtype* h_data) +int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix Amat, sunrealtype* h_data) { if (SUNMatGetID(Amat) != SUNMATRIX_MAGMADENSE) return(SUNMAT_ILL_INPUT); SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); @@ -291,7 +291,7 @@ int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix Amat, realtype* h_data) retval = SUNMemoryHelper_CopyAsync(A->memhelp, A->data, _h_data, - sizeof(realtype) * A->ldata, + sizeof(sunrealtype) * A->ldata, (void*) &stream); magma_queue_sync(A->q); /* sync with respect to host, but only this stream */ @@ -299,7 +299,7 @@ int SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix Amat, realtype* h_data) return(retval == 0 ? SUNMAT_SUCCESS : SUNMAT_MEM_FAIL); } -int SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix Amat, realtype* h_data) +int SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix Amat, sunrealtype* h_data) { if (SUNMatGetID(Amat) != SUNMATRIX_MAGMADENSE) return(SUNMAT_ILL_INPUT); SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); @@ -312,7 +312,7 @@ int SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix Amat, realtype* h_data) retval = SUNMemoryHelper_CopyAsync(A->memhelp, _h_data, A->data, - sizeof(realtype) * A->ldata, + sizeof(sunrealtype) * A->ldata, (void*) &stream); magma_queue_sync(A->q); /* sync with respect to host, but only this stream */ @@ -400,7 +400,7 @@ int SUNMatZero_MagmaDense(SUNMatrix Amat) SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); /* Zero out matrix */ - SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(zeroKernel), + SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(zeroKernel), dim3(std::min(A->nblocks,INT_MAX),1,1), SUNDIALS_HIP_OR_CUDA( dim3(1,16,16), dim3(1,16,32) ), /* We choose slightly larger thread blocks when using HIP since the warps are larger */ 0, @@ -408,7 +408,7 @@ int SUNMatZero_MagmaDense(SUNMatrix Amat) A->M, A->N, A->nblocks, - (realtype*) A->data->ptr + (sunrealtype*) A->data->ptr ); return(SUNMAT_SUCCESS); @@ -428,7 +428,7 @@ int SUNMatCopy_MagmaDense(SUNMatrix Amat, SUNMatrix Bmat) return SUNMAT_ILL_INPUT; /* Copy A into B */ - SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(copyKernel), + SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(copyKernel), dim3(std::min(A->nblocks,INT_MAX),1,1), SUNDIALS_HIP_OR_CUDA( dim3(1,16,16), dim3(1,16,32) ), 0, @@ -436,14 +436,14 @@ int SUNMatCopy_MagmaDense(SUNMatrix Amat, SUNMatrix Bmat) A->M, A->N, A->nblocks, - (const realtype*) A->data->ptr, - (realtype*) B->data->ptr + (const sunrealtype*) A->data->ptr, + (sunrealtype*) B->data->ptr ); return(SUNMAT_SUCCESS); } -int SUNMatScaleAddI_MagmaDense(realtype c, SUNMatrix Amat) +int SUNMatScaleAddI_MagmaDense(sunrealtype c, SUNMatrix Amat) { if (Amat == NULL) return(SUNMAT_ILL_INPUT); @@ -452,7 +452,7 @@ int SUNMatScaleAddI_MagmaDense(realtype c, SUNMatrix Amat) SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); - SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(scaleAddIKernel), + SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(scaleAddIKernel), dim3(std::min(A->nblocks,INT_MAX),1,1), SUNDIALS_HIP_OR_CUDA( dim3(1,16,16), dim3(1,16,32) ), 0, @@ -461,13 +461,13 @@ int SUNMatScaleAddI_MagmaDense(realtype c, SUNMatrix Amat) A->N, A->nblocks, c, - (realtype*) A->data->ptr + (sunrealtype*) A->data->ptr ); return(SUNMAT_SUCCESS); } -int SUNMatScaleAdd_MagmaDense(realtype c, SUNMatrix Amat, SUNMatrix Bmat) +int SUNMatScaleAdd_MagmaDense(sunrealtype c, SUNMatrix Amat, SUNMatrix Bmat) { if ((Amat == NULL) || (Bmat == NULL)) return(SUNMAT_ILL_INPUT); @@ -478,7 +478,7 @@ int SUNMatScaleAdd_MagmaDense(realtype c, SUNMatrix Amat, SUNMatrix Bmat) SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); SUNMatrixContent_MagmaDense B = SMLD_CONTENT(Bmat); - SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(scaleAddKernel), + SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(scaleAddKernel), dim3(std::min(A->nblocks,INT_MAX),1,1), SUNDIALS_HIP_OR_CUDA( dim3(1,16,16), dim3(1,16,32) ), 0, @@ -487,8 +487,8 @@ int SUNMatScaleAdd_MagmaDense(realtype c, SUNMatrix Amat, SUNMatrix Bmat) A->N, A->nblocks, c, - (realtype*) A->data->ptr, - (const realtype*) B->data->ptr + (sunrealtype*) A->data->ptr, + (const sunrealtype*) B->data->ptr ); return(SUNMAT_SUCCESS); @@ -507,13 +507,13 @@ int SUNMatMatvecSetup_MagmaDense(SUNMatrix Amat) /* Allocate array of pointers to blocks on device */ if (A->xblocks == NULL) retval = SUNMemoryHelper_Alloc(A->memhelp, &A->xblocks, - sizeof(realtype*) * A->nblocks, + sizeof(sunrealtype*) * A->nblocks, A->data->type, nullptr); if (retval) return(SUNMAT_MEM_FAIL); if (A->yblocks == NULL) retval = SUNMemoryHelper_Alloc(A->memhelp, &A->yblocks, - sizeof(realtype*) * A->nblocks, + sizeof(sunrealtype*) * A->nblocks, A->data->type, nullptr); if (retval) return(SUNMAT_MEM_FAIL); } @@ -534,7 +534,7 @@ int SUNMatMatvec_MagmaDense(SUNMatrix Amat, N_Vector x, N_Vector y) if (A->nblocks > 1) { /* First, we need to create an array of pointers to the matrix and vector blocks */ - SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(getBlockPointers), + SUNDIALS_LAUNCH_KERNEL(SUNDIALS_KERNEL_NAME(getBlockPointers), A->nblocks, 256, 0, @@ -542,12 +542,12 @@ int SUNMatMatvec_MagmaDense(SUNMatrix Amat, N_Vector x, N_Vector y) A->M, A->N, A->nblocks, - (realtype*)A->data->ptr, - (realtype**)A->blocks->ptr, - (realtype*)N_VGetDeviceArrayPointer(x), - (realtype**)A->xblocks->ptr, - (realtype*)N_VGetDeviceArrayPointer(y), - (realtype**)A->yblocks->ptr + (sunrealtype*)A->data->ptr, + (sunrealtype**)A->blocks->ptr, + (sunrealtype*)N_VGetDeviceArrayPointer(x), + (sunrealtype**)A->xblocks->ptr, + (sunrealtype*)N_VGetDeviceArrayPointer(y), + (sunrealtype**)A->yblocks->ptr ); /* Now we can use a batched gemv to do y = alpha*A*x + beta*y where A is block diagonal */ @@ -557,12 +557,12 @@ int SUNMatMatvec_MagmaDense(SUNMatrix Amat, N_Vector x, N_Vector y) A->M, /* number of rows for a block */ A->N, /* number of cols for a block */ ONE, /* alpha */ - (realtype**)A->blocks->ptr, + (sunrealtype**)A->blocks->ptr, A->M, /* leading dimension of A */ - (realtype**)A->xblocks->ptr, + (sunrealtype**)A->xblocks->ptr, 1, /* increment (stride) of xblocks */ ZERO, /* beta */ - (realtype**)A->yblocks->ptr, + (sunrealtype**)A->yblocks->ptr, 1, /* increment (stride) of yblocks */ A->nblocks /* number of blocks */ ); @@ -576,12 +576,12 @@ int SUNMatMatvec_MagmaDense(SUNMatrix Amat, N_Vector x, N_Vector y) A->M, /* number of rows */ A->N, /* number of cols */ ONE, /* alpha */ - (const realtype*)A->data->ptr, + (const sunrealtype*)A->data->ptr, A->M, /* leading dimension of A */ - (const realtype*)N_VGetDeviceArrayPointer(x), + (const sunrealtype*)N_VGetDeviceArrayPointer(x), 1, /* increment for x data */ ZERO, /* beta */ - (realtype*)N_VGetDeviceArrayPointer(y), + (sunrealtype*)N_VGetDeviceArrayPointer(y), 1 /* increment for y data */ ); } diff --git a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp index 7306ea68bc..9c751b205a 100644 --- a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp +++ b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp @@ -48,9 +48,9 @@ #define MAT_NBLOCKS(A) (MAT_CONTENT(A)->num_blocks) #define MAT_LDATA(A) (MAT_CONTENT(A)->ldata) #define MAT_DATA(A) (MAT_CONTENT(A)->data) -#define MAT_DATAp(A) ((realtype*) MAT_CONTENT(A)->data->ptr) +#define MAT_DATAp(A) ((sunrealtype*) MAT_CONTENT(A)->data->ptr) #define MAT_BLOCKS(A) (MAT_CONTENT(A)->blocks) -#define MAT_BLOCKSp(A) ((realtype**) MAT_CONTENT(A)->blocks->ptr) +#define MAT_BLOCKSp(A) ((sunrealtype**) MAT_CONTENT(A)->blocks->ptr) #define MAT_EXECPOLICY(A) (MAT_CONTENT(A)->exec_policy) #define MAT_MEMTYPE(A) (MAT_CONTENT(A)->mem_type) #define MAT_MEMHELPER(A) (MAT_CONTENT(A)->mem_helper) @@ -140,7 +140,7 @@ SUNMatrix SUNMatrix_OneMklDenseBlock(sunindextype num_blocks, sunindextype M, // Allocate data retval = SUNMemoryHelper_Alloc(MAT_MEMHELPER(A), &(MAT_DATA(A)), - sizeof(realtype) * MAT_LDATA(A), mem_type, + sizeof(sunrealtype) * MAT_LDATA(A), mem_type, queue); if (retval) { @@ -153,7 +153,7 @@ SUNMatrix SUNMatrix_OneMklDenseBlock(sunindextype num_blocks, sunindextype M, { // Allocate array of pointers to block data retval = SUNMemoryHelper_Alloc(MAT_MEMHELPER(A), &(MAT_BLOCKS(A)), - sizeof(realtype*) * MAT_NBLOCKS(A), mem_type, + sizeof(sunrealtype*) * MAT_NBLOCKS(A), mem_type, queue); if (retval) { @@ -171,8 +171,8 @@ SUNMatrix SUNMatrix_OneMklDenseBlock(sunindextype num_blocks, sunindextype M, return NULL; } - realtype* Adata = MAT_DATAp(A); - realtype** Ablocks = MAT_BLOCKSp(A); + sunrealtype* Adata = MAT_DATAp(A); + sunrealtype** Ablocks = MAT_BLOCKSp(A); // Initialize array of pointers to block data SYCL_FOR(queue, nthreads_total, nthreads_per_block, item, @@ -245,7 +245,7 @@ sunindextype SUNMatrix_OneMklDense_LData(SUNMatrix A) } -realtype* SUNMatrix_OneMklDense_Data(SUNMatrix A) +sunrealtype* SUNMatrix_OneMklDense_Data(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_ONEMKLDENSE) return MAT_DATAp(A); @@ -263,7 +263,7 @@ sunindextype SUNMatrix_OneMklDense_BlockLData(SUNMatrix A) } -realtype** SUNMatrix_OneMklDense_BlockData(SUNMatrix A) +sunrealtype** SUNMatrix_OneMklDense_BlockData(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_ONEMKLDENSE) return MAT_BLOCKSp(A); @@ -276,11 +276,11 @@ realtype** SUNMatrix_OneMklDense_BlockData(SUNMatrix A) column. These are defined as inline functions in sunmatrix_onemkldense.h, so we just mark them as extern here. */ -extern realtype* SUNMatrix_OneMklDense_Block(SUNMatrix A, sunindextype k); +extern sunrealtype* SUNMatrix_OneMklDense_Block(SUNMatrix A, sunindextype k); -extern realtype* SUNMatrix_OneMklDense_Column(SUNMatrix A, sunindextype j); +extern sunrealtype* SUNMatrix_OneMklDense_Column(SUNMatrix A, sunindextype j); -extern realtype* SUNMatrix_OneMklDense_BlockColumn(SUNMatrix A, sunindextype k, +extern sunrealtype* SUNMatrix_OneMklDense_BlockColumn(SUNMatrix A, sunindextype k, sunindextype j); @@ -289,7 +289,7 @@ extern realtype* SUNMatrix_OneMklDense_BlockColumn(SUNMatrix A, sunindextype k, * -------------------------------------------------------------------------- */ -int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, realtype* h_data) +int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data) { if (SUNMatGetID(A) != SUNMATRIX_ONEMKLDENSE) { @@ -309,7 +309,7 @@ int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, realtype* h_data) int copy_fail = SUNMemoryHelper_CopyAsync(MAT_MEMHELPER(A), MAT_DATA(A), _h_data, - sizeof(realtype) * MAT_LDATA(A), + sizeof(sunrealtype) * MAT_LDATA(A), MAT_QUEUE(A)); // Sync with respect to host, but only this queue @@ -326,7 +326,7 @@ int SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, realtype* h_data) } -int SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, realtype* h_data) +int SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data) { if (SUNMatGetID(A) != SUNMATRIX_ONEMKLDENSE) { @@ -344,7 +344,7 @@ int SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, realtype* h_data) int copy_fail = SUNMemoryHelper_CopyAsync(MAT_MEMHELPER(A), _h_data, MAT_DATA(A), - sizeof(realtype) * MAT_LDATA(A), + sizeof(sunrealtype) * MAT_LDATA(A), MAT_QUEUE(A)); // Sync with respect to host, but only this queue @@ -449,7 +449,7 @@ int SUNMatZero_OneMklDense(SUNMatrix A) } const sunindextype ldata = MAT_LDATA(A); - realtype *Adata = MAT_DATAp(A); + sunrealtype *Adata = MAT_DATAp(A); sycl::queue *Q = MAT_QUEUE(A); size_t nthreads_total, nthreads_per_block; @@ -492,8 +492,8 @@ int SUNMatCopy_OneMklDense(SUNMatrix A, SUNMatrix B) } const sunindextype ldata = MAT_LDATA(A); - realtype *Adata = MAT_DATAp(A); - realtype *Bdata = MAT_DATAp(B); + sunrealtype *Adata = MAT_DATAp(A); + sunrealtype *Bdata = MAT_DATAp(B); sycl::queue *Q = MAT_QUEUE(A); size_t nthreads_total, nthreads_per_block; @@ -514,7 +514,7 @@ int SUNMatCopy_OneMklDense(SUNMatrix A, SUNMatrix B) } -int SUNMatScaleAddI_OneMklDense(realtype c, SUNMatrix A) +int SUNMatScaleAddI_OneMklDense(sunrealtype c, SUNMatrix A) { if (!A) { @@ -531,7 +531,7 @@ int SUNMatScaleAddI_OneMklDense(realtype c, SUNMatrix A) const size_t M = static_cast(MAT_BLOCK_ROWS(A)); const size_t N = static_cast(MAT_BLOCK_COLS(A)); const size_t B = static_cast(MAT_NBLOCKS(A)); - realtype* Adata = MAT_DATAp(A); + sunrealtype* Adata = MAT_DATAp(A); sycl::queue* Q = MAT_QUEUE(A); // Compute A = c * A + I @@ -561,7 +561,7 @@ int SUNMatScaleAddI_OneMklDense(realtype c, SUNMatrix A) } -int SUNMatScaleAdd_OneMklDense(realtype c, SUNMatrix A, SUNMatrix B) +int SUNMatScaleAdd_OneMklDense(sunrealtype c, SUNMatrix A, SUNMatrix B) { if (!A || !B) { @@ -576,8 +576,8 @@ int SUNMatScaleAdd_OneMklDense(realtype c, SUNMatrix A, SUNMatrix B) } const sunindextype ldata = MAT_LDATA(A); - realtype *Adata = MAT_DATAp(A); - realtype *Bdata = MAT_DATAp(B); + sunrealtype *Adata = MAT_DATAp(A); + sunrealtype *Bdata = MAT_DATAp(B); sycl::queue *Q = MAT_QUEUE(A); size_t nthreads_total, nthreads_per_block; @@ -621,9 +621,9 @@ int SUNMatMatvec_OneMklDense(SUNMatrix A, N_Vector x, N_Vector y) // TODO(DJG): Replace with batched function for (sunindextype i = 0; i < MAT_NBLOCKS(A); i++) { - const realtype* Adata = MAT_DATAp(A) + i * M * N; - const realtype* xdata = N_VGetDeviceArrayPointer(x) + i * N; - realtype* ydata = N_VGetDeviceArrayPointer(y) + i * M; + const sunrealtype* Adata = MAT_DATAp(A) + i * M * N; + const sunrealtype* xdata = N_VGetDeviceArrayPointer(x) + i * N; + sunrealtype* ydata = N_VGetDeviceArrayPointer(y) + i * M; // Copmute y = a * A * x + b * y oneapi::mkl::blas::gemv(*Q, oneapi::mkl::transpose::N, M, N, ONE, Adata, @@ -635,9 +635,9 @@ int SUNMatMatvec_OneMklDense(SUNMatrix A, N_Vector x, N_Vector y) sycl::queue* Q = MAT_QUEUE(A); sunindextype M = MAT_ROWS(A); sunindextype N = MAT_COLS(A); - const realtype* Adata = MAT_DATAp(A); - const realtype* xdata = N_VGetDeviceArrayPointer(x); - realtype* ydata = N_VGetDeviceArrayPointer(y); + const sunrealtype* Adata = MAT_DATAp(A); + const sunrealtype* xdata = N_VGetDeviceArrayPointer(x); + sunrealtype* ydata = N_VGetDeviceArrayPointer(y); // Copmute y = a * A * x + b * y oneapi::mkl::blas::gemv(*Q, oneapi::mkl::transpose::N, M, N, ONE, Adata, M, diff --git a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c index 6db53270b9..f7c10af34d 100644 --- a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c +++ b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c @@ -58,7 +58,7 @@ #define SM_FSTROW_SLUNRLOC(A) ( SM_SUPERSTORE_SLUNRLOC(A)->fst_row ) -#define SM_DATA_SLUNRLOC(A) ( (realtype*)SM_SUPERSTORE_SLUNRLOC(A)->nzval ) +#define SM_DATA_SLUNRLOC(A) ( (sunrealtype*)SM_SUPERSTORE_SLUNRLOC(A)->nzval ) #define SM_COLIND_SLUNRLOC(A) ( SM_SUPERSTORE_SLUNRLOC(A)->colind ) @@ -260,7 +260,7 @@ int SUNMatCopy_SLUNRloc(SUNMatrix A, SUNMatrix B) return(SUNMAT_SUCCESS); } -int SUNMatScaleAdd_SLUNRloc(realtype c, SUNMatrix A, SUNMatrix B) +int SUNMatScaleAdd_SLUNRloc(sunrealtype c, SUNMatrix A, SUNMatrix B) { /* check that B can be added into A */ if (!SMCompatible_SLUNRloc(A, B)) return(SUNMAT_ILL_INPUT); @@ -271,7 +271,7 @@ int SUNMatScaleAdd_SLUNRloc(realtype c, SUNMatrix A, SUNMatrix B) return(SUNMAT_SUCCESS); } -int SUNMatScaleAddI_SLUNRloc(realtype c, SUNMatrix A) +int SUNMatScaleAddI_SLUNRloc(sunrealtype c, SUNMatrix A) { /* call SuperLU-DIST ScaleAddI function */ dScaleAddId_CompRowLoc_Matrix_dist(SM_SUPERMATRIX_SLUNRLOC(A), c); @@ -281,7 +281,7 @@ int SUNMatScaleAddI_SLUNRloc(realtype c, SUNMatrix A) int SUNMatMatvec_SLUNRloc(SUNMatrix A, N_Vector x, N_Vector y) { SuperMatrix *ACS; - realtype *xdata, *ydata; + sunrealtype *xdata, *ydata; /* Extract the column-sorted A */ ACS = SM_COLSORTED_SLUNRLOC(A); diff --git a/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c b/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c index faf4e71545..62e384a066 100644 --- a/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c +++ b/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c @@ -231,12 +231,12 @@ SWIGEXPORT SUNMatrix _wrap_FSUNSparseMatrix(int64_t const *farg1, int64_t const SWIGEXPORT SUNMatrix _wrap_FSUNSparseFromDenseMatrix(SUNMatrix farg1, double const *farg2, int const *farg3) { SUNMatrix fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; SUNMatrix result; arg1 = (SUNMatrix)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); result = (SUNMatrix)SUNSparseFromDenseMatrix(arg1,arg2,arg3); fresult = result; @@ -247,12 +247,12 @@ SWIGEXPORT SUNMatrix _wrap_FSUNSparseFromDenseMatrix(SUNMatrix farg1, double con SWIGEXPORT SUNMatrix _wrap_FSUNSparseFromBandMatrix(SUNMatrix farg1, double const *farg2, int const *farg3) { SUNMatrix fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int arg3 ; SUNMatrix result; arg1 = (SUNMatrix)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); result = (SUNMatrix)SUNSparseFromBandMatrix(arg1,arg2,arg3); fresult = result; @@ -444,12 +444,12 @@ SWIGEXPORT int _wrap_FSUNMatCopy_Sparse(SUNMatrix farg1, SUNMatrix farg2) { SWIGEXPORT int _wrap_FSUNMatScaleAdd_Sparse(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; SUNMatrix arg3 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); arg3 = (SUNMatrix)(farg3); result = (int)SUNMatScaleAdd_Sparse(arg1,arg2,arg3); @@ -460,11 +460,11 @@ SWIGEXPORT int _wrap_FSUNMatScaleAdd_Sparse(double const *farg1, SUNMatrix farg2 SWIGEXPORT int _wrap_FSUNMatScaleAddI_Sparse(double const *farg1, SUNMatrix farg2) { int fresult ; - realtype arg1 ; + sunrealtype arg1 ; SUNMatrix arg2 = (SUNMatrix) 0 ; int result; - arg1 = (realtype)(*farg1); + arg1 = (sunrealtype)(*farg1); arg2 = (SUNMatrix)(farg2); result = (int)SUNMatScaleAddI_Sparse(arg1,arg2); fresult = (int)(result); @@ -508,10 +508,10 @@ SWIGEXPORT int _wrap_FSUNMatSpace_Sparse(SUNMatrix farg1, long *farg2, long *far SWIGEXPORT double * _wrap_FSUNSparseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype *)SUNSparseMatrix_Data(arg1); + result = (sunrealtype *)SUNSparseMatrix_Data(arg1); fresult = result; return fresult; } diff --git a/src/sunmatrix/sparse/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index efa956f84f..1e518229d6 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -115,7 +115,7 @@ SUNMatrix SUNSparseMatrix(sunindextype M, sunindextype N, content->indexptrs = NULL; /* Allocate content */ - content->data = (realtype *) calloc(NNZ, sizeof(realtype)); + content->data = (sunrealtype *) calloc(NNZ, sizeof(sunrealtype)); if (content->data == NULL) { SUNMatDestroy(A); return(NULL); } content->indexvals = (sunindextype *) calloc(NNZ, sizeof(sunindextype)); @@ -137,7 +137,7 @@ SUNMatrix SUNSparseMatrix(sunindextype M, sunindextype N, * if the request for matrix storage cannot be satisfied. */ -SUNMatrix SUNSparseFromDenseMatrix(SUNMatrix Ad, realtype droptol, +SUNMatrix SUNSparseFromDenseMatrix(SUNMatrix Ad, sunrealtype droptol, int sparsetype) { sunindextype i, j, nnz; @@ -203,7 +203,7 @@ SUNMatrix SUNSparseFromDenseMatrix(SUNMatrix Ad, realtype droptol, * if the request for matrix storage cannot be satisfied. */ -SUNMatrix SUNSparseFromBandMatrix(SUNMatrix Ad, realtype droptol, int sparsetype) +SUNMatrix SUNSparseFromBandMatrix(SUNMatrix Ad, sunrealtype droptol, int sparsetype) { sunindextype i, j, nnz; sunindextype M, N; @@ -311,7 +311,7 @@ int SUNSparseMatrix_Realloc(SUNMatrix A) /* perform reallocation */ SM_INDEXVALS_S(A) = (sunindextype *) realloc(SM_INDEXVALS_S(A), nzmax*sizeof(sunindextype)); - SM_DATA_S(A) = (realtype *) realloc(SM_DATA_S(A), nzmax*sizeof(realtype)); + SM_DATA_S(A) = (sunrealtype *) realloc(SM_DATA_S(A), nzmax*sizeof(sunrealtype)); SM_NNZ_S(A) = nzmax; return SUNMAT_SUCCESS; @@ -335,7 +335,7 @@ int SUNSparseMatrix_Reallocate(SUNMatrix A, sunindextype NNZ) /* perform reallocation */ SM_INDEXVALS_S(A) = (sunindextype *) realloc(SM_INDEXVALS_S(A), NNZ*sizeof(sunindextype)); - SM_DATA_S(A) = (realtype *) realloc(SM_DATA_S(A), NNZ*sizeof(realtype)); + SM_DATA_S(A) = (sunrealtype *) realloc(SM_DATA_S(A), NNZ*sizeof(sunrealtype)); SM_NNZ_S(A) = NNZ; return SUNMAT_SUCCESS; @@ -437,7 +437,7 @@ int SUNSparseMatrix_SparseType(SUNMatrix A) return SUNMAT_ILL_INPUT; } -realtype* SUNSparseMatrix_Data(SUNMatrix A) +sunrealtype* SUNSparseMatrix_Data(SUNMatrix A) { if (SUNMatGetID(A) == SUNMATRIX_SPARSE) return SM_DATA_S(A); @@ -547,7 +547,7 @@ int SUNMatCopy_Sparse(SUNMatrix A, SUNMatrix B) much memory as we have nonzeros in A */ if (SM_NNZ_S(B) < A_nz) { SM_INDEXVALS_S(B) = (sunindextype *) realloc(SM_INDEXVALS_S(B), A_nz*sizeof(sunindextype)); - SM_DATA_S(B) = (realtype *) realloc(SM_DATA_S(B), A_nz*sizeof(realtype)); + SM_DATA_S(B) = (sunrealtype *) realloc(SM_DATA_S(B), A_nz*sizeof(sunrealtype)); SM_NNZ_S(B) = A_nz; } @@ -570,12 +570,12 @@ int SUNMatCopy_Sparse(SUNMatrix A, SUNMatrix B) return SUNMAT_SUCCESS; } -int SUNMatScaleAddI_Sparse(realtype c, SUNMatrix A) +int SUNMatScaleAddI_Sparse(sunrealtype c, SUNMatrix A) { sunindextype j, i, p, nz, newvals, M, N, cend, nw; booleantype newmat, found; sunindextype *w, *Ap, *Ai, *Cp, *Ci; - realtype *x, *Ax, *Cx; + sunrealtype *x, *Ax, *Cx; SUNMatrix C; /* store shortcuts to matrix dimensions (M is inner dimension, N is outer) */ @@ -642,7 +642,7 @@ int SUNMatScaleAddI_Sparse(realtype c, SUNMatrix A) /* create work arrays for nonzero row (column) indices and values in a single column (row) */ w = (sunindextype *) malloc(M * sizeof(sunindextype)); - x = (realtype *) malloc(M * sizeof(realtype)); + x = (sunrealtype *) malloc(M * sizeof(sunrealtype)); /* determine storage location where last column (row) should end */ nz = Ap[N] + newvals; @@ -704,7 +704,7 @@ int SUNMatScaleAddI_Sparse(realtype c, SUNMatrix A) } else { /* create work array for nonzero values in a single column (row) */ - x = (realtype *) malloc(M * sizeof(realtype)); + x = (sunrealtype *) malloc(M * sizeof(sunrealtype)); /* create new matrix for sum */ C = SUNSparseMatrix(SM_ROWS_S(A), SM_COLUMNS_S(A), @@ -791,12 +791,12 @@ int SUNMatScaleAddI_Sparse(realtype c, SUNMatrix A) } -int SUNMatScaleAdd_Sparse(realtype c, SUNMatrix A, SUNMatrix B) +int SUNMatScaleAdd_Sparse(sunrealtype c, SUNMatrix A, SUNMatrix B) { sunindextype j, i, p, nz, newvals, M, N, cend; booleantype newmat; sunindextype *w, *Ap, *Ai, *Bp, *Bi, *Cp, *Ci; - realtype *x, *Ax, *Bx, *Cx; + sunrealtype *x, *Ax, *Bx, *Cx; SUNMatrix C; /* Verify that A and B are compatible */ @@ -831,7 +831,7 @@ int SUNMatScaleAdd_Sparse(realtype c, SUNMatrix A, SUNMatrix B) /* create work arrays for row indices and nonzero column values */ w = (sunindextype *) malloc(M * sizeof(sunindextype)); - x = (realtype *) malloc(M * sizeof(realtype)); + x = (sunrealtype *) malloc(M * sizeof(sunrealtype)); /* determine if A already contains the sparsity pattern of B */ newvals = 0; @@ -1099,7 +1099,7 @@ int Matvec_SparseCSC(SUNMatrix A, N_Vector x, N_Vector y) { sunindextype i, j; sunindextype *Ap, *Ai; - realtype *Ax, *xd, *yd; + sunrealtype *Ax, *xd, *yd; /* access data from CSC structure (return if failure) */ Ap = SM_INDEXPTRS_S(A); @@ -1142,7 +1142,7 @@ int Matvec_SparseCSR(SUNMatrix A, N_Vector x, N_Vector y) { sunindextype i, j; sunindextype *Ap, *Aj; - realtype *Ax, *xd, *yd; + sunrealtype *Ax, *xd, *yd; /* access data from CSR structure (return if failure) */ Ap = SM_INDEXPTRS_S(A); @@ -1180,7 +1180,7 @@ int Matvec_SparseCSR(SUNMatrix A, N_Vector x, N_Vector y) */ int format_convert(const SUNMatrix A, SUNMatrix B) { - realtype *Ax, *Bx; + sunrealtype *Ax, *Bx; sunindextype *Ap, *Aj; sunindextype *Bp, *Bi; sunindextype n_row, n_col, nnz; diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c index 905b285380..86714082dc 100644 --- a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c +++ b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c @@ -272,7 +272,7 @@ SWIGEXPORT int _wrap_FSUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver farg1, N_V N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int arg6 ; void *arg7 = (void *) 0 ; int result; @@ -281,7 +281,7 @@ SWIGEXPORT int _wrap_FSUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver farg1, N_V arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); arg6 = (int)(*farg6); arg7 = (void *)(farg7); result = (int)SUNNonlinSolSolve_FixedPoint(arg1,arg2,arg3,arg4,arg5,arg6,arg7); @@ -349,11 +349,11 @@ SWIGEXPORT int _wrap_FSUNNonlinSolSetMaxIters_FixedPoint(SUNNonlinearSolver farg SWIGEXPORT int _wrap_FSUNNonlinSolSetDamping_FixedPoint(SUNNonlinearSolver farg1, double const *farg2) { int fresult ; SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - realtype arg2 ; + sunrealtype arg2 ; int result; arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (realtype)(*farg2); + arg2 = (sunrealtype)(*farg2); result = (int)SUNNonlinSolSetDamping_FixedPoint(arg1,arg2); fresult = (int)(result); return fresult; diff --git a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c index 5204d53be7..50008c0c03 100644 --- a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +++ b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c @@ -182,7 +182,7 @@ int SUNNonlinSolInitialize_FixedPoint(SUNNonlinearSolver NLS) by the Sys function provided to the nonlinear solver. ---------------------------------------------------------------------------*/ int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, N_Vector y0, - N_Vector ycor, N_Vector w, realtype tol, + N_Vector ycor, N_Vector w, sunrealtype tol, booleantype callSetup, void* mem) { /* local variables */ @@ -371,7 +371,7 @@ int SUNNonlinSolSetMaxIters_FixedPoint(SUNNonlinearSolver NLS, int maxiters) return(SUN_NLS_SUCCESS); } -int SUNNonlinSolSetDamping_FixedPoint(SUNNonlinearSolver NLS, realtype beta) +int SUNNonlinSolSetDamping_FixedPoint(SUNNonlinearSolver NLS, sunrealtype beta) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) @@ -469,7 +469,7 @@ static int AndersonAccelerate(SUNNonlinearSolver NLS, N_Vector gval, { /* local variables */ int nvec, retval, i_pt, i, j, lAA, maa, *ipt_map; - realtype a, b, rtemp, c, s, beta, onembeta, *cvals, *R, *gamma; + sunrealtype a, b, rtemp, c, s, beta, onembeta, *cvals, *R, *gamma; N_Vector fv, vtemp, gold, fold, *df, *dg, *Q, *Xvecs; booleantype damping; @@ -651,15 +651,15 @@ static int AllocateContent(SUNNonlinearSolver NLS, N_Vector y) if (FP_CONTENT(NLS)->imap == NULL) { FreeContent(NLS); return(SUN_NLS_MEM_FAIL); } - FP_CONTENT(NLS)->R = (realtype *) malloc((m*m) * sizeof(realtype)); + FP_CONTENT(NLS)->R = (sunrealtype *) malloc((m*m) * sizeof(sunrealtype)); if (FP_CONTENT(NLS)->R == NULL) { FreeContent(NLS); return(SUN_NLS_MEM_FAIL); } - FP_CONTENT(NLS)->gamma = (realtype *) malloc(m * sizeof(realtype)); + FP_CONTENT(NLS)->gamma = (sunrealtype *) malloc(m * sizeof(sunrealtype)); if (FP_CONTENT(NLS)->gamma == NULL) { FreeContent(NLS); return(SUN_NLS_MEM_FAIL); } - FP_CONTENT(NLS)->cvals = (realtype *) malloc(2*(m+1) * sizeof(realtype)); + FP_CONTENT(NLS)->cvals = (sunrealtype *) malloc(2*(m+1) * sizeof(sunrealtype)); if (FP_CONTENT(NLS)->cvals == NULL) { FreeContent(NLS); return(SUN_NLS_MEM_FAIL); } diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c index ae1c387991..78c2e36aef 100644 --- a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c +++ b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c @@ -268,7 +268,7 @@ SWIGEXPORT int _wrap_FSUNNonlinSolSolve_Newton(SUNNonlinearSolver farg1, N_Vecto N_Vector arg2 = (N_Vector) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int arg6 ; void *arg7 = (void *) 0 ; int result; @@ -277,7 +277,7 @@ SWIGEXPORT int _wrap_FSUNNonlinSolSolve_Newton(SUNNonlinearSolver farg1, N_Vecto arg2 = (N_Vector)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); arg6 = (int)(*farg6); arg7 = (void *)(farg7); result = (int)SUNNonlinSolSolve_Newton(arg1,arg2,arg3,arg4,arg5,arg6,arg7); diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index 6422b24963..eaa346bf9a 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -186,7 +186,7 @@ int SUNNonlinSolInitialize_Newton(SUNNonlinearSolver NLS) ----------------------------------------------------------------------------*/ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem) { /* local variables */ diff --git a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c index a3d006611e..a822240678 100644 --- a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c +++ b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c @@ -161,7 +161,7 @@ int SUNNonlinSolInitialize_PetscSNES(SUNNonlinearSolver NLS) ----------------------------------------------------------------------------*/ int SUNNonlinSolSolve_PetscSNES(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, - N_Vector w, realtype tol, + N_Vector w, sunrealtype tol, booleantype callLSetup, void* mem) { /* local variables */ diff --git a/swig/nvector/fnvector_manyvector_mod.i b/swig/nvector/fnvector_manyvector_mod.i index b27c97f4e6..51cf7efdd9 100644 --- a/swig/nvector/fnvector_manyvector_mod.i +++ b/swig/nvector/fnvector_manyvector_mod.i @@ -35,11 +35,11 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1 double * fresult ; N_Vector arg1 = (N_Vector) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); fresult = result; return fresult; } diff --git a/swig/nvector/fnvector_mpimanyvector_mod.i b/swig/nvector/fnvector_mpimanyvector_mod.i index 260286fe07..7c2a355f5a 100644 --- a/swig/nvector/fnvector_mpimanyvector_mod.i +++ b/swig/nvector/fnvector_mpimanyvector_mod.i @@ -63,11 +63,11 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector fa double * fresult ; N_Vector arg1 = (N_Vector) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); fresult = result; return fresult; } diff --git a/swig/nvector/fnvector_mpiplusx_mod.i b/swig/nvector/fnvector_mpiplusx_mod.i index 39865b7053..14f3a45c73 100644 --- a/swig/nvector/fnvector_mpiplusx_mod.i +++ b/swig/nvector/fnvector_mpiplusx_mod.i @@ -62,10 +62,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer_MPIPlusX(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer_MPIPlusX(arg1); + result = (sunrealtype *)N_VGetArrayPointer_MPIPlusX(arg1); fresult = result; return fresult; } diff --git a/swig/nvector/fnvector_openmp_mod.i b/swig/nvector/fnvector_openmp_mod.i index 4df2439934..5878e40cb0 100644 --- a/swig/nvector/fnvector_openmp_mod.i +++ b/swig/nvector/fnvector_openmp_mod.i @@ -34,10 +34,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer_OpenMP(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer_OpenMP(arg1); + result = (sunrealtype *)N_VGetArrayPointer_OpenMP(arg1); fresult = result; return fresult; } diff --git a/swig/nvector/fnvector_parallel_mod.i b/swig/nvector/fnvector_parallel_mod.i index 2dd2e127c3..1501186b6e 100644 --- a/swig/nvector/fnvector_parallel_mod.i +++ b/swig/nvector/fnvector_parallel_mod.i @@ -62,10 +62,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Parallel(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer_Parallel(arg1); + result = (sunrealtype *)N_VGetArrayPointer_Parallel(arg1); fresult = result; return fresult; } diff --git a/swig/nvector/fnvector_pthreads_mod.i b/swig/nvector/fnvector_pthreads_mod.i index 9c70141781..fce44f8f20 100644 --- a/swig/nvector/fnvector_pthreads_mod.i +++ b/swig/nvector/fnvector_pthreads_mod.i @@ -37,10 +37,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Pthreads(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer_Pthreads(arg1); + result = (sunrealtype *)N_VGetArrayPointer_Pthreads(arg1); fresult = result; return fresult; } diff --git a/swig/nvector/fnvector_serial_mod.i b/swig/nvector/fnvector_serial_mod.i index c27824d4d8..31de082136 100644 --- a/swig/nvector/fnvector_serial_mod.i +++ b/swig/nvector/fnvector_serial_mod.i @@ -34,10 +34,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Serial(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer_Serial(arg1); + result = (sunrealtype *)N_VGetArrayPointer_Serial(arg1); fresult = result; return fresult; } diff --git a/swig/sundials/fsundials.i b/swig/sundials/fsundials.i index dcda29e1c8..4dc20a48a1 100644 --- a/swig/sundials/fsundials.i +++ b/swig/sundials/fsundials.i @@ -44,8 +44,8 @@ // Treat array of N_Vectors as an opaque pointer %apply void* { N_Vector* }; -// Assume realtype* is an array of doubles -%apply double[] { realtype* }; +// Assume sunrealtype* is an array of doubles +%apply double[] { sunrealtype* }; // Assume sunindextype* is an array of long int %apply long int[] { sunindextype* }; diff --git a/swig/sundials/fsundials_nvector_mod.i b/swig/sundials/fsundials_nvector_mod.i index 568c0d7750..b7bbce0130 100644 --- a/swig/sundials/fsundials_nvector_mod.i +++ b/swig/sundials/fsundials_nvector_mod.i @@ -40,10 +40,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetArrayPointer(arg1); + result = (sunrealtype *)N_VGetArrayPointer(arg1); fresult = result; return fresult; } @@ -52,10 +52,10 @@ SWIGEXPORT double * _wrap_FN_VGetArrayPointer(N_Vector farg1) { SWIGEXPORT double * _wrap_FN_VGetDeviceArrayPointer(N_Vector farg1) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (N_Vector)(farg1); - result = (realtype *)N_VGetDeviceArrayPointer(arg1); + result = (sunrealtype *)N_VGetDeviceArrayPointer(arg1); fresult = result; return fresult; } diff --git a/swig/sunmatrix/fsunmatrix_band_mod.i b/swig/sunmatrix/fsunmatrix_band_mod.i index 31df8f4085..b9fcdfc5e5 100644 --- a/swig/sunmatrix/fsunmatrix_band_mod.i +++ b/swig/sunmatrix/fsunmatrix_band_mod.i @@ -37,10 +37,10 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype *)SUNBandMatrix_Data(arg1); + result = (sunrealtype *)SUNBandMatrix_Data(arg1); fresult = result; return fresult; } @@ -49,11 +49,11 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const * double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)SUNBandMatrix_Column(arg1,arg2); + result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); fresult = result; return fresult; } diff --git a/swig/sunmatrix/fsunmatrix_dense_mod.i b/swig/sunmatrix/fsunmatrix_dense_mod.i index 04010bc9f0..4a01a5e3fb 100644 --- a/swig/sunmatrix/fsunmatrix_dense_mod.i +++ b/swig/sunmatrix/fsunmatrix_dense_mod.i @@ -37,10 +37,10 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype *)SUNDenseMatrix_Data(arg1); + result = (sunrealtype *)SUNDenseMatrix_Data(arg1); fresult = result; return fresult; } @@ -49,11 +49,11 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); - result = (realtype *)SUNDenseMatrix_Column(arg1,arg2); + result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); fresult = result; return fresult; } diff --git a/swig/sunmatrix/fsunmatrix_sparse_mod.i b/swig/sunmatrix/fsunmatrix_sparse_mod.i index 0d43c5dfbc..8c819482cf 100644 --- a/swig/sunmatrix/fsunmatrix_sparse_mod.i +++ b/swig/sunmatrix/fsunmatrix_sparse_mod.i @@ -39,10 +39,10 @@ SWIGEXPORT double * _wrap_FSUNSparseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - realtype *result = 0 ; + sunrealtype *result = 0 ; arg1 = (SUNMatrix)(farg1); - result = (realtype *)SUNSparseMatrix_Data(arg1); + result = (sunrealtype *)SUNSparseMatrix_Data(arg1); fresult = result; return fresult; } diff --git a/test/test_driver.sh b/test/test_driver.sh index 3dd0209141..2355514034 100755 --- a/test/test_driver.sh +++ b/test/test_driver.sh @@ -63,7 +63,7 @@ help () kinsol -- create tarball containing KINSOL only all -- create all possible tarballs - --realtype TYPE + --sunrealtype TYPE Real type precision to use in a custom test. TYPE must be one of: double -- (default) use double precision @@ -142,7 +142,7 @@ buildjobs=0 testjobs=0 testtype="CUSTOM" tarball="NONE" -realtype="double" +sunrealtype="double" indexsize="64" libtype="both" tpls="OFF" @@ -219,20 +219,20 @@ while [[ $# -gt 0 ]]; do esac shift 2;; - --realtype) - realtype=$2 - case "$realtype" in + --sunrealtype) + sunrealtype=$2 + case "$sunrealtype" in SINGLE|Single|single) - realtype=single + sunrealtype=single ;; DOUBLE|Double|double) - realtype=double + sunrealtype=double ;; EXTENDED|Extended|extended) - realtype=extended + sunrealtype=extended ;; *) - echo "ERROR: Invaid real type option $realtype" + echo "ERROR: Invaid real type option $sunrealtype" help exit 1;; esac @@ -466,14 +466,14 @@ case "$testtype" in CUSTOM) # Use default or user defined values - args_realtypes+=("${realtype}") + args_realtypes+=("${sunrealtype}") args_indexsizes+=("${indexsize}") args_libtypes+=("${libtype}") args_tpls+=("${tpls}") args_suntests+=("${suntesttype}") args_phase+=("${phase}") - if [ "${realtype}" != "double" ] && [ "${suntesttype}" == "DEV" ]; then - echo "WARNING: DEV tests may fail with ${realtype} precision" + if [ "${sunrealtype}" != "double" ] && [ "${suntesttype}" == "DEV" ]; then + echo "WARNING: DEV tests may fail with ${sunrealtype} precision" fi ;; diff --git a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp index 85ee27e410..643ece5eda 100644 --- a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp +++ b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp @@ -31,7 +31,7 @@ #include "arkode/arkode_mristep.h" // prototypes for MRIStep fcts., consts #include "nvector/nvector_parallel.h" // parallel N_Vector types, fcts., macros #include "sunlinsol/sunlinsol_pcg.h" // access to PCG SUNLinearSolver -#include "sundials/sundials_types.h" // def. of type 'realtype' +#include "sundials/sundials_types.h" // def. of type 'sunrealtype' #include "mpi.h" // MPI header file #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -63,33 +63,33 @@ typedef struct { sunindextype je; sunindextype nxl; // local number of x grid points sunindextype nyl; // local number of y grid points - realtype dx; // x-directional mesh spacing - realtype dy; // y-directional mesh spacing - realtype kx; // x-directional diffusion coefficient - realtype ky; // y-directional diffusion coefficient + sunrealtype dx; // x-directional mesh spacing + sunrealtype dy; // y-directional mesh spacing + sunrealtype kx; // x-directional diffusion coefficient + sunrealtype ky; // y-directional diffusion coefficient N_Vector h; // heat source vector N_Vector d; // inverse of Jacobian diagonal MPI_Comm comm; // communicator object int myid; // MPI process ID int nprocs; // total number of MPI processes bool HaveBdry[2][2]; // flags denoting if on physical boundary - realtype *Erecv; // receive buffers for neighbor exchange - realtype *Wrecv; - realtype *Nrecv; - realtype *Srecv; - realtype *Esend; // send buffers for neighbor exchange - realtype *Wsend; - realtype *Nsend; - realtype *Ssend; + sunrealtype *Erecv; // receive buffers for neighbor exchange + sunrealtype *Wrecv; + sunrealtype *Nrecv; + sunrealtype *Srecv; + sunrealtype *Esend; // send buffers for neighbor exchange + sunrealtype *Wsend; + sunrealtype *Nsend; + sunrealtype *Ssend; } UserData; // User-supplied Functions Called by the Solver -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int PSet(realtype t, N_Vector y, N_Vector fy, booleantype jok, - booleantype *jcurPtr, realtype gamma, void *user_data); -static int PSol(realtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int PSet(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, + booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSol(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); // Private functions @@ -111,21 +111,21 @@ int main(int argc, char* argv[]) { SUNContext_Create(NULL, &ctx); // general problem parameters - realtype T0 = RCONST(0.0); // initial time - realtype Tf = RCONST(0.3); // final time + sunrealtype T0 = RCONST(0.0); // initial time + sunrealtype Tf = RCONST(0.3); // final time int Nt = 1000; // total number of internal steps sunindextype nx = 60; // spatial mesh size sunindextype ny = 120; - realtype kx = RCONST(0.5); // heat conductivity coefficients - realtype ky = RCONST(0.75); - realtype rtol = RCONST(1.e-5); // relative and absolute tolerances - realtype atol = RCONST(1.e-10); + sunrealtype kx = RCONST(0.5); // heat conductivity coefficients + sunrealtype ky = RCONST(0.75); + sunrealtype rtol = RCONST(1.e-5); // relative and absolute tolerances + sunrealtype atol = RCONST(1.e-10); UserData *udata = NULL; - realtype *data; + sunrealtype *data; sunindextype N, Ntot, i, j; int numfails; booleantype linear; - realtype t; + sunrealtype t; long int ark_nst, ark_nfe, ark_nfi, ark_nsetups, ark_nli, ark_nJv, ark_nlcf, ark_nni, ark_ncfn, ark_npe, ark_nps; long int mri_nst, mri_nfse, mri_nfsi, mri_nsetups, mri_nli, mri_nJv, mri_nlcf, mri_nni, mri_ncfn, mri_npe, mri_nps; @@ -461,19 +461,19 @@ int main(int argc, char* argv[]) { *--------------------------------*/ // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { N_VConst(ZERO, ydot); // Initialize ydot to zero UserData *udata = (UserData *) user_data; // access problem data sunindextype nxl = udata->nxl; // set variable shortcuts sunindextype nyl = udata->nyl; - realtype kx = udata->kx; - realtype ky = udata->ky; - realtype dx = udata->dx; - realtype dy = udata->dy; - realtype *Y = N_VGetArrayPointer(y); // access data arrays + sunrealtype kx = udata->kx; + sunrealtype ky = udata->ky; + sunrealtype dx = udata->dx; + sunrealtype dy = udata->dy; + sunrealtype *Y = N_VGetArrayPointer(y); // access data arrays if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; - realtype *Ydot = N_VGetArrayPointer(ydot); + sunrealtype *Ydot = N_VGetArrayPointer(ydot); if (check_flag((void *) Ydot, "N_VGetArrayPointer", 0)) return -1; // Exchange boundary data with neighbors @@ -481,9 +481,9 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) if (check_flag(&ierr, "Exchange", 1)) return -1; // iterate over subdomain interior, computing approximation to RHS - realtype c1 = kx/dx/dx; - realtype c2 = ky/dy/dy; - realtype c3 = -TWO*(c1 + c2); + sunrealtype c1 = kx/dx/dx; + sunrealtype c2 = ky/dy/dy; + sunrealtype c3 = -TWO*(c1 + c2); sunindextype i, j; for (j=1; jkx; - realtype ky = udata->ky; - realtype dx = udata->dx; - realtype dy = udata->dy; - realtype *diag = N_VGetArrayPointer(udata->d); // access data arrays + sunrealtype kx = udata->kx; + sunrealtype ky = udata->ky; + sunrealtype dx = udata->dx; + sunrealtype dy = udata->dy; + sunrealtype *diag = N_VGetArrayPointer(udata->d); // access data arrays if (check_flag((void *) diag, "N_VGetArrayPointer", 0)) return -1; // set all entries of d to the diagonal values of interior // (since boundary RHS is 0, set boundary diagonals to the same) - realtype c = ONE + gamma*TWO*(kx/dx/dx + ky/dy/dy); + sunrealtype c = ONE + gamma*TWO*(kx/dx/dx + ky/dy/dy); N_VConst(c, udata->d); N_VInv(udata->d, udata->d); // invert diagonal return 0; // Return with success } // Preconditioner solve routine -static int PSol(realtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, realtype gamma, realtype delta, int lr, +static int PSol(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, + N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data) { UserData *udata = (UserData *) user_data; // access user_data structure @@ -686,20 +686,20 @@ static int SetupDecomp(UserData *udata) udata->HaveBdry[1][0] = (udata->js == 0); udata->HaveBdry[1][1] = (udata->je == udata->ny-1); if (!udata->HaveBdry[0][0]) { - udata->Wrecv = new realtype[udata->nyl]; - udata->Wsend = new realtype[udata->nyl]; + udata->Wrecv = new sunrealtype[udata->nyl]; + udata->Wsend = new sunrealtype[udata->nyl]; } if (!udata->HaveBdry[0][1]) { - udata->Erecv = new realtype[udata->nyl]; - udata->Esend = new realtype[udata->nyl]; + udata->Erecv = new sunrealtype[udata->nyl]; + udata->Esend = new sunrealtype[udata->nyl]; } if (!udata->HaveBdry[1][0]) { - udata->Srecv = new realtype[udata->nxl]; - udata->Ssend = new realtype[udata->nxl]; + udata->Srecv = new sunrealtype[udata->nxl]; + udata->Ssend = new sunrealtype[udata->nxl]; } if (!udata->HaveBdry[1][1]) { - udata->Nrecv = new realtype[udata->nxl]; - udata->Nsend = new realtype[udata->nxl]; + udata->Nrecv = new sunrealtype[udata->nxl]; + udata->Nsend = new sunrealtype[udata->nxl]; } return 0; // return with success flag @@ -717,7 +717,7 @@ static int Exchange(N_Vector y, UserData *udata) sunindextype nxl = udata->nxl; // access data array - realtype *Y = N_VGetArrayPointer(y); + sunrealtype *Y = N_VGetArrayPointer(y); if (check_flag((void *) Y, "N_VGetArrayPointer", 0)) return -1; // MPI neighborhood information diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp index 4abd91c925..3e89362ca3 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp @@ -50,9 +50,9 @@ using namespace std; #define ONE RCONST(1.0) // User-supplied Functions Called by the Solver -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Private function to perform matrix-matrix product @@ -71,13 +71,13 @@ int main(int argc, char* argv[]) SUNContext_Create(NULL, &sunctx); // general problem parameters - realtype T0 = RCONST(0.0); // initial time - realtype Tf = RCONST(0.05); // final time + sunrealtype T0 = RCONST(0.0); // initial time + sunrealtype Tf = RCONST(0.05); // final time int Nt = 1000; // total number of internal steps sunindextype NEQ = 3; // number of dependent vars. - realtype reltol = RCONST(1.0e-6); // tolerances - realtype abstol = RCONST(1.0e-10); - realtype lamda = RCONST(-100.0); // stiffness parameter + sunrealtype reltol = RCONST(1.0e-6); // tolerances + sunrealtype abstol = RCONST(1.0e-10); + sunrealtype lamda = RCONST(-100.0); // stiffness parameter // general problem variables int flag; // reusable error-checking flag @@ -93,7 +93,7 @@ int main(int argc, char* argv[]) void *inner_mem = NULL; // empty inner ARKStep memory structure int numfails; booleantype fixedpoint; - realtype t, tcur; + sunrealtype t, tcur; long int ark_nst, ark_nfe, ark_nfi, ark_nsetups, ark_nje, ark_nfeLS, ark_nni, ark_ncfn; long int mri_nst, mri_nfse, mri_nfsi, mri_nsetups, mri_nje, mri_nfeLS, mri_nni, mri_ncfn; @@ -372,14 +372,14 @@ int main(int argc, char* argv[]) *-------------------------------*/ // f routine to compute the ODE RHS function f(t,y). -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; // cast user_data to realtype - realtype lam = rdata[0]; // set shortcut for stiffness parameter - realtype y0 = NV_Ith_S(y,0); // access current solution values - realtype y1 = NV_Ith_S(y,1); - realtype y2 = NV_Ith_S(y,2); - realtype yd0, yd1, yd2; + sunrealtype *rdata = (sunrealtype *) user_data; // cast user_data to sunrealtype + sunrealtype lam = rdata[0]; // set shortcut for stiffness parameter + sunrealtype y0 = NV_Ith_S(y,0); // access current solution values + sunrealtype y1 = NV_Ith_S(y,1); + sunrealtype y2 = NV_Ith_S(y,2); + sunrealtype yd0, yd1, yd2; // fill in the RHS function: f(t,y) = V*D*Vi*y yd0 = RCONST(0.25)*(RCONST(5.0)*y0 + RCONST(1.0)*y1 - RCONST(3.0)*y2); // yd = Vi*y @@ -399,7 +399,7 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } // f0 routine to compute a zero-valued ODE RHS function f(t,y). -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { // Initialize ydot to zero and return N_VConst(ZERO, ydot); @@ -407,12 +407,12 @@ static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data) } // Jacobian routine to compute J(t,y) = df/dy. -static int Jac(realtype t, N_Vector y, N_Vector fy, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rdata = (realtype *) user_data; // cast user_data to realtype - realtype lam = rdata[0]; // set shortcut for stiffness parameter + sunrealtype *rdata = (sunrealtype *) user_data; // cast user_data to sunrealtype + sunrealtype lam = rdata[0]; // set shortcut for stiffness parameter SUNMatrix V = SUNDenseMatrix(3,3,sunctx); // create temporary SUNMatrix objects SUNMatrix D = SUNDenseMatrix(3,3,sunctx); // create temporary SUNMatrix objects SUNMatrix Vi = SUNDenseMatrix(3,3,sunctx); // create temporary SUNMatrix objects @@ -482,9 +482,9 @@ static int dense_MM(SUNMatrix A, SUNMatrix B, SUNMatrix C) return 1; } - realtype **adata = SUNDenseMatrix_Cols(A); // access data and extents - realtype **bdata = SUNDenseMatrix_Cols(B); - realtype **cdata = SUNDenseMatrix_Cols(C); + sunrealtype **adata = SUNDenseMatrix_Cols(A); // access data and extents + sunrealtype **bdata = SUNDenseMatrix_Cols(B); + sunrealtype **cdata = SUNDenseMatrix_Cols(C); sunindextype m = SUNDenseMatrix_Rows(C); sunindextype n = SUNDenseMatrix_Columns(C); sunindextype l = SUNDenseMatrix_Columns(A); diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp index 7f52a88d86..05320ce6ab 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp @@ -45,24 +45,24 @@ using namespace std; // User data structure struct UserData { - realtype lambda_e = RCONST(-1.0); - realtype lambda_i = RCONST(-1.0); - realtype lambda_f = RCONST(-1.0); + sunrealtype lambda_e = RCONST(-1.0); + sunrealtype lambda_i = RCONST(-1.0); + sunrealtype lambda_f = RCONST(-1.0); }; // User-supplied Functions called by the solver -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Ji(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Private function to check function return values static int check_flag(void *flagvalue, const string funcname, int opt); // Test drivers -static int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, - realtype hs, realtype hf, realtype reltol, realtype abstol, +static int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, + sunrealtype hs, sunrealtype hf, sunrealtype reltol, sunrealtype abstol, UserData* udata, SUNContext ctx); @@ -74,18 +74,18 @@ static int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, int main(int argc, char* argv[]) { // Initial time - realtype t0 = RCONST(0.0); + sunrealtype t0 = RCONST(0.0); // Number of time steps int nsteps = 1; // Relative and absolute tolerances - realtype reltol = RCONST(1.0e-4); - realtype abstol = RCONST(1.0e-6); + sunrealtype reltol = RCONST(1.0e-4); + sunrealtype abstol = RCONST(1.0e-6); // Slow and fast step sizes - realtype hs = RCONST(0.01); - realtype hf = RCONST(0.01); + sunrealtype hs = RCONST(0.01); + sunrealtype hf = RCONST(0.01); // User data structure UserData udata; @@ -142,8 +142,8 @@ int main(int argc, char* argv[]) // ----------------------------------------------------------------------------- -int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, - realtype hs, realtype hf, realtype reltol, realtype abstol, +int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, + sunrealtype hs, sunrealtype hf, sunrealtype reltol, sunrealtype abstol, UserData* udata, SUNContext sunctx) { // Reusable error-checking flag @@ -346,8 +346,8 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, // Output statistics // ----------------- - realtype t = t0; - realtype tf = nsteps * hs; + sunrealtype t = t0; + sunrealtype tf = nsteps * hs; for (int i = 0; i < nsteps; i++) { @@ -391,7 +391,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, check_flag(&flag, "MRIStepGetNumLinRhsEvals", 1); } - realtype pow = udata->lambda_f; + sunrealtype pow = udata->lambda_f; if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) { pow += udata->lambda_e; @@ -400,10 +400,10 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, { pow += udata->lambda_i; } - realtype ytrue = exp(pow * t); + sunrealtype ytrue = exp(pow * t); - realtype* ydata = N_VGetArrayPointer(y); - realtype error = ytrue - ydata[0]; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype error = ytrue - ydata[0]; cout << "\nMRIStep Statistics:\n"; cout << " Time = " << t << "\n"; @@ -520,10 +520,10 @@ int run_tests(MRISTEP_METHOD_TYPE type, realtype t0, int nsteps, // Explicit ODE RHS function fe(t,y) -static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype* y_data = N_VGetArrayPointer(y); - realtype* yd_data = N_VGetArrayPointer(ydot); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); UserData* udata = static_cast(user_data); yd_data[0] = udata->lambda_e * y_data[0]; @@ -532,10 +532,10 @@ static int fe(realtype t, N_Vector y, N_Vector ydot, void *user_data) } // Implicit ODE RHS function fi(t,y) -static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype* y_data = N_VGetArrayPointer(y); - realtype* yd_data = N_VGetArrayPointer(ydot); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); UserData* udata = static_cast(user_data); yd_data[0] = udata->lambda_i * y_data[0]; @@ -545,10 +545,10 @@ static int fi(realtype t, N_Vector y, N_Vector ydot, void *user_data) // Fast ODE RHS function ff(t,y) -static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype* y_data = N_VGetArrayPointer(y); - realtype* yd_data = N_VGetArrayPointer(ydot); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); UserData* udata = static_cast(user_data); yd_data[0] = udata->lambda_f * y_data[0]; @@ -558,11 +558,11 @@ static int ff(realtype t, N_Vector y, N_Vector ydot, void *user_data) // Jacobian routine to compute J(t,y) = dfi/dy. -static int Ji(realtype t, N_Vector y, N_Vector fy, +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype* J_data = SUNDenseMatrix_Data(J); + sunrealtype* J_data = SUNDenseMatrix_Data(J); UserData* udata = static_cast(user_data); J_data[0] = udata->lambda_i; diff --git a/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c b/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c index 92b3aa5191..b9257773e9 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c +++ b/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c @@ -45,19 +45,19 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int compute_ans(realtype t, realtype tshift, realtype tscale, +static int compute_ans(sunrealtype t, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int order, N_Vector ans); -static int compute_error(N_Vector y, N_Vector ans, N_Vector tmp, realtype rtol, - realtype atol); +static int compute_error(N_Vector y, N_Vector ans, N_Vector tmp, sunrealtype rtol, + sunrealtype atol); /* Main Program */ int main(int argc, char *argv[]) @@ -67,14 +67,14 @@ int main(int argc, char *argv[]) /* default input values */ sunindextype NEQ = 1; /* number of dependent vars. */ int order = 3; /* order of polynomial forcing */ - realtype T0 = RCONST(0.0); /* initial time */ - realtype Tf = RCONST(1.0); /* final time */ - realtype tshift = T0; /* time shift for normalization */ - realtype tscale = Tf; /* time scale for normalization */ + sunrealtype T0 = RCONST(0.0); /* initial time */ + sunrealtype Tf = RCONST(1.0); /* final time */ + sunrealtype tshift = T0; /* time shift for normalization */ + sunrealtype tscale = Tf; /* time scale for normalization */ /* tolerances */ - realtype reltol = SUNRsqrt(UNIT_ROUNDOFF); - realtype abstol = SUNRsqrt(UNIT_ROUNDOFF)/100; + sunrealtype reltol = SUNRsqrt(UNIT_ROUNDOFF); + sunrealtype abstol = SUNRsqrt(UNIT_ROUNDOFF)/100; /* general problem variables */ int flag; /* reusable error-checking flag */ @@ -86,8 +86,8 @@ int main(int argc, char *argv[]) SUNLinearSolver LS = NULL; /* linear solver object */ void *arkode_mem = NULL; /* ARKode memory structure */ int i, j; /* loop counters */ - realtype tret; /* integrator return time */ - realtype* data; /* array for accessing vector data */ + sunrealtype tret; /* integrator return time */ + sunrealtype* data; /* array for accessing vector data */ long int nst, nst_a; /* number of integrator steps */ long int mxsteps = 100000; /* max steps before output */ @@ -113,8 +113,8 @@ int main(int argc, char *argv[]) printf("ERROR: Both the initial and final time are required\n"); return(1); } - T0 = (realtype) atof(argv[3]); - Tf = (realtype) atof(argv[4]); + T0 = (sunrealtype) atof(argv[3]); + Tf = (sunrealtype) atof(argv[4]); if (SUNRabs(T0) >= SUNRabs(Tf)) { printf("ERROR: |T0| must be less than |Tf|\n"); return(1); @@ -126,8 +126,8 @@ int main(int argc, char *argv[]) printf("ERROR: Both tshift and tscale are required\n"); return(1); } - tshift = (realtype) atof(argv[5]); - tscale = (realtype) atof(argv[6]); + tshift = (sunrealtype) atof(argv[5]); + tscale = (sunrealtype) atof(argv[6]); if (SUNRabs(tscale) < TINY) { printf("ERROR: |tscale| must be greater than %"GSYM"\n", TINY); return(1); @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) for (i = 0; i < order + 1; i++) { data = N_VGetArrayPointer(forcing[i]); for (j = 0; j < NEQ; j++) { - data[j] = (realtype) rand() / (realtype) RAND_MAX; + data[j] = (sunrealtype) rand() / (sunrealtype) RAND_MAX; } } @@ -406,14 +406,14 @@ int main(int argc, char *argv[]) *-------------------------------*/ /* ODE RHS function */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { N_VConst(ZERO, ydot); return 0; } /* ODE RHS Jacobian function */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { SUNMatZero(J); @@ -460,16 +460,16 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) } /* computed the true solution at a given time */ -static int compute_ans(realtype t, realtype tshift, realtype tscale, +static int compute_ans(sunrealtype t, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int order, N_Vector ans) { int i; - realtype tau; + sunrealtype tau; N_Vector* vecs; - realtype* vals; + sunrealtype* vals; vals = NULL; - vals = (realtype*) calloc(order + 1, sizeof(realtype)); + vals = (sunrealtype*) calloc(order + 1, sizeof(sunrealtype)); if (vals == NULL) return(1); vecs = NULL; @@ -493,11 +493,11 @@ static int compute_ans(realtype t, realtype tshift, realtype tscale, } /* compure the weighted max norm of the difference of two vectors */ -static int compute_error(N_Vector y, N_Vector ans, N_Vector tmp, realtype rtol, - realtype atol) +static int compute_error(N_Vector y, N_Vector ans, N_Vector tmp, sunrealtype rtol, + sunrealtype atol) { int status; /* success (0) or failure (1) flag */ - realtype error; + sunrealtype error; /* compute the error in y */ N_VLinearSum(ONE, y, -ONE, ans, y); diff --git a/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c b/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c index 7fd3aeea30..14d027503d 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c +++ b/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c @@ -26,7 +26,7 @@ #define ONE SUN_RCONST(1.0) /* Dummy user-supplied function */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { return 0; } diff --git a/test/unit_tests/arkode/C_serial/ark_test_interp.c b/test/unit_tests/arkode/C_serial/ark_test_interp.c index 5e7d614016..4863e0f34f 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_interp.c +++ b/test/unit_tests/arkode/C_serial/ark_test_interp.c @@ -49,22 +49,22 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); /* Private function to check function return values */ static int check_flag(void *flagvalue, const char *funcname, int opt); /* Private function to verify test results */ -static int verify_results(realtype lambda, int rtype, - realtype *yrate, realtype *dyrate, - realtype *d2yrate, realtype *yrate2, - realtype *dyrate2, realtype *d2yrate2); +static int verify_results(sunrealtype lambda, int rtype, + sunrealtype *yrate, sunrealtype *dyrate, + sunrealtype *d2yrate, sunrealtype *yrate2, + sunrealtype *dyrate2, sunrealtype *d2yrate2); /* Main Program */ int main(int argc, char *argv[]) { /* initial declaration of all variables */ - realtype T0, Tf, lambda, t, t_test, hbase, rtol, atol; + sunrealtype T0, Tf, lambda, t, t_test, hbase, rtol, atol; sunindextype NEQ; int flag, nttest, ideg, ih, itest, rtype; N_Vector y, ytest, dytest, d2ytest, d3ytest, d4ytest, d5ytest; @@ -72,17 +72,17 @@ int main(int argc, char *argv[]) SUNMatrix A; SUNLinearSolver LS; void *arkode_mem; - realtype hvals[NHVALS], yerrs[NHVALS], dyerrs[NHVALS], d2yerrs[NHVALS]; - realtype d3yerrs[NHVALS], d4yerrs[NHVALS], d5yerrs[NHVALS]; - realtype yrate[ARK_INTERP_MAX_DEGREE+1], dyrate[ARK_INTERP_MAX_DEGREE+1]; - realtype d2yrate[ARK_INTERP_MAX_DEGREE+1], d3yrate[ARK_INTERP_MAX_DEGREE+1]; - realtype d4yrate[ARK_INTERP_MAX_DEGREE+1], d5yrate[ARK_INTERP_MAX_DEGREE+1]; - realtype yferr[ARK_INTERP_MAX_DEGREE+1], dyferr[ARK_INTERP_MAX_DEGREE+1]; - realtype d2yferr[ARK_INTERP_MAX_DEGREE+1], d3yferr[ARK_INTERP_MAX_DEGREE+1]; - realtype d4yferr[ARK_INTERP_MAX_DEGREE+1], d5yferr[ARK_INTERP_MAX_DEGREE+1]; - realtype yrate2[ARK_INTERP_MAX_DEGREE+1], dyrate2[ARK_INTERP_MAX_DEGREE+1]; - realtype d2yrate2[ARK_INTERP_MAX_DEGREE+1], yferr2[ARK_INTERP_MAX_DEGREE+1]; - realtype dyferr2[ARK_INTERP_MAX_DEGREE+1], d2yferr2[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype hvals[NHVALS], yerrs[NHVALS], dyerrs[NHVALS], d2yerrs[NHVALS]; + sunrealtype d3yerrs[NHVALS], d4yerrs[NHVALS], d5yerrs[NHVALS]; + sunrealtype yrate[ARK_INTERP_MAX_DEGREE+1], dyrate[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype d2yrate[ARK_INTERP_MAX_DEGREE+1], d3yrate[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype d4yrate[ARK_INTERP_MAX_DEGREE+1], d5yrate[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype yferr[ARK_INTERP_MAX_DEGREE+1], dyferr[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype d2yferr[ARK_INTERP_MAX_DEGREE+1], d3yferr[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype d4yferr[ARK_INTERP_MAX_DEGREE+1], d5yferr[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype yrate2[ARK_INTERP_MAX_DEGREE+1], dyrate2[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype d2yrate2[ARK_INTERP_MAX_DEGREE+1], yferr2[ARK_INTERP_MAX_DEGREE+1]; + sunrealtype dyferr2[ARK_INTERP_MAX_DEGREE+1], d2yferr2[ARK_INTERP_MAX_DEGREE+1]; /* Create the SUNDIALS context object for this simulation. */ SUNContext sunctx = NULL; @@ -98,9 +98,9 @@ int main(int argc, char *argv[]) if (argc > 1) lambda = strtod(argv[1], NULL); /* determine test configuration */ - if (sizeof(realtype) == 4) { + if (sizeof(sunrealtype) == 4) { rtype = 32; - } else if (sizeof(realtype) == 8) { + } else if (sizeof(sunrealtype) == 8) { rtype = 64; } else { rtype = 128; @@ -548,9 +548,9 @@ int main(int argc, char *argv[]) *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *lambda = (realtype *) user_data; + sunrealtype *lambda = (sunrealtype *) user_data; NV_Ith_S(ydot,0) = (*lambda)*(NV_Ith_S(y,0) - SIN(RCONST(2.0)*t)) + NV_Ith_S(y,1) - COS(RCONST(3.0)*t) + RCONST(2.0)*COS(RCONST(2.0)*t); NV_Ith_S(ydot,1) = NV_Ith_S(y,0) - NV_Ith_S(y,1) - SIN(RCONST(2.0)*t) @@ -608,13 +608,13 @@ static int check_flag(void *flagvalue, const char *funcname, int opt) error values >1 are omitted from these checks, as non-convergence may occur differently on various architectures. - We consider realtype precisions {32,64,128} and stiffness values + We consider sunrealtype precisions {32,64,128} and stiffness values lambda = {-1e2, -1e4, -1e6}. */ -static int verify_results(realtype lambda, int rtype, - realtype *yrate, realtype *dyrate, - realtype *d2yrate, realtype *yrate2, - realtype *dyrate2, realtype *d2yrate2) +static int verify_results(sunrealtype lambda, int rtype, + sunrealtype *yrate, sunrealtype *dyrate, + sunrealtype *d2yrate, sunrealtype *yrate2, + sunrealtype *dyrate2, sunrealtype *d2yrate2) { int tests=0; int failure=0; diff --git a/test/unit_tests/arkode/C_serial/ark_test_reset.c b/test/unit_tests/arkode/C_serial/ark_test_reset.c index f9c7a61c24..6075c8d90e 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_reset.c +++ b/test/unit_tests/arkode/C_serial/ark_test_reset.c @@ -54,29 +54,29 @@ #endif /* User-supplied Functions Called by the Solver */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Analytical solution */ -static realtype ytrue(realtype t); +static sunrealtype ytrue(sunrealtype t); /* Private function to check function return values */ static int check_retval(void *flagvalue, const char *funcname, int opt); /* Private function to check computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol); +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol); /* Main Program */ int main() { /* general problem parameters */ - realtype T0 = RCONST(0.0); - realtype dTout = RCONST(0.1); - realtype lambda = RCONST(-25.0); - realtype rtol = RCONST(1e-3); - realtype atol = RCONST(1e-6); + sunrealtype T0 = RCONST(0.0); + sunrealtype dTout = RCONST(0.1); + sunrealtype lambda = RCONST(-25.0); + sunrealtype rtol = RCONST(1e-3); + sunrealtype atol = RCONST(1e-6); /* general problem variables */ N_Vector y = NULL; @@ -86,7 +86,7 @@ int main() void *mristep_mem = NULL; MRIStepInnerStepper inner_stepper = NULL; int retval; - realtype t; + sunrealtype t; SUNContext ctx; @@ -406,11 +406,11 @@ int main() *-------------------------------*/ /* f routine to compute the ODE RHS function f(t,y). */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype u = NV_Ith_S(y,0); /* access current solution value */ + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ NV_Ith_S(ydot,0) = lambda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lambda*atan(t); @@ -419,19 +419,19 @@ static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) } /* f0 routine to compute a zero-valued ODE RHS function f(t,y). */ -static int f0(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { N_VConst(RCONST(0.0), ydot); return 0; } /* Jacobian routine to compute J(t,y) = df/dy. */ -static int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype *Jdata = SUNDenseMatrix_Data(J); + sunrealtype *rdata = (sunrealtype *) user_data; /* cast user_data to sunrealtype */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype *Jdata = SUNDenseMatrix_Data(J); /* Fill in Jacobian of f: set the first entry of the data array to set the (0,0) entry */ Jdata[0] = lambda; @@ -479,16 +479,16 @@ static int check_retval(void *flagvalue, const char *funcname, int opt) } /* analytical solution */ -static realtype ytrue(realtype t) +static sunrealtype ytrue(sunrealtype t) { return (atan(t)); } /* check the computed solution */ -static int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail=0; /* answer pass (0) or fail (1) value */ - realtype ans, err, ewt; /* answer data, error, and error weight */ + sunrealtype ans, err, ewt; /* answer data, error, and error weight */ /* compute solution error */ ans = ytrue(t); diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.cpp b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.cpp index 7105d57cf0..673e08b636 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.cpp +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.cpp @@ -46,11 +46,11 @@ int main(int argc, char* argv[]) N_Vector y = N_VNew_Serial(2, sunctx); if (check_ptr(y, "N_VNew_Serial")) return 1; - realtype utrue, vtrue; + sunrealtype utrue, vtrue; flag = true_sol(ZERO, &utrue, &vtrue); if (check_flag(flag, "true_sol")) return 1; - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); ydata[0] = utrue; ydata[1] = vtrue; @@ -76,7 +76,7 @@ int main(int argc, char* argv[]) flag = CVodeSetJacFn(cvode_mem, J); if (check_flag(flag, "CVodeSetJacFn")) return 1; - realtype udata[4] = {-TWO, HALF, HALF, -ONE}; + sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; flag = CVodeSetUserData(cvode_mem, udata); if (check_flag(flag, "CVodeSetUserData")) return 1; @@ -118,12 +118,12 @@ int main(int argc, char* argv[]) if (check_flag(flag, "CVodeSetDeltaGammaMaxBadJac")) return 1; // Initial time and fist output time - realtype tret = ZERO; - realtype tout = tret + opts.dtout; + sunrealtype tret = ZERO; + sunrealtype tout = tret + opts.dtout; // Output initial contion cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " u "; cout << " v "; @@ -179,22 +179,22 @@ int main(int argc, char* argv[]) * [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; - const realtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); - const realtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); + const sunrealtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); + const sunrealtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); - realtype* fdata = N_VGetArrayPointer(ydot); + sunrealtype* fdata = N_VGetArrayPointer(ydot); fdata[0] = a * tmp1 + b * tmp2 + rdot(t) / (TWO * u); fdata[1] = c * tmp1 + d * tmp2 + sdot(t) / (TWO * v); @@ -206,20 +206,20 @@ int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * [a/2 + (a(1+r(t))-rdot(t))/(2u^2) b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - realtype* Jdata = SUNDenseMatrix_Data(J); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; Jdata[0] = a / TWO + (a * (ONE + r(t)) - rdot(t)) / (TWO * u * u); Jdata[1] = c / TWO + c * (ONE + r(t)) / (TWO * u * u); diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp index d09f3ba46c..5d24591655 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp @@ -46,44 +46,44 @@ using namespace std; struct TestOptions { // Relative and absolute tolerances - realtype rtol = RCONST(1.0e-6); - realtype atol = RCONST(1.0e-10); + sunrealtype rtol = RCONST(1.0e-6); + sunrealtype atol = RCONST(1.0e-10); // Fixed step size eta bounds (use defaults = 0.0 and 1.5) - realtype eta_min_fx = -ONE; - realtype eta_max_fx = -ONE; + sunrealtype eta_min_fx = -ONE; + sunrealtype eta_max_fx = -ONE; // Max first step eta bound (use default = 10,000) - realtype eta_max_fs = -ONE; + sunrealtype eta_max_fs = -ONE; // Max early step eta bound and number of steps (use defaults = 10 and 10) - realtype eta_max_es = -ONE; + sunrealtype eta_max_es = -ONE; long int small_nst = -1; // Max eta bound on a general step (use default = 10) - realtype eta_max_gs = -ONE; + sunrealtype eta_max_gs = -ONE; // Min eta bound on a general step (use default = 0.1) - realtype eta_min = -ONE; + sunrealtype eta_min = -ONE; // Min eta bound after an error test fail (use default = 0.1) - realtype eta_min_ef = -ONE; + sunrealtype eta_min_ef = -ONE; // Max eta bound after multiple error test fails and number of fails necessary // (use defaults = 0.2 and 2) - realtype eta_max_ef = -ONE; + sunrealtype eta_max_ef = -ONE; int small_nef = -1; // Eta value on a nonlinear solver convergence failure (use default = 0.25) - realtype eta_cf = -ONE; + sunrealtype eta_cf = -ONE; // Change in gamma to call lsetup or mark a Jacobian as bad (use defaults 0.3 // and 0.2 - realtype dgmax_lsetup = -ONE; - realtype dgmax_jbad = -ONE; + sunrealtype dgmax_lsetup = -ONE; + sunrealtype dgmax_jbad = -ONE; // Output options - realtype dtout = ONE; // output interval + sunrealtype dtout = ONE; // output interval int nout = 10; // number of outputs }; @@ -92,10 +92,10 @@ struct TestOptions // ----------------------------------------------------------------------------- // ODE right-hand side function -int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); // Jacobian of RHS function -int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // ----------------------------------------------------------------------------- @@ -103,31 +103,31 @@ int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, // ----------------------------------------------------------------------------- // Compute r(t) -static realtype r(realtype t) +static sunrealtype r(sunrealtype t) { return HALF * cos(t); } // Compute the derivative of r(t) -static realtype rdot(realtype t) +static sunrealtype rdot(sunrealtype t) { return -HALF * sin(t); } // Compute s(t) -static realtype s(realtype t) +static sunrealtype s(sunrealtype t) { return cos(TWENTY * t); } // Compute the derivative of s(t) -static realtype sdot(realtype t) +static sunrealtype sdot(sunrealtype t) { return -TWENTY * sin(TWENTY * t); } // Compute the true solution -static int true_sol(realtype t, realtype* u, realtype* v) +static int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) { *u = sqrt(ONE + r(t)); *v = sqrt(TWO + s(t)); @@ -156,7 +156,7 @@ int check_ptr(void *ptr, const string funcname) return 1; } -inline void find_arg(vector &args, const string key, realtype &dest) +inline void find_arg(vector &args, const string key, sunrealtype &dest) { auto it = find(args.begin(), args.end(), key); if (it != args.end()) diff --git a/test/unit_tests/cvode/C_serial/cv_test_getuserdata.c b/test/unit_tests/cvode/C_serial/cv_test_getuserdata.c index 63e348f590..8b3a82ff88 100644 --- a/test/unit_tests/cvode/C_serial/cv_test_getuserdata.c +++ b/test/unit_tests/cvode/C_serial/cv_test_getuserdata.c @@ -24,7 +24,7 @@ #define ONE SUN_RCONST(1.0) /* Dummy user-supplied function */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { return 0; } diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.cpp b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.cpp index 5c0a09d0bd..ead24c6957 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.cpp +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.cpp @@ -46,11 +46,11 @@ int main(int argc, char* argv[]) N_Vector y = N_VNew_Serial(2, sunctx); if (check_ptr(y, "N_VNew_Serial")) return 1; - realtype utrue, vtrue; + sunrealtype utrue, vtrue; flag = true_sol(ZERO, &utrue, &vtrue); if (check_flag(flag, "true_sol")) return 1; - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); ydata[0] = utrue; ydata[1] = vtrue; @@ -76,7 +76,7 @@ int main(int argc, char* argv[]) flag = CVodeSetJacFn(cvode_mem, J); if (check_flag(flag, "CVodeSetJacFn")) return 1; - realtype udata[4] = {-TWO, HALF, HALF, -ONE}; + sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; flag = CVodeSetUserData(cvode_mem, udata); if (check_flag(flag, "CVodeSetUserData")) return 1; @@ -118,12 +118,12 @@ int main(int argc, char* argv[]) if (check_flag(flag, "CVodeSetDeltaGammaMaxBadJac")) return 1; // Initial time and fist output time - realtype tret = ZERO; - realtype tout = tret + opts.dtout; + sunrealtype tret = ZERO; + sunrealtype tout = tret + opts.dtout; // Output initial contion cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " u "; cout << " v "; @@ -179,22 +179,22 @@ int main(int argc, char* argv[]) * [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; - const realtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); - const realtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); + const sunrealtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); + const sunrealtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); - realtype* fdata = N_VGetArrayPointer(ydot); + sunrealtype* fdata = N_VGetArrayPointer(ydot); fdata[0] = a * tmp1 + b * tmp2 + rdot(t) / (TWO * u); fdata[1] = c * tmp1 + d * tmp2 + sdot(t) / (TWO * v); @@ -206,20 +206,20 @@ int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) * [a/2 + (a(1+r(t))-rdot(t))/(2u^2) b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - realtype* Jdata = SUNDenseMatrix_Data(J); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; Jdata[0] = a / TWO + (a * (ONE + r(t)) - rdot(t)) / (TWO * u * u); Jdata[1] = c / TWO + c * (ONE + r(t)) / (TWO * u * u); diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp index 28c94d0ca3..4102b693cb 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp @@ -46,44 +46,44 @@ using namespace std; struct TestOptions { // Relative and absolute tolerances - realtype rtol = RCONST(1.0e-6); - realtype atol = RCONST(1.0e-10); + sunrealtype rtol = RCONST(1.0e-6); + sunrealtype atol = RCONST(1.0e-10); // Fixed step size eta bounds (use defaults = 0.0 and 1.5) - realtype eta_min_fx = -ONE; - realtype eta_max_fx = -ONE; + sunrealtype eta_min_fx = -ONE; + sunrealtype eta_max_fx = -ONE; // Max first step eta bound (use default = 10,000) - realtype eta_max_fs = -ONE; + sunrealtype eta_max_fs = -ONE; // Max early step eta bound and number of steps (use defaults = 10 and 10) - realtype eta_max_es = -ONE; + sunrealtype eta_max_es = -ONE; long int small_nst = -1; // Max eta bound on a general step (use default = 10) - realtype eta_max_gs = -ONE; + sunrealtype eta_max_gs = -ONE; // Min eta bound on a general step (use default = 0.1) - realtype eta_min = -ONE; + sunrealtype eta_min = -ONE; // Min eta bound after an error test fail (use default = 0.1) - realtype eta_min_ef = -ONE; + sunrealtype eta_min_ef = -ONE; // Max eta bound after multiple error test fails and number of fails necessary // (use defaults = 0.2 and 2) - realtype eta_max_ef = -ONE; + sunrealtype eta_max_ef = -ONE; int small_nef = -1; // Eta value on a nonlinear solver convergence failure (use default = 0.25) - realtype eta_cf = -ONE; + sunrealtype eta_cf = -ONE; // Change in gamma to call lsetup or mark a Jacobian as bad (use defaults 0.3 // and 0.2 - realtype dgmax_lsetup = -ONE; - realtype dgmax_jbad = -ONE; + sunrealtype dgmax_lsetup = -ONE; + sunrealtype dgmax_jbad = -ONE; // Output options - realtype dtout = ONE; // output interval + sunrealtype dtout = ONE; // output interval int nout = 10; // number of outputs }; @@ -92,10 +92,10 @@ struct TestOptions // ----------------------------------------------------------------------------- // ODE right-hand side function -int f(realtype t, N_Vector y, N_Vector ydot, void *user_data); +int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); // Jacobian of RHS function -int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, +int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // ----------------------------------------------------------------------------- @@ -103,31 +103,31 @@ int J(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, // ----------------------------------------------------------------------------- // Compute r(t) -static realtype r(realtype t) +static sunrealtype r(sunrealtype t) { return HALF * cos(t); } // Compute the derivative of r(t) -static realtype rdot(realtype t) +static sunrealtype rdot(sunrealtype t) { return -HALF * sin(t); } // Compute s(t) -static realtype s(realtype t) +static sunrealtype s(sunrealtype t) { return cos(TWENTY * t); } // Compute the derivative of s(t) -static realtype sdot(realtype t) +static sunrealtype sdot(sunrealtype t) { return -TWENTY * sin(TWENTY * t); } // Compute the true solution -static int true_sol(realtype t, realtype* u, realtype* v) +static int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) { *u = sqrt(ONE + r(t)); *v = sqrt(TWO + s(t)); @@ -156,7 +156,7 @@ int check_ptr(void *ptr, const string funcname) return 1; } -inline void find_arg(vector &args, const string key, realtype &dest) +inline void find_arg(vector &args, const string key, sunrealtype &dest) { auto it = find(args.begin(), args.end(), key); if (it != args.end()) diff --git a/test/unit_tests/cvodes/C_serial/cvs_test_getuserdata.c b/test/unit_tests/cvodes/C_serial/cvs_test_getuserdata.c index 45c7b7a879..f108822af8 100644 --- a/test/unit_tests/cvodes/C_serial/cvs_test_getuserdata.c +++ b/test/unit_tests/cvodes/C_serial/cvs_test_getuserdata.c @@ -24,7 +24,7 @@ #define ONE SUN_RCONST(1.0) /* Dummy user-supplied function */ -static int f(realtype t, N_Vector y, N_Vector ydot, void *user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { return 0; } diff --git a/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp b/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp index b57874ea40..89767594a7 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp +++ b/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp @@ -136,7 +136,7 @@ int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, void* user_data) * [2 a u - 2 u' - 2 cj u 2 b v ] * [2 c u 2 d v - 2 v' - 2 cj v ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector res, +int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector res, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; @@ -167,7 +167,7 @@ int J(sunrealtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector res, // ----------------------------------------------------------------------------- int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { // Create a copy of the matrix for factorization SUNMatrix Acpy = SUNMatClone(A); diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp b/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp index 27ab2f70ad..23ed1f6e93 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp @@ -46,22 +46,22 @@ int main(int argc, char* argv[]) N_Vector y = N_VNew_Serial(2, sunctx); if (check_ptr(y, "N_VNew_Serial")) return 1; - realtype utrue, vtrue; + sunrealtype utrue, vtrue; flag = true_sol(ZERO, &utrue, &vtrue); if (check_flag(flag, "true_sol")) return 1; - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); ydata[0] = utrue; ydata[1] = vtrue; N_Vector yp = N_VNew_Serial(2, sunctx); if (check_ptr(y, "N_VNew_Serial")) return 1; - realtype uptrue, vptrue; + sunrealtype uptrue, vptrue; flag = true_sol_p(ZERO, &uptrue, &vptrue); if (check_flag(flag, "true_sol")) return 1; - realtype* ypdata = N_VGetArrayPointer(yp); + sunrealtype* ypdata = N_VGetArrayPointer(yp); ypdata[0] = uptrue; ypdata[1] = vptrue; @@ -87,7 +87,7 @@ int main(int argc, char* argv[]) flag = IDASetJacFn(ida_mem, J); if (check_flag(flag, "IDASetJacFn")) return 1; - realtype udata[4] = {-TWO, HALF, HALF, -ONE}; + sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; flag = IDASetUserData(ida_mem, udata); if (check_flag(flag, "IDASetUserData")) return 1; @@ -111,12 +111,12 @@ int main(int argc, char* argv[]) if (check_flag(flag, "IDASetDeltaCjLSetup")) return 1; // Initial time and fist output time - realtype tret = ZERO; - realtype tout = tret + opts.dtout; + sunrealtype tret = ZERO; + sunrealtype tout = tret + opts.dtout; // Output initial contion cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " u "; cout << " v "; @@ -173,26 +173,26 @@ int main(int argc, char* argv[]) * ru = [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] - [u'] * rv = [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] - [v'] * ---------------------------------------------------------------------------*/ -int res(realtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data) +int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; - realtype* ypdata = N_VGetArrayPointer(yp); - const realtype up = ypdata[0]; - const realtype vp = ypdata[1]; + sunrealtype* ypdata = N_VGetArrayPointer(yp); + const sunrealtype up = ypdata[0]; + const sunrealtype vp = ypdata[1]; - const realtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); - const realtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); + const sunrealtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); + const sunrealtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); - realtype* rdata = N_VGetArrayPointer(rr); + sunrealtype* rdata = N_VGetArrayPointer(rr); rdata[0] = (a * tmp1 + b * tmp2 + rdot(t) / (TWO * u)) - up; rdata[1] = (c * tmp1 + d * tmp2 + sdot(t) / (TWO * v)) - vp; @@ -204,21 +204,21 @@ int res(realtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data) * [a/2 + (a(1+r(t))-r'(t))/(2u^2) - cj b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-s'(t))/(2u^2) - cj ] * ---------------------------------------------------------------------------*/ -int J(realtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector rr, +int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector rr, SUNMatrix J, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - realtype* Jdata = SUNDenseMatrix_Data(J); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; Jdata[0] = (a / TWO + (a * (ONE + r(t)) - rdot(t)) / (TWO * u * u)) - cj; Jdata[1] = c / TWO + c * (ONE + r(t)) / (TWO * u * u); diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp b/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp index 97ec70b4f4..26427a2f8a 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp @@ -46,28 +46,28 @@ using namespace std; struct TestOptions { // Relative and absolute tolerances - realtype rtol = RCONST(1.0e-6); - realtype atol = RCONST(1.0e-10); + sunrealtype rtol = RCONST(1.0e-6); + sunrealtype atol = RCONST(1.0e-10); // Fixed step size eta bounds (use defaults = 0.0 and 1.5) - realtype eta_min_fx = -ONE; - realtype eta_max_fx = -ONE; + sunrealtype eta_min_fx = -ONE; + sunrealtype eta_max_fx = -ONE; // Max and min eta bounds on a general step (use default = 10) - realtype eta_max = -ONE; - realtype eta_min = -ONE; + sunrealtype eta_max = -ONE; + sunrealtype eta_min = -ONE; // Min eta bound after an error test fail (use default = 0.25) - realtype eta_min_ef = -ONE; + sunrealtype eta_min_ef = -ONE; // Eta value on a nonlinear solver convergence failure (use default = 0.25) - realtype eta_cf = -ONE; + sunrealtype eta_cf = -ONE; // Parameter for if a change in c_j needs a call lsetup (use defaults 0.25) - realtype dcj = -ONE; + sunrealtype dcj = -ONE; // Output options - realtype dtout = ONE; // output interval + sunrealtype dtout = ONE; // output interval int nout = 10; // number of outputs }; @@ -76,10 +76,10 @@ struct TestOptions // ----------------------------------------------------------------------------- // DAE residual function -int res(realtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data); +int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data); // Jacobian of RHS function -int J(realtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector rr, +int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector rr, SUNMatrix J, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); @@ -88,31 +88,31 @@ int J(realtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector rr, // ----------------------------------------------------------------------------- // Compute r(t) -static realtype r(realtype t) +static sunrealtype r(sunrealtype t) { return HALF * cos(t); } // Compute the derivative of r(t) -static realtype rdot(realtype t) +static sunrealtype rdot(sunrealtype t) { return -HALF * sin(t); } // Compute s(t) -static realtype s(realtype t) +static sunrealtype s(sunrealtype t) { return cos(TWENTY * t); } // Compute the derivative of s(t) -static realtype sdot(realtype t) +static sunrealtype sdot(sunrealtype t) { return -TWENTY * sin(TWENTY * t); } // Compute the true solution -static int true_sol(realtype t, realtype* u, realtype* v) +static int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) { *u = sqrt(ONE + r(t)); *v = sqrt(TWO + s(t)); @@ -121,7 +121,7 @@ static int true_sol(realtype t, realtype* u, realtype* v) } // Compute the true solution derivative -static int true_sol_p(realtype t, realtype* up, realtype* vp) +static int true_sol_p(sunrealtype t, sunrealtype* up, sunrealtype* vp) { *up = rdot(t) / (TWO * sqrt(ONE + r(t))); *vp = sdot(t) / (TWO * sqrt(TWO + s(t))); @@ -150,7 +150,7 @@ int check_ptr(void *ptr, const string funcname) return 1; } -inline void find_arg(vector &args, const string key, realtype &dest) +inline void find_arg(vector &args, const string key, sunrealtype &dest) { auto it = find(args.begin(), args.end(), key); if (it != args.end()) diff --git a/test/unit_tests/ida/C_serial/ida_test_getuserdata.c b/test/unit_tests/ida/C_serial/ida_test_getuserdata.c index b745c8bfb3..31e664c189 100644 --- a/test/unit_tests/ida/C_serial/ida_test_getuserdata.c +++ b/test/unit_tests/ida/C_serial/ida_test_getuserdata.c @@ -24,7 +24,7 @@ #define ONE SUN_RCONST(1.0) /* Dummy user-supplied function */ -static int r(realtype t, N_Vector y, N_Vector ydot, N_Vector res, +static int r(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, void *user_data) { return 0; diff --git a/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp b/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp index c084ddc012..bcc4e43d0c 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp +++ b/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp @@ -136,7 +136,7 @@ int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, void* user_data) * [2 a u - 2 u' - 2 cj u 2 b v ] * [2 c u 2 d v - 2 v' - 2 cj v ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector res, +int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector res, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; @@ -167,7 +167,7 @@ int J(sunrealtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector res, // ----------------------------------------------------------------------------- int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { // Create a copy of the matrix for factorization SUNMatrix Acpy = SUNMatClone(A); diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp b/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp index 61bc0b2f59..5816715110 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp @@ -46,22 +46,22 @@ int main(int argc, char* argv[]) N_Vector y = N_VNew_Serial(2, sunctx); if (check_ptr(y, "N_VNew_Serial")) return 1; - realtype utrue, vtrue; + sunrealtype utrue, vtrue; flag = true_sol(ZERO, &utrue, &vtrue); if (check_flag(flag, "true_sol")) return 1; - realtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydata = N_VGetArrayPointer(y); ydata[0] = utrue; ydata[1] = vtrue; N_Vector yp = N_VNew_Serial(2, sunctx); if (check_ptr(y, "N_VNew_Serial")) return 1; - realtype uptrue, vptrue; + sunrealtype uptrue, vptrue; flag = true_sol_p(ZERO, &uptrue, &vptrue); if (check_flag(flag, "true_sol")) return 1; - realtype* ypdata = N_VGetArrayPointer(yp); + sunrealtype* ypdata = N_VGetArrayPointer(yp); ypdata[0] = uptrue; ypdata[1] = vptrue; @@ -87,7 +87,7 @@ int main(int argc, char* argv[]) flag = IDASetJacFn(ida_mem, J); if (check_flag(flag, "IDASetJacFn")) return 1; - realtype udata[4] = {-TWO, HALF, HALF, -ONE}; + sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; flag = IDASetUserData(ida_mem, udata); if (check_flag(flag, "IDASetUserData")) return 1; @@ -111,12 +111,12 @@ int main(int argc, char* argv[]) if (check_flag(flag, "IDASetDeltaCjLSetup")) return 1; // Initial time and fist output time - realtype tret = ZERO; - realtype tout = tret + opts.dtout; + sunrealtype tret = ZERO; + sunrealtype tout = tret + opts.dtout; // Output initial contion cout << scientific; - cout << setprecision(numeric_limits::digits10); + cout << setprecision(numeric_limits::digits10); cout << " t "; cout << " u "; cout << " v "; @@ -173,26 +173,26 @@ int main(int argc, char* argv[]) * ru = [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] - [u'] * rv = [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] - [v'] * ---------------------------------------------------------------------------*/ -int res(realtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data) +int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; - realtype* ypdata = N_VGetArrayPointer(yp); - const realtype up = ypdata[0]; - const realtype vp = ypdata[1]; + sunrealtype* ypdata = N_VGetArrayPointer(yp); + const sunrealtype up = ypdata[0]; + const sunrealtype vp = ypdata[1]; - const realtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); - const realtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); + const sunrealtype tmp1 = (-ONE + u * u - r(t)) / (TWO * u); + const sunrealtype tmp2 = (-TWO + v * v - s(t)) / (TWO * v); - realtype* rdata = N_VGetArrayPointer(rr); + sunrealtype* rdata = N_VGetArrayPointer(rr); rdata[0] = (a * tmp1 + b * tmp2 + rdot(t) / (TWO * u)) - up; rdata[1] = (c * tmp1 + d * tmp2 + sdot(t) / (TWO * v)) - vp; @@ -204,21 +204,21 @@ int res(realtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data) * [a/2 + (a(1+r(t))-r'(t))/(2u^2) - cj b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-s'(t))/(2u^2) - cj ] * ---------------------------------------------------------------------------*/ -int J(realtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector rr, +int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector rr, SUNMatrix J, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { - realtype* udata = (realtype *) user_data; - const realtype a = udata[0]; - const realtype b = udata[1]; - const realtype c = udata[2]; - const realtype d = udata[3]; + sunrealtype* udata = (sunrealtype *) user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; - realtype* ydata = N_VGetArrayPointer(y); - realtype* Jdata = SUNDenseMatrix_Data(J); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); - const realtype u = ydata[0]; - const realtype v = ydata[1]; + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; Jdata[0] = (a / TWO + (a * (ONE + r(t)) - rdot(t)) / (TWO * u * u)) - cj; Jdata[1] = c / TWO + c * (ONE + r(t)) / (TWO * u * u); diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp b/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp index 6913518e8c..4f67cef61f 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp @@ -46,28 +46,28 @@ using namespace std; struct TestOptions { // Relative and absolute tolerances - realtype rtol = RCONST(1.0e-6); - realtype atol = RCONST(1.0e-10); + sunrealtype rtol = RCONST(1.0e-6); + sunrealtype atol = RCONST(1.0e-10); // Fixed step size eta bounds (use defaults = 0.0 and 1.5) - realtype eta_min_fx = -ONE; - realtype eta_max_fx = -ONE; + sunrealtype eta_min_fx = -ONE; + sunrealtype eta_max_fx = -ONE; // Max and min eta bounds on a general step (use default = 10) - realtype eta_max = -ONE; - realtype eta_min = -ONE; + sunrealtype eta_max = -ONE; + sunrealtype eta_min = -ONE; // Min eta bound after an error test fail (use default = 0.25) - realtype eta_min_ef = -ONE; + sunrealtype eta_min_ef = -ONE; // Eta value on a nonlinear solver convergence failure (use default = 0.25) - realtype eta_cf = -ONE; + sunrealtype eta_cf = -ONE; // Parameter for if a change in c_j needs a call lsetup (use defaults 0.25) - realtype dcj = -ONE; + sunrealtype dcj = -ONE; // Output options - realtype dtout = ONE; // output interval + sunrealtype dtout = ONE; // output interval int nout = 10; // number of outputs }; @@ -76,10 +76,10 @@ struct TestOptions // ----------------------------------------------------------------------------- // DAE residual function -int res(realtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data); +int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector rr, void *user_data); // Jacobian of RHS function -int J(realtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector rr, +int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector rr, SUNMatrix J, void *user_data, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3); @@ -88,31 +88,31 @@ int J(realtype t, realtype cj, N_Vector y, N_Vector yp, N_Vector rr, // ----------------------------------------------------------------------------- // Compute r(t) -static realtype r(realtype t) +static sunrealtype r(sunrealtype t) { return HALF * cos(t); } // Compute the derivative of r(t) -static realtype rdot(realtype t) +static sunrealtype rdot(sunrealtype t) { return -HALF * sin(t); } // Compute s(t) -static realtype s(realtype t) +static sunrealtype s(sunrealtype t) { return cos(TWENTY * t); } // Compute the derivative of s(t) -static realtype sdot(realtype t) +static sunrealtype sdot(sunrealtype t) { return -TWENTY * sin(TWENTY * t); } // Compute the true solution -static int true_sol(realtype t, realtype* u, realtype* v) +static int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) { *u = sqrt(ONE + r(t)); *v = sqrt(TWO + s(t)); @@ -121,7 +121,7 @@ static int true_sol(realtype t, realtype* u, realtype* v) } // Compute the true solution derivative -static int true_sol_p(realtype t, realtype* up, realtype* vp) +static int true_sol_p(sunrealtype t, sunrealtype* up, sunrealtype* vp) { *up = rdot(t) / (TWO * sqrt(ONE + r(t))); *vp = sdot(t) / (TWO * sqrt(TWO + s(t))); @@ -150,7 +150,7 @@ int check_ptr(void *ptr, const string funcname) return 1; } -inline void find_arg(vector &args, const string key, realtype &dest) +inline void find_arg(vector &args, const string key, sunrealtype &dest) { auto it = find(args.begin(), args.end(), key); if (it != args.end()) diff --git a/test/unit_tests/idas/C_serial/idas_test_getuserdata.c b/test/unit_tests/idas/C_serial/idas_test_getuserdata.c index 058fe94e16..d1a42fde65 100644 --- a/test/unit_tests/idas/C_serial/idas_test_getuserdata.c +++ b/test/unit_tests/idas/C_serial/idas_test_getuserdata.c @@ -24,7 +24,7 @@ #define ONE SUN_RCONST(1.0) /* Dummy user-supplied function */ -static int r(realtype t, N_Vector y, N_Vector ydot, N_Vector res, +static int r(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, void *user_data) { return 0; diff --git a/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp b/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp index f9364169e4..ae3dea5a28 100644 --- a/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp +++ b/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp @@ -140,7 +140,7 @@ int J(N_Vector uu, N_Vector fuu, SUNMatrix J, void *user_data, N_Vector tmp1, // ----------------------------------------------------------------------------- int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, realtype tol) + N_Vector b, sunrealtype tol) { // Create a copy of the matrix for factorization SUNMatrix Acpy = SUNMatClone(A); From 7557be462b1134290fa593803a3e43bbd05ab776 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:43:26 -0700 Subject: [PATCH 07/85] update sunrealtype related macros --- .../kokkos/advection_reaction_3D.cpp | 4 +- .../raja/advection_reaction_3D.cpp | 4 +- benchmarks/diffusion_2D/diffusion_2D.hpp | 10 +- benchmarks/diffusion_2D/main_arkode.cpp | 4 +- benchmarks/diffusion_2D/main_cvode.cpp | 4 +- benchmarks/diffusion_2D/main_ida.cpp | 4 +- .../cuda/test_nvector_performance_cuda.cu | 2 +- .../hip/test_nvector_performance_hip.cpp | 2 +- .../test_nvector_performance_mpiplusx.c | 4 +- .../openmp/test_nvector_performance_openmp.c | 4 +- .../test_nvector_performance_parallel.c | 4 +- .../parhyp/test_nvector_performance_parhyp.c | 4 +- .../petsc/test_nvector_performance_petsc.c | 4 +- .../test_nvector_performance_pthreads.c | 4 +- .../serial/test_nvector_performance_serial.c | 4 +- benchmarks/nvector/test_nvector_performance.h | 10 +- .../guide/source/Usage/User_supplied.rst | 8 +- doc/cvode/guide/source/Usage/index.rst | 10 +- doc/cvodes/guide/source/Usage/ADJ.rst | 4 +- doc/cvodes/guide/source/Usage/SIM.rst | 10 +- doc/ida/guide/source/Usage/index.rst | 8 +- doc/idas/guide/source/Usage/ADJ.rst | 4 +- doc/idas/guide/source/Usage/SIM.rst | 8 +- doc/kinsol/guide/source/Usage/index.rst | 6 +- doc/shared/Types.rst | 18 +- doc/shared/nvectors/NVector_Operations.rst | 4 +- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 54 +- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 14 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 14 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 14 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 14 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 14 +- .../ark_advection_diffusion_reaction.cpp | 2 +- .../ark_advection_diffusion_reaction.hpp | 30 +- .../arkode/CXX_serial/ark_analytic_sys.cpp | 12 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 14 +- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 34 +- .../ark_brusselator1D_FEM_sludist.cpp | 52 +- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 14 +- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 14 +- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 14 +- .../C_manyvector/ark_brusselator1D_manyvec.c | 34 +- .../arkode/C_openmp/ark_brusselator1D_omp.c | 42 +- examples/arkode/C_openmp/ark_heat1D_omp.c | 10 +- .../C_openmpdev/ark_analytic_nonlin_ompdev.c | 6 +- .../C_openmpdev/ark_heat1D_adapt_ompdev.c | 38 +- .../arkode/C_openmpdev/ark_heat1D_ompdev.c | 10 +- .../arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 64 +- .../arkode/C_parallel/ark_diurnal_kry_p.c | 86 +- examples/arkode/C_parhyp/ark_diurnal_kry_ph.c | 86 +- .../arkode/C_serial/ark_KrylovDemo_prec.c | 38 +- examples/arkode/C_serial/ark_analytic.c | 20 +- examples/arkode/C_serial/ark_analytic_mels.c | 20 +- .../arkode/C_serial/ark_analytic_nonlin.c | 6 +- examples/arkode/C_serial/ark_brusselator.c | 42 +- examples/arkode/C_serial/ark_brusselator1D.c | 42 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 52 +- .../C_serial/ark_brusselator1D_imexmri.c | 120 +- .../arkode/C_serial/ark_brusselator1D_klu.c | 18 +- .../arkode/C_serial/ark_brusselator_1D_mri.c | 34 +- examples/arkode/C_serial/ark_brusselator_fp.c | 42 +- .../arkode/C_serial/ark_brusselator_mri.c | 22 +- examples/arkode/C_serial/ark_heat1D.c | 10 +- examples/arkode/C_serial/ark_heat1D_adapt.c | 38 +- examples/arkode/C_serial/ark_kepler.c | 4 +- examples/arkode/C_serial/ark_kpr_mri.c | 98 +- .../arkode/C_serial/ark_onewaycouple_mri.c | 34 +- .../C_serial/ark_reaction_diffusion_mri.c | 26 +- examples/arkode/C_serial/ark_robertson.c | 28 +- .../C_serial/ark_robertson_constraints.c | 30 +- examples/arkode/C_serial/ark_robertson_root.c | 26 +- .../arkode/C_serial/ark_twowaycouple_mri.c | 20 +- .../CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp | 50 +- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 14 +- .../cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp | 14 +- .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 14 +- examples/cvode/CXX_serial/cv_heat2D.hpp | 10 +- examples/cvode/CXX_serial/cv_kpr.hpp | 14 +- .../cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp | 22 +- .../cvDiurnal_kry_mpimanyvec.c | 86 +- examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c | 22 +- .../cvode/C_openmpdev/cvAdvDiff_kry_ompdev.c | 22 +- examples/cvode/cuda/cvAdvDiff_diag_cuda.cu | 18 +- examples/cvode/cuda/cvAdvDiff_kry_cuda.cu | 22 +- .../cvode/cuda/cvAdvDiff_kry_cuda_managed.cu | 22 +- .../cvRoberts_block_cusolversp_batchqr.cu | 40 +- examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp | 10 +- examples/cvode/ginkgo/cv_kpr_ginkgo.hpp | 14 +- examples/cvode/hip/cvAdvDiff_diag_hip.cpp | 18 +- examples/cvode/hip/cvAdvDiff_kry_hip.cpp | 22 +- .../cvode/magma/cv_bruss_batched_magma.cpp | 42 +- examples/cvode/parallel/cvAdvDiff_diag_p.c | 18 +- examples/cvode/parallel/cvAdvDiff_non_p.c | 18 +- examples/cvode/parallel/cvDiurnal_kry_bbd_p.c | 64 +- examples/cvode/parallel/cvDiurnal_kry_p.c | 86 +- examples/cvode/parhyp/cvAdvDiff_non_ph.c | 18 +- examples/cvode/petsc/cvAdvDiff_petsc.c | 18 +- examples/cvode/raja/cvAdvDiff_kry_raja.cpp | 22 +- examples/cvode/serial/cvAdvDiff_bnd.c | 22 +- examples/cvode/serial/cvAdvDiff_bndL.c | 22 +- examples/cvode/serial/cvAnalytic_mels.c | 20 +- examples/cvode/serial/cvDirectDemo_ls.c | 34 +- examples/cvode/serial/cvDisc_dns.c | 18 +- examples/cvode/serial/cvDiurnal_kry.c | 72 +- examples/cvode/serial/cvDiurnal_kry_bp.c | 60 +- examples/cvode/serial/cvHeat2D_klu.c | 36 +- examples/cvode/serial/cvKrylovDemo_ls.c | 66 +- examples/cvode/serial/cvKrylovDemo_prec.c | 38 +- examples/cvode/serial/cvParticle_dns.c | 12 +- examples/cvode/serial/cvPendulum_dns.c | 18 +- examples/cvode/serial/cvRoberts_block_klu.c | 40 +- examples/cvode/serial/cvRoberts_dns.c | 54 +- examples/cvode/serial/cvRoberts_dnsL.c | 44 +- .../cvode/serial/cvRoberts_dns_constraints.c | 54 +- examples/cvode/serial/cvRoberts_dns_negsol.c | 26 +- examples/cvode/serial/cvRoberts_dns_uw.c | 44 +- examples/cvode/serial/cvRoberts_klu.c | 44 +- examples/cvode/serial/cvRoberts_sps.c | 44 +- examples/cvode/serial/cvRocket_dns.c | 36 +- .../cvode/superludist/cvAdvDiff_sludist.cpp | 18 +- examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c | 22 +- .../cvodes/parallel/cvsAdvDiff_ASAp_non_p.c | 18 +- .../cvodes/parallel/cvsAdvDiff_FSA_non_p.c | 20 +- examples/cvodes/parallel/cvsAdvDiff_non_p.c | 18 +- .../parallel/cvsAtmDisp_ASAi_kry_bbd_p.c | 68 +- .../cvodes/parallel/cvsDiurnal_FSA_kry_p.c | 74 +- .../cvodes/parallel/cvsDiurnal_kry_bbd_p.c | 64 +- examples/cvodes/parallel/cvsDiurnal_kry_p.c | 86 +- examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c | 26 +- examples/cvodes/serial/cvsAdvDiff_FSA_non.c | 22 +- examples/cvodes/serial/cvsAdvDiff_bnd.c | 22 +- examples/cvodes/serial/cvsAdvDiff_bndL.c | 22 +- examples/cvodes/serial/cvsAnalytic_mels.c | 20 +- examples/cvodes/serial/cvsDirectDemo_ls.c | 34 +- examples/cvodes/serial/cvsDiurnal_FSA_kry.c | 78 +- examples/cvodes/serial/cvsDiurnal_kry.c | 72 +- examples/cvodes/serial/cvsDiurnal_kry_bp.c | 60 +- examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c | 42 +- examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c | 42 +- examples/cvodes/serial/cvsHessian_ASA_FSA.c | 10 +- examples/cvodes/serial/cvsKrylovDemo_ls.c | 66 +- examples/cvodes/serial/cvsKrylovDemo_prec.c | 38 +- examples/cvodes/serial/cvsParticle_dns.c | 12 +- examples/cvodes/serial/cvsPendulum_dns.c | 18 +- examples/cvodes/serial/cvsRoberts_ASAi_dns.c | 38 +- .../serial/cvsRoberts_ASAi_dns_constraints.c | 40 +- examples/cvodes/serial/cvsRoberts_ASAi_klu.c | 38 +- examples/cvodes/serial/cvsRoberts_ASAi_sps.c | 38 +- examples/cvodes/serial/cvsRoberts_FSA_dns.c | 28 +- .../cvodes/serial/cvsRoberts_FSA_dns_Switch.c | 38 +- .../serial/cvsRoberts_FSA_dns_constraints.c | 30 +- examples/cvodes/serial/cvsRoberts_FSA_klu.c | 28 +- examples/cvodes/serial/cvsRoberts_FSA_sps.c | 28 +- examples/cvodes/serial/cvsRoberts_dns.c | 54 +- examples/cvodes/serial/cvsRoberts_dnsL.c | 44 +- .../serial/cvsRoberts_dns_constraints.c | 54 +- examples/cvodes/serial/cvsRoberts_dns_uw.c | 44 +- examples/cvodes/serial/cvsRoberts_klu.c | 44 +- examples/cvodes/serial/cvsRoberts_sps.c | 44 +- examples/ida/C_openmp/idaFoodWeb_bnd_omp.c | 44 +- examples/ida/C_openmp/idaFoodWeb_kry_omp.c | 46 +- examples/ida/cuda/idaHeat2D_kry_cuda.cu | 14 +- .../ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu | 12 +- .../ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp | 12 +- examples/ida/parallel/idaFoodWeb_kry_bbd_p.c | 40 +- examples/ida/parallel/idaFoodWeb_kry_p.c | 44 +- examples/ida/parallel/idaHeat2D_kry_bbd_p.c | 12 +- examples/ida/parallel/idaHeat2D_kry_p.c | 12 +- examples/ida/petsc/idaHeat2D_petsc_snes.c | 10 +- examples/ida/petsc/idaHeat2D_petsc_spgmr.c | 10 +- examples/ida/raja/idaHeat2D_kry_raja.cpp | 14 +- examples/ida/serial/idaAnalytic_mels.c | 30 +- examples/ida/serial/idaFoodWeb_bnd.c | 44 +- examples/ida/serial/idaFoodWeb_kry.c | 46 +- examples/ida/serial/idaHeat2D_bnd.c | 16 +- examples/ida/serial/idaHeat2D_klu.c | 20 +- examples/ida/serial/idaHeat2D_kry.c | 14 +- examples/ida/serial/idaHeat2D_sps.c | 20 +- examples/ida/serial/idaKrylovDemo_ls.c | 14 +- examples/ida/serial/idaRoberts_dns.c | 48 +- examples/ida/serial/idaRoberts_klu.c | 52 +- examples/ida/serial/idaRoberts_sps.c | 40 +- examples/ida/serial/idaSlCrank_dns.c | 16 +- .../ida/trilinos/idaHeat2D_kry_p_tpetra.cpp | 12 +- .../ida/trilinos/idaHeat2D_kry_tpetra.cpp | 14 +- examples/idas/C_openmp/idasFoodWeb_bnd_omp.c | 44 +- examples/idas/C_openmp/idasFoodWeb_kry_omp.c | 46 +- .../idas/parallel/idasBruss_ASAp_kry_bbd_p.c | 32 +- .../idas/parallel/idasBruss_FSA_kry_bbd_p.c | 30 +- examples/idas/parallel/idasBruss_kry_bbd_p.c | 30 +- .../idas/parallel/idasFoodWeb_kry_bbd_p.c | 40 +- examples/idas/parallel/idasFoodWeb_kry_p.c | 44 +- .../idas/parallel/idasHeat2D_FSA_kry_bbd_p.c | 12 +- examples/idas/parallel/idasHeat2D_kry_bbd_p.c | 12 +- examples/idas/parallel/idasHeat2D_kry_p.c | 12 +- examples/idas/serial/idasAkzoNob_ASAi_dns.c | 58 +- examples/idas/serial/idasAkzoNob_dns.c | 50 +- examples/idas/serial/idasAnalytic_mels.c | 30 +- examples/idas/serial/idasFoodWeb_bnd.c | 44 +- examples/idas/serial/idasHeat2D_bnd.c | 16 +- examples/idas/serial/idasHeat2D_kry.c | 14 +- examples/idas/serial/idasHessian_ASA_FSA.c | 34 +- examples/idas/serial/idasKrylovDemo_ls.c | 14 +- examples/idas/serial/idasRoberts_ASAi_dns.c | 46 +- examples/idas/serial/idasRoberts_ASAi_klu.c | 46 +- examples/idas/serial/idasRoberts_ASAi_sps.c | 46 +- examples/idas/serial/idasRoberts_FSA_dns.c | 28 +- examples/idas/serial/idasRoberts_FSA_klu.c | 28 +- examples/idas/serial/idasRoberts_FSA_sps.c | 28 +- examples/idas/serial/idasRoberts_dns.c | 48 +- examples/idas/serial/idasRoberts_klu.c | 52 +- examples/idas/serial/idasRoberts_sps.c | 40 +- examples/idas/serial/idasSlCrank_FSA_dns.c | 28 +- examples/idas/serial/idasSlCrank_dns.c | 24 +- examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu | 8 +- examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp | 18 +- examples/kinsol/CXX_parallel/kin_em_p.cpp | 8 +- examples/kinsol/CXX_parallel/kin_em_p.hpp | 18 +- .../CXX_parallel/kin_heat2D_nonlin_p.cpp | 2 +- .../CXX_parallel/kin_heat2D_nonlin_p.hpp | 12 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 4 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp | 12 +- .../kin_heat2D_nonlin_hypre_pfmg.cpp | 4 +- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 10 +- examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c | 40 +- .../kinsol/parallel/kinFoodWeb_kry_bbd_p.c | 36 +- examples/kinsol/parallel/kinFoodWeb_kry_p.c | 38 +- examples/kinsol/serial/kinAnalytic_fp.c | 38 +- examples/kinsol/serial/kinFerTron_dns.c | 24 +- examples/kinsol/serial/kinFerTron_klu.c | 24 +- examples/kinsol/serial/kinFoodWeb_kry.c | 40 +- examples/kinsol/serial/kinKrylovDemo_ls.c | 40 +- examples/kinsol/serial/kinLaplace_bnd.c | 8 +- .../kinsol/serial/kinLaplace_picard_bnd.c | 8 +- .../kinsol/serial/kinLaplace_picard_kry.c | 8 +- examples/kinsol/serial/kinRoberts_fp.c | 26 +- examples/kinsol/serial/kinRoboKin_dns.c | 10 +- examples/kinsol/serial/kinRoboKin_slu.c | 10 +- examples/nvector/test_nvector.c | 26 +- examples/nvector/test_nvector.h | 14 +- .../band/test_fsunlinsol_band_mod.f90 | 2 +- examples/sunlinsol/band/test_sunlinsol_band.c | 2 +- .../test_sunlinsol_cusolversp_batchqr.cu | 2 +- .../dense/test_fsunlinsol_dense_mod.f90 | 2 +- .../sunlinsol/dense/test_sunlinsol_dense.c | 2 +- .../sunlinsol/klu/test_fsunlinsol_klu_mod.f90 | 2 +- examples/sunlinsol/klu/test_sunlinsol_klu.c | 2 +- .../lapackband/test_sunlinsol_lapackband.c | 2 +- .../lapackdense/test_sunlinsol_lapackdense.c | 2 +- .../magmadense/test_sunlinsol_magmadense.cpp | 4 +- .../test_sunlinsol_onemkldense.cpp | 4 +- .../parallel/test_sunlinsol_pcg_parallel.c | 4 +- .../pcg/serial/test_sunlinsol_pcg_serial.c | 4 +- .../parallel/test_sunlinsol_spbcgs_parallel.c | 4 +- .../serial/test_sunlinsol_spbcgs_serial.c | 4 +- .../parallel/test_sunlinsol_spfgmr_parallel.c | 4 +- .../serial/test_sunlinsol_spfgmr_serial.c | 4 +- .../parallel/test_sunlinsol_spgmr_parallel.c | 4 +- .../serial/test_sunlinsol_spgmr_serial.c | 4 +- .../test_sunlinsol_sptfqmr_parallel.c | 4 +- .../serial/test_sunlinsol_sptfqmr_serial.c | 4 +- .../test_sunlinsol_superludist.cpp | 2 +- .../superlumt/test_sunlinsol_superlumt.c | 2 +- examples/sunlinsol/test_sunlinsol.c | 2 +- examples/sunlinsol/test_sunlinsol.h | 4 +- examples/sunmatrix/band/test_sunmatrix_band.c | 4 +- .../cusparse/test_sunmatrix_cusparse.cu | 16 +- .../sunmatrix/sparse/test_sunmatrix_sparse.c | 146 +- examples/sunmatrix/test_sunmatrix.c | 12 +- examples/sunmatrix/test_sunmatrix.f90 | 12 +- examples/sunmatrix/test_sunmatrix.h | 16 +- .../fixedpoint/test_sunnonlinsol_fixedpoint.c | 30 +- .../newton/test_sunnonlinsol_newton.c | 16 +- .../petsc/test_sunnonlinsol_petscsnes.c | 16 +- examples/utilities/test_utilities.f90 | 4 +- include/cvode/cvode_hypamgpre.h | 2 +- include/sundials/sundials_math.h | 8 +- include/sundials/sundials_types.h | 20 - src/arkode/arkode.c | 12 +- src/arkode/arkode_adapt.c | 2 +- src/arkode/arkode_adapt_impl.h | 48 +- src/arkode/arkode_arkstep.c | 6 +- src/arkode/arkode_arkstep_impl.h | 12 +- src/arkode/arkode_arkstep_io.c | 140 +- src/arkode/arkode_arkstep_nls.c | 2 +- src/arkode/arkode_bandpre.c | 6 +- src/arkode/arkode_bbdpre.c | 6 +- src/arkode/arkode_butcher.c | 86 +- src/arkode/arkode_butcher_dirk.def | 1418 ++++++++--------- src/arkode/arkode_butcher_erk.def | 1066 ++++++------- src/arkode/arkode_erkstep.c | 2 +- src/arkode/arkode_erkstep_io.c | 12 +- src/arkode/arkode_impl.h | 28 +- src/arkode/arkode_interp.c | 106 +- src/arkode/arkode_interp_impl.h | 8 +- src/arkode/arkode_io.c | 8 +- src/arkode/arkode_ls.c | 10 +- src/arkode/arkode_ls_impl.h | 2 +- src/arkode/arkode_mri_tables.c | 6 +- src/arkode/arkode_mri_tables.def | 546 +++---- src/arkode/arkode_mristep.c | 8 +- src/arkode/arkode_mristep_impl.h | 8 +- src/arkode/arkode_mristep_io.c | 2 +- src/arkode/arkode_mristep_nls.c | 2 +- src/arkode/arkode_root_impl.h | 2 +- src/arkode/xbraid/arkode_xbraid.c | 2 +- src/cvode/cvode.c | 50 +- src/cvode/cvode_bandpre.c | 8 +- src/cvode/cvode_bbdpre.c | 8 +- src/cvode/cvode_diag.c | 4 +- src/cvode/cvode_fused_stubs.c | 10 +- src/cvode/cvode_hypamgpre.c | 6 +- src/cvode/cvode_impl.h | 34 +- src/cvode/cvode_io.c | 8 +- src/cvode/cvode_ls.c | 10 +- src/cvode/cvode_ls_impl.h | 4 +- src/cvode/cvode_nls.c | 6 +- src/cvode/cvode_proj.c | 6 +- src/cvode/cvode_proj_impl.h | 4 +- src/cvodes/cvodea.c | 10 +- src/cvodes/cvodea_io.c | 2 +- src/cvodes/cvodes.c | 50 +- src/cvodes/cvodes_bandpre.c | 8 +- src/cvodes/cvodes_bbdpre.c | 8 +- src/cvodes/cvodes_diag.c | 4 +- src/cvodes/cvodes_impl.h | 38 +- src/cvodes/cvodes_io.c | 8 +- src/cvodes/cvodes_ls.c | 10 +- src/cvodes/cvodes_ls_impl.h | 4 +- src/cvodes/cvodes_nls.c | 2 +- src/cvodes/cvodes_nls_sim.c | 2 +- src/cvodes/cvodes_nls_stg.c | 2 +- src/cvodes/cvodes_nls_stg1.c | 2 +- src/cvodes/cvodes_proj.c | 6 +- src/cvodes/cvodes_proj_impl.h | 4 +- src/ida/ida.c | 42 +- src/ida/ida_bbdpre.c | 6 +- src/ida/ida_ic.c | 18 +- src/ida/ida_impl.h | 20 +- src/ida/ida_io.c | 8 +- src/ida/ida_ls.c | 12 +- src/ida/ida_nls.c | 8 +- src/idas/idaa.c | 10 +- src/idas/idaa_io.c | 2 +- src/idas/idas.c | 42 +- src/idas/idas_bbdpre.c | 6 +- src/idas/idas_ic.c | 18 +- src/idas/idas_impl.h | 20 +- src/idas/idas_io.c | 8 +- src/idas/idas_ls.c | 12 +- src/idas/idas_nls.c | 8 +- src/idas/idas_nls_sim.c | 8 +- src/idas/idas_nls_stg.c | 8 +- src/kinsol/kinsol.c | 34 +- src/kinsol/kinsol_bbdpre.c | 4 +- src/kinsol/kinsol_impl.h | 4 +- src/kinsol/kinsol_io.c | 18 +- src/kinsol/kinsol_ls.c | 8 +- src/nvector/cuda/nvector_cuda.cu | 4 +- src/nvector/hip/nvector_hip.hip.cpp | 4 +- src/nvector/manyvector/nvector_manyvector.c | 8 +- src/nvector/openmp/nvector_openmp.c | 12 +- src/nvector/openmpdev/nvector_openmpdev.c | 10 +- src/nvector/parallel/nvector_parallel.c | 12 +- src/nvector/parhyp/nvector_parhyp.c | 12 +- src/nvector/petsc/nvector_petsc.c | 12 +- src/nvector/pthreads/nvector_pthreads.c | 12 +- src/nvector/raja/nvector_raja.cpp | 8 +- src/nvector/serial/nvector_serial.c | 10 +- src/nvector/sycl/nvector_sycl.cpp | 8 +- src/nvector/trilinos/nvector_trilinos.cpp | 8 +- src/sundials/sundials_band.c | 4 +- src/sundials/sundials_dense.c | 6 +- src/sundials/sundials_direct.c | 4 +- src/sundials/sundials_iterative.c | 6 +- src/sundials/sundials_linearsolver.c | 2 +- src/sundials/sundials_math.c | 20 +- src/sundials/sundials_nvector.c | 8 +- src/sundials/sundials_nvector_senswrapper.c | 2 +- src/sundials/sundials_xbraid.c | 2 +- src/sunlinsol/band/sunlinsol_band.c | 4 +- .../sunlinsol_cusolversp_batchqr.cu | 6 +- src/sunlinsol/dense/sunlinsol_dense.c | 2 +- src/sunlinsol/klu/sunlinsol_klu.c | 10 +- .../lapackband/sunlinsol_lapackband.c | 4 +- .../lapackdense/sunlinsol_lapackdense.c | 4 +- .../magmadense/sunlinsol_magmadense.cpp | 4 +- .../onemkldense/sunlinsol_onemkldense.cpp | 2 +- src/sunlinsol/pcg/sunlinsol_pcg.c | 4 +- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 4 +- src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 4 +- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 4 +- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 4 +- .../superludist/sunlinsol_superludist.c | 6 +- src/sunlinsol/superlumt/sunlinsol_superlumt.c | 6 +- src/sunmatrix/band/sunmatrix_band.c | 4 +- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 4 +- src/sunmatrix/dense/sunmatrix_dense.c | 4 +- .../magmadense/sunmatrix_magmadense.cpp | 4 +- .../onemkldense/sunmatrix_onemkldense.cpp | 4 +- src/sunmatrix/slunrloc/sunmatrix_slunrloc.c | 2 +- src/sunmatrix/sparse/sunmatrix_sparse.c | 8 +- .../fixedpoint/sunnonlinsol_fixedpoint.c | 4 +- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 4 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 40 +- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 86 +- .../CXX_serial/ark_test_dahlquist_mri.cpp | 20 +- .../C_serial/ark_test_arkstepsetforcing.c | 8 +- .../arkode/C_serial/ark_test_interp.c | 82 +- .../arkode/C_serial/ark_test_reset.c | 50 +- .../cvode/CXX_serial/cv_test_kpr.hpp | 14 +- .../cvodes/CXX_serial/cvs_test_kpr.hpp | 14 +- .../ida/CXX_serial/ida_test_kpr.hpp | 14 +- .../idas/CXX_serial/idas_test_kpr.hpp | 14 +- 414 files changed, 5995 insertions(+), 6015 deletions(-) diff --git a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp index 6a47db5427..188cfd716b 100644 --- a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp @@ -555,8 +555,8 @@ void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax { /* Gaussian distribution defaults */ const sunrealtype alpha = 0.1; - const sunrealtype mu[] = { xmax/RCONST(2.0), xmax/RCONST(2.0), xmax/RCONST(2.0) }; - const sunrealtype sigma[] = { xmax/RCONST(4.0), xmax/RCONST(4.0), xmax/RCONST(4.0) }; // Sigma = diag(sigma) + const sunrealtype mu[] = { xmax/SUN_RCONST(2.0), xmax/SUN_RCONST(2.0), xmax/SUN_RCONST(2.0) }; + const sunrealtype sigma[] = { xmax/SUN_RCONST(4.0), xmax/SUN_RCONST(4.0), xmax/SUN_RCONST(4.0) }; // Sigma = diag(sigma) /* denominator = 2*sqrt(|Sigma|*(2pi)^3) */ const sunrealtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3)); diff --git a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp index 50de56acbc..0b1aa0b583 100644 --- a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp +++ b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp @@ -578,8 +578,8 @@ void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax { /* Gaussian distribution defaults */ const sunrealtype alpha = 0.1; - const sunrealtype mu[] = { xmax/RCONST(2.0), xmax/RCONST(2.0), xmax/RCONST(2.0) }; - const sunrealtype sigma[] = { xmax/RCONST(4.0), xmax/RCONST(4.0), xmax/RCONST(4.0) }; // Sigma = diag(sigma) + const sunrealtype mu[] = { xmax/SUN_RCONST(2.0), xmax/SUN_RCONST(2.0), xmax/SUN_RCONST(2.0) }; + const sunrealtype sigma[] = { xmax/SUN_RCONST(4.0), xmax/SUN_RCONST(4.0), xmax/SUN_RCONST(4.0) }; // Sigma = diag(sigma) /* denominator = 2*sqrt(|Sigma|*(2pi)^3) */ const sunrealtype denom = 2.0 * sqrt((sigma[0]*sigma[1]*sigma[2])*pow(2*M_PI,3)); diff --git a/benchmarks/diffusion_2D/diffusion_2D.hpp b/benchmarks/diffusion_2D/diffusion_2D.hpp index ea7159e53f..e054d359f8 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.hpp +++ b/benchmarks/diffusion_2D/diffusion_2D.hpp @@ -47,11 +47,11 @@ #endif // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index 33984002a9..39208044b2 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -20,8 +20,8 @@ struct UserOptions { // Integrator settings - sunrealtype rtol = RCONST(1.0e-5); // relative tolerance - sunrealtype atol = RCONST(1.0e-10); // absolute tolerance + sunrealtype rtol = SUN_RCONST(1.0e-5); // relative tolerance + sunrealtype atol = SUN_RCONST(1.0e-10); // absolute tolerance sunrealtype hfixed = ZERO; // fixed step size int order = 3; // ARKode method order int controller = 0; // step size adaptivity method diff --git a/benchmarks/diffusion_2D/main_cvode.cpp b/benchmarks/diffusion_2D/main_cvode.cpp index c28239842e..e1ba36a7fb 100644 --- a/benchmarks/diffusion_2D/main_cvode.cpp +++ b/benchmarks/diffusion_2D/main_cvode.cpp @@ -20,8 +20,8 @@ struct UserOptions { // Integrator settings - sunrealtype rtol = RCONST(1.0e-5); // relative tolerance - sunrealtype atol = RCONST(1.0e-10); // absolute tolerance + sunrealtype rtol = SUN_RCONST(1.0e-5); // relative tolerance + sunrealtype atol = SUN_RCONST(1.0e-10); // absolute tolerance int maxsteps = 0; // max steps between outputs int onestep = 0; // one step mode, number of steps diff --git a/benchmarks/diffusion_2D/main_ida.cpp b/benchmarks/diffusion_2D/main_ida.cpp index 43313b1edd..8fe18e4555 100644 --- a/benchmarks/diffusion_2D/main_ida.cpp +++ b/benchmarks/diffusion_2D/main_ida.cpp @@ -20,8 +20,8 @@ struct UserOptions { // Integrator settings - sunrealtype rtol = RCONST(1.0e-5); // relative tolerance - sunrealtype atol = RCONST(1.0e-10); // absolute tolerance + sunrealtype rtol = SUN_RCONST(1.0e-5); // relative tolerance + sunrealtype atol = SUN_RCONST(1.0e-10); // absolute tolerance int maxsteps = 0; // max steps between outputs int onestep = 0; // one step mode, number of steps diff --git a/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu b/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu index 68dd937620..b4be26d8d6 100644 --- a/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu +++ b/benchmarks/nvector/cuda/test_nvector_performance_cuda.cu @@ -273,7 +273,7 @@ static int InitializeClearCache(int cachesize) } /* fill host vector with random data and copy to device */ - rand_realtype(h_data, N, RCONST(-1.0), RCONST(1.0)); + rand_realtype(h_data, N, SUN_RCONST(-1.0), SUN_RCONST(1.0)); err = cudaMemcpy(d_data, h_data, N*sizeof(sunrealtype), cudaMemcpyHostToDevice); if (err != cudaSuccess) { diff --git a/benchmarks/nvector/hip/test_nvector_performance_hip.cpp b/benchmarks/nvector/hip/test_nvector_performance_hip.cpp index d944397d90..bb8b3fe350 100644 --- a/benchmarks/nvector/hip/test_nvector_performance_hip.cpp +++ b/benchmarks/nvector/hip/test_nvector_performance_hip.cpp @@ -273,7 +273,7 @@ static int InitializeClearCache(int cachesize) } /* fill host vector with random data and copy to device */ - rand_realtype(h_data, N, RCONST(-1.0), RCONST(1.0)); + rand_realtype(h_data, N, SUN_RCONST(-1.0), SUN_RCONST(1.0)); err = hipMemcpy(d_data, h_data, N*sizeof(sunrealtype), hipMemcpyHostToDevice); if (err != hipSuccess) { diff --git a/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c b/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c index 6912310bfd..eab5de07e5 100644 --- a/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c +++ b/benchmarks/nvector/mpiplusx/test_nvector_performance_mpiplusx.c @@ -264,7 +264,7 @@ static int InitializeClearCache(int cachesize) /* allocate data and fill random values */ data = (sunrealtype*) malloc(N*sizeof(sunrealtype)); - rand_realtype(data, N, RCONST(-1.0), RCONST(1.0)); + rand_realtype(data, N, SUN_RCONST(-1.0), SUN_RCONST(1.0)); return(0); } @@ -280,7 +280,7 @@ void ClearCache() sunrealtype sum; sunindextype i; - sum = RCONST(0.0); + sum = SUN_RCONST(0.0); for (i=0; i /* define constatnts */ -#define NEG_ONE RCONST(-1.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define TEN RCONST(10.0) +#define NEG_ONE SUN_RCONST(-1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define TEN SUN_RCONST(10.0) #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/doc/arkode/guide/source/Usage/User_supplied.rst b/doc/arkode/guide/source/Usage/User_supplied.rst index 96463b73e9..0dc116f2a2 100644 --- a/doc/arkode/guide/source/Usage/User_supplied.rst +++ b/doc/arkode/guide/source/Usage/User_supplied.rst @@ -482,7 +482,7 @@ object was supplied to :c:func:`ARKStepSetLinearSolver` or then use the ``ARKStepGet*`` or ``MRIStepGet*`` functions listed in :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF``, which is defined in the header + accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header file ``sundials_types.h``. **dense** :math:`J(t,y)`: @@ -600,7 +600,7 @@ the default is a difference quotient approximation to these products. their ``user_data``, and then use the ``ARKStepGet*`` or ``MRIStepGet*`` functions listed in :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF``, which is defined in the header + accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header file ``sundials_types.h``. @@ -652,7 +652,7 @@ defined as follows: ``MRIStepGet*`` functions listed in :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF``, which is defined in the header + accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header file ``sundials_types.h``. @@ -782,7 +782,7 @@ user-supplied function of type :c:type:`ARKLsPrecSetupFn`. ``user_data``, and then use the ``ARKStepGet*`` or ``MRIStepGet*`` functions listed in :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF``, which is defined in the header + accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header file ``sundials_types.h``. diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 71afaafce1..4c144809d4 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -3491,7 +3491,7 @@ user-defined projection operation the projection function must have type If needed by the user's projection routine, the error weight vector can be accessed by calling :c:func:`CVodeGetErrWeights`, and the unit roundoff is - available as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + available as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. versionadded:: 5.3.0 @@ -3547,7 +3547,7 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: the current step size, the error weights, etc. To obtain these, the user will need to add a pointer to ``cv_mem`` in ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODE.Usage.CC.optional_output`. - The unit roundoff can be accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. **Dense**: A user-supplied dense Jacobian function must load the :math:`N` by :math:`N` @@ -3693,7 +3693,7 @@ the default is a difference quotient approximation to these products. To obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODE.Usage.CC.optional_output.optout_main`. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``CVSpilsJacTimesVecFn`` is identical to :c:func:`CVLsJacTimesVecFn`, and may still be used for backward-compatibility. @@ -3738,7 +3738,7 @@ be done in a user-supplied function of type :c:type:`CVLsJacTimesSetupFn`, defin To obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODE.Usage.CC.optional_output.optout_main`. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``CVSpilsJacTimesSetupFn`` is identical to :c:type:`CVLsJacTimesSetupFn`, and may still be used for @@ -3841,7 +3841,7 @@ function of type , defined as follows: To obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODE.Usage.CC.optional_output`. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``CVSpilsPrecSetupFn`` is identical to :c:type:`CVLsPrecSetupFn`, and may still be used for backward-compatibility. diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index 86063c03f1..f9fdf9956f 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -1949,7 +1949,7 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_dataB`` and then use the ``CVGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output`. The unit - roundoff can be accessed as ``UNIT_ROUNDOFF`` defined in + roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type :c:type:`CVSpilsJacTimesSetupFnB` is identical to :c:type:`CVLsJacTimesSetupFnB`, and may still be used for @@ -1989,7 +1989,7 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or etc. To obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_dataB`` and then use the ``CVGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output`. - The unit roundoff can be accessed as ``UNIT_ROUNDOFF`` defined in + The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type :c:type:`CVSpilsJacTimesSetupFnBS` is identical to :c:type:`CVLsJacTimesSetupFnBS`, and may still be used for diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index d2c549e06a..4070475138 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -3493,7 +3493,7 @@ user-defined projection operation the projection function must have type If needed by the user's projection routine, the error weight vector can be accessed by calling :c:func:`CVodeGetErrWeights`, and the unit roundoff is - available as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + available as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. versionadded:: 6.2.0 @@ -3549,7 +3549,7 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: the current step size, the error weights, etc. To obtain these, the user will need to add a pointer to ``cv_mem`` in ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output`. - The unit roundoff can be accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. **Dense**: A user-supplied dense Jacobian function must load the :math:`N` by :math:`N` @@ -3695,7 +3695,7 @@ the default is a difference quotient approximation to these products. To obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output.optout_main`. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``CVSpilsJacTimesVecFn`` is identical to :c:func:`CVLsJacTimesVecFn`, and may still be used for backward-compatibility. @@ -3740,7 +3740,7 @@ be done in a user-supplied function of type :c:type:`CVLsJacTimesSetupFn`, defin To obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output.optout_main`. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``CVSpilsJacTimesSetupFn`` is identical to :c:type:`CVLsJacTimesSetupFn`, and may still be used for @@ -3843,7 +3843,7 @@ function of type , defined as follows: To obtain these, the user will need to add a pointer to ``cvode_mem`` to ``user_data`` and then use the ``CVodeGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output`. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``CVSpilsPrecSetupFn`` is identical to :c:type:`CVLsPrecSetupFn`, and may still be used for backward-compatibility. diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 3e8d0031b7..41059b5b38 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -3441,7 +3441,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: obtain these, the user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDA.Usage.CC.optional_output.optout_main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. **dense:** @@ -3571,7 +3571,7 @@ the default is a difference quotient approximation to these products. user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDA.Usage.CC.optional_output.optout_main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. warning:: @@ -3627,7 +3627,7 @@ follows: user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDA.Usage.CC.optional_output.optout_main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. warning:: @@ -3735,7 +3735,7 @@ function of type :c:type:`IDALsPrecSetupFn`, defined as follows: user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDA.Usage.CC.optional_output.optout_main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. _IDA.Usage.CC.precond: diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index 57384a09b6..ef875a5aa3 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -2057,7 +2057,7 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or these, the user will need to add a pointer to ``ida_mem`` to ``user_dataB`` and then use the ``IDAGet*`` functions described in :numref:`IDAS.Usage.SIM.user_callable.optional_output.main`. - The unit roundoff can be accessed as ``UNIT_ROUNDOFF`` defined in + The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. warning:: @@ -2102,7 +2102,7 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or etc. To obtain these, the user will need to add a pointer to ``ida_mem`` to ``user_dataB`` and then use the ``IDAGet*`` functions described in :numref:`IDAS.Usage.ADJ.user_callable.optional_output_b`. The unit roundoff - can be accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``IDASpilsJacTimesSetupFnBS`` is deprecated. .. warning:: diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index feb34ab1f5..8f5be59771 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -3481,7 +3481,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: obtain these, the user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDAS.Usage.SIM.user_callable.optional_output.main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. **dense:** @@ -3611,7 +3611,7 @@ the default is a difference quotient approximation to these products. user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDAS.Usage.SIM.user_callable.optional_output.main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. warning:: @@ -3667,7 +3667,7 @@ follows: user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDAS.Usage.SIM.user_callable.optional_output.main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. warning:: @@ -3775,7 +3775,7 @@ function of type :c:type:`IDALsPrecSetupFn`, defined as follows: user will need to add a pointer to ``ida_mem`` to ``user_data`` and then use the ``IDAGet*`` functions described in :numref:`IDAS.Usage.SIM.user_callable.optional_output.main`. The unit roundoff can be - accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. _IDAS.Usage.Purequad: diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index f35ad45c83..0c672188c3 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -2072,7 +2072,7 @@ provide a function of type :c:type:`KINLsJacFn` defined as follows: These quantities may include the scale vectors and the unit roundoff. To obtain the scale vectors, the user will need to add to ``user_data`` pointers to ``u_scale`` and/or ``f_scale`` as needed. The unit roundoff - can be accessed as ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. **dense:** @@ -2195,7 +2195,7 @@ supplied, the default is a difference quotient approximation to these products. might include the scale vectors and the unit roundoff. To obtain the scale vectors, the user will need to add to ``user_data`` pointers to ``u_scale`` and/or ``f_scale`` as needed. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. .. warning:: @@ -2290,7 +2290,7 @@ function of type :c:type:`KINLsPrecSetupFn`, defined as follows: might include the scale vectors and the unit roundoff. To obtain the scale vectors, the user will need to add to ``user_data`` pointers to ``u_scale`` and/or ``f_scale`` as needed. The unit roundoff can be accessed as - ``UNIT_ROUNDOFF`` defined in ``sundials_types.h``. + ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. If the preconditioner solve routine requires no preparation, then a preconditioner setup function need not be given. diff --git a/doc/shared/Types.rst b/doc/shared/Types.rst index b78bd866a4..280a113c54 100644 --- a/doc/shared/Types.rst +++ b/doc/shared/Types.rst @@ -36,12 +36,12 @@ Floating point types :cmakeop:`SUNDIALS_PRECISION`). Additionally, based on the current precision, ``sundials_types.h`` defines -``BIG_REAL`` to be the largest value representable as a ``sunrealtype``, -``SMALL_REAL`` to be the smallest value representable as a ``sunrealtype``, and -``UNIT_ROUNDOFF`` to be the difference between :math:`1.0` and the minimum +``SUN_BIG_REAL`` to be the largest value representable as a ``sunrealtype``, +``SUN_SMALL_REAL`` to be the smallest value representable as a ``sunrealtype``, and +``SUN_UNIT_ROUNDOFF`` to be the difference between :math:`1.0` and the minimum ``sunrealtype`` greater than :math:`1.0`. -Within SUNDIALS, real constants are set by way of a macro called ``RCONST``. It +Within SUNDIALS, real constants are set by way of a macro called ``SUN_RCONST``. It is this macro that needs the ability to branch on the definition of ``sunrealtype``. In ANSI C, a floating-point constant with no suffix is stored as a ``double``. Placing the suffix "``F``" at the end of a floating point constant @@ -56,10 +56,10 @@ double``. For example, defines ``A`` to be a ``double`` constant equal to :math:`1.0`, ``B`` to be a ``float`` constant equal to :math:`1.0`, and ``C`` to be a ``long double`` -constant equal to :math:`1.0`. The macro call ``RCONST(1.0)`` automatically +constant equal to :math:`1.0`. The macro call ``SUN_RCONST(1.0)`` automatically expands to ``1.0`` if ``sunrealtype`` is ``double``, to ``1.0F`` if ``sunrealtype`` is ``float``, or to ``1.0L`` if ``sunrealtype`` is ``long double``. SUNDIALS uses the -``RCONST`` macro internally to declare all of its floating-point constants. +``SUN_RCONST`` macro internally to declare all of its floating-point constants. Additionally, SUNDIALS defines several macros for common mathematical functions *e.g.*, ``fabs``, ``sqrt``, ``exp``, etc. in ``sundials_math.h``. The macros are @@ -68,15 +68,15 @@ prefixed with ``SUNR`` and expand to the appropriate ``C`` function based on the ``fabs`` when ``sunrealtype`` is ``double``, ``fabsf`` when ``sunrealtype`` is ``float``, and ``fabsl`` when ``sunrealtype`` is ``long double``. -A user program which uses the type ``sunrealtype``, the ``RCONST`` macro, and the +A user program which uses the type ``sunrealtype``, the ``SUN_RCONST`` macro, and the ``SUNR`` mathematical function macros is precision-independent except for any calls to precision-specific library functions. Our example programs use -``sunrealtype``, ``RCONST``, and the ``SUNR`` macros. Users can, however, use the +``sunrealtype``, ``SUN_RCONST``, and the ``SUNR`` macros. Users can, however, use the type ``double``, ``float``, or ``long double`` in their code (assuming that this usage is consistent with the typedef for ``sunrealtype``) and call the appropriate math library functions directly. Thus, a previously existing piece of C or C++ code can use SUNDIALS without modifying the code to use ``sunrealtype``, -``RCONST``, or the ``SUNR`` macros so long as the SUNDIALS libraries are built +``SUN_RCONST``, or the ``SUNR`` macros so long as the SUNDIALS libraries are built to use the corresponding precision (see :numref:`Installation.CMake.Options`). Integer types used for indexing diff --git a/doc/shared/nvectors/NVector_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index 48b5daa4b0..352a0da101 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -494,7 +494,7 @@ operations below. \min_{0\le i< n} \frac{\text{num}_i}{\text{denom}_i}. A zero element in *denom* will be skipped. If no such quotients - are found, then the large value ``BIG_REAL`` (defined in the header + are found, then the large value ``SUN_BIG_REAL`` (defined in the header file ``sundials_types.h``) is returned. Usage: @@ -928,7 +928,7 @@ operations below. term-wise dividing :math:`num_i` by :math:`denom_i`, for all MPI task-local components of the vectors. A zero element in *denom* will be skipped. If no such quotients are found, then the large value - ``BIG_REAL`` (defined in the header file ``sundials_types.h``) + ``SUN_BIG_REAL`` (defined in the header file ``sundials_types.h``) is returned. Usage: diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 1b04cfd410..d4b7c50826 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -78,10 +78,10 @@ #include "sunnonlinsol/sunnonlinsol_fixedpoint.h" // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NSPECIES 2 @@ -141,23 +141,23 @@ struct UserData // ------------------ // Diffusion coefficients for u and v - sunrealtype Dux = RCONST(1.0e-3); - sunrealtype Duy = RCONST(1.0e-3); - sunrealtype Dvx = RCONST(1.0e-3); - sunrealtype Dvy = RCONST(1.0e-3); + sunrealtype Dux = SUN_RCONST(1.0e-3); + sunrealtype Duy = SUN_RCONST(1.0e-3); + sunrealtype Dvx = SUN_RCONST(1.0e-3); + sunrealtype Dvy = SUN_RCONST(1.0e-3); // Feed and reaction rates - sunrealtype A = RCONST(1.0); - sunrealtype B = RCONST(3.0); + sunrealtype A = SUN_RCONST(1.0); + sunrealtype B = SUN_RCONST(3.0); // Final simulation time - sunrealtype tf = RCONST(10.0); + sunrealtype tf = SUN_RCONST(10.0); // Domain boundaries in x and y directions - sunrealtype xl = RCONST(-0.5); - sunrealtype xu = RCONST(0.5); - sunrealtype yl = RCONST(-0.5); - sunrealtype yu = RCONST(0.5); + sunrealtype xl = SUN_RCONST(-0.5); + sunrealtype xu = SUN_RCONST(0.5); + sunrealtype yl = SUN_RCONST(-0.5); + sunrealtype yu = SUN_RCONST(0.5); // Enable/disable RHS terms bool diffusion = true; @@ -254,8 +254,8 @@ struct UserData // ------------- // Relative and absolute tolerances - sunrealtype rtol_imex = RCONST(1.e-4); - sunrealtype atol_imex = RCONST(1.e-8); + sunrealtype rtol_imex = SUN_RCONST(1.e-4); + sunrealtype atol_imex = SUN_RCONST(1.e-8); // Step size selection (ZERO = adaptive steps) sunrealtype h_imex = ZERO; @@ -268,13 +268,13 @@ struct UserData // ------------ // Relative and absolute tolerances (slow and fast) - sunrealtype rtol_slow = RCONST(1.e-4); - sunrealtype atol_slow = RCONST(1.e-8); - sunrealtype rtol_fast = RCONST(1.e-5); - sunrealtype atol_fast = RCONST(1.e-9); + sunrealtype rtol_slow = SUN_RCONST(1.e-4); + sunrealtype atol_slow = SUN_RCONST(1.e-8); + sunrealtype rtol_fast = SUN_RCONST(1.e-5); + sunrealtype atol_fast = SUN_RCONST(1.e-9); // Fixed step size (slow and fast) - sunrealtype h_slow = RCONST(-1.0); // use multiple of CFL + sunrealtype h_slow = SUN_RCONST(-1.0); // use multiple of CFL sunrealtype h_fast = ZERO; // use adaptive stepping // Inner ARKODE method order @@ -2460,11 +2460,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata) // Compute slow step size based on CFL if not set by input if (udata->h_slow < ZERO) { - sunrealtype cfl_u = RCONST(0.5) / ((udata->Dux / (udata->dx * udata->dx)) + + sunrealtype cfl_u = SUN_RCONST(0.5) / ((udata->Dux / (udata->dx * udata->dx)) + (udata->Duy / (udata->dy * udata->dy))); - sunrealtype cfl_v = RCONST(0.5) / ((udata->Dvx / (udata->dx * udata->dx)) + + sunrealtype cfl_v = SUN_RCONST(0.5) / ((udata->Dvx / (udata->dx * udata->dx)) + (udata->Dvy / (udata->dy * udata->dy))); - udata->h_slow = RCONST(5.0) * min(cfl_u, cfl_v); + udata->h_slow = SUN_RCONST(5.0) * min(cfl_u, cfl_v); } // Return success @@ -2488,7 +2488,7 @@ static int SetIC(N_Vector u, UserData *udata) // Gaussian random number generator default_random_engine generator; - normal_distribution dist(RCONST(0.0), RCONST(0.001)); + normal_distribution dist(SUN_RCONST(0.0), SUN_RCONST(0.001)); sunrealtype *data = N_VGetArrayPointer(u); if (check_flag((void *) data, "N_VGetArrayPointer", 0)) return -1; @@ -2503,7 +2503,7 @@ static int SetIC(N_Vector u, UserData *udata) a = TWO * PI * (x - udata->xl) / (udata->xu - udata->xl); b = TWO * PI * (y - udata->yl) / (udata->yu - udata->yl); - data[UIDX(i,j,nx_loc)] = udata->A + RCONST(0.5) * sin(a) * sin(b); + data[UIDX(i,j,nx_loc)] = udata->A + SUN_RCONST(0.5) * sin(a) * sin(b); data[VIDX(i,j,nx_loc)] = udata->B / udata->A; } } diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index c73c2e8ec4..63754d31fa 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -60,11 +60,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -1334,8 +1334,8 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->hfixed = ZERO; // using adaptive step sizes udata->order = 3; // method order udata->controller = 0; // PID controller diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index 451ac37cca..0f7996cb6f 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -62,11 +62,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -1644,8 +1644,8 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->hfixed = ZERO; // using adaptive step sizes udata->order = 3; // method order udata->controller = 0; // PID controller diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index 45c2063d09..3b04f5a9b5 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -62,11 +62,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -2069,8 +2069,8 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->hfixed = ZERO; // using adaptive step sizes udata->order = 3; // method order udata->controller = 0; // PID controller diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp index 5cdc91c7f1..c2db52ee42 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -63,11 +63,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -2204,8 +2204,8 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->linear = false; // linearly implicit problem udata->order = 3; // method order diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp index 739ada3b02..4911e16894 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -62,11 +62,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -2158,8 +2158,8 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->linear = false; // linearly implicit problem udata->sorder = 3; // slow method order udata->forder = 3; // fast method order diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp index b32e4ed674..ae050a941f 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp @@ -1637,7 +1637,7 @@ int SetIC(N_Vector y, UserData &udata) for (sunindextype i = 0; i < udata.nx; i++) { x = udata.xl + i * udata.dx; - p = RCONST(0.1) * sin(PI * x); + p = SUN_RCONST(0.1) * sin(PI * x); ydata[UIDX(i)] = udata.A + p; ydata[VIDX(i)] = udata.B / udata.A + p; ydata[WIDX(i)] = udata.B + p; diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp index 92d5f16d6b..fd7a072084 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp @@ -35,10 +35,10 @@ #include "sunlinsol/sunlinsol_band.h" // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NSPECIES 3 @@ -65,18 +65,18 @@ struct UserData int splitting = 3; // Advection and diffusion coefficients - sunrealtype c = RCONST(1.0e-3); - sunrealtype d = RCONST(1.0e-2); + sunrealtype c = SUN_RCONST(1.0e-3); + sunrealtype d = SUN_RCONST(1.0e-2); // Feed and reaction rates - sunrealtype A = RCONST(0.6); - sunrealtype B = RCONST(2.0); + sunrealtype A = SUN_RCONST(0.6); + sunrealtype B = SUN_RCONST(2.0); // Stiffness parameter - sunrealtype eps = RCONST(1.0e-2); + sunrealtype eps = SUN_RCONST(1.0e-2); // Final simulation time - sunrealtype tf = RCONST(3.0); + sunrealtype tf = SUN_RCONST(3.0); // Domain boundaries sunrealtype xl = ZERO; @@ -132,10 +132,10 @@ struct UserOptions bool ark_dirk = false; // Relative and absolute tolerances - sunrealtype rtol = RCONST(1.e-4); - sunrealtype atol = RCONST(1.e-9); - sunrealtype rtol_fast = RCONST(1.e-4); - sunrealtype atol_fast = RCONST(1.e-9); + sunrealtype rtol = SUN_RCONST(1.e-4); + sunrealtype atol = SUN_RCONST(1.e-9); + sunrealtype rtol_fast = SUN_RCONST(1.e-4); + sunrealtype atol_fast = SUN_RCONST(1.e-9); // Step size selection (ZERO = adaptive steps) sunrealtype fixed_h = ZERO; @@ -159,7 +159,7 @@ struct UserOptions bool save_hinit = false; bool save_hcur = false; - sunrealtype hcur_factor = RCONST(0.7); + sunrealtype hcur_factor = SUN_RCONST(0.7); int output = 1; // 0 = none, 1 = stats, 2 = disk, 3 = disk with tstop int nout = 10; // number of output times diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.cpp b/examples/arkode/CXX_serial/ark_analytic_sys.cpp index 281120a68c..fa7bb0b4c5 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.cpp +++ b/examples/arkode/CXX_serial/ark_analytic_sys.cpp @@ -79,13 +79,13 @@ static int check_flag(void *flagvalue, const string funcname, int opt); int main() { // general problem parameters - sunrealtype T0 = RCONST(0.0); // initial time - sunrealtype Tf = RCONST(0.05); // final time - sunrealtype dTout = RCONST(0.005); // time between outputs + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(0.05); // final time + sunrealtype dTout = SUN_RCONST(0.005); // time between outputs sunindextype NEQ = 3; // number of dependent vars. - sunrealtype reltol = RCONST(1.0e-6); // tolerances - sunrealtype abstol = RCONST(1.0e-10); - sunrealtype lamda = RCONST(-100.0); // stiffness parameter + sunrealtype reltol = SUN_RCONST(1.0e-6); // tolerances + sunrealtype abstol = SUN_RCONST(1.0e-10); + sunrealtype lamda = SUN_RCONST(-100.0); // stiffness parameter // general problem variables int flag; // reusable error-checking flag diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index df9850f7d3..38534438e9 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -60,11 +60,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -678,8 +678,8 @@ static int InitUserData(UserData *udata) udata->dy = udata->yu / (udata->ny - 1); // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->hfixed = ZERO; // using adaptive step sizes udata->order = 3; // method order udata->controller = 0; // PID controller diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp index 3743b2292d..2434dc4c0c 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp +++ b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp @@ -95,10 +95,10 @@ #define FSYM "f" #endif -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define PI4 RCONST(0.78539816339744830961566084581987572) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define PI4 SUN_RCONST(0.78539816339744830961566084581987572) using namespace std; @@ -141,17 +141,17 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { // general problem parameters - sunrealtype T0 = RCONST(-3.0); // initial time - sunrealtype Tf = RCONST(7.0); // final time - sunrealtype dTout = RCONST(0.1); // time between outputs + sunrealtype T0 = SUN_RCONST(-3.0); // initial time + sunrealtype Tf = SUN_RCONST(7.0); // final time + sunrealtype dTout = SUN_RCONST(0.1); // time between outputs sunindextype NEQ = 2; // number of dependent vars. int rk_type = 0; // type of RK method [ARK=0, DIRK=1, ERK=2] int nls_type = 0; // type of nonlinear solver [Newton=0, FP=1] int order = 4; // order of accuracy for RK method booleantype deduce = SUNFALSE; // deduce fi after a nonlinear solve booleantype adaptive = SUNTRUE; // adaptive run vs convergence order - sunrealtype reltol = RCONST(1e-5); // relative tolerance - sunrealtype abstol = RCONST(1e-11); // absolute tolerance + sunrealtype reltol = SUN_RCONST(1e-5); // relative tolerance + sunrealtype abstol = SUN_RCONST(1e-11); // absolute tolerance // general problem variables int retval; // reusable error-checking flag @@ -163,9 +163,9 @@ int main(int argc, char *argv[]) SUNLinearSolver MLS = NULL; // empty mass linear solver object SUNNonlinearSolver NLS = NULL; // empty nonlinear solver object UserData udata; // user-data structure - udata.G = RCONST(-100.0); // stiffness parameter - udata.g = RCONST(10.0); // mass matrix parameter - udata.e = RCONST(0.5); // coupling strength + udata.G = SUN_RCONST(-100.0); // stiffness parameter + udata.g = SUN_RCONST(10.0); // mass matrix parameter + udata.e = SUN_RCONST(0.5); // coupling strength udata.M_timedep = SUNTRUE; // time-dependence of mass matrix // @@ -612,8 +612,8 @@ static int check_order(void *arkode_mem, N_Vector y, sunrealtype T0, // local variables int retval; size_t Nout = 20; - sunrealtype reltol = RCONST(1.e-9); - sunrealtype abstol = RCONST(1.e-12); + sunrealtype reltol = SUN_RCONST(1.e-9); + sunrealtype abstol = SUN_RCONST(1.e-12); sunrealtype a11, a12, a21, a22, b1, b2; a11 = a12 = a21 = a22 = b1 = b2 = ZERO; @@ -706,7 +706,7 @@ static int check_order(void *arkode_mem, N_Vector y, sunrealtype T0, ord_max, ord_avg, ord_est); // clean up and return - if (ord_max < (order-RCONST(0.5))) { + if (ord_max < (order-SUN_RCONST(0.5))) { cout << " [FAILURE]\n"; return(1); } else { @@ -717,7 +717,7 @@ static int check_order(void *arkode_mem, N_Vector y, sunrealtype T0, static sunrealtype r(sunrealtype t) { - return( RCONST(0.5)*cos(t) ); + return( SUN_RCONST(0.5)*cos(t) ); } static sunrealtype s(sunrealtype t) { @@ -725,7 +725,7 @@ static sunrealtype s(sunrealtype t) } static sunrealtype rdot(sunrealtype t) { - return( -RCONST(0.5)*sin(t) ); + return( -SUN_RCONST(0.5)*sin(t) ); } static sunrealtype sdot(sunrealtype t) { diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp index 6e4ae2a20a..a156755fb5 100644 --- a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp +++ b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp @@ -84,18 +84,18 @@ #define IDX(x,v) (3*(x)+v) /* constants */ -#define ZERO (RCONST(0.0)) -#define ONE (RCONST(1.0)) -#define TWO (RCONST(2.0)) -#define HALF (RCONST(0.5)) +#define ZERO (SUN_RCONST(0.0)) +#define ONE (SUN_RCONST(1.0)) +#define TWO (SUN_RCONST(2.0)) +#define HALF (SUN_RCONST(0.5)) /* Gaussian quadrature nodes, weights and formula (3 node, 7th-order accurate) */ -#define X1(xl,xr) (HALF*(xl+xr) - HALF*(xr-xl)*RCONST(0.774596669241483377035853079956)) +#define X1(xl,xr) (HALF*(xl+xr) - HALF*(xr-xl)*SUN_RCONST(0.774596669241483377035853079956)) #define X2(xl,xr) (HALF*(xl+xr)) -#define X3(xl,xr) (HALF*(xl+xr) + HALF*(xr-xl)*RCONST(0.774596669241483377035853079956)) -#define W1 (RCONST(0.55555555555555555555555555555556)) -#define W2 (RCONST(0.88888888888888888888888888888889)) -#define W3 (RCONST(0.55555555555555555555555555555556)) +#define X3(xl,xr) (HALF*(xl+xr) + HALF*(xr-xl)*SUN_RCONST(0.774596669241483377035853079956)) +#define W1 (SUN_RCONST(0.55555555555555555555555555555556)) +#define W2 (SUN_RCONST(0.88888888888888888888888888888889)) +#define W3 (SUN_RCONST(0.55555555555555555555555555555556)) #define Quad(f1,f2,f3,xl,xr) (HALF*(xr-xl)*(W1*f1 + W2*f2 + W3*f3)) /* evaluation macros for variables, basis functions and basis derivatives */ @@ -142,8 +142,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; @@ -152,14 +152,14 @@ int main(int argc, char *argv[]) { sunindextype *Acolind, *Mcolind, *Rcolind; /* CSR matrix column indices */ sunindextype *Arowptr, *Mrowptr, *Rrowptr; /* CSR matrix row pointers */ sunindextype N = 201; /* spatial mesh size */ - sunrealtype a = RCONST(0.6); /* problem parameters */ - sunrealtype b = RCONST(2.0); - sunrealtype du = RCONST(0.025); - sunrealtype dv = RCONST(0.025); - sunrealtype dw = RCONST(0.025); - sunrealtype ep = RCONST(1.0e-5); /* stiffness parameter */ - sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-10); + sunrealtype a = SUN_RCONST(0.6); /* problem parameters */ + sunrealtype b = SUN_RCONST(2.0); + sunrealtype du = SUN_RCONST(0.025); + sunrealtype dv = SUN_RCONST(0.025); + sunrealtype dw = SUN_RCONST(0.025); + sunrealtype ep = SUN_RCONST(1.0e-5); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-10); sunindextype i, NEQ, NNZ; int npes, my_pe; @@ -264,18 +264,18 @@ int main(int argc, char *argv[]) { more intervals near the end points of the interval */ udata->x = (sunrealtype *) malloc(N*sizeof(sunrealtype)); if (check_retval((void *)udata->x, "malloc", 2)) MPI_Abort(grid.comm, 1); - h = RCONST(10.0)/(N-1); + h = SUN_RCONST(10.0)/(N-1); for (i=0; ix[i] = HALF/atan(RCONST(5.0))*atan(z) + HALF; + z = -SUN_RCONST(5.0) + h*i; + udata->x[i] = HALF/atan(SUN_RCONST(5.0))*atan(z) + HALF; } /* Set initial conditions into y */ - pi = RCONST(4.0)*atan(RCONST(1.0)); + pi = SUN_RCONST(4.0)*atan(SUN_RCONST(1.0)); for (i=0; ix[i]); /* u */ - data[IDX(i,1)] = b/a + RCONST(0.1)*sin(pi*udata->x[i]); /* v */ - data[IDX(i,2)] = b + RCONST(0.1)*sin(pi*udata->x[i]); /* w */ + data[IDX(i,0)] = a + SUN_RCONST(0.1)*sin(pi*udata->x[i]); /* u */ + data[IDX(i,1)] = b/a + SUN_RCONST(0.1)*sin(pi*udata->x[i]); /* v */ + data[IDX(i,2)] = b + SUN_RCONST(0.1)*sin(pi*udata->x[i]); /* w */ } /* Set mask array values for each solution component */ diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index d39154966d..59b4a9b034 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -64,11 +64,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -2399,8 +2399,8 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem udata->diagnostics = false; // output diagnostics diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index a130710d06..0e1b742f77 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -62,11 +62,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -1664,8 +1664,8 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem udata->diagnostics = false; // output diagnostics diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index eaff0de164..90d7695097 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -63,11 +63,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -1008,8 +1008,8 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->nprocs_w = 1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem udata->diagnostics = false; // output diagnostics diff --git a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c index 5bf22f7c47..94c6ae8220 100644 --- a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c +++ b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c @@ -71,9 +71,9 @@ #endif /* sunrealtype constant macros */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* user data structure */ typedef struct { @@ -101,20 +101,20 @@ int main() { /* general problem parameters */ sunrealtype T0 = ZERO; /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData userdata = NULL; sunrealtype *udata, *vdata, *wdata; sunindextype N = 201; /* spatial mesh size */ - sunrealtype a = RCONST(0.6); /* problem parameters */ - sunrealtype b = RCONST(2.0); - sunrealtype du = RCONST(0.001); - sunrealtype dv = RCONST(0.001); - sunrealtype dw = RCONST(0.001); - sunrealtype ep = RCONST(1.0e-5); /* stiffness parameter */ - sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-10); + sunrealtype a = SUN_RCONST(0.6); /* problem parameters */ + sunrealtype b = SUN_RCONST(2.0); + sunrealtype du = SUN_RCONST(0.001); + sunrealtype dv = SUN_RCONST(0.001); + sunrealtype dw = SUN_RCONST(0.001); + sunrealtype ep = SUN_RCONST(1.0e-5); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-10); sunindextype i; /* general problem variables */ @@ -180,11 +180,11 @@ int main() if (check_flag((void *)wdata, "N_VGetArrayPointer", 0)) return 1; /* Set initial conditions into y */ - pi = RCONST(4.0)*atan(ONE); + pi = SUN_RCONST(4.0)*atan(ONE); for (i=0; idx); /* u */ - vdata[i] = b/a + RCONST(0.1)*sin(pi*i*userdata->dx); /* v */ - wdata[i] = b + RCONST(0.1)*sin(pi*i*userdata->dx); /* w */ + udata[i] = a + SUN_RCONST(0.1)*sin(pi*i*userdata->dx); /* u */ + vdata[i] = b/a + SUN_RCONST(0.1)*sin(pi*i*userdata->dx); /* v */ + wdata[i] = b + SUN_RCONST(0.1)*sin(pi*i*userdata->dx); /* w */ } /* Call ARKStepCreate to initialize the ARK timestepper module and @@ -353,7 +353,7 @@ static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) f_w = N_VGetArrayPointer(N_VGetSubvector_ManyVector(ydot, 2)); if (check_flag((void *) f_w, "N_VGetArrayPointer", 0)) return 1; - N_VConst(RCONST(0.0), ydot); /* initialize ydot to zero */ + N_VConst(SUN_RCONST(0.0), ydot); /* initialize ydot to zero */ /* iterate over domain, computing all equations */ uconst = du/dx/dx; diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.c b/examples/arkode/C_openmp/ark_brusselator1D_omp.c index 789b065b71..78a2c8bbb0 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.c +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.c @@ -102,8 +102,8 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; @@ -190,32 +190,32 @@ int main(int argc, char *argv[]) if (check_flag((void *)wmask, "N_VClone", 0)) return 1; /* Set initial conditions into y */ - udata->dx = RCONST(1.0)/(N-1); /* set spatial mesh spacing */ + udata->dx = SUN_RCONST(1.0)/(N-1); /* set spatial mesh spacing */ data = N_VGetArrayPointer(y); /* Access data array for new NVector y */ if (check_flag((void *)data, "N_VGetArrayPointer", 0)) return 1; - pi = RCONST(4.0)*atan(RCONST(1.0)); + pi = SUN_RCONST(4.0)*atan(SUN_RCONST(1.0)); for (i=0; idx); /* u */ - data[IDX(i,1)] = b/a + RCONST(0.1)*sin(pi*i*udata->dx); /* v */ - data[IDX(i,2)] = b + RCONST(0.1)*sin(pi*i*udata->dx); /* w */ + data[IDX(i,0)] = a + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* u */ + data[IDX(i,1)] = b/a + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* v */ + data[IDX(i,2)] = b + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* w */ } /* Set mask array values for each solution component */ N_VConst(0.0, umask); data = N_VGetArrayPointer(umask); if (check_flag((void *) data, "N_VGetArrayPointer", 0)) return 1; - for (i=0; iN = N; udata->k = k; - udata->dx = RCONST(1.0)/(N-1); /* mesh spacing */ + udata->dx = SUN_RCONST(1.0)/(N-1); /* mesh spacing */ udata->nthreads = num_threads; /* Initial problem output */ @@ -266,7 +266,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* iterate over domain, computing all equations */ c1 = k/dx/dx; - c2 = -RCONST(2.0)*k/dx/dx; + c2 = -SUN_RCONST(2.0)*k/dx/dx; isource = N/2; Ydot[0] = 0.0; /* left boundary condition */ #pragma omp parallel for default(shared) private(i) schedule(static) num_threads(udata->nthreads) @@ -298,7 +298,7 @@ static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, /* iterate over domain, computing all Jacobian-vector products */ c1 = k/dx/dx; - c2 = -RCONST(2.0)*k/dx/dx; + c2 = -SUN_RCONST(2.0)*k/dx/dx; JV[0] = 0.0; #pragma omp parallel for default(shared) private(i) schedule(static) num_threads(udata->nthreads) for (i=1; iN = N; udata->k = k; - udata->dx = RCONST(1.0)/(1.0*N-1.0); /* mesh spacing */ + udata->dx = SUN_RCONST(1.0)/(1.0*N-1.0); /* mesh spacing */ /* Initial problem output */ printf("\n1D Heat PDE test problem:\n"); @@ -266,7 +266,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* iterate over domain, computing all equations */ c1 = k/dx/dx; - c2 = -RCONST(2.0)*k/dx/dx; + c2 = -SUN_RCONST(2.0)*k/dx/dx; isource = N/2; #pragma omp target map(to:c1,c2,isource,N,dx) is_device_ptr(Ydot,Y) device(dev) @@ -305,7 +305,7 @@ static int Jac(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, /* iterate over domain, computing all Jacobian-vector products */ c1 = k/dx/dx; - c2 = -RCONST(2.0)*k/dx/dx; + c2 = -SUN_RCONST(2.0)*k/dx/dx; #pragma omp target map(to:c1,c2,N) is_device_ptr(JV,V) device(dev) #pragma omp teams distribute parallel for schedule(static, 1) diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c index 465a6009ad..f1daa3ad92 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c @@ -71,29 +71,29 @@ #endif /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -105,8 +105,8 @@ #define MY (NPEY*MYSUB) /* MY = number of y mesh points */ /* Spatial mesh is MX by MY */ /* initialization constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -315,8 +315,8 @@ static void InitUserData(int my_pe, sunindextype local_N, MPI_Comm comm, data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -352,18 +352,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) Here lx and ly are local mesh point indices on the local subgrid, and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); uarray[offset ] = C1_SCALE*cx*cy; uarray[offset+1] = C2_SCALE*cx*cy; offset = offset + 2; @@ -777,10 +777,10 @@ static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, jy = ly + isuby*MYSUB; /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -807,8 +807,8 @@ static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, c2lt = uext[offsetue-1]; c1rt = uext[offsetue+2]; c2rt = uext[offsetue+3]; - hord1 = hordco*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = hordco*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = hordco*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = hordco*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = horaco*(c1rt - c1lt); horad2 = horaco*(c2rt - c2lt); diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index c58ecb228d..2622544255 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -69,27 +69,27 @@ /* Problem Constants */ #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) - -#define T0 RCONST(0.0) /* initial time */ +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) + +#define T0 SUN_RCONST(0.0) /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ -#define XMIN RCONST(0.0) /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMIN SUN_RCONST(0.0) /* grid boundaries in x */ +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -102,8 +102,8 @@ /* Spatial mesh is MX by MY */ /* initialization constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -300,8 +300,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -360,18 +360,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) Here lx and ly are local mesh point indices on the local subgrid, and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); udata[offset ] = C1_SCALE*cx*cy; udata[offset+1] = C2_SCALE*cx*cy; offset = offset + 2; @@ -723,12 +723,12 @@ static void fcalc(sunrealtype t, sunrealtype udata[], /* Set diurnal rate coefficients as functions of t, and save q4 in data block for use by preconditioner evaluation routine */ s = sin((data->om)*t); - if (s > RCONST(0.0)) { + if (s > SUN_RCONST(0.0)) { q3 = exp(-A3/s); q4coef = exp(-A4/s); } else { - q3 = RCONST(0.0); - q4coef = RCONST(0.0); + q3 = SUN_RCONST(0.0); + q4coef = SUN_RCONST(0.0); } data->q4 = q4coef; @@ -738,10 +738,10 @@ static void fcalc(sunrealtype t, sunrealtype udata[], jy = ly + isuby*MYSUB; /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -752,7 +752,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], qq2 = Q2*c1*c2; qq3 = q3*C3; qq4 = q4coef*c2; - rkin1 = -qq1 - qq2 + RCONST(2.0)*qq3 + qq4; + rkin1 = -qq1 - qq2 + SUN_RCONST(2.0)*qq3 + qq4; rkin2 = qq1 - qq2 - qq4; /* Set vertical diffusion terms */ @@ -768,8 +768,8 @@ static void fcalc(sunrealtype t, sunrealtype udata[], c2lt = uext[offsetue-1]; c1rt = uext[offsetue+2]; c2rt = uext[offsetue+3]; - hord1 = hordco*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = hordco*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = hordco*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = hordco*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = horaco*(c1rt - c1lt); horad2 = horaco*(c2rt - c2lt); @@ -854,11 +854,11 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, computed on the last f call). Load into P. */ for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); - diag = -(cydn + cyup + RCONST(2.0)*hordco); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); + diag = -(cydn + cyup + SUN_RCONST(2.0)*hordco); for (lx = 0; lx < MXSUB; lx++) { offset = lx*NVARS + ly*nvmxsub; c1 = udata[offset]; @@ -916,7 +916,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, /* Solve the block-diagonal system Px = r using LU factors stored in P and pivot data in pivot, and return the solution in z. First copy vector r to z. */ - N_VScale(RCONST(1.0), r, z); + N_VScale(SUN_RCONST(1.0), r, z); nvmxsub = data->nvmxsub; zdata = N_VGetArrayPointer(z); diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c index 986289fe8a..02620a29d6 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c @@ -69,27 +69,27 @@ /* Problem Constants */ #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) - -#define T0 RCONST(0.0) /* initial time */ +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) + +#define T0 SUN_RCONST(0.0) /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ -#define XMIN RCONST(0.0) /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMIN SUN_RCONST(0.0) /* grid boundaries in x */ +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -102,8 +102,8 @@ /* Spatial mesh is MX by MY */ /* initialization constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -312,8 +312,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SUNSQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SUNSQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SUNSQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -377,18 +377,18 @@ static void SetInitialProfiles(HYPRE_IJVector Uij, UserData data, Here lx and ly are local mesh point indices on the local subgrid, and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SUNSQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SUNSQR(cy); + cy = SUNSQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SUNSQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SUNSQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SUNSQR(cx); + cx = SUNSQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SUNSQR(cx); iglobal[offset] = my_base + offset; udata[offset++] = C1_SCALE*cx*cy; iglobal[offset] = my_base + offset; @@ -749,12 +749,12 @@ static void fcalc(sunrealtype t, sunrealtype udata[], /* Set diurnal rate coefficients as functions of t, and save q4 in data block for use by preconditioner evaluation routine */ s = sin((data->om)*t); - if (s > RCONST(0.0)) { + if (s > SUN_RCONST(0.0)) { q3 = SUNRexp(-A3/s); q4coef = SUNRexp(-A4/s); } else { - q3 = RCONST(0.0); - q4coef = RCONST(0.0); + q3 = SUN_RCONST(0.0); + q4coef = SUN_RCONST(0.0); } data->q4 = q4coef; @@ -764,10 +764,10 @@ static void fcalc(sunrealtype t, sunrealtype udata[], jy = ly + isuby*MYSUB; /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*SUNRexp(RCONST(0.2)*ydn); - cyup = verdco*SUNRexp(RCONST(0.2)*yup); + cydn = verdco*SUNRexp(SUN_RCONST(0.2)*ydn); + cyup = verdco*SUNRexp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -778,7 +778,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], qq2 = Q2*c1*c2; qq3 = q3*C3; qq4 = q4coef*c2; - rkin1 = -qq1 - qq2 + RCONST(2.0)*qq3 + qq4; + rkin1 = -qq1 - qq2 + SUN_RCONST(2.0)*qq3 + qq4; rkin2 = qq1 - qq2 - qq4; /* Set vertical diffusion terms */ @@ -794,8 +794,8 @@ static void fcalc(sunrealtype t, sunrealtype udata[], c2lt = uext[offsetue-1]; c1rt = uext[offsetue+2]; c2rt = uext[offsetue+3]; - hord1 = hordco*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = hordco*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = hordco*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = hordco*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = horaco*(c1rt - c1lt); horad2 = horaco*(c2rt - c2lt); @@ -891,11 +891,11 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, computed on the last f call). Load into P. */ for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*SUNRexp(RCONST(0.2)*ydn); - cyup = verdco*SUNRexp(RCONST(0.2)*yup); - diag = -(cydn + cyup + RCONST(2.0)*hordco); + cydn = verdco*SUNRexp(SUN_RCONST(0.2)*ydn); + cyup = verdco*SUNRexp(SUN_RCONST(0.2)*yup); + diag = -(cydn + cyup + SUN_RCONST(2.0)*hordco); for (lx = 0; lx < MXSUB; lx++) { offset = lx*NVARS + ly*nvmxsub; c1 = udata[offset]; @@ -954,7 +954,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, /* Solve the block-diagonal system Px = r using LU factors stored in P and pivot data in pivot, and return the solution in z. First copy vector r to z. */ - N_VScale(RCONST(1.0), r, z); + N_VScale(SUN_RCONST(1.0), r, z); nvmxsub = data->nvmxsub; zhyp = N_VGetVector_ParHyp(z); /* extract hypre vector */ zdata = hypre_VectorData(hypre_ParVectorLocalVector(zhyp)); diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index fb71dd39fd..f6d6c5bf8c 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -127,17 +127,17 @@ /* Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Problem Specification Constants */ #define AA ONE /* AA = a */ -#define EE RCONST(1.0e4) /* EE = e */ -#define GG RCONST(0.5e-6) /* GG = g */ +#define EE SUN_RCONST(1.0e4) /* EE = e */ +#define GG SUN_RCONST(0.5e-6) /* GG = g */ #define BB ONE /* BB = b */ #define DPREY ONE -#define DPRED RCONST(0.5) +#define DPRED SUN_RCONST(0.5) #define ALPH ONE #define NP 3 #define NS (2*NP) @@ -163,8 +163,8 @@ #define NEQ (NS*MX*MY) #define T0 ZERO -#define RTOL RCONST(1.0e-5) -#define ATOL RCONST(1.0e-5) +#define RTOL SUN_RCONST(1.0e-5) +#define ATOL SUN_RCONST(1.0e-5) /* Spgmr Constants */ @@ -173,8 +173,8 @@ /* Output Constants */ -#define T1 RCONST(1.0e-8) -#define TOUT_MULT RCONST(10.0) +#define T1 SUN_RCONST(1.0e-8) +#define TOUT_MULT SUN_RCONST(10.0) #define DTOUT ONE #define NOUT 18 @@ -361,7 +361,7 @@ int main(int argc, char* argv[]) PrintOutput(arkode_mem, t); if (firstrun && (iout % 3 == 0)) PrintAllSpecies(c, ns, mxns, t); if(check_flag(&flag, "ARKStepEvolve", 1)) break; - if (tout > RCONST(0.9)) tout += DTOUT; else tout *= TOUT_MULT; + if (tout > SUN_RCONST(0.9)) tout += DTOUT; else tout *= TOUT_MULT; } /* Print final statistics, and loop for next case */ @@ -439,7 +439,7 @@ static void InitUserData(WebData wdata) wdata->mq = MQ; wdata->mx = MX; wdata->my = MY; - wdata->srur = sqrt(UNIT_ROUNDOFF); + wdata->srur = sqrt(SUN_UNIT_ROUNDOFF); wdata->mxmp = MXMP; wdata->ngrp = NGRP; wdata->ngx = NGX; @@ -488,8 +488,8 @@ static void CInit(N_Vector c, WebData wdata) dx = wdata->dx; dy = wdata->dy; - x_factor = RCONST(4.0)/SQR(AX); - y_factor = RCONST(4.0)/SQR(AY); + x_factor = SUN_RCONST(4.0)/SQR(AX); + y_factor = SUN_RCONST(4.0)/SQR(AY); for (jy = 0; jy < MY; jy++) { y = jy*dy; argy = SQR(y_factor*y*(AY-y)); @@ -500,7 +500,7 @@ static void CInit(N_Vector c, WebData wdata) ioff = iyoff + ns*jx; for (i = 1; i <= ns; i++) { ici = ioff + i-1; - cdata[ici] = RCONST(10.0) + i*argx*argy; + cdata[ici] = SUN_RCONST(10.0) + i*argx*argy; } } } @@ -826,7 +826,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, if(check_flag(&flag, "ARKStepGetErrWeights", 1)) return(1); rewtdata = N_VGetArrayPointer(rewt); - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; P = wdata->P; pivot = wdata->pivot; @@ -847,7 +847,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, f1 = N_VGetArrayPointer(wdata->tmp); fac = N_VWrmsNorm (fc, rewt); - r0 = RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; + r0 = SUN_RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; if (r0 == ZERO) r0 = ONE; for (igy = 0; igy < ngy; igy++) { @@ -984,11 +984,11 @@ static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) Load local arrays beta, beta2, gam, gam2, and cof1. */ for (i = 0; i < ns; i++) { - temp = ONE/(ONE + RCONST(2.0)*gamma*(cox[i] + coy[i])); + temp = ONE/(ONE + SUN_RCONST(2.0)*gamma*(cox[i] + coy[i])); beta[i] = gamma*cox[i]*temp; - beta2[i] = RCONST(2.0)*beta[i]; + beta2[i] = SUN_RCONST(2.0)*beta[i]; gam[i] = gamma*coy[i]*temp; - gam2[i] = RCONST(2.0)*gam[i]; + gam2[i] = SUN_RCONST(2.0)*gam[i]; cof1[i] = temp; } diff --git a/examples/arkode/C_serial/ark_analytic.c b/examples/arkode/C_serial/ark_analytic.c index 8ee87a548a..18190e1a3a 100644 --- a/examples/arkode/C_serial/ark_analytic.c +++ b/examples/arkode/C_serial/ark_analytic.c @@ -64,13 +64,13 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ - sunrealtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-10); - sunrealtype lamda = RCONST(-100.0); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-10); + sunrealtype lamda = SUN_RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int flag; /* reusable error-checking flag */ @@ -96,7 +96,7 @@ int main() /* Initialize data structures */ y = N_VNew_Serial(NEQ, ctx); /* Create serial vector for solution */ if (check_flag((void *)y, "N_VNew_Serial", 0)) return 1; - N_VConst(RCONST(0.0), y); /* Specify initial condition */ + N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ /* Call ARKStepCreate to initialize the ARK timestepper module and specify the right-hand side function in y'=f(t,y), the inital time @@ -212,7 +212,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ - NV_Ith_S(ydot,0) = lamda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lamda*atan(t); + NV_Ith_S(ydot,0) = lamda*u + SUN_RCONST(1.0)/(SUN_RCONST(1.0)+t*t) - lamda*atan(t); return 0; /* return with success */ } @@ -278,11 +278,11 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = atan(t); - ewt = RCONST(1.0) / (rtol * fabs(ans) + atol); + ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); err = ewt * fabs(NV_Ith_S(y,0) - ans); /* is the solution within the tolerances? */ - passfail = (err < RCONST(1.0)) ? 0 : 1; + passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; if (passfail) { fprintf(stdout, "\nSUNDIALS_WARNING: check_ans error=%"GSYM"\n\n", err); diff --git a/examples/arkode/C_serial/ark_analytic_mels.c b/examples/arkode/C_serial/ark_analytic_mels.c index ba0b5304ec..86dc78d0e2 100644 --- a/examples/arkode/C_serial/ark_analytic_mels.c +++ b/examples/arkode/C_serial/ark_analytic_mels.c @@ -66,13 +66,13 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ - sunrealtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-10); - sunrealtype lamda = RCONST(-100.0); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-10); + sunrealtype lamda = SUN_RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -96,7 +96,7 @@ int main() /* Initialize data structures */ y = N_VNew_Serial(NEQ, ctx); /* Create serial vector for solution */ if (check_retval((void *)y, "N_VNew_Serial", 0)) return 1; - N_VConst(RCONST(0.0), y); /* Specify initial condition */ + N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ /* Call ARKStepCreate to initialize the ARK timestepper module and specify the right-hand side function in y'=f(t,y), the inital time @@ -196,7 +196,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ - NV_Ith_S(ydot,0) = lamda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lamda*atan(t); + NV_Ith_S(ydot,0) = lamda*u + SUN_RCONST(1.0)/(SUN_RCONST(1.0)+t*t) - lamda*atan(t); return 0; /* return with success */ } @@ -315,11 +315,11 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = atan(t); - ewt = RCONST(1.0) / (rtol * fabs(ans) + atol); + ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); err = ewt * fabs(NV_Ith_S(y,0) - ans); /* is the solution within the tolerances? */ - passfail = (err < RCONST(1.0)) ? 0 : 1; + passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; if (passfail) { fprintf(stdout, "\nSUNDIALS_WARNING: check_ans error=%"GSYM"\n\n", err); diff --git a/examples/arkode/C_serial/ark_analytic_nonlin.c b/examples/arkode/C_serial/ark_analytic_nonlin.c index f55d2079bc..c55fae9bc0 100644 --- a/examples/arkode/C_serial/ark_analytic_nonlin.c +++ b/examples/arkode/C_serial/ark_analytic_nonlin.c @@ -53,9 +53,9 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ - sunrealtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ sunrealtype reltol = 1.0e-6; /* tolerances */ sunrealtype abstol = 1.0e-10; diff --git a/examples/arkode/C_serial/ark_brusselator.c b/examples/arkode/C_serial/ark_brusselator.c index c24db60087..ae0b41cbcb 100644 --- a/examples/arkode/C_serial/ark_brusselator.c +++ b/examples/arkode/C_serial/ark_brusselator.c @@ -84,9 +84,9 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ - sunrealtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ int test = 2; /* test problem to run */ @@ -113,26 +113,26 @@ int main() /* set up the test problem according to the desired test */ if (test == 1) { - u0 = RCONST(3.9); - v0 = RCONST(1.1); - w0 = RCONST(2.8); - a = RCONST(1.2); - b = RCONST(2.5); - ep = RCONST(1.0e-5); + u0 = SUN_RCONST(3.9); + v0 = SUN_RCONST(1.1); + w0 = SUN_RCONST(2.8); + a = SUN_RCONST(1.2); + b = SUN_RCONST(2.5); + ep = SUN_RCONST(1.0e-5); } else if (test == 3) { - u0 = RCONST(3.0); - v0 = RCONST(3.0); - w0 = RCONST(3.5); - a = RCONST(0.5); - b = RCONST(3.0); - ep = RCONST(5.0e-4); + u0 = SUN_RCONST(3.0); + v0 = SUN_RCONST(3.0); + w0 = SUN_RCONST(3.5); + a = SUN_RCONST(0.5); + b = SUN_RCONST(3.0); + ep = SUN_RCONST(5.0e-4); } else { - u0 = RCONST(1.2); - v0 = RCONST(3.1); - w0 = RCONST(3.0); - a = RCONST(1.0); - b = RCONST(3.5); - ep = RCONST(5.0e-6); + u0 = SUN_RCONST(1.2); + v0 = SUN_RCONST(3.1); + w0 = SUN_RCONST(3.0); + a = SUN_RCONST(1.0); + b = SUN_RCONST(3.5); + ep = SUN_RCONST(5.0e-6); } /* Initial problem output */ diff --git a/examples/arkode/C_serial/ark_brusselator1D.c b/examples/arkode/C_serial/ark_brusselator1D.c index 2a91891d61..53d3dac473 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.c +++ b/examples/arkode/C_serial/ark_brusselator1D.c @@ -93,8 +93,8 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; @@ -168,32 +168,32 @@ int main() if (check_flag((void *)wmask, "N_VClone", 0)) return 1; /* Set initial conditions into y */ - udata->dx = RCONST(1.0)/(N-1); /* set spatial mesh spacing */ + udata->dx = SUN_RCONST(1.0)/(N-1); /* set spatial mesh spacing */ data = N_VGetArrayPointer(y); /* Access data array for new NVector y */ if (check_flag((void *)data, "N_VGetArrayPointer", 0)) return 1; - pi = RCONST(4.0)*atan(RCONST(1.0)); + pi = SUN_RCONST(4.0)*atan(SUN_RCONST(1.0)); for (i=0; idx); /* u */ - data[IDX(i,1)] = b/a + RCONST(0.1)*sin(pi*i*udata->dx); /* v */ - data[IDX(i,2)] = b + RCONST(0.1)*sin(pi*i*udata->dx); /* w */ + data[IDX(i,0)] = a + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* u */ + data[IDX(i,1)] = b/a + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* v */ + data[IDX(i,2)] = b + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* w */ } /* Set mask array values for each solution component */ N_VConst(0.0, umask); data = N_VGetArrayPointer(umask); if (check_flag((void *)data, "N_VGetArrayPointer", 0)) return 1; - for (i=0; idu/dx/dx; SM_ELEMENT_B(Jac,IDX(i,1),IDX(i-1,1)) += c*udata->dv/dx/dx; SM_ELEMENT_B(Jac,IDX(i,2),IDX(i-1,2)) += c*udata->dw/dx/dx; - SM_ELEMENT_B(Jac,IDX(i,0),IDX(i,0)) += -c*RCONST(2.0)*udata->du/dx/dx; - SM_ELEMENT_B(Jac,IDX(i,1),IDX(i,1)) += -c*RCONST(2.0)*udata->dv/dx/dx; - SM_ELEMENT_B(Jac,IDX(i,2),IDX(i,2)) += -c*RCONST(2.0)*udata->dw/dx/dx; + SM_ELEMENT_B(Jac,IDX(i,0),IDX(i,0)) += -c*SUN_RCONST(2.0)*udata->du/dx/dx; + SM_ELEMENT_B(Jac,IDX(i,1),IDX(i,1)) += -c*SUN_RCONST(2.0)*udata->dv/dx/dx; + SM_ELEMENT_B(Jac,IDX(i,2),IDX(i,2)) += -c*SUN_RCONST(2.0)*udata->dw/dx/dx; SM_ELEMENT_B(Jac,IDX(i,0),IDX(i+1,0)) += c*udata->du/dx/dx; SM_ELEMENT_B(Jac,IDX(i,1),IDX(i+1,1)) += c*udata->dv/dx/dx; SM_ELEMENT_B(Jac,IDX(i,2),IDX(i+1,2)) += c*udata->dw/dx/dx; @@ -440,8 +440,8 @@ static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata) w = Ydata[IDX(i,2)]; /* all vars wrt u */ - SM_ELEMENT_B(Jac,IDX(i,0),IDX(i,0)) += c*(RCONST(2.0)*u*v-(w+RCONST(1.0))); - SM_ELEMENT_B(Jac,IDX(i,1),IDX(i,0)) += c*(w - RCONST(2.0)*u*v); + SM_ELEMENT_B(Jac,IDX(i,0),IDX(i,0)) += c*(SUN_RCONST(2.0)*u*v-(w+SUN_RCONST(1.0))); + SM_ELEMENT_B(Jac,IDX(i,1),IDX(i,0)) += c*(w - SUN_RCONST(2.0)*u*v); SM_ELEMENT_B(Jac,IDX(i,2),IDX(i,0)) += c*(-w); /* all vars wrt v */ @@ -451,7 +451,7 @@ static int ReactionJac(sunrealtype c, N_Vector y, SUNMatrix Jac, UserData udata) /* all vars wrt w */ SM_ELEMENT_B(Jac,IDX(i,0),IDX(i,2)) += c*(-u); SM_ELEMENT_B(Jac,IDX(i,1),IDX(i,2)) += c*(u); - SM_ELEMENT_B(Jac,IDX(i,2),IDX(i,2)) += c*(-RCONST(1.0)/ep - u); + SM_ELEMENT_B(Jac,IDX(i,2),IDX(i,2)) += c*(-SUN_RCONST(1.0)/ep - u); } diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c index 3960bed4dc..404c2386c5 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -82,18 +82,18 @@ #define IDX(x,v) (3*(x)+v) /* constants */ -#define ZERO (RCONST(0.0)) -#define ONE (RCONST(1.0)) -#define TWO (RCONST(2.0)) -#define HALF (RCONST(0.5)) +#define ZERO (SUN_RCONST(0.0)) +#define ONE (SUN_RCONST(1.0)) +#define TWO (SUN_RCONST(2.0)) +#define HALF (SUN_RCONST(0.5)) /* Gaussian quadrature nodes, weights and formula (3 node, 7th-order accurate) */ -#define X1(xl,xr) (HALF*(xl+xr) - HALF*(xr-xl)*RCONST(0.774596669241483377035853079956)) +#define X1(xl,xr) (HALF*(xl+xr) - HALF*(xr-xl)*SUN_RCONST(0.774596669241483377035853079956)) #define X2(xl,xr) (HALF*(xl+xr)) -#define X3(xl,xr) (HALF*(xl+xr) + HALF*(xr-xl)*RCONST(0.774596669241483377035853079956)) -#define W1 (RCONST(0.55555555555555555555555555555556)) -#define W2 (RCONST(0.88888888888888888888888888888889)) -#define W3 (RCONST(0.55555555555555555555555555555556)) +#define X3(xl,xr) (HALF*(xl+xr) + HALF*(xr-xl)*SUN_RCONST(0.774596669241483377035853079956)) +#define W1 (SUN_RCONST(0.55555555555555555555555555555556)) +#define W2 (SUN_RCONST(0.88888888888888888888888888888889)) +#define W3 (SUN_RCONST(0.55555555555555555555555555555556)) #define Quad(f1,f2,f3,xl,xr) (HALF*(xr-xl)*(W1*f1 + W2*f2 + W3*f3)) /* evaluation macros for variables, basis functions and basis derivatives */ @@ -140,21 +140,21 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ UserData udata = NULL; sunrealtype *data; sunindextype N = 201; /* spatial mesh size */ - sunrealtype a = RCONST(0.6); /* problem parameters */ - sunrealtype b = RCONST(2.0); - sunrealtype du = RCONST(0.025); - sunrealtype dv = RCONST(0.025); - sunrealtype dw = RCONST(0.025); - sunrealtype ep = RCONST(1.0e-5); /* stiffness parameter */ - sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-10); + sunrealtype a = SUN_RCONST(0.6); /* problem parameters */ + sunrealtype b = SUN_RCONST(2.0); + sunrealtype du = SUN_RCONST(0.025); + sunrealtype dv = SUN_RCONST(0.025); + sunrealtype dw = SUN_RCONST(0.025); + sunrealtype ep = SUN_RCONST(1.0e-5); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-10); sunindextype i, NEQ, NNZ; int num_threads; @@ -238,18 +238,18 @@ int main(int argc, char *argv[]) { udata->x = (sunrealtype *) malloc(N*sizeof(sunrealtype)); if (check_retval((void *)udata->x, "malloc", 2)) return(1); - h = RCONST(10.0)/(N-1); + h = SUN_RCONST(10.0)/(N-1); for (i=0; ix[i] = HALF/atan(RCONST(5.0))*atan(z) + HALF; + z = -SUN_RCONST(5.0) + h*i; + udata->x[i] = HALF/atan(SUN_RCONST(5.0))*atan(z) + HALF; } /* Set initial conditions into y */ - pi = RCONST(4.0)*atan(RCONST(1.0)); + pi = SUN_RCONST(4.0)*atan(SUN_RCONST(1.0)); for (i=0; ix[i]); /* u */ - data[IDX(i,1)] = b/a + RCONST(0.1)*sin(pi*udata->x[i]); /* v */ - data[IDX(i,2)] = b + RCONST(0.1)*sin(pi*udata->x[i]); /* w */ + data[IDX(i,0)] = a + SUN_RCONST(0.1)*sin(pi*udata->x[i]); /* u */ + data[IDX(i,1)] = b/a + SUN_RCONST(0.1)*sin(pi*udata->x[i]); /* v */ + data[IDX(i,2)] = b + SUN_RCONST(0.1)*sin(pi*udata->x[i]); /* w */ } /* Set mask array values for each solution component */ diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index c37c5cfe64..327bce36a0 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c @@ -86,9 +86,9 @@ #endif /* Define some constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* accessor macros between (x,v) location and 1D NVector array */ #define IDX(x,v) (3*(x)+v) @@ -139,18 +139,18 @@ int main(int argc, char *argv[]) { /* general problem parameters */ sunrealtype T0 = ZERO; /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 10; /* total number of output times */ sunrealtype dTout = (Tf-T0)/Nt; /* time between outputs */ int Nvar = 3; /* number of solution fields */ sunindextype N = 101; /* spatial mesh size */ sunrealtype hs; /* slow step size */ - sunrealtype m = RCONST(10.0); /* time-scale separation factor */ + sunrealtype m = SUN_RCONST(10.0); /* time-scale separation factor */ int solve_type; /* solver configuration */ sunrealtype dx = ONE/(N-1); /* set spatial mesh spacing */ sunrealtype a = 0.6; /* problem parameters */ sunrealtype b = 2.0; - sunrealtype pi = RCONST(4.0)*atan(ONE); + sunrealtype pi = SUN_RCONST(4.0)*atan(ONE); sunrealtype du = 0.01; sunrealtype dv = 0.01; sunrealtype dw = 0.01; @@ -339,17 +339,17 @@ int main(int argc, char *argv[]) N_VConst(0.0, umask); data = N_VGetArrayPointer(umask); if (check_retval((void *)data, "N_VGetArrayPointer", 0)) return 1; - for (i=0; iA[1][0] = RCONST(4.0)*gamma+TWO*beta; - B->A[1][1] = ONE-RCONST(4.0)*gamma-TWO*beta; - B->A[2][0] = RCONST(0.5)-beta-gamma; + beta = SUNRsqrt(SUN_RCONST(3.0))/SUN_RCONST(6.0) + SUN_RCONST(0.5); + gamma = (-ONE/SUN_RCONST(8.0))*(SUNRsqrt(SUN_RCONST(3.0))+ONE); + B->A[1][0] = SUN_RCONST(4.0)*gamma+TWO*beta; + B->A[1][1] = ONE-SUN_RCONST(4.0)*gamma-TWO*beta; + B->A[2][0] = SUN_RCONST(0.5)-beta-gamma; B->A[2][1] = gamma; B->A[2][2] = beta; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = ONE/RCONST(6.0); - B->b[2] = TWO/RCONST(3.0); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = ONE/SUN_RCONST(6.0); + B->b[2] = TWO/SUN_RCONST(3.0); B->c[1] = ONE; - B->c[2] = RCONST(0.5); + B->c[2] = SUN_RCONST(0.5); B->q=3; retval = ARKStepSetTables(inner_arkode_mem, 3, 0, B, NULL); if (check_retval(&retval, "ARKStepSetTables", 1)) return 1; @@ -438,14 +438,14 @@ int main(int argc, char *argv[]) if (check_retval((void *) inner_arkode_mem, "ARKStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(3, SUNTRUE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); B->A[2][0] = -ONE; B->A[2][1] = TWO; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = TWO/RCONST(3.0); - B->b[2] = ONE/RCONST(6.0); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = TWO/SUN_RCONST(3.0); + B->b[2] = ONE/SUN_RCONST(6.0); B->d[1] = ONE; - B->c[1] = RCONST(0.5); + B->c[1] = SUN_RCONST(0.5); B->c[2] = ONE; B->q=3; B->p=2; @@ -457,15 +457,15 @@ int main(int argc, char *argv[]) if (check_retval((void *) inner_arkode_mem, "ARKStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(4, SUNFALSE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); - B->A[2][1] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); + B->A[2][1] = SUN_RCONST(0.5); B->A[3][2] = ONE; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = ONE/RCONST(3.0); - B->b[2] = ONE/RCONST(3.0); - B->b[3] = ONE/RCONST(6.0); - B->c[1] = RCONST(0.5); - B->c[2] = RCONST(0.5); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = ONE/SUN_RCONST(3.0); + B->b[2] = ONE/SUN_RCONST(3.0); + B->b[3] = ONE/SUN_RCONST(6.0); + B->c[1] = SUN_RCONST(0.5); + B->c[2] = SUN_RCONST(0.5); B->c[3] = ONE; B->q=4; retval = ARKStepSetTables(inner_arkode_mem, 4, 0, NULL, B); @@ -534,10 +534,10 @@ int main(int argc, char *argv[]) if (check_retval((void *)arkode_mem, "MRIStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(2, SUNFALSE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = TWO/RCONST(3.0); - B->b[0] = RCONST(0.25); - B->b[1] = RCONST(0.75); - B->c[1] = TWO/RCONST(3.0); + B->A[1][0] = TWO/SUN_RCONST(3.0); + B->b[0] = SUN_RCONST(0.25); + B->b[1] = SUN_RCONST(0.75); + B->c[1] = TWO/SUN_RCONST(3.0); B->q=2; C = MRIStepCoupling_MIStoMRI(B, 2, 0); if (check_retval((void *)C, "MRIStepCoupling_MIStoMRI", 0)) return 1; @@ -881,9 +881,9 @@ static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) N_VConst(0.0, ydot); /* initialize ydot to zero */ /* iterate over domain, computing all equations */ - auconst = -au/RCONST(2.0)/dx; - avconst = -av/RCONST(2.0)/dx; - awconst = -aw/RCONST(2.0)/dx; + auconst = -au/SUN_RCONST(2.0)/dx; + avconst = -av/SUN_RCONST(2.0)/dx; + awconst = -aw/SUN_RCONST(2.0)/dx; for (i=1; idu/dx/dx; SM_ELEMENT_B(Jac,IDX(i,1),IDX(i-1,1)) += c*udata->dv/dx/dx; SM_ELEMENT_B(Jac,IDX(i,2),IDX(i-1,2)) += c*udata->dw/dx/dx; - SM_ELEMENT_B(Jac,IDX(i,0),IDX(i,0)) += -c*RCONST(2.0)*udata->du/dx/dx; - SM_ELEMENT_B(Jac,IDX(i,1),IDX(i,1)) += -c*RCONST(2.0)*udata->dv/dx/dx; - SM_ELEMENT_B(Jac,IDX(i,2),IDX(i,2)) += -c*RCONST(2.0)*udata->dw/dx/dx; + SM_ELEMENT_B(Jac,IDX(i,0),IDX(i,0)) += -c*SUN_RCONST(2.0)*udata->du/dx/dx; + SM_ELEMENT_B(Jac,IDX(i,1),IDX(i,1)) += -c*SUN_RCONST(2.0)*udata->dv/dx/dx; + SM_ELEMENT_B(Jac,IDX(i,2),IDX(i,2)) += -c*SUN_RCONST(2.0)*udata->dw/dx/dx; SM_ELEMENT_B(Jac,IDX(i,0),IDX(i+1,0)) += c*udata->du/dx/dx; SM_ELEMENT_B(Jac,IDX(i,1),IDX(i+1,1)) += c*udata->dv/dx/dx; SM_ELEMENT_B(Jac,IDX(i,2),IDX(i+1,2)) += c*udata->dw/dx/dx; diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.c b/examples/arkode/C_serial/ark_brusselator1D_klu.c index f47bdf3d9e..8063885913 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.c @@ -72,8 +72,8 @@ #define IDX(x,v) (3*(x)+v) /* constants */ -#define ONE (RCONST(1.0)) -#define TWO (RCONST(2.0)) +#define ONE (SUN_RCONST(1.0)) +#define TWO (SUN_RCONST(2.0)) /* user data structure */ typedef struct { @@ -106,8 +106,8 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 10; /* total number of output times */ int Nvar = 3; UserData udata = NULL; @@ -186,15 +186,15 @@ int main() if (check_flag((void *)wmask, "N_VClone", 0)) return 1; /* Set initial conditions into y */ - udata->dx = RCONST(1.0)/(N-1); /* set spatial mesh spacing */ + udata->dx = SUN_RCONST(1.0)/(N-1); /* set spatial mesh spacing */ data = N_VGetArrayPointer(y); /* Access data array for new NVector y */ if (check_flag((void *)data, "N_VGetArrayPointer", 0)) return 1; - pi = RCONST(4.0)*atan(ONE); + pi = SUN_RCONST(4.0)*atan(ONE); for (i=0; idx); /* u */ - data[IDX(i,1)] = b/a + RCONST(0.1)*sin(pi*i*udata->dx); /* v */ - data[IDX(i,2)] = b + RCONST(0.1)*sin(pi*i*udata->dx); /* w */ + data[IDX(i,0)] = a + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* u */ + data[IDX(i,1)] = b/a + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* v */ + data[IDX(i,2)] = b + SUN_RCONST(0.1)*sin(pi*i*udata->dx); /* w */ } /* Set mask array values for each solution component */ diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.c b/examples/arkode/C_serial/ark_brusselator_1D_mri.c index ed4c50971c..86445d02f8 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.c @@ -74,9 +74,9 @@ #endif /* Define some constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* accessor macros between (x,v) location and 1D NVector array */ #define IDX(x,v) (3*(x)+v) @@ -108,17 +108,17 @@ static int check_retval(void *flagvalue, const char *funcname, int opt); int main(int argc, char *argv[]) { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ int Nt = 100; /* total number of output times */ int Nvar = 3; /* number of solution fields */ sunindextype N = 200; /* spatial mesh size (N intervals) */ - sunrealtype a = RCONST(1.0); /* problem parameters */ - sunrealtype b = RCONST(3.5); - sunrealtype c = RCONST(0.25); - sunrealtype ep = RCONST(1.0e-6); /* stiffness parameter */ - sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-10); + sunrealtype a = SUN_RCONST(1.0); /* problem parameters */ + sunrealtype b = SUN_RCONST(3.5); + sunrealtype c = SUN_RCONST(0.25); + sunrealtype ep = SUN_RCONST(1.0e-6); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-10); /* general problem variables */ sunrealtype hs; /* slow step size */ @@ -160,13 +160,13 @@ int main(int argc, char *argv[]) udata->b = b; udata->c = c; udata->ep = ep; - udata->dx = RCONST(1.0)/N; /* periodic BC, divide by N not N-1 */ + udata->dx = SUN_RCONST(1.0)/N; /* periodic BC, divide by N not N-1 */ /* set total allocated vector length */ NEQ = Nvar*udata->N; /* set the slow step size */ - hs = RCONST(0.5)*(udata->dx / SUNRabs(c)); + hs = SUN_RCONST(0.5)*(udata->dx / SUNRabs(c)); /* Initial problem output */ printf("\n1D Advection-Reaction example problem:\n"); @@ -198,17 +198,17 @@ int main(int argc, char *argv[]) N_VConst(0.0, umask); data = N_VGetArrayPointer(umask); if (check_retval((void *) data, "N_VGetArrayPointer", 0)) return 1; - for (i=0; iN = N; udata->k = k; - udata->dx = RCONST(1.0)/(N-1); /* mesh spacing */ + udata->dx = SUN_RCONST(1.0)/(N-1); /* mesh spacing */ /* Initial problem output */ printf("\n1D Heat PDE test problem:\n"); @@ -253,7 +253,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* iterate over domain, computing all equations */ c1 = k/dx/dx; - c2 = -RCONST(2.0)*k/dx/dx; + c2 = -SUN_RCONST(2.0)*k/dx/dx; isource = N/2; Ydot[0] = 0.0; /* left boundary condition */ for (i=1; i>> FAILURE: computed order of accuracy wrt solution is below " "expected (%d)\n", @@ -593,7 +593,7 @@ int main(int argc, char* argv[]) return 1; } - if (ord_max_conv < (expected_order - RCONST(0.5))) + if (ord_max_conv < (expected_order - SUN_RCONST(0.5))) { printf(">>> FAILURE: computed order of accuracy wrt Hamiltonian is below " "expected (%d)\n", diff --git a/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index 6e9902bfaa..5022994b9f 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.c +++ b/examples/arkode/C_serial/ark_kpr_mri.c @@ -92,9 +92,9 @@ #define FSYM "f" #endif -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* User-supplied functions called by the solver */ static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); @@ -127,17 +127,17 @@ int main(int argc, char *argv[]) SUNContext ctx; /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(5.0); /* final time */ - sunrealtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(5.0); /* final time */ + sunrealtype dTout = SUN_RCONST(0.1); /* time between outputs */ sunindextype NEQ = 2; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ int solve_type = 0; /* problem configuration type */ - sunrealtype hs = RCONST(0.01); /* slow step size */ - sunrealtype e = RCONST(0.5); /* fast/slow coupling strength */ - sunrealtype G = RCONST(-100.0); /* stiffness at slow time scale */ - sunrealtype w = RCONST(100.0); /* time-scale separation factor */ - sunrealtype reltol = RCONST(0.01); + sunrealtype hs = SUN_RCONST(0.01); /* slow step size */ + sunrealtype e = SUN_RCONST(0.5); /* fast/slow coupling strength */ + sunrealtype G = SUN_RCONST(-100.0); /* stiffness at slow time scale */ + sunrealtype w = SUN_RCONST(100.0); /* time-scale separation factor */ + sunrealtype reltol = SUN_RCONST(0.01); sunrealtype abstol = 1e-11; /* general problem variables */ @@ -293,14 +293,14 @@ int main(int argc, char *argv[]) if (check_retval((void *) inner_arkode_mem, "ARKStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(3, SUNTRUE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); B->A[2][0] = -ONE; B->A[2][1] = TWO; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = TWO/RCONST(3.0); - B->b[2] = ONE/RCONST(6.0); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = TWO/SUN_RCONST(3.0); + B->b[2] = ONE/SUN_RCONST(6.0); B->d[1] = ONE; - B->c[1] = RCONST(0.5); + B->c[1] = SUN_RCONST(0.5); B->c[2] = ONE; B->q=3; B->p=2; @@ -313,14 +313,14 @@ int main(int argc, char *argv[]) if (check_retval((void *) inner_arkode_mem, "ARKStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(3, SUNTRUE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); B->A[2][0] = -ONE; B->A[2][1] = TWO; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = TWO/RCONST(3.0); - B->b[2] = ONE/RCONST(6.0); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = TWO/SUN_RCONST(3.0); + B->b[2] = ONE/SUN_RCONST(6.0); B->d[1] = ONE; - B->c[1] = RCONST(0.5); + B->c[1] = SUN_RCONST(0.5); B->c[2] = ONE; B->q=3; B->p=2; @@ -334,15 +334,15 @@ int main(int argc, char *argv[]) if (check_retval((void *) inner_arkode_mem, "ARKStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(4, SUNFALSE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); - B->A[2][1] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); + B->A[2][1] = SUN_RCONST(0.5); B->A[3][2] = ONE; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = ONE/RCONST(3.0); - B->b[2] = ONE/RCONST(3.0); - B->b[3] = ONE/RCONST(6.0); - B->c[1] = RCONST(0.5); - B->c[2] = RCONST(0.5); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = ONE/SUN_RCONST(3.0); + B->b[2] = ONE/SUN_RCONST(3.0); + B->b[3] = ONE/SUN_RCONST(6.0); + B->c[1] = SUN_RCONST(0.5); + B->c[2] = SUN_RCONST(0.5); B->c[3] = ONE; B->q=4; retval = ARKStepSetTables(inner_arkode_mem, 4, 0, NULL, B); @@ -354,18 +354,18 @@ int main(int argc, char *argv[]) if (check_retval((void *) inner_arkode_mem, "ARKStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(3, SUNFALSE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - beta = SUNRsqrt(RCONST(3.0))/RCONST(6.0) + RCONST(0.5); - gamma = (-ONE/RCONST(8.0))*(SUNRsqrt(RCONST(3.0))+ONE); - B->A[1][0] = RCONST(4.0)*gamma+TWO*beta; - B->A[1][1] = ONE-RCONST(4.0)*gamma-TWO*beta; - B->A[2][0] = RCONST(0.5)-beta-gamma; + beta = SUNRsqrt(SUN_RCONST(3.0))/SUN_RCONST(6.0) + SUN_RCONST(0.5); + gamma = (-ONE/SUN_RCONST(8.0))*(SUNRsqrt(SUN_RCONST(3.0))+ONE); + B->A[1][0] = SUN_RCONST(4.0)*gamma+TWO*beta; + B->A[1][1] = ONE-SUN_RCONST(4.0)*gamma-TWO*beta; + B->A[2][0] = SUN_RCONST(0.5)-beta-gamma; B->A[2][1] = gamma; B->A[2][2] = beta; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = ONE/RCONST(6.0); - B->b[2] = TWO/RCONST(3.0); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = ONE/SUN_RCONST(6.0); + B->b[2] = TWO/SUN_RCONST(3.0); B->c[1] = ONE; - B->c[2] = RCONST(0.5); + B->c[2] = SUN_RCONST(0.5); B->q=3; retval = ARKStepSetTables(inner_arkode_mem, 3, 0, B, NULL); if (check_retval(&retval, "ARKStepSetTables", 1)) return 1; @@ -387,14 +387,14 @@ int main(int argc, char *argv[]) if (check_retval((void *) inner_arkode_mem, "ARKStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(3, SUNTRUE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); B->A[2][0] = -ONE; B->A[2][1] = TWO; - B->b[0] = ONE/RCONST(6.0); - B->b[1] = TWO/RCONST(3.0); - B->b[2] = ONE/RCONST(6.0); + B->b[0] = ONE/SUN_RCONST(6.0); + B->b[1] = TWO/SUN_RCONST(3.0); + B->b[2] = ONE/SUN_RCONST(6.0); B->d[1] = ONE; - B->c[1] = RCONST(0.5); + B->c[1] = SUN_RCONST(0.5); B->c[2] = ONE; B->q=3; B->p=2; @@ -455,10 +455,10 @@ int main(int argc, char *argv[]) if (check_retval((void *)arkode_mem, "MRIStepCreate", 0)) return 1; B = ARKodeButcherTable_Alloc(2, SUNFALSE); if (check_retval((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = TWO/RCONST(3.0); - B->b[0] = RCONST(0.25); - B->b[1] = RCONST(0.75); - B->c[1] = TWO/RCONST(3.0); + B->A[1][0] = TWO/SUN_RCONST(3.0); + B->b[0] = SUN_RCONST(0.25); + B->b[1] = SUN_RCONST(0.75); + B->c[1] = TWO/SUN_RCONST(3.0); B->q=2; C = MRIStepCoupling_MIStoMRI(B, 2, 0); if (check_retval((void *)C, "MRIStepCoupling_MIStoMRI", 0)) return 1; @@ -857,7 +857,7 @@ static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_da static sunrealtype r(sunrealtype t, void *user_data) { - return( RCONST(0.5)*cos(t) ); + return( SUN_RCONST(0.5)*cos(t) ); } static sunrealtype s(sunrealtype t, void *user_data) { @@ -866,7 +866,7 @@ static sunrealtype s(sunrealtype t, void *user_data) } static sunrealtype rdot(sunrealtype t, void *user_data) { - return( -RCONST(0.5)*sin(t) ); + return( -SUN_RCONST(0.5)*sin(t) ); } static sunrealtype sdot(sunrealtype t, void *user_data) { diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.c b/examples/arkode/C_serial/ark_onewaycouple_mri.c index 859ea14f64..96ca69f08a 100644 --- a/examples/arkode/C_serial/ark_onewaycouple_mri.c +++ b/examples/arkode/C_serial/ark_onewaycouple_mri.c @@ -75,13 +75,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(1.0); /* final time */ - sunrealtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(1.0); /* final time */ + sunrealtype dTout = SUN_RCONST(0.1); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ - sunrealtype hs = RCONST(0.001); /* slow step size */ - sunrealtype hf = RCONST(0.0001); /* fast step size */ + sunrealtype hs = SUN_RCONST(0.001); /* slow step size */ + sunrealtype hf = SUN_RCONST(0.0001); /* fast step size */ sunrealtype u0, v0, w0; /* initial conditions */ /* general problem variables */ @@ -93,7 +93,7 @@ int main() MRIStepInnerStepper inner_stepper = NULL; /* inner stepper */ FILE *UFID; sunrealtype t, tout; - sunrealtype error = RCONST(0.0); + sunrealtype error = SUN_RCONST(0.0); int iout; long int nsts, nstf, nfse, nfsi, nff, tmp; @@ -107,9 +107,9 @@ int main() if (check_retval(&retval, "SUNContext_Create", 1)) return 1; /* Set the initial contions */ - u0 = RCONST(1.0); - v0 = RCONST(0.0); - w0 = RCONST(2.0); + u0 = SUN_RCONST(1.0); + v0 = SUN_RCONST(0.0); + w0 = SUN_RCONST(2.0); /* Initial problem output */ printf("\nOne way coupling ODE test problem:\n"); @@ -255,8 +255,8 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) sunrealtype w = NV_Ith_S(y,2); /* access solution values */ /* fill in the RHS function */ - NV_Ith_S(ydot,0) = RCONST(0.0); - NV_Ith_S(ydot,1) = RCONST(0.0); + NV_Ith_S(ydot,0) = SUN_RCONST(0.0); + NV_Ith_S(ydot,1) = SUN_RCONST(0.0); NV_Ith_S(ydot,2) = -w; /* Return with success */ @@ -266,7 +266,7 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* fs routine to compute the slow portion of the ODE RHS. */ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - sunrealtype c1 = RCONST(50.0); /* problem constant */ + sunrealtype c1 = SUN_RCONST(50.0); /* problem constant */ sunrealtype u = NV_Ith_S(y,0); /* access solution values */ sunrealtype v = NV_Ith_S(y,1); @@ -286,10 +286,10 @@ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* function to compute the analytic solution of the ODE */ static int ans(sunrealtype t, N_Vector ytrue, void *user_data) { - sunrealtype c1 = RCONST(50.0); - sunrealtype c2 = RCONST(5051.0)/RCONST(2501.0); - sunrealtype c3 = RCONST(49.0)/RCONST(2501.0); - sunrealtype c4 = RCONST(51.0)/RCONST(2501.0); + sunrealtype c1 = SUN_RCONST(50.0); + sunrealtype c2 = SUN_RCONST(5051.0)/SUN_RCONST(2501.0); + sunrealtype c3 = SUN_RCONST(49.0)/SUN_RCONST(2501.0); + sunrealtype c4 = SUN_RCONST(51.0)/SUN_RCONST(2501.0); /* fill in the solution vector */ NV_Ith_S(ytrue,0) = cos(c1*t); @@ -304,7 +304,7 @@ static int ans(sunrealtype t, N_Vector ytrue, void *user_data) static int err(N_Vector y, N_Vector ytrue, sunrealtype* e) { /* compute the error and store it in ytrue */ - N_VLinearSum(RCONST(1.0), y, RCONST(-1.0), ytrue, ytrue); + N_VLinearSum(SUN_RCONST(1.0), y, SUN_RCONST(-1.0), ytrue, ytrue); /* compute the max norm of the error */ *e = N_VMaxNorm(ytrue); diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c index 682da3be53..0716c41ef0 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c @@ -81,18 +81,18 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(3.0); /* final time */ - sunrealtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(3.0); /* final time */ + sunrealtype dTout = SUN_RCONST(0.1); /* time between outputs */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ - sunrealtype hs = RCONST(0.001); /* slow step size */ - sunrealtype hf = RCONST(0.00002); /* fast step size */ + sunrealtype hs = SUN_RCONST(0.001); /* slow step size */ + sunrealtype hf = SUN_RCONST(0.00002); /* fast step size */ UserData udata = NULL; /* user data */ sunrealtype *data; /* array for solution output */ - sunrealtype L = RCONST(5.0); /* domain length */ + sunrealtype L = SUN_RCONST(5.0); /* domain length */ sunindextype N = 1001; /* number of mesh points */ - sunrealtype ep = RCONST(1e-2); + sunrealtype ep = SUN_RCONST(1e-2); sunindextype i; /* general problem variables */ @@ -117,9 +117,9 @@ int main() { /* allocate and fill user data structure */ udata = (UserData) malloc(sizeof(*udata)); udata->N = N; - udata->dx = L / (RCONST(1.0)*N - RCONST(1.0)); - udata->k = RCONST(1e-4)/ep; - udata->lam = RCONST(0.5)*sqrt(RCONST(2.0) * ep * RCONST(1e4)); + udata->dx = L / (SUN_RCONST(1.0)*N - SUN_RCONST(1.0)); + udata->k = SUN_RCONST(1e-4)/ep; + udata->lam = SUN_RCONST(0.5)*sqrt(SUN_RCONST(2.0) * ep * SUN_RCONST(1e4)); /* Initial problem output */ printf("\n1D reaction-diffusion PDE test problem:\n"); @@ -272,7 +272,7 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* iterate over domain, computing reaction term */ for (i = 0; i < N; i++) - Ydot[i] = Y[i] * Y[i] * (RCONST(1.0) - Y[i]); + Ydot[i] = Y[i] * Y[i] * (SUN_RCONST(1.0) - Y[i]); /* Return with success */ return 0; @@ -300,7 +300,7 @@ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* iterate over domain, computing diffusion term */ c1 = k/dx/dx; - c2 = RCONST(2.0)*k/dx/dx; + c2 = SUN_RCONST(2.0)*k/dx/dx; /* left boundary condition */ Ydot[0] = c2*(Y[1] - Y[0]); @@ -335,7 +335,7 @@ static int SetInitialCondition(N_Vector y, UserData user_data) /* set initial condition */ for (i = 0; i < N; i++) - Y[i] = RCONST(1.0)/(1 + exp(lam*(i*dx-RCONST(1.0)))); + Y[i] = SUN_RCONST(1.0)/(1 + exp(lam*(i*dx-SUN_RCONST(1.0)))); /* Return with success */ return 0; diff --git a/examples/arkode/C_serial/ark_robertson.c b/examples/arkode/C_serial/ark_robertson.c index 264a56eefd..8d85c7e110 100644 --- a/examples/arkode/C_serial/ark_robertson.c +++ b/examples/arkode/C_serial/ark_robertson.c @@ -66,8 +66,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(1.e11); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(1.e11); /* final time */ sunrealtype dTout = (Tf-T0)/100; /* time between outputs */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ sunindextype NEQ = 3; /* number of dependent vars. */ @@ -83,12 +83,12 @@ int main() int iout; /* set up the initial conditions, tolerances, initial time step size */ - sunrealtype u0 = RCONST(1.0); - sunrealtype v0 = RCONST(0.0); - sunrealtype w0 = RCONST(0.0); - sunrealtype reltol = RCONST(1.0e-4); - sunrealtype abstol = RCONST(1.0e-11); - sunrealtype h0 = RCONST(1.0e-4) * reltol; + sunrealtype u0 = SUN_RCONST(1.0); + sunrealtype v0 = SUN_RCONST(0.0); + sunrealtype w0 = SUN_RCONST(0.0); + sunrealtype reltol = SUN_RCONST(1.0e-4); + sunrealtype abstol = SUN_RCONST(1.0e-11); + sunrealtype h0 = SUN_RCONST(1.0e-4) * reltol; /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -120,7 +120,7 @@ int main() if (check_flag(&flag, "ARKStepSetMaxErrTestFails", 1)) return 1; flag = ARKStepSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ if (check_flag(&flag, "ARKStepSetMaxNonlinIters", 1)) return 1; - flag = ARKStepSetNonlinConvCoef(arkode_mem, RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) return 1; flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) return 1; @@ -286,17 +286,17 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ sunrealtype err; /* wrms error */ - sunrealtype ZERO=RCONST(0.0); - sunrealtype ONE=RCONST(1.0); + sunrealtype ZERO=SUN_RCONST(0.0); + sunrealtype ONE=SUN_RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(2.0833403356917897e-08); - NV_Ith_S(ref,1) = RCONST(8.1470714598028223e-14); - NV_Ith_S(ref,2) = RCONST(9.9999997916651040e-01); + NV_Ith_S(ref,0) = SUN_RCONST(2.0833403356917897e-08); + NV_Ith_S(ref,1) = SUN_RCONST(8.1470714598028223e-14); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999997916651040e-01); /* compute the error weight vector */ N_VAbs(ref, ewt); diff --git a/examples/arkode/C_serial/ark_robertson_constraints.c b/examples/arkode/C_serial/ark_robertson_constraints.c index 22d9d0bbba..32e4ca483c 100644 --- a/examples/arkode/C_serial/ark_robertson_constraints.c +++ b/examples/arkode/C_serial/ark_robertson_constraints.c @@ -66,11 +66,11 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* Main Program */ int main() { - sunrealtype ONE = RCONST(1.0); + sunrealtype ONE = SUN_RCONST(1.0); /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(1.e11); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(1.e11); /* final time */ sunrealtype dTout = (Tf-T0)/100; /* time between outputs */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ sunindextype NEQ = 3; /* number of dependent vars. */ @@ -88,12 +88,12 @@ int main() long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, nnf, ncfn, netf, nctf; /* set up the initial conditions, tolerances, initial time step size */ - sunrealtype u0 = RCONST(1.0); - sunrealtype v0 = RCONST(0.0); - sunrealtype w0 = RCONST(0.0); - sunrealtype reltol = RCONST(1.0e-3); - sunrealtype abstol = RCONST(1.0e-7); - sunrealtype h0 = RCONST(1.0e-4) * reltol; + sunrealtype u0 = SUN_RCONST(1.0); + sunrealtype v0 = SUN_RCONST(0.0); + sunrealtype w0 = SUN_RCONST(0.0); + sunrealtype reltol = SUN_RCONST(1.0e-3); + sunrealtype abstol = SUN_RCONST(1.0e-7); + sunrealtype h0 = SUN_RCONST(1.0e-4) * reltol; /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -130,7 +130,7 @@ int main() if (check_flag(&flag, "ARKStepSetMaxErrTestFails", 1)) return 1; flag = ARKStepSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ if (check_flag(&flag, "ARKStepSetMaxNonlinIters", 1)) return 1; - flag = ARKStepSetNonlinConvCoef(arkode_mem, RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) return 1; flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) return 1; @@ -327,17 +327,17 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ sunrealtype err; /* wrms error */ - sunrealtype ZERO=RCONST(0.0); - sunrealtype ONE=RCONST(1.0); + sunrealtype ZERO=SUN_RCONST(0.0); + sunrealtype ONE=SUN_RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(2.0833403356917897e-08); - NV_Ith_S(ref,1) = RCONST(8.1470714598028223e-14); - NV_Ith_S(ref,2) = RCONST(9.9999997916651040e-01); + NV_Ith_S(ref,0) = SUN_RCONST(2.0833403356917897e-08); + NV_Ith_S(ref,1) = SUN_RCONST(8.1470714598028223e-14); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999997916651040e-01); /* compute the error weight vector */ N_VAbs(ref, ewt); diff --git a/examples/arkode/C_serial/ark_robertson_root.c b/examples/arkode/C_serial/ark_robertson_root.c index 6682db8606..d59a7e0b84 100644 --- a/examples/arkode/C_serial/ark_robertson_root.c +++ b/examples/arkode/C_serial/ark_robertson_root.c @@ -67,9 +67,9 @@ static int check_flag(void *flagvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype T1 = RCONST(0.4); /* first output time */ - sunrealtype TMult = RCONST(10.0); /* output time multiplication factor */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype T1 = SUN_RCONST(0.4); /* first output time */ + sunrealtype TMult = SUN_RCONST(10.0); /* output time multiplication factor */ int Nt = 12; /* total number of output times */ sunindextype NEQ = 3; /* number of dependent vars. */ @@ -90,10 +90,10 @@ int main() long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, nnf, ncfn, netf, nge; /* set up the initial conditions */ - sunrealtype u0 = RCONST(1.0); - sunrealtype v0 = RCONST(0.0); - sunrealtype w0 = RCONST(0.0); - sunrealtype reltol = RCONST(1.0e-4); + sunrealtype u0 = SUN_RCONST(1.0); + sunrealtype v0 = SUN_RCONST(0.0); + sunrealtype w0 = SUN_RCONST(0.0); + sunrealtype reltol = SUN_RCONST(1.0e-4); /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -115,9 +115,9 @@ int main() if (check_flag((void *) atols, "N_VNew_Serial", 0)) return 1; /* Set absolute tolerances */ - NV_Ith_S(atols,0) = RCONST(1.0e-8); - NV_Ith_S(atols,1) = RCONST(1.0e-11); - NV_Ith_S(atols,2) = RCONST(1.0e-8); + NV_Ith_S(atols,0) = SUN_RCONST(1.0e-8); + NV_Ith_S(atols,1) = SUN_RCONST(1.0e-11); + NV_Ith_S(atols,2) = SUN_RCONST(1.0e-8); /* Call ARKStepCreate to initialize the ARK timestepper module and specify the right-hand side function in y'=f(t,y), the inital time @@ -131,7 +131,7 @@ int main() if (check_flag(&flag, "ARKStepSetMaxErrTestFails", 1)) return 1; flag = ARKStepSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ if (check_flag(&flag, "ARKStepSetMaxNonlinIters", 1)) return 1; - flag = ARKStepSetNonlinConvCoef(arkode_mem, RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ + flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) return 1; flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) return 1; @@ -294,8 +294,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype u = NV_Ith_S(y,0); /* access current solution */ sunrealtype w = NV_Ith_S(y,2); - gout[0] = u - RCONST(0.0001); /* check for u == 1e-4 */ - gout[1] = w - RCONST(0.01); /* check for w == 1e-2 */ + gout[0] = u - SUN_RCONST(0.0001); /* check for u == 1e-4 */ + gout[1] = w - SUN_RCONST(0.01); /* check for w == 1e-2 */ return 0; /* Return with success */ } diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.c b/examples/arkode/C_serial/ark_twowaycouple_mri.c index 88b738fcc7..e66ca48a13 100644 --- a/examples/arkode/C_serial/ark_twowaycouple_mri.c +++ b/examples/arkode/C_serial/ark_twowaycouple_mri.c @@ -60,13 +60,13 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(2.0); /* final time */ - sunrealtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(2.0); /* final time */ + sunrealtype dTout = SUN_RCONST(0.1); /* time between outputs */ sunindextype NEQ = 3; /* number of dependent vars. */ int Nt = (int) ceil(Tf/dTout); /* number of output times */ - sunrealtype hs = RCONST(0.001); /* slow step size */ - sunrealtype hf = RCONST(0.00002); /* fast step size */ + sunrealtype hs = SUN_RCONST(0.001); /* slow step size */ + sunrealtype hf = SUN_RCONST(0.00002); /* fast step size */ sunrealtype u0, v0, w0; /* initial conditions */ /* general problem variables */ @@ -90,9 +90,9 @@ int main() */ /* Set the initial contions */ - u0 = RCONST(9001.0)/RCONST(10001.0); - v0 = RCONST(-1.0e5)/RCONST(10001.0); - w0 = RCONST(1000.0); + u0 = SUN_RCONST(9001.0)/SUN_RCONST(10001.0); + v0 = SUN_RCONST(-1.0e5)/SUN_RCONST(10001.0); + w0 = SUN_RCONST(1000.0); /* Initial problem output */ printf("\nTwo way coupling ODE test problem:\n"); @@ -222,7 +222,7 @@ int main() /* ff routine to compute the fast portion of the ODE RHS. */ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { - sunrealtype c1 = RCONST(100.0); /* problem constant */ + sunrealtype c1 = SUN_RCONST(100.0); /* problem constant */ sunrealtype u = NV_Ith_S(y,0); /* access solution values */ sunrealtype v = NV_Ith_S(y,1); @@ -242,7 +242,7 @@ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) /* fill in the RHS function */ NV_Ith_S(ydot,0) = w; - NV_Ith_S(ydot,1) = RCONST(0.0); + NV_Ith_S(ydot,1) = SUN_RCONST(0.0); NV_Ith_S(ydot,2) = -w; /* Return with success */ diff --git a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp index 37e8f960cf..dead0697c7 100644 --- a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp +++ b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp @@ -60,20 +60,20 @@ using namespace std; // Problem Constants #define GROUPSIZE 3 // number of equations per group -#define Y1 RCONST(1.0) // initial y components -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) // scalar relative tolerance -#define ATOL1 RCONST(1.0e-8) // vector absolute tolerance components -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) // initial time -#define T1 RCONST(0.1) // first output time -#define TMULT RCONST(10.0) // output time factor +#define Y1 SUN_RCONST(1.0) // initial y components +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) // scalar relative tolerance +#define ATOL1 SUN_RCONST(1.0e-8) // vector absolute tolerance components +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) // initial time +#define T1 SUN_RCONST(0.1) // first output time +#define TMULT SUN_RCONST(10.0) // output time factor #define NOUT 10 // number of output times -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) // Functions Called by the Solver static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); @@ -335,8 +335,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) sunrealtype y2 = ydata[N * groupj + 1]; sunrealtype y3 = ydata[N * groupj + 2]; - sunrealtype yd1 = RCONST(-0.04) * y1 + RCONST(1.0e4) * y2 * y3; - sunrealtype yd3 = RCONST(3.0e7) * y2 * y2; + sunrealtype yd1 = SUN_RCONST(-0.04) * y1 + SUN_RCONST(1.0e4) * y2 * y3; + sunrealtype yd3 = SUN_RCONST(3.0e7) * y2 * y2; ydotdata[N * groupj] = yd1; ydotdata[N * groupj + 1] = -yd1 - yd3; @@ -373,18 +373,18 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, sunrealtype y3 = ydata[N * groupj + 2]; // first col of block - Jdata[NN * groupj] = RCONST(-0.04); - Jdata[NN * groupj + 1] = RCONST(0.04); + Jdata[NN * groupj] = SUN_RCONST(-0.04); + Jdata[NN * groupj + 1] = SUN_RCONST(0.04); Jdata[NN * groupj + 2] = ZERO; // second col of block - Jdata[NN * groupj + 3] = RCONST(1.0e4) * y3; - Jdata[NN * groupj + 4] = RCONST(-1.0e4) * y3 - RCONST(6.0e7) * y2; - Jdata[NN * groupj + 5] = RCONST(6.0e7) * y2; + Jdata[NN * groupj + 3] = SUN_RCONST(1.0e4) * y3; + Jdata[NN * groupj + 4] = SUN_RCONST(-1.0e4) * y3 - SUN_RCONST(6.0e7) * y2; + Jdata[NN * groupj + 5] = SUN_RCONST(6.0e7) * y2; // third col of block - Jdata[NN * groupj + 6] = RCONST(1.0e4) * y2; - Jdata[NN * groupj + 7] = RCONST(-1.0e4) * y2; + Jdata[NN * groupj + 6] = SUN_RCONST(1.0e4) * y2; + Jdata[NN * groupj + 7] = SUN_RCONST(-1.0e4) * y2; Jdata[NN * groupj + 8] = ZERO; }); }); @@ -427,10 +427,10 @@ static int PSolve(sunrealtype t, N_Vector y, N_Vector f, N_Vector r, sunrealtype y3 = ydata[i2]; // set matrix values - sunrealtype a = gamma * RCONST(0.04); - sunrealtype b = gamma * RCONST(1.0e4) * y3; - sunrealtype c = gamma * RCONST(1.0e4) * y2; - sunrealtype d = gamma * RCONST(6.0e7) * y2; + sunrealtype a = gamma * SUN_RCONST(0.04); + sunrealtype b = gamma * SUN_RCONST(1.0e4) * y3; + sunrealtype c = gamma * SUN_RCONST(1.0e4) * y2; + sunrealtype d = gamma * SUN_RCONST(6.0e7) * y2; // Initial Jacobi iteration with zero guess diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index 922fab48ce..79265c6831 100644 --- a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp +++ b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp @@ -60,11 +60,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -1283,8 +1283,8 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-5); // relative tolerance - udata->atol = RCONST(1.e-10); // absolute tolerance + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance udata->maxsteps = 0; // use default // Linear solver and preconditioner options diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp index 86350c0046..95578b722d 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp @@ -61,11 +61,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -1580,8 +1580,8 @@ UserData::UserData(sundials::Context& sunctx) ipN = -1; // Integrator settings - rtol = RCONST(1.e-5); // relative tolerance - atol = RCONST(1.e-10); // absolute tolerance + rtol = SUN_RCONST(1.e-5); // relative tolerance + atol = SUN_RCONST(1.e-10); // absolute tolerance maxsteps = 0; // use default // Linear solver and preconditioner options diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index aeb7b84878..2dd12c26d4 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -61,11 +61,11 @@ // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) @@ -2015,8 +2015,8 @@ UserData::UserData(sundials::Context& sunctx) ipN = -1; // Integrator settings - rtol = RCONST(1.e-5); // relative tolerance - atol = RCONST(1.e-10); // absolute tolerance + rtol = SUN_RCONST(1.e-5); // relative tolerance + atol = SUN_RCONST(1.e-10); // absolute tolerance maxsteps = 0; // use default // Linear solver and preconditioner options diff --git a/examples/cvode/CXX_serial/cv_heat2D.hpp b/examples/cvode/CXX_serial/cv_heat2D.hpp index c9a8d4259b..c8a2878381 100644 --- a/examples/cvode/CXX_serial/cv_heat2D.hpp +++ b/examples/cvode/CXX_serial/cv_heat2D.hpp @@ -32,11 +32,11 @@ #include // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // ----------------------------------------------------------------------------- // User data structure diff --git a/examples/cvode/CXX_serial/cv_kpr.hpp b/examples/cvode/CXX_serial/cv_kpr.hpp index 67dac6b065..683392309e 100644 --- a/examples/cvode/CXX_serial/cv_kpr.hpp +++ b/examples/cvode/CXX_serial/cv_kpr.hpp @@ -32,11 +32,11 @@ #include // Macros for problem constants -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define TWENTY RCONST(20.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define TWENTY SUN_RCONST(20.0) // ----------------------------------------------------------------------------- // Problem options @@ -45,8 +45,8 @@ struct Options { // Relative and absolute tolerances - sunrealtype rtol = RCONST(1.0e-6); - sunrealtype atol = RCONST(1.0e-10); + sunrealtype rtol = SUN_RCONST(1.0e-6); + sunrealtype atol = SUN_RCONST(1.0e-10); // Finite difference Jacobian bool fd_jac = false; diff --git a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp index 22cb760ec6..850d0eddbc 100644 --- a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp +++ b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp @@ -47,17 +47,17 @@ // Real Constants -#define ATOL RCONST(1.0e-5) // scalar absolute tolerance -#define T0 RCONST(0.0) // initial time -#define T1 RCONST(0.1) // first output time -#define DTOUT RCONST(0.1) // output time increment +#define ATOL SUN_RCONST(1.0e-5) // scalar absolute tolerance +#define T0 SUN_RCONST(0.0) // initial time +#define T1 SUN_RCONST(0.1) // first output time +#define DTOUT SUN_RCONST(0.1) // output time increment #define NOUT 10 // number of output times -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -82,8 +82,8 @@ struct UserData sunindextype MX = 10; // interior nodes in the x-direction sunindextype MY = 5; // interior nodes in the y-direction sunindextype NEQ = MX * MY; // number of equations - sunrealtype xmax = RCONST(2.0); // x-domain boundary - sunrealtype ymax = RCONST(1.0); // y-domain boundary + sunrealtype xmax = SUN_RCONST(2.0); // x-domain boundary + sunrealtype ymax = SUN_RCONST(1.0); // y-domain boundary sunrealtype dx = xmax / (MX + 1); // x-direction mesh spacing sunrealtype dy = ymax / (MY + 1); // y-directino mesh spacing sunrealtype hdcoef = ONE / (dx * dx); // x-diffusion diff --git a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c index 1385ec8bf7..a6ebce34eb 100644 --- a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c +++ b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c @@ -77,27 +77,27 @@ /* Problem Constants */ #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) - -#define T0 RCONST(0.0) /* initial time */ +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) + +#define T0 SUN_RCONST(0.0) /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ -#define XMIN RCONST(0.0) /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMIN SUN_RCONST(0.0) /* grid boundaries in x */ +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -110,8 +110,8 @@ /* Spatial mesh is MX by MY */ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -331,8 +331,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -389,18 +389,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) Here lx and ly are local mesh point indices on the local subgrid, and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + (data->isuby)*MYSUB; y = YMIN + jy*(data->dy); - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + (data->isubx)*MXSUB; x = XMIN + jx*(data->dx); - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); c1data[offset] = C1_SCALE*cx*cy; c2data[offset] = C2_SCALE*cx*cy; offset++; @@ -741,12 +741,12 @@ static void fcalc(sunrealtype t, N_Vector udot, UserData data) /* Set diurnal rate coefficients as functions of t, and save q4 in data block for use by preconditioner evaluation routine */ s = sin((data->om)*t); - if (s > RCONST(0.0)) { + if (s > SUN_RCONST(0.0)) { q3 = exp(-A3/s); q4coef = exp(-A4/s); } else { - q3 = RCONST(0.0); - q4coef = RCONST(0.0); + q3 = SUN_RCONST(0.0); + q4coef = SUN_RCONST(0.0); } data->q4 = q4coef; @@ -757,10 +757,10 @@ static void fcalc(sunrealtype t, N_Vector udot, UserData data) jy = ly + (data->isuby)*MYSUB; /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*(data->dy); + ydn = YMIN + (jy - SUN_RCONST(0.5))*(data->dy); yup = ydn + data->dy; - cydn = (data->vdco)*exp(RCONST(0.2)*ydn); - cyup = (data->vdco)*exp(RCONST(0.2)*yup); + cydn = (data->vdco)*exp(SUN_RCONST(0.2)*ydn); + cyup = (data->vdco)*exp(SUN_RCONST(0.2)*yup); /* Loop over x-direction */ for (lx=0; lxhdco)*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = (data->hdco)*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = (data->hdco)*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = (data->hdco)*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = (data->haco)*(c1rt - c1lt); horad2 = (data->haco)*(c2rt - c2lt); @@ -858,11 +858,11 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, computed on the last f call). Load into P. */ for (ly=0; lyisuby)*MYSUB; - ydn = YMIN + (jy - RCONST(0.5))*(data->dy); + ydn = YMIN + (jy - SUN_RCONST(0.5))*(data->dy); yup = ydn + (data->dy); - cydn = (data->vdco)*exp(RCONST(0.2)*ydn); - cyup = (data->vdco)*exp(RCONST(0.2)*yup); - diag = -(cydn + cyup + RCONST(2.0)*(data->hdco)); + cydn = (data->vdco)*exp(SUN_RCONST(0.2)*ydn); + cyup = (data->vdco)*exp(SUN_RCONST(0.2)*yup); + diag = -(cydn + cyup + SUN_RCONST(2.0)*(data->hdco)); for (lx = 0; lx < MXSUB; lx++) { c1 = c1data[lx+ly*MXSUB]; c2 = c2data[lx+ly*MXSUB]; @@ -915,7 +915,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector /* Solve the block-diagonal system Px = r using LU factors stored in P and pivot data in pivot, and return the solution in z. First copy vector r to z. */ - N_VScale(RCONST(1.0), r, z); + N_VScale(SUN_RCONST(1.0), r, z); z1data = N_VGetSubvectorArrayPointer_MPIManyVector(z,0); z2data = N_VGetSubvectorArrayPointer_MPIManyVector(z,1); for (lx=0; lxdx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ - data->hdcoef = RCONST(1.0)/(dx*dx); - data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); + data->hdcoef = SUN_RCONST(1.0)/(dx*dx); + data->hacoef = SUN_RCONST(0.5)/(SUN_RCONST(2.0)*dx); SetIC(u, dx); /* Initialize u vector */ @@ -217,7 +217,7 @@ static void SetIC(N_Vector u, sunrealtype dx) /* Load initial profile into u vector */ for (i=1; i<=N; i++) { x = i*dx; - udata[i-1] = x*(XMAX - x)*exp(RCONST(2.0)*x); + udata[i-1] = x*(XMAX - x)*exp(SUN_RCONST(2.0)*x); } N_VCopyToDevice_Cuda(u); } @@ -297,7 +297,7 @@ static void f_kernel(sunindextype N, urt = (i == N-1) ? ZERO : u[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); udot[i] = hdiff + hadv; } diff --git a/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu b/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu index 381e111402..968aecd550 100644 --- a/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu +++ b/examples/cvode/cuda/cvAdvDiff_kry_cuda.cu @@ -52,17 +52,17 @@ /* Real Constants */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -296,8 +296,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ - const sunrealtype YMAX = RCONST(1.0); + const sunrealtype XMAX = SUN_RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = SUN_RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); diff --git a/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu b/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu index c6b95d389a..13df5a617a 100644 --- a/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu +++ b/examples/cvode/cuda/cvAdvDiff_kry_cuda_managed.cu @@ -52,17 +52,17 @@ /* Real Constants */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -300,8 +300,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ - const sunrealtype YMAX = RCONST(1.0); + const sunrealtype XMAX = SUN_RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = SUN_RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); diff --git a/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu b/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu index ddd3101f08..de8ef27a7d 100644 --- a/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu +++ b/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu @@ -48,19 +48,19 @@ /* Problem Constants */ #define GROUPSIZE 3 /* number of equations per group */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -312,8 +312,8 @@ static void f_kernel(sunrealtype t, sunrealtype* ydata, sunrealtype* ydotdata, if (i < neq) { y1 = ydata[groupj]; y2 = ydata[groupj+1]; y3 = ydata[groupj+2]; - yd1 = ydotdata[groupj] = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = ydotdata[groupj+2] = RCONST(3.0e7)*y2*y2; + yd1 = ydotdata[groupj] = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = ydotdata[groupj+2] = SUN_RCONST(3.0e7)*y2*y2; ydotdata[groupj+1] = -yd1 - yd3; } } @@ -409,18 +409,18 @@ static void j_kernel(int ngroups, int nnzper, sunrealtype* ydata, sunrealtype *J y3 = ydata[GROUPSIZE*groupj + 2]; /* first row of block */ - Jdata[nnzper*groupj] = RCONST(-0.04); - Jdata[nnzper*groupj + 1] = RCONST(1.0e4)*y3; - Jdata[nnzper*groupj + 2] = RCONST(1.0e4)*y2; + Jdata[nnzper*groupj] = SUN_RCONST(-0.04); + Jdata[nnzper*groupj + 1] = SUN_RCONST(1.0e4)*y3; + Jdata[nnzper*groupj + 2] = SUN_RCONST(1.0e4)*y2; /* second row of block */ - Jdata[nnzper*groupj + 3] = RCONST(0.04); - Jdata[nnzper*groupj + 4] = (RCONST(-1.0e4)*y3) - (RCONST(6.0e7)*y2); - Jdata[nnzper*groupj + 5] = RCONST(-1.0e4)*y2; + Jdata[nnzper*groupj + 3] = SUN_RCONST(0.04); + Jdata[nnzper*groupj + 4] = (SUN_RCONST(-1.0e4)*y3) - (SUN_RCONST(6.0e7)*y2); + Jdata[nnzper*groupj + 5] = SUN_RCONST(-1.0e4)*y2; /* third row of block */ Jdata[nnzper*groupj + 6] = ZERO; - Jdata[nnzper*groupj + 7] = RCONST(6.0e7)*y2; + Jdata[nnzper*groupj + 7] = SUN_RCONST(6.0e7)*y2; Jdata[nnzper*groupj + 8] = ZERO; } } diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp index bc459c68d1..df33fcd3b8 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp @@ -37,11 +37,11 @@ #include // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // ----------------------------------------------------------------------------- // User data structure diff --git a/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp b/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp index 503ca7e1ea..6bb453d01b 100644 --- a/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp +++ b/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp @@ -32,11 +32,11 @@ #include // Macros for problem constants -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define TWENTY RCONST(20.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define TWENTY SUN_RCONST(20.0) // ----------------------------------------------------------------------------- // Problem options @@ -45,8 +45,8 @@ struct Options { // Relative and absolute tolerances - sunrealtype rtol = RCONST(1.0e-6); - sunrealtype atol = RCONST(1.0e-10); + sunrealtype rtol = SUN_RCONST(1.0e-6); + sunrealtype atol = SUN_RCONST(1.0e-10); // Output options sunrealtype dtout = ONE; // output interval diff --git a/examples/cvode/hip/cvAdvDiff_diag_hip.cpp b/examples/cvode/hip/cvAdvDiff_diag_hip.cpp index a1bb2ff9f8..d68fc4d4a9 100644 --- a/examples/cvode/hip/cvAdvDiff_diag_hip.cpp +++ b/examples/cvode/hip/cvAdvDiff_diag_hip.cpp @@ -49,15 +49,15 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1e-10) /* scalar absolute tolerance */ +#define ATOL SUN_RCONST(1e-10) /* scalar absolute tolerance */ #define T0 ZERO /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ /* Type : UserData @@ -123,8 +123,8 @@ int main(int argc, char *argv[]) abstol = ATOL; dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ - data->hdcoef = RCONST(1.0)/(dx*dx); - data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); + data->hdcoef = SUN_RCONST(1.0)/(dx*dx); + data->hacoef = SUN_RCONST(0.5)/(SUN_RCONST(2.0)*dx); SetIC(u, dx); /* Initialize u vector */ @@ -210,7 +210,7 @@ static void SetIC(N_Vector u, sunrealtype dx) /* Load initial profile into u vector */ for (i=1; i<=N; i++) { x = i*dx; - udata[i-1] = x*(XMAX - x)*exp(RCONST(2.0)*x); + udata[i-1] = x*(XMAX - x)*exp(SUN_RCONST(2.0)*x); } N_VCopyToDevice_Hip(u); } @@ -290,7 +290,7 @@ static void f_kernel(sunindextype N, urt = (i == N-1) ? ZERO : u[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); udot[i] = hdiff + hadv; } diff --git a/examples/cvode/hip/cvAdvDiff_kry_hip.cpp b/examples/cvode/hip/cvAdvDiff_kry_hip.cpp index e41081a857..daf7760f56 100644 --- a/examples/cvode/hip/cvAdvDiff_kry_hip.cpp +++ b/examples/cvode/hip/cvAdvDiff_kry_hip.cpp @@ -50,17 +50,17 @@ /* Real Constants */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -292,8 +292,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ - const sunrealtype YMAX = RCONST(1.0); + const sunrealtype XMAX = SUN_RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = SUN_RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); diff --git a/examples/cvode/magma/cv_bruss_batched_magma.cpp b/examples/cvode/magma/cv_bruss_batched_magma.cpp index e74a157aad..cf7b159b5d 100644 --- a/examples/cvode/magma/cv_bruss_batched_magma.cpp +++ b/examples/cvode/magma/cv_bruss_batched_magma.cpp @@ -163,9 +163,9 @@ struct UserData { int main(int argc, char *argv[]) { - const sunrealtype T0 = RCONST(0.0); /* initial time */ - const sunrealtype Tf = RCONST(10.0); /* final time */ - const sunrealtype dTout = RCONST(1.0); /* time between outputs */ + const sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + const sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + const sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ const int Nt = (int) ceil(Tf/dTout); /* number of output times */ const sunrealtype reltol = 1.0e-6; /* relative integrator tolerance */ int retval; @@ -209,26 +209,26 @@ int main(int argc, char *argv[]) /* Set the Reaction parameters according to test_type_type */ for (int batchj = 0; batchj < udata.nbatches; ++batchj) { if (test_type == 1) { - udata.u0[batchj] = RCONST(3.9); - udata.v0[batchj] = RCONST(1.1); - udata.w0[batchj] = RCONST(2.8); - udata.a[batchj] = RCONST(1.2); - udata.b[batchj] = RCONST(2.5); - udata.ep[batchj] = RCONST(1.0e-5); + udata.u0[batchj] = SUN_RCONST(3.9); + udata.v0[batchj] = SUN_RCONST(1.1); + udata.w0[batchj] = SUN_RCONST(2.8); + udata.a[batchj] = SUN_RCONST(1.2); + udata.b[batchj] = SUN_RCONST(2.5); + udata.ep[batchj] = SUN_RCONST(1.0e-5); } else if (test_type == 2) { - udata.u0[batchj] = RCONST(3.0); - udata.v0[batchj] = RCONST(3.0); - udata.w0[batchj] = RCONST(3.5); - udata.a[batchj] = RCONST(0.5); - udata.b[batchj] = RCONST(3.0); - udata.ep[batchj] = RCONST(5.0e-4); + udata.u0[batchj] = SUN_RCONST(3.0); + udata.v0[batchj] = SUN_RCONST(3.0); + udata.w0[batchj] = SUN_RCONST(3.5); + udata.a[batchj] = SUN_RCONST(0.5); + udata.b[batchj] = SUN_RCONST(3.0); + udata.ep[batchj] = SUN_RCONST(5.0e-4); } else if (test_type == 3) { - udata.u0[batchj] = RCONST(1.2); - udata.v0[batchj] = RCONST(3.1); - udata.w0[batchj] = RCONST(3.0); - udata.a[batchj] = RCONST(1.0); - udata.b[batchj] = RCONST(3.5); - udata.ep[batchj] = RCONST(5.0e-6); + udata.u0[batchj] = SUN_RCONST(1.2); + udata.v0[batchj] = SUN_RCONST(3.1); + udata.w0[batchj] = SUN_RCONST(3.0); + udata.a[batchj] = SUN_RCONST(1.0); + udata.b[batchj] = SUN_RCONST(3.5); + udata.ep[batchj] = SUN_RCONST(5.0e-6); } } diff --git a/examples/cvode/parallel/cvAdvDiff_diag_p.c b/examples/cvode/parallel/cvAdvDiff_diag_p.c index aa55dec453..6edd6aa0ff 100644 --- a/examples/cvode/parallel/cvAdvDiff_diag_p.c +++ b/examples/cvode/parallel/cvAdvDiff_diag_p.c @@ -51,15 +51,15 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ #define T0 ZERO /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ /* Type : UserData @@ -186,8 +186,8 @@ int main(int argc, char *argv[]) abstol = ATOL; dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ - data->hdcoef = RCONST(1.0)/(dx*dx); - data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); + data->hdcoef = SUN_RCONST(1.0)/(dx*dx); + data->hacoef = SUN_RCONST(0.5)/(SUN_RCONST(2.0)*dx); SetIC(u, dx, local_N, my_base); /* Initialize u vector */ @@ -267,7 +267,7 @@ static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, for (i=1; i<=my_length; i++) { iglobal = my_base + i; x = iglobal*dx; - udata[i-1] = x*(XMAX - x)*exp(RCONST(2.0)*x); + udata[i-1] = x*(XMAX - x)*exp(SUN_RCONST(2.0)*x); } } @@ -383,7 +383,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) urt = z[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); dudata[i-1] = hdiff + hadv; } diff --git a/examples/cvode/parallel/cvAdvDiff_non_p.c b/examples/cvode/parallel/cvAdvDiff_non_p.c index bb7622130c..cbb8768b9e 100644 --- a/examples/cvode/parallel/cvAdvDiff_non_p.c +++ b/examples/cvode/parallel/cvAdvDiff_non_p.c @@ -50,15 +50,15 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ #define T0 ZERO /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ /* Type : UserData @@ -140,8 +140,8 @@ int main(int argc, char *argv[]) abstol = ATOL; dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ - data->hdcoef = RCONST(1.0)/(dx*dx); - data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); + data->hdcoef = SUN_RCONST(1.0)/(dx*dx); + data->hacoef = SUN_RCONST(0.5)/(SUN_RCONST(2.0)*dx); SetIC(u, dx, local_N, my_base); /* Initialize u vector */ @@ -226,7 +226,7 @@ static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, for (i=1; i<=my_length; i++) { iglobal = my_base + i; x = iglobal*dx; - udata[i-1] = x*(XMAX - x)*exp(RCONST(2.0)*x); + udata[i-1] = x*(XMAX - x)*exp(SUN_RCONST(2.0)*x); } } @@ -341,7 +341,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) urt = z[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); dudata[i-1] = hdiff + hadv; } diff --git a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c index 132e5ef909..ddd58374b8 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c @@ -78,30 +78,30 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -114,8 +114,8 @@ /* Spatial mesh is MX by MY */ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -334,8 +334,8 @@ static void InitUserData(int my_pe, sunindextype local_N, MPI_Comm comm, data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -375,18 +375,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); uarray[offset ] = C1_SCALE*cx*cy; uarray[offset+1] = C2_SCALE*cx*cy; offset = offset + 2; @@ -829,10 +829,10 @@ static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -862,8 +862,8 @@ static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, c2lt = uext[offsetue-1]; c1rt = uext[offsetue+2]; c2rt = uext[offsetue+3]; - hord1 = hordco*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = hordco*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = hordco*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = hordco*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = horaco*(c1rt - c1lt); horad2 = horaco*(c2rt - c2lt); diff --git a/examples/cvode/parallel/cvDiurnal_kry_p.c b/examples/cvode/parallel/cvDiurnal_kry_p.c index 373a8058d1..6ae2deee11 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_p.c @@ -76,27 +76,27 @@ /* Problem Constants */ #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) - -#define T0 RCONST(0.0) /* initial time */ +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) + +#define T0 SUN_RCONST(0.0) /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ -#define XMIN RCONST(0.0) /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMIN SUN_RCONST(0.0) /* grid boundaries in x */ +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -109,8 +109,8 @@ /* Spatial mesh is MX by MY */ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -319,8 +319,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -383,18 +383,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) Here lx and ly are local mesh point indices on the local subgrid, and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); udata[offset ] = C1_SCALE*cx*cy; udata[offset+1] = C2_SCALE*cx*cy; offset = offset + 2; @@ -751,12 +751,12 @@ static void fcalc(sunrealtype t, sunrealtype udata[], /* Set diurnal rate coefficients as functions of t, and save q4 in data block for use by preconditioner evaluation routine */ s = sin((data->om)*t); - if (s > RCONST(0.0)) { + if (s > SUN_RCONST(0.0)) { q3 = exp(-A3/s); q4coef = exp(-A4/s); } else { - q3 = RCONST(0.0); - q4coef = RCONST(0.0); + q3 = SUN_RCONST(0.0); + q4coef = SUN_RCONST(0.0); } data->q4 = q4coef; @@ -766,10 +766,10 @@ static void fcalc(sunrealtype t, sunrealtype udata[], jy = ly + isuby*MYSUB; /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -780,7 +780,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], qq2 = Q2*c1*c2; qq3 = q3*C3; qq4 = q4coef*c2; - rkin1 = -qq1 - qq2 + RCONST(2.0)*qq3 + qq4; + rkin1 = -qq1 - qq2 + SUN_RCONST(2.0)*qq3 + qq4; rkin2 = qq1 - qq2 - qq4; /* Set vertical diffusion terms */ @@ -796,8 +796,8 @@ static void fcalc(sunrealtype t, sunrealtype udata[], c2lt = uext[offsetue-1]; c1rt = uext[offsetue+2]; c2rt = uext[offsetue+3]; - hord1 = hordco*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = hordco*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = hordco*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = hordco*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = horaco*(c1rt - c1lt); horad2 = horaco*(c2rt - c2lt); @@ -882,11 +882,11 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, computed on the last f call). Load into P. */ for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); - diag = -(cydn + cyup + RCONST(2.0)*hordco); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); + diag = -(cydn + cyup + SUN_RCONST(2.0)*hordco); for (lx = 0; lx < MXSUB; lx++) { offset = lx*NVARS + ly*nvmxsub; c1 = udata[offset]; @@ -943,7 +943,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, /* Solve the block-diagonal system Px = r using LU factors stored in P and pivot data in pivot, and return the solution in z. First copy vector r to z. */ - N_VScale(RCONST(1.0), r, z); + N_VScale(SUN_RCONST(1.0), r, z); nvmxsub = data->nvmxsub; zdata = N_VGetArrayPointer(z); diff --git a/examples/cvode/parhyp/cvAdvDiff_non_ph.c b/examples/cvode/parhyp/cvAdvDiff_non_ph.c index b7ca890d80..3db5ab43aa 100644 --- a/examples/cvode/parhyp/cvAdvDiff_non_ph.c +++ b/examples/cvode/parhyp/cvAdvDiff_non_ph.c @@ -60,15 +60,15 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ #define T0 ZERO /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ /* Type : UserData @@ -155,8 +155,8 @@ int main(int argc, char *argv[]) abstol = ATOL; dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ - data->hdcoef = RCONST(1.0)/(dx*dx); - data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); + data->hdcoef = SUN_RCONST(1.0)/(dx*dx); + data->hacoef = SUN_RCONST(0.5)/(SUN_RCONST(2.0)*dx); /* Initialize solution vector. */ SetIC(Uij, dx, local_N, my_base); @@ -248,7 +248,7 @@ static void SetIC(HYPRE_IJVector Uij, sunrealtype dx, sunindextype my_length, for (i = 0; i < my_length; i++) { iglobal[i] = my_base + i; x = (iglobal[i] + 1)*dx; - udata[i] = x*(XMAX - x)*SUNRexp(RCONST(2.0)*x); + udata[i] = x*(XMAX - x)*SUNRexp(SUN_RCONST(2.0)*x); } HYPRE_IJVectorSetValues(Uij, my_length, iglobal, udata); free(iglobal); @@ -376,7 +376,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) urt = z[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); udotdata[i-1] = hdiff + hadv; } diff --git a/examples/cvode/petsc/cvAdvDiff_petsc.c b/examples/cvode/petsc/cvAdvDiff_petsc.c index ae7372ac22..4cee5d6550 100644 --- a/examples/cvode/petsc/cvAdvDiff_petsc.c +++ b/examples/cvode/petsc/cvAdvDiff_petsc.c @@ -54,15 +54,15 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ #define T0 ZERO /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ /* Type : UserData @@ -152,8 +152,8 @@ int main(int argc, char *argv[]) /* Set grid coefficients */ dx = data->dx = XMAX/((sunrealtype)(MX+1)); - data->hdcoef = RCONST(1.0)/(dx*dx); - data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); + data->hdcoef = SUN_RCONST(1.0)/(dx*dx); + data->hacoef = SUN_RCONST(0.5)/(SUN_RCONST(2.0)*dx); /* Set the tolerances */ reltol = ZERO; @@ -245,7 +245,7 @@ static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, /* Load initial profile into u vector */ for (i=1; i<=my_length; i++) { iglobal = my_base + i; x = iglobal*dx; - VecSetValue(uvec, iglobal-1, x*(XMAX - x)*SUNRexp(RCONST(2.0)*x), INSERT_VALUES); + VecSetValue(uvec, iglobal-1, x*(XMAX - x)*SUNRexp(SUN_RCONST(2.0)*x), INSERT_VALUES); } VecAssemblyBegin(uvec); @@ -357,7 +357,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) urt = z[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); dudata[i-1] = hdiff + hadv; diff --git a/examples/cvode/raja/cvAdvDiff_kry_raja.cpp b/examples/cvode/raja/cvAdvDiff_kry_raja.cpp index 6ce984a1fa..43c8f0085a 100644 --- a/examples/cvode/raja/cvAdvDiff_kry_raja.cpp +++ b/examples/cvode/raja/cvAdvDiff_kry_raja.cpp @@ -66,17 +66,17 @@ /* Real Constants */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) /* Type : _UserData (contains model and discretization parameters) */ @@ -215,8 +215,8 @@ UserData SetUserData(int argc, char *argv[]) { const sunindextype MX = 10; const sunindextype MY = 5; - const sunrealtype XMAX = RCONST(2.0); /* domain boundaries */ - const sunrealtype YMAX = RCONST(1.0); + const sunrealtype XMAX = SUN_RCONST(2.0); /* domain boundaries */ + const sunrealtype YMAX = SUN_RCONST(1.0); /* Allocate user data structure */ UserData ud = (UserData) malloc(sizeof *ud); diff --git a/examples/cvode/serial/cvAdvDiff_bnd.c b/examples/cvode/serial/cvAdvDiff_bnd.c index 9634730f3b..a32dec8b02 100644 --- a/examples/cvode/serial/cvAdvDiff_bnd.c +++ b/examples/cvode/serial/cvAdvDiff_bnd.c @@ -49,22 +49,22 @@ /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundaries */ -#define YMAX RCONST(1.0) +#define XMAX SUN_RCONST(2.0) /* domain boundaries */ +#define YMAX SUN_RCONST(1.0) #define MX 10 /* mesh dimensions */ #define MY 5 #define NEQ MX*MY /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) /* User-defined vector access macro IJth */ diff --git a/examples/cvode/serial/cvAdvDiff_bndL.c b/examples/cvode/serial/cvAdvDiff_bndL.c index 7cba61b915..b8d1e26524 100644 --- a/examples/cvode/serial/cvAdvDiff_bndL.c +++ b/examples/cvode/serial/cvAdvDiff_bndL.c @@ -46,22 +46,22 @@ /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundaries */ -#define YMAX RCONST(1.0) +#define XMAX SUN_RCONST(2.0) /* domain boundaries */ +#define YMAX SUN_RCONST(1.0) #define MX 10 /* mesh dimensions */ #define MY 5 #define NEQ MX*MY /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) /* User-defined vector access macro IJth */ diff --git a/examples/cvode/serial/cvAnalytic_mels.c b/examples/cvode/serial/cvAnalytic_mels.c index 9bc50b3f84..980eec302f 100644 --- a/examples/cvode/serial/cvAnalytic_mels.c +++ b/examples/cvode/serial/cvAnalytic_mels.c @@ -68,13 +68,13 @@ static SUNContext sunctx = NULL; int main() { /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(10.0); /* final time */ - sunrealtype dTout = RCONST(1.0); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ sunindextype NEQ = 1; /* number of dependent vars. */ - sunrealtype reltol = RCONST(1.0e-6); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-10); - sunrealtype lamda = RCONST(-100.0); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-10); + sunrealtype lamda = SUN_RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -97,7 +97,7 @@ int main() /* Initialize data structures */ y = N_VNew_Serial(NEQ, sunctx); /* Create serial vector for solution */ if (check_retval((void *)y, "N_VNew_Serial", 0)) return 1; - N_VConst(RCONST(0.0), y); /* Specify initial condition */ + N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ /* Call CVodeCreate to create the solver memory and specify the * Backward Differentiation Formula */ @@ -200,7 +200,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) sunrealtype u = NV_Ith_S(y,0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ - NV_Ith_S(ydot,0) = lamda*u + RCONST(1.0)/(RCONST(1.0)+t*t) - lamda*atan(t); + NV_Ith_S(ydot,0) = lamda*u + SUN_RCONST(1.0)/(SUN_RCONST(1.0)+t*t) - lamda*atan(t); return 0; /* return with success */ } @@ -319,11 +319,11 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = atan(t); - ewt = RCONST(1.0) / (rtol * fabs(ans) + atol); + ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); err = ewt * fabs(NV_Ith_S(y,0) - ans); /* is the solution within the tolerances? */ - passfail = (err < RCONST(1.0)) ? 0 : 1; + passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; if (passfail) { fprintf(stdout, "\nSUNDIALS_WARNING: check_ans error=%"GSYM"\n\n", err); diff --git a/examples/cvode/serial/cvDirectDemo_ls.c b/examples/cvode/serial/cvDirectDemo_ls.c index f9b80c0d57..45f28b8dee 100644 --- a/examples/cvode/serial/cvDirectDemo_ls.c +++ b/examples/cvode/serial/cvDirectDemo_ls.c @@ -83,38 +83,38 @@ /* Shared Problem Constants */ -#define ATOL RCONST(1.0e-6) -#define RTOL RCONST(0.0) +#define ATOL SUN_RCONST(1.0e-6) +#define RTOL SUN_RCONST(0.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define THIRTY RCONST(30.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define THIRTY SUN_RCONST(30.0) /* Problem #1 Constants */ #define P1_NEQ 2 -#define P1_ETA RCONST(3.0) +#define P1_ETA SUN_RCONST(3.0) #define P1_NOUT 4 -#define P1_T0 RCONST(0.0) -#define P1_T1 RCONST(1.39283880203) -#define P1_DTOUT RCONST(2.214773875) -#define P1_TOL_FACTOR RCONST(1.0e4) +#define P1_T0 SUN_RCONST(0.0) +#define P1_T1 SUN_RCONST(1.39283880203) +#define P1_DTOUT SUN_RCONST(2.214773875) +#define P1_TOL_FACTOR SUN_RCONST(1.0e4) /* Problem #2 Constants */ #define P2_MESHX 5 #define P2_MESHY 5 #define P2_NEQ P2_MESHX*P2_MESHY -#define P2_ALPH1 RCONST(1.0) -#define P2_ALPH2 RCONST(1.0) +#define P2_ALPH1 SUN_RCONST(1.0) +#define P2_ALPH2 SUN_RCONST(1.0) #define P2_NOUT 5 #define P2_ML 5 #define P2_MU 0 -#define P2_T0 RCONST(0.0) -#define P2_T1 RCONST(0.01) -#define P2_TOUT_MULT RCONST(10.0) -#define P2_TOL_FACTOR RCONST(1.0e3) +#define P2_T0 SUN_RCONST(0.0) +#define P2_T1 SUN_RCONST(0.01) +#define P2_TOUT_MULT SUN_RCONST(10.0) +#define P2_TOL_FACTOR SUN_RCONST(1.0e3) /* Linear Solver Options */ diff --git a/examples/cvode/serial/cvDisc_dns.c b/examples/cvode/serial/cvDisc_dns.c index a06fab9d64..fe13160568 100644 --- a/examples/cvode/serial/cvDisc_dns.c +++ b/examples/cvode/serial/cvDisc_dns.c @@ -60,12 +60,12 @@ int main() sunrealtype reltol, abstol, t0, t1, t2, t; long int nst1, nst2, nst; - reltol = RCONST(1.0e-3); - abstol = RCONST(1.0e-4); + reltol = SUN_RCONST(1.0e-3); + abstol = SUN_RCONST(1.0e-4); - t0 = RCONST(0.0); - t1 = RCONST(1.0); - t2 = RCONST(2.0); + t0 = SUN_RCONST(0.0); + t1 = SUN_RCONST(1.0); + t2 = SUN_RCONST(2.0); /* Create the SUNDIALS context */ retval = SUNContext_Create(NULL, &sunctx); @@ -75,7 +75,7 @@ int main() y = N_VNew_Serial(NEQ, sunctx); /* Set initial condition */ - NV_Ith_S(y,0) = RCONST(1.0); + NV_Ith_S(y,0) = SUN_RCONST(1.0); /* * ------------------------------------------------------------ @@ -149,7 +149,7 @@ int main() /* ---- Integrate from the discontinuity */ /* Include discontinuity */ - NV_Ith_S(y,0) = RCONST(1.0); + NV_Ith_S(y,0) = SUN_RCONST(1.0); /* Reinitialize the solver */ retval = CVodeReInit(cvode_mem, t1, y); @@ -190,7 +190,7 @@ int main() printf("\nDiscontinuity in RHS: Case 1 - explicit treatment\n\n"); /* Set initial condition */ - NV_Ith_S(y,0) = RCONST(1.0); + NV_Ith_S(y,0) = SUN_RCONST(1.0); /* Reinitialize the solver. CVodeReInit does not reallocate memory * so it can only be used when the new problem size is the same as @@ -263,7 +263,7 @@ int main() printf("\nDiscontinuity in RHS: Case 2 - let CVODE deal with it\n\n"); /* Set initial condition */ - NV_Ith_S(y,0) = RCONST(1.0); + NV_Ith_S(y,0) = SUN_RCONST(1.0); /* Reinitialize the solver. CVodeReInit does not reallocate memory * so it can only be used when the new problem size is the same as diff --git a/examples/cvode/serial/cvDiurnal_kry.c b/examples/cvode/serial/cvDiurnal_kry.c index 599363b897..5ed8c0d7f2 100644 --- a/examples/cvode/serial/cvDiurnal_kry.c +++ b/examples/cvode/serial/cvDiurnal_kry.c @@ -55,34 +55,34 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NUM_SPECIES 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) -#define XMID RCONST(10.0) /* grid midpoints in x,y */ -#define YMID RCONST(40.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) +#define XMID SUN_RCONST(10.0) /* grid midpoints in x,y */ +#define YMID SUN_RCONST(40.0) #define MX 10 /* MX = number of x mesh points */ #define MY 10 /* MY = number of y mesh points */ @@ -91,8 +91,8 @@ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ #define NEQ (NUM_SPECIES*MM) /* NEQ = number of equations */ @@ -319,12 +319,12 @@ static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) for (jy=0; jy < MY; jy++) { y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - YMID)); - cy = ONE - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - YMID)); + cy = ONE - cy + SUN_RCONST(0.5)*SQR(cy); for (jx=0; jx < MX; jx++) { x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - XMID)); - cx = ONE - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - XMID)); + cx = ONE - cx + SUN_RCONST(0.5)*SQR(cx); IJKth(udata,1,jx,jy) = C1_SCALE*cx*cy; IJKth(udata,2,jx,jy) = C2_SCALE*cx*cy; } @@ -504,10 +504,10 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; for (jx=0; jx < MX; jx++) { @@ -601,11 +601,11 @@ static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; @@ -739,10 +739,10 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, computed on the last f call). Load into P. */ for (jy=0; jy < MY; jy++) { - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); diag = -(cydn + cyup + TWO*hordco); for (jx=0; jx < MX; jx++) { c1 = IJKth(udata,1,jx,jy); diff --git a/examples/cvode/serial/cvDiurnal_kry_bp.c b/examples/cvode/serial/cvDiurnal_kry_bp.c index 3ead5dde00..62771cfe95 100644 --- a/examples/cvode/serial/cvDiurnal_kry_bp.c +++ b/examples/cvode/serial/cvDiurnal_kry_bp.c @@ -54,34 +54,34 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NUM_SPECIES 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) -#define XMID RCONST(10.0) /* grid midpoints in x,y */ -#define YMID RCONST(40.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) +#define XMID SUN_RCONST(10.0) /* grid midpoints in x,y */ +#define YMID SUN_RCONST(40.0) #define MX 10 /* MX = number of x mesh points */ #define MY 10 /* MY = number of y mesh points */ @@ -90,8 +90,8 @@ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ #define NEQ (NUM_SPECIES*MM) /* NEQ = number of equations */ @@ -300,12 +300,12 @@ static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) for (jy=0; jy < MY; jy++) { y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - YMID)); - cy = ONE - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - YMID)); + cy = ONE - cy + SUN_RCONST(0.5)*SQR(cy); for (jx=0; jx < MX; jx++) { x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - XMID)); - cx = ONE - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - XMID)); + cx = ONE - cx + SUN_RCONST(0.5)*SQR(cx); IJKth(udata,1,jx,jy) = C1_SCALE*cx*cy; IJKth(udata,2,jx,jy) = C2_SCALE*cx*cy; } @@ -504,10 +504,10 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; for (jx=0; jx < MX; jx++) { diff --git a/examples/cvode/serial/cvHeat2D_klu.c b/examples/cvode/serial/cvHeat2D_klu.c index 9c219030fc..bebf00ec46 100644 --- a/examples/cvode/serial/cvHeat2D_klu.c +++ b/examples/cvode/serial/cvHeat2D_klu.c @@ -65,20 +65,20 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define BVAL RCONST(0.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define BVAL SUN_RCONST(0.0) */ #define MGRID 3 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define BVAL RCONST(0.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define BVAL SUN_RCONST(0.0) #define NEQ MGRID*MGRID /* number of equations */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define TMULT RCONST(2.0) /* output time factor */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define TMULT SUN_RCONST(2.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define TOTAL 4*MGRID+8*(MGRID-2)+(MGRID-4)*(MGRID+4*(MGRID-2)) /* total num of nonzero elements */ @@ -162,9 +162,9 @@ int main(void) /* Set remaining input parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-8); + atol = SUN_RCONST(1.0e-8); /* Call CVodeCreate to create the solver memory and specify the * Backward Differentiation Formula */ @@ -271,7 +271,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) u1 = Ith(u,1); - ud1 = Ith(udot,1) = RCONST(4)*u1; + ud1 = Ith(udot,1) = SUN_RCONST(4)*u1; return(0); } @@ -299,7 +299,7 @@ int heatres(sunrealtype tres, N_Vector uu, N_Vector resval, for (i = 1; i < mm-1; i++) { loc = offset + i; resv[loc] = upv[loc] - coeff * - (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - RCONST(4.0)*uv[loc]); + (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - SUN_RCONST(4.0)*uv[loc]); } } @@ -317,7 +317,7 @@ static int jacHeat3(sunrealtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, sunindextype *rowvals = SUNSparseMatrix_IndexValues(JacMat); sunrealtype *data = SUNSparseMatrix_Data(JacMat); sunrealtype dx = ONE/(MGRID - ONE); - sunrealtype beta = RCONST(4.0)/(dx*dx); + sunrealtype beta = SUN_RCONST(4.0)/(dx*dx); yval = N_VGetArrayPointer(yy); @@ -390,7 +390,7 @@ static int jacHeat(sunrealtype tt, N_Vector yy, N_Vector fy, SUNMatrix JacMat, sunindextype *rowvals = SUNSparseMatrix_IndexValues(J); sunrealtype *data = SUNSparseMatrix_Data(J); sunrealtype dx = ONE/(MGRID - ONE); - sunrealtype beta = RCONST(4.0)/(dx*dx); + sunrealtype beta = SUN_RCONST(4.0)/(dx*dx); int i,j, repeat=0; yval = N_VGetArrayPointer(yy); @@ -652,7 +652,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector res) for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/cvode/serial/cvKrylovDemo_ls.c b/examples/cvode/serial/cvKrylovDemo_ls.c index b847e62ad8..30e1b030fd 100644 --- a/examples/cvode/serial/cvKrylovDemo_ls.c +++ b/examples/cvode/serial/cvKrylovDemo_ls.c @@ -73,34 +73,34 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NUM_SPECIES 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) -#define XMID RCONST(10.0) /* grid midpoints in x,y */ -#define YMID RCONST(40.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) +#define XMID SUN_RCONST(10.0) /* grid midpoints in x,y */ +#define YMID SUN_RCONST(40.0) #define MX 10 /* MX = number of x mesh points */ #define MY 10 /* MY = number of y mesh points */ @@ -109,8 +109,8 @@ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ #define NEQ (NUM_SPECIES*MM) /* NEQ = number of equations */ @@ -497,12 +497,12 @@ static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) for (jy=0; jy < MY; jy++) { y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - YMID)); - cy = ONE - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - YMID)); + cy = ONE - cy + SUN_RCONST(0.5)*SQR(cy); for (jx=0; jx < MX; jx++) { x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - XMID)); - cx = ONE - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - XMID)); + cx = ONE - cx + SUN_RCONST(0.5)*SQR(cx); IJKth(udata,1,jx,jy) = C1_SCALE*cx*cy; IJKth(udata,2,jx,jy) = C2_SCALE*cx*cy; } @@ -679,10 +679,10 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; for (jx=0; jx < MX; jx++) { @@ -776,10 +776,10 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, computed on the last f call). Load into P. */ for (jy=0; jy < MY; jy++) { - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); diag = -(cydn + cyup + TWO*hordco); for (jx=0; jx < MX; jx++) { c1 = IJKth(udata,1,jx,jy); diff --git a/examples/cvode/serial/cvKrylovDemo_prec.c b/examples/cvode/serial/cvKrylovDemo_prec.c index 727b6ac780..2185f4492f 100644 --- a/examples/cvode/serial/cvKrylovDemo_prec.c +++ b/examples/cvode/serial/cvKrylovDemo_prec.c @@ -120,17 +120,17 @@ /* Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Problem Specification Constants */ #define AA ONE /* AA = a */ -#define EE RCONST(1.0e4) /* EE = e */ -#define GG RCONST(0.5e-6) /* GG = g */ +#define EE SUN_RCONST(1.0e4) /* EE = e */ +#define GG SUN_RCONST(0.5e-6) /* GG = g */ #define BB ONE /* BB = b */ #define DPREY ONE -#define DPRED RCONST(0.5) +#define DPRED SUN_RCONST(0.5) #define ALPH ONE #define NP 3 #define NS (2*NP) @@ -156,8 +156,8 @@ #define NEQ (NS*MX*MY) #define T0 ZERO -#define RTOL RCONST(1.0e-5) -#define ATOL RCONST(1.0e-5) +#define RTOL SUN_RCONST(1.0e-5) +#define ATOL SUN_RCONST(1.0e-5) /* Spgmr/CVLS Constants */ @@ -166,8 +166,8 @@ /* Output Constants */ -#define T1 RCONST(1.0e-8) -#define TOUT_MULT RCONST(10.0) +#define T1 SUN_RCONST(1.0e-8) +#define TOUT_MULT SUN_RCONST(10.0) #define DTOUT ONE #define NOUT 18 @@ -332,7 +332,7 @@ int main() PrintOutput(cvode_mem, t); if (firstrun && (iout % 3 == 0)) PrintAllSpecies(c, ns, mxns, t); if(check_retval(&retval, "CVode", 1)) break; - if (tout > RCONST(0.9)) tout += DTOUT; else tout *= TOUT_MULT; + if (tout > SUN_RCONST(0.9)) tout += DTOUT; else tout *= TOUT_MULT; } /* Print final statistics, and loop for next case */ @@ -411,7 +411,7 @@ static void InitUserData(WebData wdata) wdata->mq = MQ; wdata->mx = MX; wdata->my = MY; - wdata->srur = sqrt(UNIT_ROUNDOFF); + wdata->srur = sqrt(SUN_UNIT_ROUNDOFF); wdata->mxmp = MXMP; wdata->ngrp = NGRP; wdata->ngx = NGX; @@ -460,8 +460,8 @@ static void CInit(N_Vector c, WebData wdata) dx = wdata->dx; dy = wdata->dy; - x_factor = RCONST(4.0)/SQR(AX); - y_factor = RCONST(4.0)/SQR(AY); + x_factor = SUN_RCONST(4.0)/SQR(AX); + y_factor = SUN_RCONST(4.0)/SQR(AY); for (jy = 0; jy < MY; jy++) { y = jy*dy; argy = SQR(y_factor*y*(AY-y)); @@ -472,7 +472,7 @@ static void CInit(N_Vector c, WebData wdata) ioff = iyoff + ns*jx; for (i = 1; i <= ns; i++) { ici = ioff + i-1; - cdata[ici] = RCONST(10.0) + i*argx*argy; + cdata[ici] = SUN_RCONST(10.0) + i*argx*argy; } } } @@ -799,7 +799,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, if(check_retval(&retval, "CVodeGetErrWeights", 1)) return(1); rewtdata = N_VGetArrayPointer(rewt); - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; P = wdata->P; pivot = wdata->pivot; @@ -820,7 +820,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, f1 = N_VGetArrayPointer(wdata->tmp); fac = N_VWrmsNorm (fc, rewt); - r0 = RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; + r0 = SUN_RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; if (r0 == ZERO) r0 = ONE; for (igy = 0; igy < ngy; igy++) { @@ -957,11 +957,11 @@ static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) Load local arrays beta, beta2, gam, gam2, and cof1. */ for (i = 0; i < ns; i++) { - temp = ONE/(ONE + RCONST(2.0)*gamma*(cox[i] + coy[i])); + temp = ONE/(ONE + SUN_RCONST(2.0)*gamma*(cox[i] + coy[i])); beta[i] = gamma*cox[i]*temp; - beta2[i] = RCONST(2.0)*beta[i]; + beta2[i] = SUN_RCONST(2.0)*beta[i]; gam[i] = gamma*coy[i]*temp; - gam2[i] = RCONST(2.0)*gam[i]; + gam2[i] = SUN_RCONST(2.0)*gam[i]; cof1[i] = temp; } diff --git a/examples/cvode/serial/cvParticle_dns.c b/examples/cvode/serial/cvParticle_dns.c index 669da03a7d..10fcd3b911 100644 --- a/examples/cvode/serial/cvParticle_dns.c +++ b/examples/cvode/serial/cvParticle_dns.c @@ -70,10 +70,10 @@ #endif /* Problem Constants */ -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* User-defined data structure */ typedef struct UserData_ @@ -392,8 +392,8 @@ static int InitUserData(int *argc, char ***argv, UserData udata) udata->orbits = 100; udata->torbit = (TWO * PI) / udata->alpha; - udata->rtol = RCONST(1.0e-4); - udata->atol = RCONST(1.0e-9); + udata->rtol = SUN_RCONST(1.0e-4); + udata->atol = SUN_RCONST(1.0e-9); udata->proj = 1; udata->projerr = 0; diff --git a/examples/cvode/serial/cvPendulum_dns.c b/examples/cvode/serial/cvPendulum_dns.c index 0d420f7976..f79e2b738e 100644 --- a/examples/cvode/serial/cvPendulum_dns.c +++ b/examples/cvode/serial/cvPendulum_dns.c @@ -96,9 +96,9 @@ #endif /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define GRAV RCONST(13.750371636040745654980191559621114395801712) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define GRAV SUN_RCONST(13.750371636040745654980191559621114395801712) /* Functions provided to CVODE */ static int fref(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data); @@ -132,9 +132,9 @@ int main(int argc, char* argv[]) int i; int retval; /* reusable return flag */ int nout = 1; /* number of outputs */ - sunrealtype rtol = RCONST(1.0e-5); /* base relative tolerance */ - sunrealtype atol = RCONST(1.0e-5); /* base absolute tolerance */ - sunrealtype tf = RCONST(30.0); /* final integration time */ + sunrealtype rtol = SUN_RCONST(1.0e-5); /* base relative tolerance */ + sunrealtype atol = SUN_RCONST(1.0e-5); /* base absolute tolerance */ + sunrealtype tf = SUN_RCONST(30.0); /* final integration time */ booleantype projerr = SUNTRUE; /* enable error projection */ void *cvode_mem = NULL; /* CVODE memory */ @@ -216,8 +216,8 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "GetSol", 1)) return(1); /* Reduce tolerance for next run */ - rtol /= RCONST(10.0); - atol /= RCONST(10.0); + rtol /= SUN_RCONST(10.0); + atol /= SUN_RCONST(10.0); } /* Free memory */ @@ -432,7 +432,7 @@ int RefSol(sunrealtype tf, N_Vector yref, int nout) sunrealtype tout; /* output time */ sunrealtype t; /* return time */ sunrealtype th, thd; /* theta and theta dot */ - sunrealtype tol = RCONST(1.0e-14); /* integration tolerance */ + sunrealtype tol = SUN_RCONST(1.0e-14); /* integration tolerance */ /* Create the solution vector */ yy = N_VNew_Serial(2, sunctx); diff --git a/examples/cvode/serial/cvRoberts_block_klu.c b/examples/cvode/serial/cvRoberts_block_klu.c index 0a53a12498..b3558a65c9 100644 --- a/examples/cvode/serial/cvRoberts_block_klu.c +++ b/examples/cvode/serial/cvRoberts_block_klu.c @@ -61,19 +61,19 @@ /* Problem Constants */ #define GROUPSIZE 3 /* number of equations per group */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -261,8 +261,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) for (groupj = 0; groupj < udata->neq; groupj += GROUPSIZE) { y1 = Ith(y,1+groupj); y2 = Ith(y,2+groupj); y3 = Ith(y,3+groupj); - yd1 = Ith(ydot,1+groupj) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3+groupj) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1+groupj) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3+groupj) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2+groupj) = -yd1 - yd3; } @@ -302,24 +302,24 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, rowptrs[GROUPSIZE*groupj + 2] = 9 + nnzper*groupj; /* first row of block */ - data[nnzper*groupj] = RCONST(-0.04); - data[nnzper*groupj + 1] = RCONST(1.0e4)*y3; - data[nnzper*groupj + 2] = RCONST(1.0e4)*y2; + data[nnzper*groupj] = SUN_RCONST(-0.04); + data[nnzper*groupj + 1] = SUN_RCONST(1.0e4)*y3; + data[nnzper*groupj + 2] = SUN_RCONST(1.0e4)*y2; colvals[nnzper*groupj] = GROUPSIZE*groupj; colvals[nnzper*groupj + 1] = GROUPSIZE*groupj + 1; colvals[nnzper*groupj + 2] = GROUPSIZE*groupj + 2; /* second row of block */ - data[nnzper*groupj + 3] = RCONST(0.04); - data[nnzper*groupj + 4] = (RCONST(-1.0e4)*y3) - (RCONST(6.0e7)*y2); - data[nnzper*groupj + 5] = RCONST(-1.0e4)*y2; + data[nnzper*groupj + 3] = SUN_RCONST(0.04); + data[nnzper*groupj + 4] = (SUN_RCONST(-1.0e4)*y3) - (SUN_RCONST(6.0e7)*y2); + data[nnzper*groupj + 5] = SUN_RCONST(-1.0e4)*y2; colvals[nnzper*groupj + 3] = GROUPSIZE*groupj; colvals[nnzper*groupj + 4] = GROUPSIZE*groupj + 1; colvals[nnzper*groupj + 5] = GROUPSIZE*groupj + 2; /* third row of block */ data[nnzper*groupj + 6] = ZERO; - data[nnzper*groupj + 7] = RCONST(6.0e7)*y2; + data[nnzper*groupj + 7] = SUN_RCONST(6.0e7)*y2; data[nnzper*groupj + 8] = ZERO; colvals[nnzper*groupj + 6] = GROUPSIZE*groupj; colvals[nnzper*groupj + 7] = GROUPSIZE*groupj + 1; diff --git a/examples/cvode/serial/cvRoberts_dns.c b/examples/cvode/serial/cvRoberts_dns.c index 36f8b2796b..af63236d44 100644 --- a/examples/cvode/serial/cvRoberts_dns.c +++ b/examples/cvode/serial/cvRoberts_dns.c @@ -71,19 +71,19 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -256,8 +256,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -272,8 +272,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -289,16 +289,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); @@ -375,20 +375,20 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ sunrealtype err; /* wrms error */ - sunrealtype ONE=RCONST(1.0); + sunrealtype ONE=SUN_RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(5.2083495894337328e-08); - NV_Ith_S(ref,1) = RCONST(2.0833399429795671e-13); - NV_Ith_S(ref,2) = RCONST(9.9999994791629776e-01); + NV_Ith_S(ref,0) = SUN_RCONST(5.2083495894337328e-08); + NV_Ith_S(ref,1) = SUN_RCONST(2.0833399429795671e-13); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999994791629776e-01); /* compute the error weight vector, loosen atol */ N_VAbs(ref, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), atol, ewt); + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), atol, ewt); if (N_VMin(ewt) <= ZERO) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); diff --git a/examples/cvode/serial/cvRoberts_dnsL.c b/examples/cvode/serial/cvRoberts_dnsL.c index 33d7424810..5c6e9cf572 100644 --- a/examples/cvode/serial/cvRoberts_dnsL.c +++ b/examples/cvode/serial/cvRoberts_dnsL.c @@ -60,19 +60,19 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -234,8 +234,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -250,8 +250,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -267,16 +267,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); diff --git a/examples/cvode/serial/cvRoberts_dns_constraints.c b/examples/cvode/serial/cvRoberts_dns_constraints.c index cfcf6e053b..24d73c37ee 100644 --- a/examples/cvode/serial/cvRoberts_dns_constraints.c +++ b/examples/cvode/serial/cvRoberts_dns_constraints.c @@ -73,20 +73,20 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-6) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-11) -#define ATOL3 RCONST(1.0e-5) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-6) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-11) +#define ATOL3 SUN_RCONST(1.0e-5) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Functions Called by the Solver */ @@ -268,8 +268,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -284,8 +284,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -301,16 +301,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); @@ -432,13 +432,13 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(5.2083495894337328e-08); - NV_Ith_S(ref,1) = RCONST(2.0833399429795671e-13); - NV_Ith_S(ref,2) = RCONST(9.9999994791629776e-01); + NV_Ith_S(ref,0) = SUN_RCONST(5.2083495894337328e-08); + NV_Ith_S(ref,1) = SUN_RCONST(2.0833399429795671e-13); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999994791629776e-01); /* compute the error weight vector, loosen atol */ N_VAbs(ref, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), atol, ewt); + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), atol, ewt); if (N_VMin(ewt) <= ZERO) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); diff --git a/examples/cvode/serial/cvRoberts_dns_negsol.c b/examples/cvode/serial/cvRoberts_dns_negsol.c index ed825f187e..ce76d53f5c 100644 --- a/examples/cvode/serial/cvRoberts_dns_negsol.c +++ b/examples/cvode/serial/cvRoberts_dns_negsol.c @@ -41,19 +41,19 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-7) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-13) -#define ATOL3 RCONST(1.0e-5) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-7) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-13) +#define ATOL3 SUN_RCONST(1.0e-5) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 14 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -218,8 +218,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) if ( *check_negative && (y1<0 || y2<0 || y3<0) ) return(1); - yd1 = NV_Ith_S(ydot,0) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = NV_Ith_S(ydot,2) = RCONST(3.0e7)*y2*y2; + yd1 = NV_Ith_S(ydot,0) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = NV_Ith_S(ydot,2) = SUN_RCONST(3.0e7)*y2*y2; NV_Ith_S(ydot,1) = -yd1 - yd3; return(0); diff --git a/examples/cvode/serial/cvRoberts_dns_uw.c b/examples/cvode/serial/cvRoberts_dns_uw.c index cf13d43e3a..6475f7a68d 100644 --- a/examples/cvode/serial/cvRoberts_dns_uw.c +++ b/examples/cvode/serial/cvRoberts_dns_uw.c @@ -73,19 +73,19 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -237,8 +237,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -253,8 +253,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -270,16 +270,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); diff --git a/examples/cvode/serial/cvRoberts_klu.c b/examples/cvode/serial/cvRoberts_klu.c index 86135f5edd..eed7b87537 100644 --- a/examples/cvode/serial/cvRoberts_klu.c +++ b/examples/cvode/serial/cvRoberts_klu.c @@ -57,19 +57,19 @@ #define NEQ 3 /* number of equations */ #define NNZ 7 /* number of non-zero entries in the Jacobian */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -231,8 +231,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -247,8 +247,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -276,31 +276,31 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, colptrs[0] = 0; rowvals[0] = 0; - data[0] = RCONST(-0.04); + data[0] = SUN_RCONST(-0.04); rowvals[1] = 1; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); /* second column entries start at data[2], three entries (rows 0, 1, and 2) */ colptrs[1] = 2; rowvals[2] = 0; - data[2] = RCONST(1.0e4) * yval[2]; + data[2] = SUN_RCONST(1.0e4) * yval[2]; rowvals[3] = 1; - data[3] = (RCONST(-1.0e4) * yval[2]) - (RCONST(6.0e7) * yval[1]); + data[3] = (SUN_RCONST(-1.0e4) * yval[2]) - (SUN_RCONST(6.0e7) * yval[1]); rowvals[4] = 2; - data[4] = RCONST(6.0e7) * yval[1]; + data[4] = SUN_RCONST(6.0e7) * yval[1]; /* third column entries start at data[5], two entries (rows 0 and 1) */ colptrs[2] = 5; rowvals[5] = 0; - data[5] = RCONST(1.0e4) * yval[1]; + data[5] = SUN_RCONST(1.0e4) * yval[1]; rowvals[6] = 1; - data[6] = RCONST(-1.0e4) * yval[1]; + data[6] = SUN_RCONST(-1.0e4) * yval[1]; /* number of non-zeros */ colptrs[3] = 7; diff --git a/examples/cvode/serial/cvRoberts_sps.c b/examples/cvode/serial/cvRoberts_sps.c index 25bac1fe66..cf43b9b80f 100644 --- a/examples/cvode/serial/cvRoberts_sps.c +++ b/examples/cvode/serial/cvRoberts_sps.c @@ -57,19 +57,19 @@ #define NEQ 3 /* number of equations */ #define NNZ 7 /* number of non-zero entries in the Jacobian */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -231,8 +231,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -247,8 +247,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -276,31 +276,31 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, colptrs[0] = 0; rowvals[0] = 0; - data[0] = RCONST(-0.04); + data[0] = SUN_RCONST(-0.04); rowvals[1] = 1; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); /* second column entries start at data[2], three entries (rows 0, 1, and 2) */ colptrs[1] = 2; rowvals[2] = 0; - data[2] = RCONST(1.0e4) * yval[2]; + data[2] = SUN_RCONST(1.0e4) * yval[2]; rowvals[3] = 1; - data[3] = (RCONST(-1.0e4) * yval[2]) - (RCONST(6.0e7) * yval[1]); + data[3] = (SUN_RCONST(-1.0e4) * yval[2]) - (SUN_RCONST(6.0e7) * yval[1]); rowvals[4] = 2; - data[4] = RCONST(6.0e7) * yval[1]; + data[4] = SUN_RCONST(6.0e7) * yval[1]; /* third column entries start at data[5], two entries (rows 0 and 1) */ colptrs[2] = 5; rowvals[5] = 0; - data[5] = RCONST(1.0e4) * yval[1]; + data[5] = SUN_RCONST(1.0e4) * yval[1]; rowvals[6] = 1; - data[6] = RCONST(-1.0e4) * yval[1]; + data[6] = SUN_RCONST(-1.0e4) * yval[1]; /* number of non-zeros */ colptrs[3] = 7; diff --git a/examples/cvode/serial/cvRocket_dns.c b/examples/cvode/serial/cvRocket_dns.c index 3fc51ee4ce..33a03a659c 100644 --- a/examples/cvode/serial/cvRocket_dns.c +++ b/examples/cvode/serial/cvRocket_dns.c @@ -59,25 +59,25 @@ #define NEQ 2 /* number of equations */ -#define Force RCONST(2200.0) /* engine force */ -#define massr RCONST(10.0) /* rocket mass (empty) */ -#define massf0 RCONST(1.0) /* initial fuel mass */ -#define brate RCONST(0.1) /* fuel burn rate */ -#define Drag RCONST(0.3) /* Drag coefficient */ -#define grav RCONST(32.0) /* acceleration due to gravity */ -#define Hcut RCONST(4000.0) /* height of engine cutoff */ - -#define Y1 RCONST(0.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-2) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-1) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(1.0) /* first output time */ -#define TINC RCONST(1.0) /* output time increment */ +#define Force SUN_RCONST(2200.0) /* engine force */ +#define massr SUN_RCONST(10.0) /* rocket mass (empty) */ +#define massf0 SUN_RCONST(1.0) /* initial fuel mass */ +#define brate SUN_RCONST(0.1) /* fuel burn rate */ +#define Drag SUN_RCONST(0.3) /* Drag coefficient */ +#define grav SUN_RCONST(32.0) /* acceleration due to gravity */ +#define Hcut SUN_RCONST(4000.0) /* height of engine cutoff */ + +#define Y1 SUN_RCONST(0.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-2) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-1) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(1.0) /* first output time */ +#define TINC SUN_RCONST(1.0) /* output time increment */ #define NOUT 70 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -306,7 +306,7 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_d /* Jdata is column-major */ sunrealtype* Jdata = SUNDenseMatrix_Data(J); - Jdata[1] = RCONST(1.0); + Jdata[1] = SUN_RCONST(1.0); Jdata[3] = -Drag; return (0); diff --git a/examples/cvode/superludist/cvAdvDiff_sludist.cpp b/examples/cvode/superludist/cvAdvDiff_sludist.cpp index a743b0f918..4c7f0214cf 100644 --- a/examples/cvode/superludist/cvAdvDiff_sludist.cpp +++ b/examples/cvode/superludist/cvAdvDiff_sludist.cpp @@ -56,20 +56,20 @@ /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ #define T0 ZERO /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) /* Type : UserData contains grid constants, parallel machine parameters, work array. */ diff --git a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c index 3407267c70..a4bb4bef9a 100644 --- a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c +++ b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c @@ -66,22 +66,22 @@ /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundaries */ -#define YMAX RCONST(1.0) +#define XMAX SUN_RCONST(2.0) /* domain boundaries */ +#define YMAX SUN_RCONST(1.0) #define MX 10 /* mesh dimensions */ #define MY 5 #define NEQ MX*MY /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) /* User-defined vector access macro IJth */ diff --git a/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c index f5621c5d56..4918ba26d9 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c @@ -62,21 +62,21 @@ /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 20 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(2.5) /* output time increment */ +#define ATOL SUN_RCONST(1.e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(2.5) /* output time increment */ /* Adjoint Problem Constants */ #define NP 2 /* number of parameters */ #define STEPS 200 /* steps between check points */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Type : UserData */ @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) data = (UserData) malloc(sizeof *data); if (check_retval((void *)data , "malloc", 2, my_pe)) MPI_Abort(comm, 1); data->p[0] = ONE; - data->p[1] = RCONST(0.5); + data->p[1] = SUN_RCONST(0.5); dx = data->dx = XMAX/((sunrealtype)(MX+1)); data->hdcoef = data->p[0]/(dx*dx); data->hacoef = data->p[1]/(TWO*dx); @@ -587,7 +587,7 @@ static sunrealtype Xintgr(sunrealtype *z, sunindextype l, sunrealtype dx) sunrealtype my_intgr; sunindextype i; - my_intgr = RCONST(0.5)*(z[0] + z[l-1]); + my_intgr = SUN_RCONST(0.5)*(z[0] + z[l-1]); for (i = 1; i < l-1; i++) my_intgr += z[i]; my_intgr *= dx; diff --git a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c index ff229e148d..791e2e437e 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c @@ -68,19 +68,19 @@ #include /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define ATOL SUN_RCONST(1.e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ #define NP 2 #define NS 2 -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData contains problem parameters, grid constants, work array. */ @@ -174,8 +174,8 @@ int main(int argc, char *argv[]) data->p = (sunrealtype *) malloc(NP * sizeof(sunrealtype)); if(check_retval((void *)data->p, "malloc", 2, my_pe)) MPI_Abort(comm, 1); dx = data->dx = XMAX/((sunrealtype)(MX+1)); - data->p[0] = RCONST(1.0); - data->p[1] = RCONST(0.5); + data->p[0] = SUN_RCONST(1.0); + data->p[1] = SUN_RCONST(0.5); /* INITIAL STATES */ u = N_VNew_Parallel(comm, local_N, NEQ, sunctx); /* Allocate u vector */ @@ -353,7 +353,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) data = (UserData) user_data; dx = data->dx; hordc = data->p[0]/(dx*dx); - horac = data->p[1]/(RCONST(2.0)*dx); + horac = data->p[1]/(SUN_RCONST(2.0)*dx); /* Extract parameters for parallel computation. */ comm = data->comm; @@ -395,7 +395,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) urt = z[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); dudata[i-1] = hdiff + hadv; } diff --git a/examples/cvodes/parallel/cvsAdvDiff_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_non_p.c index cbfeddf4f2..94218000bd 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_non_p.c @@ -49,15 +49,15 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.0e-5) /* scalar absolute tolerance */ +#define ATOL SUN_RCONST(1.0e-5) /* scalar absolute tolerance */ #define T0 ZERO /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ /* Type : UserData @@ -140,8 +140,8 @@ int main(int argc, char *argv[]) abstol = ATOL; dx = data->dx = XMAX/((sunrealtype)(MX+1)); /* Set grid coefficients in data */ - data->hdcoef = RCONST(1.0)/(dx*dx); - data->hacoef = RCONST(0.5)/(RCONST(2.0)*dx); + data->hdcoef = SUN_RCONST(1.0)/(dx*dx); + data->hacoef = SUN_RCONST(0.5)/(SUN_RCONST(2.0)*dx); SetIC(u, dx, local_N, my_base); /* Initialize u vector */ @@ -226,7 +226,7 @@ static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, for (i=1; i<=my_length; i++) { iglobal = my_base + i; x = iglobal*dx; - udata[i-1] = x*(XMAX - x)*exp(RCONST(2.0)*x); + udata[i-1] = x*(XMAX - x)*exp(SUN_RCONST(2.0)*x); } } @@ -341,7 +341,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) urt = z[i+1]; /* Set diffusion and advection terms and load into udot */ - hdiff = hordc*(ult - RCONST(2.0)*ui + urt); + hdiff = hordc*(ult - SUN_RCONST(2.0)*ui + urt); hadv = horac*(urt - ult); dudata[i-1] = hdiff + hadv; } diff --git a/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c b/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c index 5813d784d3..abbf8fd75e 100644 --- a/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c +++ b/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c @@ -45,76 +45,76 @@ /* Domain definition */ -#define XMIN RCONST(0.0) -#define XMAX RCONST(20.0) +#define XMIN SUN_RCONST(0.0) +#define XMAX SUN_RCONST(20.0) #define MX 80 /* no. of divisions in x dir. */ #define NPX 2 /* no. of procs. in x dir. */ -#define YMIN RCONST(0.0) -#define YMAX RCONST(20.0) +#define YMIN SUN_RCONST(0.0) +#define YMAX SUN_RCONST(20.0) #define MY 80 /* no. of divisions in y dir. */ #define NPY 2 /* no. of procs. in y dir. */ #ifdef USE3D -#define ZMIN RCONST(0.0) -#define ZMAX RCONST(20.0) +#define ZMIN SUN_RCONST(0.0) +#define ZMAX SUN_RCONST(20.0) #define MZ 40 /* no. of divisions in z dir. */ #define NPZ 2 /* no. of procs. in z dir. */ #endif /* Parameters for source Gaussians */ -#define G1_AMPL RCONST(1.0) -#define G1_SIGMA RCONST(1.7) -#define G1_X RCONST(4.0) -#define G1_Y RCONST(8.0) +#define G1_AMPL SUN_RCONST(1.0) +#define G1_SIGMA SUN_RCONST(1.7) +#define G1_X SUN_RCONST(4.0) +#define G1_Y SUN_RCONST(8.0) #ifdef USE3D -#define G1_Z RCONST(8.0) +#define G1_Z SUN_RCONST(8.0) #endif -#define G2_AMPL RCONST(0.8) -#define G2_SIGMA RCONST(3.0) -#define G2_X RCONST(16.0) -#define G2_Y RCONST(12.0) +#define G2_AMPL SUN_RCONST(0.8) +#define G2_SIGMA SUN_RCONST(3.0) +#define G2_X SUN_RCONST(16.0) +#define G2_Y SUN_RCONST(12.0) #ifdef USE3D -#define G2_Z RCONST(12.0) +#define G2_Z SUN_RCONST(12.0) #endif -#define G_MIN RCONST(1.0e-5) +#define G_MIN SUN_RCONST(1.0e-5) /* Diffusion coeff., max. velocity, domain width in y dir. */ -#define DIFF_COEF RCONST(1.0) -#define V_MAX RCONST(1.0) -#define L ((YMAX-YMIN)/RCONST(2.0)) +#define DIFF_COEF SUN_RCONST(1.0) +#define V_MAX SUN_RCONST(1.0) +#define L ((YMAX-YMIN)/SUN_RCONST(2.0)) #define V_COEFF V_MAX/L/L /* Initial and final times */ -#define ti RCONST(0.0) -#define tf RCONST(10.0) +#define ti SUN_RCONST(0.0) +#define tf SUN_RCONST(10.0) /* Integration tolerances */ -#define RTOL RCONST(1.0e-8) /* states */ -#define ATOL RCONST(1.0e-6) +#define RTOL SUN_RCONST(1.0e-8) /* states */ +#define ATOL SUN_RCONST(1.0e-6) -#define RTOL_Q RCONST(1.0e-8) /* forward quadrature */ -#define ATOL_Q RCONST(1.0e-6) +#define RTOL_Q SUN_RCONST(1.0e-8) /* forward quadrature */ +#define ATOL_Q SUN_RCONST(1.0e-6) -#define RTOL_B RCONST(1.0e-8) /* adjoint variables */ -#define ATOL_B RCONST(1.0e-6) +#define RTOL_B SUN_RCONST(1.0e-8) /* adjoint variables */ +#define ATOL_B SUN_RCONST(1.0e-6) -#define RTOL_QB RCONST(1.0e-8) /* backward quadratures */ -#define ATOL_QB RCONST(1.0e-6) +#define RTOL_QB SUN_RCONST(1.0e-8) /* backward quadratures */ +#define ATOL_QB SUN_RCONST(1.0e-6) /* Steps between check points */ #define STEPS 200 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* *------------------------------------------------------------------ @@ -879,7 +879,7 @@ static int fQ(sunrealtype t, N_Vector y, N_Vector qdot, void *user_data) dqdata = N_VGetArrayPointer(qdot); dqdata[0] = N_VDotProd(y,y); - dqdata[0] *= RCONST(0.5) * (d->dOmega); + dqdata[0] *= SUN_RCONST(0.5) * (d->dOmega); return(0); } diff --git a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c index fc3a751473..09efed1702 100644 --- a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c @@ -94,19 +94,19 @@ /* Problem Constants */ #define NVARS 2 /* number of species */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) -#define T0 RCONST(0.0) /* initial time */ +#define T0 SUN_RCONST(0.0) /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ -#define XMIN RCONST(0.0) /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMIN SUN_RCONST(0.0) /* grid boundaries in x */ +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -120,8 +120,8 @@ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tols. */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tols. */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -129,7 +129,7 @@ #define NP 8 /* number of problem parameters */ #define NS 2 /* number of sensitivities */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* User-defined matrix accessor macro: IJth */ @@ -477,11 +477,11 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, computed on the last f call). Load into P. */ for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); - diag = -(cydn + cyup + RCONST(2.0)*hordco); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); + diag = -(cydn + cyup + SUN_RCONST(2.0)*hordco); for (lx = 0; lx < MXSUB; lx++) { offset = lx*NVARS + ly*nvmxsub; c1 = udata[offset]; @@ -539,7 +539,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, /* Solve the block-diagonal system Px = r using LU factors stored in P and pivot data in pivot, and return the solution in z. First copy vector r to z. */ - N_VScale(RCONST(1.0), r, z); + N_VScale(SUN_RCONST(1.0), r, z); nvmxsub = data->nvmxsub; zdata = N_VGetArrayPointer(z); @@ -627,22 +627,22 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) sunrealtype KH, VEL, KV0; /* Set problem parameters */ - data->p[0] = RCONST(1.63e-16); /* Q1 coeffs. q1, q2, c3 */ - data->p[1] = RCONST(4.66e-16); /* Q2 */ - data->p[2] = RCONST(3.7e16); /* C3 */ - data->p[3] = RCONST(22.62); /* A3 coeff. in expression for q3(t) */ - data->p[4] = RCONST(7.601); /* A4 coeff. in expression for q4(t) */ - KH = data->p[5] = RCONST(4.0e-6); /* KH horizontal diffusivity Kh */ - VEL = data->p[6] = RCONST(0.001); /* VEL advection velocity V */ - KV0 = data->p[7] = RCONST(1.0e-8); /* KV0 coeff. in Kv(z) */ + data->p[0] = SUN_RCONST(1.63e-16); /* Q1 coeffs. q1, q2, c3 */ + data->p[1] = SUN_RCONST(4.66e-16); /* Q2 */ + data->p[2] = SUN_RCONST(3.7e16); /* C3 */ + data->p[3] = SUN_RCONST(22.62); /* A3 coeff. in expression for q3(t) */ + data->p[4] = SUN_RCONST(7.601); /* A4 coeff. in expression for q4(t) */ + KH = data->p[5] = SUN_RCONST(4.0e-6); /* KH horizontal diffusivity Kh */ + VEL = data->p[6] = SUN_RCONST(0.001); /* VEL advection velocity V */ + KV0 = data->p[7] = SUN_RCONST(1.0e-8); /* KV0 coeff. in Kv(z) */ /* Set problem constants */ data->om = PI/HALFDAY; data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -711,18 +711,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) Here lx and ly are local mesh point indices on the local subgrid, and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); udata[offset ] = C1_SCALE*cx*cy; udata[offset+1] = C2_SCALE*cx*cy; offset = offset + 2; @@ -1002,8 +1002,8 @@ static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], User /* Set vertical diffusion coefficients at jy +- 1/2 */ ydn = YMIN + (jy - .5)*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -1014,7 +1014,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], User qq2 = Q2*c1*c2; qq3 = q3*C3; qq4 = q4coef*c2; - rkin1 = -qq1 - qq2 + RCONST(2.0)*qq3 + qq4; + rkin1 = -qq1 - qq2 + SUN_RCONST(2.0)*qq3 + qq4; rkin2 = qq1 - qq2 - qq4; /* Set vertical diffusion terms */ diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c index ab26a348e1..f550431ffa 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c @@ -79,30 +79,30 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -115,8 +115,8 @@ /* Spatial mesh is MX by MY */ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -336,8 +336,8 @@ static void InitUserData(int my_pe, sunindextype local_N, MPI_Comm comm, data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -377,18 +377,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); uarray[offset ] = C1_SCALE*cx*cy; uarray[offset+1] = C2_SCALE*cx*cy; offset = offset + 2; @@ -831,10 +831,10 @@ static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -864,8 +864,8 @@ static int flocal(sunindextype Nlocal, sunrealtype t, N_Vector u, c2lt = uext[offsetue-1]; c1rt = uext[offsetue+2]; c2rt = uext[offsetue+3]; - hord1 = hordco*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = hordco*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = hordco*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = hordco*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = horaco*(c1rt - c1lt); horad2 = horaco*(c2rt - c2lt); diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_p.c index 1623001f4f..c1c7e4f04f 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_p.c @@ -67,27 +67,27 @@ /* Problem Constants */ #define NVARS 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) - -#define T0 RCONST(0.0) /* initial time */ +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) + +#define T0 SUN_RCONST(0.0) /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ -#define XMIN RCONST(0.0) /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) +#define XMIN SUN_RCONST(0.0) /* grid boundaries in x */ +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) #define NPEX 2 /* no. PEs in x direction of PE array */ #define NPEY 2 /* no. PEs in y direction of PE array */ @@ -100,8 +100,8 @@ /* Spatial mesh is MX by MY */ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ @@ -309,8 +309,8 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) data->dx = (XMAX-XMIN)/((sunrealtype)(MX-1)); data->dy = (YMAX-YMIN)/((sunrealtype)(MY-1)); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); - data->vdco = (RCONST(1.0)/SQR(data->dy))*KV0; + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); + data->vdco = (SUN_RCONST(1.0)/SQR(data->dy))*KV0; /* Set machine-related constants */ data->comm = comm; @@ -373,18 +373,18 @@ static void SetInitialProfiles(N_Vector u, UserData data) Here lx and ly are local mesh point indices on the local subgrid, and jx and jy are the global mesh point indices. */ offset = 0; - xmid = RCONST(0.5)*(XMIN + XMAX); - ymid = RCONST(0.5)*(YMIN + YMAX); + xmid = SUN_RCONST(0.5)*(XMIN + XMAX); + ymid = SUN_RCONST(0.5)*(YMIN + YMAX); for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - ymid)); - cy = RCONST(1.0) - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - ymid)); + cy = SUN_RCONST(1.0) - cy + SUN_RCONST(0.5)*SQR(cy); for (lx = 0; lx < MXSUB; lx++) { jx = lx + isubx*MXSUB; x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - xmid)); - cx = RCONST(1.0) - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - xmid)); + cx = SUN_RCONST(1.0) - cx + SUN_RCONST(0.5)*SQR(cx); udata[offset ] = C1_SCALE*cx*cy; udata[offset+1] = C2_SCALE*cx*cy; offset = offset + 2; @@ -741,12 +741,12 @@ static void fcalc(sunrealtype t, sunrealtype udata[], /* Set diurnal rate coefficients as functions of t, and save q4 in data block for use by preconditioner evaluation routine */ s = sin((data->om)*t); - if (s > RCONST(0.0)) { + if (s > SUN_RCONST(0.0)) { q3 = exp(-A3/s); q4coef = exp(-A4/s); } else { - q3 = RCONST(0.0); - q4coef = RCONST(0.0); + q3 = SUN_RCONST(0.0); + q4coef = SUN_RCONST(0.0); } data->q4 = q4coef; @@ -756,10 +756,10 @@ static void fcalc(sunrealtype t, sunrealtype udata[], jy = ly + isuby*MYSUB; /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); for (lx = 0; lx < MXSUB; lx++) { /* Extract c1 and c2, and set kinetic rate terms */ @@ -770,7 +770,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], qq2 = Q2*c1*c2; qq3 = q3*C3; qq4 = q4coef*c2; - rkin1 = -qq1 - qq2 + RCONST(2.0)*qq3 + qq4; + rkin1 = -qq1 - qq2 + SUN_RCONST(2.0)*qq3 + qq4; rkin2 = qq1 - qq2 - qq4; /* Set vertical diffusion terms */ @@ -786,8 +786,8 @@ static void fcalc(sunrealtype t, sunrealtype udata[], c2lt = uext[offsetue-1]; c1rt = uext[offsetue+2]; c2rt = uext[offsetue+3]; - hord1 = hordco*(c1rt - RCONST(2.0)*c1 + c1lt); - hord2 = hordco*(c2rt - RCONST(2.0)*c2 + c2lt); + hord1 = hordco*(c1rt - SUN_RCONST(2.0)*c1 + c1lt); + hord2 = hordco*(c2rt - SUN_RCONST(2.0)*c2 + c2lt); horad1 = horaco*(c1rt - c1lt); horad2 = horaco*(c2rt - c2lt); @@ -871,11 +871,11 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, computed on the last f call). Load into P. */ for (ly = 0; ly < MYSUB; ly++) { jy = ly + isuby*MYSUB; - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); - diag = -(cydn + cyup + RCONST(2.0)*hordco); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); + diag = -(cydn + cyup + SUN_RCONST(2.0)*hordco); for (lx = 0; lx < MXSUB; lx++) { offset = lx*NVARS + ly*nvmxsub; c1 = udata[offset]; @@ -931,7 +931,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, /* Solve the block-diagonal system Px = r using LU factors stored in P and pivot data in pivot, and return the solution in z. First copy vector r to z. */ - N_VScale(RCONST(1.0), r, z); + N_VScale(SUN_RCONST(1.0), r, z); nvmxsub = data->nvmxsub; zdata = N_VGetArrayPointer(z); diff --git a/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c b/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c index 6673d6075b..0efcaabd46 100644 --- a/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c +++ b/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c @@ -60,23 +60,23 @@ /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundaries */ -#define YMAX RCONST(1.0) +#define XMAX SUN_RCONST(2.0) /* domain boundaries */ +#define YMAX SUN_RCONST(1.0) #define MX 40 /* mesh dimensions */ #define MY 20 #define NEQ MX*MY /* number of equations */ -#define ATOL RCONST(1.e-5) -#define RTOLB RCONST(1.e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.1) /* first output time */ -#define DTOUT RCONST(0.1) /* output time increment */ +#define ATOL SUN_RCONST(1.e-5) +#define RTOLB SUN_RCONST(1.e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.1) /* first output time */ +#define DTOUT SUN_RCONST(0.1) /* output time increment */ #define NOUT 10 /* number of output times */ -#define TOUT RCONST(1.0) /* final time */ +#define TOUT SUN_RCONST(1.0) /* final time */ #define NSTEP 50 /* check point saved every NSTEP */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* User-defined vector access macro IJth */ @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) dx = data->dx = XMAX/(MX+1); dy = data->dy = YMAX/(MY+1); data->hdcoef = ONE/(dx*dx); - data->hacoef = RCONST(1.5)/(TWO*dx); + data->hacoef = SUN_RCONST(1.5)/(TWO*dx); data->vdcoef = ONE/(dy*dy); /* Set the tolerances for the forward integration */ @@ -498,7 +498,7 @@ static void SetIC(N_Vector u, UserData data) y = j*dy; for (i=1; i <= MX; i++) { x = i*dx; - IJth(udata,i,j) = x*(XMAX - x)*y*(YMAX - y)*SUNRexp(RCONST(5.0)*x*y); + IJth(udata,i,j) = x*(XMAX - x)*y*(YMAX - y)*SUNRexp(SUN_RCONST(5.0)*x*y); } } diff --git a/examples/cvodes/serial/cvsAdvDiff_FSA_non.c b/examples/cvodes/serial/cvsAdvDiff_FSA_non.c index f82c30dfaa..826a9c31ac 100644 --- a/examples/cvodes/serial/cvsAdvDiff_FSA_non.c +++ b/examples/cvodes/serial/cvsAdvDiff_FSA_non.c @@ -60,19 +60,19 @@ #include "sunnonlinsol/sunnonlinsol_fixedpoint.h" /* access to the fixed point SUNNonlinearSolver */ /* Problem Constants */ -#define XMAX RCONST(2.0) /* domain boundary */ +#define XMAX SUN_RCONST(2.0) /* domain boundary */ #define MX 10 /* mesh dimension */ #define NEQ MX /* number of equations */ -#define ATOL RCONST(1.e-5) /* scalar absolute tolerance */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.5) /* first output time */ -#define DTOUT RCONST(0.5) /* output time increment */ +#define ATOL SUN_RCONST(1.e-5) /* scalar absolute tolerance */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.5) /* first output time */ +#define DTOUT SUN_RCONST(0.5) /* output time increment */ #define NOUT 10 /* number of output times */ #define NP 2 #define NS 2 -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData contains problem parameters, grid constants, work array. */ @@ -144,8 +144,8 @@ int main(int argc, char *argv[]) if(check_retval((void *)data, "malloc", 2)) return(1); data->p = (sunrealtype *) malloc(NP * sizeof(sunrealtype)); dx = data->dx = XMAX/((sunrealtype)(MX+1)); - data->p[0] = RCONST(1.0); - data->p[1] = RCONST(0.5); + data->p[0] = SUN_RCONST(1.0); + data->p[1] = SUN_RCONST(0.5); /* Allocate and set initial states */ u = N_VNew_Serial(NEQ, sunctx); @@ -308,7 +308,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) data = (UserData) user_data; dx = data->dx; hordc = data->p[0]/(dx*dx); - horac = data->p[1]/(RCONST(2.0)*dx); + horac = data->p[1]/(SUN_RCONST(2.0)*dx); /* Loop over all grid points. */ for (i=0; iom = PI/HALFDAY; data->dx = (XMAX-XMIN)/(MX-1); data->dz = (ZMAX-ZMIN)/(MZ-1); data->hdco = KH/SQR(data->dx); - data->haco = VEL/(RCONST(2.0)*data->dx); + data->haco = VEL/(SUN_RCONST(2.0)*data->dx); data->vdco = (ONE/SQR(data->dz))*KV0; data->p[0] = Q1; @@ -735,12 +735,12 @@ static void SetInitialProfiles(N_Vector y, sunrealtype dx, sunrealtype dz) for (jz=0; jz < MZ; jz++) { z = ZMIN + jz*dz; - cz = SQR(RCONST(0.1)*(z - ZMID)); - cz = ONE - cz + RCONST(0.5)*SQR(cz); + cz = SQR(SUN_RCONST(0.1)*(z - ZMID)); + cz = ONE - cz + SUN_RCONST(0.5)*SQR(cz); for (jx=0; jx < MX; jx++) { x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - XMID)); - cx = ONE - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - XMID)); + cx = ONE - cx + SUN_RCONST(0.5)*SQR(cx); IJKth(ydata,1,jx,jz) = C1_SCALE*cx*cz; IJKth(ydata,2,jx,jz) = C2_SCALE*cx*cz; } diff --git a/examples/cvodes/serial/cvsDiurnal_kry.c b/examples/cvodes/serial/cvsDiurnal_kry.c index abd4f01023..2d3c6dba17 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry.c +++ b/examples/cvodes/serial/cvsDiurnal_kry.c @@ -55,34 +55,34 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NUM_SPECIES 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) -#define XMID RCONST(10.0) /* grid midpoints in x,y */ -#define YMID RCONST(40.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) +#define XMID SUN_RCONST(10.0) /* grid midpoints in x,y */ +#define YMID SUN_RCONST(40.0) #define MX 10 /* MX = number of x mesh points */ #define MY 10 /* MY = number of y mesh points */ @@ -91,8 +91,8 @@ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ #define NEQ (NUM_SPECIES*MM) /* NEQ = number of equations */ @@ -320,12 +320,12 @@ static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) for (jy=0; jy < MY; jy++) { y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - YMID)); - cy = ONE - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - YMID)); + cy = ONE - cy + SUN_RCONST(0.5)*SQR(cy); for (jx=0; jx < MX; jx++) { x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - XMID)); - cx = ONE - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - XMID)); + cx = ONE - cx + SUN_RCONST(0.5)*SQR(cx); IJKth(udata,1,jx,jy) = C1_SCALE*cx*cy; IJKth(udata,2,jx,jy) = C2_SCALE*cx*cy; } @@ -505,10 +505,10 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; for (jx=0; jx < MX; jx++) { @@ -602,11 +602,11 @@ static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; @@ -741,10 +741,10 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, computed on the last f call). Load into P. */ for (jy=0; jy < MY; jy++) { - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); diag = -(cydn + cyup + TWO*hordco); for (jx=0; jx < MX; jx++) { c1 = IJKth(udata,1,jx,jy); diff --git a/examples/cvodes/serial/cvsDiurnal_kry_bp.c b/examples/cvodes/serial/cvsDiurnal_kry_bp.c index 31cfc4e9f9..0a82e88e09 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry_bp.c +++ b/examples/cvodes/serial/cvsDiurnal_kry_bp.c @@ -55,34 +55,34 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NUM_SPECIES 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) -#define XMID RCONST(10.0) /* grid midpoints in x,y */ -#define YMID RCONST(40.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) +#define XMID SUN_RCONST(10.0) /* grid midpoints in x,y */ +#define YMID SUN_RCONST(40.0) #define MX 10 /* MX = number of x mesh points */ #define MY 10 /* MY = number of y mesh points */ @@ -91,8 +91,8 @@ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ #define NEQ (NUM_SPECIES*MM) /* NEQ = number of equations */ @@ -301,12 +301,12 @@ static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) for (jy = 0; jy < MY; jy++) { y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - YMID)); - cy = ONE - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - YMID)); + cy = ONE - cy + SUN_RCONST(0.5)*SQR(cy); for (jx = 0; jx < MX; jx++) { x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - XMID)); - cx = ONE - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - XMID)); + cx = ONE - cx + SUN_RCONST(0.5)*SQR(cx); IJKth(udata,1,jx,jy) = C1_SCALE*cx*cy; IJKth(udata,2,jx,jy) = C2_SCALE*cx*cy; } @@ -505,10 +505,10 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot,void *user_data) /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; for (jx = 0; jx < MX; jx++) { diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c index 95bf038125..8ca5b36fed 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c @@ -109,18 +109,18 @@ /* Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Problem Specification Constants */ #define AA ONE /* AA = a */ -#define EE RCONST(1.0e4) /* EE = e */ -#define GG RCONST(0.5e-6) /* GG = g */ +#define EE SUN_RCONST(1.0e4) /* EE = e */ +#define GG SUN_RCONST(0.5e-6) /* GG = g */ #define BB ONE /* BB = b */ #define DPREY ONE -#define DPRED RCONST(0.5) +#define DPRED SUN_RCONST(0.5) #define ALPH ONE #define NP 3 #define NS (2*NP) @@ -146,12 +146,12 @@ #define NEQ (NS*MX*MY) #define T0 ZERO -#define RTOL RCONST(1.0e-5) -#define ATOL RCONST(1.0e-5) +#define RTOL SUN_RCONST(1.0e-5) +#define ATOL SUN_RCONST(1.0e-5) /* Output Constants */ -#define TOUT RCONST(10.0) +#define TOUT SUN_RCONST(10.0) /* Note: The value for species i at mesh point (j,k) is stored in */ /* component number (i-1) + j*NS + k*NS*MX of an N_Vector, */ @@ -499,7 +499,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, cdata = N_VGetArrayPointer(c); rewtdata = N_VGetArrayPointer(rewt); - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; P = wdata->P; pivot = wdata->pivot; @@ -520,7 +520,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, f1 = N_VGetArrayPointer(wdata->vtemp); fac = N_VWrmsNorm (fc, rewt); - r0 = RCONST(1000.0)*fabs(gamma)*uround*(NEQ+1)*fac; + r0 = SUN_RCONST(1000.0)*fabs(gamma)*uround*(NEQ+1)*fac; if (r0 == ZERO) r0 = ONE; for (igy = 0; igy < ngy; igy++) { @@ -713,7 +713,7 @@ static int PrecondB(sunrealtype t, N_Vector c, cdata = N_VGetArrayPointer(c); rewtdata = N_VGetArrayPointer(rewt); - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; P = wdata->P; pivot = wdata->pivot; @@ -733,7 +733,7 @@ static int PrecondB(sunrealtype t, N_Vector c, f1 = N_VGetArrayPointer(wdata->vtempB); fac = N_VWrmsNorm (fcB, rewt); - r0 = RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; + r0 = SUN_RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; if (r0 == ZERO) r0 = ONE; for (igy = 0; igy < ngy; igy++) { @@ -896,7 +896,7 @@ static void InitUserData(WebData wdata) wdata->mq = MQ; wdata->mx = MX; wdata->my = MY; - wdata->srur = sqrt(UNIT_ROUNDOFF); + wdata->srur = sqrt(SUN_UNIT_ROUNDOFF); wdata->mxmp = MXMP; wdata->ngrp = NGRP; wdata->ngx = NGX; @@ -949,8 +949,8 @@ static void CInit(N_Vector c, WebData wdata) dx = wdata->dx; dy = wdata->dy; - x_factor = RCONST(4.0)/SQR(AX); - y_factor = RCONST(4.0)/SQR(AY); + x_factor = SUN_RCONST(4.0)/SQR(AX); + y_factor = SUN_RCONST(4.0)/SQR(AY); for (jy = 0; jy < MY; jy++) { y = jy*dy; argy = SQR(y_factor*y*(AY-y)); @@ -961,7 +961,7 @@ static void CInit(N_Vector c, WebData wdata) ioff = iyoff + ns*jx; for (i = 1; i <= ns; i++) { ici = ioff + i-1; - cdata[ici] = RCONST(10.0) + i*argx*argy; + cdata[ici] = SUN_RCONST(10.0) + i*argx*argy; /*if(i==1) cdata[ici] += ONE;*/ @@ -1318,7 +1318,7 @@ static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) intgr_x += TWO*cdata[(i-1) + jx*ns + jy*mxns]; } intgr_x += cdata[(i-1)+(mx-1)*ns+jy*mxns]; - intgr_x *= RCONST(0.5)*dx; + intgr_x *= SUN_RCONST(0.5)*dx; intgr_xy = intgr_x; @@ -1329,7 +1329,7 @@ static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) intgr_x += TWO*cdata[(i-1) + jx*ns + jy*mxns]; } intgr_x += cdata[(i-1)+(mx-1)*ns+jy*mxns]; - intgr_x *= RCONST(0.5)*dx; + intgr_x *= SUN_RCONST(0.5)*dx; intgr_xy += TWO*intgr_x; @@ -1341,11 +1341,11 @@ static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) intgr_x += TWO*cdata[(i-1) + jx*ns + jy*mxns]; } intgr_x += cdata[(i-1)+(mx-1)*ns+jy*mxns]; - intgr_x *= RCONST(0.5)*dx; + intgr_x *= SUN_RCONST(0.5)*dx; intgr_xy += intgr_x; - intgr_xy *= RCONST(0.5)*dy; + intgr_xy *= SUN_RCONST(0.5)*dy; return(intgr_xy); } diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c index 1b3e3898c3..3f695b1bba 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c @@ -102,18 +102,18 @@ /* Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Problem Specification Constants */ #define AA ONE /* AA = a */ -#define EE RCONST(1.0e4) /* EE = e */ -#define GG RCONST(0.5e-6) /* GG = g */ +#define EE SUN_RCONST(1.0e4) /* EE = e */ +#define GG SUN_RCONST(0.5e-6) /* GG = g */ #define BB ONE /* BB = b */ #define DPREY ONE -#define DPRED RCONST(0.5) +#define DPRED SUN_RCONST(0.5) #define ALPH ONE #define NP 3 #define NS (2*NP) @@ -139,12 +139,12 @@ #define NEQ (NS*MX*MY) #define T0 ZERO -#define RTOL RCONST(1.0e-5) -#define ATOL RCONST(1.0e-5) +#define RTOL SUN_RCONST(1.0e-5) +#define ATOL SUN_RCONST(1.0e-5) /* Output Constants */ -#define TOUT RCONST(10.0) +#define TOUT SUN_RCONST(10.0) /* Note: The value for species i at mesh point (j,k) is stored in */ /* component number (i-1) + j*NS + k*NS*MX of an N_Vector, */ @@ -486,7 +486,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, cdata = N_VGetArrayPointer(c); rewtdata = N_VGetArrayPointer(rewt); - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; P = wdata->P; pivot = wdata->pivot; @@ -507,7 +507,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, f1 = N_VGetArrayPointer(wdata->vtemp); fac = N_VWrmsNorm (fc, rewt); - r0 = RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; + r0 = SUN_RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; if (r0 == ZERO) r0 = ONE; for (igy = 0; igy < ngy; igy++) { @@ -691,7 +691,7 @@ static int PrecondB(sunrealtype t, N_Vector c, cdata = N_VGetArrayPointer(c); rewtdata = N_VGetArrayPointer(rewt); - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; P = wdata->P; pivot = wdata->pivot; @@ -711,7 +711,7 @@ static int PrecondB(sunrealtype t, N_Vector c, f1 = N_VGetArrayPointer(wdata->vtemp); fac = N_VWrmsNorm (fcB, rewt); - r0 = RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; + r0 = SUN_RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; if (r0 == ZERO) r0 = ONE; for (igy = 0; igy < ngy; igy++) { @@ -872,7 +872,7 @@ static void InitUserData(WebData wdata) wdata->mq = MQ; wdata->mx = MX; wdata->my = MY; - wdata->srur = sqrt(UNIT_ROUNDOFF); + wdata->srur = sqrt(SUN_UNIT_ROUNDOFF); wdata->mxmp = MXMP; wdata->ngrp = NGRP; wdata->ngx = NGX; @@ -925,8 +925,8 @@ static void CInit(N_Vector c, WebData wdata) dx = wdata->dx; dy = wdata->dy; - x_factor = RCONST(4.0)/SQR(AX); - y_factor = RCONST(4.0)/SQR(AY); + x_factor = SUN_RCONST(4.0)/SQR(AX); + y_factor = SUN_RCONST(4.0)/SQR(AY); for (jy = 0; jy < MY; jy++) { y = jy*dy; argy = SQR(y_factor*y*(AY-y)); @@ -937,7 +937,7 @@ static void CInit(N_Vector c, WebData wdata) ioff = iyoff + ns*jx; for (i = 1; i <= ns; i++) { ici = ioff + i-1; - cdata[ici] = RCONST(10.0) + i*argx*argy; + cdata[ici] = SUN_RCONST(10.0) + i*argx*argy; } } } @@ -1318,7 +1318,7 @@ static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) intgr_x += TWO*cdata[(i-1) + jx*ns + jy*mxns]; } intgr_x += cdata[(i-1)+(mx-1)*ns+jy*mxns]; - intgr_x *= RCONST(0.5)*dx; + intgr_x *= SUN_RCONST(0.5)*dx; intgr_xy = intgr_x; @@ -1329,7 +1329,7 @@ static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) intgr_x += TWO*cdata[(i-1) + jx*ns + jy*mxns]; } intgr_x += cdata[(i-1)+(mx-1)*ns+jy*mxns]; - intgr_x *= RCONST(0.5)*dx; + intgr_x *= SUN_RCONST(0.5)*dx; intgr_xy += TWO*intgr_x; @@ -1341,11 +1341,11 @@ static sunrealtype doubleIntgr(N_Vector c, int i, WebData wdata) intgr_x += TWO*cdata[(i-1) + jx*ns + jy*mxns]; } intgr_x += cdata[(i-1)+(mx-1)*ns+jy*mxns]; - intgr_x *= RCONST(0.5)*dx; + intgr_x *= SUN_RCONST(0.5)*dx; intgr_xy += intgr_x; - intgr_xy *= RCONST(0.5)*dy; + intgr_xy *= SUN_RCONST(0.5)*dy; return(intgr_xy); } diff --git a/examples/cvodes/serial/cvsHessian_ASA_FSA.c b/examples/cvodes/serial/cvsHessian_ASA_FSA.c index f99b62aad4..3d6db9f490 100644 --- a/examples/cvodes/serial/cvsHessian_ASA_FSA.c +++ b/examples/cvodes/serial/cvsHessian_ASA_FSA.c @@ -44,8 +44,8 @@ #define Ith(v,i) NV_Ith_S(v,i-1) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) typedef struct { sunrealtype p1, p2; @@ -132,8 +132,8 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); - data->p1 = RCONST(1.0); - data->p2 = RCONST(2.0); + data->p1 = SUN_RCONST(1.0); + data->p2 = SUN_RCONST(2.0); /* Problem size, integration interval, and tolerances */ @@ -437,7 +437,7 @@ int main(int argc, char *argv[]) /* Finite difference tests */ - dp = RCONST(1.0e-2); + dp = SUN_RCONST(1.0e-2); printf("-----------------------\n"); printf("Finite Difference tests\n"); diff --git a/examples/cvodes/serial/cvsKrylovDemo_ls.c b/examples/cvodes/serial/cvsKrylovDemo_ls.c index f0297ff11c..85e5ad2a71 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_ls.c +++ b/examples/cvodes/serial/cvsKrylovDemo_ls.c @@ -72,34 +72,34 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NUM_SPECIES 2 /* number of species */ -#define KH RCONST(4.0e-6) /* horizontal diffusivity Kh */ -#define VEL RCONST(0.001) /* advection velocity V */ -#define KV0 RCONST(1.0e-8) /* coefficient in Kv(y) */ -#define Q1 RCONST(1.63e-16) /* coefficients q1, q2, c3 */ -#define Q2 RCONST(4.66e-16) -#define C3 RCONST(3.7e16) -#define A3 RCONST(22.62) /* coefficient in expression for q3(t) */ -#define A4 RCONST(7.601) /* coefficient in expression for q4(t) */ -#define C1_SCALE RCONST(1.0e6) /* coefficients in initial profiles */ -#define C2_SCALE RCONST(1.0e12) +#define KH SUN_RCONST(4.0e-6) /* horizontal diffusivity Kh */ +#define VEL SUN_RCONST(0.001) /* advection velocity V */ +#define KV0 SUN_RCONST(1.0e-8) /* coefficient in Kv(y) */ +#define Q1 SUN_RCONST(1.63e-16) /* coefficients q1, q2, c3 */ +#define Q2 SUN_RCONST(4.66e-16) +#define C3 SUN_RCONST(3.7e16) +#define A3 SUN_RCONST(22.62) /* coefficient in expression for q3(t) */ +#define A4 SUN_RCONST(7.601) /* coefficient in expression for q4(t) */ +#define C1_SCALE SUN_RCONST(1.0e6) /* coefficients in initial profiles */ +#define C2_SCALE SUN_RCONST(1.0e12) #define T0 ZERO /* initial time */ #define NOUT 12 /* number of output times */ -#define TWOHR RCONST(7200.0) /* number of seconds in two hours */ -#define HALFDAY RCONST(4.32e4) /* number of seconds in a half day */ -#define PI RCONST(3.1415926535898) /* pi */ +#define TWOHR SUN_RCONST(7200.0) /* number of seconds in two hours */ +#define HALFDAY SUN_RCONST(4.32e4) /* number of seconds in a half day */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define XMIN ZERO /* grid boundaries in x */ -#define XMAX RCONST(20.0) -#define YMIN RCONST(30.0) /* grid boundaries in y */ -#define YMAX RCONST(50.0) -#define XMID RCONST(10.0) /* grid midpoints in x,y */ -#define YMID RCONST(40.0) +#define XMAX SUN_RCONST(20.0) +#define YMIN SUN_RCONST(30.0) /* grid boundaries in y */ +#define YMAX SUN_RCONST(50.0) +#define XMID SUN_RCONST(10.0) /* grid midpoints in x,y */ +#define YMID SUN_RCONST(40.0) #define MX 10 /* MX = number of x mesh points */ #define MY 10 /* MY = number of y mesh points */ @@ -108,8 +108,8 @@ /* CVodeInit Constants */ -#define RTOL RCONST(1.0e-5) /* scalar relative tolerance */ -#define FLOOR RCONST(100.0) /* value of C1 or C2 at which tolerances */ +#define RTOL SUN_RCONST(1.0e-5) /* scalar relative tolerance */ +#define FLOOR SUN_RCONST(100.0) /* value of C1 or C2 at which tolerances */ /* change from relative to absolute */ #define ATOL (RTOL*FLOOR) /* scalar absolute tolerance */ #define NEQ (NUM_SPECIES*MM) /* NEQ = number of equations */ @@ -480,12 +480,12 @@ static void SetInitialProfiles(N_Vector u, sunrealtype dx, sunrealtype dy) for (jy=0; jy < MY; jy++) { y = YMIN + jy*dy; - cy = SQR(RCONST(0.1)*(y - YMID)); - cy = ONE - cy + RCONST(0.5)*SQR(cy); + cy = SQR(SUN_RCONST(0.1)*(y - YMID)); + cy = ONE - cy + SUN_RCONST(0.5)*SQR(cy); for (jx=0; jx < MX; jx++) { x = XMIN + jx*dx; - cx = SQR(RCONST(0.1)*(x - XMID)); - cx = ONE - cx + RCONST(0.5)*SQR(cx); + cx = SQR(SUN_RCONST(0.1)*(x - XMID)); + cx = ONE - cx + SUN_RCONST(0.5)*SQR(cx); IJKth(udata,1,jx,jy) = C1_SCALE*cx*cy; IJKth(udata,2,jx,jy) = C2_SCALE*cx*cy; } @@ -668,10 +668,10 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Set vertical diffusion coefficients at jy +- 1/2 */ - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); idn = (jy == 0) ? 1 : -1; iup = (jy == MY-1) ? -1 : 1; for (jx=0; jx < MX; jx++) { @@ -765,10 +765,10 @@ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, computed on the last f call). Load into P. */ for (jy=0; jy < MY; jy++) { - ydn = YMIN + (jy - RCONST(0.5))*dely; + ydn = YMIN + (jy - SUN_RCONST(0.5))*dely; yup = ydn + dely; - cydn = verdco*exp(RCONST(0.2)*ydn); - cyup = verdco*exp(RCONST(0.2)*yup); + cydn = verdco*exp(SUN_RCONST(0.2)*ydn); + cyup = verdco*exp(SUN_RCONST(0.2)*yup); diag = -(cydn + cyup + TWO*hordco); for (jx=0; jx < MX; jx++) { c1 = IJKth(udata,1,jx,jy); diff --git a/examples/cvodes/serial/cvsKrylovDemo_prec.c b/examples/cvodes/serial/cvsKrylovDemo_prec.c index 9d43d0e851..e11fee5ded 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_prec.c +++ b/examples/cvodes/serial/cvsKrylovDemo_prec.c @@ -119,17 +119,17 @@ /* Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Problem Specification Constants */ #define AA ONE /* AA = a */ -#define EE RCONST(1.0e4) /* EE = e */ -#define GG RCONST(0.5e-6) /* GG = g */ +#define EE SUN_RCONST(1.0e4) /* EE = e */ +#define GG SUN_RCONST(0.5e-6) /* GG = g */ #define BB ONE /* BB = b */ #define DPREY ONE -#define DPRED RCONST(0.5) +#define DPRED SUN_RCONST(0.5) #define ALPH ONE #define NP 3 #define NS (2*NP) @@ -155,8 +155,8 @@ #define NEQ (NS*MX*MY) #define T0 ZERO -#define RTOL RCONST(1.0e-5) -#define ATOL RCONST(1.0e-5) +#define RTOL SUN_RCONST(1.0e-5) +#define ATOL SUN_RCONST(1.0e-5) /* Spgmr/CVLS Constants */ @@ -165,8 +165,8 @@ /* Output Constants */ -#define T1 RCONST(1.0e-8) -#define TOUT_MULT RCONST(10.0) +#define T1 SUN_RCONST(1.0e-8) +#define TOUT_MULT SUN_RCONST(10.0) #define DTOUT ONE #define NOUT 18 @@ -331,7 +331,7 @@ int main() PrintOutput(cvode_mem, t); if (firstrun && (iout % 3 == 0)) PrintAllSpecies(c, ns, mxns, t); if(check_retval(&retval, "CVode", 1)) break; - if (tout > RCONST(0.9)) tout += DTOUT; else tout *= TOUT_MULT; + if (tout > SUN_RCONST(0.9)) tout += DTOUT; else tout *= TOUT_MULT; } /* Print final statistics, and loop for next case */ @@ -409,7 +409,7 @@ static void InitUserData(WebData wdata) wdata->mq = MQ; wdata->mx = MX; wdata->my = MY; - wdata->srur = sqrt(UNIT_ROUNDOFF); + wdata->srur = sqrt(SUN_UNIT_ROUNDOFF); wdata->mxmp = MXMP; wdata->ngrp = NGRP; wdata->ngx = NGX; @@ -458,8 +458,8 @@ static void CInit(N_Vector c, WebData wdata) dx = wdata->dx; dy = wdata->dy; - x_factor = RCONST(4.0)/SQR(AX); - y_factor = RCONST(4.0)/SQR(AY); + x_factor = SUN_RCONST(4.0)/SQR(AX); + y_factor = SUN_RCONST(4.0)/SQR(AY); for (jy = 0; jy < MY; jy++) { y = jy*dy; argy = SQR(y_factor*y*(AY-y)); @@ -470,7 +470,7 @@ static void CInit(N_Vector c, WebData wdata) ioff = iyoff + ns*jx; for (i = 1; i <= ns; i++) { ici = ioff + i-1; - cdata[ici] = RCONST(10.0) + i*argx*argy; + cdata[ici] = SUN_RCONST(10.0) + i*argx*argy; } } } @@ -797,7 +797,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, if(check_retval(&retval, "CVodeGetErrWeights", 1)) return(1); rewtdata = N_VGetArrayPointer(rewt); - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; P = wdata->P; pivot = wdata->pivot; @@ -818,7 +818,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, f1 = N_VGetArrayPointer(wdata->tmp); fac = N_VWrmsNorm (fc, rewt); - r0 = RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; + r0 = SUN_RCONST(1000.0)*fabs(gamma)*uround*NEQ*fac; if (r0 == ZERO) r0 = ONE; for (igy = 0; igy < ngy; igy++) { @@ -955,11 +955,11 @@ static void GSIter(sunrealtype gamma, N_Vector z, N_Vector x, WebData wdata) Load local arrays beta, beta2, gam, gam2, and cof1. */ for (i = 0; i < ns; i++) { - temp = ONE/(ONE + RCONST(2.0)*gamma*(cox[i] + coy[i])); + temp = ONE/(ONE + SUN_RCONST(2.0)*gamma*(cox[i] + coy[i])); beta[i] = gamma*cox[i]*temp; - beta2[i] = RCONST(2.0)*beta[i]; + beta2[i] = SUN_RCONST(2.0)*beta[i]; gam[i] = gamma*coy[i]*temp; - gam2[i] = RCONST(2.0)*gam[i]; + gam2[i] = SUN_RCONST(2.0)*gam[i]; cof1[i] = temp; } diff --git a/examples/cvodes/serial/cvsParticle_dns.c b/examples/cvodes/serial/cvsParticle_dns.c index 662af010a7..debe2da355 100644 --- a/examples/cvodes/serial/cvsParticle_dns.c +++ b/examples/cvodes/serial/cvsParticle_dns.c @@ -70,10 +70,10 @@ #endif /* Problem Constants */ -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* User-defined data structure */ typedef struct UserData_ @@ -392,8 +392,8 @@ static int InitUserData(int *argc, char ***argv, UserData udata) udata->orbits = 100; udata->torbit = (TWO * PI) / udata->alpha; - udata->rtol = RCONST(1.0e-4); - udata->atol = RCONST(1.0e-9); + udata->rtol = SUN_RCONST(1.0e-4); + udata->atol = SUN_RCONST(1.0e-9); udata->proj = 1; udata->projerr = 0; diff --git a/examples/cvodes/serial/cvsPendulum_dns.c b/examples/cvodes/serial/cvsPendulum_dns.c index dfd045b8e4..aa7927c130 100644 --- a/examples/cvodes/serial/cvsPendulum_dns.c +++ b/examples/cvodes/serial/cvsPendulum_dns.c @@ -96,9 +96,9 @@ #endif /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define GRAV RCONST(13.750371636040745654980191559621114395801712) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define GRAV SUN_RCONST(13.750371636040745654980191559621114395801712) /* Functions provided to CVODES */ static int fref(sunrealtype t, N_Vector yy, N_Vector fy, void *f_data); @@ -132,9 +132,9 @@ int main(int argc, char* argv[]) int i; int retval; /* reusable return flag */ int nout = 1; /* number of outputs */ - sunrealtype rtol = RCONST(1.0e-5); /* base relative tolerance */ - sunrealtype atol = RCONST(1.0e-5); /* base absolute tolerance */ - sunrealtype tf = RCONST(30.0); /* final integration time */ + sunrealtype rtol = SUN_RCONST(1.0e-5); /* base relative tolerance */ + sunrealtype atol = SUN_RCONST(1.0e-5); /* base absolute tolerance */ + sunrealtype tf = SUN_RCONST(30.0); /* final integration time */ booleantype projerr = SUNTRUE; /* enable error projection */ void *cvode_mem = NULL; /* CVODES memory */ @@ -216,8 +216,8 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "GetSol", 1)) return(1); /* Reduce tolerance for next run */ - rtol /= RCONST(10.0); - atol /= RCONST(10.0); + rtol /= SUN_RCONST(10.0); + atol /= SUN_RCONST(10.0); } /* Free memory */ @@ -432,7 +432,7 @@ int RefSol(sunrealtype tf, N_Vector yref, int nout) sunrealtype tout; /* output time */ sunrealtype t; /* return time */ sunrealtype th, thd; /* theta and theta dot */ - sunrealtype tol = RCONST(1.0e-14); /* integration tolerance */ + sunrealtype tol = SUN_RCONST(1.0e-14); /* integration tolerance */ /* Create the solution vector */ yy = N_VNew_Serial(2, sunctx); diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns.c index 6fd4f98e03..611cf8d520 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns.c @@ -71,27 +71,27 @@ #define NEQ 3 /* number of equations */ -#define RTOL RCONST(1e-6) /* scalar relative tolerance */ +#define RTOL SUN_RCONST(1e-6) /* scalar relative tolerance */ -#define ATOL1 RCONST(1e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1e-14) -#define ATOL3 RCONST(1e-6) +#define ATOL1 SUN_RCONST(1e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1e-14) +#define ATOL3 SUN_RCONST(1e-6) -#define ATOLl RCONST(1e-8) /* absolute tolerance for adjoint vars. */ -#define ATOLq RCONST(1e-6) /* absolute tolerance for quadratures */ +#define ATOLl SUN_RCONST(1e-8) /* absolute tolerance for adjoint vars. */ +#define ATOLq SUN_RCONST(1e-6) /* absolute tolerance for quadratures */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(4e7) /* final time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(4e7) /* final time */ -#define TB1 RCONST(4e7) /* starting point for adjoint problem */ -#define TB2 RCONST(50.0) /* starting point for adjoint problem */ -#define TBout1 RCONST(40.0) /* intermediate t for adjoint problem */ +#define TB1 SUN_RCONST(4e7) /* starting point for adjoint problem */ +#define TB2 SUN_RCONST(50.0) /* starting point for adjoint problem */ +#define TBout1 SUN_RCONST(40.0) /* intermediate t for adjoint problem */ #define STEPS 150 /* number of steps between check points */ #define NP 3 /* number of problem parameters */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -174,9 +174,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS simulation context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); @@ -185,7 +185,7 @@ int main(int argc, char *argv[]) /* Initialize y */ y = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)y, "N_VNew_Serial", 0)) return(1); - Ith(y,1) = RCONST(1.0); + Ith(y,1) = SUN_RCONST(1.0); Ith(y,2) = ZERO; Ith(y,3) = ZERO; @@ -645,8 +645,8 @@ static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user /* Load yBdot */ Ith(yBdot,1) = - p1*l21; - Ith(yBdot,2) = p2*y3*l21 - RCONST(2.0)*p3*y2*l32; - Ith(yBdot,3) = p2*y2*l21 - RCONST(1.0); + Ith(yBdot,2) = p2*y3*l21 - SUN_RCONST(2.0)*p3*y2*l32; + Ith(yBdot,3) = p2*y2*l21 - SUN_RCONST(1.0); return(0); } @@ -672,7 +672,7 @@ static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix /* Load JB */ IJth(JB,1,1) = p1; IJth(JB,1,2) = -p1; IJth(JB,1,3) = ZERO; - IJth(JB,2,1) = -p2*y3; IJth(JB,2,2) = p2*y3+2.0*p3*y2; IJth(JB,2,3) = RCONST(-2.0)*p3*y2; + IJth(JB,2,1) = -p2*y3; IJth(JB,2,2) = p2*y3+2.0*p3*y2; IJth(JB,2,3) = SUN_RCONST(-2.0)*p3*y2; IJth(JB,3,1) = -p2*y2; IJth(JB,3,2) = p2*y2; IJth(JB,3,3) = ZERO; return(0); diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c index 8bd88256bc..771f4366fa 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c @@ -73,28 +73,28 @@ #define NEQ 3 /* number of equations */ -#define RTOL RCONST(1e-4) /* scalar relative tolerance */ +#define RTOL SUN_RCONST(1e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1e-4) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1e-8) -#define ATOL3 RCONST(1e-4) +#define ATOL1 SUN_RCONST(1e-4) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1e-8) +#define ATOL3 SUN_RCONST(1e-4) -#define ATOLl RCONST(1e-8) /* absolute tolerance for adjoint vars. */ -#define ATOLq RCONST(1e-6) /* absolute tolerance for quadratures */ +#define ATOLl SUN_RCONST(1e-8) /* absolute tolerance for adjoint vars. */ +#define ATOLq SUN_RCONST(1e-6) /* absolute tolerance for quadratures */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(4e7) /* final time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(4e7) /* final time */ -#define TB1 RCONST(4e7) /* starting point for adjoint problem */ -#define TB2 RCONST(50.0) /* starting point for adjoint problem */ -#define TBout1 RCONST(40.0) /* intermediate t for adjoint problem */ +#define TB1 SUN_RCONST(4e7) /* starting point for adjoint problem */ +#define TB2 SUN_RCONST(50.0) /* starting point for adjoint problem */ +#define TBout1 SUN_RCONST(40.0) /* intermediate t for adjoint problem */ #define STEPS 150 /* number of steps between check points */ #define NP 3 /* number of problem parameters */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Type : UserData */ @@ -180,9 +180,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS simulation context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) /* Initialize y */ y = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)y, "N_VNew_Serial", 0)) return(1); - Ith(y,1) = RCONST(1.0); + Ith(y,1) = SUN_RCONST(1.0); Ith(y,2) = ZERO; Ith(y,3) = ZERO; @@ -643,8 +643,8 @@ static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user /* Load yBdot */ Ith(yBdot,1) = - p1*l21; - Ith(yBdot,2) = p2*y3*l21 - RCONST(2.0)*p3*y2*l32; - Ith(yBdot,3) = p2*y2*l21 - RCONST(1.0); + Ith(yBdot,2) = p2*y3*l21 - SUN_RCONST(2.0)*p3*y2*l32; + Ith(yBdot,3) = p2*y2*l21 - SUN_RCONST(1.0); return(0); } @@ -670,7 +670,7 @@ static int JacB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix /* Load JB */ IJth(JB,1,1) = p1; IJth(JB,1,2) = -p1; IJth(JB,1,3) = ZERO; - IJth(JB,2,1) = -p2*y3; IJth(JB,2,2) = p2*y3+2.0*p3*y2; IJth(JB,2,3) = RCONST(-2.0)*p3*y2; + IJth(JB,2,1) = -p2*y3; IJth(JB,2,2) = p2*y3+2.0*p3*y2; IJth(JB,2,3) = SUN_RCONST(-2.0)*p3*y2; IJth(JB,3,1) = -p2*y2; IJth(JB,3,2) = p2*y2; IJth(JB,3,3) = ZERO; return(0); diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_klu.c b/examples/cvodes/serial/cvsRoberts_ASAi_klu.c index 78490ea231..3976e69a6b 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_klu.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_klu.c @@ -73,27 +73,27 @@ #define NEQ 3 /* number of equations */ -#define RTOL RCONST(1e-6) /* scalar relative tolerance */ +#define RTOL SUN_RCONST(1e-6) /* scalar relative tolerance */ -#define ATOL1 RCONST(1e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1e-14) -#define ATOL3 RCONST(1e-6) +#define ATOL1 SUN_RCONST(1e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1e-14) +#define ATOL3 SUN_RCONST(1e-6) -#define ATOLl RCONST(1e-8) /* absolute tolerance for adjoint vars. */ -#define ATOLq RCONST(1e-6) /* absolute tolerance for quadratures */ +#define ATOLl SUN_RCONST(1e-8) /* absolute tolerance for adjoint vars. */ +#define ATOLq SUN_RCONST(1e-6) /* absolute tolerance for quadratures */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(4e7) /* final time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(4e7) /* final time */ -#define TB1 RCONST(4e7) /* starting point for adjoint problem */ -#define TB2 RCONST(50.0) /* starting point for adjoint problem */ -#define TBout1 RCONST(40.0) /* intermediate t for adjoint problem */ +#define TB1 SUN_RCONST(4e7) /* starting point for adjoint problem */ +#define TB2 SUN_RCONST(50.0) /* starting point for adjoint problem */ +#define TBout1 SUN_RCONST(40.0) /* intermediate t for adjoint problem */ #define STEPS 150 /* number of steps between check points */ #define NP 3 /* number of problem parameters */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -177,9 +177,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS simulation context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) /* Initialize y */ y = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)y, "N_VNew_Serial", 0)) return(1); - Ith(y,1) = RCONST(1.0); + Ith(y,1) = SUN_RCONST(1.0); Ith(y,2) = ZERO; Ith(y,3) = ZERO; @@ -655,8 +655,8 @@ static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user /* Load yBdot */ Ith(yBdot,1) = - p1*l21; - Ith(yBdot,2) = p2*y3*l21 - RCONST(2.0)*p3*y2*l32; - Ith(yBdot,3) = p2*y2*l21 - RCONST(1.0); + Ith(yBdot,2) = p2*y3*l21 - SUN_RCONST(2.0)*p3*y2*l32; + Ith(yBdot,3) = p2*y2*l21 - SUN_RCONST(1.0); return(0); } @@ -705,7 +705,7 @@ static int JacB(sunrealtype t, dataB[6] = ZERO; rowvalsB[6] = 0; - dataB[7] = RCONST(-2.0)*p3*yvalB[1]; + dataB[7] = SUN_RCONST(-2.0)*p3*yvalB[1]; rowvalsB[7] = 1; dataB[8] = ZERO; rowvalsB[8] = 2; diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_sps.c b/examples/cvodes/serial/cvsRoberts_ASAi_sps.c index d1bd551fc2..7850ff4249 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_sps.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_sps.c @@ -73,27 +73,27 @@ #define NEQ 3 /* number of equations */ -#define RTOL RCONST(1e-6) /* scalar relative tolerance */ +#define RTOL SUN_RCONST(1e-6) /* scalar relative tolerance */ -#define ATOL1 RCONST(1e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1e-14) -#define ATOL3 RCONST(1e-6) +#define ATOL1 SUN_RCONST(1e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1e-14) +#define ATOL3 SUN_RCONST(1e-6) -#define ATOLl RCONST(1e-8) /* absolute tolerance for adjoint vars. */ -#define ATOLq RCONST(1e-6) /* absolute tolerance for quadratures */ +#define ATOLl SUN_RCONST(1e-8) /* absolute tolerance for adjoint vars. */ +#define ATOLq SUN_RCONST(1e-6) /* absolute tolerance for quadratures */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(4e7) /* final time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(4e7) /* final time */ -#define TB1 RCONST(4e7) /* starting point for adjoint problem */ -#define TB2 RCONST(50.0) /* starting point for adjoint problem */ -#define TBout1 RCONST(40.0) /* intermediate t for adjoint problem */ +#define TB1 SUN_RCONST(4e7) /* starting point for adjoint problem */ +#define TB2 SUN_RCONST(50.0) /* starting point for adjoint problem */ +#define TBout1 SUN_RCONST(40.0) /* intermediate t for adjoint problem */ #define STEPS 150 /* number of steps between check points */ #define NP 3 /* number of problem parameters */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -177,9 +177,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS simulation context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) /* Initialize y */ y = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)y, "N_VNew_Serial", 0)) return(1); - Ith(y,1) = RCONST(1.0); + Ith(y,1) = SUN_RCONST(1.0); Ith(y,2) = ZERO; Ith(y,3) = ZERO; @@ -656,8 +656,8 @@ static int fB(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void *user /* Load yBdot */ Ith(yBdot,1) = - p1*l21; - Ith(yBdot,2) = p2*y3*l21 - RCONST(2.0)*p3*y2*l32; - Ith(yBdot,3) = p2*y2*l21 - RCONST(1.0); + Ith(yBdot,2) = p2*y3*l21 - SUN_RCONST(2.0)*p3*y2*l32; + Ith(yBdot,3) = p2*y2*l21 - SUN_RCONST(1.0); return(0); } @@ -706,7 +706,7 @@ static int JacB(sunrealtype t, dataB[6] = ZERO; rowvalsB[6] = 0; - dataB[7] = RCONST(-2.0)*p3*yvalB[1]; + dataB[7] = SUN_RCONST(-2.0)*p3*yvalB[1]; rowvalsB[7] = 1; dataB[8] = ZERO; rowvalsB[8] = 2; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns.c b/examples/cvodes/serial/cvsRoberts_FSA_dns.c index c8338e5985..a5950d17b0 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns.c @@ -92,22 +92,22 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define NP 3 /* number of problem parameters */ #define NS 3 /* number of sensitivities computed */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -186,9 +186,9 @@ int main(int argc, char *argv[]) if (check_retval((void *)data, "malloc", 2)) return(1); /* Initialize sensitivity variables (reaction rates for this problem) */ - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c index d0ff20ead6..29bc809f48 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c @@ -50,10 +50,10 @@ /* Problem Constants */ #define MXSTEPS 2000 /* max number of steps */ #define NEQ 3 /* number of equations */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(4.0e10) /* first output time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(4.0e10) /* first output time */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ typedef struct { @@ -118,9 +118,9 @@ int main(int argc, char *argv[]) data = (UserData) malloc(sizeof *data); /* Initialize sensitivity variables (reaction rates for this problem) */ - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Allocate initial condition vector and set context */ y0 = N_VNew_Serial(NEQ, sunctx); @@ -134,15 +134,15 @@ int main(int argc, char *argv[]) if (check_retval((void *)abstol, "N_VClone", 0)) return(1); /* Set initial conditions */ - NV_Ith_S(y0,0) = RCONST(1.0); - NV_Ith_S(y0,1) = RCONST(0.0); - NV_Ith_S(y0,2) = RCONST(0.0); + NV_Ith_S(y0,0) = SUN_RCONST(1.0); + NV_Ith_S(y0,1) = SUN_RCONST(0.0); + NV_Ith_S(y0,2) = SUN_RCONST(0.0); /* Set integration tolerances */ - reltol = RCONST(1e-6); - NV_Ith_S(abstol,0) = RCONST(1e-8); - NV_Ith_S(abstol,1) = RCONST(1e-14); - NV_Ith_S(abstol,2) = RCONST(1e-6); + reltol = SUN_RCONST(1e-6); + NV_Ith_S(abstol,0) = SUN_RCONST(1e-8); + NV_Ith_S(abstol,1) = SUN_RCONST(1e-14); + NV_Ith_S(abstol,2) = SUN_RCONST(1e-6); /* Call CVodeCreate to create the solver memory and specify the * Backward Differentiation Formula */ @@ -235,9 +235,9 @@ int main(int argc, char *argv[]) Reinitialize and run CVODES */ - data->p[0] = RCONST(0.05); - data->p[1] = RCONST(2.0e4); - data->p[2] = RCONST(2.9e7); + data->p[0] = SUN_RCONST(0.05); + data->p[1] = SUN_RCONST(2.0e4); + data->p[2] = SUN_RCONST(2.9e7); data->sensi = SUNFALSE; @@ -257,9 +257,9 @@ int main(int argc, char *argv[]) Reinitialize and run CVODES */ - data->p[0] = RCONST(0.06); - data->p[1] = RCONST(3.0e4); - data->p[2] = RCONST(2.8e7); + data->p[0] = SUN_RCONST(0.06); + data->p[1] = SUN_RCONST(3.0e4); + data->p[2] = SUN_RCONST(2.8e7); data->sensi = SUNTRUE; data->fsDQ = SUNTRUE; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c index 6f7e805adb..86d508d0df 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c @@ -84,23 +84,23 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-6) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-11) -#define ATOL3 RCONST(1.0e-5) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-6) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-11) +#define ATOL3 SUN_RCONST(1.0e-5) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define NP 3 /* number of problem parameters */ #define NS 3 /* number of sensitivities computed */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Type : UserData */ @@ -181,9 +181,9 @@ int main(int argc, char *argv[]) if (check_retval((void *)data, "malloc", 2)) return(1); /* Initialize sensitivity variables (reaction rates for this problem) */ - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); diff --git a/examples/cvodes/serial/cvsRoberts_FSA_klu.c b/examples/cvodes/serial/cvsRoberts_FSA_klu.c index 9133bb7a24..1131bda89f 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_klu.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_klu.c @@ -78,22 +78,22 @@ #define NEQ 3 /* number of equations */ #define NNZ 7 /* number of non-zero entries in the Jacobian */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define NP 3 /* number of problem parameters */ #define NS 3 /* number of sensitivities computed */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -170,9 +170,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); diff --git a/examples/cvodes/serial/cvsRoberts_FSA_sps.c b/examples/cvodes/serial/cvsRoberts_FSA_sps.c index 76a9f96577..9b9c35a387 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_sps.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_sps.c @@ -78,22 +78,22 @@ #define NEQ 3 /* number of equations */ #define NNZ 7 /* number of non-zero entries in the Jacobian */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define NP 3 /* number of problem parameters */ #define NS 3 /* number of sensitivities computed */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -170,9 +170,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Create the SUNDIALS context that all SUNDIALS objects require */ retval = SUNContext_Create(NULL, &sunctx); diff --git a/examples/cvodes/serial/cvsRoberts_dns.c b/examples/cvodes/serial/cvsRoberts_dns.c index 813fd9fe89..bd23804f65 100644 --- a/examples/cvodes/serial/cvsRoberts_dns.c +++ b/examples/cvodes/serial/cvsRoberts_dns.c @@ -71,19 +71,19 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -256,8 +256,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -272,8 +272,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -289,16 +289,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); @@ -375,20 +375,20 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) N_Vector ref; /* reference solution vector */ N_Vector ewt; /* error weight vector */ sunrealtype err; /* wrms error */ - sunrealtype ONE=RCONST(1.0); + sunrealtype ONE=SUN_RCONST(1.0); /* create reference solution and error weight vectors */ ref = N_VClone(y); ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(5.2083495894337328e-08); - NV_Ith_S(ref,1) = RCONST(2.0833399429795671e-13); - NV_Ith_S(ref,2) = RCONST(9.9999994791629776e-01); + NV_Ith_S(ref,0) = SUN_RCONST(5.2083495894337328e-08); + NV_Ith_S(ref,1) = SUN_RCONST(2.0833399429795671e-13); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999994791629776e-01); /* compute the error weight vector, loosen atol */ N_VAbs(ref, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), atol, ewt); + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), atol, ewt); if (N_VMin(ewt) <= ZERO) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); diff --git a/examples/cvodes/serial/cvsRoberts_dnsL.c b/examples/cvodes/serial/cvsRoberts_dnsL.c index 6efec0961a..6105636d58 100644 --- a/examples/cvodes/serial/cvsRoberts_dnsL.c +++ b/examples/cvodes/serial/cvsRoberts_dnsL.c @@ -60,19 +60,19 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -234,8 +234,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -250,8 +250,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -267,16 +267,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); diff --git a/examples/cvodes/serial/cvsRoberts_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_dns_constraints.c index 3ad73755b1..04dc0ffaa3 100644 --- a/examples/cvodes/serial/cvsRoberts_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_dns_constraints.c @@ -73,20 +73,20 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-6) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-11) -#define ATOL3 RCONST(1.0e-5) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-6) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-11) +#define ATOL3 SUN_RCONST(1.0e-5) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Functions Called by the Solver */ @@ -268,8 +268,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -284,8 +284,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -301,16 +301,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); @@ -432,13 +432,13 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(5.2083495894337328e-08); - NV_Ith_S(ref,1) = RCONST(2.0833399429795671e-13); - NV_Ith_S(ref,2) = RCONST(9.9999994791629776e-01); + NV_Ith_S(ref,0) = SUN_RCONST(5.2083495894337328e-08); + NV_Ith_S(ref,1) = SUN_RCONST(2.0833399429795671e-13); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999994791629776e-01); /* compute the error weight vector, loosen atol */ N_VAbs(ref, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), atol, ewt); + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), atol, ewt); if (N_VMin(ewt) <= ZERO) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); diff --git a/examples/cvodes/serial/cvsRoberts_dns_uw.c b/examples/cvodes/serial/cvsRoberts_dns_uw.c index 52f642e2e1..4bb3f26ffb 100644 --- a/examples/cvodes/serial/cvsRoberts_dns_uw.c +++ b/examples/cvodes/serial/cvsRoberts_dns_uw.c @@ -73,19 +73,19 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -237,8 +237,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -253,8 +253,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -270,16 +270,16 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, y2 = Ith(y,2); y3 = Ith(y,3); - IJth(J,1,1) = RCONST(-0.04); - IJth(J,1,2) = RCONST(1.0e4)*y3; - IJth(J,1,3) = RCONST(1.0e4)*y2; + IJth(J,1,1) = SUN_RCONST(-0.04); + IJth(J,1,2) = SUN_RCONST(1.0e4)*y3; + IJth(J,1,3) = SUN_RCONST(1.0e4)*y2; - IJth(J,2,1) = RCONST(0.04); - IJth(J,2,2) = RCONST(-1.0e4)*y3-RCONST(6.0e7)*y2; - IJth(J,2,3) = RCONST(-1.0e4)*y2; + IJth(J,2,1) = SUN_RCONST(0.04); + IJth(J,2,2) = SUN_RCONST(-1.0e4)*y3-SUN_RCONST(6.0e7)*y2; + IJth(J,2,3) = SUN_RCONST(-1.0e4)*y2; IJth(J,3,1) = ZERO; - IJth(J,3,2) = RCONST(6.0e7)*y2; + IJth(J,3,2) = SUN_RCONST(6.0e7)*y2; IJth(J,3,3) = ZERO; return(0); diff --git a/examples/cvodes/serial/cvsRoberts_klu.c b/examples/cvodes/serial/cvsRoberts_klu.c index 614fafac9b..0d7e58cd7d 100644 --- a/examples/cvodes/serial/cvsRoberts_klu.c +++ b/examples/cvodes/serial/cvsRoberts_klu.c @@ -57,19 +57,19 @@ #define NEQ 3 /* number of equations */ #define NNZ 7 /* number of non-zero entries in the Jacobian */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -231,8 +231,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -247,8 +247,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -276,31 +276,31 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, colptrs[0] = 0; rowvals[0] = 0; - data[0] = RCONST(-0.04); + data[0] = SUN_RCONST(-0.04); rowvals[1] = 1; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); /* second column entries start at data[2], three entries (rows 0, 1, and 2) */ colptrs[1] = 2; rowvals[2] = 0; - data[2] = RCONST(1.0e4) * yval[2]; + data[2] = SUN_RCONST(1.0e4) * yval[2]; rowvals[3] = 1; - data[3] = (RCONST(-1.0e4) * yval[2]) - (RCONST(6.0e7) * yval[1]); + data[3] = (SUN_RCONST(-1.0e4) * yval[2]) - (SUN_RCONST(6.0e7) * yval[1]); rowvals[4] = 2; - data[4] = RCONST(6.0e7) * yval[1]; + data[4] = SUN_RCONST(6.0e7) * yval[1]; /* third column entries start at data[5], two entries (rows 0 and 1) */ colptrs[2] = 5; rowvals[5] = 0; - data[5] = RCONST(1.0e4) * yval[1]; + data[5] = SUN_RCONST(1.0e4) * yval[1]; rowvals[6] = 1; - data[6] = RCONST(-1.0e4) * yval[1]; + data[6] = SUN_RCONST(-1.0e4) * yval[1]; /* number of non-zeros */ colptrs[3] = 7; diff --git a/examples/cvodes/serial/cvsRoberts_sps.c b/examples/cvodes/serial/cvsRoberts_sps.c index 6e9a5ba1fc..25b5e48e2c 100644 --- a/examples/cvodes/serial/cvsRoberts_sps.c +++ b/examples/cvodes/serial/cvsRoberts_sps.c @@ -57,19 +57,19 @@ #define NEQ 3 /* number of equations */ #define NNZ 7 /* number of non-zero entries in the Jacobian */ -#define Y1 RCONST(1.0) /* initial y components */ -#define Y2 RCONST(0.0) -#define Y3 RCONST(0.0) -#define RTOL RCONST(1.0e-4) /* scalar relative tolerance */ -#define ATOL1 RCONST(1.0e-8) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1.0e-14) -#define ATOL3 RCONST(1.0e-6) -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define Y1 SUN_RCONST(1.0) /* initial y components */ +#define Y2 SUN_RCONST(0.0) +#define Y3 SUN_RCONST(0.0) +#define RTOL SUN_RCONST(1.0e-4) /* scalar relative tolerance */ +#define ATOL1 SUN_RCONST(1.0e-8) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1.0e-14) +#define ATOL3 SUN_RCONST(1.0e-6) +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Functions Called by the Solver */ @@ -231,8 +231,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) y1 = Ith(y,1); y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = Ith(ydot,1) = RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3; - yd3 = Ith(ydot,3) = RCONST(3.0e7)*y2*y2; + yd1 = Ith(ydot,1) = SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3; + yd3 = Ith(ydot,3) = SUN_RCONST(3.0e7)*y2*y2; Ith(ydot,2) = -yd1 - yd3; return(0); @@ -247,8 +247,8 @@ static int g(sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data) sunrealtype y1, y3; y1 = Ith(y,1); y3 = Ith(y,3); - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -276,31 +276,31 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, colptrs[0] = 0; rowvals[0] = 0; - data[0] = RCONST(-0.04); + data[0] = SUN_RCONST(-0.04); rowvals[1] = 1; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); /* second column entries start at data[2], three entries (rows 0, 1, and 2) */ colptrs[1] = 2; rowvals[2] = 0; - data[2] = RCONST(1.0e4) * yval[2]; + data[2] = SUN_RCONST(1.0e4) * yval[2]; rowvals[3] = 1; - data[3] = (RCONST(-1.0e4) * yval[2]) - (RCONST(6.0e7) * yval[1]); + data[3] = (SUN_RCONST(-1.0e4) * yval[2]) - (SUN_RCONST(6.0e7) * yval[1]); rowvals[4] = 2; - data[4] = RCONST(6.0e7) * yval[1]; + data[4] = SUN_RCONST(6.0e7) * yval[1]; /* third column entries start at data[5], two entries (rows 0 and 1) */ colptrs[2] = 5; rowvals[5] = 0; - data[5] = RCONST(1.0e4) * yval[1]; + data[5] = SUN_RCONST(1.0e4) * yval[1]; rowvals[6] = 1; - data[6] = RCONST(-1.0e4) * yval[1]; + data[6] = SUN_RCONST(-1.0e4) * yval[1]; /* number of non-zeros */ colptrs[3] = 7; diff --git a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c index d9f504db6c..97c611db2c 100644 --- a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c @@ -125,30 +125,30 @@ #define NPREY 1 /* No. of prey (= no. of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) -#define FOURPI (RCONST(4.0)*PI) +#define PI SUN_RCONST(3.1415926535898) +#define FOURPI (SUN_RCONST(4.0)*PI) #define MX 20 /* MX = number of x mesh points */ #define MY 20 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NUM_SPECIES*MX*MY) -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* Relative tolerance */ -#define ATOL RCONST(1.e-5) /* Absolute tolerance */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* Relative tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* Absolute tolerance */ #define NOUT 6 /* Number of output times */ -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.) -#define ONE RCONST(1.0) +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ +#define ZERO SUN_RCONST(0.) +#define ONE SUN_RCONST(1.0) /* * User-defined vector and accessor macro: IJ_Vptr. @@ -283,7 +283,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1)) return(1); @@ -466,17 +466,17 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yloc = NSMX * jy; for (jx = 0; jx < MX; jx++) { xx = jx * webdata->dx; - xyfactor = RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); xyfactor *= xyfactor; loc = yloc + NUM_SPECIES*jx; for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; + ccv[loc+is] = SUN_RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { - ccv[loc+is] = RCONST(1.0e5); + ccv[loc+is] = SUN_RCONST(1.0e5); idv[loc+is] = ZERO; } } diff --git a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c index c7e8d5a897..3dd64eb005 100644 --- a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c @@ -130,30 +130,30 @@ #define NPREY 1 /* No. of prey (= no. of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) -#define FOURPI (RCONST(4.0)*PI) +#define PI SUN_RCONST(3.1415926535898) +#define FOURPI (SUN_RCONST(4.0)*PI) #define MX 20 /* MX = number of x mesh points */ #define MY 20 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NUM_SPECIES*MX*MY) -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* Relative tolerance */ -#define ATOL RCONST(1.e-5) /* Absolute tolerance */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* Relative tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* Absolute tolerance */ #define NOUT 6 /* Number of output times */ -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.) -#define ONE RCONST(1.0) +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ +#define ZERO SUN_RCONST(0.) +#define ONE SUN_RCONST(1.0) /* * User-defined vector and accessor macro: IJ_Vptr. @@ -309,7 +309,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1)) return(1); @@ -439,7 +439,7 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, del_x = webdata->dx; del_y = webdata->dy; - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; sqru = sqrt(uround); ida_mem = webdata->ida_mem; @@ -598,17 +598,17 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yloc = NSMX * jy; for (jx = 0; jx < MX; jx++) { xx = jx * webdata->dx; - xyfactor = RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); xyfactor *= xyfactor; loc = yloc + NUM_SPECIES*jx; for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; + ccv[loc+is] = SUN_RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { - ccv[loc+is] = RCONST(1.0e5); + ccv[loc+is] = SUN_RCONST(1.0e5); idv[loc+is] = ZERO; } } diff --git a/examples/ida/cuda/idaHeat2D_kry_cuda.cu b/examples/ida/cuda/idaHeat2D_kry_cuda.cu index d665ef9139..68d0be8607 100644 --- a/examples/ida/cuda/idaHeat2D_kry_cuda.cu +++ b/examples/ida/cuda/idaHeat2D_kry_cuda.cu @@ -43,10 +43,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) /* User data type */ @@ -222,9 +222,9 @@ int main(int argc, char *argv[]) /* Assign various parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -486,7 +486,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, yfact = data->dx * j; for (i = 0; i < mm; i++) { xfact = data->dx * i; - udata[mm*j + i] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[mm*j + i] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu b/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu index 3283cb4abf..a2ad87c3ea 100644 --- a/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu +++ b/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu @@ -46,9 +46,9 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -411,11 +411,11 @@ int main(int argc, char *argv[]) /* Set constraints to all 1's for nonnegative solution values. */ N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution. */ @@ -1125,7 +1125,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = dx*i; loc = iloc + jloc*mxsub; - uudata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + uudata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == data->mx - 1 || j == 0 || j == data->my - 1) iddata[loc] = ZERO; diff --git a/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp b/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp index 74ec5767e8..5c635297df 100644 --- a/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp +++ b/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp @@ -61,9 +61,9 @@ /* Problem Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -234,11 +234,11 @@ int main(int argc, char *argv[]) /* Set constraints to all 1's for nonnegative solution values. */ N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution. */ @@ -994,7 +994,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = dx*i; loc = iloc + jloc*mxsub; - uudata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + uudata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == data->mx - 1 || j == 0 || j == data->my - 1) iddata[loc] = ZERO; diff --git a/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c b/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c index 9ac2ef18a9..34fb1fe9ef 100644 --- a/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c +++ b/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c @@ -120,8 +120,8 @@ #define NPREY 1 /* Number of prey (= number of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) /* pi */ -#define FOURPI (RCONST(4.0)*PI) /* 4 pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ +#define FOURPI (SUN_RCONST(4.0)*PI) /* 4 pi */ #define MXSUB 10 /* Number of x mesh points per processor subgrid */ #define MYSUB 10 /* Number of y mesh points per processor subgrid */ @@ -131,23 +131,23 @@ #define MY (MYSUB*NPEY) /* MY = number of y mesh points */ #define NSMXSUB (NUM_SPECIES * MXSUB) #define NEQ (NUM_SPECIES*MX*MY) /* Number of equations in system */ -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* rtol tolerance */ -#define ATOL RCONST(1.e-5) /* atol tolerance */ -#define ZERO RCONST(0.) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* rtol tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* atol tolerance */ +#define ZERO SUN_RCONST(0.) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ #define NOUT 6 -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ /* User-defined vector accessor macro IJ_Vptr. */ @@ -342,7 +342,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1, thispe)) MPI_Abort(comm, 1); @@ -494,7 +494,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { if (is < np) - {cxy[is] = RCONST(10.0)+(sunrealtype)(is+1)*xyfactor; idxy[is] = ONE;} + {cxy[is] = SUN_RCONST(10.0)+(sunrealtype)(is+1)*xyfactor; idxy[is] = ONE;} else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } diff --git a/examples/ida/parallel/idaFoodWeb_kry_p.c b/examples/ida/parallel/idaFoodWeb_kry_p.c index c24d2a97ab..9a63a090f0 100644 --- a/examples/ida/parallel/idaFoodWeb_kry_p.c +++ b/examples/ida/parallel/idaFoodWeb_kry_p.c @@ -126,8 +126,8 @@ #define NPREY 1 /* Number of prey (= number of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) /* pi */ -#define FOURPI (RCONST(4.0)*PI) /* 4 pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ +#define FOURPI (SUN_RCONST(4.0)*PI) /* 4 pi */ #define MXSUB 10 /* Number of x mesh points per processor subgrid */ #define MYSUB 10 /* Number of y mesh points per processor subgrid */ @@ -137,23 +137,23 @@ #define MY (MYSUB*NPEY) /* MY = number of y mesh points */ #define NSMXSUB (NUM_SPECIES * MXSUB) #define NEQ (NUM_SPECIES*MX*MY) /* Number of equations in system */ -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* rtol tolerance */ -#define ATOL RCONST(1.e-5) /* atol tolerance */ -#define ZERO RCONST(0.) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* rtol tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* atol tolerance */ +#define ZERO SUN_RCONST(0.) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ #define NOUT 6 -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ /* User-defined vector accessor macro IJ_Vptr. */ @@ -361,7 +361,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if (check_retval(&retval, "IDACalcIC", 1, thispe)) MPI_Abort(comm, 1); @@ -550,13 +550,13 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yy = (jy + jysub*mysub) * dy; for (ix = 0; ix < mxsub; ix++) { xx = (ix + ixsub*mxsub) * dx; - xyfactor = RCONST(16.0)*xx*(ONE - xx)*yy*(ONE - yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE - xx)*yy*(ONE - yy); xyfactor *= xyfactor; cxy = IJ_Vptr(cc,ix,jy); idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { - if (is < np) { cxy[is] = RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } + if (is < np) { cxy[is] = SUN_RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } @@ -1163,7 +1163,7 @@ static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, sunrealtype hh; webdata = (UserData)user_data; - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; sqru = sqrt(uround); thispe = webdata->thispe; diff --git a/examples/ida/parallel/idaHeat2D_kry_bbd_p.c b/examples/ida/parallel/idaHeat2D_kry_bbd_p.c index 6f8dc81866..0e1f8eb544 100644 --- a/examples/ida/parallel/idaHeat2D_kry_bbd_p.c +++ b/examples/ida/parallel/idaHeat2D_kry_bbd_p.c @@ -54,9 +54,9 @@ #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -197,12 +197,12 @@ int main(int argc, char *argv[]) SetInitialProfile(uu, up, id, res, data); N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -695,7 +695,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = data->dx * i; loc = offset + iloc; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == MX-1 || j == 0 || j == MY-1) iddata[loc] = ZERO; } } diff --git a/examples/ida/parallel/idaHeat2D_kry_p.c b/examples/ida/parallel/idaHeat2D_kry_p.c index 6521b54d21..9a504eea16 100644 --- a/examples/ida/parallel/idaHeat2D_kry_p.c +++ b/examples/ida/parallel/idaHeat2D_kry_p.c @@ -52,9 +52,9 @@ #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -219,11 +219,11 @@ int main(int argc, char *argv[]) /* Set constraints to all 1's for nonnegative solution values. */ N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution. */ @@ -845,7 +845,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = dx*i; loc = iloc + jloc*mxsub; - uudata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + uudata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == data->mx - 1 || j == 0 || j == data->my - 1) iddata[loc] = ZERO; diff --git a/examples/ida/petsc/idaHeat2D_petsc_snes.c b/examples/ida/petsc/idaHeat2D_petsc_snes.c index 3794e7b2ea..518c9bb295 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_snes.c +++ b/examples/ida/petsc/idaHeat2D_petsc_snes.c @@ -69,9 +69,9 @@ #define DSYM "d" #endif -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -245,11 +245,11 @@ int main(int argc, char *argv[]) /* Set constraints to all 1's for nonnegative solution values. */ N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-4); + atol = SUN_RCONST(1.0e-4); /* * Call IDACreate and IDAInit, set integration tolerances, then set optional inputs diff --git a/examples/ida/petsc/idaHeat2D_petsc_spgmr.c b/examples/ida/petsc/idaHeat2D_petsc_spgmr.c index c616778549..37d3b744a8 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_spgmr.c +++ b/examples/ida/petsc/idaHeat2D_petsc_spgmr.c @@ -61,9 +61,9 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -223,12 +223,12 @@ int main(int argc, char *argv[]) N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-4); + atol = SUN_RCONST(1.0e-4); /* Call IDACreate and IDAMalloc to initialize solution. */ diff --git a/examples/ida/raja/idaHeat2D_kry_raja.cpp b/examples/ida/raja/idaHeat2D_kry_raja.cpp index 322cded013..4e86d6e849 100644 --- a/examples/ida/raja/idaHeat2D_kry_raja.cpp +++ b/examples/ida/raja/idaHeat2D_kry_raja.cpp @@ -58,10 +58,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) /* User data type */ @@ -167,9 +167,9 @@ int main(int argc, char *argv[]) /* Assign various parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -454,7 +454,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, yfact = data->dx * j; for (i = 0; i < mm; i++) { xfact = data->dx * i; - udata[mm*j + i] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[mm*j + i] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/ida/serial/idaAnalytic_mels.c b/examples/ida/serial/idaAnalytic_mels.c index b3babe5349..70b1613ffe 100644 --- a/examples/ida/serial/idaAnalytic_mels.c +++ b/examples/ida/serial/idaAnalytic_mels.c @@ -68,13 +68,13 @@ int main(void) SUNContext ctx; /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(1.0); /* final time */ - sunrealtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(1.0); /* final time */ + sunrealtype dTout = SUN_RCONST(0.1); /* time between outputs */ sunindextype NEQ = 2; /* number of dependent vars. */ - sunrealtype reltol = RCONST(1.0e-4); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-9); - sunrealtype alpha = RCONST(10.0); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-4); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-9); + sunrealtype alpha = SUN_RCONST(10.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -193,8 +193,8 @@ int fres(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) sunrealtype x1 = NV_Ith_S(yy,0); /* access current solution values */ sunrealtype x2 = NV_Ith_S(yy,1); sunrealtype x1p = NV_Ith_S(yp,0); /* access current derivative values */ - sunrealtype ONE = RCONST(1.0); - sunrealtype TWO = RCONST(2.0); + sunrealtype ONE = SUN_RCONST(1.0); + sunrealtype TWO = SUN_RCONST(2.0); NV_Ith_S(rr,0) = (ONE-alpha)/(t-TWO)*x1 - x1 + (alpha-ONE)*x2 + TWO*exp(t) - x1p; NV_Ith_S(rr,1) = (t+TWO)*x1 - (t+TWO)*SUNRexp(t); @@ -243,8 +243,8 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, sunrealtype *rdata; sunrealtype alpha; sunrealtype a11, a12, a21, b1, b2; - sunrealtype ONE = RCONST(1.0); - sunrealtype TWO = RCONST(2.0); + sunrealtype ONE = SUN_RCONST(1.0); + sunrealtype TWO = SUN_RCONST(2.0); /* retrieve implicit system data from IDA */ retval = IDAGetNonlinearSystemData(LS->content, &tcur, &yypred, &yppred, @@ -328,9 +328,9 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) static void analytical_solution(sunrealtype t, N_Vector y, N_Vector yp) { NV_Ith_S(y,0) = SUNRexp(t); - NV_Ith_S(y,1) = SUNRexp(t)/(t-RCONST(2.0)); + NV_Ith_S(y,1) = SUNRexp(t)/(t-SUN_RCONST(2.0)); NV_Ith_S(yp,0) = SUNRexp(t); - NV_Ith_S(yp,1) = SUNRexp(t)/(t-RCONST(2.0)) - SUNRexp(t)/(t-RCONST(2.0))/(t-RCONST(2.0)); + NV_Ith_S(yp,1) = SUNRexp(t)/(t-SUN_RCONST(2.0)) - SUNRexp(t)/(t-SUN_RCONST(2.0))/(t-SUN_RCONST(2.0)); } /* check the computed solution */ @@ -341,7 +341,7 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at N_Vector ewt; /* error weight vector */ N_Vector abstol; /* absolute tolerance vector */ sunrealtype err; /* wrms error */ - sunrealtype ONE = RCONST(1.0); + sunrealtype ONE = SUN_RCONST(1.0); /* create solution and error weight vectors */ ytrue = N_VClone(y); @@ -354,8 +354,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute the error weight vector, loosen atol */ N_VConst(atol, abstol); N_VAbs(ytrue, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), abstol, ewt); - if (N_VMin(ewt) <= RCONST(0.0)) { + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), abstol, ewt); + if (N_VMin(ewt) <= SUN_RCONST(0.0)) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); } diff --git a/examples/ida/serial/idaFoodWeb_bnd.c b/examples/ida/serial/idaFoodWeb_bnd.c index 6f26180a06..fc976c344e 100644 --- a/examples/ida/serial/idaFoodWeb_bnd.c +++ b/examples/ida/serial/idaFoodWeb_bnd.c @@ -103,30 +103,30 @@ #define NPREY 1 /* No. of prey (= no. of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) -#define FOURPI (RCONST(4.0)*PI) +#define PI SUN_RCONST(3.1415926535898) +#define FOURPI (SUN_RCONST(4.0)*PI) #define MX 20 /* MX = number of x mesh points */ #define MY 20 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NUM_SPECIES*MX*MY) -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* Relative tolerance */ -#define ATOL RCONST(1.e-5) /* Absolute tolerance */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* Relative tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* Absolute tolerance */ #define NOUT 6 /* Number of output times */ -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.) -#define ONE RCONST(1.0) +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ +#define ZERO SUN_RCONST(0.) +#define ONE SUN_RCONST(1.0) /* * User-defined vector and accessor macro: IJ_Vptr. @@ -253,7 +253,7 @@ int main() /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1)) return(1); @@ -433,17 +433,17 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yloc = NSMX * jy; for (jx = 0; jx < MX; jx++) { xx = jx * webdata->dx; - xyfactor = RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); xyfactor *= xyfactor; loc = yloc + NUM_SPECIES*jx; for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; + ccv[loc+is] = SUN_RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { - ccv[loc+is] = RCONST(1.0e5); + ccv[loc+is] = SUN_RCONST(1.0e5); idv[loc+is] = ZERO; } } diff --git a/examples/ida/serial/idaFoodWeb_kry.c b/examples/ida/serial/idaFoodWeb_kry.c index a260b86ea5..fb1eb1c90b 100644 --- a/examples/ida/serial/idaFoodWeb_kry.c +++ b/examples/ida/serial/idaFoodWeb_kry.c @@ -109,30 +109,30 @@ #define NPREY 1 /* No. of prey (= no. of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) -#define FOURPI (RCONST(4.0)*PI) +#define PI SUN_RCONST(3.1415926535898) +#define FOURPI (SUN_RCONST(4.0)*PI) #define MX 20 /* MX = number of x mesh points */ #define MY 20 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NUM_SPECIES*MX*MY) -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* Relative tolerance */ -#define ATOL RCONST(1.e-5) /* Absolute tolerance */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* Relative tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* Absolute tolerance */ #define NOUT 6 /* Number of output times */ -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.) -#define ONE RCONST(1.0) +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ +#define ZERO SUN_RCONST(0.) +#define ONE SUN_RCONST(1.0) /* * User-defined vector and accessor macro: IJ_Vptr. @@ -285,7 +285,7 @@ int main() /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1)) return(1); @@ -413,7 +413,7 @@ static int Precond(sunrealtype tt, del_x = webdata->dx; del_y = webdata->dy; - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; sqru = sqrt(uround); mem = webdata->ida_mem; @@ -571,17 +571,17 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yloc = NSMX * jy; for (jx = 0; jx < MX; jx++) { xx = jx * webdata->dx; - xyfactor = RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); xyfactor *= xyfactor; loc = yloc + NUM_SPECIES*jx; for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; + ccv[loc+is] = SUN_RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { - ccv[loc+is] = RCONST(1.0e5); + ccv[loc+is] = SUN_RCONST(1.0e5); idv[loc+is] = ZERO; } } diff --git a/examples/ida/serial/idaHeat2D_bnd.c b/examples/ida/serial/idaHeat2D_bnd.c index 47a9b5ca8f..38c2ca713e 100644 --- a/examples/ida/serial/idaHeat2D_bnd.c +++ b/examples/ida/serial/idaHeat2D_bnd.c @@ -51,10 +51,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define BVAL RCONST(0.1) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define BVAL SUN_RCONST(0.1) /* Type: UserData */ @@ -133,9 +133,9 @@ int main(void) /* Set remaining input parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ mem = IDACreate(ctx); @@ -250,7 +250,7 @@ int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, for (i = 1; i < mm-1; i++) { loc = offset + i; resv[loc] = upv[loc] - coeff * - (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - RCONST(4.0)*uv[loc]); + (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - SUN_RCONST(4.0)*uv[loc]); } } @@ -291,7 +291,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/ida/serial/idaHeat2D_klu.c b/examples/ida/serial/idaHeat2D_klu.c index 1160b4bb37..57dacb35f3 100644 --- a/examples/ida/serial/idaHeat2D_klu.c +++ b/examples/ida/serial/idaHeat2D_klu.c @@ -52,10 +52,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define BVAL RCONST(0.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define BVAL SUN_RCONST(0.0) #define TOTAL 4*MGRID+8*(MGRID-2)+(MGRID-4)*(MGRID+4*(MGRID-2)) /* total num of nonzero elements */ /* Type: UserData */ @@ -146,9 +146,9 @@ int main(void) /* Set remaining input parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-8); + atol = SUN_RCONST(1.0e-8); /* Call IDACreate and IDAMalloc to initialize solution */ mem = IDACreate(ctx); @@ -275,7 +275,7 @@ int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, for (i = 1; i < mm-1; i++) { loc = offset + i; resv[loc] = upv[loc] - coeff * - (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - RCONST(4.0)*uv[loc]); + (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - SUN_RCONST(4.0)*uv[loc]); } } @@ -290,7 +290,7 @@ int jacHeat3(sunrealtype tt, sunrealtype cj, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { sunrealtype dx = ONE/(MGRID - ONE); - sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype beta = SUN_RCONST(4.0)/(dx*dx) + cj; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); @@ -353,7 +353,7 @@ int jacHeat(sunrealtype tt, sunrealtype cj, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { sunrealtype dx = ONE/(MGRID - ONE); - sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype beta = SUN_RCONST(4.0)/(dx*dx) + cj; int i,j, repeat=0; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); @@ -624,7 +624,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/ida/serial/idaHeat2D_kry.c b/examples/ida/serial/idaHeat2D_kry.c index a0ca85b9f8..2cd19e6075 100644 --- a/examples/ida/serial/idaHeat2D_kry.c +++ b/examples/ida/serial/idaHeat2D_kry.c @@ -50,10 +50,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) /* User data type */ @@ -150,9 +150,9 @@ int main() /* Assign various parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -437,7 +437,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/ida/serial/idaHeat2D_sps.c b/examples/ida/serial/idaHeat2D_sps.c index 9df19886a2..aff94c6e8f 100644 --- a/examples/ida/serial/idaHeat2D_sps.c +++ b/examples/ida/serial/idaHeat2D_sps.c @@ -53,10 +53,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define BVAL RCONST(0.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define BVAL SUN_RCONST(0.0) #define TOTAL 4*MGRID+8*(MGRID-2)+(MGRID-4)*(MGRID+4*(MGRID-2)) /* total num of nonzero elements */ /* Type: UserData */ @@ -147,9 +147,9 @@ int main(void) /* Set remaining input parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-8); + atol = SUN_RCONST(1.0e-8); /* Call IDACreate and IDAMalloc to initialize solution */ mem = IDACreate(ctx); @@ -276,7 +276,7 @@ int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, for (i = 1; i < mm-1; i++) { loc = offset + i; resv[loc] = upv[loc] - coeff * - (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - RCONST(4.0)*uv[loc]); + (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - SUN_RCONST(4.0)*uv[loc]); } } @@ -291,7 +291,7 @@ int jacHeat3(sunrealtype tt, sunrealtype cj, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { sunrealtype dx = ONE/(MGRID - ONE); - sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype beta = SUN_RCONST(4.0)/(dx*dx) + cj; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); sunindextype *rowvals = SUNSparseMatrix_IndexValues(JJ); @@ -354,7 +354,7 @@ int jacHeat(sunrealtype tt, sunrealtype cj, N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) { sunrealtype dx = ONE/(MGRID - ONE); - sunrealtype beta = RCONST(4.0)/(dx*dx) + cj; + sunrealtype beta = SUN_RCONST(4.0)/(dx*dx) + cj; int i,j, repeat=0; sunindextype *colptrs = SUNSparseMatrix_IndexPointers(JJ); @@ -625,7 +625,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/ida/serial/idaKrylovDemo_ls.c b/examples/ida/serial/idaKrylovDemo_ls.c index 2bd08dc2cb..552c3852e5 100644 --- a/examples/ida/serial/idaKrylovDemo_ls.c +++ b/examples/ida/serial/idaKrylovDemo_ls.c @@ -67,10 +67,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) /* Linear Solver Loop Constants */ @@ -182,9 +182,9 @@ int main(int argc, char* argv[]) /* Assign various parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -503,7 +503,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/ida/serial/idaRoberts_dns.c b/examples/ida/serial/idaRoberts_dns.c index 4886b77537..7732aa4883 100644 --- a/examples/ida/serial/idaRoberts_dns.c +++ b/examples/ida/serial/idaRoberts_dns.c @@ -58,8 +58,8 @@ #define NEQ 3 #define NOUT 12 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Macro to define dense matrix elements, indexed from 1. */ @@ -131,20 +131,20 @@ int main(void) yval[2] = ZERO; ypval = N_VGetArrayPointer(yp); - ypval[0] = RCONST(-0.04); - ypval[1] = RCONST(0.04); + ypval[0] = SUN_RCONST(-0.04); + ypval[1] = SUN_RCONST(0.04); ypval[2] = ZERO; - rtol = RCONST(1.0e-4); + rtol = SUN_RCONST(1.0e-4); atval = N_VGetArrayPointer(avtol); - atval[0] = RCONST(1.0e-8); - atval[1] = RCONST(1.0e-6); - atval[2] = RCONST(1.0e-6); + atval[0] = SUN_RCONST(1.0e-8); + atval[1] = SUN_RCONST(1.0e-6); + atval[2] = SUN_RCONST(1.0e-6); /* Integration limits */ t0 = ZERO; - tout1 = RCONST(0.4); + tout1 = SUN_RCONST(0.4); PrintHeader(rtol, avtol, yy); @@ -208,7 +208,7 @@ int main(void) if (retval == IDA_SUCCESS) { iout++; - tout *= RCONST(10.0); + tout *= SUN_RCONST(10.0); } if (iout == NOUT) break; @@ -258,8 +258,8 @@ int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_d ypval = N_VGetArrayPointer(yp); rval = N_VGetArrayPointer(rr); - rval[0] = RCONST(-0.04)*yval[0] + RCONST(1.0e4)*yval[1]*yval[2]; - rval[1] = -rval[0] - RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; + rval[0] = SUN_RCONST(-0.04)*yval[0] + SUN_RCONST(1.0e4)*yval[1]*yval[2]; + rval[1] = -rval[0] - SUN_RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; rval[0] -= ypval[0]; rval[2] = yval[0] + yval[1] + yval[2] - ONE; @@ -277,8 +277,8 @@ static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -296,14 +296,14 @@ int jacrob(sunrealtype tt, sunrealtype cj, yval = N_VGetArrayPointer(yy); - IJth(JJ,1,1) = RCONST(-0.04) - cj; - IJth(JJ,2,1) = RCONST(0.04); + IJth(JJ,1,1) = SUN_RCONST(-0.04) - cj; + IJth(JJ,2,1) = SUN_RCONST(0.04); IJth(JJ,3,1) = ONE; - IJth(JJ,1,2) = RCONST(1.0e4)*yval[2]; - IJth(JJ,2,2) = RCONST(-1.0e4)*yval[2] - RCONST(6.0e7)*yval[1] - cj; + IJth(JJ,1,2) = SUN_RCONST(1.0e4)*yval[2]; + IJth(JJ,2,2) = SUN_RCONST(-1.0e4)*yval[2] - SUN_RCONST(6.0e7)*yval[1] - cj; IJth(JJ,3,2) = ONE; - IJth(JJ,1,3) = RCONST(1.0e4)*yval[1]; - IJth(JJ,2,3) = RCONST(-1.0e4)*yval[1]; + IJth(JJ,1,3) = SUN_RCONST(1.0e4)*yval[1]; + IJth(JJ,2,3) = SUN_RCONST(-1.0e4)*yval[1]; IJth(JJ,3,3) = ONE; return(0); @@ -442,13 +442,13 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(5.2083474251394888e-08); - NV_Ith_S(ref,1) = RCONST(2.0833390772616859e-13); - NV_Ith_S(ref,2) = RCONST(9.9999994791631752e-01); + NV_Ith_S(ref,0) = SUN_RCONST(5.2083474251394888e-08); + NV_Ith_S(ref,1) = SUN_RCONST(2.0833390772616859e-13); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999994791631752e-01); /* compute the error weight vector, loosen atol */ N_VAbs(ref, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), atol, ewt); + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), atol, ewt); if (N_VMin(ewt) <= ZERO) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); diff --git a/examples/ida/serial/idaRoberts_klu.c b/examples/ida/serial/idaRoberts_klu.c index a8d9770f6b..50ba414a42 100644 --- a/examples/ida/serial/idaRoberts_klu.c +++ b/examples/ida/serial/idaRoberts_klu.c @@ -46,8 +46,8 @@ #define NEQ 3 #define NOUT 12 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of functions called by IDA */ @@ -118,20 +118,20 @@ int main(void) yval[2] = ZERO; ypval = N_VGetArrayPointer(yp); - ypval[0] = RCONST(-0.04); - ypval[1] = RCONST(0.04); + ypval[0] = SUN_RCONST(-0.04); + ypval[1] = SUN_RCONST(0.04); ypval[2] = ZERO; - rtol = RCONST(1.0e-4); + rtol = SUN_RCONST(1.0e-4); atval = N_VGetArrayPointer(avtol); - atval[0] = RCONST(1.0e-8); - atval[1] = RCONST(1.0e-6); - atval[2] = RCONST(1.0e-6); + atval[0] = SUN_RCONST(1.0e-8); + atval[1] = SUN_RCONST(1.0e-6); + atval[2] = SUN_RCONST(1.0e-6); /* Integration limits */ t0 = ZERO; - tout1 = RCONST(0.4); + tout1 = SUN_RCONST(0.4); PrintHeader(rtol, avtol, yy); @@ -188,7 +188,7 @@ int main(void) if (retval == IDA_SUCCESS) { iout++; - tout *= RCONST(10.0); + tout *= SUN_RCONST(10.0); } if (iout == NOUT) break; @@ -227,8 +227,8 @@ int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_d ypval = N_VGetArrayPointer(yp); rval = N_VGetArrayPointer(rr); - rval[0] = RCONST(-0.04)*yval[0] + RCONST(1.0e4)*yval[1]*yval[2]; - rval[1] = -rval[0] - RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; + rval[0] = SUN_RCONST(-0.04)*yval[0] + SUN_RCONST(1.0e4)*yval[1]*yval[2]; + rval[1] = -rval[0] - SUN_RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; rval[0] -= ypval[0]; rval[2] = yval[0] + yval[1] + yval[2] - ONE; @@ -246,8 +246,8 @@ static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -276,25 +276,25 @@ int jacrobCSC(sunrealtype tt, sunrealtype cj, colptrs[3] = 9; /* column 0 */ - data[0] = RCONST(-0.04) - cj; + data[0] = SUN_RCONST(-0.04) - cj; rowvals[0] = 0; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); rowvals[1] = 1; data[2] = ONE; rowvals[2] = 2; /* column 1 */ - data[3] = RCONST(1.0e4)*yval[2]; + data[3] = SUN_RCONST(1.0e4)*yval[2]; rowvals[3] = 0; - data[4] = (RCONST(-1.0e4)*yval[2]) - (RCONST(6.0e7)*yval[1]) - cj; + data[4] = (SUN_RCONST(-1.0e4)*yval[2]) - (SUN_RCONST(6.0e7)*yval[1]) - cj; rowvals[4] = 1; data[5] = ONE; rowvals[5] = 2; /* column 2 */ - data[6] = RCONST(1.0e4)*yval[1]; + data[6] = SUN_RCONST(1.0e4)*yval[1]; rowvals[6] = 0; - data[7] = RCONST(-1.0e4)*yval[1]; + data[7] = SUN_RCONST(-1.0e4)*yval[1]; rowvals[7] = 1; data[8] = ONE; rowvals[8] = 2; @@ -325,19 +325,19 @@ int jacrobCSR(sunrealtype tt, sunrealtype cj, rowptrs[3] = 9; /* row 0 */ - data[0] = RCONST(-0.04) - cj; + data[0] = SUN_RCONST(-0.04) - cj; colvals[0] = 0; - data[1] = RCONST(1.0e4)*yval[2]; + data[1] = SUN_RCONST(1.0e4)*yval[2]; colvals[1] = 1; - data[2] = RCONST(1.0e4)*yval[1]; + data[2] = SUN_RCONST(1.0e4)*yval[1]; colvals[2] = 2; /* row 1 */ - data[3] = RCONST(0.04); + data[3] = SUN_RCONST(0.04); colvals[3] = 0; - data[4] = (RCONST(-1.0e4)*yval[2]) - (RCONST(6.0e7)*yval[1]) - cj; + data[4] = (SUN_RCONST(-1.0e4)*yval[2]) - (SUN_RCONST(6.0e7)*yval[1]) - cj; colvals[4] = 1; - data[5] = RCONST(-1.0e4)*yval[1]; + data[5] = SUN_RCONST(-1.0e4)*yval[1]; colvals[5] = 2; /* row 2 */ diff --git a/examples/ida/serial/idaRoberts_sps.c b/examples/ida/serial/idaRoberts_sps.c index 0127ff2500..cb2f3fd881 100644 --- a/examples/ida/serial/idaRoberts_sps.c +++ b/examples/ida/serial/idaRoberts_sps.c @@ -46,8 +46,8 @@ #define NEQ 3 #define NOUT 12 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of functions called by IDA */ @@ -113,20 +113,20 @@ int main(void) yval[2] = ZERO; ypval = N_VGetArrayPointer(yp); - ypval[0] = RCONST(-0.04); - ypval[1] = RCONST(0.04); + ypval[0] = SUN_RCONST(-0.04); + ypval[1] = SUN_RCONST(0.04); ypval[2] = ZERO; - rtol = RCONST(1.0e-4); + rtol = SUN_RCONST(1.0e-4); atval = N_VGetArrayPointer(avtol); - atval[0] = RCONST(1.0e-8); - atval[1] = RCONST(1.0e-6); - atval[2] = RCONST(1.0e-6); + atval[0] = SUN_RCONST(1.0e-8); + atval[1] = SUN_RCONST(1.0e-6); + atval[2] = SUN_RCONST(1.0e-6); /* Integration limits */ t0 = ZERO; - tout1 = RCONST(0.4); + tout1 = SUN_RCONST(0.4); PrintHeader(rtol, avtol, yy); @@ -183,7 +183,7 @@ int main(void) if (retval == IDA_SUCCESS) { iout++; - tout *= RCONST(10.0); + tout *= SUN_RCONST(10.0); } if (iout == NOUT) break; @@ -222,8 +222,8 @@ int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_d ypval = N_VGetArrayPointer(yp); rval = N_VGetArrayPointer(rr); - rval[0] = RCONST(-0.04)*yval[0] + RCONST(1.0e4)*yval[1]*yval[2]; - rval[1] = -rval[0] - RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; + rval[0] = SUN_RCONST(-0.04)*yval[0] + SUN_RCONST(1.0e4)*yval[1]*yval[2]; + rval[1] = -rval[0] - SUN_RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; rval[0] -= ypval[0]; rval[2] = yval[0] + yval[1] + yval[2] - ONE; @@ -241,8 +241,8 @@ static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -271,25 +271,25 @@ int jacrob(sunrealtype tt, sunrealtype cj, colptrs[3] = 9; /* column 0 */ - data[0] = RCONST(-0.04) - cj; + data[0] = SUN_RCONST(-0.04) - cj; rowvals[0] = 0; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); rowvals[1] = 1; data[2] = ONE; rowvals[2] = 2; /* column 1 */ - data[3] = RCONST(1.0e4)*yval[2]; + data[3] = SUN_RCONST(1.0e4)*yval[2]; rowvals[3] = 0; - data[4] = (RCONST(-1.0e4)*yval[2]) - (RCONST(6.0e7)*yval[1]) - cj; + data[4] = (SUN_RCONST(-1.0e4)*yval[2]) - (SUN_RCONST(6.0e7)*yval[1]) - cj; rowvals[4] = 1; data[5] = ONE; rowvals[5] = 2; /* column 2 */ - data[6] = RCONST(1.0e4)*yval[1]; + data[6] = SUN_RCONST(1.0e4)*yval[1]; rowvals[6] = 0; - data[7] = RCONST(-1.0e4)*yval[1]; + data[7] = SUN_RCONST(-1.0e4)*yval[1]; rowvals[7] = 1; data[8] = ONE; rowvals[8] = 2; diff --git a/examples/ida/serial/idaSlCrank_dns.c b/examples/ida/serial/idaSlCrank_dns.c index ab4b77062b..85cf007afd 100644 --- a/examples/ida/serial/idaSlCrank_dns.c +++ b/examples/ida/serial/idaSlCrank_dns.c @@ -35,15 +35,15 @@ #define NEQ 10 -#define TEND RCONST(10.0) +#define TEND SUN_RCONST(10.0) #define NOUT 41 -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) typedef struct { sunrealtype a; @@ -119,8 +119,8 @@ int main(void) NV_Ith_S(id,9) = ZERO; /* Tolerances */ - rtol = RCONST(1.0e-6); - atol = RCONST(1.0e-6); + rtol = SUN_RCONST(1.0e-6); + atol = SUN_RCONST(1.0e-6); /* Integration limits */ t0 = ZERO; diff --git a/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp index b82b260e0e..c005349aca 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp +++ b/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp @@ -60,9 +60,9 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -256,11 +256,11 @@ int main(int argc, char *argv[]) N_VConst(ONE, constraints); sunrealtype t0 = ZERO; - sunrealtype t1 = RCONST(0.01); + sunrealtype t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ sunrealtype rtol = ZERO; - sunrealtype atol = RCONST(1.0e-3); + sunrealtype atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution. */ @@ -992,7 +992,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = dx*i; loc = iloc + jloc*mxsub; - u_1d(loc) = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + u_1d(loc) = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == data->mx - 1 || j == 0 || j == data->my - 1) id_1d(loc) = ZERO; diff --git a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp index 992dd8ba2f..89e068cc95 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp +++ b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp @@ -58,10 +58,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) /* User data type */ @@ -198,9 +198,9 @@ int main(int argc, char *argv[]) /* Assign various parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -517,7 +517,7 @@ static int SetInitialProfile(UserData *data, N_Vector uu, N_Vector up, yfact = data->dx * j; for (i = 0; i < mm; i++) { xfact = data->dx * i; - u_1d(mm*j + i) = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + u_1d(mm*j + i) = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c index 9a4eaf5970..d5cbe085b3 100644 --- a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c @@ -125,30 +125,30 @@ #define NPREY 1 /* No. of prey (= no. of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) -#define FOURPI (RCONST(4.0)*PI) +#define PI SUN_RCONST(3.1415926535898) +#define FOURPI (SUN_RCONST(4.0)*PI) #define MX 20 /* MX = number of x mesh points */ #define MY 20 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NUM_SPECIES*MX*MY) -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* Relative tolerance */ -#define ATOL RCONST(1.e-5) /* Absolute tolerance */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* Relative tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* Absolute tolerance */ #define NOUT 6 /* Number of output times */ -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.) -#define ONE RCONST(1.0) +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ +#define ZERO SUN_RCONST(0.) +#define ONE SUN_RCONST(1.0) /* * User-defined vector and accessor macro: IJ_Vptr. @@ -284,7 +284,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1)) return(1); @@ -467,17 +467,17 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yloc = NSMX * jy; for (jx = 0; jx < MX; jx++) { xx = jx * webdata->dx; - xyfactor = RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); xyfactor *= xyfactor; loc = yloc + NUM_SPECIES*jx; for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; + ccv[loc+is] = SUN_RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { - ccv[loc+is] = RCONST(1.0e5); + ccv[loc+is] = SUN_RCONST(1.0e5); idv[loc+is] = ZERO; } } diff --git a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c index 1ed9d3b477..40a8fa46f3 100644 --- a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c @@ -130,30 +130,30 @@ #define NPREY 1 /* No. of prey (= no. of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) -#define FOURPI (RCONST(4.0)*PI) +#define PI SUN_RCONST(3.1415926535898) +#define FOURPI (SUN_RCONST(4.0)*PI) #define MX 20 /* MX = number of x mesh points */ #define MY 20 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NUM_SPECIES*MX*MY) -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* Relative tolerance */ -#define ATOL RCONST(1.e-5) /* Absolute tolerance */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* Relative tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* Absolute tolerance */ #define NOUT 6 /* Number of output times */ -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.) -#define ONE RCONST(1.0) +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ +#define ZERO SUN_RCONST(0.) +#define ONE SUN_RCONST(1.0) /* * User-defined vector and accessor macro: IJ_Vptr. @@ -310,7 +310,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1)) return(1); @@ -440,7 +440,7 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, del_x = webdata->dx; del_y = webdata->dy; - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; sqru = sqrt(uround); ida_mem = webdata->ida_mem; @@ -599,17 +599,17 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yloc = NSMX * jy; for (jx = 0; jx < MX; jx++) { xx = jx * webdata->dx; - xyfactor = RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); xyfactor *= xyfactor; loc = yloc + NUM_SPECIES*jx; for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; + ccv[loc+is] = SUN_RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { - ccv[loc+is] = RCONST(1.0e5); + ccv[loc+is] = SUN_RCONST(1.0e5); idv[loc+is] = ZERO; } } diff --git a/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c b/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c index 38d10d318a..7de76c0d4b 100644 --- a/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c @@ -85,12 +85,12 @@ /* Problem Constants */ #define NUM_SPECIES 2 -#define ctL RCONST(1.0) /* Domain =[0,L]^2 */ -#define ctA RCONST(1.0) -#define ctB RCONST(3.4) -#define ctEps RCONST(2.0e-3) +#define ctL SUN_RCONST(1.0) /* Domain =[0,L]^2 */ +#define ctA SUN_RCONST(1.0) +#define ctB SUN_RCONST(3.4) +#define ctEps SUN_RCONST(2.0e-3) -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define MXSUB 21 /* Number of x mesh points per processor subgrid */ #define MYSUB 21 /* Number of y mesh points per processor subgrid */ @@ -101,18 +101,18 @@ #define NSMXSUB (NUM_SPECIES * MXSUB) #define NEQ (NUM_SPECIES*MX*MY) /* Number of equations in system */ -#define RTOL RCONST(1.e-5) /* rtol tolerance */ -#define ATOL RCONST(1.e-5) /* atol tolerance */ +#define RTOL SUN_RCONST(1.e-5) /* rtol tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* atol tolerance */ -#define TBEGIN RCONST(0.0) /* Multiplier for tout values */ -#define TEND RCONST(1.0) /* Increment for tout values */ +#define TBEGIN SUN_RCONST(0.0) /* Multiplier for tout values */ +#define TEND SUN_RCONST(1.0) /* Increment for tout values */ #define STEPS 50 -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* User-defined vector accessor macro IJ_Vptr. */ @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1, thispe)) MPI_Abort(comm, 1); @@ -486,8 +486,8 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, x = (ix + ixsub*mxsub) * dx; uvxy = IJ_Vptr(uv,ix,jy); - uvxy[0] = RCONST(1.0) - HALF*cos(PI*y/L); - uvxy[1] = RCONST(3.5) - RCONST(2.5)*cos(PI*x/L); + uvxy[0] = SUN_RCONST(1.0) - HALF*cos(PI*y/L); + uvxy[1] = SUN_RCONST(3.5) - SUN_RCONST(2.5)*cos(PI*x/L); } } diff --git a/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c b/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c index 9d9136d3ca..7639eec6d0 100644 --- a/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c @@ -69,14 +69,14 @@ /* Problem Constants */ #define NUM_SPECIES 2 -#define ctL RCONST(1.0) /* Domain =[0,L]^2 */ -#define ctA RCONST(1.0) -#define ctB RCONST(3.4) -#define ctEps RCONST(2.0e-3) +#define ctL SUN_RCONST(1.0) /* Domain =[0,L]^2 */ +#define ctA SUN_RCONST(1.0) +#define ctB SUN_RCONST(3.4) +#define ctEps SUN_RCONST(2.0e-3) #define NS 2 -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define MXSUB 41 /* Number of x mesh points per processor subgrid */ #define MYSUB 41 /* Number of y mesh points per processor subgrid */ @@ -88,15 +88,15 @@ #define NEQ (NUM_SPECIES*MX*MY) /* Number of equations in system */ -#define RTOL RCONST(1.e-5) /* rtol tolerance */ -#define ATOL RCONST(1.e-5) /* atol tolerance */ +#define RTOL SUN_RCONST(1.e-5) /* rtol tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* atol tolerance */ #define NOUT 6 -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) /* User-defined vector accessor macro IJ_Vptr. */ @@ -311,7 +311,7 @@ int main(int argc, char *argv[]) if(check_retval(&retval, "IDABBDPrecInit", 1, thispe)) MPI_Abort(comm, 1); /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1, thispe)) MPI_Abort(comm, 1); @@ -451,8 +451,8 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, x = (ix + ixsub*mxsub) * dx; uvxy = IJ_Vptr(uv,ix,jy); - uvxy[0] = RCONST(1.0) - HALF*cos(PI*y/L); - uvxy[1] = RCONST(3.5) - RCONST(2.5)*cos(PI*x/L); + uvxy[0] = SUN_RCONST(1.0) - HALF*cos(PI*y/L); + uvxy[1] = SUN_RCONST(3.5) - SUN_RCONST(2.5)*cos(PI*x/L); } } diff --git a/examples/idas/parallel/idasBruss_kry_bbd_p.c b/examples/idas/parallel/idasBruss_kry_bbd_p.c index e1352740c7..8e48071f7a 100644 --- a/examples/idas/parallel/idasBruss_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_kry_bbd_p.c @@ -59,13 +59,13 @@ /* Problem Constants */ #define NUM_SPECIES 2 -#define ctL RCONST(1.0) /* Domain =[0,L]^2 */ -#define ctA RCONST(1.0) -#define ctB RCONST(3.4) -#define ctEps RCONST(2.0e-3) +#define ctL SUN_RCONST(1.0) /* Domain =[0,L]^2 */ +#define ctA SUN_RCONST(1.0) +#define ctB SUN_RCONST(3.4) +#define ctEps SUN_RCONST(2.0e-3) -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define MXSUB 21 /* Number of x mesh points per processor subgrid */ #define MYSUB 21 /* Number of y mesh points per processor subgrid */ @@ -77,15 +77,15 @@ #define NEQ (NUM_SPECIES*MX*MY) /* Number of equations in system */ -#define RTOL RCONST(1.e-5) /* rtol tolerance */ -#define ATOL RCONST(1.e-5) /* atol tolerance */ +#define RTOL SUN_RCONST(1.e-5) /* rtol tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* atol tolerance */ #define NOUT 6 -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) /* User-defined vector accessor macro IJ_Vptr. */ @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) if(check_retval(&retval, "IDABBDPrecInit", 1, thispe)) MPI_Abort(comm, 1); /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1, thispe)) MPI_Abort(comm, 1); @@ -384,8 +384,8 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, x = (ix + ixsub*mxsub) * dx; uvxy = IJ_Vptr(uv,ix,jy); - uvxy[0] = RCONST(1.0) - HALF*cos(PI*y/L); - uvxy[1] = RCONST(3.5) - RCONST(2.5)*cos(PI*x/L); + uvxy[0] = SUN_RCONST(1.0) - HALF*cos(PI*y/L); + uvxy[1] = SUN_RCONST(3.5) - SUN_RCONST(2.5)*cos(PI*x/L); } } diff --git a/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c b/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c index c489c7a498..63c652e236 100644 --- a/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c +++ b/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c @@ -120,8 +120,8 @@ #define NPREY 1 /* Number of prey (= number of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) /* pi */ -#define FOURPI (RCONST(4.0)*PI) /* 4 pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ +#define FOURPI (SUN_RCONST(4.0)*PI) /* 4 pi */ #define MXSUB 10 /* Number of x mesh points per processor subgrid */ #define MYSUB 10 /* Number of y mesh points per processor subgrid */ @@ -131,23 +131,23 @@ #define MY (MYSUB*NPEY) /* MY = number of y mesh points */ #define NSMXSUB (NUM_SPECIES * MXSUB) #define NEQ (NUM_SPECIES*MX*MY) /* Number of equations in system */ -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* rtol tolerance */ -#define ATOL RCONST(1.e-5) /* atol tolerance */ -#define ZERO RCONST(0.) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* rtol tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* atol tolerance */ +#define ZERO SUN_RCONST(0.) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ #define NOUT 6 -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ /* User-defined vector accessor macro IJ_Vptr. */ @@ -342,7 +342,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1, thispe)) MPI_Abort(comm, 1); @@ -494,7 +494,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { if (is < np) - { cxy[is] = RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } + { cxy[is] = SUN_RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } diff --git a/examples/idas/parallel/idasFoodWeb_kry_p.c b/examples/idas/parallel/idasFoodWeb_kry_p.c index a09a046911..460a202505 100644 --- a/examples/idas/parallel/idasFoodWeb_kry_p.c +++ b/examples/idas/parallel/idasFoodWeb_kry_p.c @@ -125,8 +125,8 @@ #define NPREY 1 /* Number of prey (= number of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) /* pi */ -#define FOURPI (RCONST(4.0)*PI) /* 4 pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ +#define FOURPI (SUN_RCONST(4.0)*PI) /* 4 pi */ #define MXSUB 10 /* Number of x mesh points per processor subgrid */ #define MYSUB 10 /* Number of y mesh points per processor subgrid */ @@ -136,23 +136,23 @@ #define MY (MYSUB*NPEY) /* MY = number of y mesh points */ #define NSMXSUB (NUM_SPECIES * MXSUB) #define NEQ (NUM_SPECIES*MX*MY) /* Number of equations in system */ -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* rtol tolerance */ -#define ATOL RCONST(1.e-5) /* atol tolerance */ -#define ZERO RCONST(0.) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* rtol tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* atol tolerance */ +#define ZERO SUN_RCONST(0.) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ #define NOUT 6 -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ /* User-defined vector accessor macro IJ_Vptr. */ @@ -360,7 +360,7 @@ int main(int argc, char *argv[]) /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(ida_mem, IDA_YA_YDP_INIT, tout); if (check_retval(&retval, "IDACalcIC", 1, thispe)) MPI_Abort(comm, 1); @@ -549,13 +549,13 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yy = (jy + jysub*mysub) * dy; for (ix = 0; ix < mxsub; ix++) { xx = (ix + ixsub*mxsub) * dx; - xyfactor = RCONST(16.0)*xx*(ONE - xx)*yy*(ONE - yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE - xx)*yy*(ONE - yy); xyfactor *= xyfactor; cxy = IJ_Vptr(cc,ix,jy); idxy = IJ_Vptr(id,ix,jy); for (is = 0; is < NUM_SPECIES; is++) { - if (is < np) { cxy[is] = RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } + if (is < np) { cxy[is] = SUN_RCONST(10.0) + (sunrealtype)(is+1)*xyfactor; idxy[is] = ONE; } else { cxy[is] = 1.0e5; idxy[is] = ZERO; } } } @@ -1162,7 +1162,7 @@ static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, sunrealtype hh; webdata = (UserData)user_data; - uround = UNIT_ROUNDOFF; + uround = SUN_UNIT_ROUNDOFF; sqru = sqrt(uround); thispe = webdata->thispe; diff --git a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c index 9d7119d0da..b5b5237591 100644 --- a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c +++ b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c @@ -57,9 +57,9 @@ #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -211,12 +211,12 @@ int main(int argc, char *argv[]) SetInitialProfile(uu, up, id, res, data); N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAInit to initialize solution and various IDASet*** functions to specify optional inputs: @@ -753,7 +753,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = data->dx * i; loc = offset + iloc; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == MX-1 || j == 0 || j == MY-1) iddata[loc] = ZERO; } } diff --git a/examples/idas/parallel/idasHeat2D_kry_bbd_p.c b/examples/idas/parallel/idasHeat2D_kry_bbd_p.c index 9ea49bdda3..5f8f17bb73 100644 --- a/examples/idas/parallel/idasHeat2D_kry_bbd_p.c +++ b/examples/idas/parallel/idasHeat2D_kry_bbd_p.c @@ -54,9 +54,9 @@ #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -197,12 +197,12 @@ int main(int argc, char *argv[]) SetInitialProfile(uu, up, id, res, data); N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -695,7 +695,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = data->dx * i; loc = offset + iloc; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == MX-1 || j == 0 || j == MY-1) iddata[loc] = ZERO; } } diff --git a/examples/idas/parallel/idasHeat2D_kry_p.c b/examples/idas/parallel/idasHeat2D_kry_p.c index bb5960bbbe..3b296c6e1e 100644 --- a/examples/idas/parallel/idasHeat2D_kry_p.c +++ b/examples/idas/parallel/idasHeat2D_kry_p.c @@ -52,9 +52,9 @@ #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define NOUT 11 /* Number of output times */ @@ -212,12 +212,12 @@ int main(int argc, char *argv[]) N_VConst(ONE, constraints); - t0 = ZERO; t1 = RCONST(0.01); + t0 = ZERO; t1 = SUN_RCONST(0.01); /* Scalar relative and absolute tolerance. */ rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution. */ @@ -747,7 +747,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, for (i = ixbegin, iloc = 0; i <= ixend; i++, iloc++) { xfact = data->dx * i; loc = offset + iloc; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); if (i == 0 || i == MX-1 || j == 0 || j == MY-1) iddata[loc] = ZERO; } } diff --git a/examples/idas/serial/idasAkzoNob_ASAi_dns.c b/examples/idas/serial/idasAkzoNob_ASAi_dns.c index 8b1a1d253f..d927e946c2 100644 --- a/examples/idas/serial/idasAkzoNob_ASAi_dns.c +++ b/examples/idas/serial/idasAkzoNob_ASAi_dns.c @@ -42,21 +42,21 @@ /* Problem Constants */ #define NEQ 6 -#define T0 RCONST(0.0) +#define T0 SUN_RCONST(0.0) -#define TF RCONST(180.0) /* Final time. */ +#define TF SUN_RCONST(180.0) /* Final time. */ -#define RTOL RCONST(1.0e-08) -#define ATOL RCONST(1.0e-10) -#define RTOLB RCONST(1.0e-06) -#define ATOLB RCONST(1.0e-08) -#define RTOLQ RCONST(1.0e-10) -#define ATOLQ RCONST(1.0e-12) +#define RTOL SUN_RCONST(1.0e-08) +#define ATOL SUN_RCONST(1.0e-10) +#define RTOLB SUN_RCONST(1.0e-06) +#define ATOLB SUN_RCONST(1.0e-08) +#define RTOLQ SUN_RCONST(1.0e-10) +#define ATOLQ SUN_RCONST(1.0e-12) -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define STEPS 150 @@ -94,11 +94,11 @@ int main() SUNContext ctx; /* Consistent IC for y, y'. */ - const sunrealtype y01 = RCONST(0.444); - const sunrealtype y02 = RCONST(0.00123); - const sunrealtype y03 = RCONST(0.0); - const sunrealtype y04 = RCONST(0.007); - const sunrealtype y05 = RCONST(0.0); + const sunrealtype y01 = SUN_RCONST(0.444); + const sunrealtype y02 = SUN_RCONST(0.00123); + const sunrealtype y03 = SUN_RCONST(0.0); + const sunrealtype y04 = SUN_RCONST(0.007); + const sunrealtype y05 = SUN_RCONST(0.0); mem = NULL; yy = yp = NULL; @@ -118,15 +118,15 @@ int main() data = (UserData) malloc(sizeof(*data)); /* Fill user's data with the appropriate values for coefficients. */ - data->k1 = RCONST(18.7); - data->k2 = RCONST(0.58); - data->k3 = RCONST(0.09); - data->k4 = RCONST(0.42); - data->K = RCONST(34.4); - data->klA = RCONST(3.3); - data->Ks = RCONST(115.83); - data->pCO2 = RCONST(0.9); - data->H = RCONST(737.0); + data->k1 = SUN_RCONST(18.7); + data->k2 = SUN_RCONST(0.58); + data->k3 = SUN_RCONST(0.09); + data->k4 = SUN_RCONST(0.42); + data->K = SUN_RCONST(34.4); + data->klA = SUN_RCONST(3.3); + data->Ks = SUN_RCONST(115.83); + data->pCO2 = SUN_RCONST(0.9); + data->H = SUN_RCONST(737.0); /* Allocate N-vectors. */ yy = N_VNew_Serial(NEQ, ctx); @@ -350,9 +350,9 @@ static int rhsQ(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector qdot, void *us return(0); } -#define QUARTER RCONST(0.25) -#define FOUR RCONST(4.0) -#define EIGHT RCONST(8.0) +#define QUARTER SUN_RCONST(0.25) +#define FOUR SUN_RCONST(4.0) +#define EIGHT SUN_RCONST(8.0) /* * resB routine. Residual for adjoint system. diff --git a/examples/idas/serial/idasAkzoNob_dns.c b/examples/idas/serial/idasAkzoNob_dns.c index 7f4496cca8..631fcd5c7f 100644 --- a/examples/idas/serial/idasAkzoNob_dns.c +++ b/examples/idas/serial/idasAkzoNob_dns.c @@ -36,21 +36,21 @@ /* Problem Constants */ #define NEQ 6 -#define T0 RCONST(0.0) -#define T1 RCONST(1e-8) /* first time for output */ +#define T0 SUN_RCONST(0.0) +#define T1 SUN_RCONST(1e-8) /* first time for output */ -#define TF RCONST(180.0) /* Final time. */ +#define TF SUN_RCONST(180.0) /* Final time. */ #define NF 25 /* Total number of outputs. */ -#define RTOL RCONST(1.0e-08) -#define ATOL RCONST(1.0e-10) -#define RTOLQ RCONST(1.0e-10) -#define ATOLQ RCONST(1.0e-12) +#define RTOL SUN_RCONST(1.0e-08) +#define ATOL SUN_RCONST(1.0e-10) +#define RTOLQ SUN_RCONST(1.0e-10) +#define ATOLQ SUN_RCONST(1.0e-12) -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) typedef struct { @@ -82,11 +82,11 @@ int main() SUNContext ctx; /* Consistent IC for y, y'. */ - const sunrealtype y01 = RCONST(0.444); - const sunrealtype y02 = RCONST(0.00123); - const sunrealtype y03 = RCONST(0.0); - const sunrealtype y04 = RCONST(0.007); - const sunrealtype y05 = RCONST(0.0); + const sunrealtype y01 = SUN_RCONST(0.444); + const sunrealtype y02 = SUN_RCONST(0.00123); + const sunrealtype y03 = SUN_RCONST(0.0); + const sunrealtype y04 = SUN_RCONST(0.007); + const sunrealtype y05 = SUN_RCONST(0.0); mem = NULL; yy = yp = NULL; @@ -101,15 +101,15 @@ int main() data = (UserData) malloc(sizeof(*data)); /* Fill user's data with the appropriate values for coefficients. */ - data->k1 = RCONST(18.7); - data->k2 = RCONST(0.58); - data->k3 = RCONST(0.09); - data->k4 = RCONST(0.42); - data->K = RCONST(34.4); - data->klA = RCONST(3.3); - data->Ks = RCONST(115.83); - data->pCO2 = RCONST(0.9); - data->H = RCONST(737.0); + data->k1 = SUN_RCONST(18.7); + data->k2 = SUN_RCONST(0.58); + data->k3 = SUN_RCONST(0.09); + data->k4 = SUN_RCONST(0.42); + data->K = SUN_RCONST(34.4); + data->klA = SUN_RCONST(3.3); + data->Ks = SUN_RCONST(115.83); + data->pCO2 = SUN_RCONST(0.9); + data->H = SUN_RCONST(737.0); /* Allocate N-vectors. */ yy = N_VNew_Serial(NEQ, ctx); diff --git a/examples/idas/serial/idasAnalytic_mels.c b/examples/idas/serial/idasAnalytic_mels.c index b636bf57c1..183a6fc7e9 100644 --- a/examples/idas/serial/idasAnalytic_mels.c +++ b/examples/idas/serial/idasAnalytic_mels.c @@ -68,13 +68,13 @@ int main(void) SUNContext ctx; /* general problem parameters */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(1.0); /* final time */ - sunrealtype dTout = RCONST(0.1); /* time between outputs */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(1.0); /* final time */ + sunrealtype dTout = SUN_RCONST(0.1); /* time between outputs */ sunindextype NEQ = 2; /* number of dependent vars. */ - sunrealtype reltol = RCONST(1.0e-4); /* tolerances */ - sunrealtype abstol = RCONST(1.0e-9); - sunrealtype alpha = RCONST(10.0); /* stiffness parameter */ + sunrealtype reltol = SUN_RCONST(1.0e-4); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-9); + sunrealtype alpha = SUN_RCONST(10.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -193,8 +193,8 @@ int fres(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) sunrealtype x1 = NV_Ith_S(yy,0); /* access current solution values */ sunrealtype x2 = NV_Ith_S(yy,1); sunrealtype x1p = NV_Ith_S(yp,0); /* access current derivative values */ - sunrealtype ONE = RCONST(1.0); - sunrealtype TWO = RCONST(2.0); + sunrealtype ONE = SUN_RCONST(1.0); + sunrealtype TWO = SUN_RCONST(2.0); NV_Ith_S(rr,0) = (ONE-alpha)/(t-TWO)*x1 - x1 + (alpha-ONE)*x2 + TWO*exp(t) - x1p; NV_Ith_S(rr,1) = (t+TWO)*x1 - (t+TWO)*SUNRexp(t); @@ -243,8 +243,8 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, sunrealtype *rdata; sunrealtype alpha; sunrealtype a11, a12, a21, b1, b2; - sunrealtype ONE = RCONST(1.0); - sunrealtype TWO = RCONST(2.0); + sunrealtype ONE = SUN_RCONST(1.0); + sunrealtype TWO = SUN_RCONST(2.0); /* retrieve implicit system data from IDA */ retval = IDAGetNonlinearSystemData(LS->content, &tcur, &yypred, &yppred, @@ -328,9 +328,9 @@ static int check_retval(void *returnvalue, const char *funcname, int opt) static void analytical_solution(sunrealtype t, N_Vector y, N_Vector yp) { NV_Ith_S(y,0) = SUNRexp(t); - NV_Ith_S(y,1) = SUNRexp(t)/(t-RCONST(2.0)); + NV_Ith_S(y,1) = SUNRexp(t)/(t-SUN_RCONST(2.0)); NV_Ith_S(yp,0) = SUNRexp(t); - NV_Ith_S(yp,1) = SUNRexp(t)/(t-RCONST(2.0)) - SUNRexp(t)/(t-RCONST(2.0))/(t-RCONST(2.0)); + NV_Ith_S(yp,1) = SUNRexp(t)/(t-SUN_RCONST(2.0)) - SUNRexp(t)/(t-SUN_RCONST(2.0))/(t-SUN_RCONST(2.0)); } /* check the computed solution */ @@ -341,7 +341,7 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at N_Vector ewt; /* error weight vector */ N_Vector abstol; /* absolute tolerance vector */ sunrealtype err; /* wrms error */ - sunrealtype ONE = RCONST(1.0); + sunrealtype ONE = SUN_RCONST(1.0); /* create solution and error weight vectors */ ytrue = N_VClone(y); @@ -354,8 +354,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute the error weight vector, loosen atol */ N_VConst(atol, abstol); N_VAbs(ytrue, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), abstol, ewt); - if (N_VMin(ewt) <= RCONST(0.0)) { + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), abstol, ewt); + if (N_VMin(ewt) <= SUN_RCONST(0.0)) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); } diff --git a/examples/idas/serial/idasFoodWeb_bnd.c b/examples/idas/serial/idasFoodWeb_bnd.c index 1ac87f180c..84fdb1ecf2 100644 --- a/examples/idas/serial/idasFoodWeb_bnd.c +++ b/examples/idas/serial/idasFoodWeb_bnd.c @@ -103,30 +103,30 @@ #define NPREY 1 /* No. of prey (= no. of predators). */ #define NUM_SPECIES 2*NPREY -#define PI RCONST(3.1415926535898) -#define FOURPI (RCONST(4.0)*PI) +#define PI SUN_RCONST(3.1415926535898) +#define FOURPI (SUN_RCONST(4.0)*PI) #define MX 20 /* MX = number of x mesh points */ #define MY 20 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NUM_SPECIES*MX*MY) -#define AA RCONST(1.0) /* Coefficient in above eqns. for a */ -#define EE RCONST(10000.) /* Coefficient in above eqns. for a */ -#define GG RCONST(0.5e-6) /* Coefficient in above eqns. for a */ -#define BB RCONST(1.0) /* Coefficient in above eqns. for b */ -#define DPREY RCONST(1.0) /* Coefficient in above eqns. for d */ -#define DPRED RCONST(0.05) /* Coefficient in above eqns. for d */ -#define ALPHA RCONST(50.) /* Coefficient alpha in above eqns. */ -#define BETA RCONST(1000.) /* Coefficient beta in above eqns. */ -#define AX RCONST(1.0) /* Total range of x variable */ -#define AY RCONST(1.0) /* Total range of y variable */ -#define RTOL RCONST(1.e-5) /* Relative tolerance */ -#define ATOL RCONST(1.e-5) /* Absolute tolerance */ +#define AA SUN_RCONST(1.0) /* Coefficient in above eqns. for a */ +#define EE SUN_RCONST(10000.) /* Coefficient in above eqns. for a */ +#define GG SUN_RCONST(0.5e-6) /* Coefficient in above eqns. for a */ +#define BB SUN_RCONST(1.0) /* Coefficient in above eqns. for b */ +#define DPREY SUN_RCONST(1.0) /* Coefficient in above eqns. for d */ +#define DPRED SUN_RCONST(0.05) /* Coefficient in above eqns. for d */ +#define ALPHA SUN_RCONST(50.) /* Coefficient alpha in above eqns. */ +#define BETA SUN_RCONST(1000.) /* Coefficient beta in above eqns. */ +#define AX SUN_RCONST(1.0) /* Total range of x variable */ +#define AY SUN_RCONST(1.0) /* Total range of y variable */ +#define RTOL SUN_RCONST(1.e-5) /* Relative tolerance */ +#define ATOL SUN_RCONST(1.e-5) /* Absolute tolerance */ #define NOUT 6 /* Number of output times */ -#define TMULT RCONST(10.0) /* Multiplier for tout values */ -#define TADD RCONST(0.3) /* Increment for tout values */ -#define ZERO RCONST(0.) -#define ONE RCONST(1.0) +#define TMULT SUN_RCONST(10.0) /* Multiplier for tout values */ +#define TADD SUN_RCONST(0.3) /* Increment for tout values */ +#define ZERO SUN_RCONST(0.) +#define ONE SUN_RCONST(1.0) /* * User-defined vector and accessor macro: IJ_Vptr. @@ -253,7 +253,7 @@ int main() /* Call IDACalcIC (with default options) to correct the initial values. */ - tout = RCONST(0.001); + tout = SUN_RCONST(0.001); retval = IDACalcIC(mem, IDA_YA_YDP_INIT, tout); if(check_retval(&retval, "IDACalcIC", 1)) return(1); @@ -433,17 +433,17 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, yloc = NSMX * jy; for (jx = 0; jx < MX; jx++) { xx = jx * webdata->dx; - xyfactor = RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); + xyfactor = SUN_RCONST(16.0)*xx*(ONE-xx)*yy*(ONE-yy); xyfactor *= xyfactor; loc = yloc + NUM_SPECIES*jx; for (is = 0; is < NUM_SPECIES; is++) { if (is < np) { - ccv[loc+is] = RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; + ccv[loc+is] = SUN_RCONST(10.0) + (sunrealtype)(is+1) * xyfactor; idv[loc+is] = ONE; } else { - ccv[loc+is] = RCONST(1.0e5); + ccv[loc+is] = SUN_RCONST(1.0e5); idv[loc+is] = ZERO; } } diff --git a/examples/idas/serial/idasHeat2D_bnd.c b/examples/idas/serial/idasHeat2D_bnd.c index b2f59a9041..b112e92f83 100644 --- a/examples/idas/serial/idasHeat2D_bnd.c +++ b/examples/idas/serial/idasHeat2D_bnd.c @@ -51,10 +51,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define BVAL RCONST(0.1) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define BVAL SUN_RCONST(0.1) /* Type: UserData */ @@ -133,9 +133,9 @@ int main(void) /* Set remaining input parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ mem = IDACreate(ctx); @@ -250,7 +250,7 @@ int heatres(sunrealtype tres, N_Vector uu, N_Vector up, N_Vector resval, for (i = 1; i < mm-1; i++) { loc = offset + i; resv[loc] = upv[loc] - coeff * - (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - RCONST(4.0)*uv[loc]); + (uv[loc-1] + uv[loc+1] + uv[loc-mm] + uv[loc+mm] - SUN_RCONST(4.0)*uv[loc]); } } @@ -291,7 +291,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/idas/serial/idasHeat2D_kry.c b/examples/idas/serial/idasHeat2D_kry.c index 909daecbda..d4bce7fa14 100644 --- a/examples/idas/serial/idasHeat2D_kry.c +++ b/examples/idas/serial/idasHeat2D_kry.c @@ -50,10 +50,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) /* User data type */ @@ -150,9 +150,9 @@ int main() /* Assign various parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -436,7 +436,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/idas/serial/idasHessian_ASA_FSA.c b/examples/idas/serial/idasHessian_ASA_FSA.c index 2d02b7227f..48c5b6373c 100644 --- a/examples/idas/serial/idasHessian_ASA_FSA.c +++ b/examples/idas/serial/idasHessian_ASA_FSA.c @@ -58,25 +58,25 @@ #define NEQ 3 /* number of equations */ #define NP 2 /* number of sensitivities */ -#define T0 RCONST(0.0) /* Initial time. */ -#define TF RCONST(80.0) /* Final time. */ +#define T0 SUN_RCONST(0.0) /* Initial time. */ +#define TF SUN_RCONST(80.0) /* Final time. */ /* Tolerances */ -#define RTOL RCONST(1e-08) /* scalar relative tolerance */ -#define ATOL RCONST(1e-10) /* vector absolute tolerance components */ -#define RTOLA RCONST(1e-08) /* for adjoint integration */ -#define ATOLA RCONST(1e-08) /* for adjoint integration */ +#define RTOL SUN_RCONST(1e-08) /* scalar relative tolerance */ +#define ATOL SUN_RCONST(1e-10) /* vector absolute tolerance components */ +#define RTOLA SUN_RCONST(1e-08) /* for adjoint integration */ +#define ATOLA SUN_RCONST(1e-08) /* for adjoint integration */ /* Parameters */ -#define P1 RCONST(0.04) -#define P2 RCONST(1.0e4) -#define P3 RCONST(3.0e7) +#define P1 SUN_RCONST(0.04) +#define P2 SUN_RCONST(1.0e4) +#define P3 SUN_RCONST(3.0e7) /* Predefined consts */ -#define HALF RCONST(0.5) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define HALF SUN_RCONST(0.5) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* User defined struct */ typedef struct { @@ -364,8 +364,8 @@ int main(int argc, char *argv[]) **********************************/ /* Perturbations are of different magnitudes as p1 and p2 are. */ - dp1 = RCONST(1.0e-3); - dp2 = RCONST(2.5e+2); + dp1 = SUN_RCONST(1.0e-3); + dp2 = SUN_RCONST(2.5e+2); printf("\n"); printf("---------------------------------------------------------\n"); @@ -391,8 +391,8 @@ int main(int argc, char *argv[]) retval = IDAInit(ida_mem, res, ti, yy, yp); - rtolFD = RCONST(1.0e-12); - atolFD = RCONST(1.0e-14); + rtolFD = SUN_RCONST(1.0e-12); + atolFD = SUN_RCONST(1.0e-14); retval = IDASStolerances(ida_mem, rtolFD, atolFD); diff --git a/examples/idas/serial/idasKrylovDemo_ls.c b/examples/idas/serial/idasKrylovDemo_ls.c index f4520f5089..5c3c04e749 100644 --- a/examples/idas/serial/idasKrylovDemo_ls.c +++ b/examples/idas/serial/idasKrylovDemo_ls.c @@ -67,10 +67,10 @@ #define NOUT 11 #define MGRID 10 #define NEQ MGRID*MGRID -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define FOUR RCONST(4.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOUR SUN_RCONST(4.0) /* Linear Solver Loop Constants */ @@ -181,9 +181,9 @@ int main(int argc, char* argv[]) /* Assign various parameters. */ t0 = ZERO; - t1 = RCONST(0.01); + t1 = SUN_RCONST(0.01); rtol = ZERO; - atol = RCONST(1.0e-3); + atol = SUN_RCONST(1.0e-3); /* Call IDACreate and IDAMalloc to initialize solution */ @@ -502,7 +502,7 @@ static int SetInitialProfile(UserData data, N_Vector uu, N_Vector up, for (i = 0;i < mm; i++) { xfact = data->dx * i; loc = offset + i; - udata[loc] = RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); + udata[loc] = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * (ONE - yfact); } } diff --git a/examples/idas/serial/idasRoberts_ASAi_dns.c b/examples/idas/serial/idasRoberts_ASAi_dns.c index 8e8271c6a1..e0b6f4a4c7 100644 --- a/examples/idas/serial/idasRoberts_ASAi_dns.c +++ b/examples/idas/serial/idasRoberts_ASAi_dns.c @@ -67,29 +67,29 @@ #define NEQ 3 /* number of equations */ -#define RTOL RCONST(1e-06) /* scalar relative tolerance */ +#define RTOL SUN_RCONST(1e-06) /* scalar relative tolerance */ -#define ATOL1 RCONST(1e-08) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1e-12) -#define ATOL3 RCONST(1e-08) +#define ATOL1 SUN_RCONST(1e-08) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1e-12) +#define ATOL3 SUN_RCONST(1e-08) -#define ATOLA RCONST(1e-08) /* absolute tolerance for adjoint vars. */ -#define ATOLQ RCONST(1e-06) /* absolute tolerance for quadratures */ +#define ATOLA SUN_RCONST(1e-08) /* absolute tolerance for adjoint vars. */ +#define ATOLQ SUN_RCONST(1e-06) /* absolute tolerance for quadratures */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(4e10) /* final time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(4e10) /* final time */ -#define TB1 RCONST(50.0) /* starting point for adjoint problem */ +#define TB1 SUN_RCONST(50.0) /* starting point for adjoint problem */ #define TB2 TOUT /* starting point for adjoint problem */ -#define T1B RCONST(49.0) /* for IDACalcICB */ +#define T1B SUN_RCONST(49.0) /* for IDACalcICB */ #define STEPS 100 /* number of steps between check points */ #define NP 3 /* number of problem parameters */ -#define ONE RCONST(1.0) -#define ZERO RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -189,9 +189,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Initialize y */ yy = N_VNew_Serial(NEQ, ctx); @@ -203,8 +203,8 @@ int main(int argc, char *argv[]) /* Initialize yprime */ yp = N_VClone(yy); if (check_retval((void *)yp, "N_VNew_Serial", 0)) return(1); - Ith(yp,1) = RCONST(-0.04); - Ith(yp,2) = RCONST( 0.04); + Ith(yp,1) = SUN_RCONST(-0.04); + Ith(yp,2) = SUN_RCONST( 0.04); Ith(yp,3) = ZERO; /* Initialize q */ @@ -449,11 +449,11 @@ int main(int argc, char *argv[]) /* Both algebraic part from y and the entire y' are computed by IDACalcIC. */ Ith(yB,1) = ZERO; Ith(yB,2) = ZERO; - Ith(yB,3) = RCONST(0.50); /* not consistent */ + Ith(yB,3) = SUN_RCONST(0.50); /* not consistent */ /* Rough guess for ypB. */ - Ith(ypB,1) = RCONST(0.80); - Ith(ypB,2) = RCONST(0.75); + Ith(ypB,1) = SUN_RCONST(0.80); + Ith(ypB,2) = SUN_RCONST(0.75); Ith(ypB,3) = ZERO; /* Initialize qB */ @@ -669,8 +669,8 @@ static int resB(sunrealtype tt, /* Load residual. */ Ith(rrB,1) = lp1 + p1*l21 - l3; - Ith(rrB,2) = lp2 - p2*y3*l21 - RCONST(2.0)*p3*y2*l2-l3; - Ith(rrB,3) = - p2*y2*l21 -l3 + RCONST(1.0); + Ith(rrB,2) = lp2 - p2*y3*l21 - SUN_RCONST(2.0)*p3*y2*l2-l3; + Ith(rrB,3) = - p2*y2*l21 -l3 + SUN_RCONST(1.0); return(0); } @@ -696,7 +696,7 @@ static int JacB(sunrealtype tt, sunrealtype cj, IJth(JB,1,3) = -ONE; IJth(JB,2,1) = p2*y3; - IJth(JB,2,2) = -(p2*y3+RCONST(2.0)*p3*y2)+cj; + IJth(JB,2,2) = -(p2*y3+SUN_RCONST(2.0)*p3*y2)+cj; IJth(JB,2,3) = -ONE; IJth(JB,3,1) = p2*y2; diff --git a/examples/idas/serial/idasRoberts_ASAi_klu.c b/examples/idas/serial/idasRoberts_ASAi_klu.c index e7aaebec19..f370968eb0 100644 --- a/examples/idas/serial/idasRoberts_ASAi_klu.c +++ b/examples/idas/serial/idasRoberts_ASAi_klu.c @@ -67,29 +67,29 @@ #define NEQ 3 /* number of equations */ -#define RTOL RCONST(1e-06) /* scalar relative tolerance */ +#define RTOL SUN_RCONST(1e-06) /* scalar relative tolerance */ -#define ATOL1 RCONST(1e-08) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1e-12) -#define ATOL3 RCONST(1e-08) +#define ATOL1 SUN_RCONST(1e-08) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1e-12) +#define ATOL3 SUN_RCONST(1e-08) -#define ATOLA RCONST(1e-08) /* absolute tolerance for adjoint vars. */ -#define ATOLQ RCONST(1e-06) /* absolute tolerance for quadratures */ +#define ATOLA SUN_RCONST(1e-08) /* absolute tolerance for adjoint vars. */ +#define ATOLQ SUN_RCONST(1e-06) /* absolute tolerance for quadratures */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(4e10) /* final time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(4e10) /* final time */ -#define TB1 RCONST(50.0) /* starting point for adjoint problem */ +#define TB1 SUN_RCONST(50.0) /* starting point for adjoint problem */ #define TB2 TOUT /* starting point for adjoint problem */ -#define T1B RCONST(49.0) /* for IDACalcICB */ +#define T1B SUN_RCONST(49.0) /* for IDACalcICB */ #define STEPS 100 /* number of steps between check points */ #define NP 3 /* number of problem parameters */ -#define ONE RCONST(1.0) -#define ZERO RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -189,9 +189,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Initialize y */ yy = N_VNew_Serial(NEQ, ctx); @@ -203,8 +203,8 @@ int main(int argc, char *argv[]) /* Initialize yprime */ yp = N_VClone(yy); if (check_retval((void *)yp, "N_VNew_Serial", 0)) return(1); - Ith(yp,1) = RCONST(-0.04); - Ith(yp,2) = RCONST( 0.04); + Ith(yp,1) = SUN_RCONST(-0.04); + Ith(yp,2) = SUN_RCONST( 0.04); Ith(yp,3) = ZERO; /* Initialize q */ @@ -439,11 +439,11 @@ int main(int argc, char *argv[]) /* Both algebraic part from y and the entire y' are computed by IDACalcIC. */ Ith(yB,1) = ZERO; Ith(yB,2) = ZERO; - Ith(yB,3) = RCONST(0.50); /* not consistent */ + Ith(yB,3) = SUN_RCONST(0.50); /* not consistent */ /* Rough guess for ypB. */ - Ith(ypB,1) = RCONST(0.80); - Ith(ypB,2) = RCONST(0.75); + Ith(ypB,1) = SUN_RCONST(0.80); + Ith(ypB,2) = SUN_RCONST(0.75); Ith(ypB,3) = ZERO; /* Initialize qB */ @@ -677,8 +677,8 @@ static int resB(sunrealtype tt, /* Load residual. */ Ith(rrB,1) = lp1 + p1*l21 - l3; - Ith(rrB,2) = lp2 - p2*y3*l21 - RCONST(2.0)*p3*y2*l2-l3; - Ith(rrB,3) = - p2*y2*l21 -l3 + RCONST(1.0); + Ith(rrB,2) = lp2 - p2*y3*l21 - SUN_RCONST(2.0)*p3*y2*l2-l3; + Ith(rrB,3) = - p2*y2*l21 -l3 + SUN_RCONST(1.0); return(0); } @@ -721,7 +721,7 @@ static int JacB(sunrealtype tt, sunrealtype cjB, /* column 1 */ dataB[3] = p1; rowvalsB[3] = 0; - dataB[4] = -(p2*yvalB[2]+RCONST(2.0)*p3*yvalB[1])+cjB; + dataB[4] = -(p2*yvalB[2]+SUN_RCONST(2.0)*p3*yvalB[1])+cjB; rowvalsB[4] = 1; dataB[5] = -p2*yvalB[1]; rowvalsB[5] = 2; diff --git a/examples/idas/serial/idasRoberts_ASAi_sps.c b/examples/idas/serial/idasRoberts_ASAi_sps.c index 43ea229333..c5b36bfff9 100644 --- a/examples/idas/serial/idasRoberts_ASAi_sps.c +++ b/examples/idas/serial/idasRoberts_ASAi_sps.c @@ -67,29 +67,29 @@ #define NEQ 3 /* number of equations */ -#define RTOL RCONST(1e-06) /* scalar relative tolerance */ +#define RTOL SUN_RCONST(1e-06) /* scalar relative tolerance */ -#define ATOL1 RCONST(1e-08) /* vector absolute tolerance components */ -#define ATOL2 RCONST(1e-12) -#define ATOL3 RCONST(1e-08) +#define ATOL1 SUN_RCONST(1e-08) /* vector absolute tolerance components */ +#define ATOL2 SUN_RCONST(1e-12) +#define ATOL3 SUN_RCONST(1e-08) -#define ATOLA RCONST(1e-08) /* absolute tolerance for adjoint vars. */ -#define ATOLQ RCONST(1e-06) /* absolute tolerance for quadratures */ +#define ATOLA SUN_RCONST(1e-08) /* absolute tolerance for adjoint vars. */ +#define ATOLQ SUN_RCONST(1e-06) /* absolute tolerance for quadratures */ -#define T0 RCONST(0.0) /* initial time */ -#define TOUT RCONST(4e10) /* final time */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define TOUT SUN_RCONST(4e10) /* final time */ -#define TB1 RCONST(50.0) /* starting point for adjoint problem */ +#define TB1 SUN_RCONST(50.0) /* starting point for adjoint problem */ #define TB2 TOUT /* starting point for adjoint problem */ -#define T1B RCONST(49.0) /* for IDACalcICB */ +#define T1B SUN_RCONST(49.0) /* for IDACalcICB */ #define STEPS 100 /* number of steps between check points */ #define NP 3 /* number of problem parameters */ -#define ONE RCONST(1.0) -#define ZERO RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define ZERO SUN_RCONST(0.0) /* Type : UserData */ @@ -189,9 +189,9 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.04); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); + data->p[0] = SUN_RCONST(0.04); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); /* Initialize y */ yy = N_VNew_Serial(NEQ, ctx); @@ -203,8 +203,8 @@ int main(int argc, char *argv[]) /* Initialize yprime */ yp = N_VClone(yy); if (check_retval((void *)yp, "N_VNew_Serial", 0)) return(1); - Ith(yp,1) = RCONST(-0.04); - Ith(yp,2) = RCONST( 0.04); + Ith(yp,1) = SUN_RCONST(-0.04); + Ith(yp,2) = SUN_RCONST( 0.04); Ith(yp,3) = ZERO; /* Initialize q */ @@ -440,11 +440,11 @@ int main(int argc, char *argv[]) /* Both algebraic part from y and the entire y' are computed by IDACalcIC. */ Ith(yB,1) = ZERO; Ith(yB,2) = ZERO; - Ith(yB,3) = RCONST(0.50); /* not consistent */ + Ith(yB,3) = SUN_RCONST(0.50); /* not consistent */ /* Rough guess for ypB. */ - Ith(ypB,1) = RCONST(0.80); - Ith(ypB,2) = RCONST(0.75); + Ith(ypB,1) = SUN_RCONST(0.80); + Ith(ypB,2) = SUN_RCONST(0.75); Ith(ypB,3) = ZERO; /* Initialize qB */ @@ -678,8 +678,8 @@ static int resB(sunrealtype tt, /* Load residual. */ Ith(rrB,1) = lp1 + p1*l21 - l3; - Ith(rrB,2) = lp2 - p2*y3*l21 - RCONST(2.0)*p3*y2*l2-l3; - Ith(rrB,3) = - p2*y2*l21 -l3 + RCONST(1.0); + Ith(rrB,2) = lp2 - p2*y3*l21 - SUN_RCONST(2.0)*p3*y2*l2-l3; + Ith(rrB,3) = - p2*y2*l21 -l3 + SUN_RCONST(1.0); return(0); } @@ -722,7 +722,7 @@ static int JacB(sunrealtype tt, sunrealtype cjB, /* column 1 */ dataB[3] = p1; rowvalsB[3] = 0; - dataB[4] = -(p2*yvalB[2]+RCONST(2.0)*p3*yvalB[1])+cjB; + dataB[4] = -(p2*yvalB[2]+SUN_RCONST(2.0)*p3*yvalB[1])+cjB; rowvalsB[4] = 1; dataB[5] = -p2*yvalB[1]; rowvalsB[5] = 2; diff --git a/examples/idas/serial/idasRoberts_FSA_dns.c b/examples/idas/serial/idasRoberts_FSA_dns.c index f9820fc39f..adae35014b 100644 --- a/examples/idas/serial/idasRoberts_FSA_dns.c +++ b/examples/idas/serial/idasRoberts_FSA_dns.c @@ -61,16 +61,16 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define NP 3 /* number of problem parameters */ #define NS 3 /* number of sensitivities computed */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Type : UserData */ @@ -152,10 +152,10 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.040); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); - data->coef = RCONST(0.5); + data->p[0] = SUN_RCONST(0.040); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); + data->coef = SUN_RCONST(0.5); /* Initial conditions */ y = N_VNew_Serial(NEQ, ctx); @@ -169,7 +169,7 @@ int main(int argc, char *argv[]) if(check_retval((void *)yp, "N_VNew_Serial", 0)) return(1); /* These initial conditions are NOT consistent. See IDACalcIC below. */ - Ith(yp,1) = RCONST(0.1); + Ith(yp,1) = SUN_RCONST(0.1); Ith(yp,2) = ZERO; Ith(yp,3) = ZERO; @@ -182,11 +182,11 @@ int main(int argc, char *argv[]) if (check_retval(&retval, "IDAInit", 1)) return(1); /* Specify scalar relative tol. and vector absolute tol. */ - reltol = RCONST(1.0e-6); + reltol = SUN_RCONST(1.0e-6); abstol = N_VClone(y); - Ith(abstol,1) = RCONST(1.0e-8); - Ith(abstol,2) = RCONST(1.0e-14); - Ith(abstol,3) = RCONST(1.0e-6); + Ith(abstol,1) = SUN_RCONST(1.0e-8); + Ith(abstol,2) = SUN_RCONST(1.0e-14); + Ith(abstol,3) = SUN_RCONST(1.0e-6); retval = IDASVtolerances(ida_mem, reltol, abstol); if (check_retval(&retval, "IDASVtolerances", 1)) return(1); diff --git a/examples/idas/serial/idasRoberts_FSA_klu.c b/examples/idas/serial/idasRoberts_FSA_klu.c index a65bc4c181..80abcc02dd 100644 --- a/examples/idas/serial/idasRoberts_FSA_klu.c +++ b/examples/idas/serial/idasRoberts_FSA_klu.c @@ -64,16 +64,16 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define NP 3 /* number of problem parameters */ #define NS 3 /* number of sensitivities computed */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Type : UserData */ @@ -159,10 +159,10 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.040); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); - data->coef = RCONST(0.5); + data->p[0] = SUN_RCONST(0.040); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); + data->coef = SUN_RCONST(0.5); /* Initial conditions */ y = N_VNew_Serial(NEQ, ctx); @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) if(check_retval((void *)yp, "N_VNew_Serial", 0)) return(1); /* These initial conditions are NOT consistent. See IDACalcIC below. */ - Ith(yp,1) = RCONST(0.1); + Ith(yp,1) = SUN_RCONST(0.1); Ith(yp,2) = ZERO; Ith(yp,3) = ZERO; @@ -189,11 +189,11 @@ int main(int argc, char *argv[]) if (check_retval(&retval, "IDAInit", 1)) return(1); /* Specify scalar relative tol. and vector absolute tol. */ - reltol = RCONST(1.0e-6); + reltol = SUN_RCONST(1.0e-6); abstol = N_VClone(y); - Ith(abstol,1) = RCONST(1.0e-8); - Ith(abstol,2) = RCONST(1.0e-14); - Ith(abstol,3) = RCONST(1.0e-6); + Ith(abstol,1) = SUN_RCONST(1.0e-8); + Ith(abstol,2) = SUN_RCONST(1.0e-14); + Ith(abstol,3) = SUN_RCONST(1.0e-6); retval = IDASVtolerances(ida_mem, reltol, abstol); if (check_retval(&retval, "IDASVtolerances", 1)) return(1); diff --git a/examples/idas/serial/idasRoberts_FSA_sps.c b/examples/idas/serial/idasRoberts_FSA_sps.c index 02b9ac327d..9a574a1a09 100644 --- a/examples/idas/serial/idasRoberts_FSA_sps.c +++ b/examples/idas/serial/idasRoberts_FSA_sps.c @@ -64,16 +64,16 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define T0 RCONST(0.0) /* initial time */ -#define T1 RCONST(0.4) /* first output time */ -#define TMULT RCONST(10.0) /* output time factor */ +#define T0 SUN_RCONST(0.0) /* initial time */ +#define T1 SUN_RCONST(0.4) /* first output time */ +#define TMULT SUN_RCONST(10.0) /* output time factor */ #define NOUT 12 /* number of output times */ #define NP 3 /* number of problem parameters */ #define NS 3 /* number of sensitivities computed */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Type : UserData */ @@ -159,10 +159,10 @@ int main(int argc, char *argv[]) /* User data structure */ data = (UserData) malloc(sizeof *data); if (check_retval((void *)data, "malloc", 2)) return(1); - data->p[0] = RCONST(0.040); - data->p[1] = RCONST(1.0e4); - data->p[2] = RCONST(3.0e7); - data->coef = RCONST(0.5); + data->p[0] = SUN_RCONST(0.040); + data->p[1] = SUN_RCONST(1.0e4); + data->p[2] = SUN_RCONST(3.0e7); + data->coef = SUN_RCONST(0.5); /* Initial conditions */ y = N_VNew_Serial(NEQ, ctx); @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) if(check_retval((void *)yp, "N_VNew_Serial", 0)) return(1); /* These initial conditions are NOT consistent. See IDACalcIC below. */ - Ith(yp,1) = RCONST(0.1); + Ith(yp,1) = SUN_RCONST(0.1); Ith(yp,2) = ZERO; Ith(yp,3) = ZERO; @@ -189,11 +189,11 @@ int main(int argc, char *argv[]) if (check_retval(&retval, "IDAInit", 1)) return(1); /* Specify scalar relative tol. and vector absolute tol. */ - reltol = RCONST(1.0e-6); + reltol = SUN_RCONST(1.0e-6); abstol = N_VClone(y); - Ith(abstol,1) = RCONST(1.0e-8); - Ith(abstol,2) = RCONST(1.0e-14); - Ith(abstol,3) = RCONST(1.0e-6); + Ith(abstol,1) = SUN_RCONST(1.0e-8); + Ith(abstol,2) = SUN_RCONST(1.0e-14); + Ith(abstol,3) = SUN_RCONST(1.0e-6); retval = IDASVtolerances(ida_mem, reltol, abstol); if (check_retval(&retval, "IDASVtolerances", 1)) return(1); diff --git a/examples/idas/serial/idasRoberts_dns.c b/examples/idas/serial/idasRoberts_dns.c index dff54ccb05..02733bf78a 100644 --- a/examples/idas/serial/idasRoberts_dns.c +++ b/examples/idas/serial/idasRoberts_dns.c @@ -58,8 +58,8 @@ #define NEQ 3 #define NOUT 12 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Macro to define dense matrix elements, indexed from 1. */ @@ -131,20 +131,20 @@ int main(void) yval[2] = ZERO; ypval = N_VGetArrayPointer(yp); - ypval[0] = RCONST(-0.04); - ypval[1] = RCONST(0.04); + ypval[0] = SUN_RCONST(-0.04); + ypval[1] = SUN_RCONST(0.04); ypval[2] = ZERO; - rtol = RCONST(1.0e-4); + rtol = SUN_RCONST(1.0e-4); atval = N_VGetArrayPointer(avtol); - atval[0] = RCONST(1.0e-8); - atval[1] = RCONST(1.0e-6); - atval[2] = RCONST(1.0e-6); + atval[0] = SUN_RCONST(1.0e-8); + atval[1] = SUN_RCONST(1.0e-6); + atval[2] = SUN_RCONST(1.0e-6); /* Integration limits */ t0 = ZERO; - tout1 = RCONST(0.4); + tout1 = SUN_RCONST(0.4); PrintHeader(rtol, avtol, yy); @@ -208,7 +208,7 @@ int main(void) if (retval == IDA_SUCCESS) { iout++; - tout *= RCONST(10.0); + tout *= SUN_RCONST(10.0); } if (iout == NOUT) break; @@ -258,8 +258,8 @@ int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_d ypval = N_VGetArrayPointer(yp); rval = N_VGetArrayPointer(rr); - rval[0] = RCONST(-0.04)*yval[0] + RCONST(1.0e4)*yval[1]*yval[2]; - rval[1] = -rval[0] - RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; + rval[0] = SUN_RCONST(-0.04)*yval[0] + SUN_RCONST(1.0e4)*yval[1]*yval[2]; + rval[1] = -rval[0] - SUN_RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; rval[0] -= ypval[0]; rval[2] = yval[0] + yval[1] + yval[2] - ONE; @@ -277,8 +277,8 @@ static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -296,14 +296,14 @@ int jacrob(sunrealtype tt, sunrealtype cj, yval = N_VGetArrayPointer(yy); - IJth(JJ,1,1) = RCONST(-0.04) - cj; - IJth(JJ,2,1) = RCONST(0.04); + IJth(JJ,1,1) = SUN_RCONST(-0.04) - cj; + IJth(JJ,2,1) = SUN_RCONST(0.04); IJth(JJ,3,1) = ONE; - IJth(JJ,1,2) = RCONST(1.0e4)*yval[2]; - IJth(JJ,2,2) = RCONST(-1.0e4)*yval[2] - RCONST(6.0e7)*yval[1] - cj; + IJth(JJ,1,2) = SUN_RCONST(1.0e4)*yval[2]; + IJth(JJ,2,2) = SUN_RCONST(-1.0e4)*yval[2] - SUN_RCONST(6.0e7)*yval[1] - cj; IJth(JJ,3,2) = ONE; - IJth(JJ,1,3) = RCONST(1.0e4)*yval[1]; - IJth(JJ,2,3) = RCONST(-1.0e4)*yval[1]; + IJth(JJ,1,3) = SUN_RCONST(1.0e4)*yval[1]; + IJth(JJ,2,3) = SUN_RCONST(-1.0e4)*yval[1]; IJth(JJ,3,3) = ONE; return(0); @@ -442,13 +442,13 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) ewt = N_VClone(y); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(5.2083474251394888e-08); - NV_Ith_S(ref,1) = RCONST(2.0833390772616859e-13); - NV_Ith_S(ref,2) = RCONST(9.9999994791631752e-01); + NV_Ith_S(ref,0) = SUN_RCONST(5.2083474251394888e-08); + NV_Ith_S(ref,1) = SUN_RCONST(2.0833390772616859e-13); + NV_Ith_S(ref,2) = SUN_RCONST(9.9999994791631752e-01); /* compute the error weight vector, loosen atol */ N_VAbs(ref, ewt); - N_VLinearSum(rtol, ewt, RCONST(10.0), atol, ewt); + N_VLinearSum(rtol, ewt, SUN_RCONST(10.0), atol, ewt); if (N_VMin(ewt) <= ZERO) { fprintf(stderr, "\nSUNDIALS_ERROR: check_ans failed - ewt <= 0\n\n"); return(-1); diff --git a/examples/idas/serial/idasRoberts_klu.c b/examples/idas/serial/idasRoberts_klu.c index 0994cc447a..25bda3a3fc 100644 --- a/examples/idas/serial/idasRoberts_klu.c +++ b/examples/idas/serial/idasRoberts_klu.c @@ -46,8 +46,8 @@ #define NEQ 3 #define NOUT 12 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of functions called by IDA */ @@ -118,20 +118,20 @@ int main(void) yval[2] = ZERO; ypval = N_VGetArrayPointer(yp); - ypval[0] = RCONST(-0.04); - ypval[1] = RCONST(0.04); + ypval[0] = SUN_RCONST(-0.04); + ypval[1] = SUN_RCONST(0.04); ypval[2] = ZERO; - rtol = RCONST(1.0e-4); + rtol = SUN_RCONST(1.0e-4); atval = N_VGetArrayPointer(avtol); - atval[0] = RCONST(1.0e-8); - atval[1] = RCONST(1.0e-6); - atval[2] = RCONST(1.0e-6); + atval[0] = SUN_RCONST(1.0e-8); + atval[1] = SUN_RCONST(1.0e-6); + atval[2] = SUN_RCONST(1.0e-6); /* Integration limits */ t0 = ZERO; - tout1 = RCONST(0.4); + tout1 = SUN_RCONST(0.4); PrintHeader(rtol, avtol, yy); @@ -188,7 +188,7 @@ int main(void) if (retval == IDA_SUCCESS) { iout++; - tout *= RCONST(10.0); + tout *= SUN_RCONST(10.0); } if (iout == NOUT) break; @@ -227,8 +227,8 @@ int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_d ypval = N_VGetArrayPointer(yp); rval = N_VGetArrayPointer(rr); - rval[0] = RCONST(-0.04)*yval[0] + RCONST(1.0e4)*yval[1]*yval[2]; - rval[1] = -rval[0] - RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; + rval[0] = SUN_RCONST(-0.04)*yval[0] + SUN_RCONST(1.0e4)*yval[1]*yval[2]; + rval[1] = -rval[0] - SUN_RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; rval[0] -= ypval[0]; rval[2] = yval[0] + yval[1] + yval[2] - ONE; @@ -246,8 +246,8 @@ static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -276,25 +276,25 @@ int jacrobCSC(sunrealtype tt, sunrealtype cj, colptrs[3] = 9; /* column 0 */ - data[0] = RCONST(-0.04) - cj; + data[0] = SUN_RCONST(-0.04) - cj; rowvals[0] = 0; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); rowvals[1] = 1; data[2] = ONE; rowvals[2] = 2; /* column 1 */ - data[3] = RCONST(1.0e4)*yval[2]; + data[3] = SUN_RCONST(1.0e4)*yval[2]; rowvals[3] = 0; - data[4] = (RCONST(-1.0e4)*yval[2]) - (RCONST(6.0e7)*yval[1]) - cj; + data[4] = (SUN_RCONST(-1.0e4)*yval[2]) - (SUN_RCONST(6.0e7)*yval[1]) - cj; rowvals[4] = 1; data[5] = ONE; rowvals[5] = 2; /* column 2 */ - data[6] = RCONST(1.0e4)*yval[1]; + data[6] = SUN_RCONST(1.0e4)*yval[1]; rowvals[6] = 0; - data[7] = RCONST(-1.0e4)*yval[1]; + data[7] = SUN_RCONST(-1.0e4)*yval[1]; rowvals[7] = 1; data[8] = ONE; rowvals[8] = 2; @@ -325,19 +325,19 @@ int jacrobCSR(sunrealtype tt, sunrealtype cj, rowptrs[3] = 9; /* row 0 */ - data[0] = RCONST(-0.04) - cj; + data[0] = SUN_RCONST(-0.04) - cj; colvals[0] = 0; - data[1] = RCONST(1.0e4)*yval[2]; + data[1] = SUN_RCONST(1.0e4)*yval[2]; colvals[1] = 1; - data[2] = RCONST(1.0e4)*yval[1]; + data[2] = SUN_RCONST(1.0e4)*yval[1]; colvals[2] = 2; /* row 1 */ - data[3] = RCONST(0.04); + data[3] = SUN_RCONST(0.04); colvals[3] = 0; - data[4] = (RCONST(-1.0e4)*yval[2]) - (RCONST(6.0e7)*yval[1]) - cj; + data[4] = (SUN_RCONST(-1.0e4)*yval[2]) - (SUN_RCONST(6.0e7)*yval[1]) - cj; colvals[4] = 1; - data[5] = RCONST(-1.0e4)*yval[1]; + data[5] = SUN_RCONST(-1.0e4)*yval[1]; colvals[5] = 2; /* row 2 */ diff --git a/examples/idas/serial/idasRoberts_sps.c b/examples/idas/serial/idasRoberts_sps.c index e762afd969..8abf326224 100644 --- a/examples/idas/serial/idasRoberts_sps.c +++ b/examples/idas/serial/idasRoberts_sps.c @@ -46,8 +46,8 @@ #define NEQ 3 #define NOUT 12 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of functions called by IDA */ @@ -113,20 +113,20 @@ int main(void) yval[2] = ZERO; ypval = N_VGetArrayPointer(yp); - ypval[0] = RCONST(-0.04); - ypval[1] = RCONST(0.04); + ypval[0] = SUN_RCONST(-0.04); + ypval[1] = SUN_RCONST(0.04); ypval[2] = ZERO; - rtol = RCONST(1.0e-4); + rtol = SUN_RCONST(1.0e-4); atval = N_VGetArrayPointer(avtol); - atval[0] = RCONST(1.0e-8); - atval[1] = RCONST(1.0e-6); - atval[2] = RCONST(1.0e-6); + atval[0] = SUN_RCONST(1.0e-8); + atval[1] = SUN_RCONST(1.0e-6); + atval[2] = SUN_RCONST(1.0e-6); /* Integration limits */ t0 = ZERO; - tout1 = RCONST(0.4); + tout1 = SUN_RCONST(0.4); PrintHeader(rtol, avtol, yy); @@ -183,7 +183,7 @@ int main(void) if (retval == IDA_SUCCESS) { iout++; - tout *= RCONST(10.0); + tout *= SUN_RCONST(10.0); } if (iout == NOUT) break; @@ -222,8 +222,8 @@ int resrob(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rr, void *user_d ypval = N_VGetArrayPointer(yp); rval = N_VGetArrayPointer(rr); - rval[0] = RCONST(-0.04)*yval[0] + RCONST(1.0e4)*yval[1]*yval[2]; - rval[1] = -rval[0] - RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; + rval[0] = SUN_RCONST(-0.04)*yval[0] + SUN_RCONST(1.0e4)*yval[1]*yval[2]; + rval[1] = -rval[0] - SUN_RCONST(3.0e7)*yval[1]*yval[1] - ypval[1]; rval[0] -= ypval[0]; rval[2] = yval[0] + yval[1] + yval[2] - ONE; @@ -241,8 +241,8 @@ static int grob(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype *gout, yval = N_VGetArrayPointer(yy); y1 = yval[0]; y3 = yval[2]; - gout[0] = y1 - RCONST(0.0001); - gout[1] = y3 - RCONST(0.01); + gout[0] = y1 - SUN_RCONST(0.0001); + gout[1] = y3 - SUN_RCONST(0.01); return(0); } @@ -271,25 +271,25 @@ int jacrob(sunrealtype tt, sunrealtype cj, colptrs[3] = 9; /* column 0 */ - data[0] = RCONST(-0.04) - cj; + data[0] = SUN_RCONST(-0.04) - cj; rowvals[0] = 0; - data[1] = RCONST(0.04); + data[1] = SUN_RCONST(0.04); rowvals[1] = 1; data[2] = ONE; rowvals[2] = 2; /* column 1 */ - data[3] = RCONST(1.0e4)*yval[2]; + data[3] = SUN_RCONST(1.0e4)*yval[2]; rowvals[3] = 0; - data[4] = (RCONST(-1.0e4)*yval[2]) - (RCONST(6.0e7)*yval[1]) - cj; + data[4] = (SUN_RCONST(-1.0e4)*yval[2]) - (SUN_RCONST(6.0e7)*yval[1]) - cj; rowvals[4] = 1; data[5] = ONE; rowvals[5] = 2; /* column 2 */ - data[6] = RCONST(1.0e4)*yval[1]; + data[6] = SUN_RCONST(1.0e4)*yval[1]; rowvals[6] = 0; - data[7] = RCONST(-1.0e4)*yval[1]; + data[7] = SUN_RCONST(-1.0e4)*yval[1]; rowvals[7] = 1; data[8] = ONE; rowvals[8] = 2; diff --git a/examples/idas/serial/idasSlCrank_FSA_dns.c b/examples/idas/serial/idasSlCrank_FSA_dns.c index 25ae1a46e9..5d86efcde5 100644 --- a/examples/idas/serial/idasSlCrank_FSA_dns.c +++ b/examples/idas/serial/idasSlCrank_FSA_dns.c @@ -46,25 +46,25 @@ #define NEQ 10 #define NP 2 -#define TBEGIN RCONST(0.0) -#define TEND RCONST(10.000) +#define TBEGIN SUN_RCONST(0.0) +#define TEND SUN_RCONST(10.000) -#define RTOLF RCONST(1.0e-06) -#define ATOLF RCONST(1.0e-07) +#define RTOLF SUN_RCONST(1.0e-06) +#define ATOLF SUN_RCONST(1.0e-07) -#define RTOLQ RCONST(1.0e-06) -#define ATOLQ RCONST(1.0e-08) +#define RTOLQ SUN_RCONST(1.0e-06) +#define ATOLQ SUN_RCONST(1.0e-08) -#define RTOLFD RCONST(1.0e-06) -#define ATOLFD RCONST(1.0e-08) +#define RTOLFD SUN_RCONST(1.0e-06) +#define ATOLFD SUN_RCONST(1.0e-08) -#define ZERO RCONST(0.00) -#define QUARTER RCONST(0.25) -#define HALF RCONST(0.50) -#define ONE RCONST(1.00) -#define TWO RCONST(2.00) -#define FOUR RCONST(4.00) +#define ZERO SUN_RCONST(0.00) +#define QUARTER SUN_RCONST(0.25) +#define HALF SUN_RCONST(0.50) +#define ONE SUN_RCONST(1.00) +#define TWO SUN_RCONST(2.00) +#define FOUR SUN_RCONST(4.00) typedef struct { sunrealtype a; diff --git a/examples/idas/serial/idasSlCrank_dns.c b/examples/idas/serial/idasSlCrank_dns.c index 4871676fa2..29a56cbb6b 100644 --- a/examples/idas/serial/idasSlCrank_dns.c +++ b/examples/idas/serial/idasSlCrank_dns.c @@ -44,23 +44,23 @@ #define NEQ 10 -#define TBEGIN RCONST(0.0) -#define TEND RCONST(10.0) +#define TBEGIN SUN_RCONST(0.0) +#define TEND SUN_RCONST(10.0) #define NOUT 25 -#define RTOLF RCONST(1.0e-06) -#define ATOLF RCONST(1.0e-07) +#define RTOLF SUN_RCONST(1.0e-06) +#define ATOLF SUN_RCONST(1.0e-07) -#define RTOLQ RCONST(1.0e-06) -#define ATOLQ RCONST(1.0e-08) +#define RTOLQ SUN_RCONST(1.0e-06) +#define ATOLQ SUN_RCONST(1.0e-08) -#define ZERO RCONST(0.00) -#define QUARTER RCONST(0.25) -#define HALF RCONST(0.50) -#define ONE RCONST(1.00) -#define TWO RCONST(2.00) -#define FOUR RCONST(4.00) +#define ZERO SUN_RCONST(0.00) +#define QUARTER SUN_RCONST(0.25) +#define HALF SUN_RCONST(0.50) +#define ONE SUN_RCONST(1.00) +#define TWO SUN_RCONST(2.00) +#define FOUR SUN_RCONST(4.00) typedef struct { sunrealtype a; diff --git a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu index 2e1de78777..1f40b587e6 100644 --- a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu +++ b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu @@ -493,9 +493,9 @@ static int SetStartGuess(N_Vector u, UserData* udata) for (sunindextype i = 0; i < udata->nodes_loc; i++) { - u_host[3 * i] = RCONST(0.25); - u_host[3 * i + 1] = RCONST(3.0); - u_host[3 * i + 2] = RCONST(0.75); + u_host[3 * i] = SUN_RCONST(0.25); + u_host[3 * i + 1] = SUN_RCONST(3.0); + u_host[3 * i + 2] = SUN_RCONST(0.75); } N_VCopyToDevice_Cuda(N_VGetLocalVector_MPIPlusX(u)); @@ -606,7 +606,7 @@ static int InitUserData(UserData *udata) udata->nodes = udata->nodes_loc * udata->nprocs_w; // Integrator settings - udata->rtol = RCONST(1.e-8); // relative tolerance + udata->rtol = SUN_RCONST(1.e-8); // relative tolerance udata->maa = 3; // 3 vectors in Anderson Acceleration space udata->damping = ONE; // no damping for Anderson Acceleration udata->orthaa = 0; // use MGS for Anderson Acceleration diff --git a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp index afc23219e2..6a5e03b543 100644 --- a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp +++ b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp @@ -31,15 +31,15 @@ #include "mpi.h" // MPI header file // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define HALF RCONST(0.5) -#define PTTHREE RCONST(0.3) -#define PTFOUR RCONST(0.4) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) -#define TEN RCONST(10.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define HALF SUN_RCONST(0.5) +#define PTTHREE SUN_RCONST(0.3) +#define PTFOUR SUN_RCONST(0.4) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) +#define TEN SUN_RCONST(10.0) // Maximum size of output directory string #define MXSTR 2048 diff --git a/examples/kinsol/CXX_parallel/kin_em_p.cpp b/examples/kinsol/CXX_parallel/kin_em_p.cpp index 5ab1419481..f26a264427 100644 --- a/examples/kinsol/CXX_parallel/kin_em_p.cpp +++ b/examples/kinsol/CXX_parallel/kin_em_p.cpp @@ -421,9 +421,9 @@ static int SetStartGuess(N_Vector u, UserData* udata) for (sunindextype i = 0; i < udata->nodes_loc; i++) { - u_host[3 * i] = RCONST(0.25); - u_host[3 * i + 1] = RCONST(3.0); - u_host[3 * i + 2] = RCONST(0.75); + u_host[3 * i] = SUN_RCONST(0.25); + u_host[3 * i + 1] = SUN_RCONST(3.0); + u_host[3 * i + 2] = SUN_RCONST(0.75); } // Return success @@ -566,7 +566,7 @@ static int InitUserData(UserData *udata) udata->nodes = udata->nodes_loc * udata->nprocs_w; // Integrator settings - udata->rtol = RCONST(1.e-8); // relative tolerance + udata->rtol = SUN_RCONST(1.e-8); // relative tolerance udata->maa = 3; // 3 vectors in Anderson Acceleration space udata->damping = ONE; // no damping for Anderson Acceleration udata->orthaa = 0; // use MGS for Anderson Acceleration diff --git a/examples/kinsol/CXX_parallel/kin_em_p.hpp b/examples/kinsol/CXX_parallel/kin_em_p.hpp index 4895c33842..c02f08db89 100644 --- a/examples/kinsol/CXX_parallel/kin_em_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_em_p.hpp @@ -31,15 +31,15 @@ #include "mpi.h" // MPI header file // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define HALF RCONST(0.5) -#define PTTHREE RCONST(0.3) -#define PTFOUR RCONST(0.4) -#define TWO RCONST(2.0) -#define FIVE RCONST(5.0) -#define TEN RCONST(10.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define HALF SUN_RCONST(0.5) +#define PTTHREE SUN_RCONST(0.3) +#define PTFOUR SUN_RCONST(0.4) +#define TWO SUN_RCONST(2.0) +#define FIVE SUN_RCONST(5.0) +#define TEN SUN_RCONST(10.0) // Maximum size of output directory string #define MXSTR 2048 diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp index 544c9ff077..600db1fc80 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp @@ -1088,7 +1088,7 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Integrator settings - udata->rtol = RCONST(1.e-8); // relative tolerance + udata->rtol = SUN_RCONST(1.e-8); // relative tolerance udata->maa = 60; // 60 vectors in Anderson Acceleration space udata->damping = ONE; // no damping for Anderson Acceleration udata->orthaa = 0; // use MGS for Anderson Acceleration diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp index cc743d8940..fe860bda8e 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp @@ -29,12 +29,12 @@ #include "mpi.h" // MPI header file // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define HALF RCONST(0.5) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define HALF SUN_RCONST(0.5) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp index 6c5fbf5ac1..344e9eb535 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp @@ -1274,7 +1274,7 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Fixed Point Solver settings - udata->rtol = RCONST(1.e-8); // relative tolerance + udata->rtol = SUN_RCONST(1.e-8); // relative tolerance udata->maa = 1; // 1 Anderson Acceleration vector udata->damping = ONE; // no damping for Anderson Acceleration udata->orthaa = 0; // use MGS for Anderson Acceleration @@ -1284,7 +1284,7 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations - udata->epslin = RCONST(1.e-8); // relative stopping tolerance + udata->epslin = SUN_RCONST(1.e-8); // relative stopping tolerance // Linear solver object udata->LS = NULL; diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp index ce80188b2b..457c4d5f29 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp @@ -30,12 +30,12 @@ #include "mpi.h" // MPI header file // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define SIX RCONST(6.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define SIX SUN_RCONST(6.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp index f3a3d1023d..4968037e09 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp @@ -1444,7 +1444,7 @@ static int InitUserData(UserData *udata) udata->ipN = -1; // Fixed Point Solver settings - udata->rtol = RCONST(1.e-8); // relative tolerance + udata->rtol = SUN_RCONST(1.e-8); // relative tolerance udata->maa = 0; // no Anderson Acceleration udata->damping = ONE; // no damping for Anderson Acceleration udata->orthaa = 0; // use MGS for Anderson Acceleration @@ -1454,7 +1454,7 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations - udata->epslin = RCONST(1.e-8); // use default (0.05) + udata->epslin = SUN_RCONST(1.e-8); // use default (0.05) // Linear solver object udata->LS = NULL; diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp index fb5e3b7204..8deec52743 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp @@ -31,11 +31,11 @@ #include "mpi.h" // MPI header file // Macros for problem constants -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define EIGHT RCONST(8.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) // Macro to access (x,y) location in 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) diff --git a/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c b/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c index fae8fb634c..d550b3137f 100644 --- a/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c +++ b/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c @@ -123,29 +123,29 @@ #define NUM_SPECIES 6 /* must equal 2*(number of prey or predators) number of prey = number of predators */ -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define MX 8 /* MX = number of x mesh points */ #define MY 8 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NSMX * MY) /* number of equations in the system */ -#define AA RCONST(1.0) /* value of coefficient AA in above eqns */ -#define EE RCONST(10000.) /* value of coefficient EE in above eqns */ -#define GG RCONST(0.5e-6) /* value of coefficient GG in above eqns */ -#define BB RCONST(1.0) /* value of coefficient BB in above eqns */ -#define DPREY RCONST(1.0) /* value of coefficient dprey above */ -#define DPRED RCONST(0.5) /* value of coefficient dpred above */ -#define ALPHA RCONST(1.0) /* value of coefficient alpha above */ -#define AX RCONST(1.0) /* total range of x variable */ -#define AY RCONST(1.0) /* total range of y variable */ -#define FTOL RCONST(1.e-7) /* ftol tolerance */ -#define STOL RCONST(1.e-13) /* stol tolerance */ -#define THOUSAND RCONST(1000.0) /* one thousand */ -#define ZERO RCONST(0.0) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ -#define TWO RCONST(2.0) /* 2. */ -#define PREYIN RCONST(1.0) /* initial guess for prey concentrations. */ -#define PREDIN RCONST(30000.0)/* initial guess for predator concs. */ +#define AA SUN_RCONST(1.0) /* value of coefficient AA in above eqns */ +#define EE SUN_RCONST(10000.) /* value of coefficient EE in above eqns */ +#define GG SUN_RCONST(0.5e-6) /* value of coefficient GG in above eqns */ +#define BB SUN_RCONST(1.0) /* value of coefficient BB in above eqns */ +#define DPREY SUN_RCONST(1.0) /* value of coefficient dprey above */ +#define DPRED SUN_RCONST(0.5) /* value of coefficient dpred above */ +#define ALPHA SUN_RCONST(1.0) /* value of coefficient alpha above */ +#define AX SUN_RCONST(1.0) /* total range of x variable */ +#define AY SUN_RCONST(1.0) /* total range of y variable */ +#define FTOL SUN_RCONST(1.e-7) /* ftol tolerance */ +#define STOL SUN_RCONST(1.e-13) /* stol tolerance */ +#define THOUSAND SUN_RCONST(1000.0) /* one thousand */ +#define ZERO SUN_RCONST(0.0) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ +#define TWO SUN_RCONST(2.0) /* 2. */ +#define PREYIN SUN_RCONST(1.0) /* initial guess for prey concentrations. */ +#define PREDIN SUN_RCONST(30000.0)/* initial guess for predator concs. */ /* User-defined vector access macro: IJ_Vptr */ @@ -594,7 +594,7 @@ static void InitUserData(UserData data) data->ay = AY; data->dx = (data->ax)/(MX-1); data->dy = (data->ay)/(MY-1); - data->uround = UNIT_ROUNDOFF; + data->uround = SUN_UNIT_ROUNDOFF; data->sqruround = sqrt(data->uround); /* Set up the coefficients a and b plus others found in the equations */ @@ -671,7 +671,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) } for (i = NUM_SPECIES/2; i < NUM_SPECIES; i++) { ctemp[i] = PREDIN; - stemp[i] = RCONST(0.00001); + stemp[i] = SUN_RCONST(0.00001); } /* Load initial profiles into cc and sc vector from ctemp and stemp. */ diff --git a/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c b/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c index a45642e13d..ee3b260159 100644 --- a/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c +++ b/examples/kinsol/parallel/kinFoodWeb_kry_bbd_p.c @@ -107,7 +107,7 @@ #define NUM_SPECIES 6 /* must equal 2*(number of prey or predators) number of prey = number of predators */ -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define NPEX 2 /* number of processors in the x-direction */ #define NPEY 2 /* number of processors in the y-direction */ @@ -118,22 +118,22 @@ #define NSMXSUB (NUM_SPECIES * MXSUB) #define NSMXSUB2 (NUM_SPECIES * (MXSUB+2)) #define NEQ (NUM_SPECIES*MX*MY) /* number of equations in the system */ -#define AA RCONST(1.0) /* value of coefficient AA in above eqns */ -#define EE RCONST(10000.) /* value of coefficient EE in above eqns */ -#define GG RCONST(0.5e-6) /* value of coefficient GG in above eqns */ -#define BB RCONST(1.0) /* value of coefficient BB in above eqns */ -#define DPREY RCONST(1.0) /* value of coefficient dprey above */ -#define DPRED RCONST(0.5) /* value of coefficient dpred above */ -#define ALPHA RCONST(1.0) /* value of coefficient alpha above */ -#define AX RCONST(1.0) /* total range of x variable */ -#define AY RCONST(1.0) /* total range of y variable */ -#define FTOL RCONST(1.e-7) /* ftol tolerance */ -#define STOL RCONST(1.e-13) /* stol tolerance */ -#define THOUSAND RCONST(1000.0) /* one thousand */ -#define ZERO RCONST(0.0) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ -#define PREYIN RCONST(1.0) /* initial guess for prey concentrations. */ -#define PREDIN RCONST(30000.0)/* initial guess for predator concs. */ +#define AA SUN_RCONST(1.0) /* value of coefficient AA in above eqns */ +#define EE SUN_RCONST(10000.) /* value of coefficient EE in above eqns */ +#define GG SUN_RCONST(0.5e-6) /* value of coefficient GG in above eqns */ +#define BB SUN_RCONST(1.0) /* value of coefficient BB in above eqns */ +#define DPREY SUN_RCONST(1.0) /* value of coefficient dprey above */ +#define DPRED SUN_RCONST(0.5) /* value of coefficient dpred above */ +#define ALPHA SUN_RCONST(1.0) /* value of coefficient alpha above */ +#define AX SUN_RCONST(1.0) /* total range of x variable */ +#define AY SUN_RCONST(1.0) /* total range of y variable */ +#define FTOL SUN_RCONST(1.e-7) /* ftol tolerance */ +#define STOL SUN_RCONST(1.e-13) /* stol tolerance */ +#define THOUSAND SUN_RCONST(1000.0) /* one thousand */ +#define ZERO SUN_RCONST(0.0) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ +#define PREYIN SUN_RCONST(1.0) /* initial guess for prey concentrations. */ +#define PREDIN SUN_RCONST(30000.0)/* initial guess for predator concs. */ /* User-defined vector access macro: IJ_Vptr */ @@ -680,7 +680,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) } for (i = NUM_SPECIES/2; i < NUM_SPECIES; i++) { ctemp[i] = PREDIN; - stemp[i] = RCONST(0.00001); + stemp[i] = SUN_RCONST(0.00001); } /* Load initial profiles into cc and sc vector from ctemp and stemp. */ diff --git a/examples/kinsol/parallel/kinFoodWeb_kry_p.c b/examples/kinsol/parallel/kinFoodWeb_kry_p.c index 51682a272b..8a03c363a5 100644 --- a/examples/kinsol/parallel/kinFoodWeb_kry_p.c +++ b/examples/kinsol/parallel/kinFoodWeb_kry_p.c @@ -106,7 +106,7 @@ #define NUM_SPECIES 6 /* must equal 2*(number of prey or predators) number of prey = number of predators */ -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define NPEX 2 /* number of processors in the x-direction */ #define NPEY 2 /* number of processors in the y-direction */ @@ -117,22 +117,22 @@ #define NSMXSUB (NUM_SPECIES * MXSUB) #define NSMXSUB2 (NUM_SPECIES * (MXSUB+2)) #define NEQ (NUM_SPECIES*MX*MY) /* number of equations in the system */ -#define AA RCONST(1.0) /* value of coefficient AA in above eqns */ -#define EE RCONST(10000.) /* value of coefficient EE in above eqns */ -#define GG RCONST(0.5e-6) /* value of coefficient GG in above eqns */ -#define BB RCONST(1.0) /* value of coefficient BB in above eqns */ -#define DPREY RCONST(1.0) /* value of coefficient dprey above */ -#define DPRED RCONST(0.5) /* value of coefficient dpred above */ -#define ALPHA RCONST(1.0) /* value of coefficient alpha above */ -#define AX RCONST(1.0) /* total range of x variable */ -#define AY RCONST(1.0) /* total range of y variable */ -#define FTOL RCONST(1.e-7) /* ftol tolerance */ -#define STOL RCONST(1.e-13) /* stol tolerance */ -#define THOUSAND RCONST(1000.0) /* one thousand */ -#define ZERO RCONST(0.0) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ -#define PREYIN RCONST(1.0) /* initial guess for prey concentrations. */ -#define PREDIN RCONST(30000.0)/* initial guess for predator concs. */ +#define AA SUN_RCONST(1.0) /* value of coefficient AA in above eqns */ +#define EE SUN_RCONST(10000.) /* value of coefficient EE in above eqns */ +#define GG SUN_RCONST(0.5e-6) /* value of coefficient GG in above eqns */ +#define BB SUN_RCONST(1.0) /* value of coefficient BB in above eqns */ +#define DPREY SUN_RCONST(1.0) /* value of coefficient dprey above */ +#define DPRED SUN_RCONST(0.5) /* value of coefficient dpred above */ +#define ALPHA SUN_RCONST(1.0) /* value of coefficient alpha above */ +#define AX SUN_RCONST(1.0) /* total range of x variable */ +#define AY SUN_RCONST(1.0) /* total range of y variable */ +#define FTOL SUN_RCONST(1.e-7) /* ftol tolerance */ +#define STOL SUN_RCONST(1.e-13) /* stol tolerance */ +#define THOUSAND SUN_RCONST(1000.0) /* one thousand */ +#define ZERO SUN_RCONST(0.0) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ +#define PREYIN SUN_RCONST(1.0) /* initial guess for prey concentrations. */ +#define PREDIN SUN_RCONST(30000.0)/* initial guess for predator concs. */ /* User-defined vector access macro: IJ_Vptr */ @@ -565,7 +565,7 @@ static void InitUserData(int my_pe, MPI_Comm comm, UserData data) data->ay = AY; data->dx = (data->ax)/(MX-1); data->dy = (data->ay)/(MY-1); - data->uround = UNIT_ROUNDOFF; + data->uround = SUN_UNIT_ROUNDOFF; data->sqruround = sqrt(data->uround); data->my_pe = my_pe; data->comm = comm; @@ -648,7 +648,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) } for (i = NUM_SPECIES/2; i < NUM_SPECIES; i++) { ctemp[i] = PREDIN; - stemp[i] = RCONST(0.00001); + stemp[i] = SUN_RCONST(0.00001); } /* Load initial profiles into cc and sc vector from ctemp and stemp. */ diff --git a/examples/kinsol/serial/kinAnalytic_fp.c b/examples/kinsol/serial/kinAnalytic_fp.c index 090a561149..2e14279259 100644 --- a/examples/kinsol/serial/kinAnalytic_fp.c +++ b/examples/kinsol/serial/kinAnalytic_fp.c @@ -70,22 +70,22 @@ /* problem constants */ #define NEQ 3 /* number of equations */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define PTONE RCONST(0.1) /* real 0.1 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define PTNINE RCONST(0.9) /* real 0.9 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define ONEPTZEROSIX RCONST(1.06) /* real 1.06 */ -#define ONEPTONE RCONST(1.1) /* real 1.1 */ -#define THREE RCONST(3.0) /* real 3.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define SIX RCONST(6.0) /* real 6.0 */ -#define NINE RCONST(9.0) /* real 9.0 */ -#define TEN RCONST(10.0) /* real 10.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ -#define SIXTY RCONST(60.0) /* real 60.0 */ -#define EIGHTYONE RCONST(81.0) /* real 81.0 */ -#define PI RCONST(3.1415926535898) /* real pi */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define PTONE SUN_RCONST(0.1) /* real 0.1 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define PTNINE SUN_RCONST(0.9) /* real 0.9 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define ONEPTZEROSIX SUN_RCONST(1.06) /* real 1.06 */ +#define ONEPTONE SUN_RCONST(1.1) /* real 1.1 */ +#define THREE SUN_RCONST(3.0) /* real 3.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define SIX SUN_RCONST(6.0) /* real 6.0 */ +#define NINE SUN_RCONST(9.0) /* real 9.0 */ +#define TEN SUN_RCONST(10.0) /* real 10.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ +#define SIXTY SUN_RCONST(60.0) /* real 60.0 */ +#define EIGHTYONE SUN_RCONST(81.0) /* real 81.0 */ +#define PI SUN_RCONST(3.1415926535898) /* real pi */ /* analytic solution */ #define XTRUE HALF @@ -388,13 +388,13 @@ static int SetDefaults(UserOpt *uopt) if (*uopt == NULL) return(-1); /* Set default options values */ - (*uopt)->tol = 100 * SQRT(UNIT_ROUNDOFF); + (*uopt)->tol = 100 * SQRT(SUN_UNIT_ROUNDOFF); (*uopt)->maxiter = 30; (*uopt)->m_aa = 0; /* no acceleration */ (*uopt)->delay_aa = 0; /* no delay */ (*uopt)->orth_aa = 0; /* MGS */ - (*uopt)->damping_fp = RCONST(1.0); /* no FP dampig */ - (*uopt)->damping_aa = RCONST(1.0); /* no AA damping */ + (*uopt)->damping_fp = SUN_RCONST(1.0); /* no FP dampig */ + (*uopt)->damping_aa = SUN_RCONST(1.0); /* no AA damping */ return(0); } diff --git a/examples/kinsol/serial/kinFerTron_dns.c b/examples/kinsol/serial/kinFerTron_dns.c index 32bf329b7e..85e2387caa 100644 --- a/examples/kinsol/serial/kinFerTron_dns.c +++ b/examples/kinsol/serial/kinFerTron_dns.c @@ -64,18 +64,18 @@ #define NVAR 2 #define NEQ 3*NVAR -#define FTOL RCONST(1.e-5) /* function tolerance */ -#define STOL RCONST(1.e-5) /* step tolerance */ - -#define ZERO RCONST(0.0) -#define PT25 RCONST(0.25) -#define PT5 RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) -#define TWO RCONST(2.0) - -#define PI RCONST(3.1415926) -#define E RCONST(2.7182818) +#define FTOL SUN_RCONST(1.e-5) /* function tolerance */ +#define STOL SUN_RCONST(1.e-5) /* step tolerance */ + +#define ZERO SUN_RCONST(0.0) +#define PT25 SUN_RCONST(0.25) +#define PT5 SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) +#define TWO SUN_RCONST(2.0) + +#define PI SUN_RCONST(3.1415926) +#define E SUN_RCONST(2.7182818) typedef struct { sunrealtype lb[NVAR]; diff --git a/examples/kinsol/serial/kinFerTron_klu.c b/examples/kinsol/serial/kinFerTron_klu.c index 84f9857444..6a5c0fe06e 100644 --- a/examples/kinsol/serial/kinFerTron_klu.c +++ b/examples/kinsol/serial/kinFerTron_klu.c @@ -65,18 +65,18 @@ #define NVAR 2 #define NEQ 3*NVAR -#define FTOL RCONST(1.e-5) /* function tolerance */ -#define STOL RCONST(1.e-5) /* step tolerance */ - -#define ZERO RCONST(0.0) -#define PT25 RCONST(0.25) -#define PT5 RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) -#define TWO RCONST(2.0) - -#define PI RCONST(3.1415926) -#define E RCONST(2.7182818) +#define FTOL SUN_RCONST(1.e-5) /* function tolerance */ +#define STOL SUN_RCONST(1.e-5) /* step tolerance */ + +#define ZERO SUN_RCONST(0.0) +#define PT25 SUN_RCONST(0.25) +#define PT5 SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) +#define TWO SUN_RCONST(2.0) + +#define PI SUN_RCONST(3.1415926) +#define E SUN_RCONST(2.7182818) typedef struct { sunrealtype lb[NVAR]; diff --git a/examples/kinsol/serial/kinFoodWeb_kry.c b/examples/kinsol/serial/kinFoodWeb_kry.c index ea2db603ff..2d835489c6 100644 --- a/examples/kinsol/serial/kinFoodWeb_kry.c +++ b/examples/kinsol/serial/kinFoodWeb_kry.c @@ -99,29 +99,29 @@ #define NUM_SPECIES 6 /* must equal 2*(number of prey or predators) number of prey = number of predators */ -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define MX 8 /* MX = number of x mesh points */ #define MY 8 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NSMX * MY) /* number of equations in the system */ -#define AA RCONST(1.0) /* value of coefficient AA in above eqns */ -#define EE RCONST(10000.) /* value of coefficient EE in above eqns */ -#define GG RCONST(0.5e-6) /* value of coefficient GG in above eqns */ -#define BB RCONST(1.0) /* value of coefficient BB in above eqns */ -#define DPREY RCONST(1.0) /* value of coefficient dprey above */ -#define DPRED RCONST(0.5) /* value of coefficient dpred above */ -#define ALPHA RCONST(1.0) /* value of coefficient alpha above */ -#define AX RCONST(1.0) /* total range of x variable */ -#define AY RCONST(1.0) /* total range of y variable */ -#define FTOL RCONST(1.e-7) /* ftol tolerance */ -#define STOL RCONST(1.e-13) /* stol tolerance */ -#define THOUSAND RCONST(1000.0) /* one thousand */ -#define ZERO RCONST(0.0) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ -#define TWO RCONST(2.0) /* 2. */ -#define PREYIN RCONST(1.0) /* initial guess for prey concentrations. */ -#define PREDIN RCONST(30000.0)/* initial guess for predator concs. */ +#define AA SUN_RCONST(1.0) /* value of coefficient AA in above eqns */ +#define EE SUN_RCONST(10000.) /* value of coefficient EE in above eqns */ +#define GG SUN_RCONST(0.5e-6) /* value of coefficient GG in above eqns */ +#define BB SUN_RCONST(1.0) /* value of coefficient BB in above eqns */ +#define DPREY SUN_RCONST(1.0) /* value of coefficient dprey above */ +#define DPRED SUN_RCONST(0.5) /* value of coefficient dpred above */ +#define ALPHA SUN_RCONST(1.0) /* value of coefficient alpha above */ +#define AX SUN_RCONST(1.0) /* total range of x variable */ +#define AY SUN_RCONST(1.0) /* total range of y variable */ +#define FTOL SUN_RCONST(1.e-7) /* ftol tolerance */ +#define STOL SUN_RCONST(1.e-13) /* stol tolerance */ +#define THOUSAND SUN_RCONST(1000.0) /* one thousand */ +#define ZERO SUN_RCONST(0.0) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ +#define TWO SUN_RCONST(2.0) /* 2. */ +#define PREYIN SUN_RCONST(1.0) /* initial guess for prey concentrations. */ +#define PREDIN SUN_RCONST(30000.0)/* initial guess for predator concs. */ /* User-defined vector access macro: IJ_Vptr */ @@ -550,7 +550,7 @@ static void InitUserData(UserData data) data->ay = AY; data->dx = (data->ax)/(MX-1); data->dy = (data->ay)/(MY-1); - data->uround = UNIT_ROUNDOFF; + data->uround = SUN_UNIT_ROUNDOFF; data->sqruround = SUNRsqrt(data->uround); /* Set up the coefficients a and b plus others found in the equations */ @@ -627,7 +627,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) } for (i = NUM_SPECIES/2; i < NUM_SPECIES; i++) { ctemp[i] = PREDIN; - stemp[i] = RCONST(0.00001); + stemp[i] = SUN_RCONST(0.00001); } /* Load initial profiles into cc and sc vector from ctemp and stemp. */ diff --git a/examples/kinsol/serial/kinKrylovDemo_ls.c b/examples/kinsol/serial/kinKrylovDemo_ls.c index 09a0386142..c9aa659dc3 100644 --- a/examples/kinsol/serial/kinKrylovDemo_ls.c +++ b/examples/kinsol/serial/kinKrylovDemo_ls.c @@ -111,29 +111,29 @@ #define NUM_SPECIES 6 /* must equal 2*(number of prey or predators) number of prey = number of predators */ -#define PI RCONST(3.1415926535898) /* pi */ +#define PI SUN_RCONST(3.1415926535898) /* pi */ #define MX 5 /* MX = number of x mesh points */ #define MY 5 /* MY = number of y mesh points */ #define NSMX (NUM_SPECIES * MX) #define NEQ (NSMX * MY) /* number of equations in the system */ -#define AA RCONST(1.0) /* value of coefficient AA in above eqns */ -#define EE RCONST(10000.) /* value of coefficient EE in above eqns */ -#define GG RCONST(0.5e-6) /* value of coefficient GG in above eqns */ -#define BB RCONST(1.0) /* value of coefficient BB in above eqns */ -#define DPREY RCONST(1.0) /* value of coefficient dprey above */ -#define DPRED RCONST(0.5) /* value of coefficient dpred above */ -#define ALPHA RCONST(1.0) /* value of coefficient alpha above */ -#define AX RCONST(1.0) /* total range of x variable */ -#define AY RCONST(1.0) /* total range of y variable */ -#define FTOL RCONST(1.e-7) /* ftol tolerance */ -#define STOL RCONST(1.e-13) /* stol tolerance */ -#define THOUSAND RCONST(1000.0) /* one thousand */ -#define ZERO RCONST(0.) /* 0. */ -#define ONE RCONST(1.0) /* 1. */ -#define TWO RCONST(2.0) /* 2. */ -#define PREYIN RCONST(1.0) /* initial guess for prey concentrations. */ -#define PREDIN RCONST(30000.0)/* initial guess for predator concs. */ +#define AA SUN_RCONST(1.0) /* value of coefficient AA in above eqns */ +#define EE SUN_RCONST(10000.) /* value of coefficient EE in above eqns */ +#define GG SUN_RCONST(0.5e-6) /* value of coefficient GG in above eqns */ +#define BB SUN_RCONST(1.0) /* value of coefficient BB in above eqns */ +#define DPREY SUN_RCONST(1.0) /* value of coefficient dprey above */ +#define DPRED SUN_RCONST(0.5) /* value of coefficient dpred above */ +#define ALPHA SUN_RCONST(1.0) /* value of coefficient alpha above */ +#define AX SUN_RCONST(1.0) /* total range of x variable */ +#define AY SUN_RCONST(1.0) /* total range of y variable */ +#define FTOL SUN_RCONST(1.e-7) /* ftol tolerance */ +#define STOL SUN_RCONST(1.e-13) /* stol tolerance */ +#define THOUSAND SUN_RCONST(1000.0) /* one thousand */ +#define ZERO SUN_RCONST(0.) /* 0. */ +#define ONE SUN_RCONST(1.0) /* 1. */ +#define TWO SUN_RCONST(2.0) /* 2. */ +#define PREYIN SUN_RCONST(1.0) /* initial guess for prey concentrations. */ +#define PREDIN SUN_RCONST(30000.0)/* initial guess for predator concs. */ /* Linear Solver Loop Constants */ @@ -653,7 +653,7 @@ static void InitUserData(UserData data) data->ay = AY; data->dx = (data->ax)/(MX-1); data->dy = (data->ay)/(MY-1); - data->uround = UNIT_ROUNDOFF; + data->uround = SUN_UNIT_ROUNDOFF; data->sqruround = sqrt(data->uround); /* Set up the coefficients a and b plus others found in the equations */ @@ -730,7 +730,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector sc) } for (i = NUM_SPECIES/2; i < NUM_SPECIES; i++) { ctemp[i] = PREDIN; - stemp[i] = RCONST(0.00001); + stemp[i] = SUN_RCONST(0.00001); } /* Load initial profiles into cc and sc vector from ctemp and stemp. */ diff --git a/examples/kinsol/serial/kinLaplace_bnd.c b/examples/kinsol/serial/kinLaplace_bnd.c index fbacc03389..d796c7eef1 100644 --- a/examples/kinsol/serial/kinLaplace_bnd.c +++ b/examples/kinsol/serial/kinLaplace_bnd.c @@ -43,11 +43,11 @@ #define SKIP 3 /* no. of points skipped for printing */ -#define FTOL RCONST(1.e-12) /* function tolerance */ +#define FTOL SUN_RCONST(1.e-12) /* function tolerance */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* IJth is defined in order to isolate the translation from the mathematical 2-dimensional structure of the dependent variable vector diff --git a/examples/kinsol/serial/kinLaplace_picard_bnd.c b/examples/kinsol/serial/kinLaplace_picard_bnd.c index 9f39e011b1..09b82a38fc 100644 --- a/examples/kinsol/serial/kinLaplace_picard_bnd.c +++ b/examples/kinsol/serial/kinLaplace_picard_bnd.c @@ -46,11 +46,11 @@ #define SKIP 3 /* no. of points skipped for printing */ -#define FTOL RCONST(1.e-12) /* function tolerance */ +#define FTOL SUN_RCONST(1.e-12) /* function tolerance */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* IJth is defined in order to isolate the translation from the mathematical 2-dimensional structure of the dependent variable vector diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index e61b2db0d0..c2d47c2955 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -44,11 +44,11 @@ #define SKIP 3 /* no. of points skipped for printing */ -#define FTOL RCONST(1.e-12) /* function tolerance */ +#define FTOL SUN_RCONST(1.e-12) /* function tolerance */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* IJth is defined in order to isolate the translation from the mathematical 2-dimensional structure of the dependent variable vector diff --git a/examples/kinsol/serial/kinRoberts_fp.c b/examples/kinsol/serial/kinRoberts_fp.c index e57b3ace6e..a641834b47 100644 --- a/examples/kinsol/serial/kinRoberts_fp.c +++ b/examples/kinsol/serial/kinRoberts_fp.c @@ -49,16 +49,16 @@ /* Problem Constants */ #define NEQ 3 /* number of equations */ -#define Y10 RCONST(1.0) /* initial y components */ -#define Y20 RCONST(0.0) -#define Y30 RCONST(0.0) -#define TOL RCONST(1.e-10) /* function tolerance */ -#define DSTEP RCONST(0.1) /* Size of the single time step used */ +#define Y10 SUN_RCONST(1.0) /* initial y components */ +#define Y20 SUN_RCONST(0.0) +#define Y30 SUN_RCONST(0.0) +#define TOL SUN_RCONST(1.e-10) /* function tolerance */ +#define DSTEP SUN_RCONST(0.1) /* Size of the single time step used */ #define PRIORS 2 -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* User-defined vector accessor macro: Ith */ @@ -195,7 +195,7 @@ int main() PrintFinalStats(kmem); /* check the solution error */ - retval = check_ans(y, RCONST(1e-4), RCONST(1e-6)); + retval = check_ans(y, SUN_RCONST(1e-4), SUN_RCONST(1e-6)); /* ----------- * Free memory @@ -228,8 +228,8 @@ static int funcRoberts(N_Vector y, N_Vector g, void *user_data) y2 = Ith(y,2); y3 = Ith(y,3); - yd1 = DSTEP * ( RCONST(-0.04)*y1 + RCONST(1.0e4)*y2*y3 ); - yd3 = DSTEP * RCONST(3.0e2)*y2*y2; + yd1 = DSTEP * ( SUN_RCONST(-0.04)*y1 + SUN_RCONST(1.0e4)*y2*y3 ); + yd3 = DSTEP * SUN_RCONST(3.0e2)*y2*y2; Ith(g,1) = yd1 + Y10; Ith(g,2) = -yd1 - yd3 + Y20; @@ -339,9 +339,9 @@ static int check_ans(N_Vector u, sunrealtype rtol, sunrealtype atol) ewt = N_VClone(u); /* set the reference solution data */ - NV_Ith_S(ref,0) = RCONST(9.9678538655358029e-01); - NV_Ith_S(ref,1) = RCONST(2.9530060962800345e-03); - NV_Ith_S(ref,2) = RCONST(2.6160735013975683e-04); + NV_Ith_S(ref,0) = SUN_RCONST(9.9678538655358029e-01); + NV_Ith_S(ref,1) = SUN_RCONST(2.9530060962800345e-03); + NV_Ith_S(ref,2) = SUN_RCONST(2.6160735013975683e-04); /* compute the error weight vector */ N_VAbs(ref, ewt); diff --git a/examples/kinsol/serial/kinRoboKin_dns.c b/examples/kinsol/serial/kinRoboKin_dns.c index 3f628088c9..92f8fc66a8 100644 --- a/examples/kinsol/serial/kinRoboKin_dns.c +++ b/examples/kinsol/serial/kinRoboKin_dns.c @@ -42,12 +42,12 @@ #define NVAR 8 /* variables */ #define NEQ 3*NVAR /* equations + bounds */ -#define FTOL RCONST(1.e-5) /* function tolerance */ -#define STOL RCONST(1.e-5) /* step tolerance */ +#define FTOL SUN_RCONST(1.e-5) /* function tolerance */ +#define STOL SUN_RCONST(1.e-5) /* step tolerance */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define Ith(v,i) NV_Ith_S(v,i-1) #define IJth(A,i,j) SM_ELEMENT_D(A,i-1,j-1) diff --git a/examples/kinsol/serial/kinRoboKin_slu.c b/examples/kinsol/serial/kinRoboKin_slu.c index 2630d3c123..9f79cb4c82 100644 --- a/examples/kinsol/serial/kinRoboKin_slu.c +++ b/examples/kinsol/serial/kinRoboKin_slu.c @@ -44,12 +44,12 @@ #define NVAR 8 /* variables */ #define NEQ 3*NVAR /* equations + bounds */ -#define FTOL RCONST(1.e-5) /* function tolerance */ -#define STOL RCONST(1.e-5) /* step tolerance */ +#define FTOL SUN_RCONST(1.e-5) /* function tolerance */ +#define STOL SUN_RCONST(1.e-5) /* step tolerance */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #define Ith(v,i) NV_Ith_S(v,i-1) diff --git a/examples/nvector/test_nvector.c b/examples/nvector/test_nvector.c index 1a77295a5e..55bc523fb0 100644 --- a/examples/nvector/test_nvector.c +++ b/examples/nvector/test_nvector.c @@ -484,7 +484,7 @@ int Test_N_VGetLength(N_Vector W, int myid) Wlength = N_VGetLength(W); /* use N_VConst and N_VDotProd to compute length */ - N_VConst(RCONST(1.0), W); + N_VConst(SUN_RCONST(1.0), W); Wlength2 = (sunindextype) N_VDotProd(W, W); sync_device(W); @@ -2118,12 +2118,12 @@ int Test_N_VMinQuotient(N_Vector NUM, N_Vector DENOM, sync_device(NUM); stop_time = get_time(); - /* ans should equal BIG_REAL */ - failure = SUNRCompare(ans, BIG_REAL); + /* ans should equal SUN_BIG_REAL */ + failure = SUNRCompare(ans, SUN_BIG_REAL); if (failure) { printf(">>> FAILED test -- N_VMinQuotient Case 2, Proc %d \n", myid); - printf(" min = %" FSYM ", expected %" FSYM "\n", ans, BIG_REAL); + printf(" min = %" FSYM ", expected %" FSYM "\n", ans, SUN_BIG_REAL); fails++; } else if (myid == 0) { printf("PASSED test -- N_VMinQuotient Case 2 \n"); @@ -4837,7 +4837,7 @@ int Test_N_VDotProdLocal(N_Vector X, N_Vector Y, sunindextype local_length, int stop_time = get_time(); /* ans should equal rmyid */ - failure = SUNRCompareTol(ans, rmyid, SUNRsqrt(UNIT_ROUNDOFF)); + failure = SUNRCompareTol(ans, rmyid, SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VDotProdLocal, Proc %d\n", myid); @@ -4875,7 +4875,7 @@ int Test_N_VMaxNormLocal(N_Vector X, sunindextype local_length, int myid) stop_time = get_time(); /* ans should equal myidp1 */ - failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, myidp1, SUNRsqrt(UNIT_ROUNDOFF)); + failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, myidp1, SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VMaxNormLocal, Proc %d\n", myid); @@ -4912,7 +4912,7 @@ int Test_N_VMinLocal(N_Vector X, sunindextype local_length, int myid) stop_time = get_time(); /* ans should equal negmyid */ - failure = SUNRCompareTol(ans, negmyid, SUNRsqrt(UNIT_ROUNDOFF)); + failure = SUNRCompareTol(ans, negmyid, SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VMinLocal, Proc %d\n", myid); @@ -4949,7 +4949,7 @@ int Test_N_VL1NormLocal(N_Vector X, sunindextype local_length, int myid) /* ans should equal myid */ failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (sunrealtype) myid, - SUNRsqrt(UNIT_ROUNDOFF)); + SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VL1NormLocal, Proc %d\n", myid); @@ -4988,7 +4988,7 @@ int Test_N_VWSqrSumLocal(N_Vector X, N_Vector W, sunindextype local_length, int /* ans should equal myid */ failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (sunrealtype) myid, - SUNRsqrt(UNIT_ROUNDOFF)); + SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VWSqrSumLocal, Proc %d\n", myid); @@ -5032,7 +5032,7 @@ int Test_N_VWSqrSumMaskLocal(N_Vector X, N_Vector W, N_Vector ID, /* ans should equal myid */ failure = (ans < ZERO) ? 1 : SUNRCompareTol(ans, (sunrealtype) myid, - SUNRsqrt(UNIT_ROUNDOFF)); + SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VWSqrSumMaskLocal, Proc %d\n", myid); @@ -5331,7 +5331,7 @@ int Test_N_VMinQuotientLocal(N_Vector NUM, N_Vector DENOM, stop_time = get_time(); /* ans should equal myid */ - failure = SUNRCompareTol(ans, (sunrealtype) myid, SUNRsqrt(UNIT_ROUNDOFF)); + failure = SUNRCompareTol(ans, (sunrealtype) myid, SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VMinQuotientLocal Case 1, Proc %d \n", myid); @@ -5360,8 +5360,8 @@ int Test_N_VMinQuotientLocal(N_Vector NUM, N_Vector DENOM, sync_device(NUM); stop_time = get_time(); - /* ans should equal BIG_REAL */ - failure = SUNRCompareTol(ans, BIG_REAL, SUNRsqrt(UNIT_ROUNDOFF)); + /* ans should equal SUN_BIG_REAL */ + failure = SUNRCompareTol(ans, SUN_BIG_REAL, SUNRsqrt(SUN_UNIT_ROUNDOFF)); if (failure) { printf(">>> FAILED test -- N_VMinQuotientLocal Case 2, Proc %d \n", myid); diff --git a/examples/nvector/test_nvector.h b/examples/nvector/test_nvector.h index 84e89a9b4b..9d55bfcae8 100644 --- a/examples/nvector/test_nvector.h +++ b/examples/nvector/test_nvector.h @@ -19,13 +19,13 @@ #include /* define constants */ -#define NEG_TWO RCONST(-2.0) -#define NEG_ONE RCONST(-1.0) -#define NEG_HALF RCONST(-0.5) -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define NEG_TWO SUN_RCONST(-2.0) +#define NEG_ONE SUN_RCONST(-1.0) +#define NEG_HALF SUN_RCONST(-0.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 index 77e04e2431..73b88e410b 100644 --- a/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 +++ b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 @@ -102,7 +102,7 @@ integer(C_INT) function unit_tests() result(fails) ! run tests fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSetup(LS, A, 0) - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, 0) + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 100*SUN_UNIT_ROUNDOFF, 0) fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0) fails = fails + Test_FSUNLinSolLastFlag(LS, 0) diff --git a/examples/sunlinsol/band/test_sunlinsol_band.c b/examples/sunlinsol/band/test_sunlinsol_band.c index b656537808..13428d2304 100644 --- a/examples/sunlinsol/band/test_sunlinsol_band.c +++ b/examples/sunlinsol/band/test_sunlinsol_band.c @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) /* Run Tests */ fails += Test_SUNLinSolInitialize(LS, 0); fails += Test_SUNLinSolSetup(LS, A, 0); - fails += Test_SUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, SUNTRUE, 0); + fails += Test_SUNLinSolSolve(LS, A, x, b, 100*SUN_UNIT_ROUNDOFF, SUNTRUE, 0); fails += Test_SUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0); fails += Test_SUNLinSolGetID(LS, SUNLINEARSOLVER_BAND, 0); diff --git a/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu b/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu index 73c70e4295..67e8f63ed2 100644 --- a/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu +++ b/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) /* Run Tests */ fails += Test_SUNLinSolInitialize(LS, 0); fails += Test_SUNLinSolSetup(LS, dA, 0); - fails += Test_SUNLinSolSolve(LS, dA, d_x, d_b, 1000*UNIT_ROUNDOFF, SUNTRUE, 0); + fails += Test_SUNLinSolSolve(LS, dA, d_x, d_b, 1000*SUN_UNIT_ROUNDOFF, SUNTRUE, 0); fails += Test_SUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0); fails += Test_SUNLinSolGetID(LS, SUNLINEARSOLVER_CUSOLVERSP_BATCHQR, 0); diff --git a/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 index 7fdfb8dfd4..17806c16ec 100644 --- a/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 +++ b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 @@ -101,7 +101,7 @@ integer(C_INT) function unit_tests() result(fails) ! run tests fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSetup(LS, A, 0) - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, 0) + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 100*SUN_UNIT_ROUNDOFF, 0) fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0) fails = fails + Test_FSUNLinSolLastFlag(LS, 0) diff --git a/examples/sunlinsol/dense/test_sunlinsol_dense.c b/examples/sunlinsol/dense/test_sunlinsol_dense.c index 0a0657f08f..dbb6f2ce1c 100644 --- a/examples/sunlinsol/dense/test_sunlinsol_dense.c +++ b/examples/sunlinsol/dense/test_sunlinsol_dense.c @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) /* Run Tests */ fails += Test_SUNLinSolInitialize(LS, 0); fails += Test_SUNLinSolSetup(LS, A, 0); - fails += Test_SUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, SUNTRUE, 0); + fails += Test_SUNLinSolSolve(LS, A, x, b, 100*SUN_UNIT_ROUNDOFF, SUNTRUE, 0); fails += Test_SUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0); fails += Test_SUNLinSolGetID(LS, SUNLINEARSOLVER_DENSE, 0); diff --git a/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 index 551dcb8d54..c99a986a11 100644 --- a/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 +++ b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 @@ -98,7 +98,7 @@ integer(C_INT) function unit_tests() result(fails) ! run tests fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSetup(LS, A, 0) - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 1000*UNIT_ROUNDOFF, 0) + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 1000*SUN_UNIT_ROUNDOFF, 0) fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0) fails = fails + Test_FSUNLinSolLastFlag(LS, 0) diff --git a/examples/sunlinsol/klu/test_sunlinsol_klu.c b/examples/sunlinsol/klu/test_sunlinsol_klu.c index f107176f41..4f2954f6eb 100644 --- a/examples/sunlinsol/klu/test_sunlinsol_klu.c +++ b/examples/sunlinsol/klu/test_sunlinsol_klu.c @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) /* Run Tests */ fails += Test_SUNLinSolInitialize(LS, 0); fails += Test_SUNLinSolSetup(LS, A, 0); - fails += Test_SUNLinSolSolve(LS, A, x, b, 1000*UNIT_ROUNDOFF, SUNTRUE, 0); + fails += Test_SUNLinSolSolve(LS, A, x, b, 1000*SUN_UNIT_ROUNDOFF, SUNTRUE, 0); fails += Test_SUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0); fails += Test_SUNLinSolGetID(LS, SUNLINEARSOLVER_KLU, 0); diff --git a/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c b/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c index 98911f8f20..6e04a975dd 100644 --- a/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c +++ b/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) /* Run Tests */ fails += Test_SUNLinSolInitialize(LS, 0); fails += Test_SUNLinSolSetup(LS, A, 0); - fails += Test_SUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, SUNTRUE, 0); + fails += Test_SUNLinSolSolve(LS, A, x, b, 100*SUN_UNIT_ROUNDOFF, SUNTRUE, 0); fails += Test_SUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0); fails += Test_SUNLinSolGetID(LS, SUNLINEARSOLVER_LAPACKBAND, 0); diff --git a/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c b/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c index 1b312e13fc..567fdd65a5 100644 --- a/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c +++ b/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) /* Run Tests */ fails += Test_SUNLinSolInitialize(LS, 0); fails += Test_SUNLinSolSetup(LS, A, 0); - fails += Test_SUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, SUNTRUE, 0); + fails += Test_SUNLinSolSolve(LS, A, x, b, 100*SUN_UNIT_ROUNDOFF, SUNTRUE, 0); fails += Test_SUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0); fails += Test_SUNLinSolGetID(LS, SUNLINEARSOLVER_LAPACKDENSE, 0); diff --git a/examples/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp b/examples/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp index b5ed958f19..57f39868b4 100644 --- a/examples/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp +++ b/examples/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) for(j=0; j /* define constatnts */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/examples/sunmatrix/band/test_sunmatrix_band.c b/examples/sunmatrix/band/test_sunmatrix_band.c index 0b89f7cf37..67edf8da71 100644 --- a/examples/sunmatrix/band/test_sunmatrix_band.c +++ b/examples/sunmatrix/band/test_sunmatrix_band.c @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) /* identity matrix */ colj = SUNBandMatrix_Column(I, j); - colj[0] = RCONST(1.0); + colj[0] = SUN_RCONST(1.0); /* A matrix */ colj = SUNBandMatrix_Column(A, j); @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) xdata[i] = i; /* y vector */ - ydata[i] = RCONST(0.0); + ydata[i] = SUN_RCONST(0.0); jstart = SUNMAX(0, i-lband); jend = SUNMIN(cols-1, i+uband); for (j=jstart; j<=jend; j++) diff --git a/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu b/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu index 26a579af5e..c7464633be 100644 --- a/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu +++ b/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) matdata[row] = (sunrealtype) rand() / (sunrealtype) RAND_MAX / N; } } - if (SUNMatScaleAddI(RCONST(1.0), D)) { + if (SUNMatScaleAddI(SUN_RCONST(1.0), D)) { printf("ERROR: SUNMatScaleAddI failed for dense matrix D\n"); return(-1); } @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) matdata[row] = (sunrealtype) rand() / (sunrealtype) RAND_MAX / N; } } - if (SUNMatScaleAddI(RCONST(1.0), C)) { + if (SUNMatScaleAddI(SUN_RCONST(1.0), C)) { printf("ERROR: SUNMatScaleAddI failed for dense matrix C\n"); return(-1); } @@ -243,14 +243,14 @@ int main(int argc, char *argv[]) N = blkcols * nblocks; D = SUNDenseMatrix(M, N, sunctx); - SUNMatScaleAddI(RCONST(0.0), D); - if (SUNMatScaleAddI(RCONST(0.0), D)) { + SUNMatScaleAddI(SUN_RCONST(0.0), D); + if (SUNMatScaleAddI(SUN_RCONST(0.0), D)) { printf("ERROR: SUNMatScaleAddI failed for dense matrix D\n"); return(-1); } C = SUNDenseMatrix(M, N, sunctx); - if (SUNMatScaleAddI(RCONST(0.0), C)) { + if (SUNMatScaleAddI(SUN_RCONST(0.0), C)) { printf("ERROR: SUNMatScaleAddI failed for dense matrix C\n"); return(-1); } @@ -279,7 +279,7 @@ int main(int argc, char *argv[]) } SUNMatDestroy(cscA); - if (SUNMatScaleAddI(RCONST(1.0), A)) { + if (SUNMatScaleAddI(SUN_RCONST(1.0), A)) { printf("ERROR: SUNMatScaleAddI failed on matrix that read\n"); return(-1); } @@ -468,7 +468,7 @@ int main(int argc, char *argv[]) int Test_SetKernelExecPolicy(SUNMatrix I, int myid) { int print_all_ranks = 0; - sunrealtype tol = 100*UNIT_ROUNDOFF; + sunrealtype tol = 100*SUN_UNIT_ROUNDOFF; SUNMatrix B = SUNMatClone(I); /* check cloned matrix */ @@ -491,7 +491,7 @@ int Test_SetKernelExecPolicy(SUNMatrix I, int myid) SUNMatrix_cuSparse_SetKernelExecPolicy(B, &exec_policy); /* try out an operation */ - if (SUNMatScaleAddI(RCONST(-1.0), B)) { + if (SUNMatScaleAddI(SUN_RCONST(-1.0), B)) { TEST_STATUS(">>> FAILED test -- SetKernelExecPolicy \n", myid); TEST_STATUS(" SUNMatScaleAddI returned nonzero \n \n", myid); SUNMatDestroy(B); diff --git a/examples/sunmatrix/sparse/test_sunmatrix_sparse.c b/examples/sunmatrix/sparse/test_sunmatrix_sparse.c index dcb36f3d4f..03d3a0f892 100644 --- a/examples/sunmatrix/sparse/test_sunmatrix_sparse.c +++ b/examples/sunmatrix/sparse/test_sunmatrix_sparse.c @@ -104,15 +104,15 @@ int main(int argc, char *argv[]) B = SUNDenseMatrix(5,6, sunctx); matdata = SUNDenseMatrix_Data(B); - matdata[2] = RCONST(1.0); /* [ 0 2 0 0 7 0 ] */ - matdata[5] = RCONST(2.0); /* [ 0 0 4 0 8 0 ] */ - matdata[9] = RCONST(3.0); /* [ 1 0 0 0 0 0 ] */ - matdata[11] = RCONST(4.0); /* [ 0 0 5 6 0 0 ] */ - matdata[13] = RCONST(5.0); /* [ 0 3 0 0 0 9 ] */ - matdata[18] = RCONST(6.0); - matdata[20] = RCONST(7.0); - matdata[21] = RCONST(8.0); - matdata[29] = RCONST(9.0); + matdata[2] = SUN_RCONST(1.0); /* [ 0 2 0 0 7 0 ] */ + matdata[5] = SUN_RCONST(2.0); /* [ 0 0 4 0 8 0 ] */ + matdata[9] = SUN_RCONST(3.0); /* [ 1 0 0 0 0 0 ] */ + matdata[11] = SUN_RCONST(4.0); /* [ 0 0 5 6 0 0 ] */ + matdata[13] = SUN_RCONST(5.0); /* [ 0 3 0 0 0 9 ] */ + matdata[18] = SUN_RCONST(6.0); + matdata[20] = SUN_RCONST(7.0); + matdata[21] = SUN_RCONST(8.0); + matdata[29] = SUN_RCONST(9.0); if (mattype == CSR_MAT) { @@ -122,19 +122,19 @@ int main(int argc, char *argv[]) colindices = SUNSparseMatrix_IndexValues(C); matdata = SUNSparseMatrix_Data(C); rowptrs[0] = 0; - matdata[0] = RCONST(2.0); colindices[0] = 1; - matdata[1] = RCONST(7.0); colindices[1] = 4; + matdata[0] = SUN_RCONST(2.0); colindices[0] = 1; + matdata[1] = SUN_RCONST(7.0); colindices[1] = 4; rowptrs[1] = 2; - matdata[2] = RCONST(4.0); colindices[2] = 2; - matdata[3] = RCONST(8.0); colindices[3] = 4; + matdata[2] = SUN_RCONST(4.0); colindices[2] = 2; + matdata[3] = SUN_RCONST(8.0); colindices[3] = 4; rowptrs[2] = 4; - matdata[4] = RCONST(1.0); colindices[4] = 0; + matdata[4] = SUN_RCONST(1.0); colindices[4] = 0; rowptrs[3] = 5; - matdata[5] = RCONST(5.0); colindices[5] = 2; - matdata[6] = RCONST(6.0); colindices[6] = 3; + matdata[5] = SUN_RCONST(5.0); colindices[5] = 2; + matdata[6] = SUN_RCONST(6.0); colindices[6] = 3; rowptrs[4] = 7; - matdata[7] = RCONST(3.0); colindices[7] = 1; - matdata[8] = RCONST(9.0); colindices[8] = 5; + matdata[7] = SUN_RCONST(3.0); colindices[7] = 1; + matdata[8] = SUN_RCONST(9.0); colindices[8] = 5; rowptrs[5] = 9; A = SUNSparseFromDenseMatrix(B, ZERO, CSR_MAT); @@ -156,20 +156,20 @@ int main(int argc, char *argv[]) rowindices = SUNSparseMatrix_IndexValues(D); matdata = SUNSparseMatrix_Data(D); colptrs[0] = 0; - matdata[0] = RCONST(1.0); rowindices[0] = 2; + matdata[0] = SUN_RCONST(1.0); rowindices[0] = 2; colptrs[1] = 1; - matdata[1] = RCONST(2.0); rowindices[1] = 0; - matdata[2] = RCONST(3.0); rowindices[2] = 4; + matdata[1] = SUN_RCONST(2.0); rowindices[1] = 0; + matdata[2] = SUN_RCONST(3.0); rowindices[2] = 4; colptrs[2] = 3; - matdata[3] = RCONST(4.0); rowindices[3] = 1; - matdata[4] = RCONST(5.0); rowindices[4] = 3; + matdata[3] = SUN_RCONST(4.0); rowindices[3] = 1; + matdata[4] = SUN_RCONST(5.0); rowindices[4] = 3; colptrs[3] = 5; - matdata[5] = RCONST(6.0); rowindices[5] = 3; + matdata[5] = SUN_RCONST(6.0); rowindices[5] = 3; colptrs[4] = 6; - matdata[6] = RCONST(7.0); rowindices[6] = 0; - matdata[7] = RCONST(8.0); rowindices[7] = 1; + matdata[6] = SUN_RCONST(7.0); rowindices[6] = 0; + matdata[7] = SUN_RCONST(8.0); rowindices[7] = 1; colptrs[5] = 8; - matdata[8] = RCONST(9.0); rowindices[8] = 4; + matdata[8] = SUN_RCONST(9.0); rowindices[8] = 4; colptrs[6] = 9; A = SUNSparseFromDenseMatrix(B, 1e-15, CSC_MAT); @@ -208,33 +208,33 @@ int main(int argc, char *argv[]) colindices = SUNSparseMatrix_IndexValues(C); matdata = SUNSparseMatrix_Data(C); rowptrs[ 0] = 0; - matdata[ 0] = RCONST(2.0); colindices[ 0] = 1; + matdata[ 0] = SUN_RCONST(2.0); colindices[ 0] = 1; rowptrs[ 1] = 1; - matdata[ 1] = RCONST(-1.0); colindices[ 1] = 0; - matdata[ 2] = RCONST(1.0); colindices[ 2] = 1; - matdata[ 3] = RCONST(3.0); colindices[ 3] = 2; + matdata[ 1] = SUN_RCONST(-1.0); colindices[ 1] = 0; + matdata[ 2] = SUN_RCONST(1.0); colindices[ 2] = 1; + matdata[ 3] = SUN_RCONST(3.0); colindices[ 3] = 2; rowptrs[ 2] = 4; - matdata[ 4] = RCONST(-2.0); colindices[ 4] = 0; - matdata[ 5] = RCONST(2.0); colindices[ 5] = 2; - matdata[ 6] = RCONST(4.0); colindices[ 6] = 3; + matdata[ 4] = SUN_RCONST(-2.0); colindices[ 4] = 0; + matdata[ 5] = SUN_RCONST(2.0); colindices[ 5] = 2; + matdata[ 6] = SUN_RCONST(4.0); colindices[ 6] = 3; rowptrs[ 3] = 7; - matdata[ 7] = RCONST(-1.0); colindices[ 7] = 1; - matdata[ 8] = RCONST(1.0); colindices[ 8] = 2; - matdata[ 9] = RCONST(3.0); colindices[ 9] = 3; - matdata[10] = RCONST(5.0); colindices[10] = 4; + matdata[ 7] = SUN_RCONST(-1.0); colindices[ 7] = 1; + matdata[ 8] = SUN_RCONST(1.0); colindices[ 8] = 2; + matdata[ 9] = SUN_RCONST(3.0); colindices[ 9] = 3; + matdata[10] = SUN_RCONST(5.0); colindices[10] = 4; rowptrs[ 4] = 11; - matdata[11] = RCONST(2.0); colindices[11] = 3; - matdata[12] = RCONST(4.0); colindices[12] = 4; - matdata[13] = RCONST(6.0); colindices[13] = 5; + matdata[11] = SUN_RCONST(2.0); colindices[11] = 3; + matdata[12] = SUN_RCONST(4.0); colindices[12] = 4; + matdata[13] = SUN_RCONST(6.0); colindices[13] = 5; rowptrs[ 5] = 14; - matdata[14] = RCONST(1.0); colindices[14] = 3; - matdata[15] = RCONST(3.0); colindices[15] = 4; - matdata[16] = RCONST(5.0); colindices[16] = 5; - matdata[17] = RCONST(7.0); colindices[17] = 6; + matdata[14] = SUN_RCONST(1.0); colindices[14] = 3; + matdata[15] = SUN_RCONST(3.0); colindices[15] = 4; + matdata[16] = SUN_RCONST(5.0); colindices[16] = 5; + matdata[17] = SUN_RCONST(7.0); colindices[17] = 6; rowptrs[ 6] = 18; - matdata[18] = RCONST(2.0); colindices[18] = 4; - matdata[19] = RCONST(4.0); colindices[19] = 5; - matdata[20] = RCONST(6.0); colindices[20] = 6; + matdata[18] = SUN_RCONST(2.0); colindices[18] = 4; + matdata[19] = SUN_RCONST(4.0); colindices[19] = 5; + matdata[20] = SUN_RCONST(6.0); colindices[20] = 6; rowptrs[ 7] = 21; A = SUNSparseFromBandMatrix(B, ZERO, CSR_MAT); @@ -256,33 +256,33 @@ int main(int argc, char *argv[]) rowindices = SUNSparseMatrix_IndexValues(D); matdata = SUNSparseMatrix_Data(D); colptrs[ 0] = 0; - matdata[ 0] = RCONST(-1.0); rowindices[ 0] = 1; - matdata[ 1] = RCONST(-2.0); rowindices[ 1] = 2; + matdata[ 0] = SUN_RCONST(-1.0); rowindices[ 0] = 1; + matdata[ 1] = SUN_RCONST(-2.0); rowindices[ 1] = 2; colptrs[ 1] = 2; - matdata[ 2] = RCONST(2.0); rowindices[ 2] = 0; - matdata[ 3] = RCONST(1.0); rowindices[ 3] = 1; - matdata[ 4] = RCONST(-1.0); rowindices[ 4] = 3; + matdata[ 2] = SUN_RCONST(2.0); rowindices[ 2] = 0; + matdata[ 3] = SUN_RCONST(1.0); rowindices[ 3] = 1; + matdata[ 4] = SUN_RCONST(-1.0); rowindices[ 4] = 3; colptrs[ 2] = 5; - matdata[ 5] = RCONST(3.0); rowindices[ 5] = 1; - matdata[ 6] = RCONST(2.0); rowindices[ 6] = 2; - matdata[ 7] = RCONST(1.0); rowindices[ 7] = 3; + matdata[ 5] = SUN_RCONST(3.0); rowindices[ 5] = 1; + matdata[ 6] = SUN_RCONST(2.0); rowindices[ 6] = 2; + matdata[ 7] = SUN_RCONST(1.0); rowindices[ 7] = 3; colptrs[ 3] = 8; - matdata[ 8] = RCONST(4.0); rowindices[ 8] = 2; - matdata[ 9] = RCONST(3.0); rowindices[ 9] = 3; - matdata[10] = RCONST(2.0); rowindices[10] = 4; - matdata[11] = RCONST(1.0); rowindices[11] = 5; + matdata[ 8] = SUN_RCONST(4.0); rowindices[ 8] = 2; + matdata[ 9] = SUN_RCONST(3.0); rowindices[ 9] = 3; + matdata[10] = SUN_RCONST(2.0); rowindices[10] = 4; + matdata[11] = SUN_RCONST(1.0); rowindices[11] = 5; colptrs[ 4] = 12; - matdata[12] = RCONST(5.0); rowindices[12] = 3; - matdata[13] = RCONST(4.0); rowindices[13] = 4; - matdata[14] = RCONST(3.0); rowindices[14] = 5; - matdata[15] = RCONST(2.0); rowindices[15] = 6; + matdata[12] = SUN_RCONST(5.0); rowindices[12] = 3; + matdata[13] = SUN_RCONST(4.0); rowindices[13] = 4; + matdata[14] = SUN_RCONST(3.0); rowindices[14] = 5; + matdata[15] = SUN_RCONST(2.0); rowindices[15] = 6; colptrs[ 5] = 16; - matdata[16] = RCONST(6.0); rowindices[16] = 4; - matdata[17] = RCONST(5.0); rowindices[17] = 5; - matdata[18] = RCONST(4.0); rowindices[18] = 6; + matdata[16] = SUN_RCONST(6.0); rowindices[16] = 4; + matdata[17] = SUN_RCONST(5.0); rowindices[17] = 5; + matdata[18] = SUN_RCONST(4.0); rowindices[18] = 6; colptrs[ 6] = 19; - matdata[19] = RCONST(7.0); rowindices[19] = 5; - matdata[20] = RCONST(6.0); rowindices[20] = 6; + matdata[19] = SUN_RCONST(7.0); rowindices[19] = 5; + matdata[20] = SUN_RCONST(6.0); rowindices[20] = 6; colptrs[ 7] = 21; A = SUNSparseFromBandMatrix(B, 1e-15, CSC_MAT); @@ -428,7 +428,7 @@ int Test_SUNMatScaleAdd2(SUNMatrix A, SUNMatrix B, N_Vector x, int failure; SUNMatrix C, D, E; N_Vector u, v; - sunrealtype tol=100*UNIT_ROUNDOFF; + sunrealtype tol=100*SUN_UNIT_ROUNDOFF; /* create clones for test */ C = SUNMatClone(A); @@ -601,7 +601,7 @@ int Test_SUNMatScaleAddI2(SUNMatrix A, N_Vector x, N_Vector y) int failure; SUNMatrix B, C, D; N_Vector w, z; - sunrealtype tol=200*UNIT_ROUNDOFF; + sunrealtype tol=200*SUN_UNIT_ROUNDOFF; /* create clones for test */ B = SUNMatClone(A); @@ -743,7 +743,7 @@ int Test_SUNSparseMatrixToCSR(SUNMatrix A) { int failure; SUNMatrix csc, csr; - sunrealtype tol=200*UNIT_ROUNDOFF; + sunrealtype tol=200*SUN_UNIT_ROUNDOFF; failure = SUNSparseMatrix_ToCSR(A, &csr); @@ -779,7 +779,7 @@ int Test_SUNSparseMatrixToCSC(SUNMatrix A) { int failure; SUNMatrix csc=NULL, csr=NULL; - sunrealtype tol=200*UNIT_ROUNDOFF; + sunrealtype tol=200*SUN_UNIT_ROUNDOFF; failure = SUNSparseMatrix_ToCSC(A, &csc); diff --git a/examples/sunmatrix/test_sunmatrix.c b/examples/sunmatrix/test_sunmatrix.c index ca6a75b631..7f2e1a33c9 100644 --- a/examples/sunmatrix/test_sunmatrix.c +++ b/examples/sunmatrix/test_sunmatrix.c @@ -79,7 +79,7 @@ int Test_SUNMatClone(SUNMatrix A, int myid) { int failure; double start_time, stop_time; - sunrealtype tol=10*UNIT_ROUNDOFF; + sunrealtype tol=10*SUN_UNIT_ROUNDOFF; SUNMatrix B; /* clone matrix */ @@ -136,7 +136,7 @@ int Test_SUNMatZero(SUNMatrix A, int myid) { int failure; double start_time, stop_time; - sunrealtype tol=10*UNIT_ROUNDOFF; + sunrealtype tol=10*SUN_UNIT_ROUNDOFF; SUNMatrix B; /* protect A */ @@ -183,7 +183,7 @@ int Test_SUNMatCopy(SUNMatrix A, int myid) int failure; double start_time, stop_time; SUNMatrix B; - sunrealtype tol=10*UNIT_ROUNDOFF; + sunrealtype tol=10*SUN_UNIT_ROUNDOFF; B = SUNMatClone(A); @@ -232,7 +232,7 @@ int Test_SUNMatScaleAdd(SUNMatrix A, SUNMatrix I, int myid) int failure; double start_time, stop_time; SUNMatrix B, C, D; - sunrealtype tol=10*UNIT_ROUNDOFF; + sunrealtype tol=10*SUN_UNIT_ROUNDOFF; /* * Case 1: same sparsity/bandwith pattern @@ -359,7 +359,7 @@ int Test_SUNMatScaleAddI(SUNMatrix A, SUNMatrix I, int myid) int failure; double start_time, stop_time; SUNMatrix B; - sunrealtype tol=10*UNIT_ROUNDOFF; + sunrealtype tol=10*SUN_UNIT_ROUNDOFF; /* protect A */ B = SUNMatClone(A); @@ -444,7 +444,7 @@ int Test_SUNMatMatvec(SUNMatrix A, N_Vector x, N_Vector y, int myid) double start_time, stop_time; SUNMatrix B; N_Vector z, w; - sunrealtype tol=100*UNIT_ROUNDOFF; + sunrealtype tol=100*SUN_UNIT_ROUNDOFF; if (A->ops->matvec == NULL) { TEST_STATUS(" PASSED test -- SUNMatMatvec not implemented\n", myid); diff --git a/examples/sunmatrix/test_sunmatrix.f90 b/examples/sunmatrix/test_sunmatrix.f90 index 07c0f2299f..de97d621e1 100644 --- a/examples/sunmatrix/test_sunmatrix.f90 +++ b/examples/sunmatrix/test_sunmatrix.f90 @@ -137,7 +137,7 @@ integer(C_INT) function Test_FSUNMatClone(A, myid) result(failure) integer(C_INT) :: myid type(SUNMatrix) :: A - real(C_DOUBLE) :: tol = 10*UNIT_ROUNDOFF + real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix), pointer :: B failure = 0 @@ -180,7 +180,7 @@ integer(C_INT) function Test_FSUNMatZero(A, myid) result(failure) implicit none integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*UNIT_ROUNDOFF + real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A type(SUNMatrix), pointer :: B @@ -218,7 +218,7 @@ integer(C_INT) function Test_FSUNMatCopy(A, myid) result(failure) implicit none integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*UNIT_ROUNDOFF + real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A type(SUNMatrix), pointer :: B @@ -257,7 +257,7 @@ integer(C_INT) function Test_FSUNMatScaleAdd(A, I, myid) result(failure) implicit none integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*UNIT_ROUNDOFF + real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A, I type(SUNMatrix), pointer :: B @@ -306,7 +306,7 @@ integer(C_INT) function Test_FSUNMatScaleAddI(A, I, myid) result(failure) implicit none integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*UNIT_ROUNDOFF + real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A, I type(SUNMatrix), pointer :: B @@ -386,7 +386,7 @@ integer(C_INT) function Test_FSUNMatMatvec(A, x, y, myid) result(failure) type(N_Vector) :: x, y type(N_Vector), pointer :: z, w integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 100*UNIT_ROUNDOFF + real(C_DOUBLE) :: tol = 100*SUN_UNIT_ROUNDOFF type(SUNMatrix_Ops), pointer :: ops failure = 0 diff --git a/examples/sunmatrix/test_sunmatrix.h b/examples/sunmatrix/test_sunmatrix.h index e6da14544c..99ea6cc707 100644 --- a/examples/sunmatrix/test_sunmatrix.h +++ b/examples/sunmatrix/test_sunmatrix.h @@ -21,14 +21,14 @@ #include /* define constatnts */ -#define NEG_TWO RCONST(-2.0) -#define NEG_ONE RCONST(-1.0) -#define NEG_HALF RCONST(-0.5) -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define THREE RCONST(3.0) +#define NEG_TWO SUN_RCONST(-2.0) +#define NEG_ONE SUN_RCONST(-1.0) +#define NEG_HALF SUN_RCONST(-0.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define THREE SUN_RCONST(3.0) /* Helpers for printing out test status information */ #define TEST_STATUS(fmt, myrank) \ diff --git a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c index a7931d7a29..43b986d4d6 100644 --- a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c +++ b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c @@ -62,19 +62,19 @@ /* problem constants */ #define NEQ 3 /* number of equations */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define PTONE RCONST(0.1) /* real 0.1 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define PTNINE RCONST(0.9) /* real 0.9 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define ONEPTZEROSIX RCONST(1.06) /* real 1.06 */ -#define THREE RCONST(3.0) /* real 3.0 */ -#define SIX RCONST(6.0) /* real 6.0 */ -#define NINE RCONST(9.0) /* real 9.0 */ -#define TEN RCONST(10.0) /* real 10.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ -#define SIXTY RCONST(60.0) /* real 60.0 */ -#define PI RCONST(3.1415926535898) /* real pi */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define PTONE SUN_RCONST(0.1) /* real 0.1 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define PTNINE SUN_RCONST(0.9) /* real 0.9 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define ONEPTZEROSIX SUN_RCONST(1.06) /* real 1.06 */ +#define THREE SUN_RCONST(3.0) /* real 3.0 */ +#define SIX SUN_RCONST(6.0) /* real 6.0 */ +#define NINE SUN_RCONST(9.0) /* real 9.0 */ +#define TEN SUN_RCONST(10.0) /* real 10.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ +#define SIXTY SUN_RCONST(60.0) /* real 60.0 */ +#define PI SUN_RCONST(3.1415926535898) /* real pi */ /* analytic solution */ #define XTRUE HALF @@ -114,10 +114,10 @@ int main(int argc, char *argv[]) IntegratorMem Imem = NULL; int retval = 0; SUNNonlinearSolver NLS = NULL; - sunrealtype tol = 100 * SUNRsqrt(UNIT_ROUNDOFF); + sunrealtype tol = 100 * SUNRsqrt(SUN_UNIT_ROUNDOFF); int mxiter = 20; int maa = 0; /* no acceleration */ - sunrealtype damping = RCONST(1.0); /* no damping */ + sunrealtype damping = SUN_RCONST(1.0); /* no damping */ long int niters = 0; sunrealtype* data = NULL; SUNContext sunctx = NULL; diff --git a/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c b/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c index b24209b22e..5ee983de89 100644 --- a/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c +++ b/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c @@ -34,16 +34,16 @@ #endif #define NEQ 3 /* number of equations */ -#define TOL RCONST(1.0e-2) /* nonlinear solver tolerance */ +#define TOL SUN_RCONST(1.0e-2) /* nonlinear solver tolerance */ #define MAXIT 10 /* max nonlinear iterations */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define THREE RCONST(3.0) /* real 3.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define SIX RCONST(6.0) /* real 6.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define THREE SUN_RCONST(3.0) /* real 3.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define SIX SUN_RCONST(6.0) /* real 6.0 */ /* approximate solution */ #define Y1 0.785196933062355226 diff --git a/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c b/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c index d859c2b4fc..b54a4e4979 100644 --- a/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c +++ b/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c @@ -32,16 +32,16 @@ #endif #define NEQ 3 /* number of equations */ -#define TOL RCONST(1.0e-2) /* nonlinear solver tolerance */ +#define TOL SUN_RCONST(1.0e-2) /* nonlinear solver tolerance */ #define MAXIT 10 /* max nonlinear iterations */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define THREE RCONST(3.0) /* real 3.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define SIX RCONST(6.0) /* real 6.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define THREE SUN_RCONST(3.0) /* real 3.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define SIX SUN_RCONST(6.0) /* real 6.0 */ /* approximate solution */ #define Y1 0.785196933062355226 diff --git a/examples/utilities/test_utilities.f90 b/examples/utilities/test_utilities.f90 index 77d684801e..7ff5c32fe2 100644 --- a/examples/utilities/test_utilities.f90 +++ b/examples/utilities/test_utilities.f90 @@ -20,7 +20,7 @@ module test_utilities use fsundials_context_mod implicit none - real(C_DOUBLE), parameter :: UNIT_ROUNDOFF = epsilon(1.0d0) + real(C_DOUBLE), parameter :: SUN_UNIT_ROUNDOFF = epsilon(1.0d0) real(C_DOUBLE) :: NEG_TWO = -2.0d0 real(C_DOUBLE) :: NEG_ONE = -1.0d0 @@ -79,7 +79,7 @@ integer(C_INT) function FNEQ(a, b) result(nequal) if (a /= a) then nequal = 1 - else if ((abs(a-b)/abs(b)) > (10*UNIT_ROUNDOFF)) then + else if ((abs(a-b)/abs(b)) > (10*SUN_UNIT_ROUNDOFF)) then nequal = 1 else nequal = 0 diff --git a/include/cvode/cvode_hypamgpre.h b/include/cvode/cvode_hypamgpre.h index 27e1ad3902..78ac09f18a 100644 --- a/include/cvode/cvode_hypamgpre.h +++ b/include/cvode/cvode_hypamgpre.h @@ -150,7 +150,7 @@ extern "C" { * and ewt (the error weight vector) are accessible through * CVodeGetCurrentStep and CVodeGetErrWeights, respectively * (see cvode.h). The unit roundoff is available as - * UNIT_ROUNDOFF defined in sundials_types.h. + * SUN_UNIT_ROUNDOFF defined in sundials_types.h. * * ----------------------------------------------------------------- */ diff --git a/include/sundials/sundials_math.h b/include/sundials/sundials_math.h index 6186653d94..691015938f 100644 --- a/include/sundials/sundials_math.h +++ b/include/sundials/sundials_math.h @@ -77,14 +77,14 @@ extern "C" { #ifndef SUNRsqrt #if defined(__cplusplus) || defined(SUNDIALS_C_COMPILER_HAS_MATH_PRECISIONS) # if defined(SUNDIALS_DOUBLE_PRECISION) -# define SUNRsqrt(x) ((x) <= RCONST(0.0) ? (RCONST(0.0)) : (sqrt((x)))) +# define SUNRsqrt(x) ((x) <= SUN_RCONST(0.0) ? (SUN_RCONST(0.0)) : (sqrt((x)))) # elif defined(SUNDIALS_SINGLE_PRECISION) -# define SUNRsqrt(x) ((x) <= RCONST(0.0) ? (RCONST(0.0)) : (sqrtf((x)))) +# define SUNRsqrt(x) ((x) <= SUN_RCONST(0.0) ? (SUN_RCONST(0.0)) : (sqrtf((x)))) # elif defined(SUNDIALS_EXTENDED_PRECISION) -# define SUNRsqrt(x) ((x) <= RCONST(0.0) ? (RCONST(0.0)) : (sqrtl((x)))) +# define SUNRsqrt(x) ((x) <= SUN_RCONST(0.0) ? (SUN_RCONST(0.0)) : (sqrtl((x)))) # endif #else -# define SUNRsqrt(x) ((x) <= RCONST(0.0) ? (RCONST(0.0)) : ((sunrealtype) sqrt((double) (x)))) +# define SUNRsqrt(x) ((x) <= SUN_RCONST(0.0) ? (SUN_RCONST(0.0)) : ((sunrealtype) sqrt((double) (x)))) #endif #endif diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index e60509088d..a8d08a52ed 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -83,13 +83,6 @@ extern "C" { #if defined(SUNDIALS_SINGLE_PRECISION) -/* deprecated */ -typedef float sunrealtype; -# define RCONST(x) x##F -# define BIG_REAL FLT_MAX -# define SMALL_REAL FLT_MIN -# define UNIT_ROUNDOFF FLT_EPSILON - typedef float sunrealtype; # define SUN_RCONST(x) x##F # define SUN_BIG_REAL FLT_MAX @@ -98,12 +91,6 @@ typedef float sunrealtype; #elif defined(SUNDIALS_DOUBLE_PRECISION) -/* deprecated */ -# define RCONST(x) x -# define BIG_REAL DBL_MAX -# define SMALL_REAL DBL_MIN -# define UNIT_ROUNDOFF DBL_EPSILON - typedef double sunrealtype; # define SUN_RCONST(x) x # define SUN_BIG_REAL DBL_MAX @@ -112,13 +99,6 @@ typedef double sunrealtype; #elif defined(SUNDIALS_EXTENDED_PRECISION) -/* deprecated */ -typedef long double sunrealtype; -# define RCONST(x) x##L -# define BIG_REAL LDBL_MAX -# define SMALL_REAL LDBL_MIN -# define UNIT_ROUNDOFF LDBL_EPSILON - typedef long double sunrealtype; # define SUN_RCONST(x) x##L # define SUN_BIG_REAL LDBL_MAX diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 54c25d81ef..14cd3e6429 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -72,7 +72,7 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->sunctx = sunctx; /* Set uround */ - ark_mem->uround = UNIT_ROUNDOFF; + ark_mem->uround = SUN_UNIT_ROUNDOFF; /* Initialize time step module to NULL */ ark_mem->step_attachlinsol = NULL; @@ -2262,7 +2262,7 @@ int arkHin(ARKodeMem ark_mem, sunrealtype tout) /* If successful, we can use ydd */ if (retval == ARK_SUCCESS) {hgOK = SUNTRUE; break;} /* f() failed recoverably; cut step size and test it again */ - hg *= RCONST(0.2); + hg *= SUN_RCONST(0.2); } /* If f() failed recoverably H0_ITERS times */ @@ -2660,7 +2660,7 @@ int arkEwtSetSV(N_Vector ycur, N_Vector weight, void* arkode_mem) This routine is responsible for setting the error weight vector ewt as follows: - ewt[i] = SMALL_REAL + ewt[i] = SUN_SMALL_REAL This is routine is only used with explicit time stepping with a fixed step size to avoid a potential too much error return @@ -2668,7 +2668,7 @@ int arkEwtSetSV(N_Vector ycur, N_Vector weight, void* arkode_mem) ---------------------------------------------------------------*/ int arkEwtSetSmallReal(N_Vector ycur, N_Vector weight, void* arkode_mem) { - N_VConst(SMALL_REAL, weight); + N_VConst(SUN_SMALL_REAL, weight); return(ARK_SUCCESS); } @@ -2724,7 +2724,7 @@ int arkExpStab(N_Vector y, sunrealtype t, sunrealtype *hstab, void *data) { /* explicit stability not used by default, set to zero to disable */ - *hstab = RCONST(0.0); + *hstab = SUN_RCONST(0.0); return(ARK_SUCCESS); } @@ -2998,7 +2998,7 @@ int arkCheckConstraints(ARKodeMem ark_mem, int *constrfails, int *nflag) /* Reduce h by computing eta = h'/h */ N_VLinearSum(ONE, ark_mem->yn, -ONE, ark_mem->ycur, tmp); N_VProd(mm, tmp, tmp); - ark_mem->eta = RCONST(0.9)*N_VMinQuotient(ark_mem->yn, tmp); + ark_mem->eta = SUN_RCONST(0.9)*N_VMinQuotient(ark_mem->yn, tmp); ark_mem->eta = SUNMAX(ark_mem->eta, TENTH); /* Signal for Jacobian/preconditioner setup */ diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index da6003f407..6f6ca24b57 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -175,7 +175,7 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, "Error in explicit stability function."); return (ARK_ILL_INPUT); } - if (h_cfl <= ZERO) h_cfl = RCONST(1.0e30) * SUNRabs(hcur); + if (h_cfl <= ZERO) h_cfl = SUN_RCONST(1.0e30) * SUNRabs(hcur); /* Solver diagnostics reporting */ if (ark_mem->report) diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index 215666d7ea..acfe48fe9d 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -35,32 +35,32 @@ extern "C" { #define ARK_ADAPT_LIW 8 /* includes function/data pointers */ /* Time step controller default values */ -#define CFLFAC RCONST(0.5) -#define SAFETY RCONST(0.96) /* CVODE uses 1.0 */ -#define BIAS RCONST(1.5) /* CVODE uses 6.0 */ -#define GROWTH RCONST(20.0) /* CVODE uses 10.0 */ -#define HFIXED_LB RCONST(1.0) /* CVODE uses 1.0 */ -#define HFIXED_UB RCONST(1.5) /* CVODE uses 1.5 */ -#define AD0_K1 RCONST(0.58) /* PID controller constants */ -#define AD0_K2 RCONST(0.21) -#define AD0_K3 RCONST(0.1) -#define AD1_K1 RCONST(0.8) /* PI controller constants */ -#define AD1_K2 RCONST(0.31) -#define AD2_K1 RCONST(1.0) /* I controller constants */ -#define AD3_K1 RCONST(0.367) /* explicit Gustafsson controller */ -#define AD3_K2 RCONST(0.268) -#define AD4_K1 RCONST(0.98) /* implicit Gustafsson controller */ -#define AD4_K2 RCONST(0.95) -#define AD5_K1 RCONST(0.367) /* imex Gustafsson controller */ -#define AD5_K2 RCONST(0.268) -#define AD5_K3 RCONST(0.95) - -#define ETAMX1 RCONST(10000.0) /* maximum step size change on first step */ -#define ETAMXF RCONST(0.3) /* step size reduction factor on multiple error +#define CFLFAC SUN_RCONST(0.5) +#define SAFETY SUN_RCONST(0.96) /* CVODE uses 1.0 */ +#define BIAS SUN_RCONST(1.5) /* CVODE uses 6.0 */ +#define GROWTH SUN_RCONST(20.0) /* CVODE uses 10.0 */ +#define HFIXED_LB SUN_RCONST(1.0) /* CVODE uses 1.0 */ +#define HFIXED_UB SUN_RCONST(1.5) /* CVODE uses 1.5 */ +#define AD0_K1 SUN_RCONST(0.58) /* PID controller constants */ +#define AD0_K2 SUN_RCONST(0.21) +#define AD0_K3 SUN_RCONST(0.1) +#define AD1_K1 SUN_RCONST(0.8) /* PI controller constants */ +#define AD1_K2 SUN_RCONST(0.31) +#define AD2_K1 SUN_RCONST(1.0) /* I controller constants */ +#define AD3_K1 SUN_RCONST(0.367) /* explicit Gustafsson controller */ +#define AD3_K2 SUN_RCONST(0.268) +#define AD4_K1 SUN_RCONST(0.98) /* implicit Gustafsson controller */ +#define AD4_K2 SUN_RCONST(0.95) +#define AD5_K1 SUN_RCONST(0.367) /* imex Gustafsson controller */ +#define AD5_K2 SUN_RCONST(0.268) +#define AD5_K3 SUN_RCONST(0.95) + +#define ETAMX1 SUN_RCONST(10000.0) /* maximum step size change on first step */ +#define ETAMXF SUN_RCONST(0.3) /* step size reduction factor on multiple error test failures (multiple implies >= SMALL_NEF) */ -#define ETAMIN RCONST(0.1) /* smallest allowable step size reduction factor +#define ETAMIN SUN_RCONST(0.1) /* smallest allowable step size reduction factor on an error test failure */ -#define ETACF RCONST(0.25) /* step size reduction factor on nonlinear +#define ETACF SUN_RCONST(0.25) /* step size reduction factor on nonlinear convergence failure */ #define SMALL_NEF 2 /* if an error failure occurs and SMALL_NEF <= nef, then reset eta = MIN(eta, ETAMXF) */ diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 8c4f132e3e..57f155d1e1 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -2083,7 +2083,7 @@ int arkStep_CheckButcherTables(ARKodeMem ark_mem) int i, j; booleantype okay; ARKodeARKStepMem step_mem; - const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + const sunrealtype tol = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; /* access ARKodeARKStepMem structure */ if (ark_mem->step_mem==NULL) { @@ -2711,7 +2711,7 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype *dsmPtr) /* solve for y update (stored in y) */ retval = step_mem->msolve((void *) ark_mem, y, step_mem->nlscoef); if (retval < 0) { - *dsmPtr = RCONST(2.0); /* indicate too much error, step with smaller step */ + *dsmPtr = SUN_RCONST(2.0); /* indicate too much error, step with smaller step */ N_VScale(ONE, ark_mem->yn, y); /* place old solution into y */ return(CONV_FAIL); } @@ -2746,7 +2746,7 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype *dsmPtr) /* solve for yerr */ retval = step_mem->msolve((void *) ark_mem, yerr, step_mem->nlscoef); if (retval < 0) { - *dsmPtr = RCONST(2.0); /* next attempt will reduce step by 'etacf'; + *dsmPtr = SUN_RCONST(2.0); /* next attempt will reduce step by 'etacf'; insert dsmPtr placeholder here */ return(CONV_FAIL); } diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index d844600673..bfc899340f 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -34,16 +34,16 @@ extern "C" { ===============================================================*/ #define MAXCOR 3 /* max number of nonlinear iterations */ -#define CRDOWN RCONST(0.3) /* constant to estimate the convergence +#define CRDOWN SUN_RCONST(0.3) /* constant to estimate the convergence rate for the nonlinear equation */ -#define DGMAX RCONST(0.2) /* if |gamma/gammap-1| > DGMAX then call lsetup */ -#define RDIV RCONST(2.3) /* declare divergence if ratio del/delp > RDIV */ +#define DGMAX SUN_RCONST(0.2) /* if |gamma/gammap-1| > DGMAX then call lsetup */ +#define RDIV SUN_RCONST(2.3) /* declare divergence if ratio del/delp > RDIV */ #define MSBP 20 /* max no. of steps between lsetup calls */ /* Default solver tolerance factor */ -/* #define NLSCOEF RCONST(0.003) */ /* Hairer & Wanner constant */ -/* #define NLSCOEF RCONST(0.2) */ /* CVODE constant */ -#define NLSCOEF RCONST(0.1) +/* #define NLSCOEF SUN_RCONST(0.003) */ /* Hairer & Wanner constant */ +/* #define NLSCOEF SUN_RCONST(0.2) */ /* CVODE constant */ +#define NLSCOEF SUN_RCONST(0.1) /* Mass matrix types */ #define MASS_IDENTITY 0 diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 8994d6d830..1b14332bac 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -474,12 +474,12 @@ int ARKStepSetOptimalParams(void *arkode_mem) /* explicit */ if (step_mem->explicit && !step_mem->implicit) { hadapt_mem->imethod = ARK_ADAPT_PI; - hadapt_mem->safety = RCONST(0.99); - hadapt_mem->bias = RCONST(1.2); - hadapt_mem->growth = RCONST(25.0); - hadapt_mem->k1 = RCONST(0.8); - hadapt_mem->k2 = RCONST(0.31); - hadapt_mem->etamxf = RCONST(0.3); + hadapt_mem->safety = SUN_RCONST(0.99); + hadapt_mem->bias = SUN_RCONST(1.2); + hadapt_mem->growth = SUN_RCONST(25.0); + hadapt_mem->k1 = SUN_RCONST(0.8); + hadapt_mem->k2 = SUN_RCONST(0.31); + hadapt_mem->etamxf = SUN_RCONST(0.3); /* implicit */ } else if (step_mem->implicit && !step_mem->explicit) { @@ -492,7 +492,7 @@ int ARKStepSetOptimalParams(void *arkode_mem) hadapt_mem->etamxf = ETAMXF; hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; - step_mem->nlscoef = RCONST(0.001); + step_mem->nlscoef = SUN_RCONST(0.001); step_mem->maxcor = 5; step_mem->crdown = CRDOWN; step_mem->rdiv = RDIV; @@ -501,50 +501,50 @@ int ARKStepSetOptimalParams(void *arkode_mem) break; case 3: hadapt_mem->imethod = ARK_ADAPT_I; - hadapt_mem->safety = RCONST(0.957); - hadapt_mem->bias = RCONST(1.9); - hadapt_mem->growth = RCONST(17.6); - hadapt_mem->etamxf = RCONST(0.45); + hadapt_mem->safety = SUN_RCONST(0.957); + hadapt_mem->bias = SUN_RCONST(1.9); + hadapt_mem->growth = SUN_RCONST(17.6); + hadapt_mem->etamxf = SUN_RCONST(0.45); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; - step_mem->nlscoef = RCONST(0.22); - step_mem->crdown = RCONST(0.17); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.19); + step_mem->nlscoef = SUN_RCONST(0.22); + step_mem->crdown = SUN_RCONST(0.17); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.19); step_mem->msbp = 60; break; case 4: hadapt_mem->imethod = ARK_ADAPT_PID; - hadapt_mem->safety = RCONST(0.988); - hadapt_mem->bias = RCONST(1.2); - hadapt_mem->growth = RCONST(31.5); - hadapt_mem->k1 = RCONST(0.535); - hadapt_mem->k2 = RCONST(0.209); - hadapt_mem->k3 = RCONST(0.148); - hadapt_mem->etamxf = RCONST(0.33); + hadapt_mem->safety = SUN_RCONST(0.988); + hadapt_mem->bias = SUN_RCONST(1.2); + hadapt_mem->growth = SUN_RCONST(31.5); + hadapt_mem->k1 = SUN_RCONST(0.535); + hadapt_mem->k2 = SUN_RCONST(0.209); + hadapt_mem->k3 = SUN_RCONST(0.148); + hadapt_mem->etamxf = SUN_RCONST(0.33); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; - step_mem->nlscoef = RCONST(0.24); - step_mem->crdown = RCONST(0.26); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.16); + step_mem->nlscoef = SUN_RCONST(0.24); + step_mem->crdown = SUN_RCONST(0.26); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.16); step_mem->msbp = 31; break; case 5: hadapt_mem->imethod = ARK_ADAPT_PID; - hadapt_mem->safety = RCONST(0.937); - hadapt_mem->bias = RCONST(3.3); - hadapt_mem->growth = RCONST(22.0); - hadapt_mem->k1 = RCONST(0.56); - hadapt_mem->k2 = RCONST(0.338); - hadapt_mem->k3 = RCONST(0.14); - hadapt_mem->etamxf = RCONST(0.44); + hadapt_mem->safety = SUN_RCONST(0.937); + hadapt_mem->bias = SUN_RCONST(3.3); + hadapt_mem->growth = SUN_RCONST(22.0); + hadapt_mem->k1 = SUN_RCONST(0.56); + hadapt_mem->k2 = SUN_RCONST(0.338); + hadapt_mem->k3 = SUN_RCONST(0.14); + hadapt_mem->etamxf = SUN_RCONST(0.44); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; - step_mem->nlscoef = RCONST(0.25); - step_mem->crdown = RCONST(0.4); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.32); + step_mem->nlscoef = SUN_RCONST(0.25); + step_mem->crdown = SUN_RCONST(0.4); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.32); step_mem->msbp = 31; break; } @@ -554,52 +554,52 @@ int ARKStepSetOptimalParams(void *arkode_mem) switch (step_mem->q) { case 3: hadapt_mem->imethod = ARK_ADAPT_PID; - hadapt_mem->safety = RCONST(0.965); - hadapt_mem->bias = RCONST(1.42); - hadapt_mem->growth = RCONST(28.7); - hadapt_mem->k1 = RCONST(0.54); - hadapt_mem->k2 = RCONST(0.36); - hadapt_mem->k3 = RCONST(0.14); - hadapt_mem->etamxf = RCONST(0.46); + hadapt_mem->safety = SUN_RCONST(0.965); + hadapt_mem->bias = SUN_RCONST(1.42); + hadapt_mem->growth = SUN_RCONST(28.7); + hadapt_mem->k1 = SUN_RCONST(0.54); + hadapt_mem->k2 = SUN_RCONST(0.36); + hadapt_mem->k3 = SUN_RCONST(0.14); + hadapt_mem->etamxf = SUN_RCONST(0.46); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; - step_mem->nlscoef = RCONST(0.22); - step_mem->crdown = RCONST(0.17); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.19); + step_mem->nlscoef = SUN_RCONST(0.22); + step_mem->crdown = SUN_RCONST(0.17); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.19); step_mem->msbp = 60; break; case 4: hadapt_mem->imethod = ARK_ADAPT_PID; - hadapt_mem->safety = RCONST(0.97); - hadapt_mem->bias = RCONST(1.35); - hadapt_mem->growth = RCONST(25.0); - hadapt_mem->k1 = RCONST(0.543); - hadapt_mem->k2 = RCONST(0.297); - hadapt_mem->k3 = RCONST(0.14); - hadapt_mem->etamxf = RCONST(0.47); + hadapt_mem->safety = SUN_RCONST(0.97); + hadapt_mem->bias = SUN_RCONST(1.35); + hadapt_mem->growth = SUN_RCONST(25.0); + hadapt_mem->k1 = SUN_RCONST(0.543); + hadapt_mem->k2 = SUN_RCONST(0.297); + hadapt_mem->k3 = SUN_RCONST(0.14); + hadapt_mem->etamxf = SUN_RCONST(0.47); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; - step_mem->nlscoef = RCONST(0.24); - step_mem->crdown = RCONST(0.26); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.16); + step_mem->nlscoef = SUN_RCONST(0.24); + step_mem->crdown = SUN_RCONST(0.26); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.16); step_mem->msbp = 31; break; case 5: hadapt_mem->imethod = ARK_ADAPT_PI; - hadapt_mem->safety = RCONST(0.993); - hadapt_mem->bias = RCONST(1.15); - hadapt_mem->growth = RCONST(28.5); - hadapt_mem->k1 = RCONST(0.8); - hadapt_mem->k2 = RCONST(0.35); - hadapt_mem->etamxf = RCONST(0.3); + hadapt_mem->safety = SUN_RCONST(0.993); + hadapt_mem->bias = SUN_RCONST(1.15); + hadapt_mem->growth = SUN_RCONST(28.5); + hadapt_mem->k1 = SUN_RCONST(0.8); + hadapt_mem->k2 = SUN_RCONST(0.35); + hadapt_mem->etamxf = SUN_RCONST(0.3); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; - step_mem->nlscoef = RCONST(0.25); - step_mem->crdown = RCONST(0.4); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.32); + step_mem->nlscoef = SUN_RCONST(0.25); + step_mem->crdown = SUN_RCONST(0.4); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.32); step_mem->msbp = 31; break; } @@ -690,7 +690,7 @@ int ARKStepSetLinear(void *arkode_mem, int timedepend) /* set parameters */ step_mem->linear = SUNTRUE; step_mem->linear_timedep = (timedepend == 1); - step_mem->dgmax = RCONST(100.0)*UNIT_ROUNDOFF; + step_mem->dgmax = SUN_RCONST(100.0)*SUN_UNIT_ROUNDOFF; return(ARK_SUCCESS); } diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index 5dcabb8388..c09b2f957d 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -329,7 +329,7 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) N_VConst(ZERO, step_mem->zcor); /* Reset the stored residual norm (for iterative linear solvers) */ - step_mem->eRNrm = RCONST(0.1) * step_mem->nlscoef; + step_mem->eRNrm = SUN_RCONST(0.1) * step_mem->nlscoef; /* solve the nonlinear system for the actual correction */ retval = SUNNonlinSolSolve(step_mem->NLS, step_mem->zpred, step_mem->zcor, diff --git a/src/arkode/arkode_bandpre.c b/src/arkode/arkode_bandpre.c index c985533494..d809add6b1 100644 --- a/src/arkode/arkode_bandpre.c +++ b/src/arkode/arkode_bandpre.c @@ -26,9 +26,9 @@ #include "arkode_ls_impl.h" #include -#define MIN_INC_MULT RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of ARKBandPrecSetup and ARKBandPrecSolve */ diff --git a/src/arkode/arkode_bbdpre.c b/src/arkode/arkode_bbdpre.c index be491e4a8f..aedb579969 100644 --- a/src/arkode/arkode_bbdpre.c +++ b/src/arkode/arkode_bbdpre.c @@ -28,9 +28,9 @@ #include -#define MIN_INC_MULT RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of functions ARKBBDPrecSetup and ARKBBDPrecSolve */ diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index 11fd4756b2..5dd25ba679 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -23,7 +23,7 @@ /* tolerance for checking order conditions */ -#define TOL (SUNRsqrt(UNIT_ROUNDOFF)) +#define TOL (SUNRsqrt(SUN_UNIT_ROUNDOFF)) /* Private utility functions for checking method order */ static int __mv(sunrealtype **A, sunrealtype *x, int s, sunrealtype *b); @@ -1459,7 +1459,7 @@ static int __mv(sunrealtype **A, sunrealtype *x, int s, sunrealtype *b) int i, j; if ((A == NULL) || (x == NULL) || (b == NULL) || (s < 1)) return(1); - for (i=0; i TOL) @@ -1550,7 +1550,7 @@ static booleantype __rowsum(sunrealtype **A, sunrealtype *c, int s) static booleantype __order1(sunrealtype *b, int s) { int i; - sunrealtype err = RCONST(1.0); + sunrealtype err = SUN_RCONST(1.0); for (i=0; i TOL) ? SUNFALSE : SUNTRUE; @@ -1561,7 +1561,7 @@ static booleantype __order2(sunrealtype *b, sunrealtype *c, int s) { sunrealtype bc; if (__dot(b,c,s,&bc)) return(SUNFALSE); - return (SUNRabs(bc - RCONST(0.5)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bc - SUN_RCONST(0.5)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2) = 1/3 */ @@ -1572,7 +1572,7 @@ static booleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, i if (__vv(c1,c2,s,tmp)) { free(tmp); return(SUNFALSE); } if (__dot(b,tmp,s,&bcc)) return(SUNFALSE); free(tmp); - return (SUNRabs(bcc - RCONST(1.0)/RCONST(3.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcc - SUN_RCONST(1.0)/SUN_RCONST(3.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(A*c) = 1/6 */ @@ -1583,7 +1583,7 @@ static booleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, in if (__mv(A,c,s,tmp)) { free(tmp); return(SUNFALSE); } if (__dot(b,tmp,s,&bAc)) return(SUNFALSE); free(tmp); - return (SUNRabs(bAc - RCONST(1.0)/RCONST(6.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAc - SUN_RCONST(1.0)/SUN_RCONST(6.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2.*c3) = 1/4 */ @@ -1596,7 +1596,7 @@ static booleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s if (__vv(c3,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bccc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bccc - RCONST(0.25)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bccc - SUN_RCONST(0.25)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1)'*(A*c2) = 1/8 */ @@ -1609,7 +1609,7 @@ static booleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, s if (__mv(A,c2,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(tmp1,tmp2,s,&bcAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcAc - RCONST(0.125)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAc - SUN_RCONST(0.125)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A*(c1.*c2) = 1/12 */ @@ -1622,7 +1622,7 @@ static booleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, s if (__mv(A,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAcc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAcc - RCONST(1.0)/RCONST(12.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAcc - SUN_RCONST(1.0)/SUN_RCONST(12.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*A2*c = 1/24 */ @@ -1635,7 +1635,7 @@ static booleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAAc - RCONST(1.0)/RCONST(24.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAc - SUN_RCONST(1.0)/SUN_RCONST(24.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2.*c3.*c4) = 1/5 */ @@ -1649,7 +1649,7 @@ static booleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s if (__vv(c4,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp1,s,&bcccc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcccc - RCONST(0.2)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcccc - SUN_RCONST(0.2)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1.*c2)'*(A*c3) = 1/10 */ @@ -1663,7 +1663,7 @@ static booleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s if (__mv(A,c3,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(tmp1,tmp2,s,&bccAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bccAc - RCONST(0.1)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bccAc - SUN_RCONST(0.1)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*((A1*c1).*(A2*c2)) = 1/20 */ @@ -1678,7 +1678,7 @@ static booleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, if (__vv(tmp1,tmp2,s,tmp3)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__dot(b,tmp3,s,&bAcAc)) return(SUNFALSE); free(tmp1); free(tmp2); free(tmp3); - return (SUNRabs(bAcAc - RCONST(0.05)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAcAc - SUN_RCONST(0.05)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1)'*A*(c2.*c3) = 1/15 */ @@ -1692,7 +1692,7 @@ static booleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, s if (__vv(b,c1,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(tmp1,tmp2,s,&bcAcc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcAcc - RCONST(1.0)/RCONST(15.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAcc - SUN_RCONST(1.0)/SUN_RCONST(15.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A*(c1.*c2.*c3) = 1/20 */ @@ -1706,7 +1706,7 @@ static booleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, s if (__mv(A,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp1,s,&bAccc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAccc - RCONST(0.05)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAccc - SUN_RCONST(0.05)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1)'*A1*A2*c2 = 1/30 */ @@ -1720,7 +1720,7 @@ static booleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, if (__vv(b,c1,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(tmp1,tmp2,s,&bcAAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcAAc - RCONST(1.0)/RCONST(30.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAAc - SUN_RCONST(1.0)/SUN_RCONST(30.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*(c1.*(A2*c2)) = 1/40 */ @@ -1734,7 +1734,7 @@ static booleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp1,s,&bAcAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAcAc - RCONST(1.0)/RCONST(40.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAcAc - SUN_RCONST(1.0)/SUN_RCONST(40.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*A2*(c1.*c2) = 1/60 */ @@ -1748,7 +1748,7 @@ static booleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp1,s,&bAAcc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAAcc - RCONST(1.0)/RCONST(60.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAcc - SUN_RCONST(1.0)/SUN_RCONST(60.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*A2*A3*c = 1/120 */ @@ -1762,7 +1762,7 @@ static booleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp2,s,tmp1)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp1,s,&bAAAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAAAc - RCONST(1.0)/RCONST(120.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAAc - SUN_RCONST(1.0)/SUN_RCONST(120.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2.*c3.*c4.*c5) = 1/6 */ @@ -1777,7 +1777,7 @@ static booleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s if (__vv(c5,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bccccc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bccccc - RCONST(1.0)/RCONST(6.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bccccc - SUN_RCONST(1.0)/SUN_RCONST(6.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1.*c2.*c3)'*(A*c4) = 1/12 */ @@ -1792,7 +1792,7 @@ static booleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s if (__mv(A,c4,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(tmp1,tmp2,s,&bcccAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcccAc - RCONST(1.0)/RCONST(12.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcccAc - SUN_RCONST(1.0)/SUN_RCONST(12.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*(A1*c2).*(A2*c3)) = 1/24 */ @@ -1808,7 +1808,7 @@ static booleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, if (__vv(c1,tmp3,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__dot(b,tmp1,s,&bcAc2)) return(SUNFALSE); free(tmp1); free(tmp2); free(tmp3); - return (SUNRabs(bcAc2 - RCONST(1.0)/RCONST(24.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAc2 - SUN_RCONST(1.0)/SUN_RCONST(24.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1.*c2)'*A*(c3.*c4) = 1/18 */ @@ -1824,7 +1824,7 @@ static booleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s if (__vv(b,tmp1,s,tmp3)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__dot(tmp2,tmp3,s,&bccAcc)) return(SUNFALSE); free(tmp1); free(tmp2); free(tmp3); - return (SUNRabs(bccAcc - RCONST(1.0)/RCONST(18.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bccAcc - SUN_RCONST(1.0)/SUN_RCONST(18.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*(c1.*c2))'*A1*A2*c3 = 1/36 */ @@ -1840,7 +1840,7 @@ static booleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s if (__mv(A1,tmp1,s,tmp3)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__dot(tmp2,tmp3,s,&bccAAc)) return(SUNFALSE); free(tmp1); free(tmp2); free(tmp3); - return (SUNRabs(bccAAc - RCONST(1.0)/RCONST(36.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bccAAc - SUN_RCONST(1.0)/SUN_RCONST(36.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*((A1*A2*c1).*(A3*c2)) = 1/72 */ @@ -1856,7 +1856,7 @@ static booleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__vv(tmp1,tmp2,s,tmp3)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__dot(b,tmp3,s,&bAAcAc)) return(SUNFALSE); free(tmp1); free(tmp2); free(tmp3); - return (SUNRabs(bAAcAc - RCONST(1.0)/RCONST(72.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAcAc - SUN_RCONST(1.0)/SUN_RCONST(72.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*(A*(c2.*c3.*c4))) = 1/24 */ @@ -1871,7 +1871,7 @@ static booleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, s if (__vv(c1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bcAccc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcAccc - RCONST(1.0)/RCONST(24.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAccc - SUN_RCONST(1.0)/SUN_RCONST(24.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*(A1*(c2.*(A2*c3)))) = 1/48 */ @@ -1886,7 +1886,7 @@ static booleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, if (__vv(c1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bcAcAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcAcAc - RCONST(1.0)/RCONST(48.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAcAc - SUN_RCONST(1.0)/SUN_RCONST(48.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*(A1*A2*(c2.*c3))) = 1/72 */ @@ -1901,7 +1901,7 @@ static booleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, if (__vv(c1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bcAAcc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcAAcc - RCONST(1.0)/RCONST(72.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAAcc - SUN_RCONST(1.0)/SUN_RCONST(72.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*(A1*A2*A3*c2)) = 1/144 */ @@ -1916,7 +1916,7 @@ static booleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, if (__vv(c1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bcAAAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bcAAAc - RCONST(1.0)/RCONST(144.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bcAAAc - SUN_RCONST(1.0)/SUN_RCONST(144.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A*(c1.*c2.*c3.*c4) = 1/30 */ @@ -1931,7 +1931,7 @@ static booleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, s if (__mv(A,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAcccc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAcccc - RCONST(1.0)/RCONST(30.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAcccc - SUN_RCONST(1.0)/SUN_RCONST(30.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*(c1.*c2.*(A2*c3)) = 1/60 */ @@ -1946,7 +1946,7 @@ static booleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAccAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAccAc - RCONST(1.0)/RCONST(60.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAccAc - SUN_RCONST(1.0)/SUN_RCONST(60.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*((A2*c1).*(A3*c2)) = 1/120 */ @@ -1962,7 +1962,7 @@ static booleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp3,s,tmp1)) { free(tmp1); free(tmp2); free(tmp3); return(SUNFALSE); } if (__dot(b,tmp1,s,&bAAcAc)) return(SUNFALSE); free(tmp1); free(tmp2); free(tmp3); - return (SUNRabs(bAAcAc - RCONST(1.0)/RCONST(120.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAcAc - SUN_RCONST(1.0)/SUN_RCONST(120.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*(c1.*(A2*(c2.*c3))) = 1/90 */ @@ -1977,7 +1977,7 @@ static booleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAcAcc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAcAcc - RCONST(1.0)/RCONST(90.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAcAcc - SUN_RCONST(1.0)/SUN_RCONST(90.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*(c1.*(A2*A3*c2)) = 1/180 */ @@ -1992,7 +1992,7 @@ static booleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAcAAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAcAAc - RCONST(1.0)/RCONST(180.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAcAAc - SUN_RCONST(1.0)/SUN_RCONST(180.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*A2*(c1.*c2.*c3) = 1/120 */ @@ -2007,7 +2007,7 @@ static booleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAAccc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAAccc - RCONST(1.0)/RCONST(120.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAccc - SUN_RCONST(1.0)/SUN_RCONST(120.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*A2*(c1.*(A3*c2)) = 1/240 */ @@ -2022,7 +2022,7 @@ static booleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAAcAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAAcAc - RCONST(1.0)/RCONST(240.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAcAc - SUN_RCONST(1.0)/SUN_RCONST(240.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*A2*A3*(c1.*c2) = 1/360 */ @@ -2037,7 +2037,7 @@ static booleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAAAcc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAAAcc - RCONST(1.0)/RCONST(360.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAAcc - SUN_RCONST(1.0)/SUN_RCONST(360.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A1*A2*A3*A4*c = 1/720 */ @@ -2052,7 +2052,7 @@ static booleantype __order6s(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, if (__mv(A1,tmp1,s,tmp2)) { free(tmp1); free(tmp2); return(SUNFALSE); } if (__dot(b,tmp2,s,&bAAAAc)) return(SUNFALSE); free(tmp1); free(tmp2); - return (SUNRabs(bAAAAc - RCONST(1.0)/RCONST(720.0)) > TOL) ? SUNFALSE : SUNTRUE; + return (SUNRabs(bAAAAc - SUN_RCONST(1.0)/SUN_RCONST(720.0)) > TOL) ? SUNFALSE : SUNTRUE; } @@ -2072,7 +2072,7 @@ static int __ButcherSimplifyingAssumptions(sunrealtype **A, sunrealtype *b, sunr for (i=1; i<1000; i++) { if (__vp(c,i-1,s,tmp)) { free(tmp); return(0); } if (__dot(b,tmp,s,&LHS)) { free(tmp); return(0); } - RHS = RCONST(1.0)/i; + RHS = SUN_RCONST(1.0)/i; if (SUNRabs(RHS-LHS) > TOL) break; P++; @@ -2103,10 +2103,10 @@ static int __ButcherSimplifyingAssumptions(sunrealtype **A, sunrealtype *b, sunr for (k=1; k<1000; k++) { alltrue = SUNTRUE; for (j=0; j TOL) { alltrue = SUNFALSE; break; diff --git a/src/arkode/arkode_butcher_dirk.def b/src/arkode/arkode_butcher_dirk.def index a3cca75f66..2358f3275f 100644 --- a/src/arkode/arkode_butcher_dirk.def +++ b/src/arkode/arkode_butcher_dirk.def @@ -70,17 +70,17 @@ ARK_BUTCHER_TABLE(ARKODE_SDIRK_2_1_2, { /* SDIRK-2-1 (A,B stable) */ B->q = 2; B->p = 1; - B->A[0][0] = RCONST(1.0); - B->A[1][0] = RCONST(-1.0); - B->A[1][1] = RCONST(1.0); + B->A[0][0] = SUN_RCONST(1.0); + B->A[1][0] = SUN_RCONST(-1.0); + B->A[1][1] = SUN_RCONST(1.0); - B->b[0] = RCONST(0.5); - B->b[1] = RCONST(0.5); + B->b[0] = SUN_RCONST(0.5); + B->b[1] = SUN_RCONST(0.5); - B->d[0] = RCONST(1.0); + B->d[0] = SUN_RCONST(1.0); - B->c[0] = RCONST(1.0); - B->c[1] = RCONST(0.0); + B->c[0] = SUN_RCONST(1.0); + B->c[1] = SUN_RCONST(0.0); return B; }) @@ -125,23 +125,23 @@ ARK_BUTCHER_TABLE(ARKODE_BILLINGTON_3_3_2, { /* Billington-SDIRK */ B->q = 2; B->p = 3; - B->A[0][0] = RCONST(0.292893218813); - B->A[1][0] = RCONST(0.798989873223); - B->A[1][1] = RCONST(0.292893218813); - B->A[2][0] = RCONST(0.740789228841); - B->A[2][1] = RCONST(0.259210771159); - B->A[2][2] = RCONST(0.292893218813); + B->A[0][0] = SUN_RCONST(0.292893218813); + B->A[1][0] = SUN_RCONST(0.798989873223); + B->A[1][1] = SUN_RCONST(0.292893218813); + B->A[2][0] = SUN_RCONST(0.740789228841); + B->A[2][1] = SUN_RCONST(0.259210771159); + B->A[2][2] = SUN_RCONST(0.292893218813); - B->d[0] = RCONST(0.691665115992); - B->d[1] = RCONST(0.503597029883); - B->d[2] = RCONST(-0.195262145876); + B->d[0] = SUN_RCONST(0.691665115992); + B->d[1] = SUN_RCONST(0.503597029883); + B->d[2] = SUN_RCONST(-0.195262145876); - B->b[0] = RCONST(0.740789228840); - B->b[1] = RCONST(0.259210771159); + B->b[0] = SUN_RCONST(0.740789228840); + B->b[1] = SUN_RCONST(0.259210771159); - B->c[0] = RCONST(0.292893218813); - B->c[1] = RCONST(1.091883092037); - B->c[2] = RCONST(1.292893218813); + B->c[0] = SUN_RCONST(0.292893218813); + B->c[1] = SUN_RCONST(1.091883092037); + B->c[2] = SUN_RCONST(1.292893218813); return B; }) @@ -150,22 +150,22 @@ ARK_BUTCHER_TABLE(ARKODE_TRBDF2_3_3_2, { /* TRBDF2-ESDIRK */ B->q = 2; B->p = 3; - B->A[1][0] = (RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(2.0); - B->A[1][1] = (RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(2.0); - B->A[2][0] = SUNRsqrt(RCONST(2.0))/RCONST(4.0); - B->A[2][1] = SUNRsqrt(RCONST(2.0))/RCONST(4.0); - B->A[2][2] = (RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(2.0); + B->A[1][0] = (SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(2.0); + B->A[1][1] = (SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(2.0); + B->A[2][0] = SUNRsqrt(SUN_RCONST(2.0))/SUN_RCONST(4.0); + B->A[2][1] = SUNRsqrt(SUN_RCONST(2.0))/SUN_RCONST(4.0); + B->A[2][2] = (SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(2.0); - B->d[0] = (RCONST(1.0)-SUNRsqrt(RCONST(2.0))/RCONST(4.0))/RCONST(3.0); - B->d[1] = (RCONST(3.0)*SUNRsqrt(RCONST(2.0))/RCONST(4.0)+RCONST(1.0))/RCONST(3.0); - B->d[2] = (RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(6.0); + B->d[0] = (SUN_RCONST(1.0)-SUNRsqrt(SUN_RCONST(2.0))/SUN_RCONST(4.0))/SUN_RCONST(3.0); + B->d[1] = (SUN_RCONST(3.0)*SUNRsqrt(SUN_RCONST(2.0))/SUN_RCONST(4.0)+SUN_RCONST(1.0))/SUN_RCONST(3.0); + B->d[2] = (SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(6.0); - B->b[0] = SUNRsqrt(RCONST(2.0))/RCONST(4.0); - B->b[1] = SUNRsqrt(RCONST(2.0))/RCONST(4.0); - B->b[2] = (RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(2.0); + B->b[0] = SUNRsqrt(SUN_RCONST(2.0))/SUN_RCONST(4.0); + B->b[1] = SUNRsqrt(SUN_RCONST(2.0))/SUN_RCONST(4.0); + B->b[2] = (SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(2.0); - B->c[1] = RCONST(2.0)-SUNRsqrt(RCONST(2.0)); - B->c[2] = RCONST(1.0); + B->c[1] = SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)); + B->c[2] = SUN_RCONST(1.0); return B; }) @@ -173,28 +173,28 @@ ARK_BUTCHER_TABLE(ARKODE_KVAERNO_4_2_3, { /* Kvaerno(4,2,3)-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(4, SUNTRUE); B->q = 3; B->p = 2; - B->A[1][0] = RCONST(0.4358665215); - B->A[1][1] = RCONST(0.4358665215); - B->A[2][0] = RCONST(0.490563388419108); - B->A[2][1] = RCONST(0.073570090080892); - B->A[2][2] = RCONST(0.4358665215); - B->A[3][0] = RCONST(0.308809969973036); - B->A[3][1] = RCONST(1.490563388254106); - B->A[3][2] = RCONST(-1.235239879727145); - B->A[3][3] = RCONST(0.4358665215); - - B->b[0] = RCONST(0.308809969973036); - B->b[1] = RCONST(1.490563388254106); - B->b[2] = RCONST(-1.235239879727145); - B->b[3] = RCONST(0.4358665215); - - B->d[0] = RCONST(0.490563388419108); - B->d[1] = RCONST(0.073570090080892); - B->d[2] = RCONST(0.4358665215); - - B->c[1] = RCONST(0.871733043); - B->c[2] = RCONST(1.0); - B->c[3] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.4358665215); + B->A[1][1] = SUN_RCONST(0.4358665215); + B->A[2][0] = SUN_RCONST(0.490563388419108); + B->A[2][1] = SUN_RCONST(0.073570090080892); + B->A[2][2] = SUN_RCONST(0.4358665215); + B->A[3][0] = SUN_RCONST(0.308809969973036); + B->A[3][1] = SUN_RCONST(1.490563388254106); + B->A[3][2] = SUN_RCONST(-1.235239879727145); + B->A[3][3] = SUN_RCONST(0.4358665215); + + B->b[0] = SUN_RCONST(0.308809969973036); + B->b[1] = SUN_RCONST(1.490563388254106); + B->b[2] = SUN_RCONST(-1.235239879727145); + B->b[3] = SUN_RCONST(0.4358665215); + + B->d[0] = SUN_RCONST(0.490563388419108); + B->d[1] = SUN_RCONST(0.073570090080892); + B->d[2] = SUN_RCONST(0.4358665215); + + B->c[1] = SUN_RCONST(0.871733043); + B->c[2] = SUN_RCONST(1.0); + B->c[3] = SUN_RCONST(1.0); return B; }) @@ -202,29 +202,29 @@ ARK_BUTCHER_TABLE(ARKODE_ARK324L2SA_DIRK_4_2_3, { /* ARK3(2)4L[2]SA-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(4, SUNTRUE); B->q = 3; B->p = 2; - B->A[1][0] = RCONST(1767732205903.0)/RCONST(4055673282236.0); - B->A[1][1] = RCONST(1767732205903.0)/RCONST(4055673282236.0); - B->A[2][0] = RCONST(2746238789719.0)/RCONST(10658868560708.0); - B->A[2][1] = RCONST(-640167445237.0)/RCONST(6845629431997.0); - B->A[2][2] = RCONST(1767732205903.0)/RCONST(4055673282236.0); - B->A[3][0] = RCONST(1471266399579.0)/RCONST(7840856788654.0); - B->A[3][1] = RCONST(-4482444167858.0)/RCONST(7529755066697.0); - B->A[3][2] = RCONST(11266239266428.0)/RCONST(11593286722821.0); - B->A[3][3] = RCONST(1767732205903.0)/RCONST(4055673282236.0); - - B->b[0] = RCONST(1471266399579.0)/RCONST(7840856788654.0); - B->b[1] = RCONST(-4482444167858.0)/RCONST(7529755066697.0); - B->b[2] = RCONST(11266239266428.0)/RCONST(11593286722821.0); - B->b[3] = RCONST(1767732205903.0)/RCONST(4055673282236.0); - - B->d[0] = RCONST(2756255671327.0)/RCONST(12835298489170.0); - B->d[1] = RCONST(-10771552573575.0)/RCONST(22201958757719.0); - B->d[2] = RCONST(9247589265047.0)/RCONST(10645013368117.0); - B->d[3] = RCONST(2193209047091.0)/RCONST(5459859503100.0); - - B->c[1] = RCONST(1767732205903.0)/RCONST(2027836641118.0); - B->c[2] = RCONST(3.0)/RCONST(5.0); - B->c[3] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(1767732205903.0)/SUN_RCONST(4055673282236.0); + B->A[1][1] = SUN_RCONST(1767732205903.0)/SUN_RCONST(4055673282236.0); + B->A[2][0] = SUN_RCONST(2746238789719.0)/SUN_RCONST(10658868560708.0); + B->A[2][1] = SUN_RCONST(-640167445237.0)/SUN_RCONST(6845629431997.0); + B->A[2][2] = SUN_RCONST(1767732205903.0)/SUN_RCONST(4055673282236.0); + B->A[3][0] = SUN_RCONST(1471266399579.0)/SUN_RCONST(7840856788654.0); + B->A[3][1] = SUN_RCONST(-4482444167858.0)/SUN_RCONST(7529755066697.0); + B->A[3][2] = SUN_RCONST(11266239266428.0)/SUN_RCONST(11593286722821.0); + B->A[3][3] = SUN_RCONST(1767732205903.0)/SUN_RCONST(4055673282236.0); + + B->b[0] = SUN_RCONST(1471266399579.0)/SUN_RCONST(7840856788654.0); + B->b[1] = SUN_RCONST(-4482444167858.0)/SUN_RCONST(7529755066697.0); + B->b[2] = SUN_RCONST(11266239266428.0)/SUN_RCONST(11593286722821.0); + B->b[3] = SUN_RCONST(1767732205903.0)/SUN_RCONST(4055673282236.0); + + B->d[0] = SUN_RCONST(2756255671327.0)/SUN_RCONST(12835298489170.0); + B->d[1] = SUN_RCONST(-10771552573575.0)/SUN_RCONST(22201958757719.0); + B->d[2] = SUN_RCONST(9247589265047.0)/SUN_RCONST(10645013368117.0); + B->d[3] = SUN_RCONST(2193209047091.0)/SUN_RCONST(5459859503100.0); + + B->c[1] = SUN_RCONST(1767732205903.0)/SUN_RCONST(2027836641118.0); + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + B->c[3] = SUN_RCONST(1.0); return B; }) @@ -232,36 +232,36 @@ ARK_BUTCHER_TABLE(ARKODE_CASH_5_2_4, { /* Cash(5,2,4)-SDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 2; - B->A[0][0] = RCONST(0.435866521508); - B->A[1][0] = RCONST(-1.13586652150); - B->A[1][1] = RCONST(0.435866521508); - B->A[2][0] = RCONST(1.08543330679); - B->A[2][1] = RCONST(-0.721299828287); - B->A[2][2] = RCONST(0.435866521508); - B->A[3][0] = RCONST(0.416349501547); - B->A[3][1] = RCONST(0.190984004184); - B->A[3][2] = RCONST(-0.118643265417); - B->A[3][3] = RCONST(0.435866521508); - B->A[4][0] = RCONST(0.896869652944); - B->A[4][1] = RCONST(0.0182725272734); - B->A[4][2] = RCONST(-0.0845900310706); - B->A[4][3] = RCONST(-0.266418670647); - B->A[4][4] = RCONST(0.435866521508); - - B->b[0] = RCONST(0.896869652944); - B->b[1] = RCONST(0.0182725272734); - B->b[2] = RCONST(-0.0845900310706); - B->b[3] = RCONST(-0.266418670647); - B->b[4] = RCONST(0.435866521508); - - B->d[0] = (RCONST(-0.7)-RCONST(0.5))/(RCONST(-0.7)-RCONST(0.435866521508)); - B->d[1] = (RCONST(0.5)-RCONST(0.435866521508))/(RCONST(-0.7)-RCONST(0.435866521508)); - - B->c[0] = RCONST(0.435866521508); - B->c[1] = RCONST(-0.7); - B->c[2] = RCONST(0.8); - B->c[3] = RCONST(0.924556761814); - B->c[4] = RCONST(1.0); + B->A[0][0] = SUN_RCONST(0.435866521508); + B->A[1][0] = SUN_RCONST(-1.13586652150); + B->A[1][1] = SUN_RCONST(0.435866521508); + B->A[2][0] = SUN_RCONST(1.08543330679); + B->A[2][1] = SUN_RCONST(-0.721299828287); + B->A[2][2] = SUN_RCONST(0.435866521508); + B->A[3][0] = SUN_RCONST(0.416349501547); + B->A[3][1] = SUN_RCONST(0.190984004184); + B->A[3][2] = SUN_RCONST(-0.118643265417); + B->A[3][3] = SUN_RCONST(0.435866521508); + B->A[4][0] = SUN_RCONST(0.896869652944); + B->A[4][1] = SUN_RCONST(0.0182725272734); + B->A[4][2] = SUN_RCONST(-0.0845900310706); + B->A[4][3] = SUN_RCONST(-0.266418670647); + B->A[4][4] = SUN_RCONST(0.435866521508); + + B->b[0] = SUN_RCONST(0.896869652944); + B->b[1] = SUN_RCONST(0.0182725272734); + B->b[2] = SUN_RCONST(-0.0845900310706); + B->b[3] = SUN_RCONST(-0.266418670647); + B->b[4] = SUN_RCONST(0.435866521508); + + B->d[0] = (SUN_RCONST(-0.7)-SUN_RCONST(0.5))/(SUN_RCONST(-0.7)-SUN_RCONST(0.435866521508)); + B->d[1] = (SUN_RCONST(0.5)-SUN_RCONST(0.435866521508))/(SUN_RCONST(-0.7)-SUN_RCONST(0.435866521508)); + + B->c[0] = SUN_RCONST(0.435866521508); + B->c[1] = SUN_RCONST(-0.7); + B->c[2] = SUN_RCONST(0.8); + B->c[3] = SUN_RCONST(0.924556761814); + B->c[4] = SUN_RCONST(1.0); return B; }) @@ -269,38 +269,38 @@ ARK_BUTCHER_TABLE(ARKODE_CASH_5_3_4, { /* Cash(5,3,4)-SDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 3; - B->A[0][0] = RCONST(0.435866521508); - B->A[1][0] = RCONST(-1.13586652150); - B->A[1][1] = RCONST(0.435866521508); - B->A[2][0] = RCONST(1.08543330679); - B->A[2][1] = RCONST(-0.721299828287); - B->A[2][2] = RCONST(0.435866521508); - B->A[3][0] = RCONST(0.416349501547); - B->A[3][1] = RCONST(0.190984004184); - B->A[3][2] = RCONST(-0.118643265417); - B->A[3][3] = RCONST(0.435866521508); - B->A[4][0] = RCONST(0.896869652944); - B->A[4][1] = RCONST(0.0182725272734); - B->A[4][2] = RCONST(-0.0845900310706); - B->A[4][3] = RCONST(-0.266418670647); - B->A[4][4] = RCONST(0.435866521508); - - B->b[0] = RCONST(0.896869652944); - B->b[1] = RCONST(0.0182725272734); - B->b[2] = RCONST(-0.0845900310706); - B->b[3] = RCONST(-0.266418670647); - B->b[4] = RCONST(0.435866521508); - - B->d[0] = RCONST(0.776691932910); - B->d[1] = RCONST(0.0297472791484); - B->d[2] = RCONST(-0.0267440239074); - B->d[3] = RCONST(0.220304811849); - - B->c[0] = RCONST(0.435866521508); - B->c[1] = RCONST(-0.7); - B->c[2] = RCONST(0.8); - B->c[3] = RCONST(0.924556761814); - B->c[4] = RCONST(1.0); + B->A[0][0] = SUN_RCONST(0.435866521508); + B->A[1][0] = SUN_RCONST(-1.13586652150); + B->A[1][1] = SUN_RCONST(0.435866521508); + B->A[2][0] = SUN_RCONST(1.08543330679); + B->A[2][1] = SUN_RCONST(-0.721299828287); + B->A[2][2] = SUN_RCONST(0.435866521508); + B->A[3][0] = SUN_RCONST(0.416349501547); + B->A[3][1] = SUN_RCONST(0.190984004184); + B->A[3][2] = SUN_RCONST(-0.118643265417); + B->A[3][3] = SUN_RCONST(0.435866521508); + B->A[4][0] = SUN_RCONST(0.896869652944); + B->A[4][1] = SUN_RCONST(0.0182725272734); + B->A[4][2] = SUN_RCONST(-0.0845900310706); + B->A[4][3] = SUN_RCONST(-0.266418670647); + B->A[4][4] = SUN_RCONST(0.435866521508); + + B->b[0] = SUN_RCONST(0.896869652944); + B->b[1] = SUN_RCONST(0.0182725272734); + B->b[2] = SUN_RCONST(-0.0845900310706); + B->b[3] = SUN_RCONST(-0.266418670647); + B->b[4] = SUN_RCONST(0.435866521508); + + B->d[0] = SUN_RCONST(0.776691932910); + B->d[1] = SUN_RCONST(0.0297472791484); + B->d[2] = SUN_RCONST(-0.0267440239074); + B->d[3] = SUN_RCONST(0.220304811849); + + B->c[0] = SUN_RCONST(0.435866521508); + B->c[1] = SUN_RCONST(-0.7); + B->c[2] = SUN_RCONST(0.8); + B->c[3] = SUN_RCONST(0.924556761814); + B->c[4] = SUN_RCONST(1.0); return B; }) @@ -308,38 +308,38 @@ ARK_BUTCHER_TABLE(ARKODE_SDIRK_5_3_4, { /* SDIRK-5-4 */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 3; - B->A[0][0] = RCONST(0.25); - B->A[1][0] = RCONST(0.5); - B->A[1][1] = RCONST(0.25); - B->A[2][0] = RCONST(17.0)/RCONST(50.0); - B->A[2][1] = RCONST(-1.0)/RCONST(25.0); - B->A[2][2] = RCONST(0.25); - B->A[3][0] = RCONST(371.0)/RCONST(1360.0); - B->A[3][1] = RCONST(-137.0)/RCONST(2720.0); - B->A[3][2] = RCONST(15.0)/RCONST(544.0); - B->A[3][3] = RCONST(0.25); - B->A[4][0] = RCONST(25.0)/RCONST(24.0); - B->A[4][1] = RCONST(-49.0)/RCONST(48.0); - B->A[4][2] = RCONST(125.0)/RCONST(16.0); - B->A[4][3] = RCONST(-85.0)/RCONST(12.0); - B->A[4][4] = RCONST(0.25); - - B->b[0] = RCONST(25.0)/RCONST(24.0); - B->b[1] = RCONST(-49.0)/RCONST(48.0); - B->b[2] = RCONST(125.0)/RCONST(16.0); - B->b[3] = RCONST(-85.0)/RCONST(12.0); - B->b[4] = RCONST(0.25); - - B->d[0] = RCONST(59.0)/RCONST(48.0); - B->d[1] = RCONST(-17.0)/RCONST(96.0); - B->d[2] = RCONST(225.0)/RCONST(32.0); - B->d[3] = RCONST(-85.0)/RCONST(12.0); - - B->c[0] = RCONST(0.25); - B->c[1] = RCONST(0.75); - B->c[2] = RCONST(11.0)/RCONST(20.0); - B->c[3] = RCONST(0.5); - B->c[4] = RCONST(1.0); + B->A[0][0] = SUN_RCONST(0.25); + B->A[1][0] = SUN_RCONST(0.5); + B->A[1][1] = SUN_RCONST(0.25); + B->A[2][0] = SUN_RCONST(17.0)/SUN_RCONST(50.0); + B->A[2][1] = SUN_RCONST(-1.0)/SUN_RCONST(25.0); + B->A[2][2] = SUN_RCONST(0.25); + B->A[3][0] = SUN_RCONST(371.0)/SUN_RCONST(1360.0); + B->A[3][1] = SUN_RCONST(-137.0)/SUN_RCONST(2720.0); + B->A[3][2] = SUN_RCONST(15.0)/SUN_RCONST(544.0); + B->A[3][3] = SUN_RCONST(0.25); + B->A[4][0] = SUN_RCONST(25.0)/SUN_RCONST(24.0); + B->A[4][1] = SUN_RCONST(-49.0)/SUN_RCONST(48.0); + B->A[4][2] = SUN_RCONST(125.0)/SUN_RCONST(16.0); + B->A[4][3] = SUN_RCONST(-85.0)/SUN_RCONST(12.0); + B->A[4][4] = SUN_RCONST(0.25); + + B->b[0] = SUN_RCONST(25.0)/SUN_RCONST(24.0); + B->b[1] = SUN_RCONST(-49.0)/SUN_RCONST(48.0); + B->b[2] = SUN_RCONST(125.0)/SUN_RCONST(16.0); + B->b[3] = SUN_RCONST(-85.0)/SUN_RCONST(12.0); + B->b[4] = SUN_RCONST(0.25); + + B->d[0] = SUN_RCONST(59.0)/SUN_RCONST(48.0); + B->d[1] = SUN_RCONST(-17.0)/SUN_RCONST(96.0); + B->d[2] = SUN_RCONST(225.0)/SUN_RCONST(32.0); + B->d[3] = SUN_RCONST(-85.0)/SUN_RCONST(12.0); + + B->c[0] = SUN_RCONST(0.25); + B->c[1] = SUN_RCONST(0.75); + B->c[2] = SUN_RCONST(11.0)/SUN_RCONST(20.0); + B->c[3] = SUN_RCONST(0.5); + B->c[4] = SUN_RCONST(1.0); return B; }) @@ -347,36 +347,36 @@ ARK_BUTCHER_TABLE(ARKODE_KVAERNO_5_3_4, { /* Kvaerno(5,3,4)-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = RCONST(0.4358665215); - B->A[1][1] = RCONST(0.4358665215); - B->A[2][0] = RCONST(0.140737774731968); - B->A[2][1] = RCONST(-0.108365551378832); - B->A[2][2] = RCONST(0.4358665215); - B->A[3][0] = RCONST(0.102399400616089); - B->A[3][1] = RCONST(-0.376878452267324); - B->A[3][2] = RCONST(0.838612530151233); - B->A[3][3] = RCONST(0.4358665215); - B->A[4][0] = RCONST(0.157024897860995); - B->A[4][1] = RCONST(0.117330441357768); - B->A[4][2] = RCONST(0.61667803039168); - B->A[4][3] = RCONST(-0.326899891110444); - B->A[4][4] = RCONST(0.4358665215); - - B->b[0] = RCONST(0.157024897860995); - B->b[1] = RCONST(0.117330441357768); - B->b[2] = RCONST(0.61667803039168); - B->b[3] = RCONST(-0.326899891110444); - B->b[4] = RCONST(0.4358665215); - - B->d[0] = RCONST(0.102399400616089); - B->d[1] = RCONST(-0.376878452267324); - B->d[2] = RCONST(0.838612530151233); - B->d[3] = RCONST(0.4358665215); - - B->c[1] = RCONST(0.871733043); - B->c[2] = RCONST(0.468238744853136); - B->c[3] = RCONST(1.0); - B->c[4] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.4358665215); + B->A[1][1] = SUN_RCONST(0.4358665215); + B->A[2][0] = SUN_RCONST(0.140737774731968); + B->A[2][1] = SUN_RCONST(-0.108365551378832); + B->A[2][2] = SUN_RCONST(0.4358665215); + B->A[3][0] = SUN_RCONST(0.102399400616089); + B->A[3][1] = SUN_RCONST(-0.376878452267324); + B->A[3][2] = SUN_RCONST(0.838612530151233); + B->A[3][3] = SUN_RCONST(0.4358665215); + B->A[4][0] = SUN_RCONST(0.157024897860995); + B->A[4][1] = SUN_RCONST(0.117330441357768); + B->A[4][2] = SUN_RCONST(0.61667803039168); + B->A[4][3] = SUN_RCONST(-0.326899891110444); + B->A[4][4] = SUN_RCONST(0.4358665215); + + B->b[0] = SUN_RCONST(0.157024897860995); + B->b[1] = SUN_RCONST(0.117330441357768); + B->b[2] = SUN_RCONST(0.61667803039168); + B->b[3] = SUN_RCONST(-0.326899891110444); + B->b[4] = SUN_RCONST(0.4358665215); + + B->d[0] = SUN_RCONST(0.102399400616089); + B->d[1] = SUN_RCONST(-0.376878452267324); + B->d[2] = SUN_RCONST(0.838612530151233); + B->d[3] = SUN_RCONST(0.4358665215); + + B->c[1] = SUN_RCONST(0.871733043); + B->c[2] = SUN_RCONST(0.468238744853136); + B->c[3] = SUN_RCONST(1.0); + B->c[4] = SUN_RCONST(1.0); return B; }) @@ -384,43 +384,43 @@ ARK_BUTCHER_TABLE(ARKODE_ARK436L2SA_DIRK_6_3_4, { /* ARK4(3)6L[2]SA-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(6, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = RCONST(1.0)/RCONST(4.0); - B->A[1][1] = RCONST(1.0)/RCONST(4.0); - B->A[2][0] = RCONST(8611.0)/RCONST(62500.0); - B->A[2][1] = RCONST(-1743.0)/RCONST(31250.0); - B->A[2][2] = RCONST(1.0)/RCONST(4.0); - B->A[3][0] = RCONST(5012029.0)/RCONST(34652500.0); - B->A[3][1] = RCONST(-654441.0)/RCONST(2922500.0); - B->A[3][2] = RCONST(174375.0)/RCONST(388108.0); - B->A[3][3] = RCONST(1.0)/RCONST(4.0); - B->A[4][0] = RCONST(15267082809.0)/RCONST(155376265600.0); - B->A[4][1] = RCONST(-71443401.0)/RCONST(120774400.0); - B->A[4][2] = RCONST(730878875.0)/RCONST(902184768.0); - B->A[4][3] = RCONST(2285395.0)/RCONST(8070912.0); - B->A[4][4] = RCONST(1.0)/RCONST(4.0); - B->A[5][0] = RCONST(82889.0)/RCONST(524892.0); - B->A[5][2] = RCONST(15625.0)/RCONST(83664.0); - B->A[5][3] = RCONST(69875.0)/RCONST(102672.0); - B->A[5][4] = RCONST(-2260.0)/RCONST(8211.0); - B->A[5][5] = RCONST(1.0)/RCONST(4.0); - - B->b[0] = RCONST(82889.0)/RCONST(524892.0); - B->b[2] = RCONST(15625.0)/RCONST(83664.0); - B->b[3] = RCONST(69875.0)/RCONST(102672.0); - B->b[4] = RCONST(-2260.0)/RCONST(8211.0); - B->b[5] = RCONST(1.0)/RCONST(4.0); - - B->c[1] = RCONST(1.0)/RCONST(2.0); - B->c[2] = RCONST(83.0)/RCONST(250.0); - B->c[3] = RCONST(31.0)/RCONST(50.0); - B->c[4] = RCONST(17.0)/RCONST(20.0); - B->c[5] = RCONST(1.0); - - B->d[0] = RCONST(4586570599.0)/RCONST(29645900160.0); - B->d[2] = RCONST(178811875.0)/RCONST(945068544.0); - B->d[3] = RCONST(814220225.0)/RCONST(1159782912.0); - B->d[4] = RCONST(-3700637.0)/RCONST(11593932.0); - B->d[5] = RCONST(61727.0)/RCONST(225920.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[1][1] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[2][0] = SUN_RCONST(8611.0)/SUN_RCONST(62500.0); + B->A[2][1] = SUN_RCONST(-1743.0)/SUN_RCONST(31250.0); + B->A[2][2] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[3][0] = SUN_RCONST(5012029.0)/SUN_RCONST(34652500.0); + B->A[3][1] = SUN_RCONST(-654441.0)/SUN_RCONST(2922500.0); + B->A[3][2] = SUN_RCONST(174375.0)/SUN_RCONST(388108.0); + B->A[3][3] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[4][0] = SUN_RCONST(15267082809.0)/SUN_RCONST(155376265600.0); + B->A[4][1] = SUN_RCONST(-71443401.0)/SUN_RCONST(120774400.0); + B->A[4][2] = SUN_RCONST(730878875.0)/SUN_RCONST(902184768.0); + B->A[4][3] = SUN_RCONST(2285395.0)/SUN_RCONST(8070912.0); + B->A[4][4] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[5][0] = SUN_RCONST(82889.0)/SUN_RCONST(524892.0); + B->A[5][2] = SUN_RCONST(15625.0)/SUN_RCONST(83664.0); + B->A[5][3] = SUN_RCONST(69875.0)/SUN_RCONST(102672.0); + B->A[5][4] = SUN_RCONST(-2260.0)/SUN_RCONST(8211.0); + B->A[5][5] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + + B->b[0] = SUN_RCONST(82889.0)/SUN_RCONST(524892.0); + B->b[2] = SUN_RCONST(15625.0)/SUN_RCONST(83664.0); + B->b[3] = SUN_RCONST(69875.0)/SUN_RCONST(102672.0); + B->b[4] = SUN_RCONST(-2260.0)/SUN_RCONST(8211.0); + B->b[5] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->c[2] = SUN_RCONST(83.0)/SUN_RCONST(250.0); + B->c[3] = SUN_RCONST(31.0)/SUN_RCONST(50.0); + B->c[4] = SUN_RCONST(17.0)/SUN_RCONST(20.0); + B->c[5] = SUN_RCONST(1.0); + + B->d[0] = SUN_RCONST(4586570599.0)/SUN_RCONST(29645900160.0); + B->d[2] = SUN_RCONST(178811875.0)/SUN_RCONST(945068544.0); + B->d[3] = SUN_RCONST(814220225.0)/SUN_RCONST(1159782912.0); + B->d[4] = SUN_RCONST(-3700637.0)/SUN_RCONST(11593932.0); + B->d[5] = SUN_RCONST(61727.0)/SUN_RCONST(225920.0); return B; }); @@ -429,50 +429,50 @@ ARK_BUTCHER_TABLE(ARKODE_ARK437L2SA_DIRK_7_3_4, { /* ARK4(3)7L[2]SA-ESDIRK */ B->q = 4; B->p = 3; - B->A[1][0] = RCONST(1235.0)/RCONST(10000.0); - B->A[1][1] = RCONST(1235.0)/RCONST(10000.0); - B->A[2][0] = RCONST(624185399699.0)/RCONST(4186980696204.0); - B->A[2][1] = RCONST(624185399699.0)/RCONST(4186980696204.0); - B->A[2][2] = RCONST(1235.0)/RCONST(10000.0); - B->A[3][0] = RCONST(1258591069120.0)/RCONST(10082082980243.0); - B->A[3][1] = RCONST(1258591069120.0)/RCONST(10082082980243.0); - B->A[3][2] = RCONST(-322722984531.0)/RCONST(8455138723562.0); - B->A[3][3] = RCONST(1235.0)/RCONST(10000.0); - B->A[4][0] = RCONST(-436103496990.0)/RCONST(5971407786587.0); - B->A[4][1] = RCONST(-436103496990.0)/RCONST(5971407786587.0); - B->A[4][2] = RCONST(-2689175662187.0)/RCONST(11046760208243.0); - B->A[4][3] = RCONST(4431412449334.0)/RCONST(12995360898505.0); - B->A[4][4] = RCONST(1235.0)/RCONST(10000.0); - B->A[5][0] = RCONST(-2207373168298.0)/RCONST(14430576638973.0); - B->A[5][1] = RCONST(-2207373168298.0)/RCONST(14430576638973.0); - B->A[5][2] = RCONST(242511121179.0)/RCONST(3358618340039.0); - B->A[5][3] = RCONST(3145666661981.0)/RCONST(7780404714551.0); - B->A[5][4] = RCONST(5882073923981.0)/RCONST(14490790706663.0); - B->A[5][5] = RCONST(1235.0)/RCONST(10000.0); - B->A[6][2] = RCONST(9164257142617.0)/RCONST(17756377923965.0); - B->A[6][3] = RCONST(-10812980402763.0)/RCONST(74029279521829.0); - B->A[6][4] = RCONST(1335994250573.0)/RCONST(5691609445217.0); - B->A[6][5] = RCONST(2273837961795.0)/RCONST(8368240463276.0); - B->A[6][6] = RCONST(1235.0)/RCONST(10000.0); - - B->b[2] = RCONST(9164257142617.0)/RCONST(17756377923965.0); - B->b[3] = RCONST(-10812980402763.0)/RCONST(74029279521829.0); - B->b[4] = RCONST(1335994250573.0)/RCONST(5691609445217.0); - B->b[5] = RCONST(2273837961795.0)/RCONST(8368240463276.0); - B->b[6] = RCONST(1235.0)/RCONST(10000.0); - - B->c[1] = RCONST(247.0)/RCONST(1000.0); - B->c[2] = RCONST(4276536705230.0)/RCONST(10142255878289.0); - B->c[3] = RCONST(67.0)/RCONST(200.0); - B->c[4] = RCONST(3.0)/RCONST(40.0); - B->c[5] = RCONST(7.0)/RCONST(10.0); - B->c[6] = RCONST(1.0); - - B->d[2] = RCONST(4469248916618.0)/RCONST(8635866897933.0); - B->d[3] = RCONST(-621260224600.0)/RCONST(4094290005349.0); - B->d[4] = RCONST(696572312987.0)/RCONST(2942599194819.0); - B->d[5] = RCONST(1532940081127.0)/RCONST(5565293938103.0); - B->d[6] = RCONST(2441.0)/RCONST(20000.0); + B->A[1][0] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + B->A[1][1] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + B->A[2][0] = SUN_RCONST(624185399699.0)/SUN_RCONST(4186980696204.0); + B->A[2][1] = SUN_RCONST(624185399699.0)/SUN_RCONST(4186980696204.0); + B->A[2][2] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + B->A[3][0] = SUN_RCONST(1258591069120.0)/SUN_RCONST(10082082980243.0); + B->A[3][1] = SUN_RCONST(1258591069120.0)/SUN_RCONST(10082082980243.0); + B->A[3][2] = SUN_RCONST(-322722984531.0)/SUN_RCONST(8455138723562.0); + B->A[3][3] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + B->A[4][0] = SUN_RCONST(-436103496990.0)/SUN_RCONST(5971407786587.0); + B->A[4][1] = SUN_RCONST(-436103496990.0)/SUN_RCONST(5971407786587.0); + B->A[4][2] = SUN_RCONST(-2689175662187.0)/SUN_RCONST(11046760208243.0); + B->A[4][3] = SUN_RCONST(4431412449334.0)/SUN_RCONST(12995360898505.0); + B->A[4][4] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + B->A[5][0] = SUN_RCONST(-2207373168298.0)/SUN_RCONST(14430576638973.0); + B->A[5][1] = SUN_RCONST(-2207373168298.0)/SUN_RCONST(14430576638973.0); + B->A[5][2] = SUN_RCONST(242511121179.0)/SUN_RCONST(3358618340039.0); + B->A[5][3] = SUN_RCONST(3145666661981.0)/SUN_RCONST(7780404714551.0); + B->A[5][4] = SUN_RCONST(5882073923981.0)/SUN_RCONST(14490790706663.0); + B->A[5][5] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + B->A[6][2] = SUN_RCONST(9164257142617.0)/SUN_RCONST(17756377923965.0); + B->A[6][3] = SUN_RCONST(-10812980402763.0)/SUN_RCONST(74029279521829.0); + B->A[6][4] = SUN_RCONST(1335994250573.0)/SUN_RCONST(5691609445217.0); + B->A[6][5] = SUN_RCONST(2273837961795.0)/SUN_RCONST(8368240463276.0); + B->A[6][6] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + + B->b[2] = SUN_RCONST(9164257142617.0)/SUN_RCONST(17756377923965.0); + B->b[3] = SUN_RCONST(-10812980402763.0)/SUN_RCONST(74029279521829.0); + B->b[4] = SUN_RCONST(1335994250573.0)/SUN_RCONST(5691609445217.0); + B->b[5] = SUN_RCONST(2273837961795.0)/SUN_RCONST(8368240463276.0); + B->b[6] = SUN_RCONST(1235.0)/SUN_RCONST(10000.0); + + B->c[1] = SUN_RCONST(247.0)/SUN_RCONST(1000.0); + B->c[2] = SUN_RCONST(4276536705230.0)/SUN_RCONST(10142255878289.0); + B->c[3] = SUN_RCONST(67.0)/SUN_RCONST(200.0); + B->c[4] = SUN_RCONST(3.0)/SUN_RCONST(40.0); + B->c[5] = SUN_RCONST(7.0)/SUN_RCONST(10.0); + B->c[6] = SUN_RCONST(1.0); + + B->d[2] = SUN_RCONST(4469248916618.0)/SUN_RCONST(8635866897933.0); + B->d[3] = SUN_RCONST(-621260224600.0)/SUN_RCONST(4094290005349.0); + B->d[4] = SUN_RCONST(696572312987.0)/SUN_RCONST(2942599194819.0); + B->d[5] = SUN_RCONST(1532940081127.0)/SUN_RCONST(5565293938103.0); + B->d[6] = SUN_RCONST(2441.0)/SUN_RCONST(20000.0); return B; }) @@ -480,51 +480,51 @@ ARK_BUTCHER_TABLE(ARKODE_KVAERNO_7_4_5, { /* Kvaerno(7,4,5)-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(7, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(0.26); - B->A[1][1] = RCONST(0.26); - B->A[2][0] = RCONST(0.13); - B->A[2][1] = RCONST(0.84033320996790809); - B->A[2][2] = RCONST(0.26); - B->A[3][0] = RCONST(0.22371961478320505); - B->A[3][1] = RCONST(0.47675532319799699); - B->A[3][2] = RCONST(-0.06470895363112615); - B->A[3][3] = RCONST(0.26); - B->A[4][0] = RCONST(0.16648564323248321); - B->A[4][1] = RCONST(0.10450018841591720); - B->A[4][2] = RCONST(0.03631482272098715); - B->A[4][3] = RCONST(-0.13090704451073998); - B->A[4][4] = RCONST(0.26); - B->A[5][0] = RCONST(0.13855640231268224); - B->A[5][2] = RCONST(-0.04245337201752043); - B->A[5][3] = RCONST(0.02446657898003141); - B->A[5][4] = RCONST(0.61943039072480676); - B->A[5][5] = RCONST(0.26); - B->A[6][0] = RCONST(0.13659751177640291); - B->A[6][2] = RCONST(-0.05496908796538376); - B->A[6][3] = RCONST(-0.04118626728321046); - B->A[6][4] = RCONST(0.62993304899016403); - B->A[6][5] = RCONST(0.06962479448202728); - B->A[6][6] = RCONST(0.26); - - B->b[0] = RCONST(0.13659751177640291); - B->b[2] = RCONST(-0.05496908796538376); - B->b[3] = RCONST(-0.04118626728321046); - B->b[4] = RCONST(0.62993304899016403); - B->b[5] = RCONST(0.06962479448202728); - B->b[6] = RCONST(0.26); - - B->d[0] = RCONST(0.13855640231268224); - B->d[2] = RCONST(-0.04245337201752043); - B->d[3] = RCONST(0.02446657898003141); - B->d[4] = RCONST(0.61943039072480676); - B->d[5] = RCONST(0.26); - - B->c[1] = RCONST(0.52); - B->c[2] = RCONST(1.230333209967908); - B->c[3] = RCONST(0.895765984350076); - B->c[4] = RCONST(0.436393609858648); - B->c[5] = RCONST(1.0); - B->c[6] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.26); + B->A[1][1] = SUN_RCONST(0.26); + B->A[2][0] = SUN_RCONST(0.13); + B->A[2][1] = SUN_RCONST(0.84033320996790809); + B->A[2][2] = SUN_RCONST(0.26); + B->A[3][0] = SUN_RCONST(0.22371961478320505); + B->A[3][1] = SUN_RCONST(0.47675532319799699); + B->A[3][2] = SUN_RCONST(-0.06470895363112615); + B->A[3][3] = SUN_RCONST(0.26); + B->A[4][0] = SUN_RCONST(0.16648564323248321); + B->A[4][1] = SUN_RCONST(0.10450018841591720); + B->A[4][2] = SUN_RCONST(0.03631482272098715); + B->A[4][3] = SUN_RCONST(-0.13090704451073998); + B->A[4][4] = SUN_RCONST(0.26); + B->A[5][0] = SUN_RCONST(0.13855640231268224); + B->A[5][2] = SUN_RCONST(-0.04245337201752043); + B->A[5][3] = SUN_RCONST(0.02446657898003141); + B->A[5][4] = SUN_RCONST(0.61943039072480676); + B->A[5][5] = SUN_RCONST(0.26); + B->A[6][0] = SUN_RCONST(0.13659751177640291); + B->A[6][2] = SUN_RCONST(-0.05496908796538376); + B->A[6][3] = SUN_RCONST(-0.04118626728321046); + B->A[6][4] = SUN_RCONST(0.62993304899016403); + B->A[6][5] = SUN_RCONST(0.06962479448202728); + B->A[6][6] = SUN_RCONST(0.26); + + B->b[0] = SUN_RCONST(0.13659751177640291); + B->b[2] = SUN_RCONST(-0.05496908796538376); + B->b[3] = SUN_RCONST(-0.04118626728321046); + B->b[4] = SUN_RCONST(0.62993304899016403); + B->b[5] = SUN_RCONST(0.06962479448202728); + B->b[6] = SUN_RCONST(0.26); + + B->d[0] = SUN_RCONST(0.13855640231268224); + B->d[2] = SUN_RCONST(-0.04245337201752043); + B->d[3] = SUN_RCONST(0.02446657898003141); + B->d[4] = SUN_RCONST(0.61943039072480676); + B->d[5] = SUN_RCONST(0.26); + + B->c[1] = SUN_RCONST(0.52); + B->c[2] = SUN_RCONST(1.230333209967908); + B->c[3] = SUN_RCONST(0.895765984350076); + B->c[4] = SUN_RCONST(0.436393609858648); + B->c[5] = SUN_RCONST(1.0); + B->c[6] = SUN_RCONST(1.0); return B; }) @@ -532,57 +532,57 @@ ARK_BUTCHER_TABLE(ARKODE_ARK548L2SA_DIRK_8_4_5, { /* ARK5(4)8L[2]SA-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(8, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(41.0)/RCONST(200.0); - B->A[1][1] = RCONST(41.0)/RCONST(200.0); - B->A[2][0] = RCONST(41.0)/RCONST(400.0); - B->A[2][1] = RCONST(-567603406766.0)/RCONST(11931857230679.0); - B->A[2][2] = RCONST(41.0)/RCONST(200.0); - B->A[3][0] = RCONST(683785636431.0)/RCONST(9252920307686.0); - B->A[3][2] = RCONST(-110385047103.0)/RCONST(1367015193373.0); - B->A[3][3] = RCONST(41.0)/RCONST(200.0); - B->A[4][0] = RCONST(3016520224154.0)/RCONST(10081342136671.0); - B->A[4][2] = RCONST(30586259806659.0)/RCONST(12414158314087.0); - B->A[4][3] = RCONST(-22760509404356.0)/RCONST(11113319521817.0); - B->A[4][4] = RCONST(41.0)/RCONST(200.0); - B->A[5][0] = RCONST(218866479029.0)/RCONST(1489978393911.0); - B->A[5][2] = RCONST(638256894668.0)/RCONST(5436446318841.0); - B->A[5][3] = RCONST(-1179710474555.0)/RCONST(5321154724896.0); - B->A[5][4] = RCONST(-60928119172.0)/RCONST(8023461067671.0); - B->A[5][5] = RCONST(41.0)/RCONST(200.0); - B->A[6][0] = RCONST(1020004230633.0)/RCONST(5715676835656.0); - B->A[6][2] = RCONST(25762820946817.0)/RCONST(25263940353407.0); - B->A[6][3] = RCONST(-2161375909145.0)/RCONST(9755907335909.0); - B->A[6][4] = RCONST(-211217309593.0)/RCONST(5846859502534.0); - B->A[6][5] = RCONST(-4269925059573.0)/RCONST(7827059040749.0); - B->A[6][6] = RCONST(41.0)/RCONST(200.0); - B->A[7][0] = RCONST(-872700587467.0)/RCONST(9133579230613.0); - B->A[7][3] = RCONST(22348218063261.0)/RCONST(9555858737531.0); - B->A[7][4] = RCONST(-1143369518992.0)/RCONST(8141816002931.0); - B->A[7][5] = RCONST(-39379526789629.0)/RCONST(19018526304540.0); - B->A[7][6] = RCONST(32727382324388.0)/RCONST(42900044865799.0); - B->A[7][7] = RCONST(41.0)/RCONST(200.0); - - B->b[0] = RCONST(-872700587467.0)/RCONST(9133579230613.0); - B->b[3] = RCONST(22348218063261.0)/RCONST(9555858737531.0); - B->b[4] = RCONST(-1143369518992.0)/RCONST(8141816002931.0); - B->b[5] = RCONST(-39379526789629.0)/RCONST(19018526304540.0); - B->b[6] = RCONST(32727382324388.0)/RCONST(42900044865799.0); - B->b[7] = RCONST(41.0)/RCONST(200.0); - - B->d[0] = RCONST(-975461918565.0)/RCONST(9796059967033.0); - B->d[3] = RCONST(78070527104295.0)/RCONST(32432590147079.0); - B->d[4] = RCONST(-548382580838.0)/RCONST(3424219808633.0); - B->d[5] = RCONST(-33438840321285.0)/RCONST(15594753105479.0); - B->d[6] = RCONST(3629800801594.0)/RCONST(4656183773603.0); - B->d[7] = RCONST(4035322873751.0)/RCONST(18575991585200.0); - - B->c[1] = RCONST(41.0)/RCONST(100.0); - B->c[2] = RCONST(2935347310677.0)/RCONST(11292855782101.0); - B->c[3] = RCONST(1426016391358.0)/RCONST(7196633302097.0); - B->c[4] = RCONST(92.0)/RCONST(100.0); - B->c[5] = RCONST(24.0)/RCONST(100.0); - B->c[6] = RCONST(3.0)/RCONST(5.0); - B->c[7] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + B->A[1][1] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + B->A[2][0] = SUN_RCONST(41.0)/SUN_RCONST(400.0); + B->A[2][1] = SUN_RCONST(-567603406766.0)/SUN_RCONST(11931857230679.0); + B->A[2][2] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + B->A[3][0] = SUN_RCONST(683785636431.0)/SUN_RCONST(9252920307686.0); + B->A[3][2] = SUN_RCONST(-110385047103.0)/SUN_RCONST(1367015193373.0); + B->A[3][3] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + B->A[4][0] = SUN_RCONST(3016520224154.0)/SUN_RCONST(10081342136671.0); + B->A[4][2] = SUN_RCONST(30586259806659.0)/SUN_RCONST(12414158314087.0); + B->A[4][3] = SUN_RCONST(-22760509404356.0)/SUN_RCONST(11113319521817.0); + B->A[4][4] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + B->A[5][0] = SUN_RCONST(218866479029.0)/SUN_RCONST(1489978393911.0); + B->A[5][2] = SUN_RCONST(638256894668.0)/SUN_RCONST(5436446318841.0); + B->A[5][3] = SUN_RCONST(-1179710474555.0)/SUN_RCONST(5321154724896.0); + B->A[5][4] = SUN_RCONST(-60928119172.0)/SUN_RCONST(8023461067671.0); + B->A[5][5] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + B->A[6][0] = SUN_RCONST(1020004230633.0)/SUN_RCONST(5715676835656.0); + B->A[6][2] = SUN_RCONST(25762820946817.0)/SUN_RCONST(25263940353407.0); + B->A[6][3] = SUN_RCONST(-2161375909145.0)/SUN_RCONST(9755907335909.0); + B->A[6][4] = SUN_RCONST(-211217309593.0)/SUN_RCONST(5846859502534.0); + B->A[6][5] = SUN_RCONST(-4269925059573.0)/SUN_RCONST(7827059040749.0); + B->A[6][6] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + B->A[7][0] = SUN_RCONST(-872700587467.0)/SUN_RCONST(9133579230613.0); + B->A[7][3] = SUN_RCONST(22348218063261.0)/SUN_RCONST(9555858737531.0); + B->A[7][4] = SUN_RCONST(-1143369518992.0)/SUN_RCONST(8141816002931.0); + B->A[7][5] = SUN_RCONST(-39379526789629.0)/SUN_RCONST(19018526304540.0); + B->A[7][6] = SUN_RCONST(32727382324388.0)/SUN_RCONST(42900044865799.0); + B->A[7][7] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + + B->b[0] = SUN_RCONST(-872700587467.0)/SUN_RCONST(9133579230613.0); + B->b[3] = SUN_RCONST(22348218063261.0)/SUN_RCONST(9555858737531.0); + B->b[4] = SUN_RCONST(-1143369518992.0)/SUN_RCONST(8141816002931.0); + B->b[5] = SUN_RCONST(-39379526789629.0)/SUN_RCONST(19018526304540.0); + B->b[6] = SUN_RCONST(32727382324388.0)/SUN_RCONST(42900044865799.0); + B->b[7] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + + B->d[0] = SUN_RCONST(-975461918565.0)/SUN_RCONST(9796059967033.0); + B->d[3] = SUN_RCONST(78070527104295.0)/SUN_RCONST(32432590147079.0); + B->d[4] = SUN_RCONST(-548382580838.0)/SUN_RCONST(3424219808633.0); + B->d[5] = SUN_RCONST(-33438840321285.0)/SUN_RCONST(15594753105479.0); + B->d[6] = SUN_RCONST(3629800801594.0)/SUN_RCONST(4656183773603.0); + B->d[7] = SUN_RCONST(4035322873751.0)/SUN_RCONST(18575991585200.0); + + B->c[1] = SUN_RCONST(41.0)/SUN_RCONST(100.0); + B->c[2] = SUN_RCONST(2935347310677.0)/SUN_RCONST(11292855782101.0); + B->c[3] = SUN_RCONST(1426016391358.0)/SUN_RCONST(7196633302097.0); + B->c[4] = SUN_RCONST(92.0)/SUN_RCONST(100.0); + B->c[5] = SUN_RCONST(24.0)/SUN_RCONST(100.0); + B->c[6] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + B->c[7] = SUN_RCONST(1.0); return B; }) @@ -590,90 +590,90 @@ ARK_BUTCHER_TABLE(ARKODE_ARK548L2SAb_DIRK_8_4_5, { /* ARK5(4)8L[2]SAb-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(8, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(2.0)/RCONST(9.0); - B->A[1][1] = RCONST(2.0)/RCONST(9.0); - B->A[2][0] = RCONST(2366667076620.0)/RCONST(8822750406821.0); - B->A[2][1] = RCONST(2366667076620.0)/RCONST(8822750406821.0); - B->A[2][2] = RCONST(2.0)/RCONST(9.0); - B->A[3][0] = RCONST(-257962897183.0)/RCONST(4451812247028.0); - B->A[3][1] = RCONST(-257962897183.0)/RCONST(4451812247028.0); - B->A[3][2] = RCONST(128530224461.0)/RCONST(14379561246022.0); - B->A[3][3] = RCONST(2.0)/RCONST(9.0); - B->A[4][0] = RCONST(-486229321650.0)/RCONST(11227943450093.0); - B->A[4][1] = RCONST(-486229321650.0)/RCONST(11227943450093.0); - B->A[4][2] = RCONST(-225633144460.0)/RCONST(6633558740617.0); - B->A[4][3] = RCONST(1741320951451.0)/RCONST(6824444397158.0); - B->A[4][4] = RCONST(2.0)/RCONST(9.0); - B->A[5][0] = RCONST(621307788657.0)/RCONST(4714163060173.0); - B->A[5][1] = RCONST(621307788657.0)/RCONST(4714163060173.0); - B->A[5][2] = RCONST(-125196015625.0)/RCONST(3866852212004.0); - B->A[5][3] = RCONST(940440206406.0)/RCONST(7593089888465.0); - B->A[5][4] = RCONST(961109811699.0)/RCONST(6734810228204.0); - B->A[5][5] = RCONST(2.0)/RCONST(9.0); - B->A[6][0] = RCONST(2036305566805.0)/RCONST(6583108094622.0); - B->A[6][1] = RCONST(2036305566805.0)/RCONST(6583108094622.0); - B->A[6][2] = RCONST(-3039402635899.0)/RCONST(4450598839912.0); - B->A[6][3] = RCONST(-1829510709469.0)/RCONST(31102090912115.0); - B->A[6][4] = RCONST(-286320471013.0)/RCONST(6931253422520.0); - B->A[6][5] = RCONST(8651533662697.0)/RCONST(9642993110008.0); - B->A[6][6] = RCONST(2.0)/RCONST(9.0); - B->A[7][2] = RCONST(3517720773327.0)/RCONST(20256071687669.0); - B->A[7][3] = RCONST(4569610470461.0)/RCONST(17934693873752.0); - B->A[7][4] = RCONST(2819471173109.0)/RCONST(11655438449929.0); - B->A[7][5] = RCONST(3296210113763.0)/RCONST(10722700128969.0); - B->A[7][6] = RCONST(-1142099968913.0)/RCONST(5710983926999.0); - B->A[7][7] = RCONST(2.0)/RCONST(9.0); - - B->b[2] = RCONST(3517720773327.0)/RCONST(20256071687669.0); - B->b[3] = RCONST(4569610470461.0)/RCONST(17934693873752.0); - B->b[4] = RCONST(2819471173109.0)/RCONST(11655438449929.0); - B->b[5] = RCONST(3296210113763.0)/RCONST(10722700128969.0); - B->b[6] = RCONST(-1142099968913.0)/RCONST(5710983926999.0); - B->b[7] = RCONST(2.0)/RCONST(9.0); - - B->d[2] = RCONST(520639020421.0)/RCONST(8300446712847.0); - B->d[3] = RCONST(4550235134915.0)/RCONST(17827758688493.0); - B->d[4] = RCONST(1482366381361.0)/RCONST(6201654941325.0); - B->d[5] = RCONST(5551607622171.0)/RCONST(13911031047899.0); - B->d[6] = RCONST(-5266607656330.0)/RCONST(36788968843917.0); - B->d[7] = RCONST(1074053359553.0)/RCONST(5740751784926.0); - - B->c[1] = RCONST(4.0)/RCONST(9.0); - B->c[2] = RCONST(6456083330201.0)/RCONST(8509243623797.0); - B->c[3] = RCONST(1632083962415.0)/RCONST(14158861528103.0); - B->c[4] = RCONST(6365430648612.0)/RCONST(17842476412687.0); - B->c[5] = RCONST(18.0)/RCONST(25.0); - B->c[6] = RCONST(191.0)/RCONST(200.0); - B->c[7] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[1][1] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[2][0] = SUN_RCONST(2366667076620.0)/SUN_RCONST(8822750406821.0); + B->A[2][1] = SUN_RCONST(2366667076620.0)/SUN_RCONST(8822750406821.0); + B->A[2][2] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[3][0] = SUN_RCONST(-257962897183.0)/SUN_RCONST(4451812247028.0); + B->A[3][1] = SUN_RCONST(-257962897183.0)/SUN_RCONST(4451812247028.0); + B->A[3][2] = SUN_RCONST(128530224461.0)/SUN_RCONST(14379561246022.0); + B->A[3][3] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[4][0] = SUN_RCONST(-486229321650.0)/SUN_RCONST(11227943450093.0); + B->A[4][1] = SUN_RCONST(-486229321650.0)/SUN_RCONST(11227943450093.0); + B->A[4][2] = SUN_RCONST(-225633144460.0)/SUN_RCONST(6633558740617.0); + B->A[4][3] = SUN_RCONST(1741320951451.0)/SUN_RCONST(6824444397158.0); + B->A[4][4] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[5][0] = SUN_RCONST(621307788657.0)/SUN_RCONST(4714163060173.0); + B->A[5][1] = SUN_RCONST(621307788657.0)/SUN_RCONST(4714163060173.0); + B->A[5][2] = SUN_RCONST(-125196015625.0)/SUN_RCONST(3866852212004.0); + B->A[5][3] = SUN_RCONST(940440206406.0)/SUN_RCONST(7593089888465.0); + B->A[5][4] = SUN_RCONST(961109811699.0)/SUN_RCONST(6734810228204.0); + B->A[5][5] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[6][0] = SUN_RCONST(2036305566805.0)/SUN_RCONST(6583108094622.0); + B->A[6][1] = SUN_RCONST(2036305566805.0)/SUN_RCONST(6583108094622.0); + B->A[6][2] = SUN_RCONST(-3039402635899.0)/SUN_RCONST(4450598839912.0); + B->A[6][3] = SUN_RCONST(-1829510709469.0)/SUN_RCONST(31102090912115.0); + B->A[6][4] = SUN_RCONST(-286320471013.0)/SUN_RCONST(6931253422520.0); + B->A[6][5] = SUN_RCONST(8651533662697.0)/SUN_RCONST(9642993110008.0); + B->A[6][6] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[7][2] = SUN_RCONST(3517720773327.0)/SUN_RCONST(20256071687669.0); + B->A[7][3] = SUN_RCONST(4569610470461.0)/SUN_RCONST(17934693873752.0); + B->A[7][4] = SUN_RCONST(2819471173109.0)/SUN_RCONST(11655438449929.0); + B->A[7][5] = SUN_RCONST(3296210113763.0)/SUN_RCONST(10722700128969.0); + B->A[7][6] = SUN_RCONST(-1142099968913.0)/SUN_RCONST(5710983926999.0); + B->A[7][7] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + + B->b[2] = SUN_RCONST(3517720773327.0)/SUN_RCONST(20256071687669.0); + B->b[3] = SUN_RCONST(4569610470461.0)/SUN_RCONST(17934693873752.0); + B->b[4] = SUN_RCONST(2819471173109.0)/SUN_RCONST(11655438449929.0); + B->b[5] = SUN_RCONST(3296210113763.0)/SUN_RCONST(10722700128969.0); + B->b[6] = SUN_RCONST(-1142099968913.0)/SUN_RCONST(5710983926999.0); + B->b[7] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + + B->d[2] = SUN_RCONST(520639020421.0)/SUN_RCONST(8300446712847.0); + B->d[3] = SUN_RCONST(4550235134915.0)/SUN_RCONST(17827758688493.0); + B->d[4] = SUN_RCONST(1482366381361.0)/SUN_RCONST(6201654941325.0); + B->d[5] = SUN_RCONST(5551607622171.0)/SUN_RCONST(13911031047899.0); + B->d[6] = SUN_RCONST(-5266607656330.0)/SUN_RCONST(36788968843917.0); + B->d[7] = SUN_RCONST(1074053359553.0)/SUN_RCONST(5740751784926.0); + + B->c[1] = SUN_RCONST(4.0)/SUN_RCONST(9.0); + B->c[2] = SUN_RCONST(6456083330201.0)/SUN_RCONST(8509243623797.0); + B->c[3] = SUN_RCONST(1632083962415.0)/SUN_RCONST(14158861528103.0); + B->c[4] = SUN_RCONST(6365430648612.0)/SUN_RCONST(17842476412687.0); + B->c[5] = SUN_RCONST(18.0)/SUN_RCONST(25.0); + B->c[6] = SUN_RCONST(191.0)/SUN_RCONST(200.0); + B->c[7] = SUN_RCONST(1.0); return B; }) ARK_BUTCHER_TABLE(ARKODE_ESDIRK324L2SA_4_2_3, { /* ESDIRK3(2)4L[2]SA (A,L stable) */ - const sunrealtype g = RCONST(0.435866521508458999416019451193556843); + const sunrealtype g = SUN_RCONST(0.435866521508458999416019451193556843); const sunrealtype g2 = g * g; const sunrealtype g3 = g2 * g; const sunrealtype g4 = g3 * g; const sunrealtype g5 = g4 * g; - const sunrealtype c3 = RCONST(0.6); + const sunrealtype c3 = SUN_RCONST(0.6); ARKodeButcherTable B = ARKodeButcherTable_Alloc(4, SUNTRUE); B->q = 3; B->p = 2; - B->b[1] = (-RCONST(2.0)+RCONST(3.0)*c3+RCONST(6.0)*g*(RCONST(1.0)-c3))/(RCONST(12.0)*g*(c3-RCONST(2.0)*g)); - B->b[2] = (RCONST(1.0)-RCONST(6.0)*g+RCONST(6.0)*g2)/(RCONST(3.0)*c3*(c3-RCONST(2.0)*g)); + B->b[1] = (-SUN_RCONST(2.0)+SUN_RCONST(3.0)*c3+SUN_RCONST(6.0)*g*(SUN_RCONST(1.0)-c3))/(SUN_RCONST(12.0)*g*(c3-SUN_RCONST(2.0)*g)); + B->b[2] = (SUN_RCONST(1.0)-SUN_RCONST(6.0)*g+SUN_RCONST(6.0)*g2)/(SUN_RCONST(3.0)*c3*(c3-SUN_RCONST(2.0)*g)); B->b[3] = g; - B->b[0] = RCONST(1.0) - g - B->b[1] - B->b[2]; + B->b[0] = SUN_RCONST(1.0) - g - B->b[1] - B->b[2]; - B->d[1] = c3*(-RCONST(1.0)+RCONST(6.0)*g-RCONST(24.0)*g3+RCONST(12.0)*g4-RCONST(6.0)*g5)/(RCONST(4.0)*g*(RCONST(2.0)*g-c3)*(RCONST(1.0)-RCONST(6.0)*g+RCONST(6.0)*g2)) - + (RCONST(3.0)-RCONST(27.0)*g+RCONST(68.0)*g2-RCONST(55.0)*g3+RCONST(21.0)*g4-RCONST(6.0)*g5)/(RCONST(2.0)*(RCONST(2.0)*g-c3)*(RCONST(1.0)-RCONST(6.0)*g+RCONST(6.0)*g2)); - B->d[2] = -g*(-RCONST(2.0)+RCONST(21.0)*g-RCONST(68.0)*g2+RCONST(79.0)*g3-RCONST(33.0)*g4+RCONST(12.0)*g5)/(c3*(c3-RCONST(2.0)*g)*(RCONST(1.0)-RCONST(6.0)*g+RCONST(6.0)*g2)); - B->d[3] = -RCONST(3.0)*g2*(-RCONST(1.0)+RCONST(4.0)*g-RCONST(2.0)*g2+g3)/(RCONST(1.0)-RCONST(6.0)*g+RCONST(6.0)*g2); - B->d[0] = RCONST(1.0) - B->d[1] - B->d[2] - B->d[3]; + B->d[1] = c3*(-SUN_RCONST(1.0)+SUN_RCONST(6.0)*g-SUN_RCONST(24.0)*g3+SUN_RCONST(12.0)*g4-SUN_RCONST(6.0)*g5)/(SUN_RCONST(4.0)*g*(SUN_RCONST(2.0)*g-c3)*(SUN_RCONST(1.0)-SUN_RCONST(6.0)*g+SUN_RCONST(6.0)*g2)) + + (SUN_RCONST(3.0)-SUN_RCONST(27.0)*g+SUN_RCONST(68.0)*g2-SUN_RCONST(55.0)*g3+SUN_RCONST(21.0)*g4-SUN_RCONST(6.0)*g5)/(SUN_RCONST(2.0)*(SUN_RCONST(2.0)*g-c3)*(SUN_RCONST(1.0)-SUN_RCONST(6.0)*g+SUN_RCONST(6.0)*g2)); + B->d[2] = -g*(-SUN_RCONST(2.0)+SUN_RCONST(21.0)*g-SUN_RCONST(68.0)*g2+SUN_RCONST(79.0)*g3-SUN_RCONST(33.0)*g4+SUN_RCONST(12.0)*g5)/(c3*(c3-SUN_RCONST(2.0)*g)*(SUN_RCONST(1.0)-SUN_RCONST(6.0)*g+SUN_RCONST(6.0)*g2)); + B->d[3] = -SUN_RCONST(3.0)*g2*(-SUN_RCONST(1.0)+SUN_RCONST(4.0)*g-SUN_RCONST(2.0)*g2+g3)/(SUN_RCONST(1.0)-SUN_RCONST(6.0)*g+SUN_RCONST(6.0)*g2); + B->d[0] = SUN_RCONST(1.0) - B->d[1] - B->d[2] - B->d[3]; B->A[1][0] = g; B->A[1][1] = g; - B->A[2][1] = c3*(c3-RCONST(2.0)*g)/(RCONST(4.0)*g); + B->A[2][1] = c3*(c3-SUN_RCONST(2.0)*g)/(SUN_RCONST(4.0)*g); B->A[2][0] = c3 - g - B->A[2][1]; B->A[2][2] = g; B->A[3][0] = B->b[0]; @@ -681,9 +681,9 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK324L2SA_4_2_3, { /* ESDIRK3(2)4L[2]SA (A,L stable B->A[3][2] = B->b[2]; B->A[3][3] = B->b[3]; - B->c[1] = RCONST(2.0)*g; - B->c[2] = RCONST(3.0)/RCONST(5.0); - B->c[3] = RCONST(1.0); + B->c[1] = SUN_RCONST(2.0)*g; + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + B->c[3] = SUN_RCONST(1.0); return B; }) @@ -692,32 +692,32 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK325L2SA_5_2_3, { /* ESDIRK3(2)5L[2]SA (A,L stable B->q = 3; B->p = 2; - B->c[1] = RCONST(9.0)/RCONST(20.0); - B->c[2] = RCONST(9.0)*(RCONST(2.0)+SUNRsqrt(RCONST(2.0)))/RCONST(40.0); - B->c[3] = RCONST(3.0)/RCONST(5.0); - B->c[4] = RCONST(1.0); - - B->b[0] = (RCONST(2398.0)+RCONST(1205.0)*SUNRsqrt(RCONST(2.0)))/RCONST(2835.0)/(RCONST(4.0)+RCONST(3.0)*SUNRsqrt(RCONST(2.0))); - B->b[1] = (RCONST(2398.0)+RCONST(1205.0)*SUNRsqrt(RCONST(2.0)))/RCONST(2835.0)/(RCONST(4.0)+RCONST(3.0)*SUNRsqrt(RCONST(2.0))); - B->b[2] = -RCONST(2374.0)*(RCONST(1.0)+RCONST(2.0)*SUNRsqrt(RCONST(2.0)))/RCONST(2835.0)/(RCONST(5.0)+RCONST(3.0)*SUNRsqrt(RCONST(2.0))); - B->b[3] = RCONST(5827.0)/RCONST(7560.0); - B->b[4] = RCONST(9.0)/RCONST(40.0); - - B->d[0] = (SUNRsqrt(RCONST(2.0))*RCONST(5547709.0)-RCONST(4800247.0))/RCONST(16519545.0); - B->d[1] = (SUNRsqrt(RCONST(2.0))*RCONST(5547709.0)-RCONST(4800247.0))/RCONST(16519545.0); - B->d[2] = RCONST(11095418.0)*(RCONST(1.0)-SUNRsqrt(RCONST(2.0)))/RCONST(16519545.0); - B->d[3] = RCONST(30698249.0)/RCONST(44052120.0); - B->d[4] = RCONST(49563.0)/RCONST(233080.0); - - B->A[1][0] = RCONST(9.0)/RCONST(40.0); - B->A[1][1] = RCONST(9.0)/RCONST(40.0); - B->A[2][0] = RCONST(9.0)*(RCONST(1.0)+SUNRsqrt(RCONST(2.0)))/RCONST(80.0); - B->A[2][1] = RCONST(9.0)*(RCONST(1.0)+SUNRsqrt(RCONST(2.0)))/RCONST(80.0); - B->A[2][2] = RCONST(9.0)/RCONST(40.0); - B->A[3][0] = (RCONST(22.0)+RCONST(15.0)*SUNRsqrt(RCONST(2.0)))/RCONST(80.0)/(RCONST(1.0)+SUNRsqrt(RCONST(2.0))); - B->A[3][1] = (RCONST(22.0)+RCONST(15.0)*SUNRsqrt(RCONST(2.0)))/RCONST(80.0)/(RCONST(1.0)+SUNRsqrt(RCONST(2.0))); - B->A[3][2] = -RCONST(7.0)/RCONST(40.0)/(RCONST(1.0)+SUNRsqrt(RCONST(2.0))); - B->A[3][3] = RCONST(9.0)/RCONST(40.0); + B->c[1] = SUN_RCONST(9.0)/SUN_RCONST(20.0); + B->c[2] = SUN_RCONST(9.0)*(SUN_RCONST(2.0)+SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(40.0); + B->c[3] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + B->c[4] = SUN_RCONST(1.0); + + B->b[0] = (SUN_RCONST(2398.0)+SUN_RCONST(1205.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(2835.0)/(SUN_RCONST(4.0)+SUN_RCONST(3.0)*SUNRsqrt(SUN_RCONST(2.0))); + B->b[1] = (SUN_RCONST(2398.0)+SUN_RCONST(1205.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(2835.0)/(SUN_RCONST(4.0)+SUN_RCONST(3.0)*SUNRsqrt(SUN_RCONST(2.0))); + B->b[2] = -SUN_RCONST(2374.0)*(SUN_RCONST(1.0)+SUN_RCONST(2.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(2835.0)/(SUN_RCONST(5.0)+SUN_RCONST(3.0)*SUNRsqrt(SUN_RCONST(2.0))); + B->b[3] = SUN_RCONST(5827.0)/SUN_RCONST(7560.0); + B->b[4] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + + B->d[0] = (SUNRsqrt(SUN_RCONST(2.0))*SUN_RCONST(5547709.0)-SUN_RCONST(4800247.0))/SUN_RCONST(16519545.0); + B->d[1] = (SUNRsqrt(SUN_RCONST(2.0))*SUN_RCONST(5547709.0)-SUN_RCONST(4800247.0))/SUN_RCONST(16519545.0); + B->d[2] = SUN_RCONST(11095418.0)*(SUN_RCONST(1.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(16519545.0); + B->d[3] = SUN_RCONST(30698249.0)/SUN_RCONST(44052120.0); + B->d[4] = SUN_RCONST(49563.0)/SUN_RCONST(233080.0); + + B->A[1][0] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[1][1] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[2][0] = SUN_RCONST(9.0)*(SUN_RCONST(1.0)+SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(80.0); + B->A[2][1] = SUN_RCONST(9.0)*(SUN_RCONST(1.0)+SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(80.0); + B->A[2][2] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[3][0] = (SUN_RCONST(22.0)+SUN_RCONST(15.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(80.0)/(SUN_RCONST(1.0)+SUNRsqrt(SUN_RCONST(2.0))); + B->A[3][1] = (SUN_RCONST(22.0)+SUN_RCONST(15.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(80.0)/(SUN_RCONST(1.0)+SUNRsqrt(SUN_RCONST(2.0))); + B->A[3][2] = -SUN_RCONST(7.0)/SUN_RCONST(40.0)/(SUN_RCONST(1.0)+SUNRsqrt(SUN_RCONST(2.0))); + B->A[3][3] = SUN_RCONST(9.0)/SUN_RCONST(40.0); B->A[4][0] = B->b[0]; B->A[4][1] = B->b[1]; B->A[4][2] = B->b[2]; @@ -731,32 +731,32 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK32I5L2SA_5_2_3, { /* ESDIRK3(2I)5L[2]SA (A,L stab B->q = 3; B->p = 2; - B->c[1] = RCONST(9.0)/RCONST(20.0); - B->c[2] = RCONST(4.0)/RCONST(5.0); - B->c[3] = RCONST(1.0); - B->c[4] = RCONST(1.0); - - B->b[0] = RCONST(7415.0)/RCONST(34776.0); - B->b[1] = RCONST(9920.0)/RCONST(30429.0); - B->b[2] = RCONST(4845.0)/RCONST(9016.0); - B->b[3] = -RCONST(5827.0)/RCONST(19320.0); - B->b[4] = RCONST(9.0)/RCONST(40.0); - - B->d[0] = RCONST(23705.0)/RCONST(104328.0); - B->d[1] = RCONST(29720.0)/RCONST(91287.0); - B->d[2] = RCONST(4225.0)/RCONST(9016.0); - B->d[3] = -RCONST(69304987.0)/RCONST(337732920.0); - B->d[4] = RCONST(42843.0)/RCONST(233080.0); - - B->A[1][0] = RCONST(9.0)/RCONST(40.0); - B->A[1][1] = RCONST(9.0)/RCONST(40.0); - B->A[2][0] = RCONST(19.0)/RCONST(72.0); - B->A[2][1] = RCONST(14.0)/RCONST(45.0); - B->A[2][2] = RCONST(9.0)/RCONST(40.0); - B->A[3][0] = RCONST(3337.0)/RCONST(11520.0); - B->A[3][1] = RCONST(233.0)/RCONST(720.0); - B->A[3][2] = RCONST(207.0)/RCONST(1280.0); - B->A[3][3] = RCONST(9.0)/RCONST(40.0); + B->c[1] = SUN_RCONST(9.0)/SUN_RCONST(20.0); + B->c[2] = SUN_RCONST(4.0)/SUN_RCONST(5.0); + B->c[3] = SUN_RCONST(1.0); + B->c[4] = SUN_RCONST(1.0); + + B->b[0] = SUN_RCONST(7415.0)/SUN_RCONST(34776.0); + B->b[1] = SUN_RCONST(9920.0)/SUN_RCONST(30429.0); + B->b[2] = SUN_RCONST(4845.0)/SUN_RCONST(9016.0); + B->b[3] = -SUN_RCONST(5827.0)/SUN_RCONST(19320.0); + B->b[4] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + + B->d[0] = SUN_RCONST(23705.0)/SUN_RCONST(104328.0); + B->d[1] = SUN_RCONST(29720.0)/SUN_RCONST(91287.0); + B->d[2] = SUN_RCONST(4225.0)/SUN_RCONST(9016.0); + B->d[3] = -SUN_RCONST(69304987.0)/SUN_RCONST(337732920.0); + B->d[4] = SUN_RCONST(42843.0)/SUN_RCONST(233080.0); + + B->A[1][0] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[1][1] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[2][0] = SUN_RCONST(19.0)/SUN_RCONST(72.0); + B->A[2][1] = SUN_RCONST(14.0)/SUN_RCONST(45.0); + B->A[2][2] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[3][0] = SUN_RCONST(3337.0)/SUN_RCONST(11520.0); + B->A[3][1] = SUN_RCONST(233.0)/SUN_RCONST(720.0); + B->A[3][2] = SUN_RCONST(207.0)/SUN_RCONST(1280.0); + B->A[3][3] = SUN_RCONST(9.0)/SUN_RCONST(40.0); B->A[4][0] = B->b[0]; B->A[4][1] = B->b[1]; B->A[4][2] = B->b[2]; @@ -770,36 +770,36 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK436L2SA_6_3_4, { /* ESDIRK4(3)6L[2]SA (A,L stable B->q = 4; B->p = 3; - B->c[1] = RCONST(0.5); - B->c[2] = (RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(4.0); - B->c[3] = RCONST(5.0)/RCONST(8.0); - B->c[4] = RCONST(26.0)/RCONST(25.0); - B->c[5] = RCONST(1.0); - - B->b[0] = (RCONST(1181.0)-RCONST(987.0)*SUNRsqrt(RCONST(2.0)))/RCONST(13782.0); - B->b[1] = (RCONST(1181.0)-RCONST(987.0)*SUNRsqrt(RCONST(2.0)))/RCONST(13782.0); - B->b[2] = RCONST(47.0)*(-RCONST(267.0)+RCONST(1783.0)*SUNRsqrt(RCONST(2.0)))/RCONST(273343.0); - B->b[3] = -RCONST(16.0)*(-RCONST(22922.0)+RCONST(3525.0)*SUNRsqrt(RCONST(2.0)))/RCONST(571953.0); - B->b[4] = -RCONST(15625.0)*(RCONST(97.0)+RCONST(376.0)*SUNRsqrt(RCONST(2.0)))/RCONST(90749876.0); - B->b[5] = RCONST(1.0)/RCONST(4.0); - - B->d[0] = -RCONST(480923228411.0)/RCONST(4982971448372.0); - B->d[1] = -RCONST(480923228411.0)/RCONST(4982971448372.0); - B->d[2] = RCONST(6709447293961.0)/RCONST(12833189095359.0); - B->d[3] = RCONST(3513175791894.0)/RCONST(6748737351361.0); - B->d[4] = -RCONST(498863281070.0)/RCONST(6042575550617.0); - B->d[5] = RCONST(2077005547802.0)/RCONST(8945017530137.0); - - B->A[1][1] = RCONST(0.25); - B->A[2][1] = (RCONST(1.0)-SUNRsqrt(RCONST(2.0)))/RCONST(8.0); - B->A[2][2] = RCONST(0.25); - B->A[3][1] = (RCONST(5.0)-RCONST(7.0)*SUNRsqrt(RCONST(2.0)))/RCONST(64.0); - B->A[3][2] = RCONST(7.0)*(RCONST(1.0)+SUNRsqrt(RCONST(2.0)))/RCONST(32.0); - B->A[3][3] = RCONST(0.25); - B->A[4][1] = -(RCONST(13796.0)+RCONST(54539.0)*SUNRsqrt(RCONST(2.0)))/RCONST(125000.0); - B->A[4][2] = (RCONST(506605.0)+RCONST(132109.0)*SUNRsqrt(RCONST(2.0)))/RCONST(437500.0); - B->A[4][3] = RCONST(166.0)*(-RCONST(97.0)+RCONST(376.0)*SUNRsqrt(RCONST(2.0)))/RCONST(109375.0); - B->A[4][4] = RCONST(0.25); + B->c[1] = SUN_RCONST(0.5); + B->c[2] = (SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(4.0); + B->c[3] = SUN_RCONST(5.0)/SUN_RCONST(8.0); + B->c[4] = SUN_RCONST(26.0)/SUN_RCONST(25.0); + B->c[5] = SUN_RCONST(1.0); + + B->b[0] = (SUN_RCONST(1181.0)-SUN_RCONST(987.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(13782.0); + B->b[1] = (SUN_RCONST(1181.0)-SUN_RCONST(987.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(13782.0); + B->b[2] = SUN_RCONST(47.0)*(-SUN_RCONST(267.0)+SUN_RCONST(1783.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(273343.0); + B->b[3] = -SUN_RCONST(16.0)*(-SUN_RCONST(22922.0)+SUN_RCONST(3525.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(571953.0); + B->b[4] = -SUN_RCONST(15625.0)*(SUN_RCONST(97.0)+SUN_RCONST(376.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(90749876.0); + B->b[5] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + + B->d[0] = -SUN_RCONST(480923228411.0)/SUN_RCONST(4982971448372.0); + B->d[1] = -SUN_RCONST(480923228411.0)/SUN_RCONST(4982971448372.0); + B->d[2] = SUN_RCONST(6709447293961.0)/SUN_RCONST(12833189095359.0); + B->d[3] = SUN_RCONST(3513175791894.0)/SUN_RCONST(6748737351361.0); + B->d[4] = -SUN_RCONST(498863281070.0)/SUN_RCONST(6042575550617.0); + B->d[5] = SUN_RCONST(2077005547802.0)/SUN_RCONST(8945017530137.0); + + B->A[1][1] = SUN_RCONST(0.25); + B->A[2][1] = (SUN_RCONST(1.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(8.0); + B->A[2][2] = SUN_RCONST(0.25); + B->A[3][1] = (SUN_RCONST(5.0)-SUN_RCONST(7.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(64.0); + B->A[3][2] = SUN_RCONST(7.0)*(SUN_RCONST(1.0)+SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(32.0); + B->A[3][3] = SUN_RCONST(0.25); + B->A[4][1] = -(SUN_RCONST(13796.0)+SUN_RCONST(54539.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(125000.0); + B->A[4][2] = (SUN_RCONST(506605.0)+SUN_RCONST(132109.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(437500.0); + B->A[4][3] = SUN_RCONST(166.0)*(-SUN_RCONST(97.0)+SUN_RCONST(376.0)*SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(109375.0); + B->A[4][4] = SUN_RCONST(0.25); B->A[5][0] = B->b[0]; B->A[5][1] = B->b[1]; B->A[5][2] = B->b[2]; @@ -818,36 +818,36 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK43I6L2SA_6_3_4, { /* ESDIRK4(3I)6L[2]SA (A,L stab B->q = 4; B->p = 3; - B->c[1] = RCONST(0.5); - B->c[2] = (RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(4.0); - B->c[3] = RCONST(2012122486997.0)/RCONST(3467029789466.0); - B->c[4] = RCONST(1.0); - B->c[5] = RCONST(1.0); - - B->b[0] = RCONST(657241292721.0)/RCONST(9909463049845.0); - B->b[1] = RCONST(657241292721.0)/RCONST(9909463049845.0); - B->b[2] = RCONST(1290772910128.0)/RCONST(5804808736437.0); - B->b[3] = RCONST(1103522341516.0)/RCONST(2197678446715.0); - B->b[4] = -RCONST(3.0)/RCONST(28.0); - B->b[5] = RCONST(1.0)/RCONST(4.0); - - B->d[0] = -RCONST(71925161075.0)/RCONST(3900939759889.0); - B->d[1] = -RCONST(71925161075.0)/RCONST(3900939759889.0); - B->d[2] = RCONST(2973346383745.0)/RCONST(8160025745289.0); - B->d[3] = RCONST(3972464885073.0)/RCONST(7694851252693.0); - B->d[4] = -RCONST(263368882881.0)/RCONST(4213126269514.0); - B->d[5] = RCONST(3295468053953.0)/RCONST(15064441987965.0); - - B->A[1][1] = RCONST(0.25); - B->A[2][1] = -RCONST(1356991263433.0)/RCONST(26208533697614.0); - B->A[2][2] = RCONST(0.25); - B->A[3][1] = -RCONST(1778551891173.0)/RCONST(14697912885533.0); - B->A[3][2] = RCONST(7325038566068.0)/RCONST(12797657924939.0); - B->A[3][3] = RCONST(0.25); - B->A[4][1] = -RCONST(24076725932807.0)/RCONST(39344244018142.0); - B->A[4][2] = RCONST(9344023789330.0)/RCONST(6876721947151.0); - B->A[4][3] = RCONST(11302510524611.0)/RCONST(18374767399840.0); - B->A[4][4] = RCONST(0.25); + B->c[1] = SUN_RCONST(0.5); + B->c[2] = (SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(4.0); + B->c[3] = SUN_RCONST(2012122486997.0)/SUN_RCONST(3467029789466.0); + B->c[4] = SUN_RCONST(1.0); + B->c[5] = SUN_RCONST(1.0); + + B->b[0] = SUN_RCONST(657241292721.0)/SUN_RCONST(9909463049845.0); + B->b[1] = SUN_RCONST(657241292721.0)/SUN_RCONST(9909463049845.0); + B->b[2] = SUN_RCONST(1290772910128.0)/SUN_RCONST(5804808736437.0); + B->b[3] = SUN_RCONST(1103522341516.0)/SUN_RCONST(2197678446715.0); + B->b[4] = -SUN_RCONST(3.0)/SUN_RCONST(28.0); + B->b[5] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + + B->d[0] = -SUN_RCONST(71925161075.0)/SUN_RCONST(3900939759889.0); + B->d[1] = -SUN_RCONST(71925161075.0)/SUN_RCONST(3900939759889.0); + B->d[2] = SUN_RCONST(2973346383745.0)/SUN_RCONST(8160025745289.0); + B->d[3] = SUN_RCONST(3972464885073.0)/SUN_RCONST(7694851252693.0); + B->d[4] = -SUN_RCONST(263368882881.0)/SUN_RCONST(4213126269514.0); + B->d[5] = SUN_RCONST(3295468053953.0)/SUN_RCONST(15064441987965.0); + + B->A[1][1] = SUN_RCONST(0.25); + B->A[2][1] = -SUN_RCONST(1356991263433.0)/SUN_RCONST(26208533697614.0); + B->A[2][2] = SUN_RCONST(0.25); + B->A[3][1] = -SUN_RCONST(1778551891173.0)/SUN_RCONST(14697912885533.0); + B->A[3][2] = SUN_RCONST(7325038566068.0)/SUN_RCONST(12797657924939.0); + B->A[3][3] = SUN_RCONST(0.25); + B->A[4][1] = -SUN_RCONST(24076725932807.0)/SUN_RCONST(39344244018142.0); + B->A[4][2] = SUN_RCONST(9344023789330.0)/SUN_RCONST(6876721947151.0); + B->A[4][3] = SUN_RCONST(11302510524611.0)/SUN_RCONST(18374767399840.0); + B->A[4][4] = SUN_RCONST(0.25); B->A[5][0] = B->b[0]; B->A[5][1] = B->b[1]; B->A[5][2] = B->b[2]; @@ -866,39 +866,39 @@ ARK_BUTCHER_TABLE(ARKODE_QESDIRK436L2SA_6_3_4, { /* QESDIRK4(3)6L[2]SA (A,L stab B->q = 4; B->p = 3; - B->c[1] = RCONST(16.0)/RCONST(75.0); - B->c[2] = RCONST(8.0)*(RCONST(2.0)-SUNRsqrt(RCONST(2.0)))/RCONST(25.0); - B->c[3] = RCONST(1298154247449.0)/RCONST(2478647287318.0); - B->c[4] = RCONST(11563539331134.0)/RCONST(11078645848867.0); - B->c[5] = RCONST(1.0); - - B->b[0] = RCONST(540088238697.0)/RCONST(4693226184761.0); - B->b[2] = RCONST(1094762490994.0)/RCONST(7880993776667.0); - B->b[3] = RCONST(4016564763003.0)/RCONST(7185357966874.0); - B->b[4] = -RCONST(411820258827.0)/RCONST(3096789411938.0); - B->b[5] = RCONST(8.0)/RCONST(25.0); - - B->d[0] = -RCONST(374484326677.0)/RCONST(8442488809460.0); - B->d[1] = -RCONST(41125091159938.0)/RCONST(25963879779069.0); - B->d[2] = RCONST(24025088270494.0)/RCONST(12927594097169.0); - B->d[3] = RCONST(5193917461301.0)/RCONST(8985383982321.0); - B->d[4] = -RCONST(1843122001830.0)/RCONST(16078617943063.0); - B->d[5] = RCONST(2439572212972.0)/RCONST(7960792257433.0); - - B->A[1][0] = RCONST(8.0)/RCONST(75.0); - B->A[1][1] = RCONST(8.0)/RCONST(75.0); - B->A[2][0] = RCONST(605497861978.0)/RCONST(9136257189845.0); - B->A[2][1] = -RCONST(2127848798551.0)/RCONST(10702252975294.0); - B->A[2][2] = RCONST(8.0)/RCONST(25.0); - B->A[3][0] = -RCONST(3005106686955.0)/RCONST(6150333508049.0); - B->A[3][1] = -RCONST(68662668193799.0)/RCONST(11091168490809.0); - B->A[3][2] = RCONST(80786898110822.0)/RCONST(11737001380747.0); - B->A[3][3] = RCONST(8.0)/RCONST(25.0); - B->A[4][0] = -RCONST(26162805558846.0)/RCONST(8363194173203.0); - B->A[4][1] = -RCONST(291987295964487.0)/RCONST(9066074244437.0); - B->A[4][2] = RCONST(384682892278670.0)/RCONST(10959450712301.0); - B->A[4][3] = RCONST(13555548451102.0)/RCONST(14148104892819.0); - B->A[4][4] = RCONST(8.0)/RCONST(25.0); + B->c[1] = SUN_RCONST(16.0)/SUN_RCONST(75.0); + B->c[2] = SUN_RCONST(8.0)*(SUN_RCONST(2.0)-SUNRsqrt(SUN_RCONST(2.0)))/SUN_RCONST(25.0); + B->c[3] = SUN_RCONST(1298154247449.0)/SUN_RCONST(2478647287318.0); + B->c[4] = SUN_RCONST(11563539331134.0)/SUN_RCONST(11078645848867.0); + B->c[5] = SUN_RCONST(1.0); + + B->b[0] = SUN_RCONST(540088238697.0)/SUN_RCONST(4693226184761.0); + B->b[2] = SUN_RCONST(1094762490994.0)/SUN_RCONST(7880993776667.0); + B->b[3] = SUN_RCONST(4016564763003.0)/SUN_RCONST(7185357966874.0); + B->b[4] = -SUN_RCONST(411820258827.0)/SUN_RCONST(3096789411938.0); + B->b[5] = SUN_RCONST(8.0)/SUN_RCONST(25.0); + + B->d[0] = -SUN_RCONST(374484326677.0)/SUN_RCONST(8442488809460.0); + B->d[1] = -SUN_RCONST(41125091159938.0)/SUN_RCONST(25963879779069.0); + B->d[2] = SUN_RCONST(24025088270494.0)/SUN_RCONST(12927594097169.0); + B->d[3] = SUN_RCONST(5193917461301.0)/SUN_RCONST(8985383982321.0); + B->d[4] = -SUN_RCONST(1843122001830.0)/SUN_RCONST(16078617943063.0); + B->d[5] = SUN_RCONST(2439572212972.0)/SUN_RCONST(7960792257433.0); + + B->A[1][0] = SUN_RCONST(8.0)/SUN_RCONST(75.0); + B->A[1][1] = SUN_RCONST(8.0)/SUN_RCONST(75.0); + B->A[2][0] = SUN_RCONST(605497861978.0)/SUN_RCONST(9136257189845.0); + B->A[2][1] = -SUN_RCONST(2127848798551.0)/SUN_RCONST(10702252975294.0); + B->A[2][2] = SUN_RCONST(8.0)/SUN_RCONST(25.0); + B->A[3][0] = -SUN_RCONST(3005106686955.0)/SUN_RCONST(6150333508049.0); + B->A[3][1] = -SUN_RCONST(68662668193799.0)/SUN_RCONST(11091168490809.0); + B->A[3][2] = SUN_RCONST(80786898110822.0)/SUN_RCONST(11737001380747.0); + B->A[3][3] = SUN_RCONST(8.0)/SUN_RCONST(25.0); + B->A[4][0] = -SUN_RCONST(26162805558846.0)/SUN_RCONST(8363194173203.0); + B->A[4][1] = -SUN_RCONST(291987295964487.0)/SUN_RCONST(9066074244437.0); + B->A[4][2] = SUN_RCONST(384682892278670.0)/SUN_RCONST(10959450712301.0); + B->A[4][3] = SUN_RCONST(13555548451102.0)/SUN_RCONST(14148104892819.0); + B->A[4][4] = SUN_RCONST(8.0)/SUN_RCONST(25.0); B->A[5][0] = B->b[0]; B->A[5][1] = B->b[1]; B->A[5][2] = B->b[2]; @@ -913,44 +913,44 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK437L2SA_7_3_4, { /* ESDIRK4(3)7L[2]SA (A,L stable B->q = 4; B->p = 3; - B->c[1] = RCONST(1.0)/RCONST(4.0); - B->c[2] = RCONST(1200237871921.0)/RCONST(16391473681546.0); - B->c[3] = RCONST(1.0)/RCONST(2.0); - B->c[4] = RCONST(395.0)/RCONST(567.0); - B->c[5] = RCONST(89.0)/RCONST(126.0); - B->c[6] = RCONST(1.0); - - B->b[1] = -RCONST(5649241495537.0)/RCONST(14093099002237.0); - B->b[2] = RCONST(5718691255176.0)/RCONST(6089204655961.0); - B->b[3] = RCONST(2199600963556.0)/RCONST(4241893152925.0); - B->b[4] = RCONST(8860614275765.0)/RCONST(11425531467341.0); - B->b[5] = -RCONST(3696041814078.0)/RCONST(6641566663007.0); - B->b[6] = RCONST(1.0)/RCONST(8.0); - B->b[0] = RCONST(1.0) - B->b[1] - B->b[2] - B->b[3] - B->b[4] - B->b[5] - B->b[6]; - - B->d[1] = -RCONST(1517409284625.0)/RCONST(6267517876163.0); - B->d[2] = RCONST(8291371032348.0)/RCONST(12587291883523.0); - B->d[3] = RCONST(5328310281212.0)/RCONST(10646448185159.0); - B->d[4] = RCONST(5405006853541.0)/RCONST(7104492075037.0); - B->d[5] = -RCONST(4254786582061.0)/RCONST(7445269677723.0); - B->d[6] = RCONST(19.0)/RCONST(140.0); - B->d[0] = RCONST(1.0) - B->d[1] - B->d[2] - B->d[3] - B->d[4] - B->d[5] - B->d[6]; - - B->A[1][1] = RCONST(1.0)/RCONST(8.0); - B->A[2][1] = -RCONST(39188347878.0)/RCONST(1513744654945.0); - B->A[2][2] = RCONST(1.0)/RCONST(8.0); - B->A[3][1] = RCONST(1748874742213.0)/RCONST(5168247530883.0); - B->A[3][2] = -RCONST(1748874742213.0)/RCONST(5795261096931.0); - B->A[3][3] = RCONST(1.0)/RCONST(8.0); - B->A[4][1] = -RCONST(6429340993097.0)/RCONST(17896796106705.0); - B->A[4][2] = RCONST(9711656375562.0)/RCONST(10370074603625.0); - B->A[4][3] = RCONST(1137589605079.0)/RCONST(3216875020685.0); - B->A[4][4] = RCONST(1.0)/RCONST(8.0); - B->A[5][1] = RCONST(405169606099.0)/RCONST(1734380148729.0); - B->A[5][2] = -RCONST(264468840649.0)/RCONST(6105657584947.0); - B->A[5][3] = RCONST(118647369377.0)/RCONST(6233854714037.0); - B->A[5][4] = RCONST(683008737625.0)/RCONST(4934655825458.0); - B->A[5][5] = RCONST(1.0)/RCONST(8.0); + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->c[2] = SUN_RCONST(1200237871921.0)/SUN_RCONST(16391473681546.0); + B->c[3] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->c[4] = SUN_RCONST(395.0)/SUN_RCONST(567.0); + B->c[5] = SUN_RCONST(89.0)/SUN_RCONST(126.0); + B->c[6] = SUN_RCONST(1.0); + + B->b[1] = -SUN_RCONST(5649241495537.0)/SUN_RCONST(14093099002237.0); + B->b[2] = SUN_RCONST(5718691255176.0)/SUN_RCONST(6089204655961.0); + B->b[3] = SUN_RCONST(2199600963556.0)/SUN_RCONST(4241893152925.0); + B->b[4] = SUN_RCONST(8860614275765.0)/SUN_RCONST(11425531467341.0); + B->b[5] = -SUN_RCONST(3696041814078.0)/SUN_RCONST(6641566663007.0); + B->b[6] = SUN_RCONST(1.0)/SUN_RCONST(8.0); + B->b[0] = SUN_RCONST(1.0) - B->b[1] - B->b[2] - B->b[3] - B->b[4] - B->b[5] - B->b[6]; + + B->d[1] = -SUN_RCONST(1517409284625.0)/SUN_RCONST(6267517876163.0); + B->d[2] = SUN_RCONST(8291371032348.0)/SUN_RCONST(12587291883523.0); + B->d[3] = SUN_RCONST(5328310281212.0)/SUN_RCONST(10646448185159.0); + B->d[4] = SUN_RCONST(5405006853541.0)/SUN_RCONST(7104492075037.0); + B->d[5] = -SUN_RCONST(4254786582061.0)/SUN_RCONST(7445269677723.0); + B->d[6] = SUN_RCONST(19.0)/SUN_RCONST(140.0); + B->d[0] = SUN_RCONST(1.0) - B->d[1] - B->d[2] - B->d[3] - B->d[4] - B->d[5] - B->d[6]; + + B->A[1][1] = SUN_RCONST(1.0)/SUN_RCONST(8.0); + B->A[2][1] = -SUN_RCONST(39188347878.0)/SUN_RCONST(1513744654945.0); + B->A[2][2] = SUN_RCONST(1.0)/SUN_RCONST(8.0); + B->A[3][1] = SUN_RCONST(1748874742213.0)/SUN_RCONST(5168247530883.0); + B->A[3][2] = -SUN_RCONST(1748874742213.0)/SUN_RCONST(5795261096931.0); + B->A[3][3] = SUN_RCONST(1.0)/SUN_RCONST(8.0); + B->A[4][1] = -SUN_RCONST(6429340993097.0)/SUN_RCONST(17896796106705.0); + B->A[4][2] = SUN_RCONST(9711656375562.0)/SUN_RCONST(10370074603625.0); + B->A[4][3] = SUN_RCONST(1137589605079.0)/SUN_RCONST(3216875020685.0); + B->A[4][4] = SUN_RCONST(1.0)/SUN_RCONST(8.0); + B->A[5][1] = SUN_RCONST(405169606099.0)/SUN_RCONST(1734380148729.0); + B->A[5][2] = -SUN_RCONST(264468840649.0)/SUN_RCONST(6105657584947.0); + B->A[5][3] = SUN_RCONST(118647369377.0)/SUN_RCONST(6233854714037.0); + B->A[5][4] = SUN_RCONST(683008737625.0)/SUN_RCONST(4934655825458.0); + B->A[5][5] = SUN_RCONST(1.0)/SUN_RCONST(8.0); B->A[6][0] = B->b[0]; B->A[6][1] = B->b[1]; B->A[6][2] = B->b[2]; @@ -971,44 +971,44 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK547L2SA_7_4_5, { /* ESDIRK5(4)7L[2]SA (A,L stable B->q = 5; B->p = 4; - B->c[1] = RCONST(46.0)/RCONST(125.0); - B->c[2] = RCONST(1518047795759.0)/RCONST(14084074382095.0); - B->c[3] = RCONST(13.0)/RCONST(25.0); - B->c[4] = RCONST(5906118540659.0)/RCONST(9042400211275.0); - B->c[5] = RCONST(26.0)/RCONST(25.0); - B->c[6] = RCONST(1.0); - - B->b[1] = -RCONST(1319096626979.0)/RCONST(17356965168099.0); - B->b[2] = RCONST(4356877330928.0)/RCONST(10268933656267.0); - B->b[3] = RCONST(922991294344.0)/RCONST(3350617878647.0); - B->b[4] = RCONST(4729382008034.0)/RCONST(14755765856909.0); - B->b[5] = -RCONST(308199069217.0)/RCONST(5897303561678.0); - B->b[6] = RCONST(23.0)/RCONST(125.0); - B->b[0] = RCONST(1.0) - B->b[1] - B->b[2] - B->b[3] - B->b[4] - B->b[5] - B->b[6]; - - B->d[1] = -RCONST(12068858301481.0)/RCONST(111697653055985.0); - B->d[2] = RCONST(30204157393951.0)/RCONST(62440428688139.0); - B->d[3] = RCONST(26156819792768.0)/RCONST(110856972047457.0); - B->d[4] = RCONST(33531609809941.0)/RCONST(89326307438822.0); - B->d[5] = -RCONST(18686091006953.0)/RCONST(578397443530870.0); - B->d[6] = RCONST(10582397456777.0)/RCONST(69011126173064.0); - B->d[0] = RCONST(1.0) - B->d[1] - B->d[2] - B->d[3] - B->d[4] - B->d[5] - B->d[6]; - - B->A[1][1] = RCONST(23.0)/RCONST(125.0); - B->A[2][1] = -RCONST(121529886477.0)/RCONST(3189120653983.0); - B->A[2][2] = RCONST(23.0)/RCONST(125.0); - B->A[3][1] = RCONST(186345625210.0)/RCONST(8596203768457.0); - B->A[3][2] = RCONST(3681435451073.0)/RCONST(12579882114497.0); - B->A[3][3] = RCONST(23.0)/RCONST(125.0); - B->A[4][1] = -RCONST(9898129553915.0)/RCONST(11630542248213.0); - B->A[4][2] = RCONST(19565727496993.0)/RCONST(11159348038501.0); - B->A[4][3] = RCONST(2073446517052.0)/RCONST(4961027473423.0); - B->A[4][4] = RCONST(23.0)/RCONST(125.0); - B->A[5][1] = -RCONST(39752543191591.0)/RCONST(7894275939720.0); - B->A[5][2] = RCONST(52228808998390.0)/RCONST(5821762529307.0); - B->A[5][3] = RCONST(2756378382725.0)/RCONST(8748785577174.0); - B->A[5][4] = RCONST(17322065038796.0)/RCONST(10556643942083.0); - B->A[5][5] = RCONST(23.0)/RCONST(125.0); + B->c[1] = SUN_RCONST(46.0)/SUN_RCONST(125.0); + B->c[2] = SUN_RCONST(1518047795759.0)/SUN_RCONST(14084074382095.0); + B->c[3] = SUN_RCONST(13.0)/SUN_RCONST(25.0); + B->c[4] = SUN_RCONST(5906118540659.0)/SUN_RCONST(9042400211275.0); + B->c[5] = SUN_RCONST(26.0)/SUN_RCONST(25.0); + B->c[6] = SUN_RCONST(1.0); + + B->b[1] = -SUN_RCONST(1319096626979.0)/SUN_RCONST(17356965168099.0); + B->b[2] = SUN_RCONST(4356877330928.0)/SUN_RCONST(10268933656267.0); + B->b[3] = SUN_RCONST(922991294344.0)/SUN_RCONST(3350617878647.0); + B->b[4] = SUN_RCONST(4729382008034.0)/SUN_RCONST(14755765856909.0); + B->b[5] = -SUN_RCONST(308199069217.0)/SUN_RCONST(5897303561678.0); + B->b[6] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->b[0] = SUN_RCONST(1.0) - B->b[1] - B->b[2] - B->b[3] - B->b[4] - B->b[5] - B->b[6]; + + B->d[1] = -SUN_RCONST(12068858301481.0)/SUN_RCONST(111697653055985.0); + B->d[2] = SUN_RCONST(30204157393951.0)/SUN_RCONST(62440428688139.0); + B->d[3] = SUN_RCONST(26156819792768.0)/SUN_RCONST(110856972047457.0); + B->d[4] = SUN_RCONST(33531609809941.0)/SUN_RCONST(89326307438822.0); + B->d[5] = -SUN_RCONST(18686091006953.0)/SUN_RCONST(578397443530870.0); + B->d[6] = SUN_RCONST(10582397456777.0)/SUN_RCONST(69011126173064.0); + B->d[0] = SUN_RCONST(1.0) - B->d[1] - B->d[2] - B->d[3] - B->d[4] - B->d[5] - B->d[6]; + + B->A[1][1] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[2][1] = -SUN_RCONST(121529886477.0)/SUN_RCONST(3189120653983.0); + B->A[2][2] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[3][1] = SUN_RCONST(186345625210.0)/SUN_RCONST(8596203768457.0); + B->A[3][2] = SUN_RCONST(3681435451073.0)/SUN_RCONST(12579882114497.0); + B->A[3][3] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[4][1] = -SUN_RCONST(9898129553915.0)/SUN_RCONST(11630542248213.0); + B->A[4][2] = SUN_RCONST(19565727496993.0)/SUN_RCONST(11159348038501.0); + B->A[4][3] = SUN_RCONST(2073446517052.0)/SUN_RCONST(4961027473423.0); + B->A[4][4] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[5][1] = -SUN_RCONST(39752543191591.0)/SUN_RCONST(7894275939720.0); + B->A[5][2] = SUN_RCONST(52228808998390.0)/SUN_RCONST(5821762529307.0); + B->A[5][3] = SUN_RCONST(2756378382725.0)/SUN_RCONST(8748785577174.0); + B->A[5][4] = SUN_RCONST(17322065038796.0)/SUN_RCONST(10556643942083.0); + B->A[5][5] = SUN_RCONST(23.0)/SUN_RCONST(125.0); B->A[6][0] = B->b[0]; B->A[6][1] = B->b[1]; B->A[6][2] = B->b[2]; @@ -1029,44 +1029,44 @@ ARK_BUTCHER_TABLE(ARKODE_ESDIRK547L2SA2_7_4_5, { /* ESDIRK5(4)7L[2]SA2 (A,L stab B->q = 5; B->p = 4; - B->c[1] = RCONST(46.0)/RCONST(125.0); - B->c[2] = RCONST(7121331996143.0)/RCONST(11335814405378.0); - B->c[3] = RCONST(49.0)/RCONST(353.0); - B->c[4] = RCONST(3706679970760.0)/RCONST(5295570149437.0); - B->c[5] = RCONST(347.0)/RCONST(382.0); - B->c[6] = RCONST(1.0); - - B->b[1] = -RCONST(188593204321.0)/RCONST(4778616380481.0); - B->b[2] = RCONST(2809310203510.0)/RCONST(10304234040467.0); - B->b[3] = RCONST(1021729336898.0)/RCONST(2364210264653.0); - B->b[4] = RCONST(870612361811.0)/RCONST(2470410392208.0); - B->b[5] = -RCONST(1307970675534.0)/RCONST(8059683598661.0); - B->b[6] = RCONST(23.0)/RCONST(125.0); - B->b[0] = RCONST(1.0) - B->b[1] - B->b[2] - B->b[3] - B->b[4] - B->b[5] - B->b[6]; - - B->d[1] = -RCONST(582099335757.0)/RCONST(7214068459310.0); - B->d[2] = RCONST(615023338567.0)/RCONST(3362626566945.0); - B->d[3] = RCONST(3192122436311.0)/RCONST(6174152374399.0); - B->d[4] = RCONST(6156034052041.0)/RCONST(14430468657929.0); - B->d[5] = -RCONST(1011318518279.0)/RCONST(9693750372484.0); - B->d[6] = RCONST(1914490192573.0)/RCONST(13754262428401.0); - B->d[0] = RCONST(1.0) - B->d[1] - B->d[2] - B->d[3] - B->d[4] - B->d[5] - B->d[6]; - - B->A[1][1] = RCONST(23.0)/RCONST(125.0); - B->A[2][1] = RCONST(791020047304.0)/RCONST(3561426431547.0); - B->A[2][2] = RCONST(23.0)/RCONST(125.0); - B->A[3][1] = -RCONST(158159076358.0)/RCONST(11257294102345.0); - B->A[3][2] = -RCONST(85517644447.0)/RCONST(5003708988389.0); - B->A[3][3] = RCONST(23.0)/RCONST(125.0); - B->A[4][1] = -RCONST(1653327111580.0)/RCONST(4048416487981.0); - B->A[4][2] = RCONST(1514767744496.0)/RCONST(9099671765375.0); - B->A[4][3] = RCONST(14283835447591.0)/RCONST(12247432691556.0); - B->A[4][4] = RCONST(23.0)/RCONST(125.0); - B->A[5][1] = -RCONST(4540011970825.0)/RCONST(8418487046959.0); - B->A[5][2] = -RCONST(1790937573418.0)/RCONST(7393406387169.0); - B->A[5][3] = RCONST(10819093665085.0)/RCONST(7266595846747.0); - B->A[5][4] = RCONST(4109463131231.0)/RCONST(7386972500302.0); - B->A[5][5] = RCONST(23.0)/RCONST(125.0); + B->c[1] = SUN_RCONST(46.0)/SUN_RCONST(125.0); + B->c[2] = SUN_RCONST(7121331996143.0)/SUN_RCONST(11335814405378.0); + B->c[3] = SUN_RCONST(49.0)/SUN_RCONST(353.0); + B->c[4] = SUN_RCONST(3706679970760.0)/SUN_RCONST(5295570149437.0); + B->c[5] = SUN_RCONST(347.0)/SUN_RCONST(382.0); + B->c[6] = SUN_RCONST(1.0); + + B->b[1] = -SUN_RCONST(188593204321.0)/SUN_RCONST(4778616380481.0); + B->b[2] = SUN_RCONST(2809310203510.0)/SUN_RCONST(10304234040467.0); + B->b[3] = SUN_RCONST(1021729336898.0)/SUN_RCONST(2364210264653.0); + B->b[4] = SUN_RCONST(870612361811.0)/SUN_RCONST(2470410392208.0); + B->b[5] = -SUN_RCONST(1307970675534.0)/SUN_RCONST(8059683598661.0); + B->b[6] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->b[0] = SUN_RCONST(1.0) - B->b[1] - B->b[2] - B->b[3] - B->b[4] - B->b[5] - B->b[6]; + + B->d[1] = -SUN_RCONST(582099335757.0)/SUN_RCONST(7214068459310.0); + B->d[2] = SUN_RCONST(615023338567.0)/SUN_RCONST(3362626566945.0); + B->d[3] = SUN_RCONST(3192122436311.0)/SUN_RCONST(6174152374399.0); + B->d[4] = SUN_RCONST(6156034052041.0)/SUN_RCONST(14430468657929.0); + B->d[5] = -SUN_RCONST(1011318518279.0)/SUN_RCONST(9693750372484.0); + B->d[6] = SUN_RCONST(1914490192573.0)/SUN_RCONST(13754262428401.0); + B->d[0] = SUN_RCONST(1.0) - B->d[1] - B->d[2] - B->d[3] - B->d[4] - B->d[5] - B->d[6]; + + B->A[1][1] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[2][1] = SUN_RCONST(791020047304.0)/SUN_RCONST(3561426431547.0); + B->A[2][2] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[3][1] = -SUN_RCONST(158159076358.0)/SUN_RCONST(11257294102345.0); + B->A[3][2] = -SUN_RCONST(85517644447.0)/SUN_RCONST(5003708988389.0); + B->A[3][3] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[4][1] = -SUN_RCONST(1653327111580.0)/SUN_RCONST(4048416487981.0); + B->A[4][2] = SUN_RCONST(1514767744496.0)/SUN_RCONST(9099671765375.0); + B->A[4][3] = SUN_RCONST(14283835447591.0)/SUN_RCONST(12247432691556.0); + B->A[4][4] = SUN_RCONST(23.0)/SUN_RCONST(125.0); + B->A[5][1] = -SUN_RCONST(4540011970825.0)/SUN_RCONST(8418487046959.0); + B->A[5][2] = -SUN_RCONST(1790937573418.0)/SUN_RCONST(7393406387169.0); + B->A[5][3] = SUN_RCONST(10819093665085.0)/SUN_RCONST(7266595846747.0); + B->A[5][4] = SUN_RCONST(4109463131231.0)/SUN_RCONST(7386972500302.0); + B->A[5][5] = SUN_RCONST(23.0)/SUN_RCONST(125.0); B->A[6][0] = B->b[0]; B->A[6][1] = B->b[1]; B->A[6][2] = B->b[2]; diff --git a/src/arkode/arkode_butcher_erk.def b/src/arkode/arkode_butcher_erk.def index 5cfb3f2af6..704cca0870 100644 --- a/src/arkode/arkode_butcher_erk.def +++ b/src/arkode/arkode_butcher_erk.def @@ -68,14 +68,14 @@ ARK_BUTCHER_TABLE(ARKODE_HEUN_EULER_2_1_2, { /* Heun-Euler-ERK */ B->q = 2; B->p = 1; - B->A[1][0] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(1.0); - B->b[0] = RCONST(1.0)/RCONST(2.0); - B->b[1] = RCONST(1.0)/RCONST(2.0); + B->b[0] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->b[1] = SUN_RCONST(1.0)/SUN_RCONST(2.0); - B->d[0] = RCONST(1.0); + B->d[0] = SUN_RCONST(1.0); - B->c[1] = RCONST(1.0); + B->c[1] = SUN_RCONST(1.0); return B; }) @@ -118,24 +118,24 @@ ARK_BUTCHER_TABLE(ARKODE_BOGACKI_SHAMPINE_4_2_3, { /* Bogacki-Shampine-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(4, SUNTRUE); B->q = 3; B->p = 2; - B->A[1][0] = RCONST(1.0)/RCONST(2.0); - B->A[2][1] = RCONST(3.0)/RCONST(4.0); - B->A[3][0] = RCONST(2.0)/RCONST(9.0); - B->A[3][1] = RCONST(1.0)/RCONST(3.0); - B->A[3][2] = RCONST(4.0)/RCONST(9.0); - - B->b[0] = RCONST(2.0)/RCONST(9.0); - B->b[1] = RCONST(1.0)/RCONST(3.0); - B->b[2] = RCONST(4.0)/RCONST(9.0); - - B->d[0] = RCONST(7.0)/RCONST(24.0); - B->d[1] = RCONST(1.0)/RCONST(4.0); - B->d[2] = RCONST(1.0)/RCONST(3.0); - B->d[3] = RCONST(1.0)/RCONST(8.0); - - B->c[1] = RCONST(1.0)/RCONST(2.0); - B->c[2] = RCONST(3.0)/RCONST(4.0); - B->c[3] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->A[2][1] = SUN_RCONST(3.0)/SUN_RCONST(4.0); + B->A[3][0] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->A[3][1] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->A[3][2] = SUN_RCONST(4.0)/SUN_RCONST(9.0); + + B->b[0] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + B->b[1] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->b[2] = SUN_RCONST(4.0)/SUN_RCONST(9.0); + + B->d[0] = SUN_RCONST(7.0)/SUN_RCONST(24.0); + B->d[1] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->d[2] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->d[3] = SUN_RCONST(1.0)/SUN_RCONST(8.0); + + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(4.0); + B->c[3] = SUN_RCONST(1.0); return B; }) @@ -143,26 +143,26 @@ ARK_BUTCHER_TABLE(ARKODE_ARK324L2SA_ERK_4_2_3, { /* ARK3(2)4L[2]SA-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(4, SUNTRUE); B->q = 3; B->p = 2; - B->A[1][0] = RCONST(1767732205903.0)/RCONST(2027836641118.0); - B->A[2][0] = RCONST(5535828885825.0)/RCONST(10492691773637.0); - B->A[2][1] = RCONST(788022342437.0)/RCONST(10882634858940.0); - B->A[3][0] = RCONST(6485989280629.0)/RCONST(16251701735622.0); - B->A[3][1] = RCONST(-4246266847089.0)/RCONST(9704473918619.0); - B->A[3][2] = RCONST(10755448449292.0)/RCONST(10357097424841.0); - - B->b[0] = RCONST(1471266399579.0)/RCONST(7840856788654.0); - B->b[1] = RCONST(-4482444167858.0)/RCONST(7529755066697.0); - B->b[2] = RCONST(11266239266428.0)/RCONST(11593286722821.0); - B->b[3] = RCONST(1767732205903.0)/RCONST(4055673282236.0); - - B->d[0] = RCONST(2756255671327.0)/RCONST(12835298489170.0); - B->d[1] = RCONST(-10771552573575.0)/RCONST(22201958757719.0); - B->d[2] = RCONST(9247589265047.0)/RCONST(10645013368117.0); - B->d[3] = RCONST(2193209047091.0)/RCONST(5459859503100.0); - - B->c[1] = RCONST(1767732205903.0)/RCONST(2027836641118.0); - B->c[2] = RCONST(3.0)/RCONST(5.0); - B->c[3] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(1767732205903.0)/SUN_RCONST(2027836641118.0); + B->A[2][0] = SUN_RCONST(5535828885825.0)/SUN_RCONST(10492691773637.0); + B->A[2][1] = SUN_RCONST(788022342437.0)/SUN_RCONST(10882634858940.0); + B->A[3][0] = SUN_RCONST(6485989280629.0)/SUN_RCONST(16251701735622.0); + B->A[3][1] = SUN_RCONST(-4246266847089.0)/SUN_RCONST(9704473918619.0); + B->A[3][2] = SUN_RCONST(10755448449292.0)/SUN_RCONST(10357097424841.0); + + B->b[0] = SUN_RCONST(1471266399579.0)/SUN_RCONST(7840856788654.0); + B->b[1] = SUN_RCONST(-4482444167858.0)/SUN_RCONST(7529755066697.0); + B->b[2] = SUN_RCONST(11266239266428.0)/SUN_RCONST(11593286722821.0); + B->b[3] = SUN_RCONST(1767732205903.0)/SUN_RCONST(4055673282236.0); + + B->d[0] = SUN_RCONST(2756255671327.0)/SUN_RCONST(12835298489170.0); + B->d[1] = SUN_RCONST(-10771552573575.0)/SUN_RCONST(22201958757719.0); + B->d[2] = SUN_RCONST(9247589265047.0)/SUN_RCONST(10645013368117.0); + B->d[3] = SUN_RCONST(2193209047091.0)/SUN_RCONST(5459859503100.0); + + B->c[1] = SUN_RCONST(1767732205903.0)/SUN_RCONST(2027836641118.0); + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + B->c[3] = SUN_RCONST(1.0); return B; }) @@ -170,32 +170,32 @@ ARK_BUTCHER_TABLE(ARKODE_SOFRONIOU_SPALETTA_5_3_4, { /* Sofroniou-Spaletta-ERK * ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = RCONST(2.0) / RCONST(5.0); - B->A[2][0] = RCONST(-3.0) / RCONST(20.0); - B->A[2][1] = RCONST(3.0) / RCONST(4.0); - B->A[3][0] = RCONST(19.0)/RCONST(44.0); - B->A[3][1] = RCONST(-15.0)/RCONST(44.0); - B->A[3][2] = RCONST(10.0)/RCONST(11.0); - B->A[4][0] = RCONST(11.0)/RCONST(72.0); - B->A[4][1] = RCONST(25.0)/RCONST(72.0); - B->A[4][2] = RCONST(25.0)/RCONST(72.0); - B->A[4][3] = RCONST(11.0)/RCONST(72.0); - - B->b[0] = RCONST(11.0)/RCONST(72.0); - B->b[1] = RCONST(25.0)/RCONST(72.0); - B->b[2] = RCONST(25.0)/RCONST(72.0); - B->b[3] = RCONST(11.0)/RCONST(72.0); - - B->d[0] = RCONST(1251515.0)/RCONST(8970912.0); - B->d[1] = RCONST(3710105.0)/RCONST(8970912.0); - B->d[2] = RCONST(2519695.0)/RCONST(8970912.0); - B->d[3] = RCONST(61105.0)/RCONST(8970912.0); - B->d[4] = RCONST(119041.0)/RCONST(747576.0); - - B->c[1] = RCONST(2.0) / RCONST(5.0); - B->c[2] = RCONST(3.0) / RCONST(5.0); - B->c[3] = RCONST(1.0); - B->c[4] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(2.0) / SUN_RCONST(5.0); + B->A[2][0] = SUN_RCONST(-3.0) / SUN_RCONST(20.0); + B->A[2][1] = SUN_RCONST(3.0) / SUN_RCONST(4.0); + B->A[3][0] = SUN_RCONST(19.0)/SUN_RCONST(44.0); + B->A[3][1] = SUN_RCONST(-15.0)/SUN_RCONST(44.0); + B->A[3][2] = SUN_RCONST(10.0)/SUN_RCONST(11.0); + B->A[4][0] = SUN_RCONST(11.0)/SUN_RCONST(72.0); + B->A[4][1] = SUN_RCONST(25.0)/SUN_RCONST(72.0); + B->A[4][2] = SUN_RCONST(25.0)/SUN_RCONST(72.0); + B->A[4][3] = SUN_RCONST(11.0)/SUN_RCONST(72.0); + + B->b[0] = SUN_RCONST(11.0)/SUN_RCONST(72.0); + B->b[1] = SUN_RCONST(25.0)/SUN_RCONST(72.0); + B->b[2] = SUN_RCONST(25.0)/SUN_RCONST(72.0); + B->b[3] = SUN_RCONST(11.0)/SUN_RCONST(72.0); + + B->d[0] = SUN_RCONST(1251515.0)/SUN_RCONST(8970912.0); + B->d[1] = SUN_RCONST(3710105.0)/SUN_RCONST(8970912.0); + B->d[2] = SUN_RCONST(2519695.0)/SUN_RCONST(8970912.0); + B->d[3] = SUN_RCONST(61105.0)/SUN_RCONST(8970912.0); + B->d[4] = SUN_RCONST(119041.0)/SUN_RCONST(747576.0); + + B->c[1] = SUN_RCONST(2.0) / SUN_RCONST(5.0); + B->c[2] = SUN_RCONST(3.0) / SUN_RCONST(5.0); + B->c[3] = SUN_RCONST(1.0); + B->c[4] = SUN_RCONST(1.0); return B; }) @@ -203,29 +203,29 @@ ARK_BUTCHER_TABLE(ARKODE_ZONNEVELD_5_3_4, { /* Zonneveld */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = RCONST(0.5); - B->A[2][1] = RCONST(0.5); - B->A[3][2] = RCONST(1.0); - B->A[4][0] = RCONST(5.0)/RCONST(32.0); - B->A[4][1] = RCONST(7.0)/RCONST(32.0); - B->A[4][2] = RCONST(13.0)/RCONST(32.0); - B->A[4][3] = RCONST(-1.0)/RCONST(32.0); - - B->b[0] = RCONST(1.0)/RCONST(6.0); - B->b[1] = RCONST(1.0)/RCONST(3.0); - B->b[2] = RCONST(1.0)/RCONST(3.0); - B->b[3] = RCONST(1.0)/RCONST(6.0); - - B->d[0] = RCONST(-1.0)/RCONST(2.0); - B->d[1] = RCONST(7.0)/RCONST(3.0); - B->d[2] = RCONST(7.0)/RCONST(3.0); - B->d[3] = RCONST(13.0)/RCONST(6.0); - B->d[4] = RCONST(-16.0)/RCONST(3.0); - - B->c[1] = RCONST(0.5); - B->c[2] = RCONST(0.5); - B->c[3] = RCONST(1.0); - B->c[4] = RCONST(0.75); + B->A[1][0] = SUN_RCONST(0.5); + B->A[2][1] = SUN_RCONST(0.5); + B->A[3][2] = SUN_RCONST(1.0); + B->A[4][0] = SUN_RCONST(5.0)/SUN_RCONST(32.0); + B->A[4][1] = SUN_RCONST(7.0)/SUN_RCONST(32.0); + B->A[4][2] = SUN_RCONST(13.0)/SUN_RCONST(32.0); + B->A[4][3] = SUN_RCONST(-1.0)/SUN_RCONST(32.0); + + B->b[0] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->b[1] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->b[2] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->b[3] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + + B->d[0] = SUN_RCONST(-1.0)/SUN_RCONST(2.0); + B->d[1] = SUN_RCONST(7.0)/SUN_RCONST(3.0); + B->d[2] = SUN_RCONST(7.0)/SUN_RCONST(3.0); + B->d[3] = SUN_RCONST(13.0)/SUN_RCONST(6.0); + B->d[4] = SUN_RCONST(-16.0)/SUN_RCONST(3.0); + + B->c[1] = SUN_RCONST(0.5); + B->c[2] = SUN_RCONST(0.5); + B->c[3] = SUN_RCONST(1.0); + B->c[4] = SUN_RCONST(0.75); return B; }) @@ -233,39 +233,39 @@ ARK_BUTCHER_TABLE(ARKODE_ARK436L2SA_ERK_6_3_4, { /* ARK4(3)6L[2]SA-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(6, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = RCONST(0.5); - B->A[2][0] = RCONST(13861.0)/RCONST(62500.0); - B->A[2][1] = RCONST(6889.0)/RCONST(62500.0); - B->A[3][0] = RCONST(-116923316275.0)/RCONST(2393684061468.0); - B->A[3][1] = RCONST(-2731218467317.0)/RCONST(15368042101831.0); - B->A[3][2] = RCONST(9408046702089.0)/RCONST(11113171139209.0); - B->A[4][0] = RCONST(-451086348788.0)/RCONST(2902428689909.0); - B->A[4][1] = RCONST(-2682348792572.0)/RCONST(7519795681897.0); - B->A[4][2] = RCONST(12662868775082.0)/RCONST(11960479115383.0); - B->A[4][3] = RCONST(3355817975965.0)/RCONST(11060851509271.0); - B->A[5][0] = RCONST(647845179188.0)/RCONST(3216320057751.0); - B->A[5][1] = RCONST(73281519250.0)/RCONST(8382639484533.0); - B->A[5][2] = RCONST(552539513391.0)/RCONST(3454668386233.0); - B->A[5][3] = RCONST(3354512671639.0)/RCONST(8306763924573.0); - B->A[5][4] = RCONST(4040.0)/RCONST(17871.0); - - B->b[0] = RCONST(82889.0)/RCONST(524892.0); - B->b[2] = RCONST(15625.0)/RCONST(83664.0); - B->b[3] = RCONST(69875.0)/RCONST(102672.0); - B->b[4] = RCONST(-2260.0)/RCONST(8211.0); - B->b[5] = RCONST(1.0)/RCONST(4.0); - - B->d[0] = RCONST(4586570599.0)/RCONST(29645900160.0); - B->d[2] = RCONST(178811875.0)/RCONST(945068544.0); - B->d[3] = RCONST(814220225.0)/RCONST(1159782912.0); - B->d[4] = RCONST(-3700637.0)/RCONST(11593932.0); - B->d[5] = RCONST(61727.0)/RCONST(225920.0); - - B->c[1] = RCONST(1.0)/RCONST(2.0); - B->c[2] = RCONST(83.0)/RCONST(250.0); - B->c[3] = RCONST(31.0)/RCONST(50.0); - B->c[4] = RCONST(17.0)/RCONST(20.0); - B->c[5] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.5); + B->A[2][0] = SUN_RCONST(13861.0)/SUN_RCONST(62500.0); + B->A[2][1] = SUN_RCONST(6889.0)/SUN_RCONST(62500.0); + B->A[3][0] = SUN_RCONST(-116923316275.0)/SUN_RCONST(2393684061468.0); + B->A[3][1] = SUN_RCONST(-2731218467317.0)/SUN_RCONST(15368042101831.0); + B->A[3][2] = SUN_RCONST(9408046702089.0)/SUN_RCONST(11113171139209.0); + B->A[4][0] = SUN_RCONST(-451086348788.0)/SUN_RCONST(2902428689909.0); + B->A[4][1] = SUN_RCONST(-2682348792572.0)/SUN_RCONST(7519795681897.0); + B->A[4][2] = SUN_RCONST(12662868775082.0)/SUN_RCONST(11960479115383.0); + B->A[4][3] = SUN_RCONST(3355817975965.0)/SUN_RCONST(11060851509271.0); + B->A[5][0] = SUN_RCONST(647845179188.0)/SUN_RCONST(3216320057751.0); + B->A[5][1] = SUN_RCONST(73281519250.0)/SUN_RCONST(8382639484533.0); + B->A[5][2] = SUN_RCONST(552539513391.0)/SUN_RCONST(3454668386233.0); + B->A[5][3] = SUN_RCONST(3354512671639.0)/SUN_RCONST(8306763924573.0); + B->A[5][4] = SUN_RCONST(4040.0)/SUN_RCONST(17871.0); + + B->b[0] = SUN_RCONST(82889.0)/SUN_RCONST(524892.0); + B->b[2] = SUN_RCONST(15625.0)/SUN_RCONST(83664.0); + B->b[3] = SUN_RCONST(69875.0)/SUN_RCONST(102672.0); + B->b[4] = SUN_RCONST(-2260.0)/SUN_RCONST(8211.0); + B->b[5] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + + B->d[0] = SUN_RCONST(4586570599.0)/SUN_RCONST(29645900160.0); + B->d[2] = SUN_RCONST(178811875.0)/SUN_RCONST(945068544.0); + B->d[3] = SUN_RCONST(814220225.0)/SUN_RCONST(1159782912.0); + B->d[4] = SUN_RCONST(-3700637.0)/SUN_RCONST(11593932.0); + B->d[5] = SUN_RCONST(61727.0)/SUN_RCONST(225920.0); + + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->c[2] = SUN_RCONST(83.0)/SUN_RCONST(250.0); + B->c[3] = SUN_RCONST(31.0)/SUN_RCONST(50.0); + B->c[4] = SUN_RCONST(17.0)/SUN_RCONST(20.0); + B->c[5] = SUN_RCONST(1.0); return B; }) @@ -273,46 +273,46 @@ ARK_BUTCHER_TABLE(ARKODE_ARK437L2SA_ERK_7_3_4, { /* ARK4(3)7L[2]SA-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(7, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = RCONST(247.0)/RCONST(1000.0); - B->A[2][0] = RCONST(247.0)/RCONST(4000.0); - B->A[2][1] = RCONST(2694949928731.0)/RCONST(7487940209513.0); - B->A[3][0] = RCONST(464650059369.0)/RCONST(8764239774964.0); - B->A[3][1] = RCONST(878889893998.0)/RCONST(2444806327765.0); - B->A[3][2] = RCONST(-952945855348.0)/RCONST(12294611323341.0); - B->A[4][0] = RCONST(476636172619.0)/RCONST(8159180917465.0); - B->A[4][1] = RCONST(-1271469283451.0)/RCONST(7793814740893.0); - B->A[4][2] = RCONST(-859560642026.0)/RCONST(4356155882851.0); - B->A[4][3] = RCONST(1723805262919.0)/RCONST(4571918432560.0); - B->A[5][0] = RCONST(6338158500785.0)/RCONST(11769362343261.0); - B->A[5][1] = RCONST(-4970555480458.0)/RCONST(10924838743837.0); - B->A[5][2] = RCONST(3326578051521.0)/RCONST(2647936831840.0); - B->A[5][3] = RCONST(-880713585975.0)/RCONST(1841400956686.0); - B->A[5][4] = RCONST(-1428733748635.0)/RCONST(8843423958496.0); - B->A[6][0] = RCONST(760814592956.0)/RCONST(3276306540349.0); - B->A[6][1] = RCONST(760814592956.0)/RCONST(3276306540349.0); - B->A[6][2] = RCONST(-47223648122716.0)/RCONST(6934462133451.0); - B->A[6][3] = RCONST(71187472546993.0)/RCONST(9669769126921.0); - B->A[6][4] = RCONST(-13330509492149.0)/RCONST(9695768672337.0); - B->A[6][5] = RCONST(11565764226357.0)/RCONST(8513123442827.0); - - B->b[2] = RCONST(9164257142617.0)/RCONST(17756377923965.0); - B->b[3] = RCONST(-10812980402763.0)/RCONST(74029279521829.0); - B->b[4] = RCONST(1335994250573.0)/RCONST(5691609445217.0); - B->b[5] = RCONST(2273837961795.0)/RCONST(8368240463276.0); - B->b[6] = RCONST(247.0)/RCONST(2000.0); - - B->d[2] = RCONST(4469248916618.0)/RCONST(8635866897933.0); - B->d[3] = RCONST(-621260224600.0)/RCONST(4094290005349.0); - B->d[4] = RCONST(696572312987.0)/RCONST(2942599194819.0); - B->d[5] = RCONST(1532940081127.0)/RCONST(5565293938103.0); - B->d[6] = RCONST(2441.0)/RCONST(20000.0); - - B->c[1] = RCONST(247.0)/RCONST(1000.0); - B->c[2] = RCONST(4276536705230.0)/RCONST(10142255878289.0); - B->c[3] = RCONST(67.0)/RCONST(200.0); - B->c[4] = RCONST(3.0)/RCONST(40.0); - B->c[5] = RCONST(7.0)/RCONST(10.0); - B->c[6] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(247.0)/SUN_RCONST(1000.0); + B->A[2][0] = SUN_RCONST(247.0)/SUN_RCONST(4000.0); + B->A[2][1] = SUN_RCONST(2694949928731.0)/SUN_RCONST(7487940209513.0); + B->A[3][0] = SUN_RCONST(464650059369.0)/SUN_RCONST(8764239774964.0); + B->A[3][1] = SUN_RCONST(878889893998.0)/SUN_RCONST(2444806327765.0); + B->A[3][2] = SUN_RCONST(-952945855348.0)/SUN_RCONST(12294611323341.0); + B->A[4][0] = SUN_RCONST(476636172619.0)/SUN_RCONST(8159180917465.0); + B->A[4][1] = SUN_RCONST(-1271469283451.0)/SUN_RCONST(7793814740893.0); + B->A[4][2] = SUN_RCONST(-859560642026.0)/SUN_RCONST(4356155882851.0); + B->A[4][3] = SUN_RCONST(1723805262919.0)/SUN_RCONST(4571918432560.0); + B->A[5][0] = SUN_RCONST(6338158500785.0)/SUN_RCONST(11769362343261.0); + B->A[5][1] = SUN_RCONST(-4970555480458.0)/SUN_RCONST(10924838743837.0); + B->A[5][2] = SUN_RCONST(3326578051521.0)/SUN_RCONST(2647936831840.0); + B->A[5][3] = SUN_RCONST(-880713585975.0)/SUN_RCONST(1841400956686.0); + B->A[5][4] = SUN_RCONST(-1428733748635.0)/SUN_RCONST(8843423958496.0); + B->A[6][0] = SUN_RCONST(760814592956.0)/SUN_RCONST(3276306540349.0); + B->A[6][1] = SUN_RCONST(760814592956.0)/SUN_RCONST(3276306540349.0); + B->A[6][2] = SUN_RCONST(-47223648122716.0)/SUN_RCONST(6934462133451.0); + B->A[6][3] = SUN_RCONST(71187472546993.0)/SUN_RCONST(9669769126921.0); + B->A[6][4] = SUN_RCONST(-13330509492149.0)/SUN_RCONST(9695768672337.0); + B->A[6][5] = SUN_RCONST(11565764226357.0)/SUN_RCONST(8513123442827.0); + + B->b[2] = SUN_RCONST(9164257142617.0)/SUN_RCONST(17756377923965.0); + B->b[3] = SUN_RCONST(-10812980402763.0)/SUN_RCONST(74029279521829.0); + B->b[4] = SUN_RCONST(1335994250573.0)/SUN_RCONST(5691609445217.0); + B->b[5] = SUN_RCONST(2273837961795.0)/SUN_RCONST(8368240463276.0); + B->b[6] = SUN_RCONST(247.0)/SUN_RCONST(2000.0); + + B->d[2] = SUN_RCONST(4469248916618.0)/SUN_RCONST(8635866897933.0); + B->d[3] = SUN_RCONST(-621260224600.0)/SUN_RCONST(4094290005349.0); + B->d[4] = SUN_RCONST(696572312987.0)/SUN_RCONST(2942599194819.0); + B->d[5] = SUN_RCONST(1532940081127.0)/SUN_RCONST(5565293938103.0); + B->d[6] = SUN_RCONST(2441.0)/SUN_RCONST(20000.0); + + B->c[1] = SUN_RCONST(247.0)/SUN_RCONST(1000.0); + B->c[2] = SUN_RCONST(4276536705230.0)/SUN_RCONST(10142255878289.0); + B->c[3] = SUN_RCONST(67.0)/SUN_RCONST(200.0); + B->c[4] = SUN_RCONST(3.0)/SUN_RCONST(40.0); + B->c[5] = SUN_RCONST(7.0)/SUN_RCONST(10.0); + B->c[6] = SUN_RCONST(1.0); return B; }) @@ -320,36 +320,36 @@ ARK_BUTCHER_TABLE(ARKODE_SAYFY_ABURUB_6_3_4, { /* Sayfy-Aburub-4-3-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(6, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = RCONST(1.0)/RCONST(2.0); - B->A[2][0] = RCONST(-1.0); - B->A[2][1] = RCONST(2.0); - B->A[3][0] = RCONST(1.0)/RCONST(6.0); - B->A[3][1] = RCONST(2.0)/RCONST(3.0); - B->A[3][2] = RCONST(1.0)/RCONST(6.0); - B->A[4][0] = RCONST(0.137); - B->A[4][1] = RCONST(0.226); - B->A[4][2] = RCONST(0.137); - B->A[5][0] = RCONST(0.452); - B->A[5][1] = RCONST(-0.904); - B->A[5][2] = RCONST(-0.548); - B->A[5][4] = RCONST(2.0); - - B->b[0] = RCONST(1.0)/RCONST(6.0); - B->b[1] = RCONST(1.0)/RCONST(3.0); - B->b[2] = RCONST(1.0)/RCONST(12.0); - B->b[3] = RCONST(0.0); - B->b[4] = RCONST(1.0)/RCONST(3.0); - B->b[5] = RCONST(1.0)/RCONST(12.0); - - B->d[0] = RCONST(1.0)/RCONST(6.0); - B->d[1] = RCONST(2.0)/RCONST(3.0); - B->d[2] = RCONST(1.0)/RCONST(6.0); - - B->c[1] = RCONST(1.0)/RCONST(2.0); - B->c[2] = RCONST(1.0); - B->c[3] = RCONST(1.0); - B->c[4] = RCONST(1.0)/RCONST(2.0); - B->c[5] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->A[2][0] = SUN_RCONST(-1.0); + B->A[2][1] = SUN_RCONST(2.0); + B->A[3][0] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->A[3][1] = SUN_RCONST(2.0)/SUN_RCONST(3.0); + B->A[3][2] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->A[4][0] = SUN_RCONST(0.137); + B->A[4][1] = SUN_RCONST(0.226); + B->A[4][2] = SUN_RCONST(0.137); + B->A[5][0] = SUN_RCONST(0.452); + B->A[5][1] = SUN_RCONST(-0.904); + B->A[5][2] = SUN_RCONST(-0.548); + B->A[5][4] = SUN_RCONST(2.0); + + B->b[0] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->b[1] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->b[2] = SUN_RCONST(1.0)/SUN_RCONST(12.0); + B->b[3] = SUN_RCONST(0.0); + B->b[4] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->b[5] = SUN_RCONST(1.0)/SUN_RCONST(12.0); + + B->d[0] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->d[1] = SUN_RCONST(2.0)/SUN_RCONST(3.0); + B->d[2] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->c[2] = SUN_RCONST(1.0); + B->c[3] = SUN_RCONST(1.0); + B->c[4] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->c[5] = SUN_RCONST(1.0); return B; }) @@ -357,38 +357,38 @@ ARK_BUTCHER_TABLE(ARKODE_CASH_KARP_6_4_5, { /* Cash-Karp-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(6, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(1.0)/RCONST(5.0); - B->A[2][0] = RCONST(3.0)/RCONST(40.0); - B->A[2][1] = RCONST(9.0)/RCONST(40.0); - B->A[3][0] = RCONST(3.0)/RCONST(10.0); - B->A[3][1] = RCONST(-9.0)/RCONST(10.0); - B->A[3][2] = RCONST(6.0)/RCONST(5.0); - B->A[4][0] = RCONST(-11.0)/RCONST(54.0); - B->A[4][1] = RCONST(5.0)/RCONST(2.0); - B->A[4][2] = RCONST(-70.0)/RCONST(27.0); - B->A[4][3] = RCONST(35.0)/RCONST(27.0); - B->A[5][0] = RCONST(1631.0)/RCONST(55296.0); - B->A[5][1] = RCONST(175.0)/RCONST(512.0); - B->A[5][2] = RCONST(575.0)/RCONST(13824.0); - B->A[5][3] = RCONST(44275.0)/RCONST(110592.0); - B->A[5][4] = RCONST(253.0)/RCONST(4096.0); - - B->b[0] = RCONST(37.0)/RCONST(378.0); - B->b[2] = RCONST(250.0)/RCONST(621.0); - B->b[3] = RCONST(125.0)/RCONST(594.0); - B->b[5] = RCONST(512.0)/RCONST(1771.0); - - B->d[0] = RCONST(2825.0)/RCONST(27648.0); - B->d[2] = RCONST(18575.0)/RCONST(48384.0); - B->d[3] = RCONST(13525.0)/RCONST(55296.0); - B->d[4] = RCONST(277.0)/RCONST(14336.0); - B->d[5] = RCONST(1.0)/RCONST(4.0); - - B->c[1] = RCONST(1.0)/RCONST(5.0); - B->c[2] = RCONST(3.0)/RCONST(10.0); - B->c[3] = RCONST(3.0)/RCONST(5.0); - B->c[4] = RCONST(1.0); - B->c[5] = RCONST(7.0)/RCONST(8.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(5.0); + B->A[2][0] = SUN_RCONST(3.0)/SUN_RCONST(40.0); + B->A[2][1] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[3][0] = SUN_RCONST(3.0)/SUN_RCONST(10.0); + B->A[3][1] = SUN_RCONST(-9.0)/SUN_RCONST(10.0); + B->A[3][2] = SUN_RCONST(6.0)/SUN_RCONST(5.0); + B->A[4][0] = SUN_RCONST(-11.0)/SUN_RCONST(54.0); + B->A[4][1] = SUN_RCONST(5.0)/SUN_RCONST(2.0); + B->A[4][2] = SUN_RCONST(-70.0)/SUN_RCONST(27.0); + B->A[4][3] = SUN_RCONST(35.0)/SUN_RCONST(27.0); + B->A[5][0] = SUN_RCONST(1631.0)/SUN_RCONST(55296.0); + B->A[5][1] = SUN_RCONST(175.0)/SUN_RCONST(512.0); + B->A[5][2] = SUN_RCONST(575.0)/SUN_RCONST(13824.0); + B->A[5][3] = SUN_RCONST(44275.0)/SUN_RCONST(110592.0); + B->A[5][4] = SUN_RCONST(253.0)/SUN_RCONST(4096.0); + + B->b[0] = SUN_RCONST(37.0)/SUN_RCONST(378.0); + B->b[2] = SUN_RCONST(250.0)/SUN_RCONST(621.0); + B->b[3] = SUN_RCONST(125.0)/SUN_RCONST(594.0); + B->b[5] = SUN_RCONST(512.0)/SUN_RCONST(1771.0); + + B->d[0] = SUN_RCONST(2825.0)/SUN_RCONST(27648.0); + B->d[2] = SUN_RCONST(18575.0)/SUN_RCONST(48384.0); + B->d[3] = SUN_RCONST(13525.0)/SUN_RCONST(55296.0); + B->d[4] = SUN_RCONST(277.0)/SUN_RCONST(14336.0); + B->d[5] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(5.0); + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(10.0); + B->c[3] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + B->c[4] = SUN_RCONST(1.0); + B->c[5] = SUN_RCONST(7.0)/SUN_RCONST(8.0); return B; }) @@ -396,38 +396,38 @@ ARK_BUTCHER_TABLE(ARKODE_FEHLBERG_6_4_5, { /* Fehlberg-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(6, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(1.0)/RCONST(4.0); - B->A[2][0] = RCONST(3.0)/RCONST(32.0); - B->A[2][1] = RCONST(9.0)/RCONST(32.0); - B->A[3][0] = RCONST(1932.0)/RCONST(2197.0); - B->A[3][1] = RCONST(-7200.0)/RCONST(2197.0); - B->A[3][2] = RCONST(7296.0)/RCONST(2197.0); - B->A[4][0] = RCONST(439.0)/RCONST(216.0); - B->A[4][1] = RCONST(-8.0); - B->A[4][2] = RCONST(3680.0)/RCONST(513.0); - B->A[4][3] = RCONST(-845.0)/RCONST(4104.0); - B->A[5][0] = RCONST(-8.0)/RCONST(27.0); - B->A[5][1] = RCONST(2.0); - B->A[5][2] = RCONST(-3544.0)/RCONST(2565.0); - B->A[5][3] = RCONST(1859.0)/RCONST(4104.0); - B->A[5][4] = RCONST(-11.0)/RCONST(40.0); - - B->b[0] = RCONST(16.0)/RCONST(135.0); - B->b[2] = RCONST(6656.0)/RCONST(12825.0); - B->b[3] = RCONST(28561.0)/RCONST(56430.0); - B->b[4] = RCONST(-9.0)/RCONST(50.0); - B->b[5] = RCONST(2.0)/RCONST(55.0); - - B->d[0] = RCONST(25.0)/RCONST(216.0); - B->d[2] = RCONST(1408.0)/RCONST(2565.0); - B->d[3] = RCONST(2197.0)/RCONST(4104.0); - B->d[4] = RCONST(-1.0)/RCONST(5.0); - - B->c[1] = RCONST(1.0)/RCONST(4.0); - B->c[2] = RCONST(3.0)/RCONST(8.0); - B->c[3] = RCONST(12.0)/RCONST(13.0); - B->c[4] = RCONST(1.0); - B->c[5] = RCONST(1.0)/RCONST(2.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[2][0] = SUN_RCONST(3.0)/SUN_RCONST(32.0); + B->A[2][1] = SUN_RCONST(9.0)/SUN_RCONST(32.0); + B->A[3][0] = SUN_RCONST(1932.0)/SUN_RCONST(2197.0); + B->A[3][1] = SUN_RCONST(-7200.0)/SUN_RCONST(2197.0); + B->A[3][2] = SUN_RCONST(7296.0)/SUN_RCONST(2197.0); + B->A[4][0] = SUN_RCONST(439.0)/SUN_RCONST(216.0); + B->A[4][1] = SUN_RCONST(-8.0); + B->A[4][2] = SUN_RCONST(3680.0)/SUN_RCONST(513.0); + B->A[4][3] = SUN_RCONST(-845.0)/SUN_RCONST(4104.0); + B->A[5][0] = SUN_RCONST(-8.0)/SUN_RCONST(27.0); + B->A[5][1] = SUN_RCONST(2.0); + B->A[5][2] = SUN_RCONST(-3544.0)/SUN_RCONST(2565.0); + B->A[5][3] = SUN_RCONST(1859.0)/SUN_RCONST(4104.0); + B->A[5][4] = SUN_RCONST(-11.0)/SUN_RCONST(40.0); + + B->b[0] = SUN_RCONST(16.0)/SUN_RCONST(135.0); + B->b[2] = SUN_RCONST(6656.0)/SUN_RCONST(12825.0); + B->b[3] = SUN_RCONST(28561.0)/SUN_RCONST(56430.0); + B->b[4] = SUN_RCONST(-9.0)/SUN_RCONST(50.0); + B->b[5] = SUN_RCONST(2.0)/SUN_RCONST(55.0); + + B->d[0] = SUN_RCONST(25.0)/SUN_RCONST(216.0); + B->d[2] = SUN_RCONST(1408.0)/SUN_RCONST(2565.0); + B->d[3] = SUN_RCONST(2197.0)/SUN_RCONST(4104.0); + B->d[4] = SUN_RCONST(-1.0)/SUN_RCONST(5.0); + + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(8.0); + B->c[3] = SUN_RCONST(12.0)/SUN_RCONST(13.0); + B->c[4] = SUN_RCONST(1.0); + B->c[5] = SUN_RCONST(1.0)/SUN_RCONST(2.0); return B; }) @@ -435,46 +435,46 @@ ARK_BUTCHER_TABLE(ARKODE_DORMAND_PRINCE_7_4_5, { /* Dormand-Prince-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(7, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(1.0)/RCONST(5.0); - B->A[2][0] = RCONST(3.0)/RCONST(40.0); - B->A[2][1] = RCONST(9.0)/RCONST(40.0); - B->A[3][0] = RCONST(44.0)/RCONST(45.0); - B->A[3][1] = RCONST(-56.0)/RCONST(15.0); - B->A[3][2] = RCONST(32.0)/RCONST(9.0); - B->A[4][0] = RCONST(19372.0)/RCONST(6561.0); - B->A[4][1] = RCONST(-25360.0)/RCONST(2187.0); - B->A[4][2] = RCONST(64448.0)/RCONST(6561.0); - B->A[4][3] = RCONST(-212.0)/RCONST(729.0); - B->A[5][0] = RCONST(9017.0)/RCONST(3168.0); - B->A[5][1] = RCONST(-355.0)/RCONST(33.0); - B->A[5][2] = RCONST(46732.0)/RCONST(5247.0); - B->A[5][3] = RCONST(49.0)/RCONST(176.0); - B->A[5][4] = RCONST(-5103.0)/RCONST(18656.0); - B->A[6][0] = RCONST(35.0)/RCONST(384.0); - B->A[6][2] = RCONST(500.0)/RCONST(1113.0); - B->A[6][3] = RCONST(125.0)/RCONST(192.0); - B->A[6][4] = RCONST(-2187.0)/RCONST(6784.0); - B->A[6][5] = RCONST(11.0)/RCONST(84.0); - - B->b[0] = RCONST(35.0)/RCONST(384.0); - B->b[2] = RCONST(500.0)/RCONST(1113.0); - B->b[3] = RCONST(125.0)/RCONST(192.0); - B->b[4] = RCONST(-2187.0)/RCONST(6784.0); - B->b[5] = RCONST(11.0)/RCONST(84.0); - - B->d[0] = RCONST(5179.0)/RCONST(57600.0); - B->d[2] = RCONST(7571.0)/RCONST(16695.0); - B->d[3] = RCONST(393.0)/RCONST(640.0); - B->d[4] = RCONST(-92097.0)/RCONST(339200.0); - B->d[5] = RCONST(187.0)/RCONST(2100.0); - B->d[6] = RCONST(1.0)/RCONST(40.0); - - B->c[1] = RCONST(1.0)/RCONST(5.0); - B->c[2] = RCONST(3.0)/RCONST(10.0); - B->c[3] = RCONST(4.0)/RCONST(5.0); - B->c[4] = RCONST(8.0)/RCONST(9.0); - B->c[5] = RCONST(1.0); - B->c[6] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(5.0); + B->A[2][0] = SUN_RCONST(3.0)/SUN_RCONST(40.0); + B->A[2][1] = SUN_RCONST(9.0)/SUN_RCONST(40.0); + B->A[3][0] = SUN_RCONST(44.0)/SUN_RCONST(45.0); + B->A[3][1] = SUN_RCONST(-56.0)/SUN_RCONST(15.0); + B->A[3][2] = SUN_RCONST(32.0)/SUN_RCONST(9.0); + B->A[4][0] = SUN_RCONST(19372.0)/SUN_RCONST(6561.0); + B->A[4][1] = SUN_RCONST(-25360.0)/SUN_RCONST(2187.0); + B->A[4][2] = SUN_RCONST(64448.0)/SUN_RCONST(6561.0); + B->A[4][3] = SUN_RCONST(-212.0)/SUN_RCONST(729.0); + B->A[5][0] = SUN_RCONST(9017.0)/SUN_RCONST(3168.0); + B->A[5][1] = SUN_RCONST(-355.0)/SUN_RCONST(33.0); + B->A[5][2] = SUN_RCONST(46732.0)/SUN_RCONST(5247.0); + B->A[5][3] = SUN_RCONST(49.0)/SUN_RCONST(176.0); + B->A[5][4] = SUN_RCONST(-5103.0)/SUN_RCONST(18656.0); + B->A[6][0] = SUN_RCONST(35.0)/SUN_RCONST(384.0); + B->A[6][2] = SUN_RCONST(500.0)/SUN_RCONST(1113.0); + B->A[6][3] = SUN_RCONST(125.0)/SUN_RCONST(192.0); + B->A[6][4] = SUN_RCONST(-2187.0)/SUN_RCONST(6784.0); + B->A[6][5] = SUN_RCONST(11.0)/SUN_RCONST(84.0); + + B->b[0] = SUN_RCONST(35.0)/SUN_RCONST(384.0); + B->b[2] = SUN_RCONST(500.0)/SUN_RCONST(1113.0); + B->b[3] = SUN_RCONST(125.0)/SUN_RCONST(192.0); + B->b[4] = SUN_RCONST(-2187.0)/SUN_RCONST(6784.0); + B->b[5] = SUN_RCONST(11.0)/SUN_RCONST(84.0); + + B->d[0] = SUN_RCONST(5179.0)/SUN_RCONST(57600.0); + B->d[2] = SUN_RCONST(7571.0)/SUN_RCONST(16695.0); + B->d[3] = SUN_RCONST(393.0)/SUN_RCONST(640.0); + B->d[4] = SUN_RCONST(-92097.0)/SUN_RCONST(339200.0); + B->d[5] = SUN_RCONST(187.0)/SUN_RCONST(2100.0); + B->d[6] = SUN_RCONST(1.0)/SUN_RCONST(40.0); + + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(5.0); + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(10.0); + B->c[3] = SUN_RCONST(4.0)/SUN_RCONST(5.0); + B->c[4] = SUN_RCONST(8.0)/SUN_RCONST(9.0); + B->c[5] = SUN_RCONST(1.0); + B->c[6] = SUN_RCONST(1.0); return B; }) @@ -482,51 +482,51 @@ ARK_BUTCHER_TABLE(ARKODE_ARK548L2SA_ERK_8_4_5, { /* ARK5(4)8L[2]SA-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(8, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(41.0)/RCONST(100.0); - B->A[2][0] = RCONST(367902744464.0)/RCONST(2072280473677.0); - B->A[2][1] = RCONST(677623207551.0)/RCONST(8224143866563.0); - B->A[3][0] = RCONST(1268023523408.0)/RCONST(10340822734521.0); - B->A[3][2] = RCONST(1029933939417.0)/RCONST(13636558850479.0); - B->A[4][0] = RCONST(14463281900351.0)/RCONST(6315353703477.0); - B->A[4][2] = RCONST(66114435211212.0)/RCONST(5879490589093.0); - B->A[4][3] = RCONST(-54053170152839.0)/RCONST(4284798021562.0); - B->A[5][0] = RCONST(14090043504691.0)/RCONST(34967701212078.0); - B->A[5][2] = RCONST(15191511035443.0)/RCONST(11219624916014.0); - B->A[5][3] = RCONST(-18461159152457.0)/RCONST(12425892160975.0); - B->A[5][4] = RCONST(-281667163811.0)/RCONST(9011619295870.0); - B->A[6][0] = RCONST(19230459214898.0)/RCONST(13134317526959.0); - B->A[6][2] = RCONST(21275331358303.0)/RCONST(2942455364971.0); - B->A[6][3] = RCONST(-38145345988419.0)/RCONST(4862620318723.0); - B->A[6][4] = RCONST(-1.0)/RCONST(8.0); - B->A[6][5] = RCONST(-1.0)/RCONST(8.0); - B->A[7][0] = RCONST(-19977161125411.0)/RCONST(11928030595625.0); - B->A[7][2] = RCONST(-40795976796054.0)/RCONST(6384907823539.0); - B->A[7][3] = RCONST(177454434618887.0)/RCONST(12078138498510.0); - B->A[7][4] = RCONST(782672205425.0)/RCONST(8267701900261.0); - B->A[7][5] = RCONST(-69563011059811.0)/RCONST(9646580694205.0); - B->A[7][6] = RCONST(7356628210526.0)/RCONST(4942186776405.0); - - B->b[0] = RCONST(-872700587467.0)/RCONST(9133579230613.0); - B->b[3] = RCONST(22348218063261.0)/RCONST(9555858737531.0); - B->b[4] = RCONST(-1143369518992.0)/RCONST(8141816002931.0); - B->b[5] = RCONST(-39379526789629.0)/RCONST(19018526304540.0); - B->b[6] = RCONST(32727382324388.0)/RCONST(42900044865799.0); - B->b[7] = RCONST(41.0)/RCONST(200.0); - - B->d[0] = RCONST(-975461918565.0)/RCONST(9796059967033.0); - B->d[3] = RCONST(78070527104295.0)/RCONST(32432590147079.0); - B->d[4] = RCONST(-548382580838.0)/RCONST(3424219808633.0); - B->d[5] = RCONST(-33438840321285.0)/RCONST(15594753105479.0); - B->d[6] = RCONST(3629800801594.0)/RCONST(4656183773603.0); - B->d[7] = RCONST(4035322873751.0)/RCONST(18575991585200.0); - - B->c[1] = RCONST(41.0)/RCONST(100.0); - B->c[2] = RCONST(2935347310677.0)/RCONST(11292855782101.0); - B->c[3] = RCONST(1426016391358.0)/RCONST(7196633302097.0); - B->c[4] = RCONST(92.0)/RCONST(100.0); - B->c[5] = RCONST(24.0)/RCONST(100.0); - B->c[6] = RCONST(3.0)/RCONST(5.0); - B->c[7] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(41.0)/SUN_RCONST(100.0); + B->A[2][0] = SUN_RCONST(367902744464.0)/SUN_RCONST(2072280473677.0); + B->A[2][1] = SUN_RCONST(677623207551.0)/SUN_RCONST(8224143866563.0); + B->A[3][0] = SUN_RCONST(1268023523408.0)/SUN_RCONST(10340822734521.0); + B->A[3][2] = SUN_RCONST(1029933939417.0)/SUN_RCONST(13636558850479.0); + B->A[4][0] = SUN_RCONST(14463281900351.0)/SUN_RCONST(6315353703477.0); + B->A[4][2] = SUN_RCONST(66114435211212.0)/SUN_RCONST(5879490589093.0); + B->A[4][3] = SUN_RCONST(-54053170152839.0)/SUN_RCONST(4284798021562.0); + B->A[5][0] = SUN_RCONST(14090043504691.0)/SUN_RCONST(34967701212078.0); + B->A[5][2] = SUN_RCONST(15191511035443.0)/SUN_RCONST(11219624916014.0); + B->A[5][3] = SUN_RCONST(-18461159152457.0)/SUN_RCONST(12425892160975.0); + B->A[5][4] = SUN_RCONST(-281667163811.0)/SUN_RCONST(9011619295870.0); + B->A[6][0] = SUN_RCONST(19230459214898.0)/SUN_RCONST(13134317526959.0); + B->A[6][2] = SUN_RCONST(21275331358303.0)/SUN_RCONST(2942455364971.0); + B->A[6][3] = SUN_RCONST(-38145345988419.0)/SUN_RCONST(4862620318723.0); + B->A[6][4] = SUN_RCONST(-1.0)/SUN_RCONST(8.0); + B->A[6][5] = SUN_RCONST(-1.0)/SUN_RCONST(8.0); + B->A[7][0] = SUN_RCONST(-19977161125411.0)/SUN_RCONST(11928030595625.0); + B->A[7][2] = SUN_RCONST(-40795976796054.0)/SUN_RCONST(6384907823539.0); + B->A[7][3] = SUN_RCONST(177454434618887.0)/SUN_RCONST(12078138498510.0); + B->A[7][4] = SUN_RCONST(782672205425.0)/SUN_RCONST(8267701900261.0); + B->A[7][5] = SUN_RCONST(-69563011059811.0)/SUN_RCONST(9646580694205.0); + B->A[7][6] = SUN_RCONST(7356628210526.0)/SUN_RCONST(4942186776405.0); + + B->b[0] = SUN_RCONST(-872700587467.0)/SUN_RCONST(9133579230613.0); + B->b[3] = SUN_RCONST(22348218063261.0)/SUN_RCONST(9555858737531.0); + B->b[4] = SUN_RCONST(-1143369518992.0)/SUN_RCONST(8141816002931.0); + B->b[5] = SUN_RCONST(-39379526789629.0)/SUN_RCONST(19018526304540.0); + B->b[6] = SUN_RCONST(32727382324388.0)/SUN_RCONST(42900044865799.0); + B->b[7] = SUN_RCONST(41.0)/SUN_RCONST(200.0); + + B->d[0] = SUN_RCONST(-975461918565.0)/SUN_RCONST(9796059967033.0); + B->d[3] = SUN_RCONST(78070527104295.0)/SUN_RCONST(32432590147079.0); + B->d[4] = SUN_RCONST(-548382580838.0)/SUN_RCONST(3424219808633.0); + B->d[5] = SUN_RCONST(-33438840321285.0)/SUN_RCONST(15594753105479.0); + B->d[6] = SUN_RCONST(3629800801594.0)/SUN_RCONST(4656183773603.0); + B->d[7] = SUN_RCONST(4035322873751.0)/SUN_RCONST(18575991585200.0); + + B->c[1] = SUN_RCONST(41.0)/SUN_RCONST(100.0); + B->c[2] = SUN_RCONST(2935347310677.0)/SUN_RCONST(11292855782101.0); + B->c[3] = SUN_RCONST(1426016391358.0)/SUN_RCONST(7196633302097.0); + B->c[4] = SUN_RCONST(92.0)/SUN_RCONST(100.0); + B->c[5] = SUN_RCONST(24.0)/SUN_RCONST(100.0); + B->c[6] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + B->c[7] = SUN_RCONST(1.0); return B; }) @@ -534,56 +534,56 @@ ARK_BUTCHER_TABLE(ARKODE_ARK548L2SAb_ERK_8_4_5, { /* ARK5(4)8L[2]SAb-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(8, SUNTRUE); B->q = 5; B->p = 4; - B->A[1][0] = RCONST(4.0)/RCONST(9.0); - B->A[2][0] = RCONST(1.0)/RCONST(9.0); - B->A[2][1] = RCONST(1183333538310.0)/RCONST(1827251437969.0); - B->A[3][0] = RCONST(895379019517.0)/RCONST(9750411845327.0); - B->A[3][1] = RCONST(477606656805.0)/RCONST(13473228687314.0); - B->A[3][2] = RCONST(-112564739183.0)/RCONST(9373365219272.0); - B->A[4][0] = RCONST(-4458043123994.0)/RCONST(13015289567637.0); - B->A[4][1] = RCONST(-2500665203865.0)/RCONST(9342069639922.0); - B->A[4][2] = RCONST(983347055801.0)/RCONST(8893519644487.0); - B->A[4][3] = RCONST(2185051477207.0)/RCONST(2551468980502.0); - B->A[5][0] = RCONST(-167316361917.0)/RCONST(17121522574472.0); - B->A[5][1] = RCONST(1605541814917.0)/RCONST(7619724128744.0); - B->A[5][2] = RCONST(991021770328.0)/RCONST(13052792161721.0); - B->A[5][3] = RCONST(2342280609577.0)/RCONST(11279663441611.0); - B->A[5][4] = RCONST(3012424348531.0)/RCONST(12792462456678.0); - B->A[6][0] = RCONST(6680998715867.0)/RCONST(14310383562358.0); - B->A[6][1] = RCONST(5029118570809.0)/RCONST(3897454228471.0); - B->A[6][2] = RCONST(2415062538259.0)/RCONST(6382199904604.0); - B->A[6][3] = RCONST(-3924368632305.0)/RCONST(6964820224454.0); - B->A[6][4] = RCONST(-4331110370267.0)/RCONST(15021686902756.0); - B->A[6][5] = RCONST(-3944303808049.0)/RCONST(11994238218192.0); - B->A[7][0] = RCONST(2193717860234.0)/RCONST(3570523412979.0); - B->A[7][1] = RCONST(2193717860234.0)/RCONST(3570523412979.0); - B->A[7][2] = RCONST(5952760925747.0)/RCONST(18750164281544.0); - B->A[7][3] = RCONST(-4412967128996.0)/RCONST(6196664114337.0); - B->A[7][4] = RCONST(4151782504231.0)/RCONST(36106512998704.0); - B->A[7][5] = RCONST(572599549169.0)/RCONST(6265429158920.0); - B->A[7][6] = RCONST(-457874356192.0)/RCONST(11306498036315.0); - - B->b[2] = RCONST(3517720773327.0)/RCONST(20256071687669.0); - B->b[3] = RCONST(4569610470461.0)/RCONST(17934693873752.0); - B->b[4] = RCONST(2819471173109.0)/RCONST(11655438449929.0); - B->b[5] = RCONST(3296210113763.0)/RCONST(10722700128969.0); - B->b[6] = RCONST(-1142099968913.0)/RCONST(5710983926999.0); - B->b[7] = RCONST(2.0)/RCONST(9.0); - - B->d[2] = RCONST(520639020421.0)/RCONST(8300446712847.0); - B->d[3] = RCONST(4550235134915.0)/RCONST(17827758688493.0); - B->d[4] = RCONST(1482366381361.0)/RCONST(6201654941325.0); - B->d[5] = RCONST(5551607622171.0)/RCONST(13911031047899.0); - B->d[6] = RCONST(-5266607656330.0)/RCONST(36788968843917.0); - B->d[7] = RCONST(1074053359553.0)/RCONST(5740751784926.0); - - B->c[1] = RCONST(4.0)/RCONST(9.0); - B->c[2] = RCONST(6456083330201.0)/RCONST(8509243623797.0); - B->c[3] = RCONST(1632083962415.0)/RCONST(14158861528103.0); - B->c[4] = RCONST(6365430648612.0)/RCONST(17842476412687.0); - B->c[5] = RCONST(18.0)/RCONST(25.0); - B->c[6] = RCONST(191.0)/RCONST(200.0); - B->c[7] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(4.0)/SUN_RCONST(9.0); + B->A[2][0] = SUN_RCONST(1.0)/SUN_RCONST(9.0); + B->A[2][1] = SUN_RCONST(1183333538310.0)/SUN_RCONST(1827251437969.0); + B->A[3][0] = SUN_RCONST(895379019517.0)/SUN_RCONST(9750411845327.0); + B->A[3][1] = SUN_RCONST(477606656805.0)/SUN_RCONST(13473228687314.0); + B->A[3][2] = SUN_RCONST(-112564739183.0)/SUN_RCONST(9373365219272.0); + B->A[4][0] = SUN_RCONST(-4458043123994.0)/SUN_RCONST(13015289567637.0); + B->A[4][1] = SUN_RCONST(-2500665203865.0)/SUN_RCONST(9342069639922.0); + B->A[4][2] = SUN_RCONST(983347055801.0)/SUN_RCONST(8893519644487.0); + B->A[4][3] = SUN_RCONST(2185051477207.0)/SUN_RCONST(2551468980502.0); + B->A[5][0] = SUN_RCONST(-167316361917.0)/SUN_RCONST(17121522574472.0); + B->A[5][1] = SUN_RCONST(1605541814917.0)/SUN_RCONST(7619724128744.0); + B->A[5][2] = SUN_RCONST(991021770328.0)/SUN_RCONST(13052792161721.0); + B->A[5][3] = SUN_RCONST(2342280609577.0)/SUN_RCONST(11279663441611.0); + B->A[5][4] = SUN_RCONST(3012424348531.0)/SUN_RCONST(12792462456678.0); + B->A[6][0] = SUN_RCONST(6680998715867.0)/SUN_RCONST(14310383562358.0); + B->A[6][1] = SUN_RCONST(5029118570809.0)/SUN_RCONST(3897454228471.0); + B->A[6][2] = SUN_RCONST(2415062538259.0)/SUN_RCONST(6382199904604.0); + B->A[6][3] = SUN_RCONST(-3924368632305.0)/SUN_RCONST(6964820224454.0); + B->A[6][4] = SUN_RCONST(-4331110370267.0)/SUN_RCONST(15021686902756.0); + B->A[6][5] = SUN_RCONST(-3944303808049.0)/SUN_RCONST(11994238218192.0); + B->A[7][0] = SUN_RCONST(2193717860234.0)/SUN_RCONST(3570523412979.0); + B->A[7][1] = SUN_RCONST(2193717860234.0)/SUN_RCONST(3570523412979.0); + B->A[7][2] = SUN_RCONST(5952760925747.0)/SUN_RCONST(18750164281544.0); + B->A[7][3] = SUN_RCONST(-4412967128996.0)/SUN_RCONST(6196664114337.0); + B->A[7][4] = SUN_RCONST(4151782504231.0)/SUN_RCONST(36106512998704.0); + B->A[7][5] = SUN_RCONST(572599549169.0)/SUN_RCONST(6265429158920.0); + B->A[7][6] = SUN_RCONST(-457874356192.0)/SUN_RCONST(11306498036315.0); + + B->b[2] = SUN_RCONST(3517720773327.0)/SUN_RCONST(20256071687669.0); + B->b[3] = SUN_RCONST(4569610470461.0)/SUN_RCONST(17934693873752.0); + B->b[4] = SUN_RCONST(2819471173109.0)/SUN_RCONST(11655438449929.0); + B->b[5] = SUN_RCONST(3296210113763.0)/SUN_RCONST(10722700128969.0); + B->b[6] = SUN_RCONST(-1142099968913.0)/SUN_RCONST(5710983926999.0); + B->b[7] = SUN_RCONST(2.0)/SUN_RCONST(9.0); + + B->d[2] = SUN_RCONST(520639020421.0)/SUN_RCONST(8300446712847.0); + B->d[3] = SUN_RCONST(4550235134915.0)/SUN_RCONST(17827758688493.0); + B->d[4] = SUN_RCONST(1482366381361.0)/SUN_RCONST(6201654941325.0); + B->d[5] = SUN_RCONST(5551607622171.0)/SUN_RCONST(13911031047899.0); + B->d[6] = SUN_RCONST(-5266607656330.0)/SUN_RCONST(36788968843917.0); + B->d[7] = SUN_RCONST(1074053359553.0)/SUN_RCONST(5740751784926.0); + + B->c[1] = SUN_RCONST(4.0)/SUN_RCONST(9.0); + B->c[2] = SUN_RCONST(6456083330201.0)/SUN_RCONST(8509243623797.0); + B->c[3] = SUN_RCONST(1632083962415.0)/SUN_RCONST(14158861528103.0); + B->c[4] = SUN_RCONST(6365430648612.0)/SUN_RCONST(17842476412687.0); + B->c[5] = SUN_RCONST(18.0)/SUN_RCONST(25.0); + B->c[6] = SUN_RCONST(191.0)/SUN_RCONST(200.0); + B->c[7] = SUN_RCONST(1.0); return B; }) @@ -591,54 +591,54 @@ ARK_BUTCHER_TABLE(ARKODE_VERNER_8_5_6, { /* Verner-6-5 */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(8, SUNTRUE); B->q = 6; B->p = 5; - B->A[1][0] = RCONST(1.0)/RCONST(6.0); - B->A[2][0] = RCONST(4.0)/RCONST(75.0); - B->A[2][1] = RCONST(16.0)/RCONST(75.0); - B->A[3][0] = RCONST(5.0)/RCONST(6.0); - B->A[3][1] = RCONST(-8.0)/RCONST(3.0); - B->A[3][2] = RCONST(5.0)/RCONST(2.0); - B->A[4][0] = RCONST(-165.0)/RCONST(64.0); - B->A[4][1] = RCONST(55.0)/RCONST(6.0); - B->A[4][2] = RCONST(-425.0)/RCONST(64.0); - B->A[4][3] = RCONST(85.0)/RCONST(96.0); - B->A[5][0] = RCONST(12.0)/RCONST(5.0); - B->A[5][1] = RCONST(-8.0); - B->A[5][2] = RCONST(4015.0)/RCONST(612.0); - B->A[5][3] = RCONST(-11.0)/RCONST(36.0); - B->A[5][4] = RCONST(88.0)/RCONST(255.0); - B->A[6][0] = RCONST(-8263.0)/RCONST(15000.0); - B->A[6][1] = RCONST(124.0)/RCONST(75.0); - B->A[6][2] = RCONST(-643.0)/RCONST(680.0); - B->A[6][3] = RCONST(-81.0)/RCONST(250.0); - B->A[6][4] = RCONST(2484.0)/RCONST(10625.0); - B->A[7][0] = RCONST(3501.0)/RCONST(1720.0); - B->A[7][1] = RCONST(-300.0)/RCONST(43.0); - B->A[7][2] = RCONST(297275.0)/RCONST(52632.0); - B->A[7][3] = RCONST(-319.0)/RCONST(2322.0); - B->A[7][4] = RCONST(24068.0)/RCONST(84065.0); - B->A[7][6] = RCONST(3850.0)/RCONST(26703.0); - - B->b[0] = RCONST(3.0)/RCONST(40.0); - B->b[2] = RCONST(875.0)/RCONST(2244.0); - B->b[3] = RCONST(23.0)/RCONST(72.0); - B->b[4] = RCONST(264.0)/RCONST(1955.0); - B->b[6] = RCONST(125.0)/RCONST(11592.0); - B->b[7] = RCONST(43.0)/RCONST(616.0); - - B->d[0] = RCONST(13.0)/RCONST(160.0); - B->d[2] = RCONST(2375.0)/RCONST(5984.0); - B->d[3] = RCONST(5.0)/RCONST(16.0); - B->d[4] = RCONST(12.0)/RCONST(85.0); - B->d[5] = RCONST(3.0)/RCONST(44.0); - - B->c[0] = RCONST(0.0); - B->c[1] = RCONST(1.0)/RCONST(6.0); - B->c[2] = RCONST(4.0)/RCONST(15.0); - B->c[3] = RCONST(2.0)/RCONST(3.0); - B->c[4] = RCONST(5.0)/RCONST(6.0); - B->c[5] = RCONST(1.0); - B->c[6] = RCONST(1.0)/RCONST(15.0); - B->c[7] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->A[2][0] = SUN_RCONST(4.0)/SUN_RCONST(75.0); + B->A[2][1] = SUN_RCONST(16.0)/SUN_RCONST(75.0); + B->A[3][0] = SUN_RCONST(5.0)/SUN_RCONST(6.0); + B->A[3][1] = SUN_RCONST(-8.0)/SUN_RCONST(3.0); + B->A[3][2] = SUN_RCONST(5.0)/SUN_RCONST(2.0); + B->A[4][0] = SUN_RCONST(-165.0)/SUN_RCONST(64.0); + B->A[4][1] = SUN_RCONST(55.0)/SUN_RCONST(6.0); + B->A[4][2] = SUN_RCONST(-425.0)/SUN_RCONST(64.0); + B->A[4][3] = SUN_RCONST(85.0)/SUN_RCONST(96.0); + B->A[5][0] = SUN_RCONST(12.0)/SUN_RCONST(5.0); + B->A[5][1] = SUN_RCONST(-8.0); + B->A[5][2] = SUN_RCONST(4015.0)/SUN_RCONST(612.0); + B->A[5][3] = SUN_RCONST(-11.0)/SUN_RCONST(36.0); + B->A[5][4] = SUN_RCONST(88.0)/SUN_RCONST(255.0); + B->A[6][0] = SUN_RCONST(-8263.0)/SUN_RCONST(15000.0); + B->A[6][1] = SUN_RCONST(124.0)/SUN_RCONST(75.0); + B->A[6][2] = SUN_RCONST(-643.0)/SUN_RCONST(680.0); + B->A[6][3] = SUN_RCONST(-81.0)/SUN_RCONST(250.0); + B->A[6][4] = SUN_RCONST(2484.0)/SUN_RCONST(10625.0); + B->A[7][0] = SUN_RCONST(3501.0)/SUN_RCONST(1720.0); + B->A[7][1] = SUN_RCONST(-300.0)/SUN_RCONST(43.0); + B->A[7][2] = SUN_RCONST(297275.0)/SUN_RCONST(52632.0); + B->A[7][3] = SUN_RCONST(-319.0)/SUN_RCONST(2322.0); + B->A[7][4] = SUN_RCONST(24068.0)/SUN_RCONST(84065.0); + B->A[7][6] = SUN_RCONST(3850.0)/SUN_RCONST(26703.0); + + B->b[0] = SUN_RCONST(3.0)/SUN_RCONST(40.0); + B->b[2] = SUN_RCONST(875.0)/SUN_RCONST(2244.0); + B->b[3] = SUN_RCONST(23.0)/SUN_RCONST(72.0); + B->b[4] = SUN_RCONST(264.0)/SUN_RCONST(1955.0); + B->b[6] = SUN_RCONST(125.0)/SUN_RCONST(11592.0); + B->b[7] = SUN_RCONST(43.0)/SUN_RCONST(616.0); + + B->d[0] = SUN_RCONST(13.0)/SUN_RCONST(160.0); + B->d[2] = SUN_RCONST(2375.0)/SUN_RCONST(5984.0); + B->d[3] = SUN_RCONST(5.0)/SUN_RCONST(16.0); + B->d[4] = SUN_RCONST(12.0)/SUN_RCONST(85.0); + B->d[5] = SUN_RCONST(3.0)/SUN_RCONST(44.0); + + B->c[0] = SUN_RCONST(0.0); + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->c[2] = SUN_RCONST(4.0)/SUN_RCONST(15.0); + B->c[3] = SUN_RCONST(2.0)/SUN_RCONST(3.0); + B->c[4] = SUN_RCONST(5.0)/SUN_RCONST(6.0); + B->c[5] = SUN_RCONST(1.0); + B->c[6] = SUN_RCONST(1.0)/SUN_RCONST(15.0); + B->c[7] = SUN_RCONST(1.0); return B; }) @@ -646,89 +646,89 @@ ARK_BUTCHER_TABLE(ARKODE_FEHLBERG_13_7_8, { /* Fehlberg-8-7 */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(13, SUNTRUE); B->q = 8; B->p = 7; - B->A[1][0] = RCONST(2.0)/RCONST(27.0); - B->A[2][0] = RCONST(1.0)/RCONST(36.0); - B->A[2][1] = RCONST(1.0)/RCONST(12.0); - B->A[3][0] = RCONST(1.0)/RCONST(24.0); - B->A[3][2] = RCONST(1.0)/RCONST(8.0); - B->A[4][0] = RCONST(5.0)/RCONST(12.0); - B->A[4][2] = RCONST(-25.0)/RCONST(16.0); - B->A[4][3] = RCONST(25.0)/RCONST(16.0); - B->A[5][0] = RCONST(1.0)/RCONST(20.0); - B->A[5][3] = RCONST(1.0)/RCONST(4.0); - B->A[5][4] = RCONST(1.0)/RCONST(5.0); - B->A[6][0] = RCONST(-25.0)/RCONST(108.0); - B->A[6][3] = RCONST(125.0)/RCONST(108.0); - B->A[6][4] = RCONST(-65.0)/RCONST(27.0); - B->A[6][5] = RCONST(125.0)/RCONST(54.0); - B->A[7][0] = RCONST(31.0)/RCONST(300.0); - B->A[7][4] = RCONST(61.0)/RCONST(225.0); - B->A[7][5] = RCONST(-2.0)/RCONST(9.0); - B->A[7][6] = RCONST(13.0)/RCONST(900.0); - B->A[8][0] = RCONST(2.0); - B->A[8][3] = RCONST(-53.0)/RCONST(6.0); - B->A[8][4] = RCONST(704.0)/RCONST(45.0); - B->A[8][5] = RCONST(-107.0)/RCONST(9.0); - B->A[8][6] = RCONST(67.0)/RCONST(90.0); - B->A[8][7] = RCONST(3.0); - B->A[9][0] = RCONST(-91.0)/RCONST(108.0); - B->A[9][3] = RCONST(23.0)/RCONST(108.0); - B->A[9][4] = RCONST(-976.0)/RCONST(135.0); - B->A[9][5] = RCONST(311.0)/RCONST(54.0); - B->A[9][6] = RCONST(-19.0)/RCONST(60.0); - B->A[9][7] = RCONST(17.0)/RCONST(6.0); - B->A[9][8] = RCONST(-1.0)/RCONST(12.0); - B->A[10][0] = RCONST(2383.0)/RCONST(4100.0); - B->A[10][3] = RCONST(-341.0)/RCONST(164.0); - B->A[10][4] = RCONST(4496.0)/RCONST(1025.0); - B->A[10][5] = RCONST(-301.0)/RCONST(82.0); - B->A[10][6] = RCONST(2133.0)/RCONST(4100.0); - B->A[10][7] = RCONST(45.0)/RCONST(82.0); - B->A[10][8] = RCONST(45.0)/RCONST(164.0); - B->A[10][9] = RCONST(18.0)/RCONST(41.0); - B->A[11][0] = RCONST(3.0)/RCONST(205.0); - B->A[11][5] = RCONST(-6.0)/RCONST(41.0); - B->A[11][6] = RCONST(-3.0)/RCONST(205.0); - B->A[11][7] = RCONST(-3.0)/RCONST(41.0); - B->A[11][8] = RCONST(3.0)/RCONST(41.0); - B->A[11][9] = RCONST(6.0)/RCONST(41.0); - B->A[12][0] = RCONST(-1777.0)/RCONST(4100.0); - B->A[12][3] = RCONST(-341.0)/RCONST(164.0); - B->A[12][4] = RCONST(4496.0)/RCONST(1025.0); - B->A[12][5] = RCONST(-289.0)/RCONST(82.0); - B->A[12][6] = RCONST(2193.0)/RCONST(4100.0); - B->A[12][7] = RCONST(51.0)/RCONST(82.0); - B->A[12][8] = RCONST(33.0)/RCONST(164.0); - B->A[12][9] = RCONST(12.0)/RCONST(41.0); - B->A[12][11] = RCONST(1.0); - - B->b[5] = RCONST(34.0)/RCONST(105.0); - B->b[6] = RCONST(9.0)/RCONST(35.0); - B->b[7] = RCONST(9.0)/RCONST(35.0); - B->b[8] = RCONST(9.0)/RCONST(280.0); - B->b[9] = RCONST(9.0)/RCONST(280.0); - B->b[11] = RCONST(41.0)/RCONST(840.0); - B->b[12] = RCONST(41.0)/RCONST(840.0); - - B->d[0] = RCONST(41.0)/RCONST(840.0); - B->d[5] = RCONST(34.0)/RCONST(105.0); - B->d[6] = RCONST(9.0)/RCONST(35.0); - B->d[7] = RCONST(9.0)/RCONST(35.0); - B->d[8] = RCONST(9.0)/RCONST(280.0); - B->d[9] = RCONST(9.0)/RCONST(280.0); - B->d[10] = RCONST(41.0)/RCONST(840.0); - - B->c[1] = RCONST(2.0)/RCONST(27.0); - B->c[2] = RCONST(1.0)/RCONST(9.0); - B->c[3] = RCONST(1.0)/RCONST(6.0); - B->c[4] = RCONST(5.0)/RCONST(12.0); - B->c[5] = RCONST(1.0)/RCONST(2.0); - B->c[6] = RCONST(5.0)/RCONST(6.0); - B->c[7] = RCONST(1.0)/RCONST(6.0); - B->c[8] = RCONST(2.0)/RCONST(3.0); - B->c[9] = RCONST(1.0)/RCONST(3.0); - B->c[10] = RCONST(1.0); - B->c[12] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(2.0)/SUN_RCONST(27.0); + B->A[2][0] = SUN_RCONST(1.0)/SUN_RCONST(36.0); + B->A[2][1] = SUN_RCONST(1.0)/SUN_RCONST(12.0); + B->A[3][0] = SUN_RCONST(1.0)/SUN_RCONST(24.0); + B->A[3][2] = SUN_RCONST(1.0)/SUN_RCONST(8.0); + B->A[4][0] = SUN_RCONST(5.0)/SUN_RCONST(12.0); + B->A[4][2] = SUN_RCONST(-25.0)/SUN_RCONST(16.0); + B->A[4][3] = SUN_RCONST(25.0)/SUN_RCONST(16.0); + B->A[5][0] = SUN_RCONST(1.0)/SUN_RCONST(20.0); + B->A[5][3] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[5][4] = SUN_RCONST(1.0)/SUN_RCONST(5.0); + B->A[6][0] = SUN_RCONST(-25.0)/SUN_RCONST(108.0); + B->A[6][3] = SUN_RCONST(125.0)/SUN_RCONST(108.0); + B->A[6][4] = SUN_RCONST(-65.0)/SUN_RCONST(27.0); + B->A[6][5] = SUN_RCONST(125.0)/SUN_RCONST(54.0); + B->A[7][0] = SUN_RCONST(31.0)/SUN_RCONST(300.0); + B->A[7][4] = SUN_RCONST(61.0)/SUN_RCONST(225.0); + B->A[7][5] = SUN_RCONST(-2.0)/SUN_RCONST(9.0); + B->A[7][6] = SUN_RCONST(13.0)/SUN_RCONST(900.0); + B->A[8][0] = SUN_RCONST(2.0); + B->A[8][3] = SUN_RCONST(-53.0)/SUN_RCONST(6.0); + B->A[8][4] = SUN_RCONST(704.0)/SUN_RCONST(45.0); + B->A[8][5] = SUN_RCONST(-107.0)/SUN_RCONST(9.0); + B->A[8][6] = SUN_RCONST(67.0)/SUN_RCONST(90.0); + B->A[8][7] = SUN_RCONST(3.0); + B->A[9][0] = SUN_RCONST(-91.0)/SUN_RCONST(108.0); + B->A[9][3] = SUN_RCONST(23.0)/SUN_RCONST(108.0); + B->A[9][4] = SUN_RCONST(-976.0)/SUN_RCONST(135.0); + B->A[9][5] = SUN_RCONST(311.0)/SUN_RCONST(54.0); + B->A[9][6] = SUN_RCONST(-19.0)/SUN_RCONST(60.0); + B->A[9][7] = SUN_RCONST(17.0)/SUN_RCONST(6.0); + B->A[9][8] = SUN_RCONST(-1.0)/SUN_RCONST(12.0); + B->A[10][0] = SUN_RCONST(2383.0)/SUN_RCONST(4100.0); + B->A[10][3] = SUN_RCONST(-341.0)/SUN_RCONST(164.0); + B->A[10][4] = SUN_RCONST(4496.0)/SUN_RCONST(1025.0); + B->A[10][5] = SUN_RCONST(-301.0)/SUN_RCONST(82.0); + B->A[10][6] = SUN_RCONST(2133.0)/SUN_RCONST(4100.0); + B->A[10][7] = SUN_RCONST(45.0)/SUN_RCONST(82.0); + B->A[10][8] = SUN_RCONST(45.0)/SUN_RCONST(164.0); + B->A[10][9] = SUN_RCONST(18.0)/SUN_RCONST(41.0); + B->A[11][0] = SUN_RCONST(3.0)/SUN_RCONST(205.0); + B->A[11][5] = SUN_RCONST(-6.0)/SUN_RCONST(41.0); + B->A[11][6] = SUN_RCONST(-3.0)/SUN_RCONST(205.0); + B->A[11][7] = SUN_RCONST(-3.0)/SUN_RCONST(41.0); + B->A[11][8] = SUN_RCONST(3.0)/SUN_RCONST(41.0); + B->A[11][9] = SUN_RCONST(6.0)/SUN_RCONST(41.0); + B->A[12][0] = SUN_RCONST(-1777.0)/SUN_RCONST(4100.0); + B->A[12][3] = SUN_RCONST(-341.0)/SUN_RCONST(164.0); + B->A[12][4] = SUN_RCONST(4496.0)/SUN_RCONST(1025.0); + B->A[12][5] = SUN_RCONST(-289.0)/SUN_RCONST(82.0); + B->A[12][6] = SUN_RCONST(2193.0)/SUN_RCONST(4100.0); + B->A[12][7] = SUN_RCONST(51.0)/SUN_RCONST(82.0); + B->A[12][8] = SUN_RCONST(33.0)/SUN_RCONST(164.0); + B->A[12][9] = SUN_RCONST(12.0)/SUN_RCONST(41.0); + B->A[12][11] = SUN_RCONST(1.0); + + B->b[5] = SUN_RCONST(34.0)/SUN_RCONST(105.0); + B->b[6] = SUN_RCONST(9.0)/SUN_RCONST(35.0); + B->b[7] = SUN_RCONST(9.0)/SUN_RCONST(35.0); + B->b[8] = SUN_RCONST(9.0)/SUN_RCONST(280.0); + B->b[9] = SUN_RCONST(9.0)/SUN_RCONST(280.0); + B->b[11] = SUN_RCONST(41.0)/SUN_RCONST(840.0); + B->b[12] = SUN_RCONST(41.0)/SUN_RCONST(840.0); + + B->d[0] = SUN_RCONST(41.0)/SUN_RCONST(840.0); + B->d[5] = SUN_RCONST(34.0)/SUN_RCONST(105.0); + B->d[6] = SUN_RCONST(9.0)/SUN_RCONST(35.0); + B->d[7] = SUN_RCONST(9.0)/SUN_RCONST(35.0); + B->d[8] = SUN_RCONST(9.0)/SUN_RCONST(280.0); + B->d[9] = SUN_RCONST(9.0)/SUN_RCONST(280.0); + B->d[10] = SUN_RCONST(41.0)/SUN_RCONST(840.0); + + B->c[1] = SUN_RCONST(2.0)/SUN_RCONST(27.0); + B->c[2] = SUN_RCONST(1.0)/SUN_RCONST(9.0); + B->c[3] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->c[4] = SUN_RCONST(5.0)/SUN_RCONST(12.0); + B->c[5] = SUN_RCONST(1.0)/SUN_RCONST(2.0); + B->c[6] = SUN_RCONST(5.0)/SUN_RCONST(6.0); + B->c[7] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->c[8] = SUN_RCONST(2.0)/SUN_RCONST(3.0); + B->c[9] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->c[10] = SUN_RCONST(1.0); + B->c[12] = SUN_RCONST(1.0); return B; }) @@ -740,17 +740,17 @@ ARK_BUTCHER_TABLE(ARKODE_KNOTH_WOLKE_3_3, { /* Knoth-Wolke-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(3, SUNFALSE); B->q = 3; B->p = 0; - B->A[1][0] = RCONST(1.0)/RCONST(3.0); - B->A[2][0] = RCONST(-3.0)/RCONST(16.0); - B->A[2][1] = RCONST(15.0)/RCONST(16.0); + B->A[1][0] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->A[2][0] = SUN_RCONST(-3.0)/SUN_RCONST(16.0); + B->A[2][1] = SUN_RCONST(15.0)/SUN_RCONST(16.0); - B->b[0] = RCONST(1.0)/RCONST(6.0); - B->b[1] = RCONST(3.0)/RCONST(10.0); - B->b[2] = RCONST(8.0)/RCONST(15.0); + B->b[0] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->b[1] = SUN_RCONST(3.0)/SUN_RCONST(10.0); + B->b[2] = SUN_RCONST(8.0)/SUN_RCONST(15.0); B->d = NULL; - B->c[1] = RCONST(1.0)/RCONST(3.0); - B->c[2] = RCONST(3.0)/RCONST(4.0); + B->c[1] = SUN_RCONST(1.0)/SUN_RCONST(3.0); + B->c[2] = SUN_RCONST(3.0)/SUN_RCONST(4.0); return B; }) diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 62e80a5087..f56a93feda 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -1004,7 +1004,7 @@ int erkStep_CheckButcherTable(ARKodeMem ark_mem) int i, j; booleantype okay; ARKodeERKStepMem step_mem; - sunrealtype tol = RCONST(1.0e-12); + sunrealtype tol = SUN_RCONST(1.0e-12); /* access ARKodeERKStepMem structure */ if (ark_mem->step_mem==NULL) { diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 2664b9654e..4d1c079463 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -267,13 +267,13 @@ int ERKStepSetDefaults(void* arkode_mem) (overwrite some adaptivity params for ERKStep use) */ step_mem->q = Q_DEFAULT; /* method order */ step_mem->p = 0; /* embedding order */ - ark_mem->hadapt_mem->etamxf = RCONST(0.3); /* max change on error-failed step */ + ark_mem->hadapt_mem->etamxf = SUN_RCONST(0.3); /* max change on error-failed step */ ark_mem->hadapt_mem->imethod = ARK_ADAPT_PI; /* PI controller */ - ark_mem->hadapt_mem->safety = RCONST(0.99); /* step adaptivity safety factor */ - ark_mem->hadapt_mem->bias = RCONST(1.2); /* step adaptivity error bias */ - ark_mem->hadapt_mem->growth = RCONST(25.0); /* step adaptivity growth factor */ - ark_mem->hadapt_mem->k1 = RCONST(0.8); /* step adaptivity parameter */ - ark_mem->hadapt_mem->k2 = RCONST(0.31); /* step adaptivity parameter */ + ark_mem->hadapt_mem->safety = SUN_RCONST(0.99); /* step adaptivity safety factor */ + ark_mem->hadapt_mem->bias = SUN_RCONST(1.2); /* step adaptivity error bias */ + ark_mem->hadapt_mem->growth = SUN_RCONST(25.0); /* step adaptivity growth factor */ + ark_mem->hadapt_mem->k1 = SUN_RCONST(0.8); /* step adaptivity parameter */ + ark_mem->hadapt_mem->k2 = SUN_RCONST(0.31); /* step adaptivity parameter */ step_mem->stages = 0; /* no stages */ step_mem->B = NULL; /* no Butcher table */ return(ARK_SUCCESS); diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 398a939e6e..65a1a0ebd3 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -73,15 +73,15 @@ extern "C" { #define MXHNIL 10 /* max number of t+h==h warnings */ /* Numeric constants */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define TINY RCONST(1.0e-10) /* small number */ -#define TENTH RCONST(0.1) /* real 0.1 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define THREE RCONST(3.0) /* real 3.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define FIVE RCONST(5.0) /* real 5.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define TINY SUN_RCONST(1.0e-10) /* small number */ +#define TENTH SUN_RCONST(0.1) /* real 0.1 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define THREE SUN_RCONST(3.0) /* real 3.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define FIVE SUN_RCONST(5.0) /* real 5.0 */ /* Control constants for tolerances */ #define ARK_SS 0 @@ -130,15 +130,15 @@ extern "C" { ONEPSM safety factor for floating point comparisons ONEMSM safety factor for floating point comparisons ---------------------------------------------------------------*/ -#define FUZZ_FACTOR RCONST(100.0) +#define FUZZ_FACTOR SUN_RCONST(100.0) -#define H0_LBFACTOR RCONST(100.0) -#define H0_UBFACTOR RCONST(0.1) +#define H0_LBFACTOR SUN_RCONST(100.0) +#define H0_UBFACTOR SUN_RCONST(0.1) #define H0_BIAS HALF #define H0_ITERS 4 -#define ONEPSM RCONST(1.000001) -#define ONEMSM RCONST(0.999999) +#define ONEPSM SUN_RCONST(1.000001) +#define ONEMSM SUN_RCONST(0.999999) /*=============================================================== diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index 7f726dc2a7..658b04d731 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -161,7 +161,7 @@ ARKInterp arkInterpCreate_Hermite(void* arkode_mem, int degree) /* initialize time values */ content->told = ark_mem->tcur; content->tnew = ark_mem->tcur; - content->h = RCONST(0.0); + content->h = SUN_RCONST(0.0); return(interp); } @@ -209,7 +209,7 @@ int arkInterpResize_Hermite(void* arkode_mem, ARKInterp interp, /* reinitialize time values */ HINT_TOLD(interp) = ark_mem->tcur; HINT_TNEW(interp) = ark_mem->tcur; - HINT_H(interp) = RCONST(0.0); + HINT_H(interp) = SUN_RCONST(0.0); return(ARK_SUCCESS); } @@ -380,7 +380,7 @@ int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, /* initialize time values */ HINT_TOLD(interp) = tnew; HINT_TNEW(interp) = tnew; - HINT_H(interp) = RCONST(0.0); + HINT_H(interp) = SUN_RCONST(0.0); /* allocate vectors based on interpolant degree */ if (HINT_FOLD(interp) == NULL) @@ -608,35 +608,35 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, /* evaluate desired function */ if (d == 0) { - a[0] = -SIX*tau2 - RCONST(16.0)*tau3 - RCONST(9.0)*tau4; - a[1] = ONE + SIX*tau2 + RCONST(16.0)*tau3 + RCONST(9.0)*tau4; - a[2] = h*FOURTH*(-FIVE*tau2 - RCONST(14.0)*tau3 - RCONST(9.0)*tau4); + a[0] = -SIX*tau2 - SUN_RCONST(16.0)*tau3 - SUN_RCONST(9.0)*tau4; + a[1] = ONE + SIX*tau2 + SUN_RCONST(16.0)*tau3 + SUN_RCONST(9.0)*tau4; + a[2] = h*FOURTH*(-FIVE*tau2 - SUN_RCONST(14.0)*tau3 - SUN_RCONST(9.0)*tau4); a[3] = h*(tau + TWO*tau2 + tau3); - a[4] = h*RCONST(27.0)*FOURTH*(-tau4 - TWO*tau3 - tau2); + a[4] = h*SUN_RCONST(27.0)*FOURTH*(-tau4 - TWO*tau3 - tau2); } else if (d == 1) { - a[0] = (-TWELVE*tau - RCONST(48.0)*tau2 - RCONST(36.0)*tau3)/h; - a[1] = (TWELVE*tau + RCONST(48.0)*tau2 + RCONST(36.0)*tau3)/h; - a[2] = HALF*(-FIVE*tau - RCONST(21.0)*tau2 - RCONST(18.0)*tau3); + a[0] = (-TWELVE*tau - SUN_RCONST(48.0)*tau2 - SUN_RCONST(36.0)*tau3)/h; + a[1] = (TWELVE*tau + SUN_RCONST(48.0)*tau2 + SUN_RCONST(36.0)*tau3)/h; + a[2] = HALF*(-FIVE*tau - SUN_RCONST(21.0)*tau2 - SUN_RCONST(18.0)*tau3); a[3] = (ONE + FOUR*tau + THREE*tau2); - a[4] = -RCONST(27.0)*HALF*(TWO*tau3 + THREE*tau2 + tau); + a[4] = -SUN_RCONST(27.0)*HALF*(TWO*tau3 + THREE*tau2 + tau); } else if (d == 2) { - a[0] = (-TWELVE - RCONST(96.0)*tau - RCONST(108.0)*tau2)/h2; - a[1] = (TWELVE + RCONST(96.0)*tau + RCONST(108.0)*tau2)/h2; - a[2] = (-FIVE*HALF - RCONST(21.0)*tau - RCONST(27.0)*tau2)/h; + a[0] = (-TWELVE - SUN_RCONST(96.0)*tau - SUN_RCONST(108.0)*tau2)/h2; + a[1] = (TWELVE + SUN_RCONST(96.0)*tau + SUN_RCONST(108.0)*tau2)/h2; + a[2] = (-FIVE*HALF - SUN_RCONST(21.0)*tau - SUN_RCONST(27.0)*tau2)/h; a[3] = (FOUR + SIX*tau)/h; - a[4] = (-RCONST(27.0)*HALF - RCONST(81.0)*tau - RCONST(81.0)*tau2)/h; + a[4] = (-SUN_RCONST(27.0)*HALF - SUN_RCONST(81.0)*tau - SUN_RCONST(81.0)*tau2)/h; } else if (d == 3) { - a[0] = (-RCONST(96.0) - RCONST(216.0)*tau)/h3; - a[1] = (RCONST(96.0) + RCONST(216.0)*tau)/h3; - a[2] = (-RCONST(21.0) - RCONST(54.0)*tau)/h2; + a[0] = (-SUN_RCONST(96.0) - SUN_RCONST(216.0)*tau)/h3; + a[1] = (SUN_RCONST(96.0) + SUN_RCONST(216.0)*tau)/h3; + a[2] = (-SUN_RCONST(21.0) - SUN_RCONST(54.0)*tau)/h2; a[3] = SIX/h2; - a[4] = (-RCONST(81.0) - RCONST(162.0)*tau)/h2; + a[4] = (-SUN_RCONST(81.0) - SUN_RCONST(162.0)*tau)/h2; } else { /* d == 4 */ - a[0] = -RCONST(216.0)/h4; - a[1] = RCONST(216.0)/h4; - a[2] = -RCONST(54.0)/h3; + a[0] = -SUN_RCONST(216.0)/h4; + a[1] = SUN_RCONST(216.0)/h4; + a[2] = -SUN_RCONST(54.0)/h3; a[3] = ZERO; - a[4] = -RCONST(162.0)/h3; + a[4] = -SUN_RCONST(162.0)/h3; } X[0] = HINT_YOLD(interp); X[1] = HINT_YNEW(interp); @@ -673,46 +673,46 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, /* evaluate desired function */ if (d == 0) { - a[0] = RCONST(54.0)*tau5 + RCONST(135.0)*tau4 + RCONST(110.0)*tau3 + RCONST(30.0)*tau2; + a[0] = SUN_RCONST(54.0)*tau5 + SUN_RCONST(135.0)*tau4 + SUN_RCONST(110.0)*tau3 + SUN_RCONST(30.0)*tau2; a[1] = ONE - a[0]; - a[2] = h/FOUR*(RCONST(27.0)*tau5 + RCONST(63.0)*tau4 + RCONST(49.0)*tau3 + RCONST(13.0)*tau2); - a[3] = h/FOUR*(RCONST(27.0)*tau5 + RCONST(72.0)*tau4 + RCONST(67.0)*tau3 + RCONST(26.0)*tau2 + FOUR*tau); - a[4] = h/FOUR*(RCONST(81.0)*tau5 + RCONST(189.0)*tau4 + RCONST(135.0)*tau3 + RCONST(27.0)*tau2); - a[5] = h/FOUR*(RCONST(81.0)*tau5 + RCONST(216.0)*tau4 + RCONST(189.0)*tau3 + RCONST(54.0)*tau2); + a[2] = h/FOUR*(SUN_RCONST(27.0)*tau5 + SUN_RCONST(63.0)*tau4 + SUN_RCONST(49.0)*tau3 + SUN_RCONST(13.0)*tau2); + a[3] = h/FOUR*(SUN_RCONST(27.0)*tau5 + SUN_RCONST(72.0)*tau4 + SUN_RCONST(67.0)*tau3 + SUN_RCONST(26.0)*tau2 + FOUR*tau); + a[4] = h/FOUR*(SUN_RCONST(81.0)*tau5 + SUN_RCONST(189.0)*tau4 + SUN_RCONST(135.0)*tau3 + SUN_RCONST(27.0)*tau2); + a[5] = h/FOUR*(SUN_RCONST(81.0)*tau5 + SUN_RCONST(216.0)*tau4 + SUN_RCONST(189.0)*tau3 + SUN_RCONST(54.0)*tau2); } else if (d == 1) { - a[0] = (RCONST(270.0)*tau4 + RCONST(540.0)*tau3 + RCONST(330.0)*tau2 + RCONST(60.0)*tau)/h; + a[0] = (SUN_RCONST(270.0)*tau4 + SUN_RCONST(540.0)*tau3 + SUN_RCONST(330.0)*tau2 + SUN_RCONST(60.0)*tau)/h; a[1] = -a[0]; - a[2] = (RCONST(135.0)*tau4 + RCONST(252.0)*tau3 + RCONST(147.0)*tau2 + RCONST(26.0)*tau)/FOUR; - a[3] = (RCONST(135.0)*tau4 + RCONST(288.0)*tau3 + RCONST(201.0)*tau2 + RCONST(52.0)*tau + FOUR)/FOUR; - a[4] = (RCONST(405.0)*tau4 + RCONST(4.0)*189*tau3 + RCONST(405.0)*tau2 + RCONST(54.0)*tau)/FOUR; - a[5] = (RCONST(405.0)*tau4 + RCONST(864.0)*tau3 + RCONST(567.0)*tau2 + RCONST(108.0)*tau)/FOUR; + a[2] = (SUN_RCONST(135.0)*tau4 + SUN_RCONST(252.0)*tau3 + SUN_RCONST(147.0)*tau2 + SUN_RCONST(26.0)*tau)/FOUR; + a[3] = (SUN_RCONST(135.0)*tau4 + SUN_RCONST(288.0)*tau3 + SUN_RCONST(201.0)*tau2 + SUN_RCONST(52.0)*tau + FOUR)/FOUR; + a[4] = (SUN_RCONST(405.0)*tau4 + SUN_RCONST(4.0)*189*tau3 + SUN_RCONST(405.0)*tau2 + SUN_RCONST(54.0)*tau)/FOUR; + a[5] = (SUN_RCONST(405.0)*tau4 + SUN_RCONST(864.0)*tau3 + SUN_RCONST(567.0)*tau2 + SUN_RCONST(108.0)*tau)/FOUR; } else if (d == 2) { - a[0] = (RCONST(1080.0)*tau3 + RCONST(1620.0)*tau2 + RCONST(660.0)*tau + RCONST(60.0))/h2; + a[0] = (SUN_RCONST(1080.0)*tau3 + SUN_RCONST(1620.0)*tau2 + SUN_RCONST(660.0)*tau + SUN_RCONST(60.0))/h2; a[1] = -a[0]; - a[2] = (RCONST(270.0)*tau3 + RCONST(378.0)*tau2 + RCONST(147.0)*tau + RCONST(13.0))/(TWO*h); - a[3] = (RCONST(270.0)*tau3 + RCONST(432.0)*tau2 + RCONST(201.0)*tau + RCONST(26.0))/(TWO*h); - a[4] = (RCONST(810.0)*tau3 + RCONST(1134.0)*tau2 + RCONST(405.0)*tau + RCONST(27.0))/(TWO*h); - a[5] = (RCONST(810.0)*tau3 + RCONST(1296.0)*tau2 + RCONST(567.0)*tau + RCONST(54.0))/(TWO*h); + a[2] = (SUN_RCONST(270.0)*tau3 + SUN_RCONST(378.0)*tau2 + SUN_RCONST(147.0)*tau + SUN_RCONST(13.0))/(TWO*h); + a[3] = (SUN_RCONST(270.0)*tau3 + SUN_RCONST(432.0)*tau2 + SUN_RCONST(201.0)*tau + SUN_RCONST(26.0))/(TWO*h); + a[4] = (SUN_RCONST(810.0)*tau3 + SUN_RCONST(1134.0)*tau2 + SUN_RCONST(405.0)*tau + SUN_RCONST(27.0))/(TWO*h); + a[5] = (SUN_RCONST(810.0)*tau3 + SUN_RCONST(1296.0)*tau2 + SUN_RCONST(567.0)*tau + SUN_RCONST(54.0))/(TWO*h); } else if (d == 3) { - a[0] = (RCONST(3240.0)*tau2 + RCONST(3240.0)*tau + RCONST(660.0))/h3; + a[0] = (SUN_RCONST(3240.0)*tau2 + SUN_RCONST(3240.0)*tau + SUN_RCONST(660.0))/h3; a[1] = -a[0]; - a[2] = (RCONST(810.0)*tau2 + RCONST(756.0)*tau + RCONST(147.0))/(TWO*h2); - a[3] = (RCONST(810.0)*tau2 + RCONST(864.0)*tau + RCONST(201.0))/(TWO*h2); - a[4] = (RCONST(2430.0)*tau2 + RCONST(2268.0)*tau + RCONST(405.0))/(TWO*h2); - a[5] = (RCONST(2430.0)*tau2 + RCONST(2592.0)*tau + RCONST(567.0))/(TWO*h2); + a[2] = (SUN_RCONST(810.0)*tau2 + SUN_RCONST(756.0)*tau + SUN_RCONST(147.0))/(TWO*h2); + a[3] = (SUN_RCONST(810.0)*tau2 + SUN_RCONST(864.0)*tau + SUN_RCONST(201.0))/(TWO*h2); + a[4] = (SUN_RCONST(2430.0)*tau2 + SUN_RCONST(2268.0)*tau + SUN_RCONST(405.0))/(TWO*h2); + a[5] = (SUN_RCONST(2430.0)*tau2 + SUN_RCONST(2592.0)*tau + SUN_RCONST(567.0))/(TWO*h2); } else if (d == 4) { - a[0] = (RCONST(6480.0)*tau + RCONST(3240.0))/h4; + a[0] = (SUN_RCONST(6480.0)*tau + SUN_RCONST(3240.0))/h4; a[1] = -a[0]; - a[2] = (RCONST(810.0)*tau + RCONST(378.0))/h3; - a[3] = (RCONST(810.0)*tau + RCONST(432.0))/h3; - a[4] = (RCONST(2430.0)*tau + RCONST(1134.0))/h3; - a[5] = (RCONST(2430.0)*tau + RCONST(1296.0))/h3; + a[2] = (SUN_RCONST(810.0)*tau + SUN_RCONST(378.0))/h3; + a[3] = (SUN_RCONST(810.0)*tau + SUN_RCONST(432.0))/h3; + a[4] = (SUN_RCONST(2430.0)*tau + SUN_RCONST(1134.0))/h3; + a[5] = (SUN_RCONST(2430.0)*tau + SUN_RCONST(1296.0))/h3; } else { /* d == 5 */ - a[0] = RCONST(6480.0)/h5; + a[0] = SUN_RCONST(6480.0)/h5; a[1] = -a[0]; - a[2] = RCONST(810.0)/h4; + a[2] = SUN_RCONST(810.0)/h4; a[3] = a[2]; - a[4] = RCONST(2430.0)/h4; + a[4] = SUN_RCONST(2430.0)/h4; a[5] = a[4]; } X[0] = HINT_YOLD(interp); @@ -1058,8 +1058,8 @@ int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp I, /* zero out history (to be safe) */ for (i=0; iuse_compensated_sums = SUNFALSE; ark_mem->fixedstep = SUNFALSE; /* default to use adaptive steps */ - ark_mem->reltol = RCONST(1.e-4); /* relative tolerance */ + ark_mem->reltol = SUN_RCONST(1.e-4); /* relative tolerance */ ark_mem->itol = ARK_SS; /* scalar-scalar solution tolerances */ ark_mem->ritol = ARK_SS; /* scalar-scalar residual tolerances */ - ark_mem->Sabstol = RCONST(1.e-9); /* solution absolute tolerance */ + ark_mem->Sabstol = SUN_RCONST(1.e-9); /* solution absolute tolerance */ ark_mem->atolmin0 = SUNFALSE; /* min(abstol) > 0 */ - ark_mem->SRabstol = RCONST(1.e-9); /* residual absolute tolerance */ + ark_mem->SRabstol = SUN_RCONST(1.e-9); /* residual absolute tolerance */ ark_mem->Ratolmin0 = SUNFALSE; /* min(Rabstol) > 0 */ ark_mem->user_efun = SUNFALSE; /* no user-supplied ewt function */ ark_mem->efun = arkEwtSetSS; /* built-in scalar-scalar ewt function */ @@ -774,7 +774,7 @@ int arkSetConstraints(void *arkode_mem, N_Vector constraints) /* Check the constraints vector */ temptest = N_VMaxNorm(constraints); - if ((temptest > RCONST(2.5)) || (temptest < HALF)) { + if ((temptest > SUN_RCONST(2.5)) || (temptest < HALF)) { arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", "ARKStepSetConstraints", MSG_ARK_BAD_CONSTR); return(ARK_ILL_INPUT); diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index d511a04062..c8539e37df 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -25,11 +25,11 @@ #include /* constants */ -#define MIN_INC_MULT RCONST(1000.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) #define MAX_DQITERS 3 /* max. # of attempts to recover in DQ J*v */ -#define ZERO RCONST(0.0) -#define PT25 RCONST(0.25) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define PT25 SUN_RCONST(0.25) +#define ONE SUN_RCONST(1.0) /* Prototypes for internal functions */ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, @@ -3295,7 +3295,7 @@ int arkLsInitializeMassCounters(ARKLsMassMem arkls_mem) arkls_mem->nli = 0; arkls_mem->nps = 0; arkls_mem->ncfl = 0; - arkls_mem->msetuptime = -BIG_REAL; + arkls_mem->msetuptime = -SUN_BIG_REAL; return(0); } diff --git a/src/arkode/arkode_ls_impl.h b/src/arkode/arkode_ls_impl.h index 6ce1f093fc..bfc0f5c55b 100644 --- a/src/arkode/arkode_ls_impl.h +++ b/src/arkode/arkode_ls_impl.h @@ -35,7 +35,7 @@ extern "C" { a tolerance on the linear iteration ---------------------------------------------------------------*/ #define ARKLS_MSBJ 51 -#define ARKLS_EPLIN RCONST(0.05) +#define ARKLS_EPLIN SUN_RCONST(0.05) /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_mri_tables.c b/src/arkode/arkode_mri_tables.c index 0458c5aa26..d2630ed35b 100644 --- a/src/arkode/arkode_mri_tables.c +++ b/src/arkode/arkode_mri_tables.c @@ -223,7 +223,7 @@ MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, MRISTEP_METHOD_TYPE type; MRIStepCoupling MRIC; - const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + const sunrealtype tol = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; /* Check that input table is non-NULL */ if (!B) return(NULL); @@ -544,7 +544,7 @@ int mriStepCoupling_GetStageType(MRIStepCoupling MRIC, int is) { int i; sunrealtype Gabs, cdiff; - const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + const sunrealtype tol = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; if ((is < 1) || (is >= MRIC->stages)) return ARK_INVALID_TABLE; @@ -586,7 +586,7 @@ int mriStepCoupling_GetStageMap(MRIStepCoupling MRIC, { int i, j, k, idx; sunrealtype Wsum, Gsum; - const sunrealtype tol = RCONST(100.0) * UNIT_ROUNDOFF; + const sunrealtype tol = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; /* ---------------------- * Check for valid inputs diff --git a/src/arkode/arkode_mri_tables.def b/src/arkode/arkode_mri_tables.def index c8b5b98e24..6cdf5400e6 100644 --- a/src/arkode/arkode_mri_tables.def +++ b/src/arkode/arkode_mri_tables.def @@ -62,14 +62,14 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK33a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ C->q = 3; C->p = 0; - C->c[1] = ONE/RCONST(3.0); - C->c[2] = TWO/RCONST(3.0); + C->c[1] = ONE/SUN_RCONST(3.0); + C->c[2] = TWO/SUN_RCONST(3.0); C->c[3] = ONE; - C->W[0][1][0] = ONE/RCONST(3.0); - C->W[0][2][0] = -ONE/RCONST(3.0); - C->W[0][2][1] = TWO/RCONST(3.0); - C->W[0][3][1] = -TWO/RCONST(3.0); + C->W[0][1][0] = ONE/SUN_RCONST(3.0); + C->W[0][2][0] = -ONE/SUN_RCONST(3.0); + C->W[0][2][1] = TWO/SUN_RCONST(3.0); + C->W[0][3][1] = -TWO/SUN_RCONST(3.0); C->W[0][3][2] = ONE; C->W[1][3][0] = ONE/TWO; @@ -83,42 +83,42 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK45a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ C->q = 4; C->p = 0; - C->c[1] = RCONST(0.2); - C->c[2] = RCONST(0.4); - C->c[3] = RCONST(0.6); - C->c[4] = RCONST(0.8); + C->c[1] = SUN_RCONST(0.2); + C->c[2] = SUN_RCONST(0.4); + C->c[3] = SUN_RCONST(0.6); + C->c[4] = SUN_RCONST(0.8); C->c[5] = ONE; - C->W[0][1][0] = RCONST(0.2); - C->W[0][2][0] = -RCONST(53.0)/RCONST(16.0); - C->W[0][2][1] = RCONST(281.0)/RCONST(80.0); - C->W[0][3][0] = -RCONST(36562993.0)/RCONST(71394880.0); - C->W[0][3][1] = RCONST(34903117.0)/RCONST(17848720.0); - C->W[0][3][2] = -RCONST(88770499.0)/RCONST(71394880.0); - C->W[0][4][0] = -RCONST(7631593.0)/RCONST(71394880.0); - C->W[0][4][1] = -RCONST(166232021.0)/RCONST(35697440.0); - C->W[0][4][2] = RCONST(6068517.0)/RCONST(1519040.0); - C->W[0][4][3] = RCONST(8644289.0)/RCONST(8924360.0); - C->W[0][5][0] = RCONST(277061.0)/RCONST(303808.0); - C->W[0][5][1] = -RCONST(209323.0)/RCONST(1139280.0); - C->W[0][5][2] = -RCONST(1360217.0)/RCONST(1139280.0); - C->W[0][5][3] = -RCONST(148789.0)/RCONST(56964.0); - C->W[0][5][4] = RCONST(147889.0)/RCONST(45120.0); - - C->W[1][2][0] = RCONST(503.0)/RCONST(80.0); - C->W[1][2][1] = -RCONST(503.0)/RCONST(80.0); - C->W[1][3][0] = -RCONST(1365537.0)/RCONST(35697440.0); - C->W[1][3][1] = RCONST(4963773.0)/RCONST(7139488.0); - C->W[1][3][2] = -RCONST(1465833.0)/RCONST(2231090.0); - C->W[1][4][0] = RCONST(66974357.0)/RCONST(35697440.0); - C->W[1][4][1] = RCONST(21445367.0)/RCONST(7139488.0); - C->W[1][4][2] = -RCONST(3.0); - C->W[1][4][3] = -RCONST(8388609.0)/RCONST(4462180.0); - C->W[1][5][0] = -RCONST(18227.0)/RCONST(7520.0); + C->W[0][1][0] = SUN_RCONST(0.2); + C->W[0][2][0] = -SUN_RCONST(53.0)/SUN_RCONST(16.0); + C->W[0][2][1] = SUN_RCONST(281.0)/SUN_RCONST(80.0); + C->W[0][3][0] = -SUN_RCONST(36562993.0)/SUN_RCONST(71394880.0); + C->W[0][3][1] = SUN_RCONST(34903117.0)/SUN_RCONST(17848720.0); + C->W[0][3][2] = -SUN_RCONST(88770499.0)/SUN_RCONST(71394880.0); + C->W[0][4][0] = -SUN_RCONST(7631593.0)/SUN_RCONST(71394880.0); + C->W[0][4][1] = -SUN_RCONST(166232021.0)/SUN_RCONST(35697440.0); + C->W[0][4][2] = SUN_RCONST(6068517.0)/SUN_RCONST(1519040.0); + C->W[0][4][3] = SUN_RCONST(8644289.0)/SUN_RCONST(8924360.0); + C->W[0][5][0] = SUN_RCONST(277061.0)/SUN_RCONST(303808.0); + C->W[0][5][1] = -SUN_RCONST(209323.0)/SUN_RCONST(1139280.0); + C->W[0][5][2] = -SUN_RCONST(1360217.0)/SUN_RCONST(1139280.0); + C->W[0][5][3] = -SUN_RCONST(148789.0)/SUN_RCONST(56964.0); + C->W[0][5][4] = SUN_RCONST(147889.0)/SUN_RCONST(45120.0); + + C->W[1][2][0] = SUN_RCONST(503.0)/SUN_RCONST(80.0); + C->W[1][2][1] = -SUN_RCONST(503.0)/SUN_RCONST(80.0); + C->W[1][3][0] = -SUN_RCONST(1365537.0)/SUN_RCONST(35697440.0); + C->W[1][3][1] = SUN_RCONST(4963773.0)/SUN_RCONST(7139488.0); + C->W[1][3][2] = -SUN_RCONST(1465833.0)/SUN_RCONST(2231090.0); + C->W[1][4][0] = SUN_RCONST(66974357.0)/SUN_RCONST(35697440.0); + C->W[1][4][1] = SUN_RCONST(21445367.0)/SUN_RCONST(7139488.0); + C->W[1][4][2] = -SUN_RCONST(3.0); + C->W[1][4][3] = -SUN_RCONST(8388609.0)/SUN_RCONST(4462180.0); + C->W[1][5][0] = -SUN_RCONST(18227.0)/SUN_RCONST(7520.0); C->W[1][5][1] = TWO; C->W[1][5][2] = ONE; - C->W[1][5][3] = RCONST(5.0); - C->W[1][5][4] = -RCONST(41933.0)/RCONST(7520.0); + C->W[1][5][3] = SUN_RCONST(5.0); + C->W[1][5][4] = -SUN_RCONST(41933.0)/SUN_RCONST(7520.0); return C; }) @@ -132,11 +132,11 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_IRK21a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ B->c[2] = ONE; B->A[1][0] = ONE; - B->A[2][0] = RCONST(0.5); - B->A[2][2] = RCONST(0.5); + B->A[2][0] = SUN_RCONST(0.5); + B->A[2][2] = SUN_RCONST(0.5); - B->b[0] = RCONST(0.5); - B->b[2] = RCONST(0.5); + B->b[0] = SUN_RCONST(0.5); + B->b[2] = SUN_RCONST(0.5); C = MRIStepCoupling_MIStoMRI(B, 2, 0); ARKodeButcherTable_Free(B); @@ -145,29 +145,29 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_IRK21a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK34a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 7, MRISTEP_IMPLICIT); - sunrealtype beta = RCONST(0.4358665215084589994160194511935568425); + sunrealtype beta = SUN_RCONST(0.4358665215084589994160194511935568425); C->q = 3; C->p = 0; - C->c[1] = ONE/RCONST(3.0); - C->c[2] = ONE/RCONST(3.0); - C->c[3] = TWO/RCONST(3.0); - C->c[4] = TWO/RCONST(3.0); + C->c[1] = ONE/SUN_RCONST(3.0); + C->c[2] = ONE/SUN_RCONST(3.0); + C->c[3] = TWO/SUN_RCONST(3.0); + C->c[4] = TWO/SUN_RCONST(3.0); C->c[5] = ONE; C->c[6] = ONE; - C->G[0][1][0] = ONE/RCONST(3.0); + C->G[0][1][0] = ONE/SUN_RCONST(3.0); C->G[0][2][0] = -beta; C->G[0][2][2] = beta; - C->G[0][3][0] = RCONST(-0.3045790611944504970424837655380884888); - C->G[0][3][2] = RCONST(0.6379123945277838303758170988714218222); - C->G[0][4][0] = RCONST(0.2116913105640266601676536489364004869); - C->G[0][4][2] = RCONST(-0.6475578320724856595836731001299573294); + C->G[0][3][0] = SUN_RCONST(-0.3045790611944504970424837655380884888); + C->G[0][3][2] = SUN_RCONST(0.6379123945277838303758170988714218222); + C->G[0][4][0] = SUN_RCONST(0.2116913105640266601676536489364004869); + C->G[0][4][2] = SUN_RCONST(-0.6475578320724856595836731001299573294); C->G[0][4][4] = beta; - C->G[0][5][0] = RCONST(0.4454209388055495029575162344619115112); - C->G[0][5][2] = RCONST(0.8813784805616198280398949036456491923); - C->G[0][5][4] = RCONST(-0.9934660860338359976640778047742273701); + C->G[0][5][0] = SUN_RCONST(0.4454209388055495029575162344619115112); + C->G[0][5][2] = SUN_RCONST(0.8813784805616198280398949036456491923); + C->G[0][5][4] = SUN_RCONST(-0.9934660860338359976640778047742273701); C->G[0][6][0] = -beta; C->G[0][6][6] = beta; return C; @@ -179,123 +179,123 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK46a, { /* A. Sandu, SINUM 57:2300-2327, 2019 C->q = 4; C->p = 0; - C->c[1] = ONE/RCONST(5.0); - C->c[2] = ONE/RCONST(5.0); - C->c[3] = TWO/RCONST(5.0); - C->c[4] = TWO/RCONST(5.0); - C->c[5] = RCONST(3.0)/RCONST(5.0); - C->c[6] = RCONST(3.0)/RCONST(5.0); - C->c[7] = RCONST(4.0)/RCONST(5.0); - C->c[8] = RCONST(4.0)/RCONST(5.0); + C->c[1] = ONE/SUN_RCONST(5.0); + C->c[2] = ONE/SUN_RCONST(5.0); + C->c[3] = TWO/SUN_RCONST(5.0); + C->c[4] = TWO/SUN_RCONST(5.0); + C->c[5] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + C->c[6] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + C->c[7] = SUN_RCONST(4.0)/SUN_RCONST(5.0); + C->c[8] = SUN_RCONST(4.0)/SUN_RCONST(5.0); C->c[9] = ONE; C->c[10] = ONE; - C->G[0][1][0] = ONE/RCONST(5.0); - C->G[0][2][0] = -ONE/RCONST(4.0); - C->G[0][2][2] = ONE/RCONST(4.0); - C->G[0][3][0] = RCONST(1771023115159.0)/RCONST(1929363690800.0); - C->G[0][3][2] = -RCONST(1385150376999.0)/RCONST(1929363690800.0); - C->G[0][4][0] = RCONST(914009.0)/RCONST(345800.0); - C->G[0][4][2] = -RCONST(1000459.0)/RCONST(345800.0); - C->G[0][4][4] = ONE/RCONST(4.0); - C->G[0][5][0] = RCONST(18386293581909.0)/RCONST(36657910125200.0); - C->G[0][5][2] = RCONST(5506531089.0)/RCONST(80566835440.0); - C->G[0][5][4] = -RCONST(178423463189.0)/RCONST(482340922700.0); - C->G[0][6][0] = RCONST(36036097.0)/RCONST(8299200.0); - C->G[0][6][2] = RCONST(4621.0)/RCONST(118560.0); - C->G[0][6][4] = -RCONST(38434367.0)/RCONST(8299200.0); - C->G[0][6][6] = ONE/RCONST(4.0); - C->G[0][7][0] = -RCONST(247809665162987.0)/RCONST(146631640500800.0); - C->G[0][7][2] = RCONST(10604946373579.0)/RCONST(14663164050080.0); - C->G[0][7][4] = RCONST(10838126175385.0)/RCONST(5865265620032.0); - C->G[0][7][6] = -RCONST(24966656214317.0)/RCONST(36657910125200.0); - C->G[0][8][0] = RCONST(38519701.0)/RCONST(11618880.0); - C->G[0][8][2] = RCONST(10517363.0)/RCONST(9682400.0); - C->G[0][8][4] = -RCONST(23284701.0)/RCONST(19364800.0); - C->G[0][8][6] = -RCONST(10018609.0)/RCONST(2904720.0); - C->G[0][8][8] = ONE/RCONST(4.0); - C->G[0][9][0] = -RCONST(52907807977903.0)/RCONST(33838070884800.0); - C->G[0][9][2] = RCONST(74846944529257.0)/RCONST(73315820250400.0); - C->G[0][9][4] = RCONST(365022522318171.0)/RCONST(146631640500800.0); - C->G[0][9][6] = -RCONST(20513210406809.0)/RCONST(109973730375600.0); - C->G[0][9][8] = -RCONST(2918009798.0)/RCONST(1870301537.0); - C->G[0][10][0] = RCONST(19.0)/RCONST(100.0); - C->G[0][10][2] = -RCONST(73.0)/RCONST(300.0); - C->G[0][10][4] = RCONST(127.0)/RCONST(300.0); - C->G[0][10][6] = RCONST(127.0)/RCONST(300.0); - C->G[0][10][8] = -RCONST(313.0)/RCONST(300.0); - C->G[0][10][10] = ONE/RCONST(4.0); - - C->G[1][3][0] = -RCONST(1674554930619.0)/RCONST(964681845400.0); - C->G[1][3][2] = RCONST(1674554930619.0)/RCONST(964681845400.0); - C->G[1][4][0] = -RCONST(1007739.0)/RCONST(172900.0); - C->G[1][4][2] = RCONST(1007739.0)/RCONST(172900.0); - C->G[1][5][0] = -RCONST(8450070574289.0)/RCONST(18328955062600.0); - C->G[1][5][2] = -RCONST(39429409169.0)/RCONST(40283417720.0); - C->G[1][5][4] = RCONST(173621393067.0)/RCONST(120585230675.0); - C->G[1][6][0] = -RCONST(122894383.0)/RCONST(16598400.0); - C->G[1][6][2] = RCONST(14501.0)/RCONST(237120.0); - C->G[1][6][4] = RCONST(121879313.0)/RCONST(16598400.0); - C->G[1][7][0] = RCONST(32410002731287.0)/RCONST(15434909526400.0); - C->G[1][7][2] = -RCONST(46499276605921.0)/RCONST(29326328100160.0); - C->G[1][7][4] = -RCONST(34914135774643.0)/RCONST(11730531240064.0); - C->G[1][7][6] = RCONST(45128506783177.0)/RCONST(18328955062600.0); - C->G[1][8][0] = -RCONST(128357303.0)/RCONST(23237760.0); - C->G[1][8][2] = -RCONST(35433927.0)/RCONST(19364800.0); - C->G[1][8][4] = RCONST(71038479.0)/RCONST(38729600.0); - C->G[1][8][6] = RCONST(8015933.0)/RCONST(1452360.0); - C->G[1][9][0] = RCONST(136721604296777.0)/RCONST(67676141769600.0); - C->G[1][9][2] = -RCONST(349632444539303.0)/RCONST(146631640500800.0); - C->G[1][9][4] = -RCONST(1292744859249609.0)/RCONST(293263281001600.0); - C->G[1][9][6] = RCONST(8356250416309.0)/RCONST(54986865187800.0); - C->G[1][9][8] = RCONST(17282943803.0)/RCONST(3740603074.0); - C->G[1][10][0] = RCONST(3.0)/RCONST(25.0); - C->G[1][10][2] = -RCONST(29.0)/RCONST(300.0); - C->G[1][10][4] = RCONST(71.0)/RCONST(300.0); - C->G[1][10][6] = RCONST(71.0)/RCONST(300.0); - C->G[1][10][8] = -RCONST(149.0)/RCONST(300.0); + C->G[0][1][0] = ONE/SUN_RCONST(5.0); + C->G[0][2][0] = -ONE/SUN_RCONST(4.0); + C->G[0][2][2] = ONE/SUN_RCONST(4.0); + C->G[0][3][0] = SUN_RCONST(1771023115159.0)/SUN_RCONST(1929363690800.0); + C->G[0][3][2] = -SUN_RCONST(1385150376999.0)/SUN_RCONST(1929363690800.0); + C->G[0][4][0] = SUN_RCONST(914009.0)/SUN_RCONST(345800.0); + C->G[0][4][2] = -SUN_RCONST(1000459.0)/SUN_RCONST(345800.0); + C->G[0][4][4] = ONE/SUN_RCONST(4.0); + C->G[0][5][0] = SUN_RCONST(18386293581909.0)/SUN_RCONST(36657910125200.0); + C->G[0][5][2] = SUN_RCONST(5506531089.0)/SUN_RCONST(80566835440.0); + C->G[0][5][4] = -SUN_RCONST(178423463189.0)/SUN_RCONST(482340922700.0); + C->G[0][6][0] = SUN_RCONST(36036097.0)/SUN_RCONST(8299200.0); + C->G[0][6][2] = SUN_RCONST(4621.0)/SUN_RCONST(118560.0); + C->G[0][6][4] = -SUN_RCONST(38434367.0)/SUN_RCONST(8299200.0); + C->G[0][6][6] = ONE/SUN_RCONST(4.0); + C->G[0][7][0] = -SUN_RCONST(247809665162987.0)/SUN_RCONST(146631640500800.0); + C->G[0][7][2] = SUN_RCONST(10604946373579.0)/SUN_RCONST(14663164050080.0); + C->G[0][7][4] = SUN_RCONST(10838126175385.0)/SUN_RCONST(5865265620032.0); + C->G[0][7][6] = -SUN_RCONST(24966656214317.0)/SUN_RCONST(36657910125200.0); + C->G[0][8][0] = SUN_RCONST(38519701.0)/SUN_RCONST(11618880.0); + C->G[0][8][2] = SUN_RCONST(10517363.0)/SUN_RCONST(9682400.0); + C->G[0][8][4] = -SUN_RCONST(23284701.0)/SUN_RCONST(19364800.0); + C->G[0][8][6] = -SUN_RCONST(10018609.0)/SUN_RCONST(2904720.0); + C->G[0][8][8] = ONE/SUN_RCONST(4.0); + C->G[0][9][0] = -SUN_RCONST(52907807977903.0)/SUN_RCONST(33838070884800.0); + C->G[0][9][2] = SUN_RCONST(74846944529257.0)/SUN_RCONST(73315820250400.0); + C->G[0][9][4] = SUN_RCONST(365022522318171.0)/SUN_RCONST(146631640500800.0); + C->G[0][9][6] = -SUN_RCONST(20513210406809.0)/SUN_RCONST(109973730375600.0); + C->G[0][9][8] = -SUN_RCONST(2918009798.0)/SUN_RCONST(1870301537.0); + C->G[0][10][0] = SUN_RCONST(19.0)/SUN_RCONST(100.0); + C->G[0][10][2] = -SUN_RCONST(73.0)/SUN_RCONST(300.0); + C->G[0][10][4] = SUN_RCONST(127.0)/SUN_RCONST(300.0); + C->G[0][10][6] = SUN_RCONST(127.0)/SUN_RCONST(300.0); + C->G[0][10][8] = -SUN_RCONST(313.0)/SUN_RCONST(300.0); + C->G[0][10][10] = ONE/SUN_RCONST(4.0); + + C->G[1][3][0] = -SUN_RCONST(1674554930619.0)/SUN_RCONST(964681845400.0); + C->G[1][3][2] = SUN_RCONST(1674554930619.0)/SUN_RCONST(964681845400.0); + C->G[1][4][0] = -SUN_RCONST(1007739.0)/SUN_RCONST(172900.0); + C->G[1][4][2] = SUN_RCONST(1007739.0)/SUN_RCONST(172900.0); + C->G[1][5][0] = -SUN_RCONST(8450070574289.0)/SUN_RCONST(18328955062600.0); + C->G[1][5][2] = -SUN_RCONST(39429409169.0)/SUN_RCONST(40283417720.0); + C->G[1][5][4] = SUN_RCONST(173621393067.0)/SUN_RCONST(120585230675.0); + C->G[1][6][0] = -SUN_RCONST(122894383.0)/SUN_RCONST(16598400.0); + C->G[1][6][2] = SUN_RCONST(14501.0)/SUN_RCONST(237120.0); + C->G[1][6][4] = SUN_RCONST(121879313.0)/SUN_RCONST(16598400.0); + C->G[1][7][0] = SUN_RCONST(32410002731287.0)/SUN_RCONST(15434909526400.0); + C->G[1][7][2] = -SUN_RCONST(46499276605921.0)/SUN_RCONST(29326328100160.0); + C->G[1][7][4] = -SUN_RCONST(34914135774643.0)/SUN_RCONST(11730531240064.0); + C->G[1][7][6] = SUN_RCONST(45128506783177.0)/SUN_RCONST(18328955062600.0); + C->G[1][8][0] = -SUN_RCONST(128357303.0)/SUN_RCONST(23237760.0); + C->G[1][8][2] = -SUN_RCONST(35433927.0)/SUN_RCONST(19364800.0); + C->G[1][8][4] = SUN_RCONST(71038479.0)/SUN_RCONST(38729600.0); + C->G[1][8][6] = SUN_RCONST(8015933.0)/SUN_RCONST(1452360.0); + C->G[1][9][0] = SUN_RCONST(136721604296777.0)/SUN_RCONST(67676141769600.0); + C->G[1][9][2] = -SUN_RCONST(349632444539303.0)/SUN_RCONST(146631640500800.0); + C->G[1][9][4] = -SUN_RCONST(1292744859249609.0)/SUN_RCONST(293263281001600.0); + C->G[1][9][6] = SUN_RCONST(8356250416309.0)/SUN_RCONST(54986865187800.0); + C->G[1][9][8] = SUN_RCONST(17282943803.0)/SUN_RCONST(3740603074.0); + C->G[1][10][0] = SUN_RCONST(3.0)/SUN_RCONST(25.0); + C->G[1][10][2] = -SUN_RCONST(29.0)/SUN_RCONST(300.0); + C->G[1][10][4] = SUN_RCONST(71.0)/SUN_RCONST(300.0); + C->G[1][10][6] = SUN_RCONST(71.0)/SUN_RCONST(300.0); + C->G[1][10][8] = -SUN_RCONST(149.0)/SUN_RCONST(300.0); return C; }) ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK3a, { /* R. Chinomona & D. Reynolds SINUM 43(5):A3082-A3113, 2021 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 8, MRISTEP_IMEX); - sunrealtype beta = RCONST(0.4358665215084589994160194511935568425); + sunrealtype beta = SUN_RCONST(0.4358665215084589994160194511935568425); C->q = 3; C->p = 0; C->c[1] = beta; C->c[2] = beta; - C->c[3] = RCONST(0.7179332607542294997080097255967784213); - C->c[4] = RCONST(0.7179332607542294997080097255967784213); + C->c[3] = SUN_RCONST(0.7179332607542294997080097255967784213); + C->c[4] = SUN_RCONST(0.7179332607542294997080097255967784213); C->c[5] = ONE; C->c[6] = ONE; C->c[7] = ONE; C->W[0][1][0] = beta; - C->W[0][3][0] = -RCONST(0.5688715801234400928465032925317932021); - C->W[0][3][2] = RCONST(0.8509383193692105931384935669350147809); - C->W[0][4][0] = RCONST(0.454283944643608855878770886900124654); - C->W[0][4][2] = -RCONST(0.454283944643608855878770886900124654); - C->W[0][5][0] = -RCONST(0.4271371821005074011706645050390732474); - C->W[0][5][2] = RCONST(0.1562747733103380821014660497037023496); - C->W[0][5][4] = RCONST(0.5529291480359398193611887297385924765); - C->W[0][7][0] = RCONST(0.105858296071879638722377459477184953); - C->W[0][7][2] = RCONST(0.655567501140070250975288954324730635); - C->W[0][7][4] = -RCONST(1.197292318720408889113685864995472431); + C->W[0][3][0] = -SUN_RCONST(0.5688715801234400928465032925317932021); + C->W[0][3][2] = SUN_RCONST(0.8509383193692105931384935669350147809); + C->W[0][4][0] = SUN_RCONST(0.454283944643608855878770886900124654); + C->W[0][4][2] = -SUN_RCONST(0.454283944643608855878770886900124654); + C->W[0][5][0] = -SUN_RCONST(0.4271371821005074011706645050390732474); + C->W[0][5][2] = SUN_RCONST(0.1562747733103380821014660497037023496); + C->W[0][5][4] = SUN_RCONST(0.5529291480359398193611887297385924765); + C->W[0][7][0] = SUN_RCONST(0.105858296071879638722377459477184953); + C->W[0][7][2] = SUN_RCONST(0.655567501140070250975288954324730635); + C->W[0][7][4] = -SUN_RCONST(1.197292318720408889113685864995472431); C->W[0][7][6] = beta; C->G[0][1][0] = beta; C->G[0][2][0] = -beta; C->G[0][2][2] = beta; - C->G[0][3][0] = -RCONST(0.4103336962288525014599513720161078937); - C->G[0][3][2] = RCONST(0.6924004354746230017519416464193294724); - C->G[0][4][0] = RCONST(0.4103336962288525014599513720161078937); - C->G[0][4][2] = -RCONST(0.8462002177373115008759708232096647362); + C->G[0][3][0] = -SUN_RCONST(0.4103336962288525014599513720161078937); + C->G[0][3][2] = SUN_RCONST(0.6924004354746230017519416464193294724); + C->G[0][4][0] = SUN_RCONST(0.4103336962288525014599513720161078937); + C->G[0][4][2] = -SUN_RCONST(0.8462002177373115008759708232096647362); C->G[0][4][4] = beta; C->G[0][5][0] = beta; - C->G[0][5][2] = RCONST(0.9264299099302395700444874096601015328); - C->G[0][5][4] = -RCONST(1.080229692192928069168516586450436797); + C->G[0][5][2] = SUN_RCONST(0.9264299099302395700444874096601015328); + C->G[0][5][4] = -SUN_RCONST(1.080229692192928069168516586450436797); C->G[0][6][0] = -beta; C->G[0][6][6] = beta; return C; @@ -303,49 +303,49 @@ ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK3a, { /* R. Chinomona & D. Reynolds SINUM 43(5 ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK3b, { /* R. Chinomona & D. Reynolds SINUM 43(5):A3082-A3113, 2021 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 8, MRISTEP_IMEX); - sunrealtype beta = RCONST(0.4358665215084589994160194511935568425); + sunrealtype beta = SUN_RCONST(0.4358665215084589994160194511935568425); C->q = 3; C->p = 0; C->c[1] = beta; C->c[2] = beta; - C->c[3] = RCONST(0.7179332607542294997080097255967784213); - C->c[4] = RCONST(0.7179332607542294997080097255967784213); + C->c[3] = SUN_RCONST(0.7179332607542294997080097255967784213); + C->c[4] = SUN_RCONST(0.7179332607542294997080097255967784213); C->c[5] = ONE; C->c[6] = ONE; C->c[7] = ONE; C->W[0][1][0] = beta; - C->W[0][3][0] = -RCONST(0.1750145285570467590610670000018749059); - C->W[0][3][2] = RCONST(0.4570812678028172593530572744050964846); - C->W[0][4][0] = RCONST(0.06042689307721552209333459437020635774); - C->W[0][4][2] = -RCONST(0.06042689307721552209333459437020635774); - C->W[0][5][0] = RCONST(0.1195213959425454440038786034027936869); - C->W[0][5][2] = -RCONST(1.84372522668966191789853395029629765); - C->W[0][5][4] = RCONST(2.006270569992886974186645621296725542); - C->W[0][6][0] = -RCONST(0.5466585780430528451745431084418669343); - C->W[0][6][2] = RCONST(2.0); - C->W[0][6][4] = -RCONST(1.453341421956947154825456891558133066); - C->W[0][7][0] = RCONST(0.105858296071879638722377459477184953); - C->W[0][7][2] = RCONST(0.655567501140070250975288954324730635); - C->W[0][7][4] = -RCONST(1.197292318720408889113685864995472431); + C->W[0][3][0] = -SUN_RCONST(0.1750145285570467590610670000018749059); + C->W[0][3][2] = SUN_RCONST(0.4570812678028172593530572744050964846); + C->W[0][4][0] = SUN_RCONST(0.06042689307721552209333459437020635774); + C->W[0][4][2] = -SUN_RCONST(0.06042689307721552209333459437020635774); + C->W[0][5][0] = SUN_RCONST(0.1195213959425454440038786034027936869); + C->W[0][5][2] = -SUN_RCONST(1.84372522668966191789853395029629765); + C->W[0][5][4] = SUN_RCONST(2.006270569992886974186645621296725542); + C->W[0][6][0] = -SUN_RCONST(0.5466585780430528451745431084418669343); + C->W[0][6][2] = SUN_RCONST(2.0); + C->W[0][6][4] = -SUN_RCONST(1.453341421956947154825456891558133066); + C->W[0][7][0] = SUN_RCONST(0.105858296071879638722377459477184953); + C->W[0][7][2] = SUN_RCONST(0.655567501140070250975288954324730635); + C->W[0][7][4] = -SUN_RCONST(1.197292318720408889113685864995472431); C->W[0][7][6] = beta; C->G[0][1][0] = beta; C->G[0][2][0] = -beta; C->G[0][2][2] = beta; - C->G[0][3][0] = RCONST(0.0414273753564414837153799230278275639); - C->G[0][3][2] = RCONST(0.2406393638893290165766103513753940148); - C->G[0][4][0] = -RCONST(0.0414273753564414837153799230278275639); - C->G[0][4][2] = -RCONST(0.3944391461520175157006395281657292786); + C->G[0][3][0] = SUN_RCONST(0.0414273753564414837153799230278275639); + C->G[0][3][2] = SUN_RCONST(0.2406393638893290165766103513753940148); + C->G[0][4][0] = -SUN_RCONST(0.0414273753564414837153799230278275639); + C->G[0][4][2] = -SUN_RCONST(0.3944391461520175157006395281657292786); C->G[0][4][4] = beta; - C->G[0][5][0] = RCONST(0.1123373143006047802633543416889605123); - C->G[0][5][2] = RCONST(1.051807513648115027700693049638099167); - C->G[0][5][4] = -RCONST(0.8820780887029493076720571169238381009); - C->G[0][6][0] = -RCONST(0.1123373143006047802633543416889605123); - C->G[0][6][2] = -RCONST(0.1253776037178754576562056399779976346); - C->G[0][6][4] = -RCONST(0.1981516034899787614964594695265986957); + C->G[0][5][0] = SUN_RCONST(0.1123373143006047802633543416889605123); + C->G[0][5][2] = SUN_RCONST(1.051807513648115027700693049638099167); + C->G[0][5][4] = -SUN_RCONST(0.8820780887029493076720571169238381009); + C->G[0][6][0] = -SUN_RCONST(0.1123373143006047802633543416889605123); + C->G[0][6][2] = -SUN_RCONST(0.1253776037178754576562056399779976346); + C->G[0][6][4] = -SUN_RCONST(0.1981516034899787614964594695265986957); C->G[0][6][6] = beta; return C; }) @@ -356,111 +356,111 @@ ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK4, { /* R. Chinomona & D. Reynolds SINUM 43(5) C->q = 4; C->p = 0; - C->c[1] = RCONST(0.5); - C->c[2] = RCONST(0.5); - C->c[3] = RCONST(0.625); - C->c[4] = RCONST(0.625); - C->c[5] = RCONST(0.75); - C->c[6] = RCONST(0.75); - C->c[7] = RCONST(0.875); - C->c[8] = RCONST(0.875); + C->c[1] = SUN_RCONST(0.5); + C->c[2] = SUN_RCONST(0.5); + C->c[3] = SUN_RCONST(0.625); + C->c[4] = SUN_RCONST(0.625); + C->c[5] = SUN_RCONST(0.75); + C->c[6] = SUN_RCONST(0.75); + C->c[7] = SUN_RCONST(0.875); + C->c[8] = SUN_RCONST(0.875); C->c[9] = ONE; C->c[10] = ONE; C->c[11] = ONE; - C->W[0][1][0] = RCONST(0.5); - C->W[0][3][0] = -RCONST(1.91716534363662868878172216064946905); - C->W[0][3][2] = RCONST(2.04216534363662868878172216064946905); - C->W[0][4][0] = -RCONST(0.4047510318011059426979159070469904691); - C->W[0][4][2] = RCONST(0.4047510318011059426979159070469904691); - C->W[0][5][0] = RCONST(11.45146602249221636665698028602631728); - C->W[0][5][2] = -RCONST(30.21075747526504271440647815573950607); - C->W[0][5][4] = RCONST(18.88429145277282634774949786971318879); - C->W[0][6][0] = -RCONST(0.7090335647602614506847116729463301439); - C->W[0][6][2] = RCONST(1.03030720858751876652616190884004718); - C->W[0][6][4] = -RCONST(0.3212736438272573158414502358937170357); - C->W[0][7][0] = -RCONST(29.99548716455828439840910684944199275); - C->W[0][7][2] = RCONST(37.60598277499180180536489685624385701); - C->W[0][7][4] = RCONST(0.3212736438272573158414502358937170357); - C->W[0][7][6] = -RCONST(7.806769254260774722797240242695581295); - C->W[0][8][0] = RCONST(3.104665054272962116338769391849124223); - C->W[0][8][2] = -RCONST(2.430325019757162297132065927415566359); - C->W[0][8][4] = -RCONST(1.905479301151524635219201659483842131); - C->W[0][8][6] = RCONST(1.231139266635724816012498195050284266); - C->W[0][9][0] = -RCONST(2.424429547752047869875875914355514008); - C->W[0][9][2] = RCONST(2.430325019757162297132065927415566359); - C->W[0][9][4] = RCONST(1.905479301151524635219201659483842131); - C->W[0][9][6] = -RCONST(1.231139266635724816012498195050284266); - C->W[0][9][8] = -RCONST(0.555235506520914246462893477493610215); - C->W[0][10][0] = -RCONST(0.01044135044479748590294518945165354204); - C->W[0][10][2] = RCONST(0.07260303614655074505152104505488141613); - C->W[0][10][4] = -RCONST(0.1288275951677260952239454098576424313); - C->W[0][10][6] = RCONST(0.1129355350093823566139440107122154084); - C->W[0][10][8] = -RCONST(0.04626962554340952053857445645780085125); - C->W[0][11][0] = -RCONST(0.8108522787762101328175789228607932098); - C->W[0][11][2] = RCONST(0.2560073199220492435001562192140882299); - C->W[0][11][4] = RCONST(0.8068294072697527893665866422787819475); - C->W[0][11][6] = -RCONST(0.4557148228721823795105894821742761164); - C->W[0][11][8] = -RCONST(0.04626962554340952053857445645780085125); - C->W[0][11][10] = RCONST(0.25); - - C->W[1][3][0] = RCONST(4.084330687273257377563444321298938099); - C->W[1][3][2] = -RCONST(4.084330687273257377563444321298938099); - C->W[1][5][0] = -RCONST(21.84342998138222084791812875795865363); - C->W[1][5][2] = RCONST(59.61201288692787354341712449738503121); - C->W[1][5][4] = -RCONST(37.76858290554565269549899573942637758); - C->W[1][7][0] = RCONST(61.65904145863709169818763704477664579); - C->W[1][7][2] = -RCONST(77.27257996715864114378211753016780838); - C->W[1][7][6] = RCONST(15.61353850852154944559448048539116259); - C->W[1][9][0] = -RCONST(1.11047101304182849292578695498722043); - C->W[1][9][8] = RCONST(1.11047101304182849292578695498722043); - - C->G[0][1][0] = RCONST(0.5); - C->G[0][2][0] = -RCONST(0.25); - C->G[0][2][2] = RCONST(0.25); - C->G[0][3][0] = -RCONST(3.977281248108488183067033851462278892); - C->G[0][3][2] = RCONST(4.102281248108488183067033851462278892); - C->G[0][4][0] = -RCONST(0.06905388741401691232724147084809374064); - C->G[0][4][2] = -RCONST(0.1809461125859830876727585291519062594); - C->G[0][4][4] = RCONST(0.25); - C->G[0][5][0] = -RCONST(1.761767663757920528863378964822412405); - C->G[0][5][2] = RCONST(2.694524698377298610155338150791461384); - C->G[0][5][4] = -RCONST(0.8077570346193780812919591859690489783); - C->G[0][6][0] = RCONST(0.5558721791553969487305081009588084962); - C->G[0][6][2] = -RCONST(0.6799140501579995013958501527883486949); - C->G[0][6][4] = -RCONST(0.1259581289973974473346579481704598013); - C->G[0][6][6] = RCONST(0.25); - C->G[0][7][0] = -RCONST(5.840176028724955954446426657541065113); - C->G[0][7][2] = RCONST(8.174456684291915089191270805710716374); - C->G[0][7][4] = RCONST(0.1259581289973974473346579481704598013); - C->G[0][7][6] = -RCONST(2.335238784564356582079502096340111063); - C->G[0][8][0] = -RCONST(1.906792645167811808094759305036052304); - C->G[0][8][2] = -RCONST(1.547057811385123933632984579249388443); - C->G[0][8][4] = RCONST(4.129888013149350305954491738020313225); - C->G[0][8][6] = -RCONST(0.9260375565964145642267478537348724775); - C->G[0][8][8] = RCONST(0.25); - C->G[0][9][0] = RCONST(3.337028151688726054557652782529662519); - C->G[0][9][2] = RCONST(1.547057811385123933632984579249388443); - C->G[0][9][4] = -RCONST(4.129888013149350305954491738020313225); - C->G[0][9][6] = RCONST(0.9260375565964145642267478537348724775); - C->G[0][9][8] = -RCONST(1.555235506520914246462893477493610215); - C->G[0][10][0] = -RCONST(0.8212936292210076187205241123124467518); - C->G[0][10][2] = RCONST(0.328610356068599988551677264268969646); - C->G[0][10][4] = RCONST(0.6780018121020266941426412324211395162); - C->G[0][10][6] = -RCONST(0.3427792878628000228966454714620607079); - C->G[0][10][8] = -RCONST(0.0925392510868190410771489129156017025); - C->G[0][10][10] = RCONST(0.25); - - C->G[1][3][0] = RCONST(8.704562496216976366134067702924557783); - C->G[1][3][2] = -RCONST(8.704562496216976366134067702924557783); - C->G[1][5][0] = RCONST(3.911643102343874882381240871341012292); - C->G[1][5][2] = -RCONST(5.027157171582631044965159243279110249); - C->G[1][5][4] = RCONST(1.115514069238756162583918371938097957); - C->G[1][7][0] = RCONST(10.81860769913911801143183711316451323); - C->G[1][7][2] = -RCONST(14.98908526826783117559084130584473536); - C->G[1][7][6] = RCONST(4.170477569128713164159004192680222125); - C->G[1][9][0] = -RCONST(2.61047101304182849292578695498722043); - C->G[1][9][8] = RCONST(2.61047101304182849292578695498722043); + C->W[0][1][0] = SUN_RCONST(0.5); + C->W[0][3][0] = -SUN_RCONST(1.91716534363662868878172216064946905); + C->W[0][3][2] = SUN_RCONST(2.04216534363662868878172216064946905); + C->W[0][4][0] = -SUN_RCONST(0.4047510318011059426979159070469904691); + C->W[0][4][2] = SUN_RCONST(0.4047510318011059426979159070469904691); + C->W[0][5][0] = SUN_RCONST(11.45146602249221636665698028602631728); + C->W[0][5][2] = -SUN_RCONST(30.21075747526504271440647815573950607); + C->W[0][5][4] = SUN_RCONST(18.88429145277282634774949786971318879); + C->W[0][6][0] = -SUN_RCONST(0.7090335647602614506847116729463301439); + C->W[0][6][2] = SUN_RCONST(1.03030720858751876652616190884004718); + C->W[0][6][4] = -SUN_RCONST(0.3212736438272573158414502358937170357); + C->W[0][7][0] = -SUN_RCONST(29.99548716455828439840910684944199275); + C->W[0][7][2] = SUN_RCONST(37.60598277499180180536489685624385701); + C->W[0][7][4] = SUN_RCONST(0.3212736438272573158414502358937170357); + C->W[0][7][6] = -SUN_RCONST(7.806769254260774722797240242695581295); + C->W[0][8][0] = SUN_RCONST(3.104665054272962116338769391849124223); + C->W[0][8][2] = -SUN_RCONST(2.430325019757162297132065927415566359); + C->W[0][8][4] = -SUN_RCONST(1.905479301151524635219201659483842131); + C->W[0][8][6] = SUN_RCONST(1.231139266635724816012498195050284266); + C->W[0][9][0] = -SUN_RCONST(2.424429547752047869875875914355514008); + C->W[0][9][2] = SUN_RCONST(2.430325019757162297132065927415566359); + C->W[0][9][4] = SUN_RCONST(1.905479301151524635219201659483842131); + C->W[0][9][6] = -SUN_RCONST(1.231139266635724816012498195050284266); + C->W[0][9][8] = -SUN_RCONST(0.555235506520914246462893477493610215); + C->W[0][10][0] = -SUN_RCONST(0.01044135044479748590294518945165354204); + C->W[0][10][2] = SUN_RCONST(0.07260303614655074505152104505488141613); + C->W[0][10][4] = -SUN_RCONST(0.1288275951677260952239454098576424313); + C->W[0][10][6] = SUN_RCONST(0.1129355350093823566139440107122154084); + C->W[0][10][8] = -SUN_RCONST(0.04626962554340952053857445645780085125); + C->W[0][11][0] = -SUN_RCONST(0.8108522787762101328175789228607932098); + C->W[0][11][2] = SUN_RCONST(0.2560073199220492435001562192140882299); + C->W[0][11][4] = SUN_RCONST(0.8068294072697527893665866422787819475); + C->W[0][11][6] = -SUN_RCONST(0.4557148228721823795105894821742761164); + C->W[0][11][8] = -SUN_RCONST(0.04626962554340952053857445645780085125); + C->W[0][11][10] = SUN_RCONST(0.25); + + C->W[1][3][0] = SUN_RCONST(4.084330687273257377563444321298938099); + C->W[1][3][2] = -SUN_RCONST(4.084330687273257377563444321298938099); + C->W[1][5][0] = -SUN_RCONST(21.84342998138222084791812875795865363); + C->W[1][5][2] = SUN_RCONST(59.61201288692787354341712449738503121); + C->W[1][5][4] = -SUN_RCONST(37.76858290554565269549899573942637758); + C->W[1][7][0] = SUN_RCONST(61.65904145863709169818763704477664579); + C->W[1][7][2] = -SUN_RCONST(77.27257996715864114378211753016780838); + C->W[1][7][6] = SUN_RCONST(15.61353850852154944559448048539116259); + C->W[1][9][0] = -SUN_RCONST(1.11047101304182849292578695498722043); + C->W[1][9][8] = SUN_RCONST(1.11047101304182849292578695498722043); + + C->G[0][1][0] = SUN_RCONST(0.5); + C->G[0][2][0] = -SUN_RCONST(0.25); + C->G[0][2][2] = SUN_RCONST(0.25); + C->G[0][3][0] = -SUN_RCONST(3.977281248108488183067033851462278892); + C->G[0][3][2] = SUN_RCONST(4.102281248108488183067033851462278892); + C->G[0][4][0] = -SUN_RCONST(0.06905388741401691232724147084809374064); + C->G[0][4][2] = -SUN_RCONST(0.1809461125859830876727585291519062594); + C->G[0][4][4] = SUN_RCONST(0.25); + C->G[0][5][0] = -SUN_RCONST(1.761767663757920528863378964822412405); + C->G[0][5][2] = SUN_RCONST(2.694524698377298610155338150791461384); + C->G[0][5][4] = -SUN_RCONST(0.8077570346193780812919591859690489783); + C->G[0][6][0] = SUN_RCONST(0.5558721791553969487305081009588084962); + C->G[0][6][2] = -SUN_RCONST(0.6799140501579995013958501527883486949); + C->G[0][6][4] = -SUN_RCONST(0.1259581289973974473346579481704598013); + C->G[0][6][6] = SUN_RCONST(0.25); + C->G[0][7][0] = -SUN_RCONST(5.840176028724955954446426657541065113); + C->G[0][7][2] = SUN_RCONST(8.174456684291915089191270805710716374); + C->G[0][7][4] = SUN_RCONST(0.1259581289973974473346579481704598013); + C->G[0][7][6] = -SUN_RCONST(2.335238784564356582079502096340111063); + C->G[0][8][0] = -SUN_RCONST(1.906792645167811808094759305036052304); + C->G[0][8][2] = -SUN_RCONST(1.547057811385123933632984579249388443); + C->G[0][8][4] = SUN_RCONST(4.129888013149350305954491738020313225); + C->G[0][8][6] = -SUN_RCONST(0.9260375565964145642267478537348724775); + C->G[0][8][8] = SUN_RCONST(0.25); + C->G[0][9][0] = SUN_RCONST(3.337028151688726054557652782529662519); + C->G[0][9][2] = SUN_RCONST(1.547057811385123933632984579249388443); + C->G[0][9][4] = -SUN_RCONST(4.129888013149350305954491738020313225); + C->G[0][9][6] = SUN_RCONST(0.9260375565964145642267478537348724775); + C->G[0][9][8] = -SUN_RCONST(1.555235506520914246462893477493610215); + C->G[0][10][0] = -SUN_RCONST(0.8212936292210076187205241123124467518); + C->G[0][10][2] = SUN_RCONST(0.328610356068599988551677264268969646); + C->G[0][10][4] = SUN_RCONST(0.6780018121020266941426412324211395162); + C->G[0][10][6] = -SUN_RCONST(0.3427792878628000228966454714620607079); + C->G[0][10][8] = -SUN_RCONST(0.0925392510868190410771489129156017025); + C->G[0][10][10] = SUN_RCONST(0.25); + + C->G[1][3][0] = SUN_RCONST(8.704562496216976366134067702924557783); + C->G[1][3][2] = -SUN_RCONST(8.704562496216976366134067702924557783); + C->G[1][5][0] = SUN_RCONST(3.911643102343874882381240871341012292); + C->G[1][5][2] = -SUN_RCONST(5.027157171582631044965159243279110249); + C->G[1][5][4] = SUN_RCONST(1.115514069238756162583918371938097957); + C->G[1][7][0] = SUN_RCONST(10.81860769913911801143183711316451323); + C->G[1][7][2] = -SUN_RCONST(14.98908526826783117559084130584473536); + C->G[1][7][6] = SUN_RCONST(4.170477569128713164159004192680222125); + C->G[1][9][0] = -SUN_RCONST(2.61047101304182849292578695498722043); + C->G[1][9][8] = SUN_RCONST(2.61047101304182849292578695498722043); return C; }) diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 32f7ae18a7..016b8d582e 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -235,7 +235,7 @@ int MRIStepResize(void *arkode_mem, N_Vector y0, sunrealtype t0, ark_mem->liw1 = liw1; /* resize ARKODE infrastructure memory (use hscale = 1.0) */ - retval = arkResize(ark_mem, y0, RCONST(1.0), t0, resize, resize_data); + retval = arkResize(ark_mem, y0, SUN_RCONST(1.0), t0, resize, resize_data); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, "ARKODE::MRIStep", "MRIStepResize", "Unable to resize main ARKODE infrastructure"); @@ -1803,7 +1803,7 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) booleantype okay; ARKodeMRIStepMem step_mem; sunrealtype Gabs, Wabs; - const sunrealtype tol = RCONST(100.0)*UNIT_ROUNDOFF; + const sunrealtype tol = SUN_RCONST(100.0)*SUN_UNIT_ROUNDOFF; /* access ARKodeMRIStepMem structure */ if (ark_mem->step_mem==NULL) { @@ -1863,7 +1863,7 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) /* Check that W tables are strictly lower triangular */ if (step_mem->MRIC->W) { - Wabs = RCONST(0.0); + Wabs = SUN_RCONST(0.0); for (k=0; kMRIC->nmat; k++) for (i=0; iMRIC->stages; i++) for (j=i; jMRIC->stages; j++) @@ -1878,7 +1878,7 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) /* Check that G tables are lower triangular */ if (step_mem->MRIC->G) { - Gabs = RCONST(0.0); + Gabs = SUN_RCONST(0.0); for (k=0; kMRIC->nmat; k++) for (i=0; iMRIC->stages; i++) for (j=i+1; jMRIC->stages; j++) diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index f2200dfcd3..aad446990c 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -39,12 +39,12 @@ extern "C" { /* Implicit solver constants (duplicate from arkode_arkstep_impl.h) */ #define MAXCOR 3 /* max number of nonlinear iterations */ -#define CRDOWN RCONST(0.3) /* constant to estimate the convergence +#define CRDOWN SUN_RCONST(0.3) /* constant to estimate the convergence rate for the nonlinear equation */ -#define DGMAX RCONST(0.2) /* if |gamma/gammap-1| > DGMAX then call lsetup */ -#define RDIV RCONST(2.3) /* declare divergence if ratio del/delp > RDIV */ +#define DGMAX SUN_RCONST(0.2) /* if |gamma/gammap-1| > DGMAX then call lsetup */ +#define RDIV SUN_RCONST(2.3) /* declare divergence if ratio del/delp > RDIV */ #define MSBP 20 /* max no. of steps between lsetup calls */ -#define NLSCOEF RCONST(0.1) +#define NLSCOEF SUN_RCONST(0.1) /*=============================================================== MRI time step module data structure diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 3e80940f99..88a721664e 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -261,7 +261,7 @@ int MRIStepSetLinear(void *arkode_mem, int timedepend) /* set parameters */ step_mem->linear = SUNTRUE; step_mem->linear_timedep = (timedepend == 1); - step_mem->dgmax = RCONST(100.0)*UNIT_ROUNDOFF; + step_mem->dgmax = SUN_RCONST(100.0)*SUN_UNIT_ROUNDOFF; return(ARK_SUCCESS); } diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index e62934b874..a705605ba2 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -311,7 +311,7 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag) N_VConst(ZERO, step_mem->zcor); /* Reset the stored residual norm (for iterative linear solvers) */ - step_mem->eRNrm = RCONST(0.1) * step_mem->nlscoef; + step_mem->eRNrm = SUN_RCONST(0.1) * step_mem->nlscoef; /* solve the nonlinear system for the actual correction */ retval = SUNNonlinSolSolve(step_mem->NLS, step_mem->zpred, step_mem->zcor, diff --git a/src/arkode/arkode_root_impl.h b/src/arkode/arkode_root_impl.h index 38854de58e..c3d4007983 100644 --- a/src/arkode/arkode_root_impl.h +++ b/src/arkode/arkode_root_impl.h @@ -34,7 +34,7 @@ extern "C" { #define ARK_ROOT_LIW 12 /* int, ptr, etc */ /* Numeric constants */ -#define HUND RCONST(100.0) /* real 100.0 */ +#define HUND SUN_RCONST(100.0) /* real 100.0 */ /*=============================================================== diff --git a/src/arkode/xbraid/arkode_xbraid.c b/src/arkode/xbraid/arkode_xbraid.c index c8b9f28169..24942b02b2 100644 --- a/src/arkode/xbraid/arkode_xbraid.c +++ b/src/arkode/xbraid/arkode_xbraid.c @@ -21,7 +21,7 @@ #include "arkode_xbraid_impl.h" #include "arkode_arkstep_impl.h" -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* ------------------------------- diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index ded4785102..fb9a10f775 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -32,21 +32,21 @@ /* CVODE Private Constants */ /*=================================================================*/ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define TINY RCONST(1.0e-10) /* small number */ -#define PT1 RCONST(0.1) /* real 0.1 */ -#define POINT2 RCONST(0.2) /* real 0.2 */ -#define FOURTH RCONST(0.25) /* real 0.25 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define PT9 RCONST(0.9) /* real 0.9 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define ONEPT5 RCONST(1.50) /* real 1.5 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define THREE RCONST(3.0) /* real 3.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define FIVE RCONST(5.0) /* real 5.0 */ -#define TWELVE RCONST(12.0) /* real 12.0 */ -#define HUNDRED RCONST(100.0) /* real 100.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define TINY SUN_RCONST(1.0e-10) /* small number */ +#define PT1 SUN_RCONST(0.1) /* real 0.1 */ +#define POINT2 SUN_RCONST(0.2) /* real 0.2 */ +#define FOURTH SUN_RCONST(0.25) /* real 0.25 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define PT9 SUN_RCONST(0.9) /* real 0.9 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define ONEPT5 SUN_RCONST(1.50) /* real 1.5 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define THREE SUN_RCONST(3.0) /* real 3.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define FIVE SUN_RCONST(5.0) /* real 5.0 */ +#define TWELVE SUN_RCONST(12.0) /* real 12.0 */ +#define HUNDRED SUN_RCONST(100.0) /* real 100.0 */ /*=================================================================*/ /* CVODE Routine-Specific Constants */ @@ -108,14 +108,14 @@ * */ -#define FUZZ_FACTOR RCONST(100.0) +#define FUZZ_FACTOR SUN_RCONST(100.0) -#define HLB_FACTOR RCONST(100.0) -#define HUB_FACTOR RCONST(0.1) +#define HLB_FACTOR SUN_RCONST(100.0) +#define HUB_FACTOR SUN_RCONST(0.1) #define H_BIAS HALF #define MAX_ITERS 4 -#define CORTES RCONST(0.1) +#define CORTES SUN_RCONST(0.1) /*=================================================================*/ /* Private Helper Functions Prototypes */ @@ -286,7 +286,7 @@ void *CVodeCreate(int lmm, SUNContext sunctx) cv_mem->cv_lmm = lmm; /* Set uround */ - cv_mem->cv_uround = UNIT_ROUNDOFF; + cv_mem->cv_uround = SUN_UNIT_ROUNDOFF; /* Set default values for integrator optional inputs */ cv_mem->cv_f = NULL; @@ -3638,11 +3638,11 @@ static int cvSLdet(CVodeMem cv_mem) /* The following are cutoffs and tolerances used by this routine */ - rrcut = RCONST(0.98); - vrrtol = RCONST(1.0e-4); - vrrt2 = RCONST(5.0e-4); - sqtol = RCONST(1.0e-3); - rrtol = RCONST(1.0e-2); + rrcut = SUN_RCONST(0.98); + vrrtol = SUN_RCONST(1.0e-4); + vrrt2 = SUN_RCONST(5.0e-4); + sqtol = SUN_RCONST(1.0e-3); + rrtol = SUN_RCONST(1.0e-2); rr = ZERO; diff --git a/src/cvode/cvode_bandpre.c b/src/cvode/cvode_bandpre.c index 414c1fde82..3aaf6dde68 100644 --- a/src/cvode/cvode_bandpre.c +++ b/src/cvode/cvode_bandpre.c @@ -28,10 +28,10 @@ #include "cvode_ls_impl.h" #include -#define MIN_INC_MULT RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Prototypes of CVBandPrecSetup and CVBandPrecSolve */ static int CVBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, diff --git a/src/cvode/cvode_bbdpre.c b/src/cvode/cvode_bbdpre.c index d9b6302d4c..eabef77118 100644 --- a/src/cvode/cvode_bbdpre.c +++ b/src/cvode/cvode_bbdpre.c @@ -30,10 +30,10 @@ #include #include -#define MIN_INC_MULT RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Prototypes of functions CVBBDPrecSetup and CVBBDPrecSolve */ static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, diff --git a/src/cvode/cvode_diag.c b/src/cvode/cvode_diag.c index 91685f8a95..036a114238 100644 --- a/src/cvode/cvode_diag.c +++ b/src/cvode/cvode_diag.c @@ -50,8 +50,8 @@ int cvDiagSolve_updateM(const sunrealtype r, N_Vector M); /* Other Constants */ -#define FRACT RCONST(0.1) -#define ONE RCONST(1.0) +#define FRACT SUN_RCONST(0.1) +#define ONE SUN_RCONST(1.0) /* CVDIAG linit, lsetup, lsolve, and lfree routines */ diff --git a/src/cvode/cvode_fused_stubs.c b/src/cvode/cvode_fused_stubs.c index 157bdda9e3..6c60976d5b 100644 --- a/src/cvode/cvode_fused_stubs.c +++ b/src/cvode/cvode_fused_stubs.c @@ -20,11 +20,11 @@ #include "cvode_diag_impl.h" #include "cvode_impl.h" -#define ZERO RCONST(0.0) -#define PT1 RCONST(0.1) -#define FRACT RCONST(0.1) -#define ONEPT5 RCONST(1.50) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define PT1 SUN_RCONST(0.1) +#define FRACT SUN_RCONST(0.1) +#define ONEPT5 SUN_RCONST(1.50) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/cvode/cvode_hypamgpre.c b/src/cvode/cvode_hypamgpre.c index 9b8bb3e261..0309e4848a 100644 --- a/src/cvode/cvode_hypamgpre.c +++ b/src/cvode/cvode_hypamgpre.c @@ -42,10 +42,10 @@ #include #include -#define MIN_INC_MULT RCONST(1000.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of functions CVBoomerAMGSetup and CVBoomerAMGSolve */ diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index 5e92c5c690..e79f809cbd 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -60,13 +60,13 @@ extern "C" { #define L_MAX (Q_MAX+1) /* max value of L for either lmm */ #define NUM_TESTS 5 /* number of error test quantities */ -#define HMIN_DEFAULT RCONST(0.0) /* hmin default value */ -#define HMAX_INV_DEFAULT RCONST(0.0) /* hmax_inv default value */ +#define HMIN_DEFAULT SUN_RCONST(0.0) /* hmin default value */ +#define HMAX_INV_DEFAULT SUN_RCONST(0.0) /* hmax_inv default value */ #define MXHNIL_DEFAULT 10 /* mxhnil default value */ #define MXSTEP_DEFAULT 500 /* mxstep default value */ #define MSBP_DEFAULT 20 /* max steps between lsetup calls */ -#define DGMAX_LSETUP_DEFAULT RCONST(0.3) /* gamma threshold to call lsetup */ +#define DGMAX_LSETUP_DEFAULT SUN_RCONST(0.3) /* gamma threshold to call lsetup */ /* Step size change constants * -------------------------- @@ -84,18 +84,18 @@ extern "C" { * ONEPSM (1+epsilon) used in testing if the step size is below its bound */ -#define ETA_MIN_FX_DEFAULT RCONST(0.0) -#define ETA_MAX_FX_DEFAULT RCONST(1.5) -#define ETA_MAX_FS_DEFAULT RCONST(10000.0) -#define ETA_MAX_ES_DEFAULT RCONST(10.0) -#define ETA_MAX_GS_DEFAULT RCONST(10.0) -#define ETA_MIN_DEFAULT RCONST(0.1) -#define ETA_MAX_EF_DEFAULT RCONST(0.2) -#define ETA_MIN_EF_DEFAULT RCONST(0.1) -#define ETA_CF_DEFAULT RCONST(0.25) +#define ETA_MIN_FX_DEFAULT SUN_RCONST(0.0) +#define ETA_MAX_FX_DEFAULT SUN_RCONST(1.5) +#define ETA_MAX_FS_DEFAULT SUN_RCONST(10000.0) +#define ETA_MAX_ES_DEFAULT SUN_RCONST(10.0) +#define ETA_MAX_GS_DEFAULT SUN_RCONST(10.0) +#define ETA_MIN_DEFAULT SUN_RCONST(0.1) +#define ETA_MAX_EF_DEFAULT SUN_RCONST(0.2) +#define ETA_MIN_EF_DEFAULT SUN_RCONST(0.1) +#define ETA_CF_DEFAULT SUN_RCONST(0.25) #define SMALL_NST_DEFAULT 10 #define SMALL_NEF_DEFAULT 2 -#define ONEPSM RCONST(1.000001) +#define ONEPSM SUN_RCONST(1.000001) /* Step size controller constants * ------------------------------ @@ -105,10 +105,10 @@ extern "C" { * BIAS3 -+ */ -#define ADDON RCONST(0.000001) -#define BIAS1 RCONST(6.0) -#define BIAS2 RCONST(6.0) -#define BIAS3 RCONST(10.0) +#define ADDON SUN_RCONST(0.000001) +#define BIAS1 SUN_RCONST(6.0) +#define BIAS2 SUN_RCONST(6.0) +#define BIAS3 SUN_RCONST(10.0) /* Order selection constants * ------------------------- diff --git a/src/cvode/cvode_io.c b/src/cvode/cvode_io.c index 91513a8d25..8605ef6508 100644 --- a/src/cvode/cvode_io.c +++ b/src/cvode/cvode_io.c @@ -22,10 +22,10 @@ #include "cvode_ls_impl.h" #include "sundials/sundials_types.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWOPT5 RCONST(2.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWOPT5 SUN_RCONST(2.5) /* * ================================================================= diff --git a/src/cvode/cvode_ls.c b/src/cvode/cvode_ls.c index fac370481d..42bc83d705 100644 --- a/src/cvode/cvode_ls.c +++ b/src/cvode/cvode_ls.c @@ -27,12 +27,12 @@ #include /* Private constants */ -#define MIN_INC_MULT RCONST(1000.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) #define MAX_DQITERS 3 /* max. number of attempts to recover in DQ J*v */ -#define ZERO RCONST(0.0) -#define PT25 RCONST(0.25) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define PT25 SUN_RCONST(0.25) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /*================================================================= PRIVATE FUNCTION PROTOTYPES diff --git a/src/cvode/cvode_ls_impl.h b/src/cvode/cvode_ls_impl.h index f9368fad9f..f4f24a1b4e 100644 --- a/src/cvode/cvode_ls_impl.h +++ b/src/cvode/cvode_ls_impl.h @@ -38,8 +38,8 @@ extern "C" { tolerance on the linear iteration -----------------------------------------------------------------*/ #define CVLS_MSBJ 51 -#define CVLS_DGMAX RCONST(0.2) -#define CVLS_EPLIN RCONST(0.05) +#define CVLS_DGMAX SUN_RCONST(0.2) +#define CVLS_EPLIN SUN_RCONST(0.05) /*----------------------------------------------------------------- diff --git a/src/cvode/cvode_nls.c b/src/cvode/cvode_nls.c index 934c88941c..2dfbab710e 100644 --- a/src/cvode/cvode_nls.c +++ b/src/cvode/cvode_nls.c @@ -18,7 +18,7 @@ #include "sundials/sundials_math.h" /* constant macros */ -#define ONE RCONST(1.0) /* real 1.0 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ /* nonlinear solver constants NLS_MAXCOR maximum no. of corrector iterations for the nonlinear solver @@ -27,8 +27,8 @@ RDIV declare divergence if ratio del/delp > RDIV */ #define NLS_MAXCOR 3 -#define CRDOWN RCONST(0.3) -#define RDIV RCONST(2.0) +#define CRDOWN SUN_RCONST(0.3) +#define RDIV SUN_RCONST(2.0) /* private functions */ static int cvNlsResidual(N_Vector ycor, N_Vector res, void* cvode_mem); diff --git a/src/cvode/cvode_proj.c b/src/cvode/cvode_proj.c index 12a9ad07f8..52628acd31 100644 --- a/src/cvode/cvode_proj.c +++ b/src/cvode/cvode_proj.c @@ -23,10 +23,10 @@ #include "cvode_impl.h" /* Private constants */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define ONE RCONST(1.0) /* real 1.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ -#define ONEPSM RCONST(1.000001) +#define ONEPSM SUN_RCONST(1.000001) /* Private utility function prototypes */ static int cvProjCreate(CVodeProjMem *proj_mem); diff --git a/src/cvode/cvode_proj_impl.h b/src/cvode/cvode_proj_impl.h index 38f6aec5d7..70a838aeda 100644 --- a/src/cvode/cvode_proj_impl.h +++ b/src/cvode/cvode_proj_impl.h @@ -34,8 +34,8 @@ extern "C" { * ===========================================================================*/ #define PROJ_MAX_FAILS 10 -#define PROJ_EPS RCONST(0.1) -#define PROJ_FAIL_ETA RCONST(0.25) +#define PROJ_EPS SUN_RCONST(0.1) +#define PROJ_FAIL_ETA SUN_RCONST(0.25) /* ============================================================================= * Projection Data Structure diff --git a/src/cvodes/cvodea.c b/src/cvodes/cvodea.c index 9973f95c5a..f2f5e88452 100644 --- a/src/cvodes/cvodea.c +++ b/src/cvodes/cvodea.c @@ -36,11 +36,11 @@ * ================================================================= */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define HUNDRED RCONST(100.0) /* real 100.0 */ -#define FUZZ_FACTOR RCONST(1000000.0) /* fuzz factor for IMget */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define HUNDRED SUN_RCONST(100.0) /* real 100.0 */ +#define FUZZ_FACTOR SUN_RCONST(1000000.0) /* fuzz factor for IMget */ /*=================================================================*/ /* Shortcuts */ diff --git a/src/cvodes/cvodea_io.c b/src/cvodes/cvodea_io.c index 1edcfcc809..a5fd7f886b 100644 --- a/src/cvodes/cvodea_io.c +++ b/src/cvodes/cvodea_io.c @@ -38,7 +38,7 @@ * ================================================================= */ -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* * ================================================================= diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 48c0c23cad..72019016f0 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -198,21 +198,21 @@ /* CVODE Private Constants */ /*=================================================================*/ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define TINY RCONST(1.0e-10) /* small number */ -#define PT1 RCONST(0.1) /* real 0.1 */ -#define POINT2 RCONST(0.2) /* real 0.2 */ -#define FOURTH RCONST(0.25) /* real 0.25 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define PT9 RCONST(0.9) /* real 0.9 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define ONEPT5 RCONST(1.50) /* real 1.5 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define THREE RCONST(3.0) /* real 3.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define FIVE RCONST(5.0) /* real 5.0 */ -#define TWELVE RCONST(12.0) /* real 12.0 */ -#define HUNDRED RCONST(100.0) /* real 100.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define TINY SUN_RCONST(1.0e-10) /* small number */ +#define PT1 SUN_RCONST(0.1) /* real 0.1 */ +#define POINT2 SUN_RCONST(0.2) /* real 0.2 */ +#define FOURTH SUN_RCONST(0.25) /* real 0.25 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define PT9 SUN_RCONST(0.9) /* real 0.9 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define ONEPT5 SUN_RCONST(1.50) /* real 1.5 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define THREE SUN_RCONST(3.0) /* real 3.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define FIVE SUN_RCONST(5.0) /* real 5.0 */ +#define TWELVE SUN_RCONST(12.0) /* real 12.0 */ +#define HUNDRED SUN_RCONST(100.0) /* real 100.0 */ /*=================================================================*/ /* CVODE Routine-Specific Constants */ @@ -293,14 +293,14 @@ * */ -#define FUZZ_FACTOR RCONST(100.0) +#define FUZZ_FACTOR SUN_RCONST(100.0) -#define HLB_FACTOR RCONST(100.0) -#define HUB_FACTOR RCONST(0.1) +#define HLB_FACTOR SUN_RCONST(100.0) +#define HUB_FACTOR SUN_RCONST(0.1) #define H_BIAS HALF #define MAX_ITERS 4 -#define CORTES RCONST(0.1) +#define CORTES SUN_RCONST(0.1) /*=================================================================*/ /* Private Helper Functions Prototypes */ @@ -496,7 +496,7 @@ void *CVodeCreate(int lmm, SUNContext sunctx) cv_mem->cv_lmm = lmm; /* Set uround */ - cv_mem->cv_uround = UNIT_ROUNDOFF; + cv_mem->cv_uround = SUN_UNIT_ROUNDOFF; /* Set default values for integrator optional inputs */ cv_mem->cv_f = NULL; @@ -7698,11 +7698,11 @@ static int cvSLdet(CVodeMem cv_mem) /* The following are cutoffs and tolerances used by this routine */ - rrcut = RCONST(0.98); - vrrtol = RCONST(1.0e-4); - vrrt2 = RCONST(5.0e-4); - sqtol = RCONST(1.0e-3); - rrtol = RCONST(1.0e-2); + rrcut = SUN_RCONST(0.98); + vrrtol = SUN_RCONST(1.0e-4); + vrrt2 = SUN_RCONST(5.0e-4); + sqtol = SUN_RCONST(1.0e-3); + rrtol = SUN_RCONST(1.0e-2); rr = ZERO; diff --git a/src/cvodes/cvodes_bandpre.c b/src/cvodes/cvodes_bandpre.c index a8f38fea29..ed39b7cfd8 100644 --- a/src/cvodes/cvodes_bandpre.c +++ b/src/cvodes/cvodes_bandpre.c @@ -27,10 +27,10 @@ #include "cvodes_ls_impl.h" #include -#define MIN_INC_MULT RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Prototypes of cvBandPrecSetup and cvBandPrecSolve */ static int cvBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, diff --git a/src/cvodes/cvodes_bbdpre.c b/src/cvodes/cvodes_bbdpre.c index 958c665c66..d4816465dc 100644 --- a/src/cvodes/cvodes_bbdpre.c +++ b/src/cvodes/cvodes_bbdpre.c @@ -29,10 +29,10 @@ #include #include -#define MIN_INC_MULT RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Prototypes of functions cvBBDPrecSetup and cvBBDPrecSolve */ static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, diff --git a/src/cvodes/cvodes_diag.c b/src/cvodes/cvodes_diag.c index d3baf75dcb..53e1dd6d17 100644 --- a/src/cvodes/cvodes_diag.c +++ b/src/cvodes/cvodes_diag.c @@ -24,8 +24,8 @@ /* Other Constants */ -#define FRACT RCONST(0.1) -#define ONE RCONST(1.0) +#define FRACT SUN_RCONST(0.1) +#define ONE SUN_RCONST(1.0) /* CVDIAG linit, lsetup, lsolve, and lfree routines */ diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index 4708e0cfbf..b2463e9f56 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -58,13 +58,13 @@ extern "C" { #define L_MAX (Q_MAX+1) /* max value of L for either lmm */ #define NUM_TESTS 5 /* number of error test quantities */ -#define HMIN_DEFAULT RCONST(0.0) /* hmin default value */ -#define HMAX_INV_DEFAULT RCONST(0.0) /* hmax_inv default value */ +#define HMIN_DEFAULT SUN_RCONST(0.0) /* hmin default value */ +#define HMAX_INV_DEFAULT SUN_RCONST(0.0) /* hmax_inv default value */ #define MXHNIL_DEFAULT 10 /* mxhnil default value */ #define MXSTEP_DEFAULT 500 /* mxstep default value */ #define MSBP_DEFAULT 20 /* max steps between lsetup calls */ -#define DGMAX_LSETUP_DEFAULT RCONST(0.3) /* gamma threshold to call lsetup */ +#define DGMAX_LSETUP_DEFAULT SUN_RCONST(0.3) /* gamma threshold to call lsetup */ /* Step size change constants * -------------------------- @@ -82,18 +82,18 @@ extern "C" { * ONEPSM (1+epsilon) used in testing if the step size is below its bound */ -#define ETA_MIN_FX_DEFAULT RCONST(0.0) -#define ETA_MAX_FX_DEFAULT RCONST(1.5) -#define ETA_MAX_FS_DEFAULT RCONST(10000.0) -#define ETA_MAX_ES_DEFAULT RCONST(10.0) -#define ETA_MAX_GS_DEFAULT RCONST(10.0) -#define ETA_MIN_DEFAULT RCONST(0.1) -#define ETA_MAX_EF_DEFAULT RCONST(0.2) -#define ETA_MIN_EF_DEFAULT RCONST(0.1) -#define ETA_CF_DEFAULT RCONST(0.25) +#define ETA_MIN_FX_DEFAULT SUN_RCONST(0.0) +#define ETA_MAX_FX_DEFAULT SUN_RCONST(1.5) +#define ETA_MAX_FS_DEFAULT SUN_RCONST(10000.0) +#define ETA_MAX_ES_DEFAULT SUN_RCONST(10.0) +#define ETA_MAX_GS_DEFAULT SUN_RCONST(10.0) +#define ETA_MIN_DEFAULT SUN_RCONST(0.1) +#define ETA_MAX_EF_DEFAULT SUN_RCONST(0.2) +#define ETA_MIN_EF_DEFAULT SUN_RCONST(0.1) +#define ETA_CF_DEFAULT SUN_RCONST(0.25) #define SMALL_NST_DEFAULT 10 #define SMALL_NEF_DEFAULT 2 -#define ONEPSM RCONST(1.000001) +#define ONEPSM SUN_RCONST(1.000001) /* Step size controller constants * ------------------------------ @@ -103,10 +103,10 @@ extern "C" { * BIAS3 -+ */ -#define ADDON RCONST(0.000001) -#define BIAS1 RCONST(6.0) -#define BIAS2 RCONST(6.0) -#define BIAS3 RCONST(10.0) +#define ADDON SUN_RCONST(0.000001) +#define BIAS1 SUN_RCONST(6.0) +#define BIAS2 SUN_RCONST(6.0) +#define BIAS3 SUN_RCONST(10.0) /* Order selection constants * ------------------------- @@ -197,8 +197,8 @@ extern "C" { RDIV declare divergence if ratio del/delp > RDIV */ #define NLS_MAXCOR 3 -#define CRDOWN RCONST(0.3) -#define RDIV RCONST(2.0) +#define CRDOWN SUN_RCONST(0.3) +#define RDIV SUN_RCONST(2.0) /* * ================================================================= diff --git a/src/cvodes/cvodes_io.c b/src/cvodes/cvodes_io.c index 0dabed7db1..db1e6673c6 100644 --- a/src/cvodes/cvodes_io.c +++ b/src/cvodes/cvodes_io.c @@ -22,10 +22,10 @@ #include "cvodes_ls_impl.h" #include "sundials/sundials_types.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWOPT5 RCONST(2.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWOPT5 SUN_RCONST(2.5) /* * ================================================================= diff --git a/src/cvodes/cvodes_ls.c b/src/cvodes/cvodes_ls.c index a878afccec..b6ebe97c0f 100644 --- a/src/cvodes/cvodes_ls.c +++ b/src/cvodes/cvodes_ls.c @@ -32,12 +32,12 @@ #include /* Private constants */ -#define MIN_INC_MULT RCONST(1000.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) #define MAX_DQITERS 3 /* max. number of attempts to recover in DQ J*v */ -#define ZERO RCONST(0.0) -#define PT25 RCONST(0.25) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define PT25 SUN_RCONST(0.25) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /*================================================================= PRIVATE FUNCTION PROTOTYPES - forward problems diff --git a/src/cvodes/cvodes_ls_impl.h b/src/cvodes/cvodes_ls_impl.h index c6055245ba..72e62df299 100644 --- a/src/cvodes/cvodes_ls_impl.h +++ b/src/cvodes/cvodes_ls_impl.h @@ -38,8 +38,8 @@ extern "C" { tolerance on the linear iteration -----------------------------------------------------------------*/ #define CVLS_MSBJ 51 -#define CVLS_DGMAX RCONST(0.2) -#define CVLS_EPLIN RCONST(0.05) +#define CVLS_DGMAX SUN_RCONST(0.2) +#define CVLS_EPLIN SUN_RCONST(0.05) /*================================================================= diff --git a/src/cvodes/cvodes_nls.c b/src/cvodes/cvodes_nls.c index 97e798b10c..2cc0c32179 100644 --- a/src/cvodes/cvodes_nls.c +++ b/src/cvodes/cvodes_nls.c @@ -19,7 +19,7 @@ #include "sundials/sundials_nvector_senswrapper.h" /* constant macros */ -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* private functions */ static int cvNlsResidual(N_Vector ycor, N_Vector res, void* cvode_mem); diff --git a/src/cvodes/cvodes_nls_sim.c b/src/cvodes/cvodes_nls_sim.c index dfdf38ee62..ceace6e955 100644 --- a/src/cvodes/cvodes_nls_sim.c +++ b/src/cvodes/cvodes_nls_sim.c @@ -28,7 +28,7 @@ #include "sundials/sundials_nvector_senswrapper.h" /* constant macros */ -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* private functions */ static int cvNlsResidualSensSim(N_Vector ycorSim, N_Vector resSim, diff --git a/src/cvodes/cvodes_nls_stg.c b/src/cvodes/cvodes_nls_stg.c index 04ab9bb7e7..efde4e21a9 100644 --- a/src/cvodes/cvodes_nls_stg.c +++ b/src/cvodes/cvodes_nls_stg.c @@ -19,7 +19,7 @@ #include "sundials/sundials_nvector_senswrapper.h" /* constant macros */ -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* private functions */ static int cvNlsResidualSensStg(N_Vector ycorStg, N_Vector resStg, diff --git a/src/cvodes/cvodes_nls_stg1.c b/src/cvodes/cvodes_nls_stg1.c index ee31fd2b5b..cffeb4d3c8 100644 --- a/src/cvodes/cvodes_nls_stg1.c +++ b/src/cvodes/cvodes_nls_stg1.c @@ -18,7 +18,7 @@ #include "sundials/sundials_math.h" /* constant macros */ -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* private functions */ static int cvNlsResidualSensStg1(N_Vector ycor, N_Vector res, diff --git a/src/cvodes/cvodes_proj.c b/src/cvodes/cvodes_proj.c index 2c8d8a23d6..80e79c1354 100644 --- a/src/cvodes/cvodes_proj.c +++ b/src/cvodes/cvodes_proj.c @@ -23,10 +23,10 @@ #include "cvodes_impl.h" /* Private constants */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define ONE RCONST(1.0) /* real 1.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ -#define ONEPSM RCONST(1.000001) +#define ONEPSM SUN_RCONST(1.000001) /* Private utility function prototypes */ static int cvProjCreate(CVodeProjMem *proj_mem); diff --git a/src/cvodes/cvodes_proj_impl.h b/src/cvodes/cvodes_proj_impl.h index 7de121a5ee..b7fa4e683c 100644 --- a/src/cvodes/cvodes_proj_impl.h +++ b/src/cvodes/cvodes_proj_impl.h @@ -34,8 +34,8 @@ extern "C" { * ===========================================================================*/ #define PROJ_MAX_FAILS 10 -#define PROJ_EPS RCONST(0.1) -#define PROJ_FAIL_ETA RCONST(0.25) +#define PROJ_EPS SUN_RCONST(0.1) +#define PROJ_FAIL_ETA SUN_RCONST(0.25) /* ============================================================================= * Projection Data Structure diff --git a/src/ida/ida.c b/src/ida/ida.c index b96631fb77..28c357295a 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -94,27 +94,27 @@ * ================================================================= */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define TWOTHIRDS RCONST(0.667) /* real 2/3 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define ONEPT5 RCONST(1.5) /* real 1.5 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define FIVE RCONST(5.0) /* real 5.0 */ -#define TEN RCONST(10.0) /* real 10.0 */ -#define TWELVE RCONST(12.0) /* real 12.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ -#define HUNDRED RCONST(100.0) /* real 100.0 */ -#define PT9 RCONST(0.9) /* real 0.9 */ -#define PT99 RCONST(0.99) /* real 0.99 */ -#define PT1 RCONST(0.1) /* real 0.1 */ -#define PT01 RCONST(0.01) /* real 0.01 */ -#define PT001 RCONST(0.001) /* real 0.001 */ -#define PT0001 RCONST(0.0001) /* real 0.0001 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define TWOTHIRDS SUN_RCONST(0.667) /* real 2/3 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define ONEPT5 SUN_RCONST(1.5) /* real 1.5 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define FIVE SUN_RCONST(5.0) /* real 5.0 */ +#define TEN SUN_RCONST(10.0) /* real 10.0 */ +#define TWELVE SUN_RCONST(12.0) /* real 12.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ +#define HUNDRED SUN_RCONST(100.0) /* real 100.0 */ +#define PT9 SUN_RCONST(0.9) /* real 0.9 */ +#define PT99 SUN_RCONST(0.99) /* real 0.99 */ +#define PT1 SUN_RCONST(0.1) /* real 0.1 */ +#define PT01 SUN_RCONST(0.01) /* real 0.01 */ +#define PT001 SUN_RCONST(0.001) /* real 0.001 */ +#define PT0001 SUN_RCONST(0.0001) /* real 0.0001 */ /* real 1 + epsilon used in testing if the step size is below its bound */ -#define ONEPSM RCONST(1.000001) +#define ONEPSM SUN_RCONST(1.000001) /* * ================================================================= @@ -174,7 +174,7 @@ #define MAXNH 5 /* max. number of h tries in IC calc. */ #define MAXNJ 4 /* max. number of J tries in IC calc. */ #define MAXNI 10 /* max. Newton iterations in IC calc. */ -#define EPCON RCONST(0.33) /* Newton convergence test constant */ +#define EPCON SUN_RCONST(0.33) /* Newton convergence test constant */ #define MAXBACKS 100 /* max backtracks per Newton step in IDACalcIC */ /* @@ -291,7 +291,7 @@ void *IDACreate(SUNContext sunctx) IDA_mem->ida_sunctx = sunctx; /* Set unit roundoff in IDA_mem */ - IDA_mem->ida_uround = UNIT_ROUNDOFF; + IDA_mem->ida_uround = SUN_UNIT_ROUNDOFF; /* Set default values for integrator optional inputs */ IDA_mem->ida_res = NULL; diff --git a/src/ida/ida_bbdpre.c b/src/ida/ida_bbdpre.c index 1a2c07ffe3..af4b922213 100644 --- a/src/ida/ida_bbdpre.c +++ b/src/ida/ida_bbdpre.c @@ -34,9 +34,9 @@ #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Prototypes of functions IDABBDPrecSetup and IDABBDPrecSolve */ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, diff --git a/src/ida/ida_ic.c b/src/ida/ida_ic.c index 7c7fcb7059..1892ee0903 100644 --- a/src/ida/ida_ic.c +++ b/src/ida/ida_ic.c @@ -30,18 +30,18 @@ /* Private Constants */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define PT99 RCONST(0.99) /* real 0.99 */ -#define PT1 RCONST(0.1) /* real 0.1 */ -#define PT001 RCONST(0.001) /* real 0.001 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define PT99 SUN_RCONST(0.99) /* real 0.99 */ +#define PT1 SUN_RCONST(0.1) /* real 0.1 */ +#define PT001 SUN_RCONST(0.001) /* real 0.001 */ /* IDACalcIC control constants */ -#define ICRATEMAX RCONST(0.9) /* max. Newton conv. rate */ -#define ALPHALS RCONST(0.0001) /* alpha in linesearch conv. test */ +#define ICRATEMAX SUN_RCONST(0.9) /* max. Newton conv. rate */ +#define ALPHALS SUN_RCONST(0.0001) /* alpha in linesearch conv. test */ /* Return values for lower level routines used by IDACalcIC */ diff --git a/src/ida/ida_impl.h b/src/ida/ida_impl.h index c8f98fd8e7..2543fc06b2 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -53,21 +53,21 @@ extern "C" { /* Basic IDA constants */ -#define HMAX_INV_DEFAULT RCONST(0.0) /* hmax_inv default value */ -#define HMIN_DEFAULT RCONST(0.0) /* hmin default value */ +#define HMAX_INV_DEFAULT SUN_RCONST(0.0) /* hmax_inv default value */ +#define HMIN_DEFAULT SUN_RCONST(0.0) /* hmin default value */ #define MAXORD_DEFAULT 5 /* maxord default value */ #define MXORDP1 6 /* max. number of N_Vectors in phi */ #define MXSTEP_DEFAULT 500 /* mxstep default value */ -#define ETA_MAX_FX_DEFAULT RCONST(2.0) /* threshold to increase step size */ -#define ETA_MIN_FX_DEFAULT RCONST(1.0) /* threshold to decrease step size */ -#define ETA_MAX_DEFAULT RCONST(2.0) /* max step size increase factor */ -#define ETA_MIN_DEFAULT RCONST(0.5) /* min step size decrease factor */ -#define ETA_LOW_DEFAULT RCONST(0.9) /* upper bound on decrease factor */ -#define ETA_MIN_EF_DEFAULT RCONST(0.25) /* err test fail min decrease factor */ -#define ETA_CF_DEFAULT RCONST(0.25) /* NLS failure decrease factor */ +#define ETA_MAX_FX_DEFAULT SUN_RCONST(2.0) /* threshold to increase step size */ +#define ETA_MIN_FX_DEFAULT SUN_RCONST(1.0) /* threshold to decrease step size */ +#define ETA_MAX_DEFAULT SUN_RCONST(2.0) /* max step size increase factor */ +#define ETA_MIN_DEFAULT SUN_RCONST(0.5) /* min step size decrease factor */ +#define ETA_LOW_DEFAULT SUN_RCONST(0.9) /* upper bound on decrease factor */ +#define ETA_MIN_EF_DEFAULT SUN_RCONST(0.25) /* err test fail min decrease factor */ +#define ETA_CF_DEFAULT SUN_RCONST(0.25) /* NLS failure decrease factor */ -#define DCJ_DEFAULT RCONST(0.25) /* constant for updating Jacobian/preconditioner */ +#define DCJ_DEFAULT SUN_RCONST(0.25) /* constant for updating Jacobian/preconditioner */ /* Return values for lower level routines used by IDASolve and functions provided to the nonlinear solver */ diff --git a/src/ida/ida_io.c b/src/ida/ida_io.c index f03ff875fe..fdb7ba8c7a 100644 --- a/src/ida/ida_io.c +++ b/src/ida/ida_io.c @@ -24,10 +24,10 @@ #include "sundials/sundials_types.h" #include "sundials/sundials_math.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWOPT5 RCONST(2.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWOPT5 SUN_RCONST(2.5) /* * ================================================================= diff --git a/src/ida/ida_ls.c b/src/ida/ida_ls.c index 14ba727f24..1279dc25c4 100644 --- a/src/ida/ida_ls.c +++ b/src/ida/ida_ls.c @@ -29,12 +29,12 @@ /* constants */ #define MAX_ITERS 3 /* max. number of attempts to recover in DQ J*v */ -#define ZERO RCONST(0.0) -#define PT25 RCONST(0.25) -#define PT05 RCONST(0.05) -#define PT9 RCONST(0.9) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define PT25 SUN_RCONST(0.25) +#define PT05 SUN_RCONST(0.05) +#define PT9 SUN_RCONST(0.9) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /*=============================================================== diff --git a/src/ida/ida_nls.c b/src/ida/ida_nls.c index 34c31edc76..84b1917585 100644 --- a/src/ida/ida_nls.c +++ b/src/ida/ida_nls.c @@ -18,13 +18,13 @@ #include "sundials/sundials_math.h" /* constant macros */ -#define PT0001 RCONST(0.0001) /* real 0.0001 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ +#define PT0001 SUN_RCONST(0.0001) /* real 0.0001 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ /* nonlinear solver parameters */ #define MAXIT 4 /* default max number of nonlinear iterations */ -#define RATEMAX RCONST(0.9) /* max convergence rate used in divergence check */ +#define RATEMAX SUN_RCONST(0.9) /* max convergence rate used in divergence check */ /* private functions passed to nonlinear solver */ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem); diff --git a/src/idas/idaa.c b/src/idas/idaa.c index 09d10f1ba3..e113a11b93 100644 --- a/src/idas/idaa.c +++ b/src/idas/idaa.c @@ -30,11 +30,11 @@ /* IDAA Private Constants */ /*=================================================================*/ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define HUNDRED RCONST(100.0) /* real 100.0 */ -#define FUZZ_FACTOR RCONST(1000000.0) /* fuzz factor for IDAAgetY */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define HUNDRED SUN_RCONST(100.0) /* real 100.0 */ +#define FUZZ_FACTOR SUN_RCONST(1000000.0) /* fuzz factor for IDAAgetY */ /*=================================================================*/ /* Shortcuts */ diff --git a/src/idas/idaa_io.c b/src/idas/idaa_io.c index 2a3a54c238..9d266c861d 100644 --- a/src/idas/idaa_io.c +++ b/src/idas/idaa_io.c @@ -39,7 +39,7 @@ * ================================================================= */ -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/idas/idas.c b/src/idas/idas.c index 21460165dd..3e4750e411 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -152,27 +152,27 @@ * ================================================================= */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define TWOTHIRDS RCONST(0.667) /* real 2/3 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define ONEPT5 RCONST(1.5) /* real 1.5 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define FOUR RCONST(4.0) /* real 4.0 */ -#define FIVE RCONST(5.0) /* real 5.0 */ -#define TEN RCONST(10.0) /* real 10.0 */ -#define TWELVE RCONST(12.0) /* real 12.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ -#define HUNDRED RCONST(100.0) /* real 100.0 */ -#define PT9 RCONST(0.9) /* real 0.9 */ -#define PT99 RCONST(0.99) /* real 0.99 */ -#define PT1 RCONST(0.1) /* real 0.1 */ -#define PT01 RCONST(0.01) /* real 0.01 */ -#define PT001 RCONST(0.001) /* real 0.001 */ -#define PT0001 RCONST(0.0001) /* real 0.0001 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define TWOTHIRDS SUN_RCONST(0.667) /* real 2/3 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define ONEPT5 SUN_RCONST(1.5) /* real 1.5 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define FOUR SUN_RCONST(4.0) /* real 4.0 */ +#define FIVE SUN_RCONST(5.0) /* real 5.0 */ +#define TEN SUN_RCONST(10.0) /* real 10.0 */ +#define TWELVE SUN_RCONST(12.0) /* real 12.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ +#define HUNDRED SUN_RCONST(100.0) /* real 100.0 */ +#define PT9 SUN_RCONST(0.9) /* real 0.9 */ +#define PT99 SUN_RCONST(0.99) /* real 0.99 */ +#define PT1 SUN_RCONST(0.1) /* real 0.1 */ +#define PT01 SUN_RCONST(0.01) /* real 0.01 */ +#define PT001 SUN_RCONST(0.001) /* real 0.001 */ +#define PT0001 SUN_RCONST(0.0001) /* real 0.0001 */ /* real 1 + epsilon used in testing if the step size is below its bound */ -#define ONEPSM RCONST(1.000001) +#define ONEPSM SUN_RCONST(1.000001) /* * ================================================================= @@ -232,7 +232,7 @@ #define MAXNH 5 /* max. number of h tries in IC calc. */ #define MAXNJ 4 /* max. number of J tries in IC calc. */ #define MAXNI 10 /* max. Newton iterations in IC calc. */ -#define EPCON RCONST(0.33) /* Newton convergence test constant */ +#define EPCON SUN_RCONST(0.33) /* Newton convergence test constant */ #define MAXBACKS 100 /* max backtracks per Newton step in IDACalcIC */ /* @@ -417,7 +417,7 @@ void *IDACreate(SUNContext sunctx) IDA_mem->ida_sunctx = sunctx; /* Set unit roundoff in IDA_mem */ - IDA_mem->ida_uround = UNIT_ROUNDOFF; + IDA_mem->ida_uround = SUN_UNIT_ROUNDOFF; /* Set default values for integrator optional inputs */ IDA_mem->ida_res = NULL; diff --git a/src/idas/idas_bbdpre.c b/src/idas/idas_bbdpre.c index d3b50a3bea..0bd05b92ef 100644 --- a/src/idas/idas_bbdpre.c +++ b/src/idas/idas_bbdpre.c @@ -34,9 +34,9 @@ #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* Prototypes of IDABBDPrecSetup and IDABBDPrecSolve */ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, diff --git a/src/idas/idas_ic.c b/src/idas/idas_ic.c index b5f2476450..e2b768ab75 100644 --- a/src/idas/idas_ic.c +++ b/src/idas/idas_ic.c @@ -30,18 +30,18 @@ /* Private Constants */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define HALF RCONST(0.5) /* real 0.5 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWO RCONST(2.0) /* real 2.0 */ -#define PT99 RCONST(0.99) /* real 0.99 */ -#define PT1 RCONST(0.1) /* real 0.1 */ -#define PT001 RCONST(0.001) /* real 0.001 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define HALF SUN_RCONST(0.5) /* real 0.5 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWO SUN_RCONST(2.0) /* real 2.0 */ +#define PT99 SUN_RCONST(0.99) /* real 0.99 */ +#define PT1 SUN_RCONST(0.1) /* real 0.1 */ +#define PT001 SUN_RCONST(0.001) /* real 0.001 */ /* IDACalcIC control constants */ -#define ICRATEMAX RCONST(0.9) /* max. Newton conv. rate */ -#define ALPHALS RCONST(0.0001) /* alpha in linesearch conv. test */ +#define ICRATEMAX SUN_RCONST(0.9) /* max. Newton conv. rate */ +#define ALPHALS SUN_RCONST(0.0001) /* alpha in linesearch conv. test */ /* Return values for lower level routines used by IDACalcIC */ diff --git a/src/idas/idas_impl.h b/src/idas/idas_impl.h index 81fce140c2..f6e9098aa2 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -52,21 +52,21 @@ extern "C" { /* Basic IDA constants */ -#define HMAX_INV_DEFAULT RCONST(0.0) /* hmax_inv default value */ -#define HMIN_DEFAULT RCONST(0.0) /* hmin default value */ +#define HMAX_INV_DEFAULT SUN_RCONST(0.0) /* hmax_inv default value */ +#define HMIN_DEFAULT SUN_RCONST(0.0) /* hmin default value */ #define MAXORD_DEFAULT 5 /* maxord default value */ #define MXORDP1 6 /* max. number of N_Vectors in phi */ #define MXSTEP_DEFAULT 500 /* mxstep default value */ -#define ETA_MAX_FX_DEFAULT RCONST(2.0) /* threshold to increase step size */ -#define ETA_MIN_FX_DEFAULT RCONST(1.0) /* threshold to decrease step size */ -#define ETA_MAX_DEFAULT RCONST(2.0) /* max step size increase factor */ -#define ETA_MIN_DEFAULT RCONST(0.5) /* min step size decrease factor */ -#define ETA_LOW_DEFAULT RCONST(0.9) /* upper bound on decrease factor */ -#define ETA_MIN_EF_DEFAULT RCONST(0.25) /* err test fail min decrease factor */ -#define ETA_CF_DEFAULT RCONST(0.25) /* NLS failure decrease factor */ +#define ETA_MAX_FX_DEFAULT SUN_RCONST(2.0) /* threshold to increase step size */ +#define ETA_MIN_FX_DEFAULT SUN_RCONST(1.0) /* threshold to decrease step size */ +#define ETA_MAX_DEFAULT SUN_RCONST(2.0) /* max step size increase factor */ +#define ETA_MIN_DEFAULT SUN_RCONST(0.5) /* min step size decrease factor */ +#define ETA_LOW_DEFAULT SUN_RCONST(0.9) /* upper bound on decrease factor */ +#define ETA_MIN_EF_DEFAULT SUN_RCONST(0.25) /* err test fail min decrease factor */ +#define ETA_CF_DEFAULT SUN_RCONST(0.25) /* NLS failure decrease factor */ -#define DCJ_DEFAULT RCONST(0.25) /* constant for updating Jacobian/preconditioner */ +#define DCJ_DEFAULT SUN_RCONST(0.25) /* constant for updating Jacobian/preconditioner */ /* Return values for lower level routines used by IDASolve and functions provided to the nonlinear solver */ diff --git a/src/idas/idas_io.c b/src/idas/idas_io.c index 2540823149..fef2fc6c7e 100644 --- a/src/idas/idas_io.c +++ b/src/idas/idas_io.c @@ -23,10 +23,10 @@ #include "sundials/sundials_types.h" #include "sundials/sundials_math.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define TWOPT5 RCONST(2.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWOPT5 SUN_RCONST(2.5) /* * ================================================================= diff --git a/src/idas/idas_ls.c b/src/idas/idas_ls.c index ae7772a49c..48b18c3a4a 100644 --- a/src/idas/idas_ls.c +++ b/src/idas/idas_ls.c @@ -29,12 +29,12 @@ /* constants */ #define MAX_ITERS 3 /* max. number of attempts to recover in DQ J*v */ -#define ZERO RCONST(0.0) -#define PT25 RCONST(0.25) -#define PT05 RCONST(0.05) -#define PT9 RCONST(0.9) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define PT25 SUN_RCONST(0.25) +#define PT05 SUN_RCONST(0.05) +#define PT9 SUN_RCONST(0.9) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /*================================================================= diff --git a/src/idas/idas_nls.c b/src/idas/idas_nls.c index 6b848b33f6..702f7099da 100644 --- a/src/idas/idas_nls.c +++ b/src/idas/idas_nls.c @@ -18,13 +18,13 @@ #include "sundials/sundials_math.h" /* constant macros */ -#define PT0001 RCONST(0.0001) /* real 0.0001 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ +#define PT0001 SUN_RCONST(0.0001) /* real 0.0001 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ /* nonlinear solver parameters */ #define MAXIT 4 /* default max number of nonlinear iterations */ -#define RATEMAX RCONST(0.9) /* max convergence rate used in divergence check */ +#define RATEMAX SUN_RCONST(0.9) /* max convergence rate used in divergence check */ /* private functions passed to nonlinear solver */ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem); diff --git a/src/idas/idas_nls_sim.c b/src/idas/idas_nls_sim.c index 62e97e9dea..8338bd5b4b 100644 --- a/src/idas/idas_nls_sim.c +++ b/src/idas/idas_nls_sim.c @@ -19,13 +19,13 @@ #include "sundials/sundials_nvector_senswrapper.h" /* constant macros */ -#define PT0001 RCONST(0.0001) /* real 0.0001 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ +#define PT0001 SUN_RCONST(0.0001) /* real 0.0001 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ /* nonlinear solver parameters */ #define MAXIT 4 /* default max number of nonlinear iterations */ -#define RATEMAX RCONST(0.9) /* max convergence rate used in divergence check */ +#define RATEMAX SUN_RCONST(0.9) /* max convergence rate used in divergence check */ /* private functions passed to nonlinear solver */ static int idaNlsResidualSensSim(N_Vector ycor, N_Vector res, void* ida_mem); diff --git a/src/idas/idas_nls_stg.c b/src/idas/idas_nls_stg.c index a6b14d91d3..09c223bf0f 100644 --- a/src/idas/idas_nls_stg.c +++ b/src/idas/idas_nls_stg.c @@ -19,13 +19,13 @@ #include "sundials/sundials_nvector_senswrapper.h" /* constant macros */ -#define PT0001 RCONST(0.0001) /* real 0.0001 */ -#define ONE RCONST(1.0) /* real 1.0 */ -#define TWENTY RCONST(20.0) /* real 20.0 */ +#define PT0001 SUN_RCONST(0.0001) /* real 0.0001 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ +#define TWENTY SUN_RCONST(20.0) /* real 20.0 */ /* nonlinear solver parameters */ #define MAXIT 4 /* default max number of nonlinear iterations */ -#define RATEMAX RCONST(0.9) /* max convergence rate used in divergence check */ +#define RATEMAX SUN_RCONST(0.9) /* max convergence rate used in divergence check */ /* private functions passed to nonlinear solver */ static int idaNlsResidualSensStg(N_Vector ycor, N_Vector res, void* ida_mem); diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index d0ce7a3bc5..1d79a46a7c 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -77,22 +77,22 @@ * ================================================================= */ -#define HALF RCONST(0.5) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) -#define TWO RCONST(2.0) -#define THREE RCONST(3.0) -#define FIVE RCONST(5.0) -#define TWELVE RCONST(12.0) -#define POINT1 RCONST(0.1) -#define POINT01 RCONST(0.01) -#define POINT99 RCONST(0.99) -#define THOUSAND RCONST(1000.0) -#define ONETHIRD RCONST(0.3333333333333333) -#define TWOTHIRDS RCONST(0.6666666666666667) -#define POINT9 RCONST(0.9) -#define POINT0001 RCONST(0.0001) +#define HALF SUN_RCONST(0.5) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) +#define TWO SUN_RCONST(2.0) +#define THREE SUN_RCONST(3.0) +#define FIVE SUN_RCONST(5.0) +#define TWELVE SUN_RCONST(12.0) +#define POINT1 SUN_RCONST(0.1) +#define POINT01 SUN_RCONST(0.01) +#define POINT99 SUN_RCONST(0.99) +#define THOUSAND SUN_RCONST(1000.0) +#define ONETHIRD SUN_RCONST(0.3333333333333333) +#define TWOTHIRDS SUN_RCONST(0.6666666666666667) +#define POINT9 SUN_RCONST(0.9) +#define POINT0001 SUN_RCONST(0.0001) /* * ================================================================= @@ -233,7 +233,7 @@ void *KINCreate(SUNContext sunctx) /* set uround (unit roundoff) */ - kin_mem->kin_uround = uround = UNIT_ROUNDOFF; + kin_mem->kin_uround = uround = SUN_UNIT_ROUNDOFF; /* set default values for solver optional inputs */ diff --git a/src/kinsol/kinsol_bbdpre.c b/src/kinsol/kinsol_bbdpre.c index 0978ce4678..18f8d13418 100644 --- a/src/kinsol/kinsol_bbdpre.c +++ b/src/kinsol/kinsol_bbdpre.c @@ -33,8 +33,8 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Prototypes of functions KINBBDPrecSetup and KINBBDPrecSolve */ static int KINBBDPrecSetup(N_Vector uu, N_Vector uscale, diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index bfd2773ba1..885965876c 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -53,8 +53,8 @@ extern "C" { #define MSBSET_DEFAULT 10 #define MSBSET_SUB_DEFAULT 5 -#define OMEGA_MIN RCONST(0.00001) -#define OMEGA_MAX RCONST(0.9) +#define OMEGA_MIN SUN_RCONST(0.00001) +#define OMEGA_MAX SUN_RCONST(0.9) /*=================================================================*/ /* Shortcuts */ diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index aee2d5c5f5..bec14904c4 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -25,15 +25,15 @@ #include #include -#define ZERO RCONST(0.0) -#define POINT1 RCONST(0.1) -#define ONETHIRD RCONST(0.3333333333333333) -#define HALF RCONST(0.5) -#define TWOTHIRDS RCONST(0.6666666666666667) -#define POINT9 RCONST(0.9) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define TWOPT5 RCONST(2.5) +#define ZERO SUN_RCONST(0.0) +#define POINT1 SUN_RCONST(0.1) +#define ONETHIRD SUN_RCONST(0.3333333333333333) +#define HALF SUN_RCONST(0.5) +#define TWOTHIRDS SUN_RCONST(0.6666666666666667) +#define POINT9 SUN_RCONST(0.9) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define TWOPT5 SUN_RCONST(2.5) /* * ================================================================= diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index 3ddebf62dc..b7ee56d89a 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -29,10 +29,10 @@ #include /* constants */ -#define MIN_INC_MULT RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define MIN_INC_MULT SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /*================================================================== diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index de68c2a010..5859c2365c 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -28,8 +28,8 @@ #include "sundials_cuda.h" #include "sundials_debug.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) using namespace sundials; using namespace sundials::cuda; diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index dc2cf952d4..3ac5587de9 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -28,8 +28,8 @@ #include "sundials_hip.h" #include "sundials_debug.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) using namespace sundials; using namespace sundials::hip; diff --git a/src/nvector/manyvector/nvector_manyvector.c b/src/nvector/manyvector/nvector_manyvector.c index dd4bed94f6..3b0c46bbdb 100644 --- a/src/nvector/manyvector/nvector_manyvector.c +++ b/src/nvector/manyvector/nvector_manyvector.c @@ -32,8 +32,8 @@ #define MVAPPEND(fun) fun##_ManyVector #endif -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* ----------------------------------------------------------------- ManyVector content accessor macros @@ -957,7 +957,7 @@ sunrealtype MVAPPEND(N_VMinLocal)(N_Vector x) sunrealtype min, lmin; /* initialize output*/ - min = BIG_REAL; + min = SUN_BIG_REAL; for (i=0; i #include -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) /* Private functions for special cases of vector operations */ static void VCopy_OpenMP(N_Vector x, N_Vector z); /* z=x */ @@ -991,12 +991,12 @@ sunrealtype N_VMinQuotient_OpenMP(N_Vector num, N_Vector denom) nd = NV_DATA_OMP(num); dd = NV_DATA_OMP(denom); - min = BIG_REAL; + min = SUN_BIG_REAL; #pragma omp parallel default(none) private(i,tmin,val) shared(N,min,nd,dd) \ num_threads(NV_NUM_THREADS_OMP(num)) { - tmin = BIG_REAL; + tmin = SUN_BIG_REAL; #pragma omp for schedule(static) for (i = 0; i < N; i++) { if (dd[i] != ZERO) { diff --git a/src/nvector/openmpdev/nvector_openmpdev.c b/src/nvector/openmpdev/nvector_openmpdev.c index d0743c871e..028405b71a 100644 --- a/src/nvector/openmpdev/nvector_openmpdev.c +++ b/src/nvector/openmpdev/nvector_openmpdev.c @@ -28,10 +28,10 @@ #include #include -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) /* Private functions for special cases of vector operations */ static void VCopy_OpenMPDEV(N_Vector x, N_Vector z); /* z=x */ @@ -1164,7 +1164,7 @@ sunrealtype N_VMinQuotient_OpenMPDEV(N_Vector num, N_Vector denom) /* get default device identifier */ dev = omp_get_default_device(); - min = BIG_REAL; + min = SUN_BIG_REAL; #pragma omp target map(tofrom:min) is_device_ptr(nd_dev, dd_dev) device(dev) #pragma omp teams distribute parallel for reduction(min:min) schedule(static, 1) diff --git a/src/nvector/parallel/nvector_parallel.c b/src/nvector/parallel/nvector_parallel.c index dd723674f3..a0a09c734d 100644 --- a/src/nvector/parallel/nvector_parallel.c +++ b/src/nvector/parallel/nvector_parallel.c @@ -22,10 +22,10 @@ #include #include -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) /* Private functions for special cases of vector operations */ static void VCopy_Parallel(N_Vector x, N_Vector z); /* z=x */ @@ -765,7 +765,7 @@ sunrealtype N_VMinLocal_Parallel(N_Vector x) xd = NULL; N = NV_LOCLENGTH_P(x); - min = BIG_REAL; + min = SUN_BIG_REAL; if (N > 0) { xd = NV_DATA_P(x); @@ -926,7 +926,7 @@ sunrealtype N_VMinQuotientLocal_Parallel(N_Vector num, N_Vector denom) dd = NV_DATA_P(denom); notEvenOnce = SUNTRUE; - min = BIG_REAL; + min = SUN_BIG_REAL; for (i = 0; i < N; i++) { if (dd[i] == ZERO) continue; diff --git a/src/nvector/parhyp/nvector_parhyp.c b/src/nvector/parhyp/nvector_parhyp.c index c76ab2f7c9..bfb542979e 100644 --- a/src/nvector/parhyp/nvector_parhyp.c +++ b/src/nvector/parhyp/nvector_parhyp.c @@ -25,10 +25,10 @@ #include #include "sundials/sundials_nvector.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) /* * ----------------------------------------------------------------- @@ -790,7 +790,7 @@ sunrealtype N_VMinLocal_ParHyp(N_Vector x) xd = NULL; N = NV_LOCLENGTH_PH(x); - min = BIG_REAL; + min = SUN_BIG_REAL; if (N > 0) { xd = NV_DATA_PH(x); @@ -943,7 +943,7 @@ sunrealtype N_VMinQuotientLocal_ParHyp(N_Vector num, N_Vector denom) dd = NV_DATA_PH(denom); notEvenOnce = SUNTRUE; - min = BIG_REAL; + min = SUN_BIG_REAL; for (i = 0; i < N; i++) { if (dd[i] == ZERO) continue; diff --git a/src/nvector/petsc/nvector_petsc.c b/src/nvector/petsc/nvector_petsc.c index 13e3149d26..903bf1c7dd 100644 --- a/src/nvector/petsc/nvector_petsc.c +++ b/src/nvector/petsc/nvector_petsc.c @@ -24,10 +24,10 @@ #include #include -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) /* Error Message */ #define BAD_N1 "N_VNewEmpty_Petsc -- Sum of local vector lengths differs from " @@ -692,7 +692,7 @@ sunrealtype N_VMinLocal_Petsc(N_Vector x) sunindextype N = NV_LOCLENGTH_PTC(x); Vec xv = NV_PVEC_PTC(x); PetscScalar *xd; - PetscReal min = BIG_REAL; + PetscReal min = SUN_BIG_REAL; VecGetArray(xv, &xd); for (i = 0; i < N; i++) { @@ -864,7 +864,7 @@ sunrealtype N_VMinQuotientLocal_Petsc(N_Vector num, N_Vector denom) Vec dv = NV_PVEC_PTC(denom); PetscScalar *nd; PetscScalar *dd; - PetscReal minval = BIG_REAL; + PetscReal minval = SUN_BIG_REAL; VecGetArray(nv, &nd); VecGetArray(dv, &dd); diff --git a/src/nvector/pthreads/nvector_pthreads.c b/src/nvector/pthreads/nvector_pthreads.c index bf79424890..181f22cd6e 100644 --- a/src/nvector/pthreads/nvector_pthreads.c +++ b/src/nvector/pthreads/nvector_pthreads.c @@ -28,10 +28,10 @@ #include #include /* define NAN */ -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) /* Private functions for special cases of vector operations */ static void VCopy_Pthreads(N_Vector x, N_Vector z); /* z=x */ @@ -2230,7 +2230,7 @@ sunrealtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom) Pthreads_Data *thread_data; pthread_attr_t attr; pthread_mutex_t global_mutex; - sunrealtype min = BIG_REAL; + sunrealtype min = SUN_BIG_REAL; /* allocate threads and thread data structs */ N = NV_LENGTH_PT(num); @@ -2302,7 +2302,7 @@ static void *N_VMinQuotient_PT(void *thread_data) end = my_data->end; /* compute minimum quotient */ - local_min = BIG_REAL; + local_min = SUN_BIG_REAL; for (i = start; i < end; i++) { if (dd[i] == ZERO) continue; diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index 6e65519e44..18a7f4ff0f 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -55,10 +55,10 @@ #error "Unknown RAJA backend" #endif -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) extern "C" { diff --git a/src/nvector/serial/nvector_serial.c b/src/nvector/serial/nvector_serial.c index b2c15adc09..18a003cd24 100644 --- a/src/nvector/serial/nvector_serial.c +++ b/src/nvector/serial/nvector_serial.c @@ -23,10 +23,10 @@ #include #include "sundials/sundials_nvector.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) /* Private functions for special cases of vector operations */ static void VCopy_Serial(N_Vector x, N_Vector z); /* z=x */ @@ -835,7 +835,7 @@ sunrealtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom) dd = NV_DATA_S(denom); notEvenOnce = SUNTRUE; - min = BIG_REAL; + min = SUN_BIG_REAL; for (i = 0; i < N; i++) { if (dd[i] == ZERO) continue; diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index f60c3a442f..5ae4d8055d 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -28,10 +28,10 @@ #include "sundials_debug.h" #include "sundials_sycl.h" -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) extern "C" { diff --git a/src/nvector/trilinos/nvector_trilinos.cpp b/src/nvector/trilinos/nvector_trilinos.cpp index 7c0dfc8590..5449f70072 100644 --- a/src/nvector/trilinos/nvector_trilinos.cpp +++ b/src/nvector/trilinos/nvector_trilinos.cpp @@ -25,10 +25,10 @@ #include #include -#define ZERO RCONST(0.0) -#define HALF RCONST(0.5) -#define ONE RCONST(1.0) -#define ONEPT5 RCONST(1.5) +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define ONEPT5 SUN_RCONST(1.5) diff --git a/src/sundials/sundials_band.c b/src/sundials/sundials_band.c index 9451e05700..10d53417e5 100644 --- a/src/sundials/sundials_band.c +++ b/src/sundials/sundials_band.c @@ -26,8 +26,8 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) #define ROW(i,j,smu) (i-j+smu) diff --git a/src/sundials/sundials_dense.c b/src/sundials/sundials_dense.c index 08d846ff3f..1e5bc729b1 100644 --- a/src/sundials/sundials_dense.c +++ b/src/sundials/sundials_dense.c @@ -27,9 +27,9 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* * ----------------------------------------------------- diff --git a/src/sundials/sundials_direct.c b/src/sundials/sundials_direct.c index 16f32973dd..68a93e57d4 100644 --- a/src/sundials/sundials_direct.c +++ b/src/sundials/sundials_direct.c @@ -21,8 +21,8 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) SUNDlsMat NewDenseMat(sunindextype M, sunindextype N) { diff --git a/src/sundials/sundials_iterative.c b/src/sundials/sundials_iterative.c index ffd041389f..58c7c6448c 100644 --- a/src/sundials/sundials_iterative.c +++ b/src/sundials/sundials_iterative.c @@ -23,9 +23,9 @@ #include "sundials_iterative_impl.h" #include -#define FACTOR RCONST(1000.0) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define FACTOR SUN_RCONST(1000.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sundials/sundials_linearsolver.c b/src/sundials/sundials_linearsolver.c index 0aac6e9de7..55a91ea732 100644 --- a/src/sundials/sundials_linearsolver.c +++ b/src/sundials/sundials_linearsolver.c @@ -209,7 +209,7 @@ sunrealtype SUNLinSolResNorm(SUNLinearSolver S) if (S->ops->resnorm) result = S->ops->resnorm(S); else - result = RCONST(0.0); + result = SUN_RCONST(0.0); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(S)); return(result); } diff --git a/src/sundials/sundials_math.c b/src/sundials/sundials_math.c index fc1928dc8b..18534776e7 100644 --- a/src/sundials/sundials_math.c +++ b/src/sundials/sundials_math.c @@ -30,7 +30,7 @@ static booleantype sunIsInf(sunrealtype a) #if defined(__cplusplus) || defined(SUNDIALS_C_COMPILER_HAS_ISINF_ISNAN) return(isinf(a)); #else - return(a < -BIG_REAL || a > BIG_REAL); + return(a < -SUN_BIG_REAL || a > SUN_BIG_REAL); #endif } @@ -52,16 +52,16 @@ sunrealtype SUNRpowerI(sunrealtype base, int exponent) int i, expt; sunrealtype prod; - prod = RCONST(1.0); + prod = SUN_RCONST(1.0); expt = abs(exponent); for(i = 1; i <= expt; i++) prod *= base; - if (exponent < 0) prod = RCONST(1.0)/prod; + if (exponent < 0) prod = SUN_RCONST(1.0)/prod; return(prod); } sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent) { - if (base <= RCONST(0.0)) return(RCONST(0.0)); + if (base <= SUN_RCONST(0.0)) return(SUN_RCONST(0.0)); #if defined(__cplusplus) || defined(SUNDIALS_C_COMPILER_HAS_MATH_PRECISIONS) #if defined(SUNDIALS_DOUBLE_PRECISION) @@ -78,7 +78,7 @@ sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent) booleantype SUNRCompare(sunrealtype a, sunrealtype b) { - return(SUNRCompareTol(a, b, 10*UNIT_ROUNDOFF)); + return(SUNRCompareTol(a, b, 10*SUN_UNIT_ROUNDOFF)); } booleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) @@ -98,18 +98,18 @@ booleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) if (sunIsInf(a) || sunIsInf(b)) return(SUNTRUE); diff = SUNRabs(a - b); - norm = SUNMIN(SUNRabs(a + b), BIG_REAL); + norm = SUNMIN(SUNRabs(a + b), SUN_BIG_REAL); - /* When |a + b| is very small (less than 10*UNIT_ROUNDOFF) or zero, we use an + /* When |a + b| is very small (less than 10*SUN_UNIT_ROUNDOFF) or zero, we use an * absolute difference: - * |a - b| >= 10*UNIT_ROUNDOFF + * |a - b| >= 10*SUN_UNIT_ROUNDOFF * Otherwise we use a relative difference: * |a - b| < tol * |a + b| * The choice to use |a + b| over max(a, b) * is arbitrary, as is the choice to use - * 10*UNIT_ROUNDOFF. + * 10*SUN_UNIT_ROUNDOFF. */ - return(diff >= SUNMAX(10*UNIT_ROUNDOFF, tol*norm)); + return(diff >= SUNMAX(10*SUN_UNIT_ROUNDOFF, tol*norm)); } long double sunNextafterl(long double from, long double to) diff --git a/src/sundials/sundials_nvector.c b/src/sundials/sundials_nvector.c index f60e96f441..57c8362822 100644 --- a/src/sundials/sundials_nvector.c +++ b/src/sundials/sundials_nvector.c @@ -542,7 +542,7 @@ int N_VLinearCombination(int nvec, sunrealtype* c, N_Vector* X, N_Vector z) z->ops->nvscale(c[0], X[0], z); for (i=1; iops->nvlinearsum(c[i], X[i], RCONST(1.0), z, z); + z->ops->nvlinearsum(c[i], X[i], SUN_RCONST(1.0), z, z); } ier = 0; @@ -564,7 +564,7 @@ int N_VScaleAddMulti(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, N_Vector } else { for (i=0; iops->nvlinearsum(a[i], x, RCONST(1.0), Y[i], Z[i]); + x->ops->nvlinearsum(a[i], x, SUN_RCONST(1.0), Y[i], Z[i]); } ier = 0; @@ -749,7 +749,7 @@ int N_VScaleAddMultiVectorArray(int nvec, int nsum, sunrealtype* a, N_Vector* X, for (i=0; iops->nvlinearsum(a[j], X[i], RCONST(1.0), Y[j][i], Z[j][i]); + X[0]->ops->nvlinearsum(a[j], X[i], SUN_RCONST(1.0), Y[j][i], Z[j][i]); } } ier = 0; @@ -793,7 +793,7 @@ int N_VLinearCombinationVectorArray(int nvec, int nsum, sunrealtype* c, for (i=0; iops->nvscale(c[0], X[0][i], Z[i]); for (j=1; jops->nvlinearsum(c[j], X[j][i], RCONST(1.0), Z[i], Z[i]); + Z[0]->ops->nvlinearsum(c[j], X[j][i], SUN_RCONST(1.0), Z[i], Z[i]); } } ier = 0; diff --git a/src/sundials/sundials_nvector_senswrapper.c b/src/sundials/sundials_nvector_senswrapper.c index e8677a0e93..bb77419557 100644 --- a/src/sundials/sundials_nvector_senswrapper.c +++ b/src/sundials/sundials_nvector_senswrapper.c @@ -23,7 +23,7 @@ #include #include -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /*============================================================================== Constructors diff --git a/src/sundials/sundials_xbraid.c b/src/sundials/sundials_xbraid.c index 37788e30b4..37e0a2e293 100644 --- a/src/sundials/sundials_xbraid.c +++ b/src/sundials/sundials_xbraid.c @@ -17,7 +17,7 @@ #include "sundials/sundials_xbraid.h" #include "sundials/sundials_math.h" -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* ------------------------- diff --git a/src/sunlinsol/band/sunlinsol_band.c b/src/sunlinsol/band/sunlinsol_band.c index 6e67312ada..a98767ad5c 100644 --- a/src/sunlinsol/band/sunlinsol_band.c +++ b/src/sunlinsol/band/sunlinsol_band.c @@ -21,8 +21,8 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) #define ROW(i,j,smu) (i-j+smu) /* diff --git a/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu b/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu index 9b25dc67fe..da54666801 100644 --- a/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu +++ b/src/sunlinsol/cusolversp/sunlinsol_cusolversp_batchqr.cu @@ -25,9 +25,9 @@ #include "sundials_cuda.h" #include "sundials_debug.h" -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* macros for handling the different function names based on precision */ #if defined(SUNDIALS_DOUBLE_PRECISION) diff --git a/src/sunlinsol/dense/sunlinsol_dense.c b/src/sunlinsol/dense/sunlinsol_dense.c index 55a7139738..ed9e075f98 100644 --- a/src/sunlinsol/dense/sunlinsol_dense.c +++ b/src/sunlinsol/dense/sunlinsol_dense.c @@ -21,7 +21,7 @@ #include #include -#define ONE RCONST(1.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/klu/sunlinsol_klu.c b/src/sunlinsol/klu/sunlinsol_klu.c index dc7c754a76..5ba90f7e0e 100644 --- a/src/sunlinsol/klu/sunlinsol_klu.c +++ b/src/sunlinsol/klu/sunlinsol_klu.c @@ -22,10 +22,10 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) -#define TWOTHIRDS RCONST(0.666666666666666666666666666666667) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define TWOTHIRDS SUN_RCONST(0.666666666666666666666666666666667) /* * ----------------------------------------------------------------- @@ -246,7 +246,7 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) int retval; sunrealtype uround_twothirds; - uround_twothirds = SUNRpowerR(UNIT_ROUNDOFF,TWOTHIRDS); + uround_twothirds = SUNRpowerR(SUN_UNIT_ROUNDOFF,TWOTHIRDS); /* Ensure that A is a sparse matrix */ if (SUNMatGetID(A) != SUNMATRIX_SPARSE) { diff --git a/src/sunlinsol/lapackband/sunlinsol_lapackband.c b/src/sunlinsol/lapackband/sunlinsol_lapackband.c index 785431586a..274520cbf7 100644 --- a/src/sunlinsol/lapackband/sunlinsol_lapackband.c +++ b/src/sunlinsol/lapackband/sunlinsol_lapackband.c @@ -35,8 +35,8 @@ #error Incompatible sunrealtype for LAPACK; disable LAPACK and rebuild #endif -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c index 8de0ffb748..ad829f07f1 100644 --- a/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c +++ b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c @@ -35,8 +35,8 @@ #error Incompatible sunrealtype for LAPACK; disable LAPACK and rebuild #endif -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index 7e2eabc414..476d7c427b 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -36,8 +36,8 @@ #error Incompatible sunrealtype for MAGMA #endif -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp b/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp index 2fb53eb772..83ff3df6d7 100644 --- a/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp +++ b/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp @@ -466,7 +466,7 @@ int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, } // Copy b into x - N_VScale(RCONST(1.0), b, x); + N_VScale(SUN_RCONST(1.0), b, x); // Access x vector data array sunrealtype* xdata = N_VGetDeviceArrayPointer(x); diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index 0c6d517fc7..eadd8e3cde 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -25,8 +25,8 @@ #include "sundials_context_impl.h" #include "sundials_logger_impl.h" -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index 3479b82f38..1039169d25 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -26,8 +26,8 @@ #include "sundials_context_impl.h" #include "sundials_logger_impl.h" -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index 827e34580b..585183fc15 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -26,8 +26,8 @@ #include "sundials_context_impl.h" #include "sundials_logger_impl.h" -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 56accfb679..925201d7a1 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -26,8 +26,8 @@ #include "sundials_context_impl.h" #include "sundials_logger_impl.h" -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 2a8049d9a5..505bbde392 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -25,8 +25,8 @@ #include "sundials_context_impl.h" #include "sundials_logger_impl.h" -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/superludist/sunlinsol_superludist.c b/src/sunlinsol/superludist/sunlinsol_superludist.c index 051a462cb2..dc813b23bc 100644 --- a/src/sunlinsol/superludist/sunlinsol_superludist.c +++ b/src/sunlinsol/superludist/sunlinsol_superludist.c @@ -23,9 +23,9 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* * ----------------------------------------------------------------- diff --git a/src/sunlinsol/superlumt/sunlinsol_superlumt.c b/src/sunlinsol/superlumt/sunlinsol_superlumt.c index b4a758c0fa..a0313c5569 100644 --- a/src/sunlinsol/superlumt/sunlinsol_superlumt.c +++ b/src/sunlinsol/superlumt/sunlinsol_superlumt.c @@ -24,9 +24,9 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) /* * ----------------------------------------------------------------- diff --git a/src/sunmatrix/band/sunmatrix_band.c b/src/sunmatrix/band/sunmatrix_band.c index cbf2a29a20..2409ca60a3 100644 --- a/src/sunmatrix/band/sunmatrix_band.c +++ b/src/sunmatrix/band/sunmatrix_band.c @@ -26,8 +26,8 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Private function prototypes */ diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index db8dd635c5..1b3562fa2c 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -33,8 +33,8 @@ using namespace sundials::cuda; using namespace sundials::sunmatrix_cusparse; /* Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Private function prototypes */ static booleantype SMCompatible_cuSparse(SUNMatrix, SUNMatrix); diff --git a/src/sunmatrix/dense/sunmatrix_dense.c b/src/sunmatrix/dense/sunmatrix_dense.c index 5cc404da17..79bce74cfc 100644 --- a/src/sunmatrix/dense/sunmatrix_dense.c +++ b/src/sunmatrix/dense/sunmatrix_dense.c @@ -23,8 +23,8 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Private function prototypes */ static booleantype compatibleMatrices(SUNMatrix A, SUNMatrix B); diff --git a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp index b0b041a4e8..4f2a57a6d5 100644 --- a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp +++ b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp @@ -38,8 +38,8 @@ using namespace sundials::sunmatrix_gpudense::hip; #define SMLD_CONTENT(A) ( (SUNMatrixContent_MagmaDense) (A->content) ) /* Constants */ -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Macros for magma operations based on precision */ #if defined(SUNDIALS_DOUBLE_PRECISION) diff --git a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp index 9c751b205a..c8dafadec5 100644 --- a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp +++ b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp @@ -35,8 +35,8 @@ #endif // Constants -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) // Content accessor macros #define MAT_CONTENT(A) ((SUNMatrixContent_OneMklDense) (A->content)) diff --git a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c index f7c10af34d..6e2bc48e52 100644 --- a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c +++ b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c @@ -65,7 +65,7 @@ #define SM_ROWPTRS_SLUNRLOC(A) ( SM_SUPERSTORE_SLUNRLOC(A)->rowptr ) /* constants */ -#define ZERO RCONST(0.0) +#define ZERO SUN_RCONST(0.0) /* Private function prototypes */ static booleantype SMCompatible_SLUNRloc(SUNMatrix A, SUNMatrix B); diff --git a/src/sunmatrix/sparse/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index 1e518229d6..93f2451e21 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -27,8 +27,8 @@ #include #include -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) /* Private function prototypes */ static booleantype SMCompatible_Sparse(SUNMatrix A, SUNMatrix B); @@ -900,7 +900,7 @@ int SUNMatScaleAdd_Sparse(sunrealtype c, SUNMatrix A, SUNMatrix B) /* clear out temporary arrays for this column (row) */ for (i=0; icontent) ) /* Constant macros */ -#define ONE RCONST(1.0) -#define ZERO RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define ZERO SUN_RCONST(0.0) /*============================================================================== Constructor to create a new fixed point solver diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index eaa346bf9a..5e785f26f8 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -30,8 +30,8 @@ #define NEWTON_CONTENT(S) ( (SUNNonlinearSolverContent_Newton)(S->content) ) /* Constant macros */ -#define ZERO RCONST(0.0) /* real 0.0 */ -#define ONE RCONST(1.0) /* real 1.0 */ +#define ZERO SUN_RCONST(0.0) /* real 0.0 */ +#define ONE SUN_RCONST(1.0) /* real 1.0 */ /*============================================================================== Constructor to create a new Newton solver diff --git a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp index 643ece5eda..9ecb397a70 100644 --- a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp +++ b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp @@ -48,10 +48,10 @@ using namespace std; // accessor macros between (x,y) location and 1D NVector array #define IDX(x,y,n) ((n)*(y)+(x)) -#define PI RCONST(3.141592653589793238462643383279502884197169) -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) -#define TWO RCONST(2.0) +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) // user data structure typedef struct { @@ -111,15 +111,15 @@ int main(int argc, char* argv[]) { SUNContext_Create(NULL, &ctx); // general problem parameters - sunrealtype T0 = RCONST(0.0); // initial time - sunrealtype Tf = RCONST(0.3); // final time + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(0.3); // final time int Nt = 1000; // total number of internal steps sunindextype nx = 60; // spatial mesh size sunindextype ny = 120; - sunrealtype kx = RCONST(0.5); // heat conductivity coefficients - sunrealtype ky = RCONST(0.75); - sunrealtype rtol = RCONST(1.e-5); // relative and absolute tolerances - sunrealtype atol = RCONST(1.e-10); + sunrealtype kx = SUN_RCONST(0.5); // heat conductivity coefficients + sunrealtype ky = SUN_RCONST(0.75); + sunrealtype rtol = SUN_RCONST(1.e-5); // relative and absolute tolerances + sunrealtype atol = SUN_RCONST(1.e-10); UserData *udata = NULL; sunrealtype *data; sunindextype N, Ntot, i, j; @@ -225,10 +225,10 @@ int main(int argc, char* argv[]) { // Create solve-decoupled DIRK2 (trapezoidal) Butcher table ARKodeButcherTable B = ARKodeButcherTable_Alloc(2, SUNFALSE); if (check_flag((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); - B->A[1][1] = RCONST(0.5); - B->b[0] = RCONST(0.5); - B->b[1] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); + B->A[1][1] = SUN_RCONST(0.5); + B->b[0] = SUN_RCONST(0.5); + B->b[1] = SUN_RCONST(0.5); B->c[1] = ONE; B->q=2; @@ -236,10 +236,10 @@ int main(int argc, char* argv[]) { ARKodeButcherTable Bc = ARKodeButcherTable_Alloc(3, SUNFALSE); if (check_flag((void *)Bc, "ARKodeButcherTable_Alloc", 0)) return 1; Bc->A[1][0] = ONE; - Bc->A[2][0] = RCONST(0.5); - Bc->A[2][2] = RCONST(0.5); - Bc->b[0] = RCONST(0.5); - Bc->b[2] = RCONST(0.5); + Bc->A[2][0] = SUN_RCONST(0.5); + Bc->A[2][2] = SUN_RCONST(0.5); + Bc->b[0] = SUN_RCONST(0.5); + Bc->b[2] = SUN_RCONST(0.5); Bc->c[1] = ONE; Bc->c[2] = ONE; Bc->q=2; @@ -251,7 +251,7 @@ int main(int argc, char* argv[]) { // Set routines flag = ARKStepSetUserData(arkstep_mem, (void *) udata); // Pass udata to user functions if (check_flag(&flag, "ARKStepSetUserData", 1)) return 1; - flag = ARKStepSetNonlinConvCoef(arkstep_mem, RCONST(1.e-7)); // Update solver convergence coeff. + flag = ARKStepSetNonlinConvCoef(arkstep_mem, SUN_RCONST(1.e-7)); // Update solver convergence coeff. if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) return 1; flag = ARKStepSStolerances(arkstep_mem, rtol, atol); // Specify tolerances if (check_flag(&flag, "ARKStepSStolerances", 1)) return 1; @@ -264,7 +264,7 @@ int main(int argc, char* argv[]) { flag = MRIStepSetUserData(mristep_mem, (void *) udata); // Pass udata to user functions if (check_flag(&flag, "MRIStepSetUserData", 1)) return 1; - flag = MRIStepSetNonlinConvCoef(mristep_mem, RCONST(1.e-7)); // Update solver convergence coeff. + flag = MRIStepSetNonlinConvCoef(mristep_mem, SUN_RCONST(1.e-7)); // Update solver convergence coeff. if (check_flag(&flag, "MRIStepSetNonlinConvCoef", 1)) return 1; flag = MRIStepSStolerances(mristep_mem, rtol, atol); // Specify tolerances if (check_flag(&flag, "MRIStepSStolerances", 1)) return 1; diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp index 3e89362ca3..623d91693c 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp @@ -46,8 +46,8 @@ using namespace std; -#define ZERO RCONST(0.0) -#define ONE RCONST(1.0) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) // User-supplied Functions Called by the Solver static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); @@ -71,13 +71,13 @@ int main(int argc, char* argv[]) SUNContext_Create(NULL, &sunctx); // general problem parameters - sunrealtype T0 = RCONST(0.0); // initial time - sunrealtype Tf = RCONST(0.05); // final time + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(0.05); // final time int Nt = 1000; // total number of internal steps sunindextype NEQ = 3; // number of dependent vars. - sunrealtype reltol = RCONST(1.0e-6); // tolerances - sunrealtype abstol = RCONST(1.0e-10); - sunrealtype lamda = RCONST(-100.0); // stiffness parameter + sunrealtype reltol = SUN_RCONST(1.0e-6); // tolerances + sunrealtype abstol = SUN_RCONST(1.0e-10); + sunrealtype lamda = SUN_RCONST(-100.0); // stiffness parameter // general problem variables int flag; // reusable error-checking flag @@ -135,10 +135,10 @@ int main(int argc, char* argv[]) // Create DIRK2 (trapezoidal) Butcher table ARKodeButcherTable B = ARKodeButcherTable_Alloc(2, SUNFALSE); if (check_flag((void *)B, "ARKodeButcherTable_Alloc", 0)) return 1; - B->A[1][0] = RCONST(0.5); - B->A[1][1] = RCONST(0.5); - B->b[0] = RCONST(0.5); - B->b[1] = RCONST(0.5); + B->A[1][0] = SUN_RCONST(0.5); + B->A[1][1] = SUN_RCONST(0.5); + B->b[0] = SUN_RCONST(0.5); + B->b[1] = SUN_RCONST(0.5); B->c[1] = ONE; B->q=2; @@ -146,10 +146,10 @@ int main(int argc, char* argv[]) ARKodeButcherTable Bc = ARKodeButcherTable_Alloc(3, SUNFALSE); if (check_flag((void *)Bc, "ARKodeButcherTable_Alloc", 0)) return 1; Bc->A[1][0] = ONE; - Bc->A[2][0] = RCONST(0.5); - Bc->A[2][2] = RCONST(0.5); - Bc->b[0] = RCONST(0.5); - Bc->b[2] = RCONST(0.5); + Bc->A[2][0] = SUN_RCONST(0.5); + Bc->A[2][2] = SUN_RCONST(0.5); + Bc->b[0] = SUN_RCONST(0.5); + Bc->b[2] = SUN_RCONST(0.5); Bc->c[1] = ONE; Bc->c[2] = ONE; Bc->q=2; @@ -382,15 +382,15 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) sunrealtype yd0, yd1, yd2; // fill in the RHS function: f(t,y) = V*D*Vi*y - yd0 = RCONST(0.25)*(RCONST(5.0)*y0 + RCONST(1.0)*y1 - RCONST(3.0)*y2); // yd = Vi*y - yd1 = RCONST(0.25)*(RCONST(2.0)*y0 + RCONST(2.0)*y1 - RCONST(2.0)*y2); - yd2 = RCONST(0.25)*(RCONST(1.0)*y0 + RCONST(1.0)*y1 + RCONST(1.0)*y2); - y0 = -RCONST(0.5)*yd0; // y = D*yd - y1 = -RCONST(0.1)*yd1; + yd0 = SUN_RCONST(0.25)*(SUN_RCONST(5.0)*y0 + SUN_RCONST(1.0)*y1 - SUN_RCONST(3.0)*y2); // yd = Vi*y + yd1 = SUN_RCONST(0.25)*(SUN_RCONST(2.0)*y0 + SUN_RCONST(2.0)*y1 - SUN_RCONST(2.0)*y2); + yd2 = SUN_RCONST(0.25)*(SUN_RCONST(1.0)*y0 + SUN_RCONST(1.0)*y1 + SUN_RCONST(1.0)*y2); + y0 = -SUN_RCONST(0.5)*yd0; // y = D*yd + y1 = -SUN_RCONST(0.1)*yd1; y2 = lam*yd2; - yd0 = RCONST(1.0)*y0 - RCONST(1.0)*y1 + RCONST(1.0)*y2; // yd = V*y - yd1 = -RCONST(1.0)*y0 + RCONST(2.0)*y1 + RCONST(1.0)*y2; - yd2 = RCONST(0.0)*y0 - RCONST(1.0)*y1 + RCONST(2.0)*y2; + yd0 = SUN_RCONST(1.0)*y0 - SUN_RCONST(1.0)*y1 + SUN_RCONST(1.0)*y2; // yd = V*y + yd1 = -SUN_RCONST(1.0)*y0 + SUN_RCONST(2.0)*y1 + SUN_RCONST(1.0)*y2; + yd2 = SUN_RCONST(0.0)*y0 - SUN_RCONST(1.0)*y1 + SUN_RCONST(2.0)*y2; NV_Ith_S(ydot,0) = yd0; NV_Ith_S(ydot,1) = yd1; NV_Ith_S(ydot,2) = yd2; @@ -423,30 +423,30 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, // Fill in temporary matrices: // V = [1 -1 1; -1 2 1; 0 -1 2] - SM_ELEMENT_D(V,0,0) = RCONST(1.0); - SM_ELEMENT_D(V,0,1) = -RCONST(1.0); - SM_ELEMENT_D(V,0,2) = RCONST(1.0); - SM_ELEMENT_D(V,1,0) = -RCONST(1.0); - SM_ELEMENT_D(V,1,1) = RCONST(2.0); - SM_ELEMENT_D(V,1,2) = RCONST(1.0); - SM_ELEMENT_D(V,2,0) = RCONST(0.0); - SM_ELEMENT_D(V,2,1) = -RCONST(1.0); - SM_ELEMENT_D(V,2,2) = RCONST(2.0); + SM_ELEMENT_D(V,0,0) = SUN_RCONST(1.0); + SM_ELEMENT_D(V,0,1) = -SUN_RCONST(1.0); + SM_ELEMENT_D(V,0,2) = SUN_RCONST(1.0); + SM_ELEMENT_D(V,1,0) = -SUN_RCONST(1.0); + SM_ELEMENT_D(V,1,1) = SUN_RCONST(2.0); + SM_ELEMENT_D(V,1,2) = SUN_RCONST(1.0); + SM_ELEMENT_D(V,2,0) = SUN_RCONST(0.0); + SM_ELEMENT_D(V,2,1) = -SUN_RCONST(1.0); + SM_ELEMENT_D(V,2,2) = SUN_RCONST(2.0); // Vi = 0.25*[5 1 -3; 2 2 -2; 1 1 1] - SM_ELEMENT_D(Vi,0,0) = RCONST(0.25)*RCONST(5.0); - SM_ELEMENT_D(Vi,0,1) = RCONST(0.25)*RCONST(1.0); - SM_ELEMENT_D(Vi,0,2) = -RCONST(0.25)*RCONST(3.0); - SM_ELEMENT_D(Vi,1,0) = RCONST(0.25)*RCONST(2.0); - SM_ELEMENT_D(Vi,1,1) = RCONST(0.25)*RCONST(2.0); - SM_ELEMENT_D(Vi,1,2) = -RCONST(0.25)*RCONST(2.0); - SM_ELEMENT_D(Vi,2,0) = RCONST(0.25)*RCONST(1.0); - SM_ELEMENT_D(Vi,2,1) = RCONST(0.25)*RCONST(1.0); - SM_ELEMENT_D(Vi,2,2) = RCONST(0.25)*RCONST(1.0); + SM_ELEMENT_D(Vi,0,0) = SUN_RCONST(0.25)*SUN_RCONST(5.0); + SM_ELEMENT_D(Vi,0,1) = SUN_RCONST(0.25)*SUN_RCONST(1.0); + SM_ELEMENT_D(Vi,0,2) = -SUN_RCONST(0.25)*SUN_RCONST(3.0); + SM_ELEMENT_D(Vi,1,0) = SUN_RCONST(0.25)*SUN_RCONST(2.0); + SM_ELEMENT_D(Vi,1,1) = SUN_RCONST(0.25)*SUN_RCONST(2.0); + SM_ELEMENT_D(Vi,1,2) = -SUN_RCONST(0.25)*SUN_RCONST(2.0); + SM_ELEMENT_D(Vi,2,0) = SUN_RCONST(0.25)*SUN_RCONST(1.0); + SM_ELEMENT_D(Vi,2,1) = SUN_RCONST(0.25)*SUN_RCONST(1.0); + SM_ELEMENT_D(Vi,2,2) = SUN_RCONST(0.25)*SUN_RCONST(1.0); // D = [-0.5 0 0; 0 -0.1 0; 0 0 lam] - SM_ELEMENT_D(D,0,0) = -RCONST(0.5); - SM_ELEMENT_D(D,1,1) = -RCONST(0.1); + SM_ELEMENT_D(D,0,0) = -SUN_RCONST(0.5); + SM_ELEMENT_D(D,1,1) = -SUN_RCONST(0.1); SM_ELEMENT_D(D,2,2) = lam; // Compute J = V*D*Vi diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp index 05320ce6ab..c74130d86c 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp @@ -45,9 +45,9 @@ using namespace std; // User data structure struct UserData { - sunrealtype lambda_e = RCONST(-1.0); - sunrealtype lambda_i = RCONST(-1.0); - sunrealtype lambda_f = RCONST(-1.0); + sunrealtype lambda_e = SUN_RCONST(-1.0); + sunrealtype lambda_i = SUN_RCONST(-1.0); + sunrealtype lambda_f = SUN_RCONST(-1.0); }; // User-supplied Functions called by the solver @@ -74,18 +74,18 @@ static int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, int main(int argc, char* argv[]) { // Initial time - sunrealtype t0 = RCONST(0.0); + sunrealtype t0 = SUN_RCONST(0.0); // Number of time steps int nsteps = 1; // Relative and absolute tolerances - sunrealtype reltol = RCONST(1.0e-4); - sunrealtype abstol = RCONST(1.0e-6); + sunrealtype reltol = SUN_RCONST(1.0e-4); + sunrealtype abstol = SUN_RCONST(1.0e-6); // Slow and fast step sizes - sunrealtype hs = RCONST(0.01); - sunrealtype hf = RCONST(0.01); + sunrealtype hs = SUN_RCONST(0.01); + sunrealtype hf = SUN_RCONST(0.01); // User data structure UserData udata; @@ -156,7 +156,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, N_Vector y = N_VNew_Serial(1, sunctx); if (check_flag((void *)y, "N_VNew_Serial", 0)) return 1; - N_VConst(RCONST(1.0), y); + N_VConst(SUN_RCONST(1.0), y); // Create matrix and linear solver (if necessary) SUNMatrix A = nullptr; @@ -471,7 +471,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, MRIStepCoupling_Free(C); // Reset state vector to the initial condition - N_VConst(RCONST(1.0), y); + N_VConst(SUN_RCONST(1.0), y); // Re-initialize fast integrator flag = ARKStepReInit(arkstep_mem, ff, nullptr, t0, y); diff --git a/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c b/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c index b9257773e9..08818856a4 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c +++ b/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c @@ -67,14 +67,14 @@ int main(int argc, char *argv[]) /* default input values */ sunindextype NEQ = 1; /* number of dependent vars. */ int order = 3; /* order of polynomial forcing */ - sunrealtype T0 = RCONST(0.0); /* initial time */ - sunrealtype Tf = RCONST(1.0); /* final time */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(1.0); /* final time */ sunrealtype tshift = T0; /* time shift for normalization */ sunrealtype tscale = Tf; /* time scale for normalization */ /* tolerances */ - sunrealtype reltol = SUNRsqrt(UNIT_ROUNDOFF); - sunrealtype abstol = SUNRsqrt(UNIT_ROUNDOFF)/100; + sunrealtype reltol = SUNRsqrt(SUN_UNIT_ROUNDOFF); + sunrealtype abstol = SUNRsqrt(SUN_UNIT_ROUNDOFF)/100; /* general problem variables */ int flag; /* reusable error-checking flag */ diff --git a/test/unit_tests/arkode/C_serial/ark_test_interp.c b/test/unit_tests/arkode/C_serial/ark_test_interp.c index 4863e0f34f..cd79b34b07 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_interp.c +++ b/test/unit_tests/arkode/C_serial/ark_test_interp.c @@ -89,12 +89,12 @@ int main(int argc, char *argv[]) SUNContext_Create(NULL, &sunctx); /* general problem parameters */ - T0 = RCONST(0.0); /* initial time */ - Tf = RCONST(10.0); /* final time */ + T0 = SUN_RCONST(0.0); /* initial time */ + Tf = SUN_RCONST(10.0); /* final time */ NEQ = 2; /* number of dependent vars. */ /* if an argument supplied, set lambda (otherwise use -100) */ - lambda = -RCONST(100.0); + lambda = -SUN_RCONST(100.0); if (argc > 1) lambda = strtod(argv[1], NULL); /* determine test configuration */ @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) /* test parameters */ nttest = 500; - hbase = RCONST(2.0); + hbase = SUN_RCONST(2.0); /*---- Part I: Hermite interpolation module ----*/ printf("\nHermite interpolation module tests:\n"); @@ -174,23 +174,23 @@ int main(int argc, char *argv[]) /* reset error/convergence arrays */ for (ih=0; ih Date: Thu, 26 Oct 2023 10:47:58 -0700 Subject: [PATCH 08/85] add old types into a different header for backwards compatibility --- include/sundials/sundials_types_old.h | 73 +++++++++++++++++++++++++++ scripts/shared | 1 + 2 files changed, 74 insertions(+) create mode 100644 include/sundials/sundials_types_old.h diff --git a/include/sundials/sundials_types_old.h b/include/sundials/sundials_types_old.h new file mode 100644 index 0000000000..2b60006edc --- /dev/null +++ b/include/sundials/sundials_types_old.h @@ -0,0 +1,73 @@ +/* ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, 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 header file exports realtype and booleantype and a few macros + * related to realtype for backwards compatibility. It is preferable + * to only use the types defined in sundials_types.h . + * -----------------------------------------------------------------*/ + +#ifndef _SUNDIALS_TYPES_OLD_H +#define _SUNDIALS_TYPES_OLD_H + +#include +#include + +#include +#include +#include + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* + *------------------------------------------------------------------ + * Type realtype + * Macro RCONST + * Constants SMALL_REAL, BIG_REAL, and UNIT_ROUNDOFF + *------------------------------------------------------------------ + */ + +#if defined(SUNDIALS_SINGLE_PRECISION) + +typedef float realtype; +# define RCONST(x) x##F +# define BIG_REAL FLT_MAX +# define SMALL_REAL FLT_MIN +# define UNIT_ROUNDOFF FLT_EPSILON + +#elif defined(SUNDIALS_DOUBLE_PRECISION) + +typedef double realtype; +# define RCONST(x) x +# define BIG_REAL DBL_MAX +# define SMALL_REAL DBL_MIN +# define UNIT_ROUNDOFF DBL_EPSILON + +#elif defined(SUNDIALS_EXTENDED_PRECISION) + +typedef long double realtype; +# define RCONST(x) x##L +# define BIG_REAL LDBL_MAX +# define SMALL_REAL LDBL_MIN +# define UNIT_ROUNDOFF LDBL_EPSILON + +#endif + +#ifndef booleantype +#define booleantype int +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNDIALS_TYPES_OLD_H */ diff --git a/scripts/shared b/scripts/shared index 9e42969552..34a355d74e 100755 --- a/scripts/shared +++ b/scripts/shared @@ -127,6 +127,7 @@ $tar $tarfile $distrobase/include/sundials/sundials_convertibleto.hpp $tar $tarfile $distrobase/include/sundials/sundials_cuda_policies.hpp $tar $tarfile $distrobase/include/sundials/sundials_hip_policies.hpp $tar $tarfile $distrobase/include/sundials/sundials_types.h +$tar $tarfile $distrobase/include/sundials/sundials_types_old.h $tar $tarfile $distrobase/include/sundials/sundials_mpi_types.h $tar $tarfile $distrobase/include/sundials/sundials_matrix.h $tar $tarfile $distrobase/include/sundials/sundials_matrix.hpp From f51efc4008634363ac6406861f397c99ead48986 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:50:06 -0700 Subject: [PATCH 09/85] booleantype --> sunbooleantype --- .../kokkos/arkode_driver.cpp | 2 +- .../raja/arkode_driver.cpp | 2 +- benchmarks/diffusion_2D/diffusion_2D.hpp | 4 +- .../diffusion_2D/preconditioner_jacobi.cpp | 4 +- .../guide/source/ARKodeButcherTable.rst | 2 +- .../ARKStep_c_interface/User_callable.rst | 6 +- .../ERKStep_c_interface/User_callable.rst | 2 +- doc/arkode/guide/source/Usage/General.rst | 2 +- .../MRIStep_c_interface/User_callable.rst | 4 +- .../guide/source/Usage/User_supplied.rst | 4 +- doc/cvode/guide/source/Usage/index.rst | 16 +- doc/cvodes/guide/source/Usage/ADJ.rst | 10 +- doc/cvodes/guide/source/Usage/FSA.rst | 4 +- doc/cvodes/guide/source/Usage/SIM.rst | 16 +- doc/ida/guide/source/Usage/index.rst | 8 +- doc/idas/guide/source/Usage/ADJ.rst | 2 +- doc/idas/guide/source/Usage/FSA.rst | 4 +- doc/idas/guide/source/Usage/SIM.rst | 10 +- doc/kinsol/guide/source/Usage/index.rst | 12 +- doc/shared/Types.rst | 10 +- doc/shared/nvectors/NVector_CUDA.rst | 28 +-- doc/shared/nvectors/NVector_Description.rst | 8 +- doc/shared/nvectors/NVector_HIP.rst | 28 +-- doc/shared/nvectors/NVector_MPIManyVector.rst | 20 +-- doc/shared/nvectors/NVector_ManyVector.rst | 20 +-- doc/shared/nvectors/NVector_OpenMP.rst | 24 +-- doc/shared/nvectors/NVector_OpenMPDEV.rst | 24 +-- doc/shared/nvectors/NVector_Operations.rst | 8 +- doc/shared/nvectors/NVector_PETSc.rst | 24 +-- doc/shared/nvectors/NVector_ParHyp.rst | 26 +-- doc/shared/nvectors/NVector_Parallel.rst | 24 +-- doc/shared/nvectors/NVector_Pthreads.rst | 24 +-- doc/shared/nvectors/NVector_RAJA.rst | 28 +-- doc/shared/nvectors/NVector_SYCL.rst | 28 +-- doc/shared/nvectors/NVector_Serial.rst | 24 +-- doc/shared/sundials/Fortran.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_API.rst | 4 +- doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst | 4 +- doc/shared/sunlinsol/SUNLinSol_PCG.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPGMR.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst | 2 +- .../sunlinsol/SUNLinSol_SuperLUDIST.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst | 2 +- doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst | 4 +- doc/shared/sunmatrix/SUNMatrix_cuSparse.rst | 2 +- .../sunmemory/SUNMemory_Description.rst | 2 +- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 8 +- .../sunnonlinsol/SUNNonlinSol_FixedPoint.rst | 2 +- .../sunnonlinsol/SUNNonlinSol_Newton.rst | 2 +- .../ark_brusselator1D_task_local_nls.cpp | 2 +- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 8 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 8 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 8 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 8 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 8 +- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 6 +- .../ark_brusselator1D_FEM_sludist.cpp | 6 +- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 8 +- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 8 +- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 8 +- .../ark_brusselator1D_task_local_nls.c | 10 +- .../arkode/C_parallel/ark_diurnal_kry_p.c | 4 +- examples/arkode/C_parhyp/ark_diurnal_kry_ph.c | 6 +- .../arkode/C_serial/ark_KrylovDemo_prec.c | 10 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 6 +- .../C_serial/ark_brusselator1D_imexmri.c | 4 +- examples/arkode/C_serial/ark_kpr_mri.c | 8 +- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 8 +- .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 8 +- examples/cvode/CXX_serial/cv_heat2D.cpp | 4 +- .../cvDiurnal_kry_mpimanyvec.c | 8 +- examples/cvode/parallel/cvDiurnal_kry_bbd_p.c | 2 +- examples/cvode/parallel/cvDiurnal_kry_p.c | 6 +- examples/cvode/serial/cvDirectDemo_ls.c | 4 +- examples/cvode/serial/cvDiurnal_kry.c | 8 +- examples/cvode/serial/cvKrylovDemo_ls.c | 8 +- examples/cvode/serial/cvKrylovDemo_prec.c | 10 +- examples/cvode/serial/cvPendulum_dns.c | 10 +- examples/cvode/serial/cvRoberts_dns_negsol.c | 6 +- .../cvode/superludist/cvAdvDiff_sludist.cpp | 4 +- .../cvodes/parallel/cvsAdvDiff_FSA_non_p.c | 14 +- .../parallel/cvsAtmDisp_ASAi_kry_bbd_p.c | 2 +- .../cvodes/parallel/cvsDiurnal_FSA_kry_p.c | 18 +- .../cvodes/parallel/cvsDiurnal_kry_bbd_p.c | 2 +- examples/cvodes/parallel/cvsDiurnal_kry_p.c | 6 +- examples/cvodes/serial/cvsAdvDiff_FSA_non.c | 16 +- examples/cvodes/serial/cvsDirectDemo_ls.c | 4 +- examples/cvodes/serial/cvsDiurnal_FSA_kry.c | 22 +-- examples/cvodes/serial/cvsDiurnal_kry.c | 4 +- examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c | 12 +- examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c | 12 +- examples/cvodes/serial/cvsKrylovDemo_ls.c | 8 +- examples/cvodes/serial/cvsKrylovDemo_prec.c | 10 +- examples/cvodes/serial/cvsPendulum_dns.c | 10 +- examples/cvodes/serial/cvsRoberts_FSA_dns.c | 8 +- .../cvodes/serial/cvsRoberts_FSA_dns_Switch.c | 6 +- .../serial/cvsRoberts_FSA_dns_constraints.c | 12 +- examples/cvodes/serial/cvsRoberts_FSA_klu.c | 12 +- examples/cvodes/serial/cvsRoberts_FSA_sps.c | 12 +- .../idas/parallel/idasHeat2D_FSA_kry_bbd_p.c | 16 +- examples/idas/serial/idasRoberts_FSA_dns.c | 8 +- examples/idas/serial/idasRoberts_FSA_klu.c | 12 +- examples/idas/serial/idasRoberts_FSA_sps.c | 12 +- .../kinsol/serial/kinLaplace_picard_kry.c | 4 +- .../nvector/C_openmp/test_nvector_openmp.c | 2 +- examples/nvector/cuda/test_nvector_cuda.cu | 2 +- examples/nvector/hip/test_nvector_hip.cpp | 2 +- .../nvector/kokkos/test_nvector_kokkos.cpp | 2 +- .../manyvector/test_nvector_manyvector.c | 2 +- .../nvector/mpicuda/test_nvector_mpicuda.cu | 2 +- .../test_nvector_mpimanyvector_parallel1.c | 2 +- .../test_nvector_mpimanyvector_parallel2.c | 2 +- .../nvector/mpiplusx/test_nvector_mpiplusx.c | 2 +- .../nvector/mpiraja/test_nvector_mpiraja.cpp | 2 +- .../openmpdev/test_nvector_openmpdev.c | 2 +- examples/nvector/parallel/test_nvector_mpi.c | 2 +- examples/nvector/parhyp/test_nvector_parhyp.c | 2 +- examples/nvector/petsc/test_nvector_petsc.c | 2 +- .../nvector/pthreads/test_nvector_pthreads.c | 2 +- examples/nvector/raja/test_nvector_raja.cpp | 2 +- examples/nvector/serial/test_nvector_serial.c | 2 +- examples/nvector/sycl/test_nvector_sycl.cpp | 2 +- examples/nvector/test_nvector.c | 8 +- examples/nvector/test_nvector.h | 2 +- .../trilinos/test_nvector_trilinos.cpp | 2 +- examples/sunlinsol/test_sunlinsol.c | 2 +- examples/sunlinsol/test_sunlinsol.h | 2 +- examples/sunmatrix/band/test_sunmatrix_band.c | 4 +- .../cusparse/test_sunmatrix_cusparse.cu | 4 +- .../sunmatrix/dense/test_sunmatrix_dense.c | 4 +- .../ginkgo/test_sunmatrix_ginkgo.cpp | 4 +- .../kokkos/test_sunmatrix_kokkosdense.cpp | 4 +- .../magmadense/test_sunmatrix_magmadense.cpp | 4 +- .../test_sunmatrix_onemkldense.cpp | 4 +- .../slunrloc/test_sunmatrix_slunrloc.cpp | 4 +- .../sunmatrix/sparse/test_sunmatrix_sparse.c | 4 +- examples/sunmatrix/test_sunmatrix.h | 4 +- .../newton/test_sunnonlinsol_newton.c | 4 +- include/arkode/arkode_arkstep.h | 6 +- include/arkode/arkode_butcher.h | 2 +- include/arkode/arkode_erkstep.h | 2 +- include/arkode/arkode_ls.h | 6 +- include/arkode/arkode_mristep.h | 4 +- include/cvode/cvode.h | 6 +- include/cvode/cvode_hypamgpre.h | 2 +- include/cvode/cvode_ls.h | 6 +- include/cvode/cvode_proj.h | 2 +- include/cvodes/cvodes.h | 14 +- include/cvodes/cvodes_ls.h | 20 +-- include/cvodes/cvodes_proj.h | 2 +- include/ida/ida.h | 4 +- include/ida/ida_ls.h | 2 +- include/idas/idas.h | 12 +- include/idas/idas_ls.h | 4 +- include/kinsol/kinsol.h | 8 +- include/kinsol/kinsol_ls.h | 2 +- include/nvector/nvector_cuda.h | 32 ++-- include/nvector/nvector_hip.h | 32 ++-- include/nvector/nvector_kokkos.hpp | 4 +- include/nvector/nvector_manyvector.h | 28 +-- include/nvector/nvector_mpimanyvector.h | 32 ++-- include/nvector/nvector_mpiplusx.h | 2 +- include/nvector/nvector_openmp.h | 30 ++-- include/nvector/nvector_openmpdev.h | 30 ++-- include/nvector/nvector_parallel.h | 36 ++-- include/nvector/nvector_parhyp.h | 36 ++-- include/nvector/nvector_petsc.h | 36 ++-- include/nvector/nvector_pthreads.h | 30 ++-- include/nvector/nvector_raja.h | 26 +-- include/nvector/nvector_serial.h | 30 ++-- include/nvector/nvector_sycl.h | 32 ++-- include/nvector/nvector_trilinos.h | 10 +- include/sundials/sundials_linearsolver.h | 4 +- include/sundials/sundials_math.h | 4 +- include/sundials/sundials_memory.h | 4 +- include/sundials/sundials_nonlinearsolver.h | 6 +- include/sundials/sundials_nvector.h | 16 +- .../sundials/sundials_nvector_senswrapper.h | 6 +- include/sundials/sundials_types.h | 4 +- .../sunlinsol/sunlinsol_cusolversp_batchqr.h | 2 +- include/sunlinsol/sunlinsol_dense.h | 2 +- include/sunlinsol/sunlinsol_magmadense.h | 4 +- include/sunlinsol/sunlinsol_pcg.h | 4 +- include/sunlinsol/sunlinsol_spbcgs.h | 4 +- include/sunlinsol/sunlinsol_spfgmr.h | 4 +- include/sunlinsol/sunlinsol_spgmr.h | 4 +- include/sunlinsol/sunlinsol_sptfqmr.h | 4 +- include/sunlinsol/sunlinsol_superludist.h | 2 +- include/sunmatrix/sunmatrix_band.h | 2 +- include/sunmatrix/sunmatrix_cusparse.h | 8 +- include/sunmatrix/sunmatrix_dense.h | 2 +- include/sunmatrix/sunmatrix_slunrloc.h | 4 +- include/sunmatrix/sunmatrix_sparse.h | 2 +- .../sunnonlinsol/sunnonlinsol_fixedpoint.h | 4 +- include/sunnonlinsol/sunnonlinsol_newton.h | 4 +- include/sunnonlinsol/sunnonlinsol_petscsnes.h | 2 +- src/arkode/arkode.c | 30 ++-- src/arkode/arkode_adapt_impl.h | 2 +- src/arkode/arkode_arkstep.c | 24 +-- src/arkode/arkode_arkstep_impl.h | 30 ++-- src/arkode/arkode_arkstep_io.c | 6 +- src/arkode/arkode_arkstep_nls.c | 4 +- src/arkode/arkode_bandpre.c | 4 +- src/arkode/arkode_bbdpre.c | 4 +- src/arkode/arkode_butcher.c | 160 +++++++++--------- src/arkode/arkode_erkstep.c | 10 +- src/arkode/arkode_erkstep_impl.h | 2 +- src/arkode/arkode_erkstep_io.c | 2 +- src/arkode/arkode_impl.h | 68 ++++---- src/arkode/arkode_io.c | 4 +- src/arkode/arkode_ls.c | 30 ++-- src/arkode/arkode_ls_impl.h | 26 +-- src/arkode/arkode_mri_tables.c | 2 +- src/arkode/arkode_mristep.c | 14 +- src/arkode/arkode_mristep_impl.h | 22 +-- src/arkode/arkode_mristep_io.c | 4 +- src/arkode/arkode_mristep_nls.c | 4 +- src/arkode/arkode_root.c | 8 +- src/arkode/arkode_root_impl.h | 2 +- src/arkode/arkode_sprkstep.c | 4 +- src/arkode/arkode_sprkstep_impl.h | 2 +- src/cvode/cvode.c | 34 ++-- src/cvode/cvode_bandpre.c | 4 +- src/cvode/cvode_bbdpre.c | 4 +- src/cvode/cvode_diag.c | 8 +- src/cvode/cvode_fused_gpu.cpp | 4 +- src/cvode/cvode_fused_stubs.c | 4 +- src/cvode/cvode_hypamgpre.c | 4 +- src/cvode/cvode_impl.h | 36 ++-- src/cvode/cvode_io.c | 6 +- src/cvode/cvode_ls.c | 12 +- src/cvode/cvode_ls_impl.h | 16 +- src/cvode/cvode_nls.c | 4 +- src/cvode/cvode_proj.c | 2 +- src/cvode/cvode_proj_impl.h | 6 +- src/cvodes/cvodea.c | 26 +-- src/cvodes/cvodea_io.c | 4 +- src/cvodes/cvodes.c | 68 ++++---- src/cvodes/cvodes_bandpre.c | 4 +- src/cvodes/cvodes_bbdpre.c | 4 +- src/cvodes/cvodes_diag.c | 8 +- src/cvodes/cvodes_impl.h | 122 ++++++------- src/cvodes/cvodes_io.c | 14 +- src/cvodes/cvodes_ls.c | 40 ++--- src/cvodes/cvodes_ls_impl.h | 16 +- src/cvodes/cvodes_nls.c | 4 +- src/cvodes/cvodes_nls_sim.c | 4 +- src/cvodes/cvodes_nls_stg.c | 4 +- src/cvodes/cvodes_nls_stg1.c | 4 +- src/cvodes/cvodes_proj.c | 2 +- src/cvodes/cvodes_proj_impl.h | 6 +- src/ida/ida.c | 26 +-- src/ida/ida_ic.c | 4 +- src/ida/ida_impl.h | 30 ++-- src/ida/ida_io.c | 4 +- src/ida/ida_ls.c | 8 +- src/ida/ida_ls_impl.h | 10 +- src/ida/ida_nls.c | 4 +- src/idas/idaa.c | 34 ++-- src/idas/idaa_io.c | 2 +- src/idas/idas.c | 66 ++++---- src/idas/idas_ic.c | 16 +- src/idas/idas_impl.h | 116 ++++++------- src/idas/idas_io.c | 12 +- src/idas/idas_ls.c | 10 +- src/idas/idas_ls_impl.h | 10 +- src/idas/idas_nls.c | 4 +- src/idas/idas_nls_sim.c | 4 +- src/idas/idas_nls_stg.c | 4 +- src/kinsol/kinsol.c | 30 ++-- src/kinsol/kinsol_impl.h | 30 ++-- src/kinsol/kinsol_io.c | 8 +- src/kinsol/kinsol_ls.c | 6 +- src/kinsol/kinsol_ls_impl.h | 12 +- src/nvector/cuda/nvector_cuda.cu | 44 ++--- src/nvector/hip/nvector_hip.hip.cpp | 42 ++--- src/nvector/manyvector/nvector_manyvector.c | 38 ++--- src/nvector/openmp/nvector_openmp.c | 32 ++-- src/nvector/openmpdev/nvector_openmpdev.c | 30 ++-- src/nvector/parallel/nvector_parallel.c | 40 ++--- src/nvector/parhyp/nvector_parhyp.c | 38 ++--- src/nvector/petsc/nvector_petsc.c | 36 ++-- src/nvector/pthreads/nvector_pthreads.c | 30 ++-- src/nvector/raja/nvector_raja.cpp | 28 +-- src/nvector/serial/nvector_serial.c | 36 ++-- src/nvector/sycl/nvector_sycl.cpp | 34 ++-- src/nvector/trilinos/nvector_trilinos.cpp | 8 +- src/sundials/sundials_band.c | 2 +- src/sundials/sundials_context_impl.h | 4 +- src/sundials/sundials_cuda.h | 6 +- src/sundials/sundials_hip.h | 2 +- src/sundials/sundials_linearsolver.c | 2 +- src/sundials/sundials_math.c | 8 +- src/sundials/sundials_memory.c | 2 +- src/sundials/sundials_nonlinearsolver.c | 2 +- src/sundials/sundials_nvector.c | 24 +-- src/sundials/sundials_nvector_senswrapper.c | 8 +- .../magmadense/sunlinsol_magmadense.cpp | 2 +- src/sunlinsol/pcg/sunlinsol_pcg.c | 8 +- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 8 +- src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 8 +- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 8 +- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 8 +- src/sunmatrix/band/sunmatrix_band.c | 8 +- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 6 +- src/sunmatrix/dense/sunmatrix_dense.c | 8 +- .../magmadense/sunmatrix_magmadense.cpp | 8 +- .../onemkldense/sunmatrix_onemkldense.cpp | 12 +- src/sunmatrix/slunrloc/sunmatrix_slunrloc.c | 6 +- src/sunmatrix/sparse/sunmatrix_sparse.c | 12 +- .../fixedpoint/sunnonlinsol_fixedpoint.c | 4 +- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 4 +- .../petscsnes/sunnonlinsol_petscsnes.c | 2 +- swig/sundials/fsundials_types_mod.i | 2 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 10 +- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 2 +- 318 files changed, 1851 insertions(+), 1851 deletions(-) diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index d243f9e021..16fbd5f3d9 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -618,7 +618,7 @@ int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { /* local variables */ MPI_Comm comm; diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index d243f9e021..16fbd5f3d9 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -618,7 +618,7 @@ int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { /* local variables */ MPI_Comm comm; diff --git a/benchmarks/diffusion_2D/diffusion_2D.hpp b/benchmarks/diffusion_2D/diffusion_2D.hpp index e054d359f8..ad081ca0cd 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.hpp +++ b/benchmarks/diffusion_2D/diffusion_2D.hpp @@ -228,8 +228,8 @@ int diffusion_jac(sunrealtype t, N_Vector u, N_Vector f, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Preconditioner setup and solve functions -int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, diff --git a/benchmarks/diffusion_2D/preconditioner_jacobi.cpp b/benchmarks/diffusion_2D/preconditioner_jacobi.cpp index f919bcd569..5ef49ee461 100644 --- a/benchmarks/diffusion_2D/preconditioner_jacobi.cpp +++ b/benchmarks/diffusion_2D/preconditioner_jacobi.cpp @@ -19,8 +19,8 @@ #if defined(BENCHMARK_ODE) // Preconditioner setup routine -int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Access problem data UserData *udata = (UserData *) user_data; diff --git a/doc/arkode/guide/source/ARKodeButcherTable.rst b/doc/arkode/guide/source/ARKodeButcherTable.rst index 7bed94ec83..b05bca6225 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -170,7 +170,7 @@ ARKodeButcherTable functions This function is case sensitive. -.. c:function:: ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, booleantype embedded) +.. c:function:: ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded) Allocates an empty Butcher table. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst index a6be7d8b6f..9c42fa3845 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst @@ -546,7 +546,7 @@ Newton and mass matrix systems, these must have the same type: Newton systems. -.. c:function:: int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, booleantype time_dep) +.. c:function:: int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, sunbooleantype time_dep) This function specifies the ``SUNLinearSolver`` object that ARKStep should use for mass matrix systems, as well as a @@ -1268,7 +1268,7 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst :c:func:`ARKStepClearStopTime`. -.. c:function:: int ARKStepSetInterpolateStopTime(void* arkode_mem, booleantype interp) +.. c:function:: int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) Specifies that the output solution should be interpolated when the current :math:`t` equals the specified ``tstop`` (instead of merely copying the @@ -2602,7 +2602,7 @@ data in the program. The user data pointer may be specified through :numref:`ARKODE.Usage.UserSupplied`. -.. c:function:: int ARKStepSetLinearSolutionScaling(void* arkode_mem, booleantype onoff) +.. c:function:: int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) Enables or disables scaling the linear system solution to account for a change in :math:`\gamma` in the linear system. For more details see diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst index 9e8d0389f7..2b764c8b56 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst @@ -888,7 +888,7 @@ Optional inputs for ERKStep :c:func:`ERKStepClearStopTime`. -.. c:function:: int ERKStepSetInterpolateStopTime(void* arkode_mem, booleantype interp) +.. c:function:: int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) Specifies that the output solution should be interpolated when the current :math:`t` equals the specified ``tstop`` (instead of merely copying the diff --git a/doc/arkode/guide/source/Usage/General.rst b/doc/arkode/guide/source/Usage/General.rst index 89806f267b..5d6a421db8 100644 --- a/doc/arkode/guide/source/Usage/General.rst +++ b/doc/arkode/guide/source/Usage/General.rst @@ -66,7 +66,7 @@ function prototypes, and include the shared ``arkode/arkode.h`` and ``arkode/arkode_ls.h`` header files. Note that ``arkode.h`` includes ``sundials_types.h`` directly, which -defines the types ``sunrealtype``, ``sunindextype``, and ``booleantype`` +defines the types ``sunrealtype``, ``sunindextype``, and ``sunbooleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``, so a user program does not need to include ``sundials_types.h`` directly. diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst index 42b9caf359..52738f4671 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst @@ -1107,7 +1107,7 @@ Optional inputs for MRIStep :c:func:`MRIStepClearStopTime`. -.. c:function:: int MRIStepSetInterpolateStopTime(void* arkode_mem, booleantype interp) +.. c:function:: int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) Specifies that the output solution should be interpolated when the current :math:`t` equals the specified ``tstop`` (instead of merely copying the @@ -1805,7 +1805,7 @@ program. The user data pointer may be specified through :numref:`ARKODE.Usage.UserSupplied`. -.. c:function:: int MRIStepSetLinearSolutionScaling(void* arkode_mem, booleantype onoff) +.. c:function:: int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) Enables or disables scaling the linear system solution to account for a change in :math:`\gamma` in the linear system. For more details see diff --git a/doc/arkode/guide/source/Usage/User_supplied.rst b/doc/arkode/guide/source/Usage/User_supplied.rst index 0dc116f2a2..3dacbd8a88 100644 --- a/doc/arkode/guide/source/Usage/User_supplied.rst +++ b/doc/arkode/guide/source/Usage/User_supplied.rst @@ -513,7 +513,7 @@ object was supplied to :c:func:`ARKStepSetLinearSolver` or -.. c:type:: int (*ARKLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +.. c:type:: int (*ARKLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the linear system matrix :math:`\mathcal{A}(t,y) = M(t) - \gamma J(t,y)` (or an approximation to it). @@ -721,7 +721,7 @@ preprocessed or evaluated, then these actions need to occur within a user-supplied function of type :c:type:`ARKLsPrecSetupFn`. -.. c:type:: int (*ARKLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype* jcurPtr, sunrealtype gamma, void* user_data) +.. c:type:: int (*ARKLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, sunbooleantype* jcurPtr, sunrealtype gamma, void* user_data) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 4c144809d4..2ea0337a4b 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -101,7 +101,7 @@ required is: * ``cvode/cvode.h`` the main header file for CVODE, which defines the several types and various constants, and includes function prototypes. This includes the header file for CVLS, ``cvode/cvode_ls.h``. -Note that ``cvode.h`` includes ``sundials_types.h``, which defines the types, ``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. +Note that ``cvode.h`` includes ``sundials_types.h``, which defines the types, ``sunrealtype``, ``sunindextype``, and ``sunbooleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation header file, of the form ``nvector/nvector_*.h``. See :numref:`NVectors` for the appropriate name. This file in turn includes the header file ``sundials_nvector.h`` which defines the abstract data type. @@ -1010,7 +1010,7 @@ Main solver optional input functions **Notes:** The default value is 10. A negative value for ``mxhnil`` indicates that no warning messages should be issued. -.. c:function:: int CVodeSetStabLimDet(void* cvode_mem, booleantype stldet) +.. c:function:: int CVodeSetStabLimDet(void* cvode_mem, sunbooleantype stldet) The function ``CVodeSetStabLimDet`` indicates if the BDF stability limit detection algorithm should be used. See :numref:`CVODE.Mathematics.stablimit` for further details. @@ -1094,7 +1094,7 @@ Main solver optional input functions A stop time not reached before a call to :c:func:`CVodeReInit` will remain active but can be disabled by calling :c:func:`CVodeClearStopTime`. -.. c:function:: int CVodeSetInterpolateStopTime(void* cvode_mem, booleantype interp) +.. c:function:: int CVodeSetInterpolateStopTime(void* cvode_mem, sunbooleantype interp) The function ``CVodeSetInterpolateStopTime`` specifies that the output solution should be interpolated when the current :math:`t` equals the specified ``tstop`` (instead of @@ -1164,7 +1164,7 @@ Main solver optional input functions **Notes:** The presence of a non-``NULL`` constraints vector that is not 0.0 in all components will cause constraint checking to be performed. However, a call with 0.0 in all components of ``constraints`` will result in an illegal input return. A ``NULL`` constraints vector will disable constraint checking. -.. c:function:: int CVodeSetUseIntegratorFusedKernels(void* cvode_mem, booleantype onoff) +.. c:function:: int CVodeSetUseIntegratorFusedKernels(void* cvode_mem, sunbooleantype onoff) The function ``CVodeSetUseIntegratorFusedKernels`` informs CVODE that it should use specialized fused kernels internally, if available. The specialized kernels may offer performance improvements for small problem sizes. Users should beware that these kernels can cause changes in the behavior of the integrator. By default, these kernels are not used. Must be called after :c:func:`CVodeInit`. @@ -1452,7 +1452,7 @@ system to account for the lagged value of :math:`\gamma`. See necessary, e.g., when providing a custom linear solver that updates the matrix using the current :math:`\gamma` as part of the solve. -.. c:function:: int CVodeSetLinearSolutionScaling(void* cvode_mem, booleantype onoff) +.. c:function:: int CVodeSetLinearSolutionScaling(void* cvode_mem, sunbooleantype onoff) The function :c:func:`CVodeSetLinearSolutionScaling` enables or disables scaling the linear system solution to account for a change in :math:`\gamma` in the linear system. For more details see :numref:`SUNLinSol.CVODE.lagged`. @@ -2127,7 +2127,7 @@ Projection optional input functions The following functions can be called to set optional inputs to control the projection when solving an IVP with constraints. -.. c:function:: int CVodeSetProjErrEst(void* cvode_mem, booleantype onoff) +.. c:function:: int CVodeSetProjErrEst(void* cvode_mem, sunbooleantype onoff) The function ``CVodeSetProjErrEst`` enables or disables projection of the error estimate by the projection function. @@ -3637,7 +3637,7 @@ side function, the user may optionally supply a function of type ``CVLsLinSysFn` for evaluating the linear system, :math:`M = I - \gamma J` (or an approximation of it). ``CVLsLinSysFn`` is defined as follows: -.. c:type:: int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix M, booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +.. c:type:: int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix M, sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); This function computes the linear system matrix :math:`M = I - \gamma J` (or an approximation to it). @@ -3798,7 +3798,7 @@ If the user’s preconditioner requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type , defined as follows: -.. c:type:: int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, sunrealtype gamma, void *user_data); +.. c:type:: int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index f9fdf9956f..ca236e5767 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -971,7 +971,7 @@ sensitivities. The function :c:func:`CVodeSetLinearSolutionScalingB` can be used to enable or disable solution scaling when using a matrix-based linear solver. -.. c:function:: int CVodeSetLinearSolutionScalingB(void * cvode_mem, int which, booleantype onoffB) +.. c:function:: int CVodeSetLinearSolutionScalingB(void * cvode_mem, int which, sunbooleantype onoffB) The function :c:func:`CVodeSetLinearSolutionScalingB` enables or disables scaling the linear system solution to account for a change in :math:`\gamma` @@ -1746,7 +1746,7 @@ function, the user may optionally supply a function of type :c:type:`CVLsLinSysF :c:type:`CVLsLinSysFnBS` for evaluating the linear system, :math:`M_B = I - \gamma_B J_B` (or an approximation of it) for the backward problem. -.. c:type:: int (*CVLsLinSysFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); +.. c:type:: int (*CVLsLinSysFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix AB, sunbooleantype jokB, sunbooleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); This function computes the linear system of the backward problem (or an approximation to it). @@ -1787,7 +1787,7 @@ J_B` (or an approximation of it) for the backward problem. ``CVLS_JACFUNC_UNRECVR``). -.. c:type:: int (*CVLsLinSysFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, N_Vector yB, N_Vector fyB, SUNMatrix AB, booleantype jokB, booleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); +.. c:type:: int (*CVLsLinSysFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, N_Vector yB, N_Vector fyB, SUNMatrix AB, sunbooleantype jokB, sunbooleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); This function computes the linear system of the backward problem (or an approximation to it), in the case where the backward problem depends on the @@ -2074,7 +2074,7 @@ If the user’s preconditioner requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of one of the following two types: -.. c:type:: int (*CVLsPrecSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB) +.. c:type:: int (*CVLsPrecSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, sunbooleantype jokB, sunbooleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner for the backward problem. @@ -2103,7 +2103,7 @@ function of one of the following two types: name soon. -.. c:type:: int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, booleantype jokB, booleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB) +.. c:type:: int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, sunbooleantype jokB, sunbooleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB) This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner for the backward problem, in the case where the backward diff --git a/doc/cvodes/guide/source/Usage/FSA.rst b/doc/cvodes/guide/source/Usage/FSA.rst index 3cb13575eb..02c502fe44 100644 --- a/doc/cvodes/guide/source/Usage/FSA.rst +++ b/doc/cvodes/guide/source/Usage/FSA.rst @@ -805,7 +805,7 @@ time and, if successful, takes effect immediately. ``DQrhomax=0.0``. -.. c:function:: int CVodeSetSensErrCon(void * cvode_mem, booleantype errconS) +.. c:function:: int CVodeSetSensErrCon(void * cvode_mem, sunbooleantype errconS) The function :c:func:`CVodeSetSensErrCon` specifies the error control strategy for sensitivity variables. @@ -1573,7 +1573,7 @@ CVODES provides the following optional input functions to control the integration of sensitivity-dependent quadrature equations. -.. c:function:: int CVodeSetQuadSensErrCon(void * cvode_mem, booleantype errconQS) +.. c:function:: int CVodeSetQuadSensErrCon(void * cvode_mem, sunbooleantype errconQS) The function :c:func:`CVodeSetQuadSensErrCon` specifies whether or not the quadrature variables are to be used in the step size control mechanism. If diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index 4070475138..2a14eb3635 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -109,7 +109,7 @@ required is: * ``cvodes/cvodes.h`` the main header file for CVODES, which defines the several types and various constants, and includes function prototypes. This includes the header file for CVLS, ``cvodes/cvodes_ls.h``. -Note that ``cvodes.h`` includes ``sundials_types.h``, which defines the types, ``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. +Note that ``cvodes.h`` includes ``sundials_types.h``, which defines the types, ``sunrealtype``, ``sunindextype``, and ``sunbooleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation header file, of the form ``nvector/nvector_*.h``. See :numref:`NVectors` for the appropriate name. This file in turn includes the header file ``sundials_nvector.h`` which defines the abstract data type. @@ -1014,7 +1014,7 @@ Main solver optional input functions **Notes:** The default value is 10. A negative value for ``mxhnil`` indicates that no warning messages should be issued. -.. c:function:: int CVodeSetStabLimDet(void* cvode_mem, booleantype stldet) +.. c:function:: int CVodeSetStabLimDet(void* cvode_mem, sunbooleantype stldet) The function ``CVodeSetStabLimDet`` indicates if the BDF stability limit detection algorithm should be used. See :numref:`CVODES.Mathematics.stablimit` for further details. @@ -1098,7 +1098,7 @@ Main solver optional input functions A stop time not reached before a call to :c:func:`CVodeReInit` will remain active but can be disabled by calling :c:func:`CVodeClearStopTime`. -.. c:function:: int CVodeSetInterpolateStopTime(void* cvode_mem, booleantype interp) +.. c:function:: int CVodeSetInterpolateStopTime(void* cvode_mem, sunbooleantype interp) The function ``CVodeSetInterpolateStopTime`` specifies that the output solution should be interpolated when the current :math:`t` equals the specified ``tstop`` (instead of @@ -1448,7 +1448,7 @@ system to account for the lagged value of :math:`\gamma`. See necessary, e.g., when providing a custom linear solver that updates the matrix using the current :math:`\gamma` as part of the solve. -.. c:function:: int CVodeSetLinearSolutionScaling(void* cvode_mem, booleantype onoff) +.. c:function:: int CVodeSetLinearSolutionScaling(void* cvode_mem, sunbooleantype onoff) The function :c:func:`CVodeSetLinearSolutionScaling` enables or disables scaling the linear system solution to account for a change in :math:`\gamma` in the linear system. For more details see :numref:`SUNLinSol.CVODES.lagged`. @@ -2123,7 +2123,7 @@ Projection optional input functions The following functions can be called to set optional inputs to control the projection when solving an IVP with constraints. -.. c:function:: int CVodeSetProjErrEst(void* cvode_mem, booleantype onoff) +.. c:function:: int CVodeSetProjErrEst(void* cvode_mem, sunbooleantype onoff) The function ``CVodeSetProjErrEst`` enables or disables projection of the error estimate by the projection function. @@ -3639,7 +3639,7 @@ side function, the user may optionally supply a function of type ``CVLsLinSysFn` for evaluating the linear system, :math:`M = I - \gamma J` (or an approximation of it). ``CVLsLinSysFn`` is defined as follows: -.. c:type:: int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix M, booleantype jok, booleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +.. c:type:: int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix M, sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); This function computes the linear system matrix :math:`M = I - \gamma J` (or an approximation to it). @@ -3800,7 +3800,7 @@ If the user’s preconditioner requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type , defined as follows: -.. c:type:: int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, booleantype *jcurPtr, sunrealtype gamma, void *user_data); +.. c:type:: int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. @@ -4097,7 +4097,7 @@ CVODES provides the following optional input functions to control the integratio of quadrature equations. -.. c:function:: int CVodeSetQuadErrCon(void * cvode_mem, booleantype errconQ) +.. c:function:: int CVodeSetQuadErrCon(void * cvode_mem, sunbooleantype errconQ) The function ``CVodeSetQuadErrCon`` specifies whether or not the quadrature variables are to be used in the step size control mechanism within CVODES. If they are, the user must call :c:func:`CVodeQuadSStolerances` or :c:func:`CVodeQuadSVtolerances` to specify the integration tolerances for the quadrature variables. diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 41059b5b38..2b38d456ab 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -97,7 +97,7 @@ data types can be used. The header file that is always required is: header file for IDALS, ``ida/ida_ls.h``. Note that ``ida.h`` includes ``sundials_types.h``, which defines the types, -``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants +``sunrealtype``, ``sunindextype``, and ``sunbooleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation @@ -1191,7 +1191,7 @@ Main solver optional input functions **Notes:** The default value is 10. -.. c:function:: int IDASetSuppressAlg(void * ida_mem, booleantype suppressalg) +.. c:function:: int IDASetSuppressAlg(void * ida_mem, sunbooleantype suppressalg) The function ``IDASetSuppressAlg`` indicates whether or not to suppress algebraic variables in the local error test. @@ -1377,7 +1377,7 @@ that updates the matrix using the current :math:`\alpha` as part of the solve. .. versionadded:: 6.2.0 -.. c:function:: int IDASetLinearSolutionScaling(void * ida_mem, booleantype onoff) +.. c:function:: int IDASetLinearSolutionScaling(void * ida_mem, sunbooleantype onoff) The function ``IDASetLinearSolutionScaling`` enables or disables scaling the linear system solution to account for a change in :math:`\alpha` in the @@ -1883,7 +1883,7 @@ to set optional inputs controlling the initial condition calculation. **Notes:** The default value is :math:`100`. -.. c:function:: int IDASetLineSearchOffIC(void * ida_mem, booleantype lsoff) +.. c:function:: int IDASetLineSearchOffIC(void * ida_mem, sunbooleantype lsoff) The function ``IDASetLineSearchOffIC`` specifies whether to turn on or off the linesearch algorithm. diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index ef875a5aa3..07adee3c6f 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -1022,7 +1022,7 @@ backward problem depends on the forward sensitivities. The function :c:func:`IDASetLinearSolutionScalingB` can be used to enable or disable solution scaling when using a matrix-based linear solver. -.. c:function:: int IDASetLinearSolutionScalingB(void * ida_mem, int which, booleantype onoffB) +.. c:function:: int IDASetLinearSolutionScalingB(void * ida_mem, int which, sunbooleantype onoffB) The function :c:func:`IDASetLinearSolutionScalingB` enables or disables scaling the linear system solution to account for a change in :math:`\alpha` diff --git a/doc/idas/guide/source/Usage/FSA.rst b/doc/idas/guide/source/Usage/FSA.rst index 1dd9e33d54..239760d5cb 100644 --- a/doc/idas/guide/source/Usage/FSA.rst +++ b/doc/idas/guide/source/Usage/FSA.rst @@ -760,7 +760,7 @@ time and, if successful, takes effect immediately. ``DQrhomax``:math:`=0.0`. -.. c:function:: int IDASetSensErrCon(void * ida_mem, booleantype errconS) +.. c:function:: int IDASetSensErrCon(void * ida_mem, sunbooleantype errconS) The function :c:func:`IDASetSensErrCon` specifies the error control strategy for sensitivity variables. @@ -1417,7 +1417,7 @@ Optional inputs for sensitivity-dependent quadrature integration IDAS provides the following optional input functions to control the integration of sensitivity-dependent quadrature equations. -.. c:function:: int IDASetQuadSensErrCon(void * ida_mem, booleantype errconQS) +.. c:function:: int IDASetQuadSensErrCon(void * ida_mem, sunbooleantype errconQS) The function :c:func:`IDASetQuadSensErrCon` specifies whether or not the quadrature variables are to be used in the local error control mechanism. If they are, the user must specify the error tolerances for the quadrature variables by calling :c:func:`IDAQuadSensSStolerances`, :c:func:`IDAQuadSensSVtolerances`, or :c:func:`IDAQuadSensEEtolerances`. diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index 8f5be59771..97639f76b3 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -101,7 +101,7 @@ data types can be used. The header file that is always required is: header file for IDALS, ``idas/idas_ls.h``. Note that ``idas.h`` includes ``sundials_types.h``, which defines the types, -``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants +``sunrealtype``, ``sunindextype``, and ``sunbooleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation @@ -1201,7 +1201,7 @@ Main solver optional input functions **Notes:** The default value is 10. -.. c:function:: int IDASetSuppressAlg(void * ida_mem, booleantype suppressalg) +.. c:function:: int IDASetSuppressAlg(void * ida_mem, sunbooleantype suppressalg) The function :c:func:`IDASetSuppressAlg` indicates whether or not to suppress algebraic variables in the local error test. @@ -1394,7 +1394,7 @@ that updates the matrix using the current :math:`\alpha` as part of the solve. .. versionadded:: 5.2.0 -.. c:function:: int IDASetLinearSolutionScaling(void * ida_mem, booleantype onoff) +.. c:function:: int IDASetLinearSolutionScaling(void * ida_mem, sunbooleantype onoff) The function :c:func:`IDASetLinearSolutionScaling` enables or disables scaling the linear system solution to account for a change in :math:`\alpha` in the @@ -1909,7 +1909,7 @@ to set optional inputs controlling the initial condition calculation. values and the initial sensititivies. -.. c:function:: int IDASetLineSearchOffIC(void * ida_mem, booleantype lsoff) +.. c:function:: int IDASetLineSearchOffIC(void * ida_mem, sunbooleantype lsoff) The function :c:func:`IDASetLineSearchOffIC` specifies whether to turn on or off the linesearch algorithm. @@ -4024,7 +4024,7 @@ Optional inputs for quadrature integration IDAS provides the following optional input functions to control the integration of quadrature equations. -.. c:function:: int IDASetQuadErrCon(void * ida_mem, booleantype errconQ) +.. c:function:: int IDASetQuadErrCon(void * ida_mem, sunbooleantype errconQ) The function :c:func:`IDASetQuadErrCon` specifies whether or not the quadrature variables are to be used in the step size control mechanism diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index 0c672188c3..9893db8f47 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -98,7 +98,7 @@ data types can be used. The header file that is always required is: header file for KINLS, ``kinsol/kinsol_ls.h``. Note that ``kinsol.h`` includes ``sundials_types.h``, which defines the types, -``sunrealtype``, ``sunindextype``, and ``booleantype`` and the constants +``sunrealtype``, ``sunindextype``, and ``sunbooleantype`` and the constants ``SUNFALSE`` and ``SUNTRUE``. The calling program must also include an ``N_Vector`` implementation @@ -720,7 +720,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. The default value for ``mxiter`` is ``MXITER_DEFAULT`` :math:`=200`. -.. c:function:: int KINSetNoInitSetup(void * kin_mem, booleantype noInitSetup) +.. c:function:: int KINSetNoInitSetup(void * kin_mem, sunbooleantype noInitSetup) The function :c:func:`KINSetNoInitSetup` specifies whether an initial call to the preconditioner or Jacobian setup function should be made or not. @@ -743,7 +743,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. problem is to be used initially for the next problem. -.. c:function:: int KINSetNoResMon(void * kin_mem, booleantype noNNIResMon) +.. c:function:: int KINSetNoResMon(void * kin_mem, sunbooleantype noNNIResMon) The function :c:func:`KINSetNoResMon` specifies whether or not the nonlinear residual monitoring scheme is used to control Jacobian updating @@ -945,7 +945,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. solver modules. -.. c:function:: int KINSetNoMinEps(void * kin_mem, booleantype noMinEps) +.. c:function:: int KINSetNoMinEps(void * kin_mem, sunbooleantype noMinEps) The function :c:func:`KINSetNoMinEps` specifies a flag that controls whether or not the value of :math:`\epsilon`, the scaled linear residual tolerance, @@ -1116,7 +1116,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. different functions. -.. c:function:: int KINSetReturnNewest(void * kin_mem, booleantype ret_newest) +.. c:function:: int KINSetReturnNewest(void * kin_mem, sunbooleantype ret_newest) The function :c:func:`KINSetReturnNewest` specifies if the fixed point iteration should return the newest iteration or the iteration consistent @@ -2164,7 +2164,7 @@ provide a function of type :c:type:`KINLsJacTimesVecFn` in the following form, to compute matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. -.. c:type:: int (*KINLsJacTimesVecFn)(N_Vector v, N_Vector Jv, N_Vector u, booleantype* new_u, void* user_data) +.. c:type:: int (*KINLsJacTimesVecFn)(N_Vector v, N_Vector Jv, N_Vector u, sunbooleantype* new_u, void* user_data) This function computes the product :math:`J v` (or an approximation to it). diff --git a/doc/shared/Types.rst b/doc/shared/Types.rst index 280a113c54..59c24d4931 100644 --- a/doc/shared/Types.rst +++ b/doc/shared/Types.rst @@ -21,7 +21,7 @@ The header file ``sundials_types.h`` contains the definition of the types: * :c:type:`sunindextype` -- the integer type used for vector and matrix indices -* :c:type:`booleantype` -- the type used for logic operations within SUNDIALS +* :c:type:`sunbooleantype` -- the type used for logic operations within SUNDIALS * :c:type:`SUNOutputFormat` -- an enumerated type for SUNDIALS output formats @@ -110,14 +110,14 @@ SUNDIALS libraries use the appropriate index storage type (for details see Boolean type ~~~~~~~~~~~~ -.. c:type:: booleantype +.. c:type:: sunbooleantype As ANSI C89 (ISO C90) does not have a built-in boolean data type, SUNDIALS - defines the type ``booleantype`` as an ``int``. + defines the type ``sunbooleantype`` as an ``int``. -The advantage of using the name booleantype (instead of int) is an increase in +The advantage of using the name sunbooleantype (instead of int) is an increase in code readability. It also allows the programmer to make a distinction between -int and boolean data. Variables of type ``booleantype`` are intended to have +int and boolean data. Variables of type ``sunbooleantype`` are intended to have only the two values ``SUNFALSE`` (``0``) and ``SUNTRUE`` (``1``). Output formatting type diff --git a/doc/shared/nvectors/NVector_CUDA.rst b/doc/shared/nvectors/NVector_CUDA.rst index 454f197575..d9d4d656d1 100644 --- a/doc/shared/nvectors/NVector_CUDA.rst +++ b/doc/shared/nvectors/NVector_CUDA.rst @@ -28,7 +28,7 @@ is as follows: struct _N_VectorContent_Cuda { sunindextype length; - booleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNCudaExecPolicy* stream_exec_policy; @@ -82,7 +82,7 @@ accessor functions: This function returns pointer to the vector data on the device. -.. c:function:: booleantype N_VIsManagedMemory_Cuda(N_Vector v) +.. c:function:: sunbooleantype N_VIsManagedMemory_Cuda(N_Vector v) This function returns a boolean flag indiciating if the vector data array is in managed memory or not. @@ -119,7 +119,7 @@ following additional user-callable routines: ``N_Vector``. The vector data array is allocated in managed memory. -.. c:function:: N_Vector N_VNewWithMemHelp_Cuda(sunindextype length, booleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) +.. c:function:: N_Vector N_VNewWithMemHelp_Cuda(sunindextype length, sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) This function creates a new CUDA ``N_Vector`` with a user-supplied SUNMemoryHelper for allocating/freeing memory. @@ -211,71 +211,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with :c:func:`N_VNew_Cuda` will have the default settings for the NVECTOR_CUDA module. -.. c:function:: int N_VEnableFusedOps_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the CUDA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_Cuda(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_Cuda(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the CUDA vector. The return value diff --git a/doc/shared/nvectors/NVector_Description.rst b/doc/shared/nvectors/NVector_Description.rst index 96218bc84b..67a0435065 100644 --- a/doc/shared/nvectors/NVector_Description.rst +++ b/doc/shared/nvectors/NVector_Description.rst @@ -76,8 +76,8 @@ defined as sunrealtype (*nvwl2norm)(N_Vector, N_Vector); sunrealtype (*nvl1norm)(N_Vector); void (*nvcompare)(sunrealtype, N_Vector, N_Vector); - booleantype (*nvinvtest)(N_Vector, N_Vector); - booleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector); + sunbooleantype (*nvinvtest)(N_Vector, N_Vector); + sunbooleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector); sunrealtype (*nvminquotient)(N_Vector, N_Vector); int (*nvlinearcombination)(int, sunrealtype *, N_Vector *, N_Vector); int (*nvscaleaddmulti)(int, sunrealtype *, N_Vector, N_Vector *, N_Vector *); @@ -97,8 +97,8 @@ defined as sunrealtype (*nvmaxnormlocal)(N_Vector); sunrealtype (*nvminlocal)(N_Vector); sunrealtype (*nvl1normlocal)(N_Vector); - booleantype (*nvinvtestlocal)(N_Vector, N_Vector); - booleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector); + sunbooleantype (*nvinvtestlocal)(N_Vector, N_Vector); + sunbooleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector); sunrealtype (*nvminquotientlocal)(N_Vector, N_Vector); sunrealtype (*nvwsqrsumlocal)(N_Vector, N_Vector); sunrealtype (*nvwsqrsummasklocal(N_Vector, N_Vector, N_Vector); diff --git a/doc/shared/nvectors/NVector_HIP.rst b/doc/shared/nvectors/NVector_HIP.rst index 8d63b61988..dc33e930cc 100644 --- a/doc/shared/nvectors/NVector_HIP.rst +++ b/doc/shared/nvectors/NVector_HIP.rst @@ -28,7 +28,7 @@ the HIP-clang compiler. The vector content layout is as follows: struct _N_VectorContent_Hip { sunindextype length; - booleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNHipExecPolicy* stream_exec_policy; @@ -79,7 +79,7 @@ accessor functions: This function returns pointer to the vector data on the device. -.. c:function:: booleantype N_VIsManagedMemory_Hip(N_Vector v) +.. c:function:: sunbooleantype N_VIsManagedMemory_Hip(N_Vector v) This function returns a boolean flag indiciating if the vector data array is in managed memory or not. @@ -109,7 +109,7 @@ following additional user-callable routines: ``N_Vector``. The vector data array is allocated in managed memory. -.. c:function:: N_Vector N_VNewWithMemHelp_Hip(sunindextype length, booleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) +.. c:function:: N_Vector N_VNewWithMemHelp_Hip(sunindextype length, sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) This function creates a new HIP ``N_Vector`` with a user-supplied SUNMemoryHelper for allocating/freeing memory. @@ -194,71 +194,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with :c:func:`N_VNew_Hip` will have the default settings for the NVECTOR_HIP module. -.. c:function:: int N_VEnableFusedOps_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the HIP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_Hip(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_Hip(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the HIP vector. The return value diff --git a/doc/shared/nvectors/NVector_MPIManyVector.rst b/doc/shared/nvectors/NVector_MPIManyVector.rst index b322703dd1..adcd362ff4 100644 --- a/doc/shared/nvectors/NVector_MPIManyVector.rst +++ b/doc/shared/nvectors/NVector_MPIManyVector.rst @@ -99,7 +99,7 @@ the beginning of the array of subvectors, and a boolean flag sunindextype num_subvectors; /* number of vectors attached */ sunindextype global_length; /* overall mpimanyvector length */ N_Vector* subvec_array; /* pointer to N_Vector array */ - booleantype own_data; /* flag indicating data ownership */ + sunbooleantype own_data; /* flag indicating data ownership */ }; The header file to include when using this module is @@ -254,57 +254,57 @@ subvectors, so those should be set up as desired *before* attaching them to the MPIManyVector in :c:func:`N_VNew_MPIManyVector` or :c:func:`N_VMake_MPIManyVector`. -.. c:function:: int N_VEnableFusedOps_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the MPIManyVector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_MPIManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the MPIManyVector vector. The return value is diff --git a/doc/shared/nvectors/NVector_ManyVector.rst b/doc/shared/nvectors/NVector_ManyVector.rst index 9af406774e..02dec8d5bd 100644 --- a/doc/shared/nvectors/NVector_ManyVector.rst +++ b/doc/shared/nvectors/NVector_ManyVector.rst @@ -82,7 +82,7 @@ the beginning of the array of subvectors, and a boolean flag sunindextype num_subvectors; /* number of vectors attached */ sunindextype global_length; /* overall manyvector length */ N_Vector* subvec_array; /* pointer to N_Vector array */ - booleantype own_data; /* flag indicating data ownership */ + sunbooleantype own_data; /* flag indicating data ownership */ }; The header file to include when using this module is @@ -193,57 +193,57 @@ that these routines *do not* call the corresponding routines on subvectors, so those should be set up as desired *before* attaching them to the ManyVector in :c:func:`N_VNew_ManyVector`. -.. c:function:: int N_VEnableFusedOps_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the manyvector vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_ManyVector(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_ManyVector(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the manyvector vector. The return value is diff --git a/doc/shared/nvectors/NVector_OpenMP.rst b/doc/shared/nvectors/NVector_OpenMP.rst index a6a954b554..6d13171c77 100644 --- a/doc/shared/nvectors/NVector_OpenMP.rst +++ b/doc/shared/nvectors/NVector_OpenMP.rst @@ -37,7 +37,7 @@ supplied argument in the vector constructor. struct _N_VectorContent_OpenMP { sunindextype length; - booleantype own_data; + sunbooleantype own_data; sunrealtype *data; int num_threads; }; @@ -209,71 +209,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with :c:func:`N_VNew_OpenMP` will have the default settings for the NVECTOR_OPENMP module. -.. c:function:: int N_VEnableFusedOps_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the OpenMP vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the OpenMP vector. The return value diff --git a/doc/shared/nvectors/NVector_OpenMPDEV.rst b/doc/shared/nvectors/NVector_OpenMPDEV.rst index 1ff136cec2..81e2416034 100644 --- a/doc/shared/nvectors/NVector_OpenMPDEV.rst +++ b/doc/shared/nvectors/NVector_OpenMPDEV.rst @@ -32,7 +32,7 @@ the ownership of host and device data arrays. struct _N_VectorContent_OpenMPDEV { sunindextype length; - booleantype own_data; + sunbooleantype own_data; sunrealtype *host_data; sunrealtype *dev_data; }; @@ -193,21 +193,21 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with ``N_VNew_OpenMPDEV`` will have the default settings for the NVECTOR_OPENMPDEV module. -.. c:function:: int N_VEnableFusedOps_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the NVECTOR_OPENMPDEV vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the NVECTOR_OPENMPDEV vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the NVECTOR_OPENMPDEV vector. The @@ -215,7 +215,7 @@ options as the vector they are cloned from while vectors created with ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the NVECTOR_OPENMPDEV vector. The return value is ``0`` @@ -223,35 +223,35 @@ options as the vector they are cloned from while vectors created with ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the NVECTOR_OPENMPDEV vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the NVECTOR_OPENMPDEV vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the NVECTOR_OPENMPDEV vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the NVECTOR_OPENMPDEV vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the NVECTOR_OPENMPDEV vector. The return value is @@ -259,7 +259,7 @@ options as the vector they are cloned from while vectors created with ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the NVECTOR_OPENMPDEV vector. The @@ -267,7 +267,7 @@ options as the vector they are cloned from while vectors created with ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the NVECTOR_OPENMPDEV vector. The return value diff --git a/doc/shared/nvectors/NVector_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index 352a0da101..eb5c287131 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -440,7 +440,7 @@ operations below. N_VCompare(c, x, z); -.. c:function:: booleantype N_VInvTest(N_Vector x, N_Vector z) +.. c:function:: sunbooleantype N_VInvTest(N_Vector x, N_Vector z) Sets the components of the ``N_Vector`` *z* to be the inverses of the components of the ``N_Vector`` *x*, with prior testing for @@ -459,7 +459,7 @@ operations below. t = N_VInvTest(x, z); -.. c:function:: booleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m) +.. c:function:: sunbooleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m) Performs the following constraint tests based on the values in :math:`c_i`: @@ -872,7 +872,7 @@ operations below. s = N_VWSqrSumMaskLocal(x, w, id); -.. c:function:: booleantype N_VInvTestLocal(N_Vector x) +.. c:function:: sunbooleantype N_VInvTestLocal(N_Vector x) This routine sets the MPI task-local components of the NVECTOR *z* to be the inverses of the components of the NVECTOR @@ -894,7 +894,7 @@ operations below. t = N_VInvTestLocal(x); -.. c:function:: booleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m) +.. c:function:: sunbooleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m) Performs the following constraint tests based on the values in :math:`c_i`: diff --git a/doc/shared/nvectors/NVector_PETSc.rst b/doc/shared/nvectors/NVector_PETSc.rst index 6c8549f46c..e7b05a4633 100644 --- a/doc/shared/nvectors/NVector_PETSc.rst +++ b/doc/shared/nvectors/NVector_PETSc.rst @@ -28,7 +28,7 @@ indicating ownership of the wrapped PETSc vector. struct _N_VectorContent_Petsc { sunindextype local_length; sunindextype global_length; - booleantype own_data; + sunbooleantype own_data; Vec *pvec; MPI_Comm comm; }; @@ -101,71 +101,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with :c:func:`N_VMake_Petsc` will have the default settings for the NVECTOR_PETSC module. -.. c:function:: int N_VEnableFusedOps_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the PETSc vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the PETSc vector. The return value diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index 600e37537b..9ff87b9f2d 100644 --- a/doc/shared/nvectors/NVector_ParHyp.rst +++ b/doc/shared/nvectors/NVector_ParHyp.rst @@ -33,8 +33,8 @@ HYPRE parallel vector object *x*. struct _N_VectorContent_ParHyp { sunindextype local_length; sunindextype global_length; - booleantype own_data; - booleantype own_parvector; + sunbooleantype own_data; + sunbooleantype own_parvector; sunrealtype *data; MPI_Comm comm; hypre_ParVector *x; @@ -109,71 +109,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with :c:func:`N_VMake_ParHyp` will have the default settings for the NVECTOR_PARHYP module. -.. c:function:: int N_VEnableFusedOps_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the parhyp vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the parhyp vector. The return value diff --git a/doc/shared/nvectors/NVector_Parallel.rst b/doc/shared/nvectors/NVector_Parallel.rst index cf5ec0412a..0a479676f4 100644 --- a/doc/shared/nvectors/NVector_Parallel.rst +++ b/doc/shared/nvectors/NVector_Parallel.rst @@ -29,7 +29,7 @@ ownership of the data array *data*. struct _N_VectorContent_Parallel { sunindextype local_length; sunindextype global_length; - booleantype own_data; + sunbooleantype own_data; sunrealtype *data; MPI_Comm comm; }; @@ -207,71 +207,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from, while vectors created with :c:func:`N_VNew_Parallel` will have the default settings for the NVECTOR_PARALLEL module. -.. c:function:: int N_VEnableFusedOps_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the parallel vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the parallel vector. The return value diff --git a/doc/shared/nvectors/NVector_Pthreads.rst b/doc/shared/nvectors/NVector_Pthreads.rst index 6960e8f095..df060f1c73 100644 --- a/doc/shared/nvectors/NVector_Pthreads.rst +++ b/doc/shared/nvectors/NVector_Pthreads.rst @@ -36,7 +36,7 @@ threaded using POSIX threads (Pthreads). struct _N_VectorContent_Pthreads { sunindextype length; - booleantype own_data; + sunbooleantype own_data; sunrealtype *data; int num_threads; }; @@ -205,71 +205,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with :c:func:`N_VNew_Pthreads` will have the default settings for the NVECTOR_PTHREADS module. -.. c:function:: int N_VEnableFusedOps_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the Pthreads vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_Pthreads(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_Pthreads(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the Pthreads vector. The return value diff --git a/doc/shared/nvectors/NVector_RAJA.rst b/doc/shared/nvectors/NVector_RAJA.rst index 6a24972d6f..9a2df1fea7 100644 --- a/doc/shared/nvectors/NVector_RAJA.rst +++ b/doc/shared/nvectors/NVector_RAJA.rst @@ -39,7 +39,7 @@ The vector content layout is as follows: struct _N_VectorContent_Raja { sunindextype length; - booleantype own_data; + sunbooleantype own_data; sunrealtype* host_data; sunrealtype* device_data; void* priv; /* 'private' data */ @@ -83,7 +83,7 @@ accessor functions: This function returns pointer to the vector data on the device. -.. c:function:: booleantype N_VIsManagedMemory_Raja(N_Vector v) +.. c:function:: sunbooleantype N_VIsManagedMemory_Raja(N_Vector v) This function returns a boolean flag indicating if the vector data is allocated in managed memory or not. @@ -137,7 +137,7 @@ NVECTOR_RAJA provides the following additional user-callable routines: memory data array. This function does not allocate memory for data itself. -.. c:function:: N_Vector N_VNewWithMemHelp_Raja(sunindextype length, booleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) +.. c:function:: N_Vector N_VNewWithMemHelp_Raja(sunindextype length, sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) This function creates an NVECTOR_RAJA with a user-supplied SUNMemoryHelper for allocating/freeing memory. @@ -181,19 +181,19 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned from while vectors created with :c:func:`N_VNew_Raja` will have the default settings for the NVECTOR_RAJA module. -.. c:function:: int N_VEnableFusedOps_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the RAJA vector. The @@ -201,53 +201,53 @@ options as the vector they are cloned from while vectors created with ``ops`` structure are ``NULL``. .. - .. c:function:: int N_VEnableDotProdMulti_Raja(N_Vector v, booleantype tf) + .. c:function:: int N_VEnableDotProdMulti_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. .. - .. c:function:: int N_VEnableWrmsNormVectorArray_Raja(N_Vector v, booleantype tf) + .. c:function:: int N_VEnableWrmsNormVectorArray_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. - .. c:function:: int N_VEnableWrmsNormMaskVectorArray_Raja(N_Vector v, booleantype tf) + .. c:function:: int N_VEnableWrmsNormMaskVectorArray_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the RAJA vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_Raja(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_Raja(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the RAJA vector. The return value diff --git a/doc/shared/nvectors/NVector_SYCL.rst b/doc/shared/nvectors/NVector_SYCL.rst index c2f378cd05..a087b35392 100644 --- a/doc/shared/nvectors/NVector_SYCL.rst +++ b/doc/shared/nvectors/NVector_SYCL.rst @@ -30,7 +30,7 @@ The vector content layout is as follows: struct _N_VectorContent_Sycl { sunindextype length; - booleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNSyclExecPolicy* stream_exec_policy; @@ -110,7 +110,7 @@ constructors for creating a new NVECTOR_SYCL: operation are launched in the provided queue. -.. cpp:function:: N_Vector N_VNewWithMemHelp_Sycl(sunindextype length, booleantype use_managed_mem, SUNMemoryHelper helper, sycl::queue *Q, SUNContext sunctx) +.. cpp:function:: N_Vector N_VNewWithMemHelp_Sycl(sunindextype length, sunbooleantype use_managed_mem, SUNMemoryHelper helper, sycl::queue *Q, SUNContext sunctx) This function creates an NVECTOR_SYCL with a user-supplied SUNMemoryHelper for allocating/freeing memory. All operation are launched in the provided @@ -163,7 +163,7 @@ host and device, unless managed (shared) memory is used. This function copies vector data from the device to the host. -.. cpp:function:: booleantype N_VIsManagedMemory_Sycl(N_Vector v) +.. cpp:function:: sunbooleantype N_VIsManagedMemory_Sycl(N_Vector v) This function returns ``SUNTRUE`` if the vector data is allocated as managed (shared) memory otherwise it returns ``SUNFALSE``. @@ -224,19 +224,19 @@ vectors created by any of the constructors above will have the default settings for the NVECTOR_SYCL module. -.. cpp:function:: int N_VEnableFusedOps_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableFusedOps_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. cpp:function:: int N_VEnableLinearCombination_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableLinearCombination_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. cpp:function:: int N_VEnableScaleAddMulti_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableScaleAddMulti_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the SYCL vector. The @@ -244,53 +244,53 @@ for the NVECTOR_SYCL module. ``ops`` structure are ``NULL``. .. - .. cpp:function:: int N_VEnableDotProdMulti_Sycl(N_Vector v, booleantype tf) + .. cpp:function:: int N_VEnableDotProdMulti_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. cpp:function:: int N_VEnableLinearSumVectorArray_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableLinearSumVectorArray_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. cpp:function:: int N_VEnableScaleVectorArray_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableScaleVectorArray_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. cpp:function:: int N_VEnableConstVectorArray_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableConstVectorArray_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. .. - .. cpp:function:: int N_VEnableWrmsNormVectorArray_Sycl(N_Vector v, booleantype tf) + .. cpp:function:: int N_VEnableWrmsNormVectorArray_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. - .. cpp:function:: int N_VEnableWrmsNormMaskVectorArray_Sycl(N_Vector v, booleantype tf) + .. cpp:function:: int N_VEnableWrmsNormMaskVectorArray_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. cpp:function:: int N_VEnableScaleAddMultiVectorArray_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableScaleAddMultiVectorArray_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the SYCL vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. cpp:function:: int N_VEnableLinearCombinationVectorArray_Sycl(N_Vector v, booleantype tf) +.. cpp:function:: int N_VEnableLinearCombinationVectorArray_Sycl(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the SYCL vector. The return value diff --git a/doc/shared/nvectors/NVector_Serial.rst b/doc/shared/nvectors/NVector_Serial.rst index 024c6a6d7e..78c28c8722 100644 --- a/doc/shared/nvectors/NVector_Serial.rst +++ b/doc/shared/nvectors/NVector_Serial.rst @@ -27,7 +27,7 @@ flag *own_data* which specifies the ownership of data. struct _N_VectorContent_Serial { sunindextype length; - booleantype own_data; + sunbooleantype own_data; sunrealtype *data; }; @@ -183,71 +183,71 @@ operations enabled/disabled as cloned vectors inherit the same enable/disable options as the vector they are cloned, from while vectors created with :c:func:`N_VNew_Serial` will have the default settings for the NVECTOR_SERIAL module. -.. c:function:: int N_VEnableFusedOps_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableFusedOps_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) all fused and vector array operations in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombination_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombination_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination fused operation in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMulti_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMulti_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector to multiple vectors fused operation in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableDotProdMulti_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableDotProdMulti_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the multiple dot products fused operation in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearSumVectorArray_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearSumVectorArray_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear sum operation for vector arrays in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleVectorArray_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleVectorArray_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale operation for vector arrays in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableConstVectorArray_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableConstVectorArray_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the const operation for vector arrays in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormVectorArray_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormVectorArray_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the WRMS norm operation for vector arrays in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the masked WRMS norm operation for vector arrays in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the scale and add a vector array to multiple vector arrays operation in the serial vector. The return value is ``0`` for success and ``-1`` if the input vector or its ``ops`` structure are ``NULL``. -.. c:function:: int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, booleantype tf) +.. c:function:: int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, sunbooleantype tf) This function enables (``SUNTRUE``) or disables (``SUNFALSE``) the linear combination operation for vector arrays in the serial vector. The return value diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index 8a8b730d98..f654431e5c 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -184,7 +184,7 @@ equivalencies with the parameter direction in mind. +-------------------------+-------------------------------+-------------------------------------------+ |``long`` | in, inout, out, return | ``integer(c_long)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``booleantype`` | in, inout, out, return | ``integer(c_int)`` | + |``sunbooleantype`` | in, inout, out, return | ``integer(c_int)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunrealtype`` | in, inout, out, return | ``real(c_double)`` | +-------------------------+-------------------------------+-------------------------------------------+ diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index 0093a97951..0ace53fb7b 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -310,7 +310,7 @@ function pointer ``NULL`` instead of supplying a dummy routine. retval = SUNLinSolSetScalingVectors(LS, s1, s2); -.. c:function:: int SUNLinSolSetZeroGuess(SUNLinearSolver LS, booleantype onoff) +.. c:function:: int SUNLinSolSetZeroGuess(SUNLinearSolver LS, sunbooleantype onoff) This *optional* routine indicates if the upcoming :c:func:`SUNlinSolSolve` call will be made with a zero initial guess (``SUNTRUE``) or a non-zero initial @@ -620,7 +620,7 @@ structure is defined as SUNPSetupFn, SUNPSolveFn); int (*setscalingvectors)(SUNLinearSolver, N_Vector, N_Vector); - int (*setzeroguess)(SUNLinearSolver, booleantype); + int (*setzeroguess)(SUNLinearSolver, sunbooleantype); int (*initialize)(SUNLinearSolver); int (*setup)(SUNLinearSolver, SUNMatrix); int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, diff --git a/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst b/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst index fa62cb2abc..2ae31b11d5 100644 --- a/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst +++ b/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst @@ -83,7 +83,7 @@ In addition, the module provides the following user-callable routines: the input matrix and vector to determine the linear system size and to assess compatibility with the solver. -.. c:function:: int SUNLinSol_MagmaDense_SetAsync(SUNLinearSolver LS, booleantype onoff) +.. c:function:: int SUNLinSol_MagmaDense_SetAsync(SUNLinearSolver LS, sunbooleantype onoff) This function can be used to toggle the linear solver between asynchronous and synchronous modes. In asynchronous mode (default), SUNLinearSolver @@ -109,7 +109,7 @@ The SUNLinearSolver_MagmaDense module defines the object *content* field of a struct _SUNLinearSolverContent_MagmaDense { int last_flag; - booleantype async; + sunbooleantype async; sunindextype N; SUNMemory pivots; SUNMemory pivotsarr; diff --git a/doc/shared/sunlinsol/SUNLinSol_PCG.rst b/doc/shared/sunlinsol/SUNLinSol_PCG.rst index 0a90307073..4620aeb5d3 100644 --- a/doc/shared/sunlinsol/SUNLinSol_PCG.rst +++ b/doc/shared/sunlinsol/SUNLinSol_PCG.rst @@ -268,7 +268,7 @@ The SUNLinSol_PCG module defines the *content* field of a struct _SUNLinearSolverContent_PCG { int maxl; int pretype; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; diff --git a/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst b/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst index e9d7dfd1ac..9fd930ad7f 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst @@ -212,7 +212,7 @@ The SUNLinSol_SPBCGS module defines the *content* field of a struct _SUNLinearSolverContent_SPBCGS { int maxl; int pretype; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; diff --git a/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst index 64f74aeb77..b864dab057 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst @@ -243,7 +243,7 @@ The SUNLinSol_SPFGMR module defines the *content* field of a int pretype; int gstype; int max_restarts; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; diff --git a/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst index 20f440ece0..4e665edf93 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst @@ -230,7 +230,7 @@ The SUNLinSol_SPGMR module defines the *content* field of a int pretype; int gstype; int max_restarts; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; diff --git a/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst index 898325a4cd..3513f66a41 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst @@ -214,7 +214,7 @@ The SUNLinSol_SPTFQMR module defines the *content* field of a struct _SUNLinearSolverContent_SPTFQMR { int maxl; int pretype; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; diff --git a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst index 20f333c92b..d8083957bd 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst @@ -141,7 +141,7 @@ The SUNLinSol_SuperLUDIST module defines the *content* field of a .. code-block:: c struct _SUNLinearSolverContent_SuperLUDIST { - booleantype first_factorize; + sunbooleantype first_factorize; int last_flag; sunrealtype berr; gridinfo_t *grid; diff --git a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst index aa5a7d6735..cf4ee214b2 100644 --- a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst +++ b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst @@ -143,7 +143,7 @@ The SUNLinSol_cuSolverSp_batchQR module defines the *content* field of a struct _SUNLinearSolverContent_cuSolverSp_batchQR { int last_flag; /* last return flag */ - booleantype first_factorize; /* is this the first factorization? */ + sunbooleantype first_factorize; /* is this the first factorization? */ size_t internal_size; /* size of cusolver buffer for Q and R */ size_t workspace_size; /* size of cusolver memory for factorization */ cusolverSpHandle_t cusolver_handle; /* cuSolverSp context */ diff --git a/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst b/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst index 6ff397d17f..65a1f210f4 100644 --- a/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst +++ b/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst @@ -29,7 +29,7 @@ structure: .. code-block:: c struct _SUNMatrixContent_SLUNRloc { - booleantype own_data; + sunbooleantype own_data; gridinfo_t *grid; sunindextype *row_to_proc; pdgsmv_comm_t *gsmv_comm; @@ -101,7 +101,7 @@ The SUNMATRIX_SLUNRLOC module provides the following user-callable routines: ``A``. Its only argument is the ``SUNMatrix`` object to access. -.. c:function:: booleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A) +.. c:function:: sunbooleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A) This function returns true if the ``SUNMatrix`` object is responsible for freeing the underlying ``SuperMatrix``, otherwise it returns false. diff --git a/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst b/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst index 071cfaf83a..823de99c48 100644 --- a/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst +++ b/doc/shared/sunmatrix/SUNMatrix_cuSparse.rst @@ -227,7 +227,7 @@ functions: or a nonzero error code otherwise. -.. c:function:: int SUNMatrix_cuSparse_SetFixedPattern(SUNMatrix A, booleantype yesno) +.. c:function:: int SUNMatrix_cuSparse_SetFixedPattern(SUNMatrix A, sunbooleantype yesno) This function changes the behavior of the the ``SUNMatZero`` operation on the object ``A``. By default the matrix sparsity pattern is not considered to be fixed, thus, diff --git a/doc/shared/sunmemory/SUNMemory_Description.rst b/doc/shared/sunmemory/SUNMemory_Description.rst index d344af612b..0dd9da86d0 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -32,7 +32,7 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, { void* ptr; SUNMemoryType type; - booleantype own; + sunbooleantype own; size_t bytes; }; diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index 14bc52aee8..60dd19a2d5 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -99,7 +99,7 @@ initialization (:c:func:`SUNNonlinSolInitialization`), setup require setup may set this operation to ``NULL``. -.. c:function:: int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, booleantype callLSetup, void *mem) +.. c:function:: int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, sunbooleantype callLSetup, void *mem) This *required* function solves the nonlinear system :math:`F(y)=0` or :math:`G(y)=y`. @@ -376,7 +376,7 @@ module have types defined in the header file linear solver setup and solve functions as applicable. -.. c:type:: int (*SUNNonlinSolLSetupFn)(booleantype jbad, booleantype* jcur, void* mem) +.. c:type:: int (*SUNNonlinSolLSetupFn)(sunbooleantype jbad, sunbooleantype* jcur, void* mem) These functions are wrappers to the SUNDIALS integrator's function for setting up linear solves with SUNLinSol modules. @@ -547,7 +547,7 @@ structure is defined as int (*initialize)(SUNNonlinearSolver); int (*setup)(SUNNonlinearSolver, N_Vector, void*); int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, - N_Vector, sunrealtype, booleantype, void*); + N_Vector, sunrealtype, sunbooleantype, void*); int (*free)(SUNNonlinearSolver); int (*setsysfn)(SUNNonlinearSolver, SUNNonlinSolSysFn); int (*setlsetupfn)(SUNNonlinearSolver, SUNNonlinSolLSetupFn); @@ -576,7 +576,7 @@ system and returns a flag denoting a successful or failed solve: int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { return((int) NLS->ops->solve(NLS, y0, y, w, tol, callLSetup, mem)); } diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst index b275eac221..8e0ed3ecf4 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst @@ -272,7 +272,7 @@ following structure. int m; int *imap; sunrealtype *R; - booleantype damping + sunbooleantype damping sunrealtype beta sunrealtype *gamma; sunrealtype *cvals; diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst index 17fcef9f9f..3d7077f769 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst @@ -230,7 +230,7 @@ following structure. SUNNonlinSolConvTestFn CTest; N_Vector delta; - booleantype jcur; + sunbooleantype jcur; int curiter; int maxiters; long int niters; diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp index a6d081357c..d32fd5ee06 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -983,7 +983,7 @@ int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, double tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { /* local variables */ MPI_Comm comm; diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 63754d31fa..4ebbc28a79 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -205,8 +205,8 @@ struct UserData static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -977,8 +977,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Start timer double t1 = MPI_Wtime(); diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index 3b04f5a9b5..b73ea9dce9 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -241,8 +241,8 @@ static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector f void *user_data, N_Vector tmp); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -1082,8 +1082,8 @@ static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector f } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp index c2db52ee42..e732498d02 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -246,8 +246,8 @@ static int fe(sunrealtype t, N_Vector u, N_Vector f, void *user_data); static int ffeval(sunrealtype *fval, sunrealtype uval, sunrealtype rval); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -1324,8 +1324,8 @@ static int ffeval(sunrealtype *fval, sunrealtype uval, sunrealtype rval) { } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp index 4911e16894..6c5ea139e2 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -248,8 +248,8 @@ static int ff(sunrealtype t, N_Vector u, N_Vector f, void *user_data); static int ffeval(sunrealtype *fval, sunrealtype uval, sunrealtype rval); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -1278,8 +1278,8 @@ static int ff(sunrealtype t, N_Vector u, N_Vector f, void *user_data) // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index 38534438e9..94c649ddc1 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -146,8 +146,8 @@ struct UserData static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -582,8 +582,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Timing variables chrono::time_point t1; diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp index 2434dc4c0c..0fad5d264c 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp +++ b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp @@ -108,7 +108,7 @@ struct UserData sunrealtype G; sunrealtype g; sunrealtype e; - booleantype M_timedep; + sunbooleantype M_timedep; }; // User-supplied functions called by the solver @@ -148,8 +148,8 @@ int main(int argc, char *argv[]) int rk_type = 0; // type of RK method [ARK=0, DIRK=1, ERK=2] int nls_type = 0; // type of nonlinear solver [Newton=0, FP=1] int order = 4; // order of accuracy for RK method - booleantype deduce = SUNFALSE; // deduce fi after a nonlinear solve - booleantype adaptive = SUNTRUE; // adaptive run vs convergence order + sunbooleantype deduce = SUNFALSE; // deduce fi after a nonlinear solve + sunbooleantype adaptive = SUNTRUE; // adaptive run vs convergence order sunrealtype reltol = SUN_RCONST(1e-5); // relative tolerance sunrealtype abstol = SUN_RCONST(1e-11); // absolute tolerance diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp index a156755fb5..1d9fe00536 100644 --- a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp +++ b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp @@ -579,7 +579,7 @@ static int f_diff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { sunindextype i; sunrealtype ul, ur, vl, vr, wl, wr; sunrealtype xl, xr, f1; - booleantype left, right; + sunbooleantype left, right; sunrealtype *Ydata, *RHSdata; /* access data arrays */ @@ -660,7 +660,7 @@ static int f_rx(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { sunindextype i; sunrealtype ul, ur, vl, vr, wl, wr; sunrealtype u, v, w, xl, xr, f1, f2, f3; - booleantype left, right; + sunbooleantype left, right; sunrealtype *Ydata, *RHSdata; /* access data arrays */ @@ -856,7 +856,7 @@ static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, /* local data */ sunindextype i, nz=0; sunrealtype xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; - booleantype left, right, interior; + sunbooleantype left, right, interior; /* check that vector/matrix dimensions match up */ if ((Msuper->nrow != NEQ) || (Msuper->ncol != NEQ)) { diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index 59b4a9b034..be21aa654a 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -280,8 +280,8 @@ static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector f void *user_data, N_Vector tmp); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -1404,8 +1404,8 @@ static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector f } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index 0e1b742f77..1096bf0ff2 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -244,8 +244,8 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -1299,8 +1299,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Start timer double t1 = MPI_Wtime(); diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 90d7695097..65d0e09f7e 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -188,8 +188,8 @@ int MyAccess(braid_App app, braid_Vector u, braid_AccessStatus astatus); static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -904,8 +904,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Timing variables chrono::time_point t1; diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c index bd7b19fccf..e8217e9815 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -199,8 +199,8 @@ static int AdvectionReaction(double t, N_Vector y, N_Vector ydot, * Preconditioner functions (used only when using the global nonlinear solver) */ -static int PSetup(double t, N_Vector y, N_Vector f, booleantype jok, - booleantype *jcurPtr, double gamma, void *user_data); +static int PSetup(double t, N_Vector y, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, double gamma, void *user_data); static int PSolve(double t, N_Vector y, N_Vector f, N_Vector r, N_Vector z, double gamma, double delta, int lr, void *user_data); @@ -1074,7 +1074,7 @@ int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, double tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { /* local variables */ MPI_Comm comm; @@ -1242,8 +1242,8 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) /* Sets P = I - gamma * J */ -int PSetup(double t, N_Vector y, N_Vector ydot, booleantype jok, - booleantype *jcurPtr, double gamma, void *user_data) +int PSetup(double t, N_Vector y, N_Vector ydot, sunbooleantype jok, + sunbooleantype *jcurPtr, double gamma, void *user_data) { /* local variables */ UserData udata = (UserData) user_data; diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index 2622544255..993597e214 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -164,7 +164,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], /* Functions Called by the Solver */ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, sunrealtype gamma, @@ -808,7 +808,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c index 02620a29d6..9e1377b783 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c @@ -60,7 +60,7 @@ #include /* declaration of N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* prototypes for small dense fcts. */ -#include /* definitions of sunrealtype, booleantype */ +#include /* definitions of sunrealtype, sunbooleantype */ #include /* definition of macros SUNSQR and EXP */ #include /* MPI constants and types */ @@ -166,7 +166,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], /* Functions Called by the Solver */ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, @@ -843,7 +843,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index f6d6c5bf8c..37acdbbf43 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -229,8 +229,8 @@ static void v_zero(sunrealtype u[], int n); static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -248,7 +248,7 @@ int main(int argc, char* argv[]) WebData wdata = NULL; SUNLinearSolver LS = NULL; void *arkode_mem = NULL; - booleantype firstrun; + sunbooleantype firstrun; int jpre, gstype, flag; int ns, mxns, iout; int nrmfactor = 0; /* LS norm conversion factor flag */ @@ -804,8 +804,8 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[ of a block-diagonal preconditioner. The blocks are of size mp, and there are ngrp=ngx*ngy blocks computed in the block-grouping scheme. */ -static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype ***P; sunindextype ier; diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c index 404c2386c5..6c1496ba1f 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -486,7 +486,7 @@ static int f_diff(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) sunindextype i; sunrealtype ul, ur, vl, vr, wl, wr; sunrealtype xl, xr, f1; - booleantype left, right; + sunbooleantype left, right; sunrealtype *Ydata, *RHSdata; /* access data arrays */ @@ -567,7 +567,7 @@ static int f_rx(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { sunindextype i; sunrealtype ul, ur, vl, vr, wl, wr; sunrealtype u, v, w, xl, xr, f1, f2, f3; - booleantype left, right; + sunbooleantype left, right; sunrealtype *Ydata, *RHSdata; /* access data arrays */ @@ -768,7 +768,7 @@ static int MassMatrix(sunrealtype t, SUNMatrix M, void *user_data, /* local data */ sunindextype i, nz=0; sunrealtype xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3; - booleantype left, right; + sunbooleantype left, right; /* check that vector/matrix dimensions match up */ if ((SUNSparseMatrix_Rows(M) != NEQ) || (SUNSparseMatrix_Columns(M) != NEQ) || diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index 327bce36a0..c27b14d8d1 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c @@ -173,8 +173,8 @@ int main(int argc, char *argv[]) SUNLinearSolver LSf = NULL; /* fast linear solver object */ SUNMatrix As = NULL; /* matrix for slow solver */ SUNLinearSolver LSs = NULL; /* slow linear solver object */ - booleantype implicit_slow; - booleantype imex_slow = SUNFALSE; + sunbooleantype implicit_slow; + sunbooleantype imex_slow = SUNFALSE; N_Vector umask = NULL; /* empty mask vectors */ N_Vector vmask = NULL; N_Vector wmask = NULL; diff --git a/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index 5022994b9f..d7ce20680b 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.c +++ b/examples/arkode/C_serial/ark_kpr_mri.c @@ -152,9 +152,9 @@ int main(int argc, char *argv[]) SUNLinearSolver LSf = NULL; /* fast linear solver object */ SUNMatrix As = NULL; /* matrix for slow solver */ SUNLinearSolver LSs = NULL; /* slow linear solver object */ - booleantype implicit_slow; - booleantype imex_slow = SUNFALSE; - booleantype deduce = SUNFALSE; + sunbooleantype implicit_slow; + sunbooleantype imex_slow = SUNFALSE; + sunbooleantype deduce = SUNFALSE; FILE *UFID; sunrealtype hf, gamma, beta, t, tout, rpar[3]; sunrealtype uerr, verr, uerrtot, verrtot, errtot; @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) if (argc > 3) G = SUNStrToReal(argv[3]); if (argc > 4) w = SUNStrToReal(argv[4]); if (argc > 5) e = SUNStrToReal(argv[5]); - if (argc > 6) deduce = (booleantype) atoi(argv[6]); + if (argc > 6) deduce = (sunbooleantype) atoi(argv[6]); /* Check arguments for validity */ /* 0 <= solve_type <= 9 */ diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index 79265c6831..63b3f39867 100644 --- a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp +++ b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp @@ -200,8 +200,8 @@ struct UserData static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -926,8 +926,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector f, void *user_data) } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { // Start timer double t1 = MPI_Wtime(); diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index 2dd12c26d4..856bf4dd6f 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -241,8 +241,8 @@ static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector f void *user_data, N_Vector tmp); // Preconditioner setup and solve functions -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, @@ -1027,8 +1027,8 @@ static int JTimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector f } // Preconditioner setup routine -static int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { int flag; diff --git a/examples/cvode/CXX_serial/cv_heat2D.cpp b/examples/cvode/CXX_serial/cv_heat2D.cpp index c89f297c34..21e0c6f008 100644 --- a/examples/cvode/CXX_serial/cv_heat2D.cpp +++ b/examples/cvode/CXX_serial/cv_heat2D.cpp @@ -61,7 +61,7 @@ int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data); // Preconditioner Setup and Solve functions -int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, booleantype* jcurPtr, sunrealtype gamma, void* user_data); +int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, sunbooleantype* jcurPtr, sunrealtype gamma, void* user_data); int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void* user_data); @@ -352,7 +352,7 @@ int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data) } // Preconditioner setup routine -int PSetup(sunrealtype t, N_Vector u, N_Vector f, booleantype jok, booleantype* jcurPtr, sunrealtype gamma, void* user_data) +int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, sunbooleantype* jcurPtr, sunrealtype gamma, void* user_data) { // Access problem data auto udata = static_cast(user_data); diff --git a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c index a6ebce34eb..36cd2c31ce 100644 --- a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c +++ b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c @@ -66,7 +66,7 @@ #include /* access to MPI-parallel N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* prototypes for small dense fcts. */ -#include /* definitions of sunrealtype, booleantype */ +#include /* definitions of sunrealtype, sunbooleantype */ /* helpful macros */ @@ -177,7 +177,7 @@ static void fcalc(sunrealtype t, N_Vector udot, UserData data); static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, @@ -823,8 +823,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) } /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup; sunrealtype **(*P)[MYSUB], **(*Jbd)[MYSUB]; diff --git a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c index ddd58374b8..c14316912e 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c @@ -66,7 +66,7 @@ #include /* access to MPI-parallel N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* access to CVBBDPRE module */ -#include /* definitions of sunrealtype, booleantype */ +#include /* definitions of sunrealtype, sunbooleantype */ #include /* MPI constants and types */ diff --git a/examples/cvode/parallel/cvDiurnal_kry_p.c b/examples/cvode/parallel/cvDiurnal_kry_p.c index 6ae2deee11..d56bb58111 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_p.c @@ -63,7 +63,7 @@ #include /* access to MPI-parallel N_Vector */ #include /* access to SPGMR SUNLinearSolver */ #include /* prototypes for small dense fcts. */ -#include /* definitions of sunrealtype, booleantype */ +#include /* definitions of sunrealtype, sunbooleantype */ #include /* MPI constants and types */ @@ -176,7 +176,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, @@ -835,7 +835,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; diff --git a/examples/cvode/serial/cvDirectDemo_ls.c b/examples/cvode/serial/cvDirectDemo_ls.c index 45f28b8dee..cdcfe062a1 100644 --- a/examples/cvode/serial/cvDirectDemo_ls.c +++ b/examples/cvode/serial/cvDirectDemo_ls.c @@ -175,7 +175,7 @@ static int Problem1(void) SUNLinearSolver LS; SUNNonlinearSolver NLS; void *cvode_mem; - booleantype firstrun; + sunbooleantype firstrun; int qu; sunrealtype hu; SUNContext sunctx; @@ -397,7 +397,7 @@ static int Problem2(void) SUNLinearSolver LS; SUNNonlinearSolver NLS; void *cvode_mem; - booleantype firstrun; + sunbooleantype firstrun; int qu, iout; sunrealtype hu; SUNContext sunctx; diff --git a/examples/cvode/serial/cvDiurnal_kry.c b/examples/cvode/serial/cvDiurnal_kry.c index 5ed8c0d7f2..16171449fa 100644 --- a/examples/cvode/serial/cvDiurnal_kry.c +++ b/examples/cvode/serial/cvDiurnal_kry.c @@ -149,8 +149,8 @@ static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, N_Vector fy, void *user_data, N_Vector tmp); -static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -695,8 +695,8 @@ static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; sunrealtype **(*P)[MY], **(*Jbd)[MY]; diff --git a/examples/cvode/serial/cvKrylovDemo_ls.c b/examples/cvode/serial/cvKrylovDemo_ls.c index 30e1b030fd..5133974e18 100644 --- a/examples/cvode/serial/cvKrylovDemo_ls.c +++ b/examples/cvode/serial/cvKrylovDemo_ls.c @@ -171,8 +171,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, @@ -732,8 +732,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; sunrealtype **(*P)[MY], **(*Jbd)[MY]; diff --git a/examples/cvode/serial/cvKrylovDemo_prec.c b/examples/cvode/serial/cvKrylovDemo_prec.c index 2185f4492f..28fa57da82 100644 --- a/examples/cvode/serial/cvKrylovDemo_prec.c +++ b/examples/cvode/serial/cvKrylovDemo_prec.c @@ -222,8 +222,8 @@ static void v_zero(sunrealtype u[], int n); static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -244,7 +244,7 @@ int main() WebData wdata; SUNLinearSolver LS; void *cvode_mem; - booleantype firstrun; + sunbooleantype firstrun; int jpre, gstype, retval; int ns, mxns, iout; @@ -777,8 +777,8 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[ of a block-diagonal preconditioner. The blocks are of size mp, and there are ngrp=ngx*ngy blocks computed in the block-grouping scheme. */ -static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype ***P; sunindextype ier; diff --git a/examples/cvode/serial/cvPendulum_dns.c b/examples/cvode/serial/cvPendulum_dns.c index f79e2b738e..c9fb2a6115 100644 --- a/examples/cvode/serial/cvPendulum_dns.c +++ b/examples/cvode/serial/cvPendulum_dns.c @@ -109,14 +109,14 @@ static int proj(sunrealtype t, N_Vector yy, N_Vector corr, /* Functions to integrate the Cartesian and reference solutions */ int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, - sunrealtype tf, int nout, booleantype proj, booleantype projerr, + sunrealtype tf, int nout, sunbooleantype proj, sunbooleantype projerr, N_Vector yref); int RefSol(sunrealtype tf, N_Vector yref, int nout); /* Utility functions */ static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, - sunrealtype *tf, int *nout, booleantype *projerr); + sunrealtype *tf, int *nout, sunbooleantype *projerr); static void InputHelp(); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -135,7 +135,7 @@ int main(int argc, char* argv[]) sunrealtype rtol = SUN_RCONST(1.0e-5); /* base relative tolerance */ sunrealtype atol = SUN_RCONST(1.0e-5); /* base absolute tolerance */ sunrealtype tf = SUN_RCONST(30.0); /* final integration time */ - booleantype projerr = SUNTRUE; /* enable error projection */ + sunbooleantype projerr = SUNTRUE; /* enable error projection */ void *cvode_mem = NULL; /* CVODE memory */ N_Vector yy0 = NULL; /* initial condition vector */ @@ -239,7 +239,7 @@ int main(int argc, char* argv[]) /* Compute the Cartesian system solution */ int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, - sunrealtype tf, int nout, booleantype proj, booleantype projerr, + sunrealtype tf, int nout, sunbooleantype proj, sunbooleantype projerr, N_Vector yref) { char outname[100]; /* output file name */ @@ -698,7 +698,7 @@ static int proj(sunrealtype t, N_Vector yy, N_Vector corr, /* Read command line unputs */ static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, - sunrealtype *tf, int *nout, booleantype *projerr) + sunrealtype *tf, int *nout, sunbooleantype *projerr) { int arg_idx = 1; diff --git a/examples/cvode/serial/cvRoberts_dns_negsol.c b/examples/cvode/serial/cvRoberts_dns_negsol.c index ce76d53f5c..4c828a19bf 100644 --- a/examples/cvode/serial/cvRoberts_dns_negsol.c +++ b/examples/cvode/serial/cvRoberts_dns_negsol.c @@ -88,7 +88,7 @@ int main() SUNLinearSolver LS; void *cvode_mem; int retval, iout; - booleantype check_negative; + sunbooleantype check_negative; y = NULL; abstol = NULL; @@ -209,9 +209,9 @@ int main() static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) { sunrealtype y1, y2, y3, yd1, yd3; - booleantype *check_negative; + sunbooleantype *check_negative; - check_negative = (booleantype *)user_data; + check_negative = (sunbooleantype *)user_data; y1 = NV_Ith_S(y,0); y2 = NV_Ith_S(y,1); y3 = NV_Ith_S(y,2); diff --git a/examples/cvode/superludist/cvAdvDiff_sludist.cpp b/examples/cvode/superludist/cvAdvDiff_sludist.cpp index 4c7f0214cf..a47f9b8416 100644 --- a/examples/cvode/superludist/cvAdvDiff_sludist.cpp +++ b/examples/cvode/superludist/cvAdvDiff_sludist.cpp @@ -462,8 +462,8 @@ static int Jac(sunrealtype t, N_Vector u, N_Vector fu, /* set non-zero Jacobian entries */ for (i=0; i < Jstore->m_loc; i++) { - booleantype first_local_row; - booleantype first_row, last_row; + sunbooleantype first_local_row; + sunbooleantype first_row, last_row; /* global row index */ j = Jstore->fst_row + i; diff --git a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c index 791e2e437e..0726e0d8ed 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c @@ -101,13 +101,13 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], int my_pe, - booleantype *sensi, int *sensi_meth, booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con); static void WrongArgs(int my_pe, char *name); static void SetIC(N_Vector u, sunrealtype dx, sunindextype my_length, sunindextype my_base); static void PrintOutput(void *cvode_mem, int my_pe, sunrealtype t, N_Vector u); static void PrintOutputS(int my_pe, N_Vector *uS); -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth); +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth); static int check_retval(void *returnvalue, const char *funcname, int opt, int id); /* @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) sunrealtype *pbar; int is, *plist; N_Vector *uS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; SUNNonlinearSolver NLS, NLSsens; @@ -414,7 +414,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) */ static void ProcessArgs(int argc, char *argv[], int my_pe, - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -569,8 +569,8 @@ static void PrintOutputS(int my_pe, N_Vector *uS) * Print some final statistics located in the iopt array */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth) +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth) { long int nst; long int nfe, nsetups, nni, ncfn, netf; diff --git a/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c b/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c index abbf8fd75e..28c63f3db1 100644 --- a/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c +++ b/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) int ncheckpnt, retval; - booleantype output; + sunbooleantype output; /* Initialize MPI and set Ids */ MPI_Init(&argc, &argv); diff --git a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c index 09efed1702..23d8fa282f 100644 --- a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c @@ -169,7 +169,7 @@ typedef struct { static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, @@ -179,7 +179,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, /* Private Helper Functions */ static void ProcessArgs(int argc, char *argv[], int my_pe, - booleantype *sensi, int *sensi_meth, booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con); static void WrongArgs(int my_pe, char *name); static void InitUserData(int my_pe, MPI_Comm comm, UserData data); @@ -200,8 +200,8 @@ static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], User static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm, sunrealtype t, N_Vector u); static void PrintOutputS(int my_pe, MPI_Comm comm, N_Vector *uS); -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth); +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth); static int check_retval(void *returnvalue, const char *funcname, int opt, int id); /* @@ -225,7 +225,7 @@ int main(int argc, char *argv[]) sunrealtype *pbar; int is, *plist; N_Vector *uS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; u = NULL; @@ -432,7 +432,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) */ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; @@ -565,7 +565,7 @@ static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, */ static void ProcessArgs(int argc, char *argv[], int my_pe, - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -1209,8 +1209,8 @@ static void PrintOutputS(int my_pe, MPI_Comm comm, N_Vector *uS) * Print final statistics from the CVODES memory. */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth) +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth) { long int nst; long int nfe, nsetups, nni, ncfn, netf; diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c index f550431ffa..4b45c8a183 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c @@ -67,7 +67,7 @@ #include /* prototypes for CVBBDPRE module */ #include /* prototypes and constants for SUNLinSol_SPGMR solver */ #include /* definition N_Vector */ -#include /* definitions of sunrealtype, booleantype */ +#include /* definitions of sunrealtype, sunbooleantype */ #include /* MPI constants and types */ diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_p.c index c1c7e4f04f..ebc6a0494a 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_p.c @@ -54,7 +54,7 @@ #include /* prototypes and constants for SUNLinSol_SPGMR solver */ #include /* definition N_Vector */ #include /* prototypes for small dense matrix fcts. */ -#include /* definitions of sunrealtype, booleantype */ +#include /* definitions of sunrealtype, sunbooleantype */ #include /* MPI constants and types */ @@ -167,7 +167,7 @@ static void fcalc(sunrealtype t, sunrealtype udata[], sunrealtype dudata[], static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, @@ -825,7 +825,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; diff --git a/examples/cvodes/serial/cvsAdvDiff_FSA_non.c b/examples/cvodes/serial/cvsAdvDiff_FSA_non.c index 826a9c31ac..7e084b26e7 100644 --- a/examples/cvodes/serial/cvsAdvDiff_FSA_non.c +++ b/examples/cvodes/serial/cvsAdvDiff_FSA_non.c @@ -89,14 +89,14 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); /* Private Helper Functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); static void SetIC(N_Vector u, sunrealtype dx); static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector u); static void PrintOutputS(N_Vector *uS); -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth); +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) sunrealtype *pbar; int is, *plist; N_Vector *uS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; SUNNonlinearSolver NLS, NLSsens; @@ -344,7 +344,7 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -478,8 +478,8 @@ static void PrintOutputS(N_Vector *uS) * Print some final statistics located in the CVODES memory */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth) +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth) { long int nst; long int nfe, nsetups, nni, ncfn, netf; diff --git a/examples/cvodes/serial/cvsDirectDemo_ls.c b/examples/cvodes/serial/cvsDirectDemo_ls.c index 42843de272..59d119b098 100644 --- a/examples/cvodes/serial/cvsDirectDemo_ls.c +++ b/examples/cvodes/serial/cvsDirectDemo_ls.c @@ -175,7 +175,7 @@ static int Problem1(void) SUNLinearSolver LS; SUNNonlinearSolver NLS; void *cvode_mem; - booleantype firstrun; + sunbooleantype firstrun; int qu; sunrealtype hu; SUNContext sunctx; @@ -396,7 +396,7 @@ static int Problem2(void) SUNLinearSolver LS; SUNNonlinearSolver NLS; void *cvode_mem; - booleantype firstrun; + sunbooleantype firstrun; int qu, iout; sunrealtype hu; SUNContext sunctx; diff --git a/examples/cvodes/serial/cvsDiurnal_FSA_kry.c b/examples/cvodes/serial/cvsDiurnal_FSA_kry.c index 7787f16915..384e490dac 100644 --- a/examples/cvodes/serial/cvsDiurnal_FSA_kry.c +++ b/examples/cvodes/serial/cvsDiurnal_FSA_kry.c @@ -146,8 +146,8 @@ typedef struct { static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(sunrealtype tn, N_Vector y, N_Vector fy, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector y, N_Vector fy, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, @@ -157,7 +157,7 @@ static int PSolve(sunrealtype tn, N_Vector y, N_Vector fy, /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con); static void WrongArgs(char *name); static UserData AllocUserData(void); static void InitUserData(UserData data); @@ -165,8 +165,8 @@ static void FreeUserData(UserData data); static void SetInitialProfiles(N_Vector y, sunrealtype dx, sunrealtype dz); static void PrintOutput(void *cvode_mem, sunrealtype t, N_Vector y); static void PrintOutputS(N_Vector *uS); -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth); +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth); static int check_retval(void *returnvalue, const char *funcname, int opt); /* @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) sunrealtype *pbar; int is, *plist; N_Vector *uS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; pbar = NULL; @@ -450,8 +450,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) * Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(sunrealtype tn, N_Vector y, N_Vector fy, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector y, N_Vector fy, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, czdn, czup, diag, zdn, zup, q4coef, delz, verdco, hordco; sunrealtype **(*P)[MZ], **(*Jbd)[MZ]; @@ -589,7 +589,7 @@ static int PSolve(sunrealtype tn, N_Vector y, N_Vector fy, */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -846,8 +846,8 @@ static void PrintOutputS(N_Vector *uS) * Print final statistics contained in iopt */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi, - booleantype err_con, int sensi_meth) +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi, + sunbooleantype err_con, int sensi_meth) { long int nst; long int nfe, nsetups, nni, ncfn, netf; diff --git a/examples/cvodes/serial/cvsDiurnal_kry.c b/examples/cvodes/serial/cvsDiurnal_kry.c index 2d3c6dba17..ab13d90c44 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry.c +++ b/examples/cvodes/serial/cvsDiurnal_kry.c @@ -148,7 +148,7 @@ static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, void *user_data, N_Vector tmp); static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, @@ -697,7 +697,7 @@ static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, /* Preconditioner setup routine. Generate and preprocess P. */ static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, - booleantype jok, booleantype *jcurPtr, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c index 8ca5b36fed..410e24c591 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c @@ -188,7 +188,7 @@ typedef struct { static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); static int Precond(sunrealtype t, N_Vector c, N_Vector fc, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector c, N_Vector fc, @@ -200,8 +200,8 @@ static int fB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector cBdot, void *user_data); static int PrecondB(sunrealtype t, N_Vector c, - N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, + N_Vector cB, N_Vector fcB, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolveB(sunrealtype t, N_Vector c, @@ -478,7 +478,7 @@ static int f(sunrealtype t, N_Vector c, N_Vector cdot, void *user_data) */ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype ***P; @@ -688,8 +688,8 @@ static int fB(sunrealtype t, N_Vector c, N_Vector cB, */ static int PrecondB(sunrealtype t, N_Vector c, - N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, + N_Vector cB, N_Vector fcB, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype ***P; diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c index 3f695b1bba..342c46ef09 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c @@ -179,7 +179,7 @@ typedef struct { static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); static int Precond(sunrealtype t, N_Vector c, N_Vector fc, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype t, N_Vector c, N_Vector fc, @@ -191,8 +191,8 @@ static int fB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector cBdot, void *user_data); static int PrecondB(sunrealtype t, N_Vector c, - N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, + N_Vector cB, N_Vector fcB, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolveB(sunrealtype t, N_Vector c, @@ -465,7 +465,7 @@ static int f(sunrealtype t, N_Vector c, N_Vector cdot, void *user_data) */ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype ***P; @@ -666,8 +666,8 @@ static int fB(sunrealtype t, N_Vector c, N_Vector cB, */ static int PrecondB(sunrealtype t, N_Vector c, - N_Vector cB, N_Vector fcB, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, + N_Vector cB, N_Vector fcB, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype ***P; diff --git a/examples/cvodes/serial/cvsKrylovDemo_ls.c b/examples/cvodes/serial/cvsKrylovDemo_ls.c index 85e5ad2a71..f9d38416f7 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_ls.c +++ b/examples/cvodes/serial/cvsKrylovDemo_ls.c @@ -168,8 +168,8 @@ static int check_retval(void *returnvalue, const char *funcname, int opt); static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data); -static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector u, N_Vector fu, N_Vector r, N_Vector z, @@ -721,8 +721,8 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void *user_data) /* Preconditioner setup routine. Generate and preprocess P. */ -static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype tn, N_Vector u, N_Vector fu, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype c1, c2, cydn, cyup, diag, ydn, yup, q4coef, dely, verdco, hordco; sunrealtype **(*P)[MY], **(*Jbd)[MY]; diff --git a/examples/cvodes/serial/cvsKrylovDemo_prec.c b/examples/cvodes/serial/cvsKrylovDemo_prec.c index e11fee5ded..f47e869c7e 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_prec.c +++ b/examples/cvodes/serial/cvsKrylovDemo_prec.c @@ -221,8 +221,8 @@ static void v_zero(sunrealtype u[], int n); static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int Precond(sunrealtype tn, N_Vector c, N_Vector fc, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSolve(sunrealtype tn, N_Vector c, N_Vector fc, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -243,7 +243,7 @@ int main() WebData wdata; SUNLinearSolver LS; void *cvode_mem; - booleantype firstrun; + sunbooleantype firstrun; int jpre, gstype, retval; int ns, mxns, iout; @@ -775,8 +775,8 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, sunrealtype c[ of a block-diagonal preconditioner. The blocks are of size mp, and there are ngrp=ngx*ngy blocks computed in the block-grouping scheme. */ -static int Precond(sunrealtype t, N_Vector c, N_Vector fc, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { sunrealtype ***P; sunindextype **pivot; diff --git a/examples/cvodes/serial/cvsPendulum_dns.c b/examples/cvodes/serial/cvsPendulum_dns.c index aa7927c130..66424e4a2b 100644 --- a/examples/cvodes/serial/cvsPendulum_dns.c +++ b/examples/cvodes/serial/cvsPendulum_dns.c @@ -109,14 +109,14 @@ static int proj(sunrealtype t, N_Vector yy, N_Vector corr, /* Functions to integrate the Cartesian and reference solutions */ int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, - sunrealtype tf, int nout, booleantype proj, booleantype projerr, + sunrealtype tf, int nout, sunbooleantype proj, sunbooleantype projerr, N_Vector yref); int RefSol(sunrealtype tf, N_Vector yref, int nout); /* Utility functions */ static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, - sunrealtype *tf, int *nout, booleantype *projerr); + sunrealtype *tf, int *nout, sunbooleantype *projerr); static void InputHelp(); static int check_retval(void *returnvalue, const char *funcname, int opt); @@ -135,7 +135,7 @@ int main(int argc, char* argv[]) sunrealtype rtol = SUN_RCONST(1.0e-5); /* base relative tolerance */ sunrealtype atol = SUN_RCONST(1.0e-5); /* base absolute tolerance */ sunrealtype tf = SUN_RCONST(30.0); /* final integration time */ - booleantype projerr = SUNTRUE; /* enable error projection */ + sunbooleantype projerr = SUNTRUE; /* enable error projection */ void *cvode_mem = NULL; /* CVODES memory */ N_Vector yy0 = NULL; /* initial condition vector */ @@ -239,7 +239,7 @@ int main(int argc, char* argv[]) /* Compute the Cartesian system solution */ int GetSol(void *cvode_mem, N_Vector yy0, sunrealtype rtol, sunrealtype atol, - sunrealtype tf, int nout, booleantype proj, booleantype projerr, + sunrealtype tf, int nout, sunbooleantype proj, sunbooleantype projerr, N_Vector yref) { char outname[100]; /* output file name */ @@ -698,7 +698,7 @@ static int proj(sunrealtype t, N_Vector yy, N_Vector corr, /* Read command line unputs */ static int ReadInputs(int *argc, char ***argv, sunrealtype *rtol, sunrealtype *atol, - sunrealtype *tf, int *nout, booleantype *projerr) + sunrealtype *tf, int *nout, sunbooleantype *projerr) { int arg_idx = 1; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns.c b/examples/cvodes/serial/cvsRoberts_FSA_dns.c index a5950d17b0..bd2863d82f 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns.c @@ -136,8 +136,8 @@ static void PrintOutputS(N_Vector *uS); /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) sunrealtype pbar[NS]; int is; N_Vector *yS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; data = NULL; @@ -491,7 +491,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c index 29bc809f48..4dd54b49d2 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c @@ -57,9 +57,9 @@ /* Type : UserData */ typedef struct { - booleantype sensi; /* turn on (T) or off (F) sensitivity analysis */ - booleantype errconS; /* full (T) or partial error control (F) */ - booleantype fsDQ; /* user provided r.h.s sensitivity analysis (T/F) */ + sunbooleantype sensi; /* turn on (T) or off (F) sensitivity analysis */ + sunbooleantype errconS; /* full (T) or partial error control (F) */ + sunbooleantype fsDQ; /* user provided r.h.s sensitivity analysis (T/F) */ int meth; /* sensitivity method */ sunrealtype p[3]; /* sensitivity variables */ } *UserData; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c index 86d508d0df..a3df89a0bb 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_constraints.c @@ -128,13 +128,13 @@ static void PrintOutputS(N_Vector *uS); /* Private function to print final statistics */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi); +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi); /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) sunrealtype pbar[NS]; int is; N_Vector *yS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; data = NULL; @@ -475,7 +475,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -608,7 +608,7 @@ static void PrintOutputS(N_Vector *uS) * Get and print some final statistics */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi) +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi) { long int nst, nfe, nsetups, nje, nni, nnf, ncfn, netf, nfeLS; long int nfSe, nfeS, nsetupsS, nniS, nnfS, ncfnS, netfS; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_klu.c b/examples/cvodes/serial/cvsRoberts_FSA_klu.c index 1131bda89f..9ab96e9bda 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_klu.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_klu.c @@ -121,13 +121,13 @@ static void PrintOutputS(N_Vector *uS); /* Private function to print final statistics */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi); +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi); /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) sunrealtype pbar[NS]; int is; N_Vector *yS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; data = NULL; @@ -490,7 +490,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -623,7 +623,7 @@ static void PrintOutputS(N_Vector *uS) * Get and print some final statistics */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi) +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi) { long int nst, nfe, nsetups, nje, nni, nnf, ncfn, netf; long int nfSe, nfeS, nsetupsS, nniS, nnfS, ncfnS, netfS; diff --git a/examples/cvodes/serial/cvsRoberts_FSA_sps.c b/examples/cvodes/serial/cvsRoberts_FSA_sps.c index 9b9c35a387..3a801fe037 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_sps.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_sps.c @@ -121,13 +121,13 @@ static void PrintOutputS(N_Vector *uS); /* Private function to print final statistics */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi); +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi); /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) sunrealtype pbar[NS]; int is; N_Vector *yS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; data = NULL; @@ -490,7 +490,7 @@ static int ewt(N_Vector y, N_Vector w, void *user_data) */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -623,7 +623,7 @@ static void PrintOutputS(N_Vector *uS) * Get and print some final statistics */ -static void PrintFinalStats(void *cvode_mem, booleantype sensi) +static void PrintFinalStats(void *cvode_mem, sunbooleantype sensi) { long int nst, nfe, nsetups, nje, nni, nnf, ncfn, netf; long int nfSe, nfeS, nsetupsS, nniS, nnfS, ncfnS, netfS; diff --git a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c index b5b5237591..25d6c891d0 100644 --- a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c +++ b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c @@ -111,14 +111,14 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol, sunindextype mudq, sunindextype mukeep, - booleantype sensi, int sensi_meth, int err_con); + sunbooleantype sensi, int sensi_meth, int err_con); static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu, - booleantype sensi, N_Vector *uuS); + sunbooleantype sensi, N_Vector *uuS); static void PrintFinalStats(void *ida_mem); static void ProcessArgs(int argc, char *argv[], int my_pe, - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(int my_pe, char *name); static int check_retval(void *returnvalue, const char *funcname, int opt, int id); @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) sunrealtype *pbar; int is; N_Vector *uuS, *upS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; ida_mem = NULL; @@ -779,7 +779,7 @@ static int SetInitialProfile(N_Vector uu, N_Vector up, N_Vector id, static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol, sunindextype mudq, sunindextype mukeep, - booleantype sensi, int sensi_meth, int err_con) + sunbooleantype sensi, int sensi_meth, int err_con) { printf("\nidasHeat2D_FSA_kry_bbd_p: Heat equation, parallel example problem for IDA\n"); printf(" Discretized heat equation on 2D unit square.\n"); @@ -832,7 +832,7 @@ static void PrintHeader(sunindextype Neq, sunrealtype rtol, sunrealtype atol, * Print integrator statistics and max-norm of solution */ static void PrintOutput(int id, void *ida_mem, sunrealtype t, N_Vector uu, - booleantype sensi, N_Vector *uuS) + sunbooleantype sensi, N_Vector *uuS) { sunrealtype umax, hused; int kused, retval, is; @@ -916,7 +916,7 @@ static void PrintFinalStats(void *ida_mem) */ static void ProcessArgs(int argc, char *argv[], int my_pe, - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; diff --git a/examples/idas/serial/idasRoberts_FSA_dns.c b/examples/idas/serial/idasRoberts_FSA_dns.c index adae35014b..c109c7c46d 100644 --- a/examples/idas/serial/idasRoberts_FSA_dns.c +++ b/examples/idas/serial/idasRoberts_FSA_dns.c @@ -95,8 +95,8 @@ static int rhsQ(sunrealtype tres, N_Vector yy, N_Vector yp, /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); static void PrintIC(N_Vector y, N_Vector yp); @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) sunrealtype pbar[NS]; int is; N_Vector *yS, *ypS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; N_Vector yQ, *yQS; @@ -517,7 +517,7 @@ static int rhsQ(sunrealtype t, N_Vector y, N_Vector yp, */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; diff --git a/examples/idas/serial/idasRoberts_FSA_klu.c b/examples/idas/serial/idasRoberts_FSA_klu.c index 80abcc02dd..a789fb5d4e 100644 --- a/examples/idas/serial/idasRoberts_FSA_klu.c +++ b/examples/idas/serial/idasRoberts_FSA_klu.c @@ -103,8 +103,8 @@ static int rhsQ(sunrealtype tres, N_Vector yy, N_Vector yp, /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); static void PrintIC(N_Vector y, N_Vector yp); @@ -113,7 +113,7 @@ static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS); static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u); static void PrintSensOutput(N_Vector *uS); -static void PrintFinalStats(void *ida_mem, booleantype sensi); +static void PrintFinalStats(void *ida_mem, sunbooleantype sensi); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) sunrealtype pbar[NS]; int is; N_Vector *yS, *ypS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; N_Vector yQ, *yQS; @@ -561,7 +561,7 @@ static int rhsQ(sunrealtype t, N_Vector y, N_Vector yp, */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -789,7 +789,7 @@ static void PrintSensOutput(N_Vector *uS) * Print some final statistics from the IDAS memory. */ -static void PrintFinalStats(void *ida_mem, booleantype sensi) +static void PrintFinalStats(void *ida_mem, sunbooleantype sensi) { long int nst; long int nfe, nsetups, nni, nnf, ncfn, netf; diff --git a/examples/idas/serial/idasRoberts_FSA_sps.c b/examples/idas/serial/idasRoberts_FSA_sps.c index 9a574a1a09..1cdcdfd07a 100644 --- a/examples/idas/serial/idasRoberts_FSA_sps.c +++ b/examples/idas/serial/idasRoberts_FSA_sps.c @@ -103,8 +103,8 @@ static int rhsQ(sunrealtype tres, N_Vector yy, N_Vector yp, /* Prototypes of private functions */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, - booleantype *err_con); + sunbooleantype *sensi, int *sensi_meth, + sunbooleantype *err_con); static void WrongArgs(char *name); static void PrintIC(N_Vector y, N_Vector yp); @@ -113,7 +113,7 @@ static void PrintSensIC(N_Vector y, N_Vector yp, N_Vector* yS, N_Vector* ypS); static void PrintOutput(void *ida_mem, sunrealtype t, N_Vector u); static void PrintSensOutput(N_Vector *uS); -static void PrintFinalStats(void *ida_mem, booleantype sensi); +static void PrintFinalStats(void *ida_mem, sunbooleantype sensi); static int check_retval(void *returnvalue, char *funcname, int opt); /* @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) sunrealtype pbar[NS]; int is; N_Vector *yS, *ypS; - booleantype sensi, err_con; + sunbooleantype sensi, err_con; int sensi_meth; N_Vector yQ, *yQS; @@ -562,7 +562,7 @@ static int rhsQ(sunrealtype t, N_Vector y, N_Vector yp, */ static void ProcessArgs(int argc, char *argv[], - booleantype *sensi, int *sensi_meth, booleantype *err_con) + sunbooleantype *sensi, int *sensi_meth, sunbooleantype *err_con) { *sensi = SUNFALSE; *sensi_meth = -1; @@ -790,7 +790,7 @@ static void PrintSensOutput(N_Vector *uS) * Print some final statistics from the IDAS memory. */ -static void PrintFinalStats(void *ida_mem, booleantype sensi) +static void PrintFinalStats(void *ida_mem, sunbooleantype sensi) { long int nst; long int nfe, nsetups, nni, nnf, ncfn, netf; diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index c2d47c2955..5ff58bd5ff 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -64,7 +64,7 @@ /* Private functions */ static int func(N_Vector u, N_Vector f, void *user_data); -static int jactimes(N_Vector v, N_Vector Jv, N_Vector u, booleantype *new_u, +static int jactimes(N_Vector v, N_Vector Jv, N_Vector u, sunbooleantype *new_u, void *user_data); static void PrintOutput(N_Vector u); static void PrintFinalStats(void *kmem); @@ -283,7 +283,7 @@ static int func(N_Vector u, N_Vector f, void *user_data) * Jacobian vector product function */ -static int jactimes(N_Vector v, N_Vector Jv, N_Vector u, booleantype *new_u, +static int jactimes(N_Vector v, N_Vector Jv, N_Vector u, sunbooleantype *new_u, void *user_data) { sunrealtype dx, dy, hdiff, vdiff; diff --git a/examples/nvector/C_openmp/test_nvector_openmp.c b/examples/nvector/C_openmp/test_nvector_openmp.c index bc304b08a4..86829d0826 100644 --- a/examples/nvector/C_openmp/test_nvector_openmp.c +++ b/examples/nvector/C_openmp/test_nvector_openmp.c @@ -257,7 +257,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if data array is non-null */ return (N_VGetArrayPointer(X) == NULL) ? SUNFALSE : SUNTRUE; diff --git a/examples/nvector/cuda/test_nvector_cuda.cu b/examples/nvector/cuda/test_nvector_cuda.cu index f804c08ffe..80c66def1a 100644 --- a/examples/nvector/cuda/test_nvector_cuda.cu +++ b/examples/nvector/cuda/test_nvector_cuda.cu @@ -376,7 +376,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if vector data is non-null */ if ((N_VGetHostArrayPointer_Cuda(X) == NULL) && diff --git a/examples/nvector/hip/test_nvector_hip.cpp b/examples/nvector/hip/test_nvector_hip.cpp index d05b9f161c..fa9067ec79 100644 --- a/examples/nvector/hip/test_nvector_hip.cpp +++ b/examples/nvector/hip/test_nvector_hip.cpp @@ -375,7 +375,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if vector data is non-null */ if ((N_VGetHostArrayPointer_Hip(X) == NULL) && diff --git a/examples/nvector/kokkos/test_nvector_kokkos.cpp b/examples/nvector/kokkos/test_nvector_kokkos.cpp index 2ddd5676c7..3c351117c4 100644 --- a/examples/nvector/kokkos/test_nvector_kokkos.cpp +++ b/examples/nvector/kokkos/test_nvector_kokkos.cpp @@ -178,7 +178,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if vector data is non-null */ return SUNTRUE; diff --git a/examples/nvector/manyvector/test_nvector_manyvector.c b/examples/nvector/manyvector/test_nvector_manyvector.c index 37a09856b7..ea480c3c9b 100644 --- a/examples/nvector/manyvector/test_nvector_manyvector.c +++ b/examples/nvector/manyvector/test_nvector_manyvector.c @@ -288,7 +288,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* should not be called in these tests */ return SUNTRUE; diff --git a/examples/nvector/mpicuda/test_nvector_mpicuda.cu b/examples/nvector/mpicuda/test_nvector_mpicuda.cu index 0967240893..e533a0bc94 100644 --- a/examples/nvector/mpicuda/test_nvector_mpicuda.cu +++ b/examples/nvector/mpicuda/test_nvector_mpicuda.cu @@ -317,7 +317,7 @@ int check_ans(sunrealtype ans, N_Vector plusX, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector plusX) +sunbooleantype has_data(N_Vector plusX) { N_Vector X = N_VGetLocalVector_MPIPlusX(plusX); /* check if vector data is non-null */ diff --git a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c index 9e737e9052..cb5c3f7ab9 100644 --- a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c +++ b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel1.c @@ -352,7 +352,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* should not be called in these tests */ return SUNTRUE; diff --git a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c index fb843c7b6f..a89beffeba 100644 --- a/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c +++ b/examples/nvector/mpimanyvector/test_nvector_mpimanyvector_parallel2.c @@ -371,7 +371,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* should not be called in these tests */ return SUNTRUE; diff --git a/examples/nvector/mpiplusx/test_nvector_mpiplusx.c b/examples/nvector/mpiplusx/test_nvector_mpiplusx.c index 63c0b39ee5..663b9055f9 100644 --- a/examples/nvector/mpiplusx/test_nvector_mpiplusx.c +++ b/examples/nvector/mpiplusx/test_nvector_mpiplusx.c @@ -314,7 +314,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* should not be called in these tests */ return SUNTRUE; diff --git a/examples/nvector/mpiraja/test_nvector_mpiraja.cpp b/examples/nvector/mpiraja/test_nvector_mpiraja.cpp index fbfd4d7094..019d2a4fdc 100644 --- a/examples/nvector/mpiraja/test_nvector_mpiraja.cpp +++ b/examples/nvector/mpiraja/test_nvector_mpiraja.cpp @@ -333,7 +333,7 @@ int check_ans(sunrealtype ans, N_Vector plusX, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector plusX) +sunbooleantype has_data(N_Vector plusX) { N_Vector X = N_VGetLocalVector_MPIPlusX(plusX); /* check if vector data is non-null */ diff --git a/examples/nvector/openmpdev/test_nvector_openmpdev.c b/examples/nvector/openmpdev/test_nvector_openmpdev.c index ee9f2834ee..0cd54ea2fb 100644 --- a/examples/nvector/openmpdev/test_nvector_openmpdev.c +++ b/examples/nvector/openmpdev/test_nvector_openmpdev.c @@ -322,7 +322,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { sunrealtype *Xdata = N_VGetHostArrayPointer_OpenMPDEV(X); if (Xdata == NULL) diff --git a/examples/nvector/parallel/test_nvector_mpi.c b/examples/nvector/parallel/test_nvector_mpi.c index c7a9dc4a88..5cd0fb786c 100644 --- a/examples/nvector/parallel/test_nvector_mpi.c +++ b/examples/nvector/parallel/test_nvector_mpi.c @@ -275,7 +275,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if data array is non-null */ return (N_VGetArrayPointer(X) == NULL) ? SUNFALSE : SUNTRUE; diff --git a/examples/nvector/parhyp/test_nvector_parhyp.c b/examples/nvector/parhyp/test_nvector_parhyp.c index f6064a6c5e..5a902552af 100644 --- a/examples/nvector/parhyp/test_nvector_parhyp.c +++ b/examples/nvector/parhyp/test_nvector_parhyp.c @@ -294,7 +294,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if wrapped hypre ParVector is non-null */ return (N_VGetVector_ParHyp(X) == NULL) ? SUNFALSE : SUNTRUE; diff --git a/examples/nvector/petsc/test_nvector_petsc.c b/examples/nvector/petsc/test_nvector_petsc.c index c58a9b6637..ba6fc134ad 100644 --- a/examples/nvector/petsc/test_nvector_petsc.c +++ b/examples/nvector/petsc/test_nvector_petsc.c @@ -292,7 +292,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if wrapped PETSc vector is non-null */ return (N_VGetVector_Petsc(X) == NULL) ? SUNFALSE : SUNTRUE; diff --git a/examples/nvector/pthreads/test_nvector_pthreads.c b/examples/nvector/pthreads/test_nvector_pthreads.c index 3352bdec53..ac3803f739 100644 --- a/examples/nvector/pthreads/test_nvector_pthreads.c +++ b/examples/nvector/pthreads/test_nvector_pthreads.c @@ -257,7 +257,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if data array is non-null */ return (N_VGetArrayPointer(X) == NULL) ? SUNFALSE : SUNTRUE; diff --git a/examples/nvector/raja/test_nvector_raja.cpp b/examples/nvector/raja/test_nvector_raja.cpp index 94ce80cbc7..0228e84ed3 100644 --- a/examples/nvector/raja/test_nvector_raja.cpp +++ b/examples/nvector/raja/test_nvector_raja.cpp @@ -307,7 +307,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if vector data is non-null */ if ((N_VGetHostArrayPointer_Raja(X) == NULL) && diff --git a/examples/nvector/serial/test_nvector_serial.c b/examples/nvector/serial/test_nvector_serial.c index b00984d4db..15b6ed9a06 100644 --- a/examples/nvector/serial/test_nvector_serial.c +++ b/examples/nvector/serial/test_nvector_serial.c @@ -257,7 +257,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if data array is non-null */ return (N_VGetArrayPointer(X) == NULL) ? SUNFALSE : SUNTRUE; diff --git a/examples/nvector/sycl/test_nvector_sycl.cpp b/examples/nvector/sycl/test_nvector_sycl.cpp index bfe910a81c..523e144ccc 100644 --- a/examples/nvector/sycl/test_nvector_sycl.cpp +++ b/examples/nvector/sycl/test_nvector_sycl.cpp @@ -425,7 +425,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype length) return (failure > ZERO) ? (1) : (0); } -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { /* check if vector data is non-null */ if ((N_VGetHostArrayPointer_Sycl(X) == NULL) && diff --git a/examples/nvector/test_nvector.c b/examples/nvector/test_nvector.c index 55bc523fb0..0bf7910dcd 100644 --- a/examples/nvector/test_nvector.c +++ b/examples/nvector/test_nvector.c @@ -1809,7 +1809,7 @@ int Test_N_VInvTest(N_Vector X, N_Vector Z, sunindextype local_length, int myid) int fails = 0, failure = 0; double start_time, stop_time, maxt; sunindextype i; - booleantype ans, exp; + sunbooleantype ans, exp; if (local_length < 2) { printf("Error Test_N_VInvTest: Local vector length is %ld, length must be >= 2\n", @@ -1905,7 +1905,7 @@ int Test_N_VConstrMask(N_Vector C, N_Vector X, N_Vector M, int fails = 0, failure = 0; double start_time, stop_time, maxt; sunindextype i; - booleantype test; + sunbooleantype test; if (local_length < 7) { printf("Error Test_N_VConstrMask: Local vector length is %ld, length must be >= 7\n", @@ -5058,7 +5058,7 @@ int Test_N_VInvTestLocal(N_Vector X, N_Vector Z, sunindextype local_length, int double start_time, stop_time, maxt; sunrealtype xval; sunindextype i; - booleantype test; + sunbooleantype test; if (local_length < 2) { printf("Error Test_N_VInvTestLocal: Local vector length is %ld, length must be >= 2\n", @@ -5150,7 +5150,7 @@ int Test_N_VConstrMaskLocal(N_Vector C, N_Vector X, N_Vector M, int fails = 0, failure = 0; double start_time, stop_time, maxt; sunindextype i; - booleantype test; + sunbooleantype test; if (local_length < 7) { printf("Error Test_N_VConstrMaskLocal: Local vector length is %ld, length must be >= 7\n", diff --git a/examples/nvector/test_nvector.h b/examples/nvector/test_nvector.h index 9d55bfcae8..910f7719ce 100644 --- a/examples/nvector/test_nvector.h +++ b/examples/nvector/test_nvector.h @@ -35,7 +35,7 @@ extern SUNContext sunctx; /* Forward declarations for implementation specific utility functions */ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length); -booleantype has_data(N_Vector X); +sunbooleantype has_data(N_Vector X); void set_element(N_Vector X, sunindextype i, sunrealtype val); void set_element_range(N_Vector X, sunindextype is, sunindextype ie, sunrealtype val); diff --git a/examples/nvector/trilinos/test_nvector_trilinos.cpp b/examples/nvector/trilinos/test_nvector_trilinos.cpp index f280caa5df..b0c1273146 100644 --- a/examples/nvector/trilinos/test_nvector_trilinos.cpp +++ b/examples/nvector/trilinos/test_nvector_trilinos.cpp @@ -240,7 +240,7 @@ int check_ans(sunrealtype ans, N_Vector X, sunindextype local_length) /* * Checks if there is a Tpetra vector */ -booleantype has_data(N_Vector X) +sunbooleantype has_data(N_Vector X) { if (X->content == NULL) return SUNFALSE; diff --git a/examples/sunlinsol/test_sunlinsol.c b/examples/sunlinsol/test_sunlinsol.c index 616d8a4467..8fadff2c49 100644 --- a/examples/sunlinsol/test_sunlinsol.c +++ b/examples/sunlinsol/test_sunlinsol.c @@ -421,7 +421,7 @@ int Test_SUNLinSolSetup(SUNLinearSolver S, SUNMatrix A, int myid) * 'setup' by the Test_SUNLinSolSetup() function prior to this call. * --------------------------------------------------------------------*/ int Test_SUNLinSolSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol, booleantype zeroguess, + N_Vector b, sunrealtype tol, sunbooleantype zeroguess, int myid) { int failure; diff --git a/examples/sunlinsol/test_sunlinsol.h b/examples/sunlinsol/test_sunlinsol.h index 33ac59273a..c653a39c4d 100644 --- a/examples/sunlinsol/test_sunlinsol.h +++ b/examples/sunlinsol/test_sunlinsol.h @@ -44,7 +44,7 @@ int Test_SUNLinSolSetScalingVectors(SUNLinearSolver S, N_Vector s1, N_Vector s2, int Test_SUNLinSolSetZeroGuess(SUNLinearSolver S, int myid); int Test_SUNLinSolInitialize(SUNLinearSolver S, int myid); int Test_SUNLinSolSetup(SUNLinearSolver S, SUNMatrix A, int myid); -int Test_SUNLinSolSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol, booleantype zeroguess, +int Test_SUNLinSolSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol, sunbooleantype zeroguess, int myid); /* Timing function */ diff --git a/examples/sunmatrix/band/test_sunmatrix_band.c b/examples/sunmatrix/band/test_sunmatrix_band.c index 67edf8da71..73aecb80f9 100644 --- a/examples/sunmatrix/band/test_sunmatrix_band.c +++ b/examples/sunmatrix/band/test_sunmatrix_band.c @@ -266,7 +266,7 @@ int check_vector(N_Vector X, N_Vector Y, sunrealtype tol) return(0); } -booleantype has_data(SUNMatrix A) +sunbooleantype has_data(SUNMatrix A) { sunrealtype *Adata = SUNBandMatrix_Data(A); if (Adata == NULL) @@ -275,7 +275,7 @@ booleantype has_data(SUNMatrix A) return SUNTRUE; } -booleantype is_square(SUNMatrix A) +sunbooleantype is_square(SUNMatrix A) { return SUNTRUE; } diff --git a/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu b/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu index c7464633be..e1737a7702 100644 --- a/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu +++ b/examples/sunmatrix/cusparse/test_sunmatrix_cusparse.cu @@ -674,7 +674,7 @@ int Test_SetKernelExecPolicy(SUNMatrix I, int myid) return(0); } - booleantype has_data(SUNMatrix A) + sunbooleantype has_data(SUNMatrix A) { sunrealtype *Adata = SUNMatrix_cuSparse_Data(A); if (Adata == NULL) @@ -683,7 +683,7 @@ int Test_SetKernelExecPolicy(SUNMatrix I, int myid) return SUNTRUE; } - booleantype is_square(SUNMatrix A) + sunbooleantype is_square(SUNMatrix A) { if (SUNMatrix_cuSparse_Rows(A) == SUNMatrix_cuSparse_Columns(A)) return SUNTRUE; diff --git a/examples/sunmatrix/dense/test_sunmatrix_dense.c b/examples/sunmatrix/dense/test_sunmatrix_dense.c index c32c120f44..81f8aa260a 100644 --- a/examples/sunmatrix/dense/test_sunmatrix_dense.c +++ b/examples/sunmatrix/dense/test_sunmatrix_dense.c @@ -265,7 +265,7 @@ int check_vector(N_Vector x, N_Vector y, sunrealtype tol) return(0); } -booleantype has_data(SUNMatrix A) +sunbooleantype has_data(SUNMatrix A) { sunrealtype *Adata = SUNDenseMatrix_Data(A); if (Adata == NULL) @@ -274,7 +274,7 @@ booleantype has_data(SUNMatrix A) return SUNTRUE; } -booleantype is_square(SUNMatrix A) +sunbooleantype is_square(SUNMatrix A) { if (SUNDenseMatrix_Rows(A) == SUNDenseMatrix_Columns(A)) return SUNTRUE; diff --git a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp index c870c92fb9..ae054e153c 100644 --- a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp +++ b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp @@ -407,7 +407,7 @@ extern "C" int check_vector(N_Vector expected, N_Vector computed, sunrealtype to return failure > 0; } -extern "C" booleantype has_data(SUNMatrix A) +extern "C" sunbooleantype has_data(SUNMatrix A) { if (using_csr_matrix_type) { auto Amat{static_cast*>(A->content)->GkoMtx()}; @@ -422,7 +422,7 @@ extern "C" booleantype has_data(SUNMatrix A) } } -extern "C" booleantype is_square(SUNMatrix A) +extern "C" sunbooleantype is_square(SUNMatrix A) { if (using_csr_matrix_type) { auto Amat{static_cast*>(A->content)->GkoMtx()}; diff --git a/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp b/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp index 4ac7c5122d..5c37de3981 100644 --- a/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp +++ b/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp @@ -265,9 +265,9 @@ extern "C" int check_vector(N_Vector actual, N_Vector expected, sunrealtype tol) else return 0; } -extern "C" booleantype has_data(SUNMatrix A) { return SUNTRUE; } +extern "C" sunbooleantype has_data(SUNMatrix A) { return SUNTRUE; } -extern "C" booleantype is_square(SUNMatrix A) +extern "C" sunbooleantype is_square(SUNMatrix A) { auto A_mat{sundials::kokkos::GetDenseMat(A)}; diff --git a/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp b/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp index fa007d2a1e..2d07eb611a 100644 --- a/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp +++ b/examples/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp @@ -299,7 +299,7 @@ int check_vector(N_Vector actual, N_Vector expected, sunrealtype tol) return(0); } -booleantype has_data(SUNMatrix A) +sunbooleantype has_data(SUNMatrix A) { sunrealtype *Adata = SUNMatrix_MagmaDense_Data(A); if (Adata == NULL) @@ -308,7 +308,7 @@ booleantype has_data(SUNMatrix A) return SUNTRUE; } -booleantype is_square(SUNMatrix A) +sunbooleantype is_square(SUNMatrix A) { if (SUNMatrix_MagmaDense_Rows(A) == SUNMatrix_MagmaDense_Columns(A)) return SUNTRUE; diff --git a/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp b/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp index 51ea7d61a1..3e074aebe8 100644 --- a/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp +++ b/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp @@ -401,7 +401,7 @@ int check_vector(N_Vector actual, N_Vector expected, sunrealtype tol) } -booleantype has_data(SUNMatrix A) +sunbooleantype has_data(SUNMatrix A) { sunrealtype *Adata = SUNMatrix_OneMklDense_Data(A); if (Adata == NULL) @@ -411,7 +411,7 @@ booleantype has_data(SUNMatrix A) } -booleantype is_square(SUNMatrix A) +sunbooleantype is_square(SUNMatrix A) { if (SUNMatrix_OneMklDense_Rows(A) == SUNMatrix_OneMklDense_Columns(A)) return SUNTRUE; diff --git a/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp b/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp index a323c93a9c..2de558b9b4 100644 --- a/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp +++ b/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp @@ -517,7 +517,7 @@ int check_vector(N_Vector x, N_Vector y, sunrealtype tol) return(0); } -booleantype has_data(SUNMatrix A) +sunbooleantype has_data(SUNMatrix A) { SuperMatrix *Asuper; NRformat_loc *Astore; @@ -534,7 +534,7 @@ booleantype has_data(SUNMatrix A) return SUNTRUE; } -booleantype is_square(SUNMatrix A) +sunbooleantype is_square(SUNMatrix A) { SuperMatrix *Asuper = SUNMatrix_SLUNRloc_SuperMatrix(A); if (Asuper->nrow == Asuper->ncol) diff --git a/examples/sunmatrix/sparse/test_sunmatrix_sparse.c b/examples/sunmatrix/sparse/test_sunmatrix_sparse.c index 03d3a0f892..68d329f2b7 100644 --- a/examples/sunmatrix/sparse/test_sunmatrix_sparse.c +++ b/examples/sunmatrix/sparse/test_sunmatrix_sparse.c @@ -943,7 +943,7 @@ int check_vector(N_Vector x, N_Vector y, sunrealtype tol) return(0); } -booleantype has_data(SUNMatrix A) +sunbooleantype has_data(SUNMatrix A) { sunrealtype *Adata = SUNSparseMatrix_Data(A); if (Adata == NULL) @@ -952,7 +952,7 @@ booleantype has_data(SUNMatrix A) return SUNTRUE; } -booleantype is_square(SUNMatrix A) +sunbooleantype is_square(SUNMatrix A) { if (SUNSparseMatrix_Rows(A) == SUNSparseMatrix_Columns(A)) return SUNTRUE; diff --git a/examples/sunmatrix/test_sunmatrix.h b/examples/sunmatrix/test_sunmatrix.h index 99ea6cc707..8ad9dd4686 100644 --- a/examples/sunmatrix/test_sunmatrix.h +++ b/examples/sunmatrix/test_sunmatrix.h @@ -60,8 +60,8 @@ extern "C" { int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol); int check_matrix_entry(SUNMatrix A, sunrealtype val, sunrealtype tol); int check_vector(N_Vector expected, N_Vector computed, sunrealtype tol); - booleantype has_data(SUNMatrix A); - booleantype is_square(SUNMatrix A); + sunbooleantype has_data(SUNMatrix A); + sunbooleantype is_square(SUNMatrix A); void sync_device(SUNMatrix A); /* Test function declarations */ diff --git a/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c b/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c index 5ee983de89..0c752aec63 100644 --- a/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c +++ b/examples/sunnonlinsol/newton/test_sunnonlinsol_newton.c @@ -76,7 +76,7 @@ typedef struct IntegratorMemRec { } *IntegratorMem; /* Linear solver setup interface function */ -static int LSetup(booleantype jbad, booleantype* jcur, void* mem); +static int LSetup(sunbooleantype jbad, sunbooleantype* jcur, void* mem); /* Linear solver solve interface function */ static int LSolve(N_Vector b, void* mem); @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) /* Proxy for integrator lsetup function */ -int LSetup(booleantype jbad, booleantype* jcur, void* mem) +int LSetup(sunbooleantype jbad, sunbooleantype* jcur, void* mem) { int retval; IntegratorMem Imem; diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index cddbf122d1..f3d51edb54 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -104,7 +104,7 @@ SUNDIALS_EXPORT int ARKStepSetLinearSolver(void *arkode_mem, SUNDIALS_EXPORT int ARKStepSetMassLinearSolver(void *arkode_mem, SUNLinearSolver LS, SUNMatrix M, - booleantype time_dep); + sunbooleantype time_dep); /* Rootfinding initialization */ SUNDIALS_EXPORT int ARKStepRootInit(void *arkode_mem, int nrtfn, @@ -194,7 +194,7 @@ SUNDIALS_EXPORT int ARKStepSetMinStep(void *arkode_mem, SUNDIALS_EXPORT int ARKStepSetMaxStep(void *arkode_mem, sunrealtype hmax); SUNDIALS_EXPORT int ARKStepSetInterpolateStopTime(void *arkode_mem, - booleantype interp); + sunbooleantype interp); SUNDIALS_EXPORT int ARKStepSetStopTime(void *arkode_mem, sunrealtype tstop); SUNDIALS_EXPORT int ARKStepClearStopTime(void *arkode_mem); @@ -229,7 +229,7 @@ SUNDIALS_EXPORT int ARKStepSetMassFn(void *arkode_mem, ARKLsMassFn mass); SUNDIALS_EXPORT int ARKStepSetJacEvalFrequency(void *arkode_mem, long int msbj); SUNDIALS_EXPORT int ARKStepSetLinearSolutionScaling(void *arkode_mem, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int ARKStepSetEpsLin(void *arkode_mem, sunrealtype eplifac); SUNDIALS_EXPORT int ARKStepSetMassEpsLin(void *arkode_mem, sunrealtype eplifac); SUNDIALS_EXPORT int ARKStepSetLSNormFactor(void *arkode_mem, diff --git a/include/arkode/arkode_butcher.h b/include/arkode/arkode_butcher.h index 82683d7a97..01f1528f6b 100644 --- a/include/arkode/arkode_butcher.h +++ b/include/arkode/arkode_butcher.h @@ -46,7 +46,7 @@ typedef _SUNDIALS_STRUCT_ ARKodeButcherTableMem *ARKodeButcherTable; /* Utility routines to allocate/free/output Butcher table structures */ SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, - booleantype embedded); + sunbooleantype embedded); SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, sunrealtype *c, diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index f9fc3a9503..34f999b72c 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -124,7 +124,7 @@ SUNDIALS_EXPORT int ERKStepSetMinStep(void *arkode_mem, SUNDIALS_EXPORT int ERKStepSetMaxStep(void *arkode_mem, sunrealtype hmax); SUNDIALS_EXPORT int ERKStepSetInterpolateStopTime(void *arkode_mem, - booleantype interp); + sunbooleantype interp); SUNDIALS_EXPORT int ERKStepSetStopTime(void *arkode_mem, sunrealtype tstop); SUNDIALS_EXPORT int ERKStepClearStopTime(void *arkode_mem); diff --git a/include/arkode/arkode_ls.h b/include/arkode/arkode_ls.h index f3b000e213..aa6142a948 100644 --- a/include/arkode/arkode_ls.h +++ b/include/arkode/arkode_ls.h @@ -59,8 +59,8 @@ typedef int (*ARKLsMassFn)(sunrealtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); typedef int (*ARKLsPrecSetupFn)(sunrealtype t, N_Vector y, - N_Vector fy, booleantype jok, - booleantype *jcurPtr, + N_Vector fy, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); typedef int (*ARKLsPrecSolveFn)(sunrealtype t, N_Vector y, @@ -78,7 +78,7 @@ typedef int (*ARKLsJacTimesVecFn)(N_Vector v, N_Vector Jv, N_Vector tmp); typedef int (*ARKLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - SUNMatrix M, booleantype jok, booleantype *jcur, + SUNMatrix M, sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index 9297936df4..cb644f88e3 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -205,7 +205,7 @@ SUNDIALS_EXPORT int MRIStepSetMaxHnilWarns(void *arkode_mem, SUNDIALS_EXPORT int MRIStepSetStopTime(void *arkode_mem, sunrealtype tstop); SUNDIALS_EXPORT int MRIStepSetInterpolateStopTime(void *arkode_mem, - booleantype interp); + sunbooleantype interp); SUNDIALS_EXPORT int MRIStepClearStopTime(void *arkode_mem); SUNDIALS_EXPORT int MRIStepSetFixedStep(void *arkode_mem, sunrealtype hsfixed); @@ -238,7 +238,7 @@ SUNDIALS_EXPORT int MRIStepSetJacFn(void *arkode_mem, ARKLsJacFn jac); SUNDIALS_EXPORT int MRIStepSetJacEvalFrequency(void *arkode_mem, long int msbj); SUNDIALS_EXPORT int MRIStepSetLinearSolutionScaling(void *arkode_mem, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int MRIStepSetEpsLin(void *arkode_mem, sunrealtype eplifac); SUNDIALS_EXPORT int MRIStepSetLSNormFactor(void *arkode_mem, sunrealtype nrmfac); diff --git a/include/cvode/cvode.h b/include/cvode/cvode.h index 0ec9df30a9..f68544dc48 100644 --- a/include/cvode/cvode.h +++ b/include/cvode/cvode.h @@ -145,11 +145,11 @@ SUNDIALS_EXPORT int CVodeSetMonitorFrequency(void *cvode_mem, long int nst); SUNDIALS_EXPORT int CVodeSetNlsRhsFn(void *cvode_mem, CVRhsFn f); SUNDIALS_EXPORT int CVodeSetNonlinConvCoef(void *cvode_mem, sunrealtype nlscoef); SUNDIALS_EXPORT int CVodeSetNonlinearSolver(void *cvode_mem, SUNNonlinearSolver NLS); -SUNDIALS_EXPORT int CVodeSetStabLimDet(void *cvode_mem, booleantype stldet); +SUNDIALS_EXPORT int CVodeSetStabLimDet(void *cvode_mem, sunbooleantype stldet); SUNDIALS_EXPORT int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop); -SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void *cvode_mem, booleantype interp); +SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void *cvode_mem, sunbooleantype interp); SUNDIALS_EXPORT int CVodeClearStopTime(void *cvode_mem); -SUNDIALS_EXPORT int CVodeSetUseIntegratorFusedKernels(void *cvode_mem, booleantype onoff); +SUNDIALS_EXPORT int CVodeSetUseIntegratorFusedKernels(void *cvode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int CVodeSetUserData(void *cvode_mem, void *user_data); /* Optional step adaptivity input functions */ diff --git a/include/cvode/cvode_hypamgpre.h b/include/cvode/cvode_hypamgpre.h index 78ac09f18a..e589054dde 100644 --- a/include/cvode/cvode_hypamgpre.h +++ b/include/cvode/cvode_hypamgpre.h @@ -209,7 +209,7 @@ SUNDIALS_EXPORT int CVBoomerAMGInit(void *cvode_mem, int ilower, int iupper, int /* SUNDIALS_EXPORT int CVBoomerAMGSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bbd_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); diff --git a/include/cvode/cvode_ls.h b/include/cvode/cvode_ls.h index 2d8765273c..bccadbd300 100644 --- a/include/cvode/cvode_ls.h +++ b/include/cvode/cvode_ls.h @@ -55,7 +55,7 @@ typedef int (*CVLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); typedef int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); typedef int (*CVLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, @@ -70,7 +70,7 @@ typedef int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, sunrealtype t, void *user_data, N_Vector tmp); typedef int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -91,7 +91,7 @@ SUNDIALS_EXPORT int CVodeSetJacFn(void *cvode_mem, CVLsJacFn jac); SUNDIALS_EXPORT int CVodeSetJacEvalFrequency(void *cvode_mem, long int msbj); SUNDIALS_EXPORT int CVodeSetLinearSolutionScaling(void *cvode_mem, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, sunrealtype dgmax_jbad); SUNDIALS_EXPORT int CVodeSetEpsLin(void *cvode_mem, sunrealtype eplifac); diff --git a/include/cvode/cvode_proj.h b/include/cvode/cvode_proj.h index eca1771537..53ec224910 100644 --- a/include/cvode/cvode_proj.h +++ b/include/cvode/cvode_proj.h @@ -41,7 +41,7 @@ typedef int (*CVProjFn)(sunrealtype t, N_Vector ycur, N_Vector corr, SUNDIALS_EXPORT int CVodeSetProjFn(void *cvode_mem, CVProjFn pfun); /* Optional input functions */ -SUNDIALS_EXPORT int CVodeSetProjErrEst(void *cvode_mem, booleantype onoff); +SUNDIALS_EXPORT int CVodeSetProjErrEst(void *cvode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int CVodeSetProjFrequency(void *cvode_mem, long int proj_freq); SUNDIALS_EXPORT int CVodeSetMaxNumProjFails(void *cvode_mem, int max_fails); SUNDIALS_EXPORT int CVodeSetEpsProj(void *cvode_mem, sunrealtype eps); diff --git a/include/cvodes/cvodes.h b/include/cvodes/cvodes.h index 0157fca601..06b0169160 100644 --- a/include/cvodes/cvodes.h +++ b/include/cvodes/cvodes.h @@ -220,9 +220,9 @@ SUNDIALS_EXPORT int CVodeSetMonitorFrequency(void *cvode_mem, long int nst); SUNDIALS_EXPORT int CVodeSetNlsRhsFn(void *cvode_mem, CVRhsFn f); SUNDIALS_EXPORT int CVodeSetNonlinConvCoef(void *cvode_mem, sunrealtype nlscoef); SUNDIALS_EXPORT int CVodeSetNonlinearSolver(void *cvode_mem, SUNNonlinearSolver NLS); -SUNDIALS_EXPORT int CVodeSetStabLimDet(void *cvode_mem, booleantype stldet); +SUNDIALS_EXPORT int CVodeSetStabLimDet(void *cvode_mem, sunbooleantype stldet); SUNDIALS_EXPORT int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop); -SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void *cvode_mem, booleantype interp); +SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void *cvode_mem, sunbooleantype interp); SUNDIALS_EXPORT int CVodeClearStopTime(void *cvode_mem); SUNDIALS_EXPORT int CVodeSetUserData(void *cvode_mem, void *user_data); @@ -355,7 +355,7 @@ SUNDIALS_EXPORT int CVodeQuadSVtolerances(void *cvode_mem, sunrealtype reltolQ, N_Vector abstolQ); /* Optional input specification functions */ -SUNDIALS_EXPORT int CVodeSetQuadErrCon(void *cvode_mem, booleantype errconQ); +SUNDIALS_EXPORT int CVodeSetQuadErrCon(void *cvode_mem, sunbooleantype errconQ); /* Extraction and Dense Output Functions for Forward Problems */ SUNDIALS_EXPORT int CVodeGetQuad(void *cvode_mem, sunrealtype *tret, @@ -397,7 +397,7 @@ SUNDIALS_EXPORT int CVodeSensEEtolerances(void *cvode_mem); /* Optional input specification functions */ SUNDIALS_EXPORT int CVodeSetSensDQMethod(void *cvode_mem, int DQtype, sunrealtype DQrhomax); -SUNDIALS_EXPORT int CVodeSetSensErrCon(void *cvode_mem, booleantype errconS); +SUNDIALS_EXPORT int CVodeSetSensErrCon(void *cvode_mem, sunbooleantype errconS); SUNDIALS_EXPORT int CVodeSetSensMaxNonlinIters(void *cvode_mem, int maxcorS); SUNDIALS_EXPORT int CVodeSetSensParams(void *cvode_mem, sunrealtype *p, sunrealtype *pbar, int *plist); @@ -480,7 +480,7 @@ SUNDIALS_EXPORT int CVodeQuadSensEEtolerances(void *cvode_mem); /* Optional input specification functions */ SUNDIALS_EXPORT int CVodeSetQuadSensErrCon(void *cvode_mem, - booleantype errconQS); + sunbooleantype errconQS); /* Extraction and dense output functions */ SUNDIALS_EXPORT int CVodeGetQuadSens(void *cvode_mem, sunrealtype *tret, @@ -571,7 +571,7 @@ SUNDIALS_EXPORT int CVodeSetMaxOrdB(void *cvode_mem, int which, int maxordB); SUNDIALS_EXPORT int CVodeSetMaxNumStepsB(void *cvode_mem, int which, long int mxstepsB); SUNDIALS_EXPORT int CVodeSetStabLimDetB(void *cvode_mem, int which, - booleantype stldetB); + sunbooleantype stldetB); SUNDIALS_EXPORT int CVodeSetInitStepB(void *cvode_mem, int which, sunrealtype hinB); SUNDIALS_EXPORT int CVodeSetMinStepB(void *cvode_mem, int which, @@ -581,7 +581,7 @@ SUNDIALS_EXPORT int CVodeSetMaxStepB(void *cvode_mem, int which, SUNDIALS_EXPORT int CVodeSetConstraintsB(void *cvode_mem, int which, N_Vector constraintsB); SUNDIALS_EXPORT int CVodeSetQuadErrConB(void *cvode_mem, int which, - booleantype errconQB); + sunbooleantype errconQB); SUNDIALS_EXPORT int CVodeSetNonlinearSolverB(void *cvode_mem, int which, SUNNonlinearSolver NLS); diff --git a/include/cvodes/cvodes_ls.h b/include/cvodes/cvodes_ls.h index 3ebbcf0425..302fdbc77d 100644 --- a/include/cvodes/cvodes_ls.h +++ b/include/cvodes/cvodes_ls.h @@ -63,7 +63,7 @@ typedef int (*CVLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); typedef int (*CVLsPrecSetupFn)(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); typedef int (*CVLsPrecSolveFn)(sunrealtype t, N_Vector y, N_Vector fy, @@ -78,7 +78,7 @@ typedef int (*CVLsJacTimesVecFn)(N_Vector v, N_Vector Jv, sunrealtype t, void *user_data, N_Vector tmp); typedef int (*CVLsLinSysFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -99,7 +99,7 @@ SUNDIALS_EXPORT int CVodeSetJacFn(void *cvode_mem, CVLsJacFn jac); SUNDIALS_EXPORT int CVodeSetJacEvalFrequency(void *cvode_mem, long int msbj); SUNDIALS_EXPORT int CVodeSetLinearSolutionScaling(void *cvode_mem, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int CVodeSetDeltaGammaMaxBadJac(void *cvode_mem, sunrealtype dgmax_jbad); SUNDIALS_EXPORT int CVodeSetEpsLin(void *cvode_mem, sunrealtype eplifac); @@ -167,14 +167,14 @@ typedef int (*CVLsJacFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector tmp2B, N_Vector tmp3B); typedef int (*CVLsPrecSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, - N_Vector fyB, booleantype jokB, - booleantype *jcurPtrB, + N_Vector fyB, sunbooleantype jokB, + sunbooleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB); typedef int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, - N_Vector fyB, booleantype jokB, - booleantype *jcurPtrB, + N_Vector fyB, sunbooleantype jokB, + sunbooleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB); typedef int (*CVLsPrecSolveFnB)(sunrealtype t, N_Vector y, N_Vector yB, @@ -206,13 +206,13 @@ typedef int (*CVLsJacTimesVecFnBS)(N_Vector vB, N_Vector JvB, void *jac_dataB, N_Vector tmpB); typedef int (*CVLsLinSysFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, - SUNMatrix AB, booleantype jokB, booleantype *jcurB, + SUNMatrix AB, sunbooleantype jokB, sunbooleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); typedef int (*CVLsLinSysFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, N_Vector yB, N_Vector fyB, SUNMatrix AB, - booleantype jokB, booleantype *jcurB, + sunbooleantype jokB, sunbooleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); @@ -244,7 +244,7 @@ SUNDIALS_EXPORT int CVodeSetLSNormFactorB(void *arkode_mem, int which, sunrealtype nrmfacB); SUNDIALS_EXPORT int CVodeSetLinearSolutionScalingB(void *cvode_mem, int which, - booleantype onoffB); + sunbooleantype onoffB); SUNDIALS_EXPORT int CVodeSetPreconditionerB(void *cvode_mem, int which, CVLsPrecSetupFnB psetB, diff --git a/include/cvodes/cvodes_proj.h b/include/cvodes/cvodes_proj.h index eca1771537..53ec224910 100644 --- a/include/cvodes/cvodes_proj.h +++ b/include/cvodes/cvodes_proj.h @@ -41,7 +41,7 @@ typedef int (*CVProjFn)(sunrealtype t, N_Vector ycur, N_Vector corr, SUNDIALS_EXPORT int CVodeSetProjFn(void *cvode_mem, CVProjFn pfun); /* Optional input functions */ -SUNDIALS_EXPORT int CVodeSetProjErrEst(void *cvode_mem, booleantype onoff); +SUNDIALS_EXPORT int CVodeSetProjErrEst(void *cvode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int CVodeSetProjFrequency(void *cvode_mem, long int proj_freq); SUNDIALS_EXPORT int CVodeSetMaxNumProjFails(void *cvode_mem, int max_fails); SUNDIALS_EXPORT int CVodeSetEpsProj(void *cvode_mem, sunrealtype eps); diff --git a/include/ida/ida.h b/include/ida/ida.h index 347c352daf..2be5ccb2fd 100644 --- a/include/ida/ida.h +++ b/include/ida/ida.h @@ -126,7 +126,7 @@ SUNDIALS_EXPORT int IDASetNonlinConvCoefIC(void *ida_mem, sunrealtype epiccon); SUNDIALS_EXPORT int IDASetMaxNumStepsIC(void *ida_mem, int maxnh); SUNDIALS_EXPORT int IDASetMaxNumJacsIC(void *ida_mem, int maxnj); SUNDIALS_EXPORT int IDASetMaxNumItersIC(void *ida_mem, int maxnit); -SUNDIALS_EXPORT int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff); +SUNDIALS_EXPORT int IDASetLineSearchOffIC(void *ida_mem, sunbooleantype lsoff); SUNDIALS_EXPORT int IDASetStepToleranceIC(void *ida_mem, sunrealtype steptol); SUNDIALS_EXPORT int IDASetMaxBacksIC(void *ida_mem, int maxbacks); @@ -144,7 +144,7 @@ SUNDIALS_EXPORT int IDASetMinStep(void *ida_mem, sunrealtype hmin); SUNDIALS_EXPORT int IDASetStopTime(void *ida_mem, sunrealtype tstop); SUNDIALS_EXPORT int IDAClearStopTime(void *ida_mem); SUNDIALS_EXPORT int IDASetMaxErrTestFails(void *ida_mem, int maxnef); -SUNDIALS_EXPORT int IDASetSuppressAlg(void *ida_mem, booleantype suppressalg); +SUNDIALS_EXPORT int IDASetSuppressAlg(void *ida_mem, sunbooleantype suppressalg); SUNDIALS_EXPORT int IDASetId(void *ida_mem, N_Vector id); SUNDIALS_EXPORT int IDASetConstraints(void *ida_mem, N_Vector constraints); diff --git a/include/ida/ida_ls.h b/include/ida/ida_ls.h index dbbcc0ed5c..63a19bdc73 100644 --- a/include/ida/ida_ls.h +++ b/include/ida/ida_ls.h @@ -100,7 +100,7 @@ SUNDIALS_EXPORT int IDASetEpsLin(void *ida_mem, sunrealtype eplifac); SUNDIALS_EXPORT int IDASetLSNormFactor(void *ida_mem, sunrealtype nrmfac); SUNDIALS_EXPORT int IDASetLinearSolutionScaling(void *ida_mem, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int IDASetIncrementFactor(void *ida_mem, sunrealtype dqincfac); diff --git a/include/idas/idas.h b/include/idas/idas.h index b1cc894521..213ed22e89 100644 --- a/include/idas/idas.h +++ b/include/idas/idas.h @@ -200,7 +200,7 @@ SUNDIALS_EXPORT int IDASetNonlinConvCoefIC(void *ida_mem, sunrealtype epiccon); SUNDIALS_EXPORT int IDASetMaxNumStepsIC(void *ida_mem, int maxnh); SUNDIALS_EXPORT int IDASetMaxNumJacsIC(void *ida_mem, int maxnj); SUNDIALS_EXPORT int IDASetMaxNumItersIC(void *ida_mem, int maxnit); -SUNDIALS_EXPORT int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff); +SUNDIALS_EXPORT int IDASetLineSearchOffIC(void *ida_mem, sunbooleantype lsoff); SUNDIALS_EXPORT int IDASetStepToleranceIC(void *ida_mem, sunrealtype steptol); SUNDIALS_EXPORT int IDASetMaxBacksIC(void *ida_mem, int maxbacks); @@ -218,7 +218,7 @@ SUNDIALS_EXPORT int IDASetMinStep(void *ida_mem, sunrealtype hmin); SUNDIALS_EXPORT int IDASetStopTime(void *ida_mem, sunrealtype tstop); SUNDIALS_EXPORT int IDAClearStopTime(void *ida_mem); SUNDIALS_EXPORT int IDASetMaxErrTestFails(void *ida_mem, int maxnef); -SUNDIALS_EXPORT int IDASetSuppressAlg(void *ida_mem, booleantype suppressalg); +SUNDIALS_EXPORT int IDASetSuppressAlg(void *ida_mem, sunbooleantype suppressalg); SUNDIALS_EXPORT int IDASetId(void *ida_mem, N_Vector id); SUNDIALS_EXPORT int IDASetConstraints(void *ida_mem, N_Vector constraints); @@ -346,7 +346,7 @@ SUNDIALS_EXPORT int IDAQuadSVtolerances(void *ida_mem, sunrealtype reltolQ, N_Vector abstolQ); /* Optional input specification functions */ -SUNDIALS_EXPORT int IDASetQuadErrCon(void *ida_mem, booleantype errconQ); +SUNDIALS_EXPORT int IDASetQuadErrCon(void *ida_mem, sunbooleantype errconQ); /* Extraction and dense output functions */ SUNDIALS_EXPORT int IDAGetQuad(void *ida_mem, sunrealtype *t, N_Vector yQout); @@ -390,7 +390,7 @@ SUNDIALS_EXPORT int IDAGetSensConsistentIC(void *ida_mem, N_Vector *yyS0, /* Optional input specification functions */ SUNDIALS_EXPORT int IDASetSensDQMethod(void *ida_mem, int DQtype, sunrealtype DQrhomax); -SUNDIALS_EXPORT int IDASetSensErrCon(void *ida_mem, booleantype errconS); +SUNDIALS_EXPORT int IDASetSensErrCon(void *ida_mem, sunbooleantype errconS); SUNDIALS_EXPORT int IDASetSensMaxNonlinIters(void *ida_mem, int maxcorS); SUNDIALS_EXPORT int IDASetSensParams(void *ida_mem, sunrealtype *p, sunrealtype *pbar, int *plist); @@ -456,7 +456,7 @@ SUNDIALS_EXPORT int IDAQuadSensSVtolerances(void *ida_mem, sunrealtype reltolQS, SUNDIALS_EXPORT int IDAQuadSensEEtolerances(void *ida_mem); /* Optional input specification functions */ -SUNDIALS_EXPORT int IDASetQuadSensErrCon(void *ida_mem, booleantype errconQS); +SUNDIALS_EXPORT int IDASetQuadSensErrCon(void *ida_mem, sunbooleantype errconQS); /* Extraction and dense output functions */ SUNDIALS_EXPORT int IDAGetQuadSens(void *ida_mem, sunrealtype *tret, @@ -557,7 +557,7 @@ SUNDIALS_EXPORT int IDASetMaxNumStepsB(void *ida_mem, int which, SUNDIALS_EXPORT int IDASetInitStepB(void *ida_mem, int which, sunrealtype hinB); SUNDIALS_EXPORT int IDASetMaxStepB(void *ida_mem, int which, sunrealtype hmaxB); SUNDIALS_EXPORT int IDASetSuppressAlgB(void *ida_mem, int which, - booleantype suppressalgB); + sunbooleantype suppressalgB); SUNDIALS_EXPORT int IDASetIdB(void *ida_mem, int which, N_Vector idB); SUNDIALS_EXPORT int IDASetConstraintsB(void *ida_mem, int which, N_Vector constraintsB); diff --git a/include/idas/idas_ls.h b/include/idas/idas_ls.h index e1baf9d2a1..ab1b9fc323 100644 --- a/include/idas/idas_ls.h +++ b/include/idas/idas_ls.h @@ -107,7 +107,7 @@ SUNDIALS_EXPORT int IDASetEpsLin(void *ida_mem, sunrealtype eplifac); SUNDIALS_EXPORT int IDASetLSNormFactor(void *ida_mem, sunrealtype nrmfac); SUNDIALS_EXPORT int IDASetLinearSolutionScaling(void *ida_mem, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int IDASetIncrementFactor(void *ida_mem, sunrealtype dqincfac); @@ -243,7 +243,7 @@ SUNDIALS_EXPORT int IDASetEpsLinB(void *ida_mem, int which, SUNDIALS_EXPORT int IDASetLSNormFactorB(void *ida_mem, int which, sunrealtype nrmfacB); SUNDIALS_EXPORT int IDASetLinearSolutionScalingB(void *ida_mem, int which, - booleantype onoffB); + sunbooleantype onoffB); SUNDIALS_EXPORT int IDASetIncrementFactorB(void *ida_mem, int which, sunrealtype dqincfacB); SUNDIALS_EXPORT int IDASetPreconditionerB(void *ida_mem, int which, diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index d8a06709a1..94de380fe7 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -111,10 +111,10 @@ SUNDIALS_EXPORT int KINSetMAA(void *kinmem, long int maa); SUNDIALS_EXPORT int KINSetOrthAA(void *kinmem, int orthaa); SUNDIALS_EXPORT int KINSetDelayAA(void *kinmem, long int delay); SUNDIALS_EXPORT int KINSetDampingAA(void *kinmem, sunrealtype beta); -SUNDIALS_EXPORT int KINSetReturnNewest(void *kinmem, booleantype ret_newest); +SUNDIALS_EXPORT int KINSetReturnNewest(void *kinmem, sunbooleantype ret_newest); SUNDIALS_EXPORT int KINSetNumMaxIters(void *kinmem, long int mxiter); -SUNDIALS_EXPORT int KINSetNoInitSetup(void *kinmem, booleantype noInitSetup); -SUNDIALS_EXPORT int KINSetNoResMon(void *kinmem, booleantype noNNIResMon); +SUNDIALS_EXPORT int KINSetNoInitSetup(void *kinmem, sunbooleantype noInitSetup); +SUNDIALS_EXPORT int KINSetNoResMon(void *kinmem, sunbooleantype noNNIResMon); SUNDIALS_EXPORT int KINSetMaxSetupCalls(void *kinmem, long int msbset); SUNDIALS_EXPORT int KINSetMaxSubSetupCalls(void *kinmem, long int msbsetsub); SUNDIALS_EXPORT int KINSetEtaForm(void *kinmem, int etachoice); @@ -124,7 +124,7 @@ SUNDIALS_EXPORT int KINSetEtaParams(void *kinmem, sunrealtype egamma, SUNDIALS_EXPORT int KINSetResMonParams(void *kinmem, sunrealtype omegamin, sunrealtype omegamax); SUNDIALS_EXPORT int KINSetResMonConstValue(void *kinmem, sunrealtype omegaconst); -SUNDIALS_EXPORT int KINSetNoMinEps(void *kinmem, booleantype noMinEps); +SUNDIALS_EXPORT int KINSetNoMinEps(void *kinmem, sunbooleantype noMinEps); SUNDIALS_EXPORT int KINSetMaxNewtonStep(void *kinmem, sunrealtype mxnewtstep); SUNDIALS_EXPORT int KINSetMaxBetaFails(void *kinmem, long int mxnbcf); SUNDIALS_EXPORT int KINSetRelErrFunc(void *kinmem, sunrealtype relfunc); diff --git a/include/kinsol/kinsol_ls.h b/include/kinsol/kinsol_ls.h index fd3fb4331a..53554d4b4c 100644 --- a/include/kinsol/kinsol_ls.h +++ b/include/kinsol/kinsol_ls.h @@ -62,7 +62,7 @@ typedef int (*KINLsPrecSolveFn)(N_Vector uu, N_Vector uscale, N_Vector vv, void *user_data); typedef int (*KINLsJacTimesVecFn)(N_Vector v, N_Vector Jv, N_Vector uu, - booleantype *new_uu, void *J_data); + sunbooleantype *new_uu, void *J_data); /*================================================================== diff --git a/include/nvector/nvector_cuda.h b/include/nvector/nvector_cuda.h index a9bb88751c..24a298ebf9 100644 --- a/include/nvector/nvector_cuda.h +++ b/include/nvector/nvector_cuda.h @@ -39,7 +39,7 @@ extern "C" { struct _N_VectorContent_Cuda { sunindextype length; - booleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNCudaExecPolicy* stream_exec_policy; @@ -60,7 +60,7 @@ SUNDIALS_EXPORT N_Vector N_VNewEmpty_Cuda(SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNew_Cuda(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNewManaged_Cuda(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Cuda(sunindextype length, - booleantype use_managed_mem, + sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_Cuda(sunindextype length, @@ -72,7 +72,7 @@ SUNDIALS_EXPORT N_Vector N_VMakeManaged_Cuda(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v); SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v); -SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Cuda(N_Vector x); +SUNDIALS_EXPORT sunbooleantype N_VIsManagedMemory_Cuda(N_Vector x); SUNDIALS_EXPORT int N_VSetKernelExecPolicy_Cuda(N_Vector x, SUNCudaExecPolicy* stream_exec_policy, SUNCudaExecPolicy* reduce_exec_policy); @@ -134,8 +134,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Cuda(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Cuda(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Cuda(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Cuda(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Cuda(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Cuda(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Cuda(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Cuda(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Cuda(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -186,19 +186,19 @@ SUNDIALS_EXPORT void N_VPrintFile_Cuda(N_Vector v, FILE *outfile); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Cuda(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Cuda(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_Cuda(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_Cuda(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Cuda(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Cuda(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Cuda(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Cuda(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_hip.h b/include/nvector/nvector_hip.h index 1c2ade734a..04bca2e875 100644 --- a/include/nvector/nvector_hip.h +++ b/include/nvector/nvector_hip.h @@ -39,7 +39,7 @@ extern "C" { struct _N_VectorContent_Hip { sunindextype length; - booleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNHipExecPolicy* stream_exec_policy; @@ -60,7 +60,7 @@ SUNDIALS_EXPORT N_Vector N_VNewEmpty_Hip(SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNew_Hip(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNewManaged_Hip(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Hip(sunindextype length, - booleantype use_managed_mem, + sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_Hip(sunindextype length, @@ -72,7 +72,7 @@ SUNDIALS_EXPORT N_Vector N_VMakeManaged_Hip(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v); SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v); -SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Hip(N_Vector x); +SUNDIALS_EXPORT sunbooleantype N_VIsManagedMemory_Hip(N_Vector x); SUNDIALS_EXPORT int N_VSetKernelExecPolicy_Hip(N_Vector x, SUNHipExecPolicy* stream_exec_policy, SUNHipExecPolicy* reduce_exec_policy); @@ -134,8 +134,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Hip(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Hip(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Hip(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Hip(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Hip(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Hip(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Hip(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Hip(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Hip(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -186,19 +186,19 @@ SUNDIALS_EXPORT void N_VPrintFile_Hip(N_Vector v, FILE *outfile); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Hip(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Hip(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_Hip(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_Hip(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Hip(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Hip(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Hip(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Hip(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_kokkos.hpp b/include/nvector/nvector_kokkos.hpp index 269d15dcef..ae8976f09e 100644 --- a/include/nvector/nvector_kokkos.hpp +++ b/include/nvector/nvector_kokkos.hpp @@ -208,7 +208,7 @@ void N_VConst_Kokkos(sunrealtype c, N_Vector z) } template -booleantype N_VConstrMask_Kokkos(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Kokkos(N_Vector c, N_Vector x, N_Vector m) { auto cvec{GetVec(c)}; auto cdata{cvec->View()}; @@ -289,7 +289,7 @@ void N_VInv_Kokkos(N_Vector x, N_Vector z) } template -booleantype N_VInvTest_Kokkos(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Kokkos(N_Vector x, N_Vector z) { auto xvec{GetVec(x)}; auto xdata{xvec->View()}; diff --git a/include/nvector/nvector_manyvector.h b/include/nvector/nvector_manyvector.h index d207b2ec49..6a44921b57 100644 --- a/include/nvector/nvector_manyvector.h +++ b/include/nvector/nvector_manyvector.h @@ -23,7 +23,7 @@ * be found in the header file sundials_types.h, and it may be * changed (at the configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype'. + * for the type 'sunbooleantype'. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -52,7 +52,7 @@ struct _N_VectorContent_ManyVector { sunindextype num_subvectors; /* number of vectors attached */ sunindextype global_length; /* overall global manyvector length */ N_Vector* subvec_array; /* pointer to N_Vector array */ - booleantype own_data; /* flag indicating data ownership */ + sunbooleantype own_data; /* flag indicating data ownership */ }; typedef struct _N_VectorContent_ManyVector *N_VectorContent_ManyVector; @@ -139,8 +139,8 @@ SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_ManyVector(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_ManyVector(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_ManyVector(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT booleantype N_VInvTestLocal_ManyVector(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_ManyVector(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTestLocal_ManyVector(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal_ManyVector(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_ManyVector(N_Vector num, N_Vector denom); @@ -159,19 +159,19 @@ SUNDIALS_EXPORT int N_VBufUnpack_ManyVector(N_Vector x, void *buf); Enable / disable fused vector operations ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_ManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_ManyVector(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_ManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_ManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_ManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_ManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_ManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_ManyVector(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_ManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_ManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_ManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_ManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_ManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_ManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_ManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_ManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_ManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_ManyVector(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_ManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_ManyVector(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_mpimanyvector.h b/include/nvector/nvector_mpimanyvector.h index 21380156ee..bc975e03d7 100644 --- a/include/nvector/nvector_mpimanyvector.h +++ b/include/nvector/nvector_mpimanyvector.h @@ -23,7 +23,7 @@ * be found in the header file sundials_types.h, and it may be * changed (at the configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype'. + * for the type 'sunbooleantype'. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -55,7 +55,7 @@ struct _N_VectorContent_MPIManyVector { sunindextype num_subvectors; /* number of vectors attached */ sunindextype global_length; /* overall global manyvector length */ N_Vector* subvec_array; /* pointer to N_Vector array */ - booleantype own_data; /* flag indicating data ownership */ + sunbooleantype own_data; /* flag indicating data ownership */ }; typedef struct _N_VectorContent_MPIManyVector *N_VectorContent_MPIManyVector; @@ -116,8 +116,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_MPIManyVector(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_MPIManyVector(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_MPIManyVector(N_Vector x); SUNDIALS_EXPORT void N_VCompare_MPIManyVector(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_MPIManyVector(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_MPIManyVector(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTest_MPIManyVector(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_MPIManyVector(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_MPIManyVector(N_Vector num, N_Vector denom); @@ -165,8 +165,8 @@ SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_MPIManyVector(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_MPIManyVector(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_MPIManyVector(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT booleantype N_VInvTestLocal_MPIManyVector(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_MPIManyVector(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTestLocal_MPIManyVector(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal_MPIManyVector(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_MPIManyVector(N_Vector num, N_Vector denom); @@ -180,19 +180,19 @@ SUNDIALS_EXPORT int N_VBufUnpack_MPIManyVector(N_Vector x, void *buf); Enable / disable fused vector operations ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_MPIManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_MPIManyVector(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_MPIManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_MPIManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_MPIManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_MPIManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_MPIManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_MPIManyVector(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_MPIManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_MPIManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_MPIManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_MPIManyVector(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_MPIManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_MPIManyVector(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_MPIManyVector(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_MPIManyVector(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_mpiplusx.h b/include/nvector/nvector_mpiplusx.h index c7692a6c70..a3faa7730b 100644 --- a/include/nvector/nvector_mpiplusx.h +++ b/include/nvector/nvector_mpiplusx.h @@ -47,7 +47,7 @@ SUNDIALS_EXPORT N_Vector N_VGetLocalVector_MPIPlusX(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLocalLength_MPIPlusX(N_Vector v); SUNDIALS_STATIC_INLINE -int N_VEnableFusedOps_MPIPlusX(N_Vector v, booleantype tf) +int N_VEnableFusedOps_MPIPlusX(N_Vector v, sunbooleantype tf) { return N_VEnableFusedOps_MPIManyVector(v, tf); } #ifdef __cplusplus diff --git a/include/nvector/nvector_openmp.h b/include/nvector/nvector_openmp.h index 6360b891b3..ea69d00a71 100644 --- a/include/nvector/nvector_openmp.h +++ b/include/nvector/nvector_openmp.h @@ -28,7 +28,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype'. + * for the type 'sunbooleantype'. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -57,7 +57,7 @@ extern "C" { struct _N_VectorContent_OpenMP { sunindextype length; /* vector length */ - booleantype own_data; /* data ownership flag */ + sunbooleantype own_data; /* data ownership flag */ sunrealtype *data; /* data array */ int num_threads; /* number of OpenMP threads */ }; @@ -128,8 +128,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_OpenMP(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_OpenMP(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_OpenMP(N_Vector x); SUNDIALS_EXPORT void N_VCompare_OpenMP(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_OpenMP(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_OpenMP(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_OpenMP(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -180,19 +180,19 @@ SUNDIALS_EXPORT int N_VBufUnpack_OpenMP(N_Vector x, void *buf); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_OpenMP(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_OpenMP(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_OpenMP(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_OpenMP(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_openmpdev.h b/include/nvector/nvector_openmpdev.h index f55a834111..2352d2b590 100644 --- a/include/nvector/nvector_openmpdev.h +++ b/include/nvector/nvector_openmpdev.h @@ -28,7 +28,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype'. + * for the type 'sunbooleantype'. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -57,7 +57,7 @@ extern "C" { struct _N_VectorContent_OpenMPDEV { sunindextype length; /* vector length */ - booleantype own_data; /* data ownership flag */ + sunbooleantype own_data; /* data ownership flag */ sunrealtype *host_data; /* host data array */ sunrealtype *dev_data; /* device data array */ }; @@ -133,8 +133,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_OpenMPDEV(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_OpenMPDEV(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_OpenMPDEV(N_Vector x); SUNDIALS_EXPORT void N_VCompare_OpenMPDEV(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_OpenMPDEV(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_OpenMPDEV(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_OpenMPDEV(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_OpenMPDEV(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_OpenMPDEV(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -181,19 +181,19 @@ SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_OpenMPDEV(N_Vector x, N_Vector w * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_OpenMPDEV(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_OpenMPDEV(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_OpenMPDEV(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_OpenMPDEV(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_parallel.h b/include/nvector/nvector_parallel.h index 4c7767c982..1a2ad48195 100644 --- a/include/nvector/nvector_parallel.h +++ b/include/nvector/nvector_parallel.h @@ -24,7 +24,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type booleantype. + * for the type sunbooleantype. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -56,7 +56,7 @@ extern "C" { struct _N_VectorContent_Parallel { sunindextype local_length; /* local vector length */ sunindextype global_length; /* global vector length */ - booleantype own_data; /* ownership of data */ + sunbooleantype own_data; /* ownership of data */ sunrealtype *data; /* local data array */ MPI_Comm comm; /* pointer to MPI communicator */ }; @@ -141,8 +141,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Parallel(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Parallel(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Parallel(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Parallel(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Parallel(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Parallel(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Parallel(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Parallel(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Parallel(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -185,8 +185,8 @@ SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_Parallel(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Parallel(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Parallel(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT booleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_Parallel(N_Vector num, N_Vector denom); @@ -209,21 +209,21 @@ SUNDIALS_EXPORT int N_VBufUnpack_Parallel(N_Vector x, void *buf); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Parallel(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Parallel(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_Parallel(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_Parallel(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Parallel(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Parallel(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Parallel(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Parallel(N_Vector v, sunbooleantype tf); #ifdef __cplusplus diff --git a/include/nvector/nvector_parhyp.h b/include/nvector/nvector_parhyp.h index 109afc725d..1287ac5128 100644 --- a/include/nvector/nvector_parhyp.h +++ b/include/nvector/nvector_parhyp.h @@ -27,7 +27,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type booleantype. + * for the type sunbooleantype. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -62,7 +62,7 @@ extern "C" { struct _N_VectorContent_ParHyp { sunindextype local_length; /* local vector length */ sunindextype global_length; /* global vector length */ - booleantype own_parvector; /* ownership of HYPRE vector */ + sunbooleantype own_parvector; /* ownership of HYPRE vector */ MPI_Comm comm; /* pointer to MPI communicator */ HYPRE_ParVector x; /* the actual HYPRE_ParVector object */ @@ -120,8 +120,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_ParHyp(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_ParHyp(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_ParHyp(N_Vector x); SUNDIALS_EXPORT void N_VCompare_ParHyp(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_ParHyp(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_ParHyp(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTest_ParHyp(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_ParHyp(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_ParHyp(N_Vector num, N_Vector denom); @@ -165,8 +165,8 @@ SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_ParHyp(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_ParHyp(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_ParHyp(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT booleantype N_VInvTestLocal_ParHyp(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_ParHyp(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTestLocal_ParHyp(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal_ParHyp(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_ParHyp(N_Vector num, N_Vector denom); @@ -189,29 +189,29 @@ SUNDIALS_EXPORT int N_VBufUnpack_ParHyp(N_Vector x, void *buf); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_ParHyp(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_ParHyp(N_Vector v, sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombination_ParHyp(N_Vector v, - booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_ParHyp(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_ParHyp(N_Vector v, booleantype tf); + sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_ParHyp(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_ParHyp(N_Vector v, sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_ParHyp(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableScaleVectorArray_ParHyp(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableConstVectorArray_ParHyp(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_ParHyp(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_ParHyp(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, - booleantype tf); + sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_ParHyp(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_ParHyp(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_petsc.h b/include/nvector/nvector_petsc.h index 67f789e780..0edf01e560 100644 --- a/include/nvector/nvector_petsc.h +++ b/include/nvector/nvector_petsc.h @@ -23,7 +23,7 @@ * header file sundials_types.h, and it may be changed (at the * build configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type booleantype. + * for the type sunbooleantype. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -55,7 +55,7 @@ extern "C" { struct _N_VectorContent_Petsc { sunindextype local_length; /* copy of local vector length */ sunindextype global_length; /* copy of global vector length */ - booleantype own_data; /* ownership of data */ + sunbooleantype own_data; /* ownership of data */ Vec pvec; /* the PETSc Vec object */ MPI_Comm comm; /* copy of MPI communicator */ }; @@ -112,8 +112,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Petsc(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Petsc(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Petsc(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Petsc(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Petsc(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Petsc(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Petsc(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Petsc(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Petsc(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -156,8 +156,8 @@ SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_Petsc(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Petsc(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Petsc(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT booleantype N_VInvTestLocal_Petsc(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTestLocal_Petsc(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_Petsc(N_Vector num, N_Vector denom); @@ -179,21 +179,21 @@ SUNDIALS_EXPORT int N_VBufUnpack_Petsc(N_Vector x, void *buf); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Petsc(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Petsc(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_Petsc(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_Petsc(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Petsc(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Petsc(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Petsc(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_pthreads.h b/include/nvector/nvector_pthreads.h index 0ff06fe9f2..4c82a479ed 100644 --- a/include/nvector/nvector_pthreads.h +++ b/include/nvector/nvector_pthreads.h @@ -29,7 +29,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype'. + * for the type 'sunbooleantype'. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -59,7 +59,7 @@ extern "C" { struct _N_VectorContent_Pthreads { sunindextype length; /* vector length */ - booleantype own_data; /* data ownership flag */ + sunbooleantype own_data; /* data ownership flag */ sunrealtype *data; /* data array */ int num_threads; /* number of POSIX threads */ }; @@ -168,8 +168,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Pthreads(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Pthreads(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Pthreads(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Pthreads(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Pthreads(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Pthreads(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Pthreads(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Pthreads(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Pthreads(N_Vector num, N_Vector denom); @@ -221,27 +221,27 @@ SUNDIALS_EXPORT int N_VBufUnpack_Pthreads(N_Vector x, void *buf); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Pthreads(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Pthreads(N_Vector v, sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombination_Pthreads(N_Vector v, - booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Pthreads(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_Pthreads(N_Vector v, booleantype tf); + sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Pthreads(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_Pthreads(N_Vector v, sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Pthreads(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Pthreads(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableConstVectorArray_Pthreads(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Pthreads(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Pthreads(N_Vector v, - booleantype tf); + sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_raja.h b/include/nvector/nvector_raja.h index ec5de520a5..afe005d19e 100644 --- a/include/nvector/nvector_raja.h +++ b/include/nvector/nvector_raja.h @@ -41,7 +41,7 @@ extern "C" { struct _N_VectorContent_Raja { sunindextype length; - booleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNMemoryHelper mem_helper; @@ -61,7 +61,7 @@ SUNDIALS_EXPORT N_Vector N_VNew_Raja(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNewManaged_Raja(sunindextype length, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Raja(sunindextype length, - booleantype use_managed_mem, + sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VMake_Raja(sunindextype length, sunrealtype *h_vdata, @@ -72,7 +72,7 @@ SUNDIALS_EXPORT N_Vector N_VMakeManaged_Raja(sunindextype length, SUNDIALS_EXPORT void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v); SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v); -SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Raja(N_Vector x); +SUNDIALS_EXPORT sunbooleantype N_VIsManagedMemory_Raja(N_Vector x); SUNDIALS_EXPORT void N_VCopyToDevice_Raja(N_Vector v); SUNDIALS_EXPORT void N_VCopyFromDevice_Raja(N_Vector v); @@ -133,8 +133,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Raja(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Raja(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Raja(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Raja(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Raja(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Raja(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Raja(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Raja(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Raja(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -179,16 +179,16 @@ SUNDIALS_EXPORT void N_VPrintFile_Raja(N_Vector v, FILE *outfile); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Raja(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Raja(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_Raja(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Raja(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_Raja(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Raja(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Raja(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Raja(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_Raja(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Raja(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Raja(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Raja(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Raja(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_Raja(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Raja(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Raja(N_Vector v, sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_serial.h b/include/nvector/nvector_serial.h index 42e475cea5..c3cc534513 100644 --- a/include/nvector/nvector_serial.h +++ b/include/nvector/nvector_serial.h @@ -24,7 +24,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype'. + * for the type 'sunbooleantype'. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -53,7 +53,7 @@ extern "C" { struct _N_VectorContent_Serial { sunindextype length; /* vector length */ - booleantype own_data; /* data ownership flag */ + sunbooleantype own_data; /* data ownership flag */ sunrealtype *data; /* data array */ }; @@ -119,8 +119,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Serial(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Serial(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Serial(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Serial(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Serial(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Serial(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom); /* fused vector operations */ @@ -170,19 +170,19 @@ SUNDIALS_EXPORT int N_VBufUnpack_Serial(N_Vector x, void *buf); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Serial(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Serial(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_Serial(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_Serial(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, sunbooleantype tf); #ifdef __cplusplus diff --git a/include/nvector/nvector_sycl.h b/include/nvector/nvector_sycl.h index 2ac028f740..c2c40bf981 100644 --- a/include/nvector/nvector_sycl.h +++ b/include/nvector/nvector_sycl.h @@ -39,7 +39,7 @@ extern "C" { struct _N_VectorContent_Sycl { sunindextype length; - booleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNSyclExecPolicy* stream_exec_policy; @@ -65,7 +65,7 @@ SUNDIALS_EXPORT N_Vector N_VNewManaged_Sycl(sunindextype length, ::sycl::queue *Q, SUNContext sunctx); SUNDIALS_EXPORT N_Vector N_VNewWithMemHelp_Sycl(sunindextype length, - booleantype use_managed_mem, + sunbooleantype use_managed_mem, SUNMemoryHelper helper, ::sycl::queue *Q, SUNContext sunctx); @@ -82,7 +82,7 @@ SUNDIALS_EXPORT N_Vector N_VMakeManaged_Sycl(sunindextype length, SUNDIALS_EXPORT void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v); SUNDIALS_EXPORT void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v); -SUNDIALS_EXPORT booleantype N_VIsManagedMemory_Sycl(N_Vector x); +SUNDIALS_EXPORT sunbooleantype N_VIsManagedMemory_Sycl(N_Vector x); SUNDIALS_EXPORT int N_VSetKernelExecPolicy_Sycl(N_Vector x, SUNSyclExecPolicy* stream_exec_policy, SUNSyclExecPolicy* reduce_exec_policy); @@ -147,8 +147,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Sycl(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Sycl(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Sycl(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Sycl(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Sycl(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Sycl(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Sycl(N_Vector num, N_Vector denom); @@ -199,24 +199,24 @@ SUNDIALS_EXPORT void N_VPrintFile_Sycl(N_Vector v, FILE *outfile); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT int N_VEnableFusedOps_Sycl(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableFusedOps_Sycl(N_Vector v, sunbooleantype tf); -SUNDIALS_EXPORT int N_VEnableLinearCombination_Sycl(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Sycl(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableDotProdMulti_Sycl(N_Vector v, booleantype tf); +SUNDIALS_EXPORT int N_VEnableLinearCombination_Sycl(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleAddMulti_Sycl(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableDotProdMulti_Sycl(N_Vector v, sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearSumVectorArray_Sycl(N_Vector v, - booleantype tf); -SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Sycl(N_Vector v, booleantype tf); -SUNDIALS_EXPORT int N_VEnableConstVectorArray_Sycl(N_Vector v, booleantype tf); + sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableScaleVectorArray_Sycl(N_Vector v, sunbooleantype tf); +SUNDIALS_EXPORT int N_VEnableConstVectorArray_Sycl(N_Vector v, sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableWrmsNormVectorArray_Sycl(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Sycl(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Sycl(N_Vector v, - booleantype tf); + sunbooleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Sycl(N_Vector v, - booleantype tf); + sunbooleantype tf); #ifdef __cplusplus } diff --git a/include/nvector/nvector_trilinos.h b/include/nvector/nvector_trilinos.h index 3f190e70da..bc98564880 100644 --- a/include/nvector/nvector_trilinos.h +++ b/include/nvector/nvector_trilinos.h @@ -30,7 +30,7 @@ * header file sundials_types.h, and it may be changed (at the * build configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type booleantype. + * for the type sunbooleantype. * * - N_Vector arguments to arithmetic vector operations need not * be distinct. For example, the following call: @@ -116,8 +116,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_Trilinos(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_Trilinos(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_Trilinos(N_Vector x); SUNDIALS_EXPORT void N_VCompare_Trilinos(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_Trilinos(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_Trilinos(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest_Trilinos(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_Trilinos(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_Trilinos(N_Vector num, N_Vector denom); /* OPTIONAL local reduction kernels (no parallel communication) */ @@ -128,8 +128,8 @@ SUNDIALS_EXPORT sunrealtype N_VL1NormLocal_Trilinos(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal_Trilinos(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal_Trilinos(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT booleantype N_VInvTestLocal_Trilinos(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMaskLocal_Trilinos(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTestLocal_Trilinos(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal_Trilinos(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal_Trilinos(N_Vector num, N_Vector denom); diff --git a/include/sundials/sundials_linearsolver.h b/include/sundials/sundials_linearsolver.h index 0a669937d8..24a8da49e8 100644 --- a/include/sundials/sundials_linearsolver.h +++ b/include/sundials/sundials_linearsolver.h @@ -114,7 +114,7 @@ struct _generic_SUNLinearSolver_Ops int (*setatimes)(SUNLinearSolver, void*, SUNATimesFn); int (*setpreconditioner)(SUNLinearSolver, void*, SUNPSetupFn, SUNPSolveFn); int (*setscalingvectors)(SUNLinearSolver, N_Vector, N_Vector); - int (*setzeroguess)(SUNLinearSolver, booleantype); + int (*setzeroguess)(SUNLinearSolver, sunbooleantype); int (*initialize)(SUNLinearSolver); int (*setup)(SUNLinearSolver, SUNMatrix); int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, sunrealtype); @@ -160,7 +160,7 @@ SUNDIALS_EXPORT int SUNLinSolSetPreconditioner(SUNLinearSolver S, void* P_data, SUNDIALS_EXPORT int SUNLinSolSetScalingVectors(SUNLinearSolver S, N_Vector s1, N_Vector s2); -SUNDIALS_EXPORT int SUNLinSolSetZeroGuess(SUNLinearSolver S, booleantype onoff); +SUNDIALS_EXPORT int SUNLinSolSetZeroGuess(SUNLinearSolver S, sunbooleantype onoff); SUNDIALS_EXPORT int SUNLinSolInitialize(SUNLinearSolver S); diff --git a/include/sundials/sundials_math.h b/include/sundials/sundials_math.h index 691015938f..4470e47798 100644 --- a/include/sundials/sundials_math.h +++ b/include/sundials/sundials_math.h @@ -209,7 +209,7 @@ SUNDIALS_EXPORT sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT booleantype SUNRCompare(sunrealtype a, sunrealtype b); +SUNDIALS_EXPORT sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); /* * ----------------------------------------------------------------- @@ -227,7 +227,7 @@ SUNDIALS_EXPORT booleantype SUNRCompare(sunrealtype a, sunrealtype b); * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT booleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); +SUNDIALS_EXPORT sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); /* * ----------------------------------------------------------------- diff --git a/include/sundials/sundials_memory.h b/include/sundials/sundials_memory.h index 19f17f4a9b..efa63382fc 100644 --- a/include/sundials/sundials_memory.h +++ b/include/sundials/sundials_memory.h @@ -47,7 +47,7 @@ struct _SUNMemory { void* ptr; SUNMemoryType type; - booleantype own; + sunbooleantype own; size_t bytes; }; @@ -152,7 +152,7 @@ SUNDIALS_EXPORT int SUNMemoryHelper_CopyOps(SUNMemoryHelper src, /* Checks that all required SUNMemoryHelper ops are provided */ SUNDIALS_EXPORT -booleantype SUNMemoryHelper_ImplementsRequiredOps(SUNMemoryHelper); +sunbooleantype SUNMemoryHelper_ImplementsRequiredOps(SUNMemoryHelper); #ifdef __cplusplus diff --git a/include/sundials/sundials_nonlinearsolver.h b/include/sundials/sundials_nonlinearsolver.h index d48373c518..67fff7a23f 100644 --- a/include/sundials/sundials_nonlinearsolver.h +++ b/include/sundials/sundials_nonlinearsolver.h @@ -71,7 +71,7 @@ typedef _SUNDIALS_STRUCT_ _generic_SUNNonlinearSolver* SUNNonlinearSolver; typedef int (*SUNNonlinSolSysFn)(N_Vector y, N_Vector F, void* mem); -typedef int (*SUNNonlinSolLSetupFn)(booleantype jbad, booleantype* jcur, void* mem); +typedef int (*SUNNonlinSolLSetupFn)(sunbooleantype jbad, sunbooleantype* jcur, void* mem); typedef int (*SUNNonlinSolLSolveFn)(N_Vector b, void* mem); @@ -98,7 +98,7 @@ struct _generic_SUNNonlinearSolver_Ops SUNNonlinearSolver_Type (*gettype)(SUNNonlinearSolver); int (*initialize)(SUNNonlinearSolver); int (*setup)(SUNNonlinearSolver, N_Vector, void*); - int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, sunrealtype, booleantype, void*); + int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, sunrealtype, sunbooleantype, void*); int (*free)(SUNNonlinearSolver); int (*setsysfn)(SUNNonlinearSolver, SUNNonlinSolSysFn); int (*setlsetupfn)(SUNNonlinearSolver, SUNNonlinSolLSetupFn); @@ -142,7 +142,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSetup(SUNNonlinearSolver NLS, N_Vector y, void* mem); SUNDIALS_EXPORT int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem); + sunbooleantype callLSetup, void* mem); SUNDIALS_EXPORT int SUNNonlinSolFree(SUNNonlinearSolver NLS); diff --git a/include/sundials/sundials_nvector.h b/include/sundials/sundials_nvector.h index f43acc2ce7..8cb15d2d9d 100644 --- a/include/sundials/sundials_nvector.h +++ b/include/sundials/sundials_nvector.h @@ -131,8 +131,8 @@ struct _generic_N_Vector_Ops sunrealtype (*nvwl2norm)(N_Vector, N_Vector); sunrealtype (*nvl1norm)(N_Vector); void (*nvcompare)(sunrealtype, N_Vector, N_Vector); - booleantype (*nvinvtest)(N_Vector, N_Vector); - booleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector); + sunbooleantype (*nvinvtest)(N_Vector, N_Vector); + sunbooleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector); sunrealtype (*nvminquotient)(N_Vector, N_Vector); /* @@ -164,8 +164,8 @@ struct _generic_N_Vector_Ops sunrealtype (*nvmaxnormlocal)(N_Vector); sunrealtype (*nvminlocal)(N_Vector); sunrealtype (*nvl1normlocal)(N_Vector); - booleantype (*nvinvtestlocal)(N_Vector, N_Vector); - booleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector); + sunbooleantype (*nvinvtestlocal)(N_Vector, N_Vector); + sunbooleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector); sunrealtype (*nvminquotientlocal)(N_Vector, N_Vector); sunrealtype (*nvwsqrsumlocal)(N_Vector, N_Vector); sunrealtype (*nvwsqrsummasklocal)(N_Vector, N_Vector, N_Vector); @@ -242,8 +242,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm(N_Vector x); SUNDIALS_EXPORT void N_VCompare(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTest(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient(N_Vector num, N_Vector denom); /* @@ -284,8 +284,8 @@ SUNDIALS_EXPORT sunrealtype N_VMinLocal(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VL1NormLocal(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWSqrSumLocal(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id); -SUNDIALS_EXPORT booleantype N_VInvTestLocal(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m); +SUNDIALS_EXPORT sunbooleantype N_VInvTestLocal(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal(N_Vector num, N_Vector denom); /* single buffer reduction operations */ diff --git a/include/sundials/sundials_nvector_senswrapper.h b/include/sundials/sundials_nvector_senswrapper.h index 281ba2591f..9ac486aff0 100644 --- a/include/sundials/sundials_nvector_senswrapper.h +++ b/include/sundials/sundials_nvector_senswrapper.h @@ -40,7 +40,7 @@ extern "C" { struct _N_VectorContent_SensWrapper { N_Vector* vecs; /* array of wrapped vectors */ int nvecs; /* number of wrapped vectors */ - booleantype own_vecs; /* flag indicating if wrapper owns vectors */ + sunbooleantype own_vecs; /* flag indicating if wrapper owns vectors */ }; typedef struct _N_VectorContent_SensWrapper *N_VectorContent_SensWrapper; @@ -91,8 +91,8 @@ SUNDIALS_EXPORT sunrealtype N_VMin_SensWrapper(N_Vector x); SUNDIALS_EXPORT sunrealtype N_VWL2Norm_SensWrapper(N_Vector x, N_Vector w); SUNDIALS_EXPORT sunrealtype N_VL1Norm_SensWrapper(N_Vector x); SUNDIALS_EXPORT void N_VCompare_SensWrapper(sunrealtype c, N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VInvTest_SensWrapper(N_Vector x, N_Vector z); -SUNDIALS_EXPORT booleantype N_VConstrMask_SensWrapper(N_Vector c, N_Vector x, +SUNDIALS_EXPORT sunbooleantype N_VInvTest_SensWrapper(N_Vector x, N_Vector z); +SUNDIALS_EXPORT sunbooleantype N_VConstrMask_SensWrapper(N_Vector c, N_Vector x, N_Vector m); SUNDIALS_EXPORT sunrealtype N_VMinQuotient_SensWrapper(N_Vector num, N_Vector denom); diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index a8d08a52ed..346645f209 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -139,8 +139,8 @@ typedef SUNDIALS_INDEX_TYPE sunindextype; */ /* deprecated */ -#ifndef booleantype -#define booleantype int +#ifndef sunbooleantype +#define sunbooleantype int #endif #ifndef sunbooleantype diff --git a/include/sunlinsol/sunlinsol_cusolversp_batchqr.h b/include/sunlinsol/sunlinsol_cusolversp_batchqr.h index 8d70dfd02d..05ea8e8ac8 100644 --- a/include/sunlinsol/sunlinsol_cusolversp_batchqr.h +++ b/include/sunlinsol/sunlinsol_cusolversp_batchqr.h @@ -39,7 +39,7 @@ extern "C" { struct _SUNLinearSolverContent_cuSolverSp_batchQR { int last_flag; /* last return flag */ - booleantype first_factorize; /* is this the first factorization? */ + sunbooleantype first_factorize; /* is this the first factorization? */ size_t internal_size; /* size of cusolver internal buffer for Q and R */ size_t workspace_size; /* size of cusolver memory block for num. factorization */ cusolverSpHandle_t cusolver_handle; /* cuSolverSp context */ diff --git a/include/sunlinsol/sunlinsol_dense.h b/include/sunlinsol/sunlinsol_dense.h index f46bced8d3..e16c71cb70 100644 --- a/include/sunlinsol/sunlinsol_dense.h +++ b/include/sunlinsol/sunlinsol_dense.h @@ -22,7 +22,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype' and 'indextype'. + * for the type 'sunbooleantype' and 'indextype'. * ----------------------------------------------------------------- */ diff --git a/include/sunlinsol/sunlinsol_magmadense.h b/include/sunlinsol/sunlinsol_magmadense.h index c101267967..2809c5b5b3 100644 --- a/include/sunlinsol/sunlinsol_magmadense.h +++ b/include/sunlinsol/sunlinsol_magmadense.h @@ -42,7 +42,7 @@ extern "C" { struct _SUNLinearSolverContent_MagmaDense { int last_flag; - booleantype async; + sunbooleantype async; sunindextype N; SUNMemory pivots; SUNMemory pivotsarr; @@ -58,7 +58,7 @@ typedef struct _SUNLinearSolverContent_MagmaDense *SUNLinearSolverContent_MagmaD SUNDIALS_EXPORT SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix A, SUNContext sunctx); -SUNDIALS_EXPORT int SUNLinSol_MagmaDense_SetAsync(SUNLinearSolver S, booleantype onoff); +SUNDIALS_EXPORT int SUNLinSol_MagmaDense_SetAsync(SUNLinearSolver S, sunbooleantype onoff); SUNDIALS_EXPORT SUNLinearSolver_Type SUNLinSolGetType_MagmaDense(SUNLinearSolver S); SUNDIALS_EXPORT SUNLinearSolver_ID SUNLinSolGetID_MagmaDense(SUNLinearSolver S); diff --git a/include/sunlinsol/sunlinsol_pcg.h b/include/sunlinsol/sunlinsol_pcg.h index 59b619a8c2..daac981a0b 100644 --- a/include/sunlinsol/sunlinsol_pcg.h +++ b/include/sunlinsol/sunlinsol_pcg.h @@ -43,7 +43,7 @@ extern "C" { struct _SUNLinearSolverContent_PCG { int maxl; int pretype; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; @@ -93,7 +93,7 @@ SUNDIALS_EXPORT int SUNLinSolSetScalingVectors_PCG(SUNLinearSolver S, N_Vector s, N_Vector nul); SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_PCG(SUNLinearSolver S, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNMatrix nul); SUNDIALS_EXPORT int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, N_Vector x, N_Vector b, sunrealtype tol); diff --git a/include/sunlinsol/sunlinsol_spbcgs.h b/include/sunlinsol/sunlinsol_spbcgs.h index c3cf699d97..3b97c8b7f5 100644 --- a/include/sunlinsol/sunlinsol_spbcgs.h +++ b/include/sunlinsol/sunlinsol_spbcgs.h @@ -47,7 +47,7 @@ extern "C" { struct _SUNLinearSolverContent_SPBCGS { int maxl; int pretype; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; @@ -100,7 +100,7 @@ SUNDIALS_EXPORT int SUNLinSolSetScalingVectors_SPBCGS(SUNLinearSolver S, N_Vector s1, N_Vector s2); SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPBCGS(SUNLinearSolver S, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol); diff --git a/include/sunlinsol/sunlinsol_spfgmr.h b/include/sunlinsol/sunlinsol_spfgmr.h index 41a8d7ef0e..8c50ddf478 100644 --- a/include/sunlinsol/sunlinsol_spfgmr.h +++ b/include/sunlinsol/sunlinsol_spfgmr.h @@ -50,7 +50,7 @@ struct _SUNLinearSolverContent_SPFGMR { int pretype; int gstype; int max_restarts; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; @@ -107,7 +107,7 @@ SUNDIALS_EXPORT int SUNLinSolSetScalingVectors_SPFGMR(SUNLinearSolver S, N_Vector s1, N_Vector s2); SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPFGMR(SUNLinearSolver S, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol); diff --git a/include/sunlinsol/sunlinsol_spgmr.h b/include/sunlinsol/sunlinsol_spgmr.h index a1b7e77378..683c12d951 100644 --- a/include/sunlinsol/sunlinsol_spgmr.h +++ b/include/sunlinsol/sunlinsol_spgmr.h @@ -52,7 +52,7 @@ struct _SUNLinearSolverContent_SPGMR { int pretype; int gstype; int max_restarts; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; @@ -109,7 +109,7 @@ SUNDIALS_EXPORT int SUNLinSolSetScalingVectors_SPGMR(SUNLinearSolver S, N_Vector s1, N_Vector s2); SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPGMR(SUNLinearSolver S, - booleantype onff); + sunbooleantype onff); SUNDIALS_EXPORT int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol); diff --git a/include/sunlinsol/sunlinsol_sptfqmr.h b/include/sunlinsol/sunlinsol_sptfqmr.h index 53e787353c..1cf27484a6 100644 --- a/include/sunlinsol/sunlinsol_sptfqmr.h +++ b/include/sunlinsol/sunlinsol_sptfqmr.h @@ -45,7 +45,7 @@ extern "C" { struct _SUNLinearSolverContent_SPTFQMR { int maxl; int pretype; - booleantype zeroguess; + sunbooleantype zeroguess; int numiters; sunrealtype resnorm; int last_flag; @@ -100,7 +100,7 @@ SUNDIALS_EXPORT int SUNLinSolSetScalingVectors_SPTFQMR(SUNLinearSolver S, N_Vector s1, N_Vector s2); SUNDIALS_EXPORT int SUNLinSolSetZeroGuess_SPTFQMR(SUNLinearSolver S, - booleantype onoff); + sunbooleantype onoff); SUNDIALS_EXPORT int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNMatrix A); SUNDIALS_EXPORT int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunrealtype tol); diff --git a/include/sunlinsol/sunlinsol_superludist.h b/include/sunlinsol/sunlinsol_superludist.h index 8233609691..ea5baca0a4 100644 --- a/include/sunlinsol/sunlinsol_superludist.h +++ b/include/sunlinsol/sunlinsol_superludist.h @@ -61,7 +61,7 @@ extern "C" { */ struct _SUNLinearSolverContent_SuperLUDIST { - booleantype first_factorize; + sunbooleantype first_factorize; int last_flag; sunrealtype berr; gridinfo_t *grid; diff --git a/include/sunmatrix/sunmatrix_band.h b/include/sunmatrix/sunmatrix_band.h index 1955c75d61..1f038e9ccd 100644 --- a/include/sunmatrix/sunmatrix_band.h +++ b/include/sunmatrix/sunmatrix_band.h @@ -24,7 +24,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype' and 'indextype'. + * for the type 'sunbooleantype' and 'indextype'. * ----------------------------------------------------------------- */ diff --git a/include/sunmatrix/sunmatrix_cusparse.h b/include/sunmatrix/sunmatrix_cusparse.h index c6ebaa0065..4754120b71 100644 --- a/include/sunmatrix/sunmatrix_cusparse.h +++ b/include/sunmatrix/sunmatrix_cusparse.h @@ -50,9 +50,9 @@ struct _SUNMatrix_Content_cuSparse { int blockcols; int blocknnz; int sparse_type; - booleantype own_matd; - booleantype fixed_pattern; - booleantype matvec_issetup; + sunbooleantype own_matd; + sunbooleantype fixed_pattern; + sunbooleantype matvec_issetup; SUNMemory colind; SUNMemory rowptrs; SUNMemory data; @@ -99,7 +99,7 @@ SUNDIALS_EXPORT int* SUNMatrix_cuSparse_IndexPointers(SUNMatrix A); SUNDIALS_EXPORT int* SUNMatrix_cuSparse_IndexValues(SUNMatrix A); SUNDIALS_EXPORT sunrealtype* SUNMatrix_cuSparse_Data(SUNMatrix A); -SUNDIALS_EXPORT int SUNMatrix_cuSparse_SetFixedPattern(SUNMatrix A, booleantype yesno); +SUNDIALS_EXPORT int SUNMatrix_cuSparse_SetFixedPattern(SUNMatrix A, sunbooleantype yesno); SUNDIALS_EXPORT int SUNMatrix_cuSparse_SetKernelExecPolicy(SUNMatrix A, SUNCudaExecPolicy* exec_policy); SUNDIALS_EXPORT int SUNMatrix_cuSparse_NumBlocks(SUNMatrix A); SUNDIALS_EXPORT int SUNMatrix_cuSparse_BlockRows(SUNMatrix A); diff --git a/include/sunmatrix/sunmatrix_dense.h b/include/sunmatrix/sunmatrix_dense.h index e1f427a92b..995c36db56 100644 --- a/include/sunmatrix/sunmatrix_dense.h +++ b/include/sunmatrix/sunmatrix_dense.h @@ -24,7 +24,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype' and 'indextype'. + * for the type 'sunbooleantype' and 'indextype'. * ----------------------------------------------------------------- */ diff --git a/include/sunmatrix/sunmatrix_slunrloc.h b/include/sunmatrix/sunmatrix_slunrloc.h index df2fdb4cee..1b4433074c 100644 --- a/include/sunmatrix/sunmatrix_slunrloc.h +++ b/include/sunmatrix/sunmatrix_slunrloc.h @@ -37,7 +37,7 @@ extern "C" { struct _SUNMatrixContent_SLUNRloc { - booleantype own_data; + sunbooleantype own_data; gridinfo_t *grid; sunindextype *row_to_proc; pdgsmv_comm_t *gsmv_comm; @@ -62,7 +62,7 @@ SUNDIALS_EXPORT void SUNMatrix_SLUNRloc_Print(SUNMatrix A, FILE *fp); SUNDIALS_EXPORT SuperMatrix* SUNMatrix_SLUNRloc_SuperMatrix(SUNMatrix A); SUNDIALS_EXPORT gridinfo_t* SUNMatrix_SLUNRloc_ProcessGrid(SUNMatrix A); -SUNDIALS_EXPORT booleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A); +SUNDIALS_EXPORT sunbooleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A); /* ----------------------------------------------------------------------------- * SuperLU implementations of various SUNMatrix operations: diff --git a/include/sunmatrix/sunmatrix_sparse.h b/include/sunmatrix/sunmatrix_sparse.h index a7a299a93c..f7792af058 100644 --- a/include/sunmatrix/sunmatrix_sparse.h +++ b/include/sunmatrix/sunmatrix_sparse.h @@ -25,7 +25,7 @@ * header file sundials_types.h, and it may be changed (at the * configuration stage) according to the user's needs. * The sundials_types.h file also contains the definition - * for the type 'booleantype' and 'indextype'. + * for the type 'sunbooleantype' and 'indextype'. * ----------------------------------------------------------------- */ diff --git a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h index 73ed985bf9..ac8f4620de 100644 --- a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h +++ b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h @@ -43,7 +43,7 @@ struct _SUNNonlinearSolverContent_FixedPoint { /* nonlinear solver variables */ int m; /* number of acceleration vectors to use */ int *imap; /* array of length m */ - booleantype damping; /* flag to apply dampling in acceleration */ + sunbooleantype damping; /* flag to apply dampling in acceleration */ sunrealtype beta; /* damping paramter */ sunrealtype *R; /* array of length m*m */ sunrealtype *gamma; /* array of length m */ @@ -91,7 +91,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize_FixedPoint(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, - booleantype callSetup, void *mem); + sunbooleantype callSetup, void *mem); SUNDIALS_EXPORT int SUNNonlinSolFree_FixedPoint(SUNNonlinearSolver NLS); diff --git a/include/sunnonlinsol/sunnonlinsol_newton.h b/include/sunnonlinsol/sunnonlinsol_newton.h index a009b900ca..f5d73f5cce 100644 --- a/include/sunnonlinsol/sunnonlinsol_newton.h +++ b/include/sunnonlinsol/sunnonlinsol_newton.h @@ -44,7 +44,7 @@ struct _SUNNonlinearSolverContent_Newton { /* nonlinear solver variables */ N_Vector delta; /* Newton update vector */ - booleantype jcur; /* Jacobian status, current = SUNTRUE / stale = SUNFALSE */ + sunbooleantype jcur; /* Jacobian status, current = SUNTRUE / stale = SUNFALSE */ int curiter; /* current number of iterations in a solve attempt */ int maxiters; /* maximum number of iterations in a solve attempt */ long int niters; /* total number of nonlinear iterations across all solves */ @@ -79,7 +79,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize_Newton(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, - booleantype callLSetup, void *mem); + sunbooleantype callLSetup, void *mem); SUNDIALS_EXPORT int SUNNonlinSolFree_Newton(SUNNonlinearSolver NLS); diff --git a/include/sunnonlinsol/sunnonlinsol_petscsnes.h b/include/sunnonlinsol/sunnonlinsol_petscsnes.h index 00cae2bf7a..739dd21100 100644 --- a/include/sunnonlinsol/sunnonlinsol_petscsnes.h +++ b/include/sunnonlinsol/sunnonlinsol_petscsnes.h @@ -69,7 +69,7 @@ SUNDIALS_EXPORT int SUNNonlinSolInitialize_PetscSNES(SUNNonlinearSolver NLS); SUNDIALS_EXPORT int SUNNonlinSolSolve_PetscSNES(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem); + sunbooleantype callLSetup, void* mem); SUNDIALS_EXPORT int SUNNonlinSolSetSysFn_PetscSNES(SUNNonlinearSolver NLS, SUNNonlinSolSysFn SysFn); diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 14cd3e6429..15d22a0f42 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -106,7 +106,7 @@ ARKodeMem arkCreate(SUNContext sunctx) /* Initialize lrw and liw */ ark_mem->lrw = 18; - ark_mem->liw = 41; /* fcn/data ptr, int, long int, sunindextype, booleantype */ + ark_mem->liw = 41; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ /* No mallocs have been done yet */ ark_mem->VabstolMallocDone = SUNFALSE; @@ -207,7 +207,7 @@ ARKodeMem arkCreate(SUNContext sunctx) int arkResize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void *resize_data) { - booleantype resizeOK; + sunbooleantype resizeOK; sunindextype lrw1, liw1, lrw_diff, liw_diff; int retval; @@ -645,7 +645,7 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, int retval, kflag, istate, ir; int ewtsetOK; sunrealtype troundoff, nrm; - booleantype inactive_roots; + sunbooleantype inactive_roots; sunrealtype dsm; int nflag, attempts, ncf, nef, constrfails; int relax_fails; @@ -1246,7 +1246,7 @@ void arkErrHandler(int error_code, const char *module, int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) { - booleantype stepperOK, nvectorOK, allocOK; + sunbooleantype stepperOK, nvectorOK, allocOK; sunindextype lrw1, liw1; /* Check ark_mem */ @@ -1486,7 +1486,7 @@ void arkPrintMem(ARKodeMem ark_mem, FILE *outfile) pointers have been supplied. If any of them is missing it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype arkCheckTimestepper(ARKodeMem ark_mem) +sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem) { if ( (ark_mem->step_init == NULL) || (ark_mem->step == NULL) || @@ -1503,7 +1503,7 @@ booleantype arkCheckTimestepper(ARKodeMem ark_mem) This routine checks if all required vector operations are present. If any of them is missing it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype arkCheckNvector(N_Vector tmpl) /* to be updated?? */ +sunbooleantype arkCheckNvector(N_Vector tmpl) /* to be updated?? */ { if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -1538,7 +1538,7 @@ booleantype arkCheckNvector(N_Vector tmpl) /* to be updated?? */ target vector or vector array already exists) otherwise SUNFALSE is retured. ---------------------------------------------------------------*/ -booleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector *v) +sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector *v) { /* allocate the new vector if necessary */ if (*v == NULL) { @@ -1555,7 +1555,7 @@ booleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector *v) } -booleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector **v, +sunbooleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector **v, sunindextype lrw1, long int *lrw, sunindextype liw1, long int *liw) { @@ -1617,7 +1617,7 @@ void arkFreeVecArray(int count, N_Vector **v, SUNTRUE is returned if the resize is successful otherwise SUNFALSE is retured. ---------------------------------------------------------------*/ -booleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, +sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, void *resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl, N_Vector *v) { @@ -1645,7 +1645,7 @@ booleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, } -booleantype arkResizeVecArray(ARKVecResizeFn resize, void *resize_data, +sunbooleantype arkResizeVecArray(ARKVecResizeFn resize, void *resize_data, int count, N_Vector tmpl, N_Vector **v, sunindextype lrw_diff, long int *lrw, sunindextype liw_diff, long int *liw) @@ -1683,7 +1683,7 @@ booleantype arkResizeVecArray(ARKVecResizeFn resize, void *resize_data, If all memory allocations are successful, arkAllocVectors returns SUNTRUE, otherwise it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl) +sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl) { /* Allocate ewt if needed */ if (!arkAllocVec(ark_mem, tmpl, &ark_mem->ewt)) @@ -1734,7 +1734,7 @@ booleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl) If all memory allocations are successful, arkResizeVectors returns SUNTRUE, otherwise it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, +sunbooleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, void *resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl) { @@ -1838,7 +1838,7 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) { int retval, hflag, istate; sunrealtype tout_hin, rh, htmp; - booleantype conOK; + sunbooleantype conOK; /* Set up the time stepper module */ if (ark_mem->step_init == NULL) { @@ -2222,7 +2222,7 @@ int arkHin(ARKodeMem ark_mem, sunrealtype tout) int retval, sign, count1, count2; sunrealtype tdiff, tdist, tround, hlb, hub; sunrealtype hg, hgs, hs, hnew, hrat, h0, yddnrm; - booleantype hgOK; + sunbooleantype hgOK; /* If tout is too close to tn, give up */ if ((tdiff = tout-ark_mem->tcur) == ZERO) return(ARK_TOO_CLOSE); @@ -2972,7 +2972,7 @@ int arkCheckConvergence(ARKodeMem ark_mem, int *nflagPtr, int *ncfPtr) --------------------------------------------------------------*/ int arkCheckConstraints(ARKodeMem ark_mem, int *constrfails, int *nflag) { - booleantype constraintsPassed; + sunbooleantype constraintsPassed; N_Vector mm = ark_mem->tempv4; N_Vector tmp = ark_mem->tempv3; diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index acfe48fe9d..1b76b97af0 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -108,7 +108,7 @@ typedef struct ARKodeHAdaptMemRec { sunrealtype k3; int q; /* method order */ int p; /* embedding order */ - booleantype pq; /* choice of using p (0) vs q (1) */ + sunbooleantype pq; /* choice of using p (0) vs q (1) */ ARKExpStabFn expstab; /* step stability function */ void *estab_data; /* user pointer passed to expstab */ diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 57f155d1e1..598008f88e 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -37,7 +37,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, ARKodeMem ark_mem; ARKodeARKStepMem step_mem; SUNNonlinearSolver NLS; - booleantype nvectorOK; + sunbooleantype nvectorOK; int retval; /* Check that at least one of fe, fi is supplied and is to be used */ @@ -131,7 +131,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, step_mem->fi = fi; /* Update the ARKODE workspace requirements */ - ark_mem->liw += 41; /* fcn/data ptr, int, long int, sunindextype, booleantype */ + ark_mem->liw += 41; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ ark_mem->lrw += 10; /* If an implicit component is to be solved, create default Newton NLS object */ @@ -881,7 +881,7 @@ int arkStep_AttachMasssol(void* arkode_mem, ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn mfree, - booleantype time_dep, + sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void *mass_mem) { @@ -1024,8 +1024,8 @@ ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem) whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ int arkStep_GetGammas(void* arkode_mem, sunrealtype *gamma, - sunrealtype *gamrat, booleantype **jcur, - booleantype *dgamma_fail) + sunrealtype *gamrat, sunbooleantype **jcur, + sunbooleantype *dgamma_fail) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; @@ -1086,7 +1086,7 @@ int arkStep_Init(void* arkode_mem, int init_type) ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int j, retval; - booleantype reset_efun; + sunbooleantype reset_efun; /* access ARKodeARKStepMem structure */ retval = arkStep_AccessStepMem(arkode_mem, "arkStep_Init", @@ -1332,7 +1332,7 @@ int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int nvec, retval; - booleantype recomputeRHS; + sunbooleantype recomputeRHS; sunrealtype* cvals; N_Vector* Xvecs; @@ -1586,8 +1586,8 @@ int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr) { int retval, is, nvec; - booleantype implicit_stage; - booleantype deduce_stage; + sunbooleantype implicit_stage; + sunbooleantype deduce_stage; ARKodeMem ark_mem; ARKodeARKStepMem step_mem; N_Vector zcor0; @@ -1906,7 +1906,7 @@ int arkStep_AccessStepMem(void* arkode_mem, const char *fname, This routine checks if all required vector operations are present. If any of them is missing it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype arkStep_CheckNVector(N_Vector tmpl) +sunbooleantype arkStep_CheckNVector(N_Vector tmpl) { if ( (tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -2081,7 +2081,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) int arkStep_CheckButcherTables(ARKodeMem ark_mem) { int i, j; - booleantype okay; + sunbooleantype okay; ARKodeARKStepMem step_mem; const sunrealtype tol = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; @@ -2467,7 +2467,7 @@ int arkStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess) sdata = yn - zp + h*sum_{j=0}^{i-1} (Ae(i,j)*Fe(j) + Ai(i,j)*Fi(j)) ---------------------------------------------------------------*/ -int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) +int arkStep_StageSetup(ARKodeMem ark_mem, sunbooleantype implicit) { /* local data */ ARKodeARKStepMem step_mem; diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index bfc899340f..32b4e9d14a 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -67,11 +67,11 @@ typedef struct ARKodeARKStepMemRec { /* ARK problem specification */ ARKRhsFn fe; /* My' = fe(t,y) + fi(t,y) */ ARKRhsFn fi; - booleantype linear; /* SUNTRUE if fi is linear */ - booleantype linear_timedep; /* SUNTRUE if dfi/dy depends on t */ - booleantype explicit; /* SUNTRUE if fe is enabled */ - booleantype implicit; /* SUNTRUE if fi is enabled */ - booleantype deduce_rhs; /* SUNTRUE if fi is deduced after + sunbooleantype linear; /* SUNTRUE if fi is linear */ + sunbooleantype linear_timedep; /* SUNTRUE if dfi/dy depends on t */ + sunbooleantype explicit; /* SUNTRUE if fe is enabled */ + sunbooleantype implicit; /* SUNTRUE if fi is enabled */ + sunbooleantype deduce_rhs; /* SUNTRUE if fi is deduced after a nonlinear solve */ /* ARK method storage and parameters */ @@ -93,7 +93,7 @@ typedef struct ARKodeARKStepMemRec { /* (Non)Linear solver parameters & data */ SUNNonlinearSolver NLS; /* generic SUNNonlinearSolver object */ - booleantype ownNLS; /* flag indicating ownership of NLS */ + sunbooleantype ownNLS; /* flag indicating ownership of NLS */ ARKRhsFn nls_fi; /* fi(t,y) used in the nonlinear solver */ sunrealtype gamma; /* gamma = h * A(i,i) */ sunrealtype gammap; /* gamma at the last setup call */ @@ -117,7 +117,7 @@ typedef struct ARKodeARKStepMemRec { nonlinear equation */ int convfail; /* NLS fail flag (for interface routines) */ - booleantype jcur; /* is Jacobian info for lin solver current? */ + sunbooleantype jcur; /* is Jacobian info for lin solver current? */ /* Linear Solver Data */ ARKLinsolInitFn linit; @@ -150,8 +150,8 @@ typedef struct ARKodeARKStepMemRec { int nfusedopvecs; /* length of cvals and Xvecs arrays */ /* Data for using ARKStep with external polynomial forcing */ - booleantype expforcing; /* add forcing to explicit RHS */ - booleantype impforcing; /* add forcing to implicit RHS */ + sunbooleantype expforcing; /* add forcing to explicit RHS */ + sunbooleantype impforcing; /* add forcing to implicit RHS */ sunrealtype tshift; /* time normalization shift */ sunrealtype tscale; /* time normalization scaling */ N_Vector* forcing; /* array of forcing vectors */ @@ -177,7 +177,7 @@ int arkStep_AttachMasssol(void* arkode_mem, ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn lfree, - booleantype time_dep, + sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void *mass_mem); void arkStep_DisableLSetup(void* arkode_mem); @@ -187,8 +187,8 @@ void* arkStep_GetLmem(void* arkode_mem); void* arkStep_GetMassMem(void* arkode_mem); ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem); int arkStep_GetGammas(void* arkode_mem, sunrealtype *gamma, - sunrealtype *gamrat, booleantype **jcur, - booleantype *dgamma_fail); + sunrealtype *gamrat, sunbooleantype **jcur, + sunbooleantype *dgamma_fail); int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); @@ -196,11 +196,11 @@ int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); /* Internal utility routines */ int arkStep_AccessStepMem(void* arkode_mem, const char *fname, ARKodeMem *ark_mem, ARKodeARKStepMem *step_mem); -booleantype arkStep_CheckNVector(N_Vector tmpl); +sunbooleantype arkStep_CheckNVector(N_Vector tmpl); int arkStep_SetButcherTables(ARKodeMem ark_mem); int arkStep_CheckButcherTables(ARKodeMem ark_mem); int arkStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess); -int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit); +int arkStep_StageSetup(ARKodeMem ark_mem, sunbooleantype implicit); int arkStep_NlsInit(ARKodeMem ark_mem); int arkStep_Nls(ARKodeMem ark_mem, int nflag); int arkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsm); @@ -215,7 +215,7 @@ int arkStep_NlsResidual_MassTDep(N_Vector zcor, N_Vector r, void* arkode_mem); int arkStep_NlsFPFunction_MassIdent(N_Vector zcor, N_Vector g, void* arkode_mem); int arkStep_NlsFPFunction_MassFixed(N_Vector zcor, N_Vector g, void* arkode_mem); int arkStep_NlsFPFunction_MassTDep(N_Vector zcor, N_Vector g, void* arkode_mem); -int arkStep_NlsLSetup(booleantype jbad, booleantype* jcur, void* arkode_mem); +int arkStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_mem); int arkStep_NlsLSolve(N_Vector delta, void* arkode_mem); int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem); diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 1b14332bac..53df69930d 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -57,7 +57,7 @@ int ARKStepSetMaxStep(void *arkode_mem, sunrealtype hmax) { int ARKStepSetStopTime(void *arkode_mem, sunrealtype tstop) { return(arkSetStopTime(arkode_mem, tstop)); } int ARKStepSetInterpolateStopTime(void *arkode_mem, - booleantype interp) { + sunbooleantype interp) { return(arkSetInterpolateStopTime(arkode_mem, interp)); } int ARKStepClearStopTime(void *arkode_mem) { return(arkClearStopTime(arkode_mem)); } @@ -118,7 +118,7 @@ int ARKStepSetLinearSolver(void *arkode_mem, SUNLinearSolver LS, SUNMatrix A) { return(arkLSSetLinearSolver(arkode_mem, LS, A)); } int ARKStepSetMassLinearSolver(void *arkode_mem, SUNLinearSolver LS, - SUNMatrix M, booleantype time_dep) { + SUNMatrix M, sunbooleantype time_dep) { return(arkLSSetMassLinearSolver(arkode_mem, LS, M, time_dep)); } int ARKStepSetJacFn(void *arkode_mem, ARKLsJacFn jac) { return(arkLSSetJacFn(arkode_mem, jac)); } @@ -126,7 +126,7 @@ int ARKStepSetMassFn(void *arkode_mem, ARKLsMassFn mass) { return(arkLSSetMassFn(arkode_mem, mass)); } int ARKStepSetJacEvalFrequency(void *arkode_mem, long int msbj) { return(arkLSSetJacEvalFrequency(arkode_mem, msbj)); } -int ARKStepSetLinearSolutionScaling(void *arkode_mem, booleantype onoff) { +int ARKStepSetLinearSolutionScaling(void *arkode_mem, sunbooleantype onoff) { return(arkLSSetLinearSolutionScaling(arkode_mem, onoff)); } int ARKStepSetEpsLin(void *arkode_mem, sunrealtype eplifac) { return(arkLSSetEpsLin(arkode_mem, eplifac)); } diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index c09b2f957d..2905f26fbc 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -285,7 +285,7 @@ int arkStep_NlsInit(ARKodeMem ark_mem) int arkStep_Nls(ARKodeMem ark_mem, int nflag) { ARKodeARKStepMem step_mem; - booleantype callLSetup; + sunbooleantype callLSetup; long int nls_iters_inc = 0; long int nls_fails_inc = 0; int retval; @@ -373,7 +373,7 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) This routine wraps the ARKODE linear solver interface 'setup' routine for use by the nonlinear solver object. ---------------------------------------------------------------*/ -int arkStep_NlsLSetup(booleantype jbad, booleantype* jcur, void* arkode_mem) +int arkStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_mem) { ARKodeMem ark_mem; ARKodeARKStepMem step_mem; diff --git a/src/arkode/arkode_bandpre.c b/src/arkode/arkode_bandpre.c index d809add6b1..167c858997 100644 --- a/src/arkode/arkode_bandpre.c +++ b/src/arkode/arkode_bandpre.c @@ -33,7 +33,7 @@ /* Prototypes of ARKBandPrecSetup and ARKBandPrecSolve */ static int ARKBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bp_data); static int ARKBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, @@ -312,7 +312,7 @@ int ARKBandPrecGetNumRhsEvals(void *arkode_mem, long int *nfevalsBP) 1 if the band factorization failed. ---------------------------------------------------------------*/ static int ARKBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bp_data) { ARKBandPrecData pdata; diff --git a/src/arkode/arkode_bbdpre.c b/src/arkode/arkode_bbdpre.c index aedb579969..d10695a1ad 100644 --- a/src/arkode/arkode_bbdpre.c +++ b/src/arkode/arkode_bbdpre.c @@ -35,7 +35,7 @@ /* Prototypes of functions ARKBBDPrecSetup and ARKBBDPrecSolve */ static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bbd_data); static int ARKBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, @@ -420,7 +420,7 @@ int ARKBBDPrecGetNumGfnEvals(void *arkode_mem, 1 for a recoverable error (step will be retried). ---------------------------------------------------------------*/ static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bbd_data) { ARKBBDPrecData pdata; diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index 5dd25ba679..4684ab20f6 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -30,50 +30,50 @@ static int __mv(sunrealtype **A, sunrealtype *x, int s, sunrealtype *b); static int __vv(sunrealtype *x, sunrealtype *y, int s, sunrealtype *z); static int __vp(sunrealtype *x, int l, int s, sunrealtype *z); static int __dot(sunrealtype *x, sunrealtype *y, int s, sunrealtype *d); -static booleantype __rowsum(sunrealtype **A, sunrealtype *c, int s); -static booleantype __order1(sunrealtype *b, int s); -static booleantype __order2(sunrealtype *b, sunrealtype *c, int s); -static booleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, int s); -static booleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, int s); -static booleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); -static booleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, int s); -static booleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, int s); -static booleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c, int s); -static booleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); -static booleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, int s); -static booleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s); -static booleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, int s); -static booleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); -static booleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, int s); -static booleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s); -static booleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, int s); -static booleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c, int s); -static booleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, sunrealtype *c5, int s); -static booleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype **A, sunrealtype *c4, int s); -static booleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); -static booleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, sunrealtype *c4, int s); -static booleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A1, sunrealtype **A2, sunrealtype *c3, int s); -static booleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); -static booleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); -static booleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); -static booleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s); -static booleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s); -static booleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); -static booleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); -static booleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); -static booleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s); -static booleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s); -static booleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); -static booleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); -static booleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c1, sunrealtype *c2, int s); -static booleantype __order6s(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype **A4, sunrealtype *c, int s); +static sunbooleantype __rowsum(sunrealtype **A, sunrealtype *c, int s); +static sunbooleantype __order1(sunrealtype *b, int s); +static sunbooleantype __order2(sunrealtype *b, sunrealtype *c, int s); +static sunbooleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, int s); +static sunbooleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, int s); +static sunbooleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); +static sunbooleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, int s); +static sunbooleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, int s); +static sunbooleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c, int s); +static sunbooleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); +static sunbooleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, int s); +static sunbooleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s); +static sunbooleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, int s); +static sunbooleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); +static sunbooleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, int s); +static sunbooleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s); +static sunbooleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, int s); +static sunbooleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c, int s); +static sunbooleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, sunrealtype *c5, int s); +static sunbooleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype **A, sunrealtype *c4, int s); +static sunbooleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); +static sunbooleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, sunrealtype *c4, int s); +static sunbooleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A1, sunrealtype **A2, sunrealtype *c3, int s); +static sunbooleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); +static sunbooleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); +static sunbooleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); +static sunbooleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s); +static sunbooleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s); +static sunbooleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s); +static sunbooleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s); +static sunbooleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); +static sunbooleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s); +static sunbooleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s); +static sunbooleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s); +static sunbooleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s); +static sunbooleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c1, sunrealtype *c2, int s); +static sunbooleantype __order6s(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype **A4, sunrealtype *c, int s); static int __ButcherSimplifyingAssumptions(sunrealtype **A, sunrealtype *b, sunrealtype *c, int s); /*--------------------------------------------------------------- Routine to allocate an empty Butcher table structure ---------------------------------------------------------------*/ -ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, booleantype embedded) +ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded) { int i; ARKodeButcherTable B; @@ -141,7 +141,7 @@ ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, sunrealtype *c { int i, j; ARKodeButcherTable B; - booleantype embedded; + sunbooleantype embedded; /* Check for legal number of stages */ if (s < 1) return(NULL); @@ -181,7 +181,7 @@ ARKodeButcherTable ARKodeButcherTable_Copy(ARKodeButcherTable B) { int i, j, s; ARKodeButcherTable Bcopy; - booleantype embedded; + sunbooleantype embedded; /* Check for legal input */ if (B == NULL) return(NULL); @@ -337,7 +337,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int *q, int *p, FILE *ou /* local variables */ int q_SA, p_SA, i, s; sunrealtype **A, *b, *c, *d; - booleantype alltrue; + sunbooleantype alltrue; (*q) = (*p) = 0; /* verify non-NULL Butcher table structure and contents */ @@ -789,7 +789,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, { /* local variables */ int i, j, k, l, m, n, s; - booleantype alltrue; + sunbooleantype alltrue; sunrealtype **A[2], *b[2], *c[2], *d[2]; (*q) = (*p) = 0; @@ -1532,7 +1532,7 @@ static int __dot(sunrealtype *x, sunrealtype *y, int s, sunrealtype *d) ---------------------------------------------------------------*/ /* c(i) = sum(A(i,:)) */ -static booleantype __rowsum(sunrealtype **A, sunrealtype *c, int s) +static sunbooleantype __rowsum(sunrealtype **A, sunrealtype *c, int s) { int i, j; sunrealtype rsum; @@ -1547,7 +1547,7 @@ static booleantype __rowsum(sunrealtype **A, sunrealtype *c, int s) } /* b'*e = 1 */ -static booleantype __order1(sunrealtype *b, int s) +static sunbooleantype __order1(sunrealtype *b, int s) { int i; sunrealtype err = SUN_RCONST(1.0); @@ -1557,7 +1557,7 @@ static booleantype __order1(sunrealtype *b, int s) } /* b'*c = 1/2 */ -static booleantype __order2(sunrealtype *b, sunrealtype *c, int s) +static sunbooleantype __order2(sunrealtype *b, sunrealtype *c, int s) { sunrealtype bc; if (__dot(b,c,s,&bc)) return(SUNFALSE); @@ -1565,7 +1565,7 @@ static booleantype __order2(sunrealtype *b, sunrealtype *c, int s) } /* b'*(c1.*c2) = 1/3 */ -static booleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, int s) +static sunbooleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, int s) { sunrealtype bcc; sunrealtype *tmp = calloc( s, sizeof(sunrealtype) ); @@ -1576,7 +1576,7 @@ static booleantype __order3a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, i } /* b'*(A*c) = 1/6 */ -static booleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, int s) +static sunbooleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, int s) { sunrealtype bAc; sunrealtype *tmp = calloc( s, sizeof(sunrealtype) ); @@ -1587,7 +1587,7 @@ static booleantype __order3b(sunrealtype *b, sunrealtype **A, sunrealtype *c, in } /* b'*(c1.*c2.*c3) = 1/4 */ -static booleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) +static sunbooleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) { sunrealtype bccc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1600,7 +1600,7 @@ static booleantype __order4a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s } /* (b.*c1)'*(A*c2) = 1/8 */ -static booleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, int s) +static sunbooleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, int s) { sunrealtype bcAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1613,7 +1613,7 @@ static booleantype __order4b(sunrealtype *b, sunrealtype *c1, sunrealtype **A, s } /* b'*A*(c1.*c2) = 1/12 */ -static booleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, int s) +static sunbooleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, int s) { sunrealtype bAcc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1626,7 +1626,7 @@ static booleantype __order4c(sunrealtype *b, sunrealtype **A, sunrealtype *c1, s } /* b'*A1*A2*c = 1/24 */ -static booleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c, int s) +static sunbooleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c, int s) { sunrealtype bAAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1639,7 +1639,7 @@ static booleantype __order4d(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*(c1.*c2.*c3.*c4) = 1/5 */ -static booleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) +static sunbooleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) { sunrealtype bcccc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1653,7 +1653,7 @@ static booleantype __order5a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s } /* (b.*c1.*c2)'*(A*c3) = 1/10 */ -static booleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, int s) +static sunbooleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, int s) { sunrealtype bccAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1667,7 +1667,7 @@ static booleantype __order5b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s } /* b'*((A1*c1).*(A2*c2)) = 1/20 */ -static booleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s) +static sunbooleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s) { sunrealtype bAcAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1682,7 +1682,7 @@ static booleantype __order5c(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, } /* (b.*c1)'*A*(c2.*c3) = 1/15 */ -static booleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, int s) +static sunbooleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, int s) { sunrealtype bcAcc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1696,7 +1696,7 @@ static booleantype __order5d(sunrealtype *b, sunrealtype *c1, sunrealtype **A, s } /* b'*A*(c1.*c2.*c3) = 1/20 */ -static booleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) +static sunbooleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) { sunrealtype bAccc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1710,7 +1710,7 @@ static booleantype __order5e(sunrealtype *b, sunrealtype **A, sunrealtype *c1, s } /* (b.*c1)'*A1*A2*c2 = 1/30 */ -static booleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, int s) +static sunbooleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, int s) { sunrealtype bcAAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1724,7 +1724,7 @@ static booleantype __order5f(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, } /* b'*A1*(c1.*(A2*c2)) = 1/40 */ -static booleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s) +static sunbooleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, int s) { sunrealtype bAcAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1738,7 +1738,7 @@ static booleantype __order5g(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, } /* b'*A1*A2*(c1.*c2) = 1/60 */ -static booleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, int s) +static sunbooleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, int s) { sunrealtype bAAcc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1752,7 +1752,7 @@ static booleantype __order5h(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*A1*A2*A3*c = 1/120 */ -static booleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c, int s) +static sunbooleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c, int s) { sunrealtype bAAAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1766,7 +1766,7 @@ static booleantype __order5i(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*(c1.*c2.*c3.*c4.*c5) = 1/6 */ -static booleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, sunrealtype *c5, int s) +static sunbooleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, sunrealtype *c5, int s) { sunrealtype bccccc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1781,7 +1781,7 @@ static booleantype __order6a(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s } /* (b.*c1.*c2.*c3)'*(A*c4) = 1/12 */ -static booleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype **A, sunrealtype *c4, int s) +static sunbooleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype **A, sunrealtype *c4, int s) { sunrealtype bcccAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1796,7 +1796,7 @@ static booleantype __order6b(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s } /* b'*(c1.*(A1*c2).*(A2*c3)) = 1/24 */ -static booleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) +static sunbooleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) { sunrealtype bcAc2; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1812,7 +1812,7 @@ static booleantype __order6c(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, } /* (b.*c1.*c2)'*A*(c3.*c4) = 1/18 */ -static booleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, sunrealtype *c4, int s) +static sunbooleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A, sunrealtype *c3, sunrealtype *c4, int s) { sunrealtype bccAcc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1828,7 +1828,7 @@ static booleantype __order6d(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s } /* (b.*(c1.*c2))'*A1*A2*c3 = 1/36 */ -static booleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A1, sunrealtype **A2, sunrealtype *c3, int s) +static sunbooleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, sunrealtype **A1, sunrealtype **A2, sunrealtype *c3, int s) { sunrealtype bccAAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1844,7 +1844,7 @@ static booleantype __order6e(sunrealtype *b, sunrealtype *c1, sunrealtype *c2, s } /* b'*((A1*A2*c1).*(A3*c2)) = 1/72 */ -static booleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) +static sunbooleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) { sunrealtype bAAcAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1860,7 +1860,7 @@ static booleantype __order6f(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*(c1.*(A*(c2.*c3.*c4))) = 1/24 */ -static booleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) +static sunbooleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) { sunrealtype bcAccc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1875,7 +1875,7 @@ static booleantype __order6g(sunrealtype *b, sunrealtype *c1, sunrealtype **A, s } /* b'*(c1.*(A1*(c2.*(A2*c3)))) = 1/48 */ -static booleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) +static sunbooleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) { sunrealtype bcAcAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1890,7 +1890,7 @@ static booleantype __order6h(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, } /* b'*(c1.*(A1*A2*(c2.*c3))) = 1/72 */ -static booleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s) +static sunbooleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s) { sunrealtype bcAAcc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1905,7 +1905,7 @@ static booleantype __order6i(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, } /* b'*(c1.*(A1*A2*A3*c2)) = 1/144 */ -static booleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s) +static sunbooleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s) { sunrealtype bcAAAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1920,7 +1920,7 @@ static booleantype __order6j(sunrealtype *b, sunrealtype *c1, sunrealtype **A1, } /* b'*A*(c1.*c2.*c3.*c4) = 1/30 */ -static booleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) +static sunbooleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, sunrealtype *c4, int s) { sunrealtype bAcccc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1935,7 +1935,7 @@ static booleantype __order6k(sunrealtype *b, sunrealtype **A, sunrealtype *c1, s } /* b'*A1*(c1.*c2.*(A2*c3)) = 1/60 */ -static booleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) +static sunbooleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype *c2, sunrealtype **A2, sunrealtype *c3, int s) { sunrealtype bAccAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1950,7 +1950,7 @@ static booleantype __order6l(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, } /* b'*A1*((A2*c1).*(A3*c2)) = 1/120 */ -static booleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) +static sunbooleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) { sunrealtype bAAcAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1966,7 +1966,7 @@ static booleantype __order6m(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*A1*(c1.*(A2*(c2.*c3))) = 1/90 */ -static booleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s) +static sunbooleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype *c2, sunrealtype *c3, int s) { sunrealtype bAcAcc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1981,7 +1981,7 @@ static booleantype __order6n(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, } /* b'*A1*(c1.*(A2*A3*c2)) = 1/180 */ -static booleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s) +static sunbooleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c2, int s) { sunrealtype bAcAAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -1996,7 +1996,7 @@ static booleantype __order6o(sunrealtype *b, sunrealtype **A1, sunrealtype *c1, } /* b'*A1*A2*(c1.*c2.*c3) = 1/120 */ -static booleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) +static sunbooleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype *c2, sunrealtype *c3, int s) { sunrealtype bAAccc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -2011,7 +2011,7 @@ static booleantype __order6p(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*A1*A2*(c1.*(A3*c2)) = 1/240 */ -static booleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) +static sunbooleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype *c1, sunrealtype **A3, sunrealtype *c2, int s) { sunrealtype bAAcAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -2026,7 +2026,7 @@ static booleantype __order6q(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*A1*A2*A3*(c1.*c2) = 1/360 */ -static booleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c1, sunrealtype *c2, int s) +static sunbooleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype *c1, sunrealtype *c2, int s) { sunrealtype bAAAcc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -2041,7 +2041,7 @@ static booleantype __order6r(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, } /* b'*A1*A2*A3*A4*c = 1/720 */ -static booleantype __order6s(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype **A4, sunrealtype *c, int s) +static sunbooleantype __order6s(sunrealtype *b, sunrealtype **A1, sunrealtype **A2, sunrealtype **A3, sunrealtype **A4, sunrealtype *c, int s) { sunrealtype bAAAAc; sunrealtype *tmp1 = calloc( s, sizeof(sunrealtype) ); @@ -2064,7 +2064,7 @@ static int __ButcherSimplifyingAssumptions(sunrealtype **A, sunrealtype *b, sunr { int P, Q, R, i, j, k, q; sunrealtype RHS, LHS; - booleantype alltrue; + sunbooleantype alltrue; sunrealtype *tmp = calloc( s, sizeof(sunrealtype) ); /* B(P) */ diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index f56a93feda..c58575a713 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -34,7 +34,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { ARKodeMem ark_mem; ARKodeERKStepMem step_mem; - booleantype nvectorOK; + sunbooleantype nvectorOK; int retval; /* Check that f is supplied */ @@ -105,7 +105,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) step_mem->f = f; /* Update the ARKODE workspace requirements -- UPDATE */ - ark_mem->liw += 41; /* fcn/data ptr, int, long int, sunindextype, booleantype */ + ark_mem->liw += 41; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ ark_mem->lrw += 10; /* Initialize all the counters */ @@ -630,7 +630,7 @@ int erkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int retval; ARKodeMem ark_mem; ARKodeERKStepMem step_mem; - booleantype recomputeRHS; + sunbooleantype recomputeRHS; /* access ARKodeERKStepMem structure */ retval = erkStep_AccessStepMem(arkode_mem, "erkStep_FullRHS", @@ -899,7 +899,7 @@ int erkStep_AccessStepMem(void* arkode_mem, const char *fname, This routine checks if all required vector operations are present. If any of them is missing it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype erkStep_CheckNVector(N_Vector tmpl) +sunbooleantype erkStep_CheckNVector(N_Vector tmpl) { if ( (tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -1002,7 +1002,7 @@ int erkStep_SetButcherTable(ARKodeMem ark_mem) int erkStep_CheckButcherTable(ARKodeMem ark_mem) { int i, j; - booleantype okay; + sunbooleantype okay; ARKodeERKStepMem step_mem; sunrealtype tol = SUN_RCONST(1.0e-12); diff --git a/src/arkode/arkode_erkstep_impl.h b/src/arkode/arkode_erkstep_impl.h index 1c25db0846..44e201fe72 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -78,7 +78,7 @@ int erkStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); /* Internal utility routines */ int erkStep_AccessStepMem(void* arkode_mem, const char *fname, ARKodeMem *ark_mem, ARKodeERKStepMem *step_mem); -booleantype erkStep_CheckNVector(N_Vector tmpl); +sunbooleantype erkStep_CheckNVector(N_Vector tmpl); int erkStep_SetButcherTable(ARKodeMem ark_mem); int erkStep_CheckButcherTable(ARKodeMem ark_mem); int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsm); diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 4d1c079463..a93c210788 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -58,7 +58,7 @@ int ERKStepSetMaxStep(void *arkode_mem, sunrealtype hmax) { int ERKStepSetStopTime(void *arkode_mem, sunrealtype tstop) { return(arkSetStopTime(arkode_mem, tstop)); } int ERKStepSetInterpolateStopTime(void *arkode_mem, - booleantype interp) { + sunbooleantype interp) { return(arkSetInterpolateStopTime(arkode_mem, interp)); } int ERKStepClearStopTime(void *arkode_mem) { return(arkClearStopTime(arkode_mem)); } diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 65a1a0ebd3..8dbb42c986 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -153,7 +153,7 @@ typedef int (*ARKLinsolInitFn)(void* arkode_mem); typedef int (*ARKLinsolSetupFn)(void* arkode_mem, int convfail, sunrealtype tpred, N_Vector ypred, N_Vector fpred, - booleantype *jcurPtr, + sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); typedef int (*ARKLinsolSolveFn)(void* arkode_mem, N_Vector b, @@ -188,7 +188,7 @@ typedef int (*ARKTimestepAttachMasssolFn)(void* arkode_mem, ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn mfree, - booleantype time_dep, + sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void *mass_mem); typedef void (*ARKTimestepDisableLSetup)(void* arkode_mem); @@ -199,8 +199,8 @@ typedef ARKRhsFn (*ARKTimestepGetImplicitRHSFn)(void* arkode_mem); typedef int (*ARKTimestepGetGammasFn)(void* arkode_mem, sunrealtype *gamma, sunrealtype *gamrat, - booleantype **jcur, - booleantype *dgamma_fail); + sunbooleantype **jcur, + sunbooleantype *dgamma_fail); typedef int (*ARKTimestepFullRHSFn)(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); typedef int (*ARKTimestepStepFn)(void* arkode_mem, sunrealtype *dsm, @@ -302,17 +302,17 @@ struct ARKodeMemRec sunrealtype reltol; /* relative tolerance */ sunrealtype Sabstol; /* scalar absolute solution tolerance */ N_Vector Vabstol; /* vector absolute solution tolerance */ - booleantype atolmin0; /* flag indicating that min(abstol) = 0 */ + sunbooleantype atolmin0; /* flag indicating that min(abstol) = 0 */ sunrealtype SRabstol; /* scalar absolute residual tolerance */ N_Vector VRabstol; /* vector absolute residual tolerance */ - booleantype Ratolmin0; /* flag indicating that min(Rabstol) = 0 */ - booleantype user_efun; /* SUNTRUE if user sets efun */ + sunbooleantype Ratolmin0; /* flag indicating that min(Rabstol) = 0 */ + sunbooleantype user_efun; /* SUNTRUE if user sets efun */ ARKEwtFn efun; /* function to set ewt */ void *e_data; /* user pointer passed to efun */ - booleantype user_rfun; /* SUNTRUE if user sets rfun */ + sunbooleantype user_rfun; /* SUNTRUE if user sets rfun */ ARKRwtFn rfun; /* function to set rwt */ void *r_data; /* user pointer passed to rfun */ - booleantype constraintsSet; /* check inequality constraints */ + sunbooleantype constraintsSet; /* check inequality constraints */ /* Time stepper module */ ARKTimestepAttachLinsolFn step_attachlinsol; @@ -332,7 +332,7 @@ struct ARKodeMemRec /* N_Vector storage */ N_Vector ewt; /* error weight vector */ N_Vector rwt; /* residual weight vector */ - booleantype rwt_is_ewt; /* SUNTRUE if rwt is a pointer to ewt */ + sunbooleantype rwt_is_ewt; /* SUNTRUE if rwt is a pointer to ewt */ N_Vector ycur; /* pointer to user-provided solution memory; used as evolving solution by the timestepper modules */ N_Vector yn; /* solution from the last successful step */ @@ -348,8 +348,8 @@ struct ARKodeMemRec ARKInterp interp; /* Tstop information */ - booleantype tstopset; - booleantype tstopinterp; + sunbooleantype tstopset; + sunbooleantype tstopinterp; sunrealtype tstop; /* Time step data */ @@ -365,7 +365,7 @@ struct ARKodeMemRec sunrealtype tcur; /* current internal value of t (changes with each stage) */ sunrealtype tretlast; /* value of tret last returned by ARKODE */ - booleantype fixedstep; /* flag to disable temporal adaptivity */ + sunbooleantype fixedstep; /* flag to disable temporal adaptivity */ ARKodeHAdaptMem hadapt_mem; /* time step adaptivity structure */ @@ -387,7 +387,7 @@ struct ARKodeMemRec long int nconstrfails; /* number of constraint failures */ /* Diagnostic output */ - booleantype report; /* flag to enable/disable diagnostic output */ + sunbooleantype report; /* flag to enable/disable diagnostic output */ FILE *diagfp; /* diagnostic outputs are sent to diagfp */ /* Space requirements for ARKODE */ @@ -402,14 +402,14 @@ struct ARKodeMemRec sunrealtype terr; /* error in tn for compensated sums */ sunrealtype hold; /* last successful h value used */ sunrealtype tolsf; /* tolerance scale factor (suggestion to user) */ - booleantype VabstolMallocDone; - booleantype VRabstolMallocDone; - booleantype MallocDone; - booleantype initsetup; /* denotes a call to InitialSetup is needed */ + sunbooleantype VabstolMallocDone; + sunbooleantype VRabstolMallocDone; + sunbooleantype MallocDone; + sunbooleantype initsetup; /* denotes a call to InitialSetup is needed */ int init_type; /* initialization type (see constants above) */ - booleantype firststage; /* denotes first stage in simulation */ - booleantype initialized; /* denotes arkInitialSetup has been done */ - booleantype call_fullrhs; /* denotes fn needs updating after each step */ + sunbooleantype firststage; /* denotes first stage in simulation */ + sunbooleantype initialized; /* denotes arkInitialSetup has been done */ + sunbooleantype call_fullrhs; /* denotes fn needs updating after each step */ /* Error handler function and error ouput file */ ARKErrHandlerFn ehfun; /* error messages are handled by ehfun */ @@ -433,7 +433,7 @@ struct ARKodeMemRec sunbooleantype use_compensated_sums; /* XBraid interface variables */ - booleantype force_pass; /* when true the step attempt loop will ignore the + sunbooleantype force_pass; /* when true the step attempt loop will ignore the return value (kflag) from arkCheckTemporalError and set kflag = ARK_SUCCESS to force the step attempt to always pass (if a solver failure did @@ -751,7 +751,7 @@ struct ARKodeMemRec This routine should fill the current value of gamma, the ratio of the current gamma value to the gamma value when the Jacobian/preconditioner was last updated, a pointer to the - time step module internal booleantype variable indicating + time step module internal sunbooleantype variable indicating whether the preconditioner is current, and a logic value indicating whether the gamma value is sufficiently stale to cause recomputation of Jacobian/preconditioner data. Here, @@ -759,7 +759,7 @@ struct ARKodeMemRec matrix, J, in the full nonlinear system Jacobian, A = M - gamma*J. - The time step module must contain a booleantype variable to + The time step module must contain a sunbooleantype variable to provide for the boolentype pointer (jcur). This is only used by iterative linear solvers, so could be NULL for time step modules that only work with direct linear solvers. Optionally, @@ -896,31 +896,31 @@ void arkProcessError(ARKodeMem ark_mem, int error_code, #endif int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type); -booleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector *v); -booleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector **v, +sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector *v); +sunbooleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector **v, sunindextype lrw1, long int *lrw, sunindextype liw1, long int *liw); void arkFreeVec(ARKodeMem ark_mem, N_Vector *v); void arkFreeVecArray(int count, N_Vector **v, sunindextype lrw1, long int *lrw, sunindextype liw1, long int *liw); -booleantype arkResizeVec(ARKodeMem ark_mem, +sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, void *resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl, N_Vector *v); -booleantype arkResizeVecArray(ARKVecResizeFn resize, void *resize_data, +sunbooleantype arkResizeVecArray(ARKVecResizeFn resize, void *resize_data, int count, N_Vector tmpl, N_Vector **v, sunindextype lrw_diff, long int *lrw, sunindextype liw_diff, long int *liw); void arkPrintMem(ARKodeMem ark_mem, FILE *outfile); -booleantype arkCheckTimestepper(ARKodeMem ark_mem); -booleantype arkCheckNvector(N_Vector tmpl); -booleantype arkAllocVectors(ARKodeMem ark_mem, +sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem); +sunbooleantype arkCheckNvector(N_Vector tmpl); +sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl); -booleantype arkResizeVectors(ARKodeMem ark_mem, +sunbooleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, void *resize_data, sunindextype lrw_diff, @@ -996,7 +996,7 @@ int arkSetInitStep(void *arkode_mem, sunrealtype hin); int arkSetMinStep(void *arkode_mem, sunrealtype hmin); int arkSetMaxStep(void *arkode_mem, sunrealtype hmax); int arkSetStopTime(void *arkode_mem, sunrealtype tstop); -int arkSetInterpolateStopTime(void *arkode_mem, booleantype interp); +int arkSetInterpolateStopTime(void *arkode_mem, sunbooleantype interp); int arkClearStopTime(void *arkode_mem); int arkSetFixedStep(void *arkode_mem, sunrealtype hfixed); int arkSetRootDirection(void *arkode_mem, int *rootdir); @@ -1054,7 +1054,7 @@ ARKODE_DIRKTableID arkButcherTableDIRKNameToID(const char *imethod); ARKODE_ERKTableID arkButcherTableERKNameToID(const char *emethod); /* XBraid interface functions */ -int arkSetForcePass(void *arkode_mem, booleantype force_pass); +int arkSetForcePass(void *arkode_mem, sunbooleantype force_pass); int arkGetLastKFlag(void *arkode_mem, int *last_kflag); diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index e59b73d2b4..1e6f60fc3c 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -528,7 +528,7 @@ int arkSetStopTime(void *arkode_mem, sunrealtype tstop) Specifies to use interpolation to fill the solution output at the stop time (instead of a copy). ---------------------------------------------------------------*/ -int arkSetInterpolateStopTime(void *arkode_mem, booleantype interp) +int arkSetInterpolateStopTime(void *arkode_mem, sunbooleantype interp) { ARKodeMem ark_mem; if (arkode_mem==NULL) { @@ -2034,7 +2034,7 @@ int arkWriteParameters(ARKodeMem ark_mem, FILE *fp) Ignore the value of kflag after the temporal error test and force the step to pass. ---------------------------------------------------------------*/ -int arkSetForcePass(void *arkode_mem, booleantype force_pass) +int arkSetForcePass(void *arkode_mem, sunbooleantype force_pass) { ARKodeMem ark_mem; if (arkode_mem==NULL) { diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index c8539e37df..4dfcb32eaa 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -33,7 +33,7 @@ /* Prototypes for internal functions */ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - SUNMatrix M, booleantype jok, booleantype *jcur, + SUNMatrix M, sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -51,8 +51,8 @@ int arkLSSetLinearSolver(void *arkode_mem, SUNLinearSolver LS, ARKLsMem arkls_mem; int retval; SUNLinearSolver_Type LSType; - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Return immediately if either arkode_mem or LS inputs are NULL */ if (arkode_mem == NULL) { @@ -281,14 +281,14 @@ int arkLSSetLinearSolver(void *arkode_mem, SUNLinearSolver LS, mass-matrix-vector product. ---------------------------------------------------------------*/ int arkLSSetMassLinearSolver(void *arkode_mem, SUNLinearSolver LS, - SUNMatrix M, booleantype time_dep) + SUNMatrix M, sunbooleantype time_dep) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; SUNLinearSolver_Type LSType; - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Return immediately if either arkode_mem or LS inputs are NULL */ if (arkode_mem == NULL) { @@ -643,7 +643,7 @@ int arkLSSetJacEvalFrequency(void *arkode_mem, long int msbj) arkLSSetLinearSolutionScaling enables or disables scaling the linear solver solution to account for changes in gamma. ---------------------------------------------------------------*/ -int arkLSSetLinearSolutionScaling(void *arkode_mem, booleantype onoff) +int arkLSSetLinearSolutionScaling(void *arkode_mem, sunbooleantype onoff) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -1644,7 +1644,7 @@ int arkLsATimes(void *arkode_mem, N_Vector v, N_Vector z) void* ark_step_massmem; int retval; sunrealtype gamma, gamrat; - booleantype dgamma_fail, *jcur; + sunbooleantype dgamma_fail, *jcur; /* access ARKLsMem structure */ retval = arkLs_AccessLMem(arkode_mem, "arkLsATimes", @@ -1703,7 +1703,7 @@ int arkLsPSetup(void *arkode_mem) ARKodeMem ark_mem; ARKLsMem arkls_mem; sunrealtype gamma, gamrat; - booleantype dgamma_fail, *jcur; + sunbooleantype dgamma_fail, *jcur; int retval; /* access ARKLsMem structure */ @@ -1749,7 +1749,7 @@ int arkLsPSolve(void *arkode_mem, N_Vector r, N_Vector z, ARKodeMem ark_mem; ARKLsMem arkls_mem; sunrealtype gamma, gamrat; - booleantype dgamma_fail, *jcur; + sunbooleantype dgamma_fail, *jcur; int retval; /* access ARKLsMem structure */ @@ -2203,7 +2203,7 @@ int arkLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, Setup the linear system A = I - gamma J or A = M - gamma J -----------------------------------------------------------------*/ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - SUNMatrix M, booleantype jok, booleantype *jcur, + SUNMatrix M, sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *arkode_mem, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { @@ -2467,7 +2467,7 @@ int arkLsInitialize(void* arkode_mem) This routine then calls the LS 'setup' routine with A. ---------------------------------------------------------------*/ int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, - N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, + N_Vector ypred, N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { ARKodeMem ark_mem = NULL; @@ -2475,7 +2475,7 @@ int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, void* ark_step_massmem = NULL; SUNMatrix M = NULL; sunrealtype gamma, gamrat; - booleantype dgamma_fail, *jcur; + sunbooleantype dgamma_fail, *jcur; int retval; /* access ARKLsMem structure */ @@ -2609,7 +2609,7 @@ int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tnow, ARKodeMem ark_mem; ARKLsMem arkls_mem; sunrealtype gamma, gamrat, delta, deltar, rwt_mean; - booleantype dgamma_fail, *jcur; + sunbooleantype dgamma_fail, *jcur; long int nps_inc; int nli_inc, retval; @@ -2926,7 +2926,7 @@ int arkLsMassSetup(void *arkode_mem, sunrealtype t, N_Vector vtemp1, { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; - booleantype call_mtsetup, call_mvsetup, call_lssetup; + sunbooleantype call_mtsetup, call_mvsetup, call_lssetup; int retval; /* access ARKLsMassMem structure */ diff --git a/src/arkode/arkode_ls_impl.h b/src/arkode/arkode_ls_impl.h index bfc0f5c55b..75948192d7 100644 --- a/src/arkode/arkode_ls_impl.h +++ b/src/arkode/arkode_ls_impl.h @@ -46,17 +46,17 @@ extern "C" { typedef struct ARKLsMemRec { /* Linear solver type information */ - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Jacobian construction & storage */ - booleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ + sunbooleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ ARKLsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* user data is passed to jac */ - booleantype jbad; /* heuristic suggestion for pset */ + sunbooleantype jbad; /* heuristic suggestion for pset */ /* Matrix-based solver, scale solution to account for change in gamma */ - booleantype scalesol; + sunbooleantype scalesol; /* Iterative solver tolerance */ sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ @@ -105,7 +105,7 @@ typedef struct ARKLsMemRec { (b) internal jtimes - Jt_data == arkode_mem - jtimesDQ == SUNTRUE */ - booleantype jtimesDQ; + sunbooleantype jtimesDQ; ARKLsJacTimesSetupFn jtsetup; ARKLsJacTimesVecFn jtimes; ARKRhsFn Jt_f; @@ -119,7 +119,7 @@ typedef struct ARKLsMemRec { * (b) internal linsys function: * - user_linsys = SUNFALSE * - A_data = cvode_mem */ - booleantype user_linsys; + sunbooleantype user_linsys; ARKLsLinSysFn linsys; void* A_data; @@ -136,8 +136,8 @@ typedef struct ARKLsMemRec { typedef struct ARKLsMassMemRec { /* Linear solver type information */ - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Mass matrix construction & storage */ ARKLsMassFn mass; /* user-provided mass matrix routine to call */ @@ -150,7 +150,7 @@ typedef struct ARKLsMassMemRec { sunrealtype nrmfac; /* integrator -> LS norm conversion factor */ /* Statistics and associated parameters */ - booleantype time_dependent; /* flag whether M depends on t */ + sunbooleantype time_dependent; /* flag whether M depends on t */ sunrealtype msetuptime; /* "t" value at last msetup call */ long int nmsetups; /* total # mass matrix-solver setups */ long int nmsolves; /* total # mass matrix-solver solves */ @@ -226,7 +226,7 @@ int arkLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, int arkLsInitialize(void* arkode_mem); int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, - N_Vector ypred, N_Vector fpred, booleantype* jcurPtr, + N_Vector ypred, N_Vector fpred, sunbooleantype* jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tcur, @@ -261,7 +261,7 @@ int arkLs_AccessMassMem(void* arkode_mem, const char* fname, int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, - SUNMatrix M, booleantype time_dep); + SUNMatrix M, sunbooleantype time_dep); int arkLSSetJacFn(void* arkode_mem, ARKLsJacFn jac); int arkLSSetMassFn(void* arkode_mem, ARKLsMassFn mass); @@ -270,7 +270,7 @@ int arkLSSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); int arkLSSetNormFactor(void* arkode_mem, sunrealtype nrmfac); int arkLSSetMassNormFactor(void* arkode_mem, sunrealtype nrmfac); int arkLSSetJacEvalFrequency(void* arkode_mem, long int msbj); -int arkLSSetLinearSolutionScaling(void* arkode_mem, booleantype onoff); +int arkLSSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); int arkLSSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve); int arkLSSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, diff --git a/src/arkode/arkode_mri_tables.c b/src/arkode/arkode_mri_tables.c index d2630ed35b..08bbee3f11 100644 --- a/src/arkode/arkode_mri_tables.c +++ b/src/arkode/arkode_mri_tables.c @@ -217,7 +217,7 @@ MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p) { int i, j, stages; - booleantype padding; + sunbooleantype padding; sunrealtype Asum; sunrealtype ***C; MRISTEP_METHOD_TYPE type; diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 016b8d582e..9291de64d7 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -40,7 +40,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, ARKodeMem ark_mem; /* outer ARKODE memory */ ARKodeMRIStepMem step_mem; /* outer stepper memory */ SUNNonlinearSolver NLS; /* default nonlin solver */ - booleantype nvectorOK; + sunbooleantype nvectorOK; int retval; /* Check that at least one of fse, fsi is supplied and is to be used*/ @@ -131,7 +131,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, step_mem->implicit_rhs = (fsi == NULL) ? SUNFALSE : SUNTRUE; /* Update the ARKODE workspace requirements */ - ark_mem->liw += 42; /* fcn/data ptr, int, long int, sunindextype, booleantype */ + ark_mem->liw += 42; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ ark_mem->lrw += 10; /* Create a default Newton NLS object (just in case; will be deleted if @@ -932,8 +932,8 @@ ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem) whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ int mriStep_GetGammas(void* arkode_mem, sunrealtype *gamma, - sunrealtype *gamrat, booleantype **jcur, - booleantype *dgamma_fail) + sunrealtype *gamrat, sunbooleantype **jcur, + sunbooleantype *dgamma_fail) { ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; @@ -974,7 +974,7 @@ int mriStep_Init(void* arkode_mem, int init_type) ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval, j; - booleantype reset_efun; + sunbooleantype reset_efun; /* access ARKodeMRIStepMem structure */ retval = mriStep_AccessStepMem(arkode_mem, "mriStep_Init", @@ -1666,7 +1666,7 @@ int mriStep_AccessStepMem(void* arkode_mem, const char *fname, This routine checks if all required vector operations are present. If any of them is missing it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype mriStep_CheckNVector(N_Vector tmpl) +sunbooleantype mriStep_CheckNVector(N_Vector tmpl) { if ( (tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -1800,7 +1800,7 @@ int mriStep_SetCoupling(ARKodeMem ark_mem) int mriStep_CheckCoupling(ARKodeMem ark_mem) { int i, j, k; - booleantype okay; + sunbooleantype okay; ARKodeMRIStepMem step_mem; sunrealtype Gabs, Wabs; const sunrealtype tol = SUN_RCONST(100.0)*SUN_UNIT_ROUNDOFF; diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index aad446990c..38db6d481e 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -60,11 +60,11 @@ typedef struct ARKodeMRIStepMemRec { /* MRI problem specification */ ARKRhsFn fse; /* y' = fse(t,y) + fsi(t,y) + ff(t,y) */ ARKRhsFn fsi; - booleantype linear; /* SUNTRUE if fi is linear */ - booleantype linear_timedep; /* SUNTRUE if dfi/dy depends on t */ - booleantype explicit_rhs; /* SUNTRUE if fse is provided */ - booleantype implicit_rhs; /* SUNTRUE if fsi is provided */ - booleantype deduce_rhs; /* SUNTRUE if fi is deduced after + sunbooleantype linear; /* SUNTRUE if fi is linear */ + sunbooleantype linear_timedep; /* SUNTRUE if dfi/dy depends on t */ + sunbooleantype explicit_rhs; /* SUNTRUE if fse is provided */ + sunbooleantype implicit_rhs; /* SUNTRUE if fsi is provided */ + sunbooleantype deduce_rhs; /* SUNTRUE if fi is deduced after a nonlinear solve */ /* Outer RK method storage and parameters */ @@ -87,7 +87,7 @@ typedef struct ARKodeMRIStepMemRec { N_Vector zcor; /* stage correction */ int istage; /* current stage index */ SUNNonlinearSolver NLS; /* generic SUNNonlinearSolver object */ - booleantype ownNLS; /* flag indicating ownership of NLS */ + sunbooleantype ownNLS; /* flag indicating ownership of NLS */ ARKRhsFn nls_fsi; /* fsi(t,y) used in the nonlinear solver */ sunrealtype gamma; /* gamma = h * A(i,i) */ sunrealtype gammap; /* gamma at the last setup call */ @@ -109,7 +109,7 @@ typedef struct ARKodeMRIStepMemRec { int maxcor; /* max num iterations for solving the nonlinear equation */ int convfail; /* NLS fail flag (for interface routines) */ - booleantype jcur; /* is Jacobian info for lin solver current? */ + sunbooleantype jcur; /* is Jacobian info for lin solver current? */ ARKStagePredictFn stage_predict; /* User-supplied stage predictor */ /* Linear Solver Data */ @@ -199,8 +199,8 @@ int mriStep_Init(void* arkode_mem, int init_type); void* mriStep_GetLmem(void* arkode_mem); ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem); int mriStep_GetGammas(void* arkode_mem, sunrealtype *gamma, - sunrealtype *gamrat, booleantype **jcur, - booleantype *dgamma_fail); + sunrealtype *gamrat, sunbooleantype **jcur, + sunbooleantype *dgamma_fail); int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); int mriStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); @@ -208,7 +208,7 @@ int mriStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr); /* Internal utility routines */ int mriStep_AccessStepMem(void* arkode_mem, const char *fname, ARKodeMem *ark_mem, ARKodeMRIStepMem *step_mem); -booleantype mriStep_CheckNVector(N_Vector tmpl); +sunbooleantype mriStep_CheckNVector(N_Vector tmpl); int mriStep_SetCoupling(ARKodeMem ark_mem); int mriStep_CheckCoupling(ARKodeMem ark_mem); int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, @@ -227,7 +227,7 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag); /* private functions passed to nonlinear solver */ int mriStep_NlsResidual(N_Vector yy, N_Vector res, void* arkode_mem); int mriStep_NlsFPFunction(N_Vector yy, N_Vector res, void* arkode_mem); -int mriStep_NlsLSetup(booleantype jbad, booleantype* jcur, void* arkode_mem); +int mriStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_mem); int mriStep_NlsLSolve(N_Vector delta, void* arkode_mem); int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem); diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 88a721664e..5d740976f0 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -47,7 +47,7 @@ int MRIStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { int MRIStepSetStopTime(void *arkode_mem, sunrealtype tstop) { return(arkSetStopTime(arkode_mem, tstop)); } int MRIStepSetInterpolateStopTime(void *arkode_mem, - booleantype interp) { + sunbooleantype interp) { return(arkSetInterpolateStopTime(arkode_mem, interp)); } int MRIStepClearStopTime(void *arkode_mem) { return(arkClearStopTime(arkode_mem)); } @@ -74,7 +74,7 @@ int MRIStepSetJacFn(void *arkode_mem, ARKLsJacFn jac) { return(arkLSSetJacFn(arkode_mem, jac)); } int MRIStepSetJacEvalFrequency(void *arkode_mem, long int msbj) { return(arkLSSetJacEvalFrequency(arkode_mem, msbj)); } -int MRIStepSetLinearSolutionScaling(void *arkode_mem, booleantype onoff) { +int MRIStepSetLinearSolutionScaling(void *arkode_mem, sunbooleantype onoff) { return(arkLSSetLinearSolutionScaling(arkode_mem, onoff)); } int MRIStepSetEpsLin(void *arkode_mem, sunrealtype eplifac) { return(arkLSSetEpsLin(arkode_mem, eplifac)); } diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index a705605ba2..e6f58320e5 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -267,7 +267,7 @@ int mriStep_NlsInit(ARKodeMem ark_mem) int mriStep_Nls(ARKodeMem ark_mem, int nflag) { ARKodeMRIStepMem step_mem; - booleantype callLSetup; + sunbooleantype callLSetup; long int nls_iters_inc = 0; long int nls_fails_inc = 0; int retval; @@ -355,7 +355,7 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag) This routine wraps the ARKODE linear solver interface 'setup' routine for use by the nonlinear solver object. ---------------------------------------------------------------*/ -int mriStep_NlsLSetup(booleantype jbad, booleantype* jcur, void* arkode_mem) +int mriStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_mem) { ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; diff --git a/src/arkode/arkode_root.c b/src/arkode/arkode_root.c index f1c8ebc37e..e839d79bfb 100644 --- a/src/arkode/arkode_root.c +++ b/src/arkode/arkode_root.c @@ -179,7 +179,7 @@ int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) return(ARK_MEM_FAIL); } ark_mem->root_mem->gactive = NULL; - ark_mem->root_mem->gactive = (booleantype *) malloc(nrt*sizeof(booleantype)); + ark_mem->root_mem->gactive = (sunbooleantype *) malloc(nrt*sizeof(sunbooleantype)); if (ark_mem->root_mem->gactive == NULL) { free(ark_mem->root_mem->glo); ark_mem->root_mem->glo = NULL; free(ark_mem->root_mem->ghi); ark_mem->root_mem->ghi = NULL; @@ -304,7 +304,7 @@ int arkRootCheck1(void* arkode_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; ARKodeMem ark_mem; ARKodeRootMem rootmem; if (arkode_mem == NULL) { @@ -382,7 +382,7 @@ int arkRootCheck2(void* arkode_mem) { int i, retval; sunrealtype smallh, tplus; - booleantype zroot; + sunbooleantype zroot; ARKodeMem ark_mem; ARKodeRootMem rootmem; if (arkode_mem == NULL) { @@ -606,7 +606,7 @@ int arkRootfind(void* arkode_mem) { sunrealtype alpha, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; - booleantype zroot, sgnchg; + sunbooleantype zroot, sgnchg; ARKodeMem ark_mem; ARKodeRootMem rootmem; if (arkode_mem == NULL) { diff --git a/src/arkode/arkode_root_impl.h b/src/arkode/arkode_root_impl.h index c3d4007983..14621b7965 100644 --- a/src/arkode/arkode_root_impl.h +++ b/src/arkode/arkode_root_impl.h @@ -65,7 +65,7 @@ typedef struct ARKodeRootMemRec { int taskc; /* copy of parameter itask */ int irfnd; /* flag showing whether last step had a root */ long int nge; /* counter for g evaluations */ - booleantype *gactive; /* array with active/inactive event functions */ + sunbooleantype *gactive; /* array with active/inactive event functions */ int mxgnull; /* num. warning messages about possible g==0 */ void *root_data; /* pointer to user_data */ diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 950edbb428..5bb9b973f3 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -38,7 +38,7 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, { ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; - booleantype nvectorOK = 0; + sunbooleantype nvectorOK = 0; int retval = 0; /* Check that f1 and f2 are supplied */ @@ -791,7 +791,7 @@ int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, This routine checks if all required vector operations are present. If any of them is missing it returns SUNFALSE. ---------------------------------------------------------------*/ -booleantype sprkStep_CheckNVector(N_Vector tmpl) +sunbooleantype sprkStep_CheckNVector(N_Vector tmpl) { if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || (tmpl->ops->nvlinearsum == NULL) || (tmpl->ops->nvconst == NULL) || diff --git a/src/arkode/arkode_sprkstep_impl.h b/src/arkode/arkode_sprkstep_impl.h index b24f3b62f8..95731cfb8a 100644 --- a/src/arkode/arkode_sprkstep_impl.h +++ b/src/arkode/arkode_sprkstep_impl.h @@ -76,7 +76,7 @@ int sprkStep_TakeStep_Compensated(void* arkode_mem, sunrealtype* dsmPtr, /* Internal utility routines */ int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, ARKodeSPRKStepMem* step_mem); -booleantype sprkStep_CheckNVector(N_Vector tmpl); +sunbooleantype sprkStep_CheckNVector(N_Vector tmpl); /* f1 = p' (Force evaluation) */ int sprkStep_f1(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, N_Vector f1, void* user_data); diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index fb9a10f775..c96d702a8f 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -121,7 +121,7 @@ /* Private Helper Functions Prototypes */ /*=================================================================*/ -static booleantype cvCheckNvector(N_Vector tmpl); +static sunbooleantype cvCheckNvector(N_Vector tmpl); /* Initial setup */ @@ -129,7 +129,7 @@ static int cvInitialSetup(CVodeMem cv_mem); /* Memory allocation/deallocation */ -static booleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl); +static sunbooleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl); static void cvFreeVectors(CVodeMem cv_mem); static int cvEwtSetSS(CVodeMem cv_mem, N_Vector ycur, N_Vector weight); @@ -137,7 +137,7 @@ static int cvEwtSetSV(CVodeMem cv_mem, N_Vector ycur, N_Vector weight); #ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS extern -int cvEwtSetSS_fused(const booleantype atolmin0, +int cvEwtSetSS_fused(const sunbooleantype atolmin0, const sunrealtype reltol, const sunrealtype Sabstol, const N_Vector ycur, @@ -145,7 +145,7 @@ int cvEwtSetSS_fused(const booleantype atolmin0, N_Vector weight); extern -int cvEwtSetSV_fused(const booleantype atolmin0, +int cvEwtSetSV_fused(const sunbooleantype atolmin0, const sunrealtype reltol, const N_Vector Vabstol, const N_Vector ycur, @@ -391,7 +391,7 @@ void *CVodeCreate(int lmm, SUNContext sunctx) int CVodeInit(void *cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0) { CVodeMem cv_mem; - booleantype nvectorOK, allocOK; + sunbooleantype nvectorOK, allocOK; sunindextype lrw1, liw1; int i,k, retval; SUNNonlinearSolver NLS; @@ -941,7 +941,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) } cv_mem->cv_gactive = NULL; - cv_mem->cv_gactive = (booleantype *) malloc(nrt*sizeof(booleantype)); + cv_mem->cv_gactive = (sunbooleantype *) malloc(nrt*sizeof(sunbooleantype)); if (cv_mem->cv_gactive == NULL) { free(cv_mem->cv_glo); cv_mem->cv_glo = NULL; free(cv_mem->cv_ghi); cv_mem->cv_ghi = NULL; @@ -996,7 +996,7 @@ int CVode(void *cvode_mem, sunrealtype tout, N_Vector yout, int retval, hflag, kflag, istate, ir, ier, irfndp; int ewtsetOK; sunrealtype troundoff, tout_hin, rh, nrm; - booleantype inactive_roots; + sunbooleantype inactive_roots; /* * ------------------------------------- @@ -1665,7 +1665,7 @@ void CVodeFree(void **cvode_mem) * If any of them is missing it returns SUNFALSE. */ -static booleantype cvCheckNvector(N_Vector tmpl) +static sunbooleantype cvCheckNvector(N_Vector tmpl) { if((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -1702,7 +1702,7 @@ static booleantype cvCheckNvector(N_Vector tmpl) * allocated here. */ -static booleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl) +static sunbooleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl) { int i, j; @@ -1845,7 +1845,7 @@ static void cvFreeVectors(CVodeMem cv_mem) static int cvInitialSetup(CVodeMem cv_mem) { int ier; - booleantype conOK; + sunbooleantype conOK; /* Did the user specify tolerances? */ if (cv_mem->cv_itol == CV_NN) { @@ -1974,7 +1974,7 @@ static int cvHin(CVodeMem cv_mem, sunrealtype tout) int retval, sign, count1, count2; sunrealtype tdiff, tdist, tround, hlb, hub; sunrealtype hg, hgs, hs, hnew, hrat, h0, yddnrm; - booleantype hgOK; + sunbooleantype hgOK; /* If tout is too close to tn, give up */ @@ -2177,7 +2177,7 @@ static int cvStep(CVodeMem cv_mem) int nflag, kflag; /* nonlinear solver flags */ int pflag; /* projection return flag */ int eflag; /* error test return flag */ - booleantype doProjection; /* flag to apply projection in this step */ + sunbooleantype doProjection; /* flag to apply projection in this step */ /* Initialize local counters for convergence and error test failures */ @@ -2808,7 +2808,7 @@ static void cvSetTqBDF(CVodeMem cv_mem, sunrealtype hsum, sunrealtype alpha0, static int cvNls(CVodeMem cv_mem, int nflag) { int flag = CV_SUCCESS; - booleantype callSetup; + sunbooleantype callSetup; long int nni_inc = 0; long int nnf_inc = 0; @@ -2887,7 +2887,7 @@ static int cvNls(CVodeMem cv_mem, int nflag) static int cvCheckConstraints(CVodeMem cv_mem) { - booleantype constraintsPassed; + sunbooleantype constraintsPassed; sunrealtype vnorm; N_Vector mm = cv_mem->cv_ftemp; N_Vector tmp = cv_mem->cv_tempv; @@ -3920,7 +3920,7 @@ static int cvRcheck1(CVodeMem cv_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; for (i = 0; i < cv_mem->cv_nrtfn; i++) cv_mem->cv_iroots[i] = 0; cv_mem->cv_tlo = cv_mem->cv_tn; @@ -3988,7 +3988,7 @@ static int cvRcheck2(CVodeMem cv_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; if (cv_mem->cv_irfnd == 0) return(CV_SUCCESS); @@ -4184,7 +4184,7 @@ static int cvRootfind(CVodeMem cv_mem) { sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; - booleantype zroot, sgnchg; + sunbooleantype zroot, sgnchg; imax = 0; diff --git a/src/cvode/cvode_bandpre.c b/src/cvode/cvode_bandpre.c index 3aaf6dde68..d56018af08 100644 --- a/src/cvode/cvode_bandpre.c +++ b/src/cvode/cvode_bandpre.c @@ -35,7 +35,7 @@ /* Prototypes of CVBandPrecSetup and CVBandPrecSolve */ static int CVBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bp_data); static int CVBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, @@ -335,7 +335,7 @@ int CVBandPrecGetNumRhsEvals(void *cvode_mem, long int *nfevalsBP) 1 if the band factorization failed. -----------------------------------------------------------------*/ static int CVBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bp_data) { CVBandPrecData pdata; diff --git a/src/cvode/cvode_bbdpre.c b/src/cvode/cvode_bbdpre.c index eabef77118..c7d6d7ff62 100644 --- a/src/cvode/cvode_bbdpre.c +++ b/src/cvode/cvode_bbdpre.c @@ -37,7 +37,7 @@ /* Prototypes of functions CVBBDPrecSetup and CVBBDPrecSolve */ static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bbd_data); static int CVBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, @@ -445,7 +445,7 @@ int CVBBDPrecGetNumGfnEvals(void *cvode_mem, 1 for a recoverable error (step will be retried). -----------------------------------------------------------------*/ static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bbd_data) { CVBBDPrecData pdata; diff --git a/src/cvode/cvode_diag.c b/src/cvode/cvode_diag.c index 036a114238..f86db8afe0 100644 --- a/src/cvode/cvode_diag.c +++ b/src/cvode/cvode_diag.c @@ -58,7 +58,7 @@ int cvDiagSolve_updateM(const sunrealtype r, N_Vector M); static int CVDiagInit(CVodeMem cv_mem); static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, @@ -339,12 +339,12 @@ static int CVDiagInit(CVodeMem cv_mem) */ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { sunrealtype r; N_Vector ftemp, y; - booleantype invOK; + sunbooleantype invOK; CVDiagMem cvdiag_mem; int retval; @@ -429,7 +429,7 @@ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur) { - booleantype invOK; + sunbooleantype invOK; sunrealtype r; CVDiagMem cvdiag_mem; diff --git a/src/cvode/cvode_fused_gpu.cpp b/src/cvode/cvode_fused_gpu.cpp index 500717b766..d88b02efee 100644 --- a/src/cvode/cvode_fused_gpu.cpp +++ b/src/cvode/cvode_fused_gpu.cpp @@ -73,7 +73,7 @@ void cvEwtSetSS_kernel(const sunindextype length, } extern "C" -int cvEwtSetSS_fused(const booleantype atolMin0, +int cvEwtSetSS_fused(const sunbooleantype atolMin0, const sunrealtype reltol, const sunrealtype Sabstol, const N_Vector ycur, @@ -133,7 +133,7 @@ void cvEwtSetSV_kernel(const sunindextype length, } extern "C" -int cvEwtSetSV_fused(const booleantype atolMin0, +int cvEwtSetSV_fused(const sunbooleantype atolMin0, const sunrealtype reltol, const N_Vector Vabstol, const N_Vector ycur, diff --git a/src/cvode/cvode_fused_stubs.c b/src/cvode/cvode_fused_stubs.c index 6c60976d5b..4c1ebebd92 100644 --- a/src/cvode/cvode_fused_stubs.c +++ b/src/cvode/cvode_fused_stubs.c @@ -32,7 +32,7 @@ * ----------------------------------------------------------------- */ -int cvEwtSetSS_fused(const booleantype atolmin0, +int cvEwtSetSS_fused(const sunbooleantype atolmin0, const sunrealtype reltol, const sunrealtype Sabstol, const N_Vector ycur, @@ -56,7 +56,7 @@ int cvEwtSetSS_fused(const booleantype atolmin0, */ -int cvEwtSetSV_fused(const booleantype atolmin0, +int cvEwtSetSV_fused(const sunbooleantype atolmin0, const sunrealtype reltol, const N_Vector Vabstol, const N_Vector ycur, diff --git a/src/cvode/cvode_hypamgpre.c b/src/cvode/cvode_hypamgpre.c index 0309e4848a..241684b173 100644 --- a/src/cvode/cvode_hypamgpre.c +++ b/src/cvode/cvode_hypamgpre.c @@ -51,7 +51,7 @@ static int CVBoomerAMGSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *hypamg_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -205,7 +205,7 @@ int CVBoomerAMGInit(void *cvode_mem, int ilower, int iupper, int jlower, int jup */ int CVBoomerAMGSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *hypamg_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index e79f809cbd..3eeea40102 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -215,12 +215,12 @@ typedef struct CVodeMemRec { sunrealtype cv_reltol; /* relative tolerance */ sunrealtype cv_Sabstol; /* scalar absolute tolerance */ N_Vector cv_Vabstol; /* vector absolute tolerance */ - booleantype cv_atolmin0; /* flag indicating that min(abstol) = 0 */ - booleantype cv_user_efun; /* SUNTRUE if user sets efun */ + sunbooleantype cv_atolmin0; /* flag indicating that min(abstol) = 0 */ + sunbooleantype cv_user_efun; /* SUNTRUE if user sets efun */ CVEwtFn cv_efun; /* function to set ewt */ void *cv_e_data; /* user pointer passed to efun */ - booleantype cv_constraintsSet; /* constraints vector present: + sunbooleantype cv_constraintsSet; /* constraints vector present: do constraints calc */ /*----------------------- @@ -255,8 +255,8 @@ typedef struct CVodeMemRec { Tstop information -----------------*/ - booleantype cv_tstopset; - booleantype cv_tstopinterp; + sunbooleantype cv_tstopset; + sunbooleantype cv_tstopinterp; sunrealtype cv_tstop; /*--------- @@ -294,7 +294,7 @@ typedef struct CVodeMemRec { sunrealtype cv_crate; /* estimated corrector convergence rate */ sunrealtype cv_delp; /* norm of previous nonlinear solver update */ sunrealtype cv_acnrm; /* | acor | */ - booleantype cv_acnrmcur; /* is | acor | current? */ + sunbooleantype cv_acnrmcur; /* is | acor | current? */ sunrealtype cv_nlscoef; /* coeficient in nonlinear convergence test */ /*------ @@ -360,7 +360,7 @@ typedef struct CVodeMemRec { ---------------------*/ SUNNonlinearSolver NLS; /* nonlinear solver object */ - booleantype ownNLS; /* flag indicating NLS ownership */ + sunbooleantype ownNLS; /* flag indicating NLS ownership */ CVRhsFn nls_f; /* f(t,y(t)) used in the nonlinear solver */ int convfail; /* flag to indicate when a Jacobian update may be needed */ @@ -374,7 +374,7 @@ typedef struct CVodeMemRec { int (*cv_linit)(struct CVodeMemRec *cv_mem); int (*cv_lsetup)(struct CVodeMemRec *cv_mem, int convfail, - N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, + N_Vector ypred, N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); int (*cv_lsolve)(struct CVodeMemRec *cv_mem, N_Vector b, N_Vector weight, @@ -398,7 +398,7 @@ typedef struct CVodeMemRec { sunrealtype cv_h0u; /* actual initial stepsize */ sunrealtype cv_hu; /* last successful h value used */ sunrealtype cv_saved_tq5; /* saved value of tq[5] */ - booleantype cv_jcur; /* is Jacobian info for linear solver current? */ + sunbooleantype cv_jcur; /* is Jacobian info for linear solver current? */ sunrealtype cv_tolsf; /* tolerance scale factor */ int cv_qmax_alloc; /* value of qmax used when allocating mem */ int cv_indx_acor; /* index of the zn vector with saved acor */ @@ -407,9 +407,9 @@ typedef struct CVodeMemRec { Flags turned ON by CVodeInit and read by CVodeReInit --------------------------------------------------------------------*/ - booleantype cv_VabstolMallocDone; - booleantype cv_MallocDone; - booleantype cv_constraintsMallocDone; + sunbooleantype cv_VabstolMallocDone; + sunbooleantype cv_MallocDone; + sunbooleantype cv_constraintsMallocDone; /*------------------------------------------- Error handler function and error ouput file @@ -429,7 +429,7 @@ typedef struct CVodeMemRec { Stability Limit Detection -------------------------*/ - booleantype cv_sldeton; /* is Stability Limit Detection on? */ + sunbooleantype cv_sldeton; /* is Stability Limit Detection on? */ sunrealtype cv_ssdat[6][4]; /* scaled data array for STALD */ int cv_nscon; /* counter for STALD method */ long int cv_nor; /* counter for number of order reductions */ @@ -453,7 +453,7 @@ typedef struct CVodeMemRec { int cv_taskc; /* copy of parameter itask */ int cv_irfnd; /* flag showing whether last step had a root */ long int cv_nge; /* counter for g evaluations */ - booleantype *cv_gactive; /* array with active/inactive event functions */ + sunbooleantype *cv_gactive; /* array with active/inactive event functions */ int cv_mxgnull; /* number of warning messages about possible g==0 */ /*--------------- @@ -461,8 +461,8 @@ typedef struct CVodeMemRec { ---------------*/ CVodeProjMem proj_mem; /* projection memory structure */ - booleantype proj_enabled; /* flag indicating if projection is enabled */ - booleantype proj_applied; /* flag indicating if projection was applied */ + sunbooleantype proj_enabled; /* flag indicating if projection is enabled */ + sunbooleantype proj_applied; /* flag indicating if projection was applied */ sunrealtype proj_p[L_MAX]; /* coefficients of p(x) (degree q poly) */ /*----------------------- @@ -472,7 +472,7 @@ typedef struct CVodeMemRec { sunrealtype cv_cvals[L_MAX]; /* array of scalars */ N_Vector cv_Xvecs[L_MAX]; /* array of vectors */ - booleantype cv_usefused; /* flag indicating if CVODE specific fused kernels should be used */ + sunbooleantype cv_usefused; /* flag indicating if CVODE specific fused kernels should be used */ } *CVodeMem; @@ -535,7 +535,7 @@ typedef struct CVodeMemRec { /* * ----------------------------------------------------------------- * int (*cv_lsetup)(CVodeMem cv_mem, int convfail, N_Vector ypred, - * N_Vector fpred, booleantype *jcurPtr, + * N_Vector fpred, sunbooleantype *jcurPtr, * N_Vector vtemp1, N_Vector vtemp2, * N_Vector vtemp3); * ----------------------------------------------------------------- diff --git a/src/cvode/cvode_io.c b/src/cvode/cvode_io.c index 8605ef6508..7f4cbe7f08 100644 --- a/src/cvode/cvode_io.c +++ b/src/cvode/cvode_io.c @@ -277,7 +277,7 @@ int CVodeSetMaxHnilWarns(void *cvode_mem, int mxhnil) * Turns on/off the stability limit detection algorithm */ -int CVodeSetStabLimDet(void *cvode_mem, booleantype sldet) +int CVodeSetStabLimDet(void *cvode_mem, sunbooleantype sldet) { CVodeMem cv_mem; @@ -721,7 +721,7 @@ int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop) * the stop time (instead of a copy). */ -int CVodeSetInterpolateStopTime(void *cvode_mem, booleantype interp) +int CVodeSetInterpolateStopTime(void *cvode_mem, sunbooleantype interp) { CVodeMem cv_mem; @@ -1005,7 +1005,7 @@ int CVodeSetConstraints(void *cvode_mem, N_Vector constraints) * Enable or disable integrator specific fused kernels */ -int CVodeSetUseIntegratorFusedKernels(void *cvode_mem, booleantype onoff) +int CVodeSetUseIntegratorFusedKernels(void *cvode_mem, sunbooleantype onoff) { CVodeMem cv_mem; #ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS diff --git a/src/cvode/cvode_ls.c b/src/cvode/cvode_ls.c index 42bc83d705..11e6c857f0 100644 --- a/src/cvode/cvode_ls.c +++ b/src/cvode/cvode_ls.c @@ -39,7 +39,7 @@ =================================================================*/ static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -56,8 +56,8 @@ int CVodeSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, CVodeMem cv_mem; CVLsMem cvls_mem; int retval, LSType; - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Return immediately if either cvode_mem or LS inputs are NULL */ if (cvode_mem == NULL) { @@ -411,7 +411,7 @@ int CVodeSetJacEvalFrequency(void *cvode_mem, long int msbj) /* CVodeSetLinearSolutionScaling enables or disables scaling the linear solver solution to account for changes in gamma. */ -int CVodeSetLinearSolutionScaling(void *cvode_mem, booleantype onoff) +int CVodeSetLinearSolutionScaling(void *cvode_mem, sunbooleantype onoff) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -1311,7 +1311,7 @@ int cvLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, Setup the linear system A = I - gamma J -----------------------------------------------------------------*/ static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *cvode_mem, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { @@ -1531,7 +1531,7 @@ int cvLsInitialize(CVodeMem cv_mem) This routine then calls the LS 'setup' routine with A. -----------------------------------------------------------------*/ int cvLsSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { CVLsMem cvls_mem; diff --git a/src/cvode/cvode_ls_impl.h b/src/cvode/cvode_ls_impl.h index f4f24a1b4e..9b7692d905 100644 --- a/src/cvode/cvode_ls_impl.h +++ b/src/cvode/cvode_ls_impl.h @@ -50,19 +50,19 @@ extern "C" { typedef struct CVLsMemRec { /* Linear solver type information */ - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Jacobian construction & storage */ - booleantype jacDQ; /* SUNTRUE if using internal DQ Jac approx. */ + sunbooleantype jacDQ; /* SUNTRUE if using internal DQ Jac approx. */ CVLsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* user data is passed to jac */ - booleantype jbad; /* heuristic suggestion for pset */ + sunbooleantype jbad; /* heuristic suggestion for pset */ sunrealtype dgmax_jbad; /* if convfail = FAIL_BAD_J and the gamma ratio * * |gamma/gammap-1| < dgmax_jbad then J is bad */ /* Matrix-based solver, scale solution to account for change in gamma */ - booleantype scalesol; + sunbooleantype scalesol; /* Iterative solver tolerance */ sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ @@ -110,7 +110,7 @@ typedef struct CVLsMemRec { * (b) internal jtimes * - jt_data == cvode_mem * - jtimesDQ == SUNTRUE */ - booleantype jtimesDQ; + sunbooleantype jtimesDQ; CVLsJacTimesSetupFn jtsetup; CVLsJacTimesVecFn jtimes; CVRhsFn jt_f; @@ -123,7 +123,7 @@ typedef struct CVLsMemRec { * (b) internal linsys function: * - user_linsys = SUNFALSE * - A_data = cvode_mem */ - booleantype user_linsys; + sunbooleantype user_linsys; CVLsLinSysFn linsys; void* A_data; @@ -158,7 +158,7 @@ int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, /* Generic linit/lsetup/lsolve/lfree interface routines for CVode to call */ int cvLsInitialize(CVodeMem cv_mem); int cvLsSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur); diff --git a/src/cvode/cvode_nls.c b/src/cvode/cvode_nls.c index 2dfbab710e..5349b11892 100644 --- a/src/cvode/cvode_nls.c +++ b/src/cvode/cvode_nls.c @@ -34,7 +34,7 @@ static int cvNlsResidual(N_Vector ycor, N_Vector res, void* cvode_mem); static int cvNlsFPFunction(N_Vector ycor, N_Vector res, void* cvode_mem); -static int cvNlsLSetup(booleantype jbad, booleantype* jcur, void* cvode_mem); +static int cvNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem); static int cvNlsLSolve(N_Vector delta, void* cvode_mem); static int cvNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* cvode_mem); @@ -248,7 +248,7 @@ int cvNlsInit(CVodeMem cvode_mem) } -static int cvNlsLSetup(booleantype jbad, booleantype* jcur, void* cvode_mem) +static int cvNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem) { CVodeMem cv_mem; int retval; diff --git a/src/cvode/cvode_proj.c b/src/cvode/cvode_proj.c index 52628acd31..d87b2a96a1 100644 --- a/src/cvode/cvode_proj.c +++ b/src/cvode/cvode_proj.c @@ -103,7 +103,7 @@ int CVodeSetProjFn(void *cvode_mem, CVProjFn pfun) * ===========================================================================*/ -int CVodeSetProjErrEst(void *cvode_mem, booleantype onoff) +int CVodeSetProjErrEst(void *cvode_mem, sunbooleantype onoff) { int retval; CVodeMem cv_mem; diff --git a/src/cvode/cvode_proj_impl.h b/src/cvode/cvode_proj_impl.h index 70a838aeda..a4f37f7c0f 100644 --- a/src/cvode/cvode_proj_impl.h +++ b/src/cvode/cvode_proj_impl.h @@ -49,9 +49,9 @@ extern "C" { * ---------------------------------------------------------------------------*/ typedef struct CVodeProjMemRec { - booleantype internal_proj; /* use the internal projection algorithm? */ - booleantype err_proj; /* is error projection enabled? */ - booleantype first_proj; /* is this the first time we project? */ + sunbooleantype internal_proj; /* use the internal projection algorithm? */ + sunbooleantype err_proj; /* is error projection enabled? */ + sunbooleantype first_proj; /* is this the first time we project? */ long int freq; /* projection frequency */ long int nstlprj; /* step number of last projection */ diff --git a/src/cvodes/cvodea.c b/src/cvodes/cvodea.c index f2f5e88452..e7b22994e9 100644 --- a/src/cvodes/cvodea.c +++ b/src/cvodes/cvodea.c @@ -64,14 +64,14 @@ static int CVAdataStore(CVodeMem cv_mem, CVckpntMem ck_mem); static int CVAckpntGet(CVodeMem cv_mem, CVckpntMem ck_mem); static int CVAfindIndex(CVodeMem cv_mem, sunrealtype t, - long int *indx, booleantype *newpoint); + long int *indx, sunbooleantype *newpoint); -static booleantype CVAhermiteMalloc(CVodeMem cv_mem); +static sunbooleantype CVAhermiteMalloc(CVodeMem cv_mem); static void CVAhermiteFree(CVodeMem cv_mem); static int CVAhermiteGetY(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS); static int CVAhermiteStorePnt(CVodeMem cv_mem, CVdtpntMem d); -static booleantype CVApolynomialMalloc(CVodeMem cv_mem); +static sunbooleantype CVApolynomialMalloc(CVodeMem cv_mem); static void CVApolynomialFree(CVodeMem cv_mem); static int CVApolynomialGetY(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS); static int CVApolynomialStorePnt(CVodeMem cv_mem, CVdtpntMem d); @@ -384,7 +384,7 @@ int CVodeF(void *cvode_mem, sunrealtype tout, N_Vector yout, CVdtpntMem *dt_mem; long int nstloc; int flag, i; - booleantype allocOK, earlyret; + sunbooleantype allocOK, earlyret; sunrealtype ttest; /* Check if cvode_mem exists */ @@ -1284,7 +1284,7 @@ int CVodeB(void *cvode_mem, sunrealtype tBout, int itaskB) CVckpntMem ck_mem; int sign, flag=0; sunrealtype tfuzz, tBret, tBn; - booleantype gotCheckpoint, isActive, reachedTBout; + sunbooleantype gotCheckpoint, isActive, reachedTBout; /* Check if cvode_mem exists */ @@ -2307,12 +2307,12 @@ static int CVAckpntGet(CVodeMem cv_mem, CVckpntMem ck_mem) */ static int CVAfindIndex(CVodeMem cv_mem, sunrealtype t, - long int *indx, booleantype *newpoint) + long int *indx, sunbooleantype *newpoint) { CVadjMem ca_mem; CVdtpntMem *dt_mem; int sign; - booleantype to_left, to_right; + sunbooleantype to_left, to_right; ca_mem = cv_mem->cv_adj_mem; dt_mem = ca_mem->dt_mem; @@ -2424,13 +2424,13 @@ int CVodeGetAdjY(void *cvode_mem, sunrealtype t, N_Vector y) * at any other time. */ -static booleantype CVAhermiteMalloc(CVodeMem cv_mem) +static sunbooleantype CVAhermiteMalloc(CVodeMem cv_mem) { CVadjMem ca_mem; CVdtpntMem *dt_mem; CVhermiteDataMem content; long int i, ii=0; - booleantype allocOK; + sunbooleantype allocOK; allocOK = SUNTRUE; @@ -2658,7 +2658,7 @@ static int CVAhermiteGetY(CVodeMem cv_mem, sunrealtype t, int flag, is, NS; long int indx; - booleantype newpoint; + sunbooleantype newpoint; /* local variables for fused vector oerations */ int retval; @@ -2819,13 +2819,13 @@ static int CVAhermiteGetY(CVodeMem cv_mem, sunrealtype t, * at any other time. */ -static booleantype CVApolynomialMalloc(CVodeMem cv_mem) +static sunbooleantype CVApolynomialMalloc(CVodeMem cv_mem) { CVadjMem ca_mem; CVdtpntMem *dt_mem; CVpolynomialDataMem content; long int i, ii=0; - booleantype allocOK; + sunbooleantype allocOK; allocOK = SUNTRUE; @@ -2994,7 +2994,7 @@ static int CVApolynomialGetY(CVodeMem cv_mem, sunrealtype t, int flag, dir, order, i, j, is, NS, retval; long int indx, base; - booleantype newpoint; + sunbooleantype newpoint; sunrealtype dt, factor; ca_mem = cv_mem->cv_adj_mem; diff --git a/src/cvodes/cvodea_io.c b/src/cvodes/cvodea_io.c index a5fd7f886b..ca5458de94 100644 --- a/src/cvodes/cvodea_io.c +++ b/src/cvodes/cvodea_io.c @@ -248,7 +248,7 @@ int CVodeSetMaxNumStepsB(void *cvode_mem, int which, long int mxstepsB) return(flag); } -int CVodeSetStabLimDetB(void *cvode_mem, int which, booleantype stldetB) +int CVodeSetStabLimDetB(void *cvode_mem, int which, sunbooleantype stldetB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -463,7 +463,7 @@ int CVodeSetConstraintsB(void *cvode_mem, int which, N_Vector constraintsB) * CVODES quadrature optional input functions */ -int CVodeSetQuadErrConB(void *cvode_mem, int which, booleantype errconQB) +int CVodeSetQuadErrConB(void *cvode_mem, int which, sunbooleantype errconQB) { CVodeMem cv_mem; CVadjMem ca_mem; diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 72019016f0..7500d58e9f 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -306,7 +306,7 @@ /* Private Helper Functions Prototypes */ /*=================================================================*/ -static booleantype cvCheckNvector(N_Vector tmpl); +static sunbooleantype cvCheckNvector(N_Vector tmpl); /* Initial setup */ @@ -314,16 +314,16 @@ static int cvInitialSetup(CVodeMem cv_mem); /* Memory allocation/deallocation */ -static booleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl); +static sunbooleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl); static void cvFreeVectors(CVodeMem cv_mem); -static booleantype cvQuadAllocVectors(CVodeMem cv_mem, N_Vector tmpl); +static sunbooleantype cvQuadAllocVectors(CVodeMem cv_mem, N_Vector tmpl); static void cvQuadFreeVectors(CVodeMem cv_mem); -static booleantype cvSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl); +static sunbooleantype cvSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl); static void cvSensFreeVectors(CVodeMem cv_mem); -static booleantype cvQuadSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl); +static sunbooleantype cvQuadSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl); static void cvQuadSensFreeVectors(CVodeMem cv_mem); @@ -677,7 +677,7 @@ void *CVodeCreate(int lmm, SUNContext sunctx) int CVodeInit(void *cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0) { CVodeMem cv_mem; - booleantype nvectorOK, allocOK; + sunbooleantype nvectorOK, allocOK; sunindextype lrw1, liw1; int i,k, retval; SUNNonlinearSolver NLS; @@ -1131,7 +1131,7 @@ int CVodeWFtolerances(void *cvode_mem, CVEwtFn efun) int CVodeQuadInit(void *cvode_mem, CVQuadRhsFn fQ, N_Vector yQ0) { CVodeMem cv_mem; - booleantype allocOK; + sunbooleantype allocOK; sunindextype lrw1Q, liw1Q; /* Check cvode_mem */ @@ -1365,7 +1365,7 @@ int CVodeQuadSVtolerances(void *cvode_mem, sunrealtype reltolQ, N_Vector abstolQ int CVodeSensInit(void *cvode_mem, int Ns, int ism, CVSensRhsFn fS, N_Vector *yS0) { CVodeMem cv_mem; - booleantype allocOK; + sunbooleantype allocOK; int is, retval; SUNNonlinearSolver NLS; @@ -1559,7 +1559,7 @@ int CVodeSensInit(void *cvode_mem, int Ns, int ism, CVSensRhsFn fS, N_Vector *yS int CVodeSensInit1(void *cvode_mem, int Ns, int ism, CVSensRhs1Fn fS1, N_Vector *yS0) { CVodeMem cv_mem; - booleantype allocOK; + sunbooleantype allocOK; int is, retval; SUNNonlinearSolver NLS; @@ -2029,7 +2029,7 @@ int CVodeSensSStolerances(void *cvode_mem, sunrealtype reltolS, sunrealtype *abs if ( !(cv_mem->cv_SabstolSMallocDone) ) { cv_mem->cv_SabstolS = NULL; cv_mem->cv_SabstolS = (sunrealtype *)malloc(cv_mem->cv_Ns*sizeof(sunrealtype)); - cv_mem->cv_atolSmin0 = (booleantype *)malloc(cv_mem->cv_Ns*sizeof(booleantype)); + cv_mem->cv_atolSmin0 = (sunbooleantype *)malloc(cv_mem->cv_Ns*sizeof(sunbooleantype)); cv_mem->cv_lrw += cv_mem->cv_Ns; cv_mem->cv_SabstolSMallocDone = SUNTRUE; } @@ -2102,7 +2102,7 @@ int CVodeSensSVtolerances(void *cvode_mem, sunrealtype reltolS, N_Vector *absto if ( !(cv_mem->cv_VabstolSMallocDone) ) { cv_mem->cv_VabstolS = N_VCloneVectorArray(cv_mem->cv_Ns, cv_mem->cv_tempv); - cv_mem->cv_atolSmin0 = (booleantype *)malloc(cv_mem->cv_Ns*sizeof(booleantype)); + cv_mem->cv_atolSmin0 = (sunbooleantype *)malloc(cv_mem->cv_Ns*sizeof(sunbooleantype)); cv_mem->cv_lrw += cv_mem->cv_Ns*cv_mem->cv_lrw1; cv_mem->cv_liw += cv_mem->cv_Ns*cv_mem->cv_liw1; cv_mem->cv_VabstolSMallocDone = SUNTRUE; @@ -2157,7 +2157,7 @@ int CVodeSensEEtolerances(void *cvode_mem) int CVodeQuadSensInit(void *cvode_mem, CVQuadSensRhsFn fQS, N_Vector *yQS0) { CVodeMem cv_mem; - booleantype allocOK; + sunbooleantype allocOK; int is, retval; /* Check cvode_mem */ @@ -2373,7 +2373,7 @@ int CVodeQuadSensSStolerances(void *cvode_mem, sunrealtype reltolQS, sunrealtype if ( !(cv_mem->cv_SabstolQSMallocDone) ) { cv_mem->cv_SabstolQS = NULL; cv_mem->cv_SabstolQS = (sunrealtype *)malloc(cv_mem->cv_Ns*sizeof(sunrealtype)); - cv_mem->cv_atolQSmin0 = (booleantype *)malloc(cv_mem->cv_Ns*sizeof(booleantype)); + cv_mem->cv_atolQSmin0 = (sunbooleantype *)malloc(cv_mem->cv_Ns*sizeof(sunbooleantype)); cv_mem->cv_lrw += cv_mem->cv_Ns; cv_mem->cv_SabstolQSMallocDone = SUNTRUE; } @@ -2454,7 +2454,7 @@ int CVodeQuadSensSVtolerances(void *cvode_mem, sunrealtype reltolQS, N_Vector * if ( !(cv_mem->cv_VabstolQSMallocDone) ) { cv_mem->cv_VabstolQS = N_VCloneVectorArray(cv_mem->cv_Ns, cv_mem->cv_tempvQ); - cv_mem->cv_atolQSmin0 = (booleantype *)malloc(cv_mem->cv_Ns*sizeof(booleantype)); + cv_mem->cv_atolQSmin0 = (sunbooleantype *)malloc(cv_mem->cv_Ns*sizeof(sunbooleantype)); cv_mem->cv_lrw += cv_mem->cv_Ns*cv_mem->cv_lrw1Q; cv_mem->cv_liw += cv_mem->cv_Ns*cv_mem->cv_liw1Q; cv_mem->cv_VabstolQSMallocDone = SUNTRUE; @@ -2674,7 +2674,7 @@ int CVodeRootInit(void *cvode_mem, int nrtfn, CVRootFn g) } cv_mem->cv_gactive = NULL; - cv_mem->cv_gactive = (booleantype *) malloc(nrt*sizeof(booleantype)); + cv_mem->cv_gactive = (sunbooleantype *) malloc(nrt*sizeof(sunbooleantype)); if (cv_mem->cv_gactive == NULL) { free(cv_mem->cv_glo); cv_mem->cv_glo = NULL; free(cv_mem->cv_ghi); cv_mem->cv_ghi = NULL; @@ -2728,7 +2728,7 @@ int CVode(void *cvode_mem, sunrealtype tout, N_Vector yout, long int nstloc; int retval, hflag, kflag, istate, is, ir, ier, irfndp; sunrealtype troundoff, tout_hin, rh, nrm; - booleantype inactive_roots; + sunbooleantype inactive_roots; /* * ------------------------------------- @@ -4238,7 +4238,7 @@ void CVodeQuadSensFree(void *cvode_mem) * If any of them is missing it returns SUNFALSE. */ -static booleantype cvCheckNvector(N_Vector tmpl) +static sunbooleantype cvCheckNvector(N_Vector tmpl) { if((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -4275,7 +4275,7 @@ static booleantype cvCheckNvector(N_Vector tmpl) * allocated here. */ -static booleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl) +static sunbooleantype cvAllocVectors(CVodeMem cv_mem, N_Vector tmpl) { int i, j; @@ -4410,7 +4410,7 @@ static void cvFreeVectors(CVodeMem cv_mem) * CVodeQuadReInit. */ -static booleantype cvQuadAllocVectors(CVodeMem cv_mem, N_Vector tmpl) +static sunbooleantype cvQuadAllocVectors(CVodeMem cv_mem, N_Vector tmpl) { int i, j; @@ -4506,7 +4506,7 @@ static void cvQuadFreeVectors(CVodeMem cv_mem) * using the N_Vector 'tmpl' as a template. */ -static booleantype cvSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl) +static sunbooleantype cvSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl) { int i, j; @@ -4650,7 +4650,7 @@ static void cvSensFreeVectors(CVodeMem cv_mem) * using the N_Vector 'tmpl' as a template. */ -static booleantype cvQuadSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl) +static sunbooleantype cvQuadSensAllocVectors(CVodeMem cv_mem, N_Vector tmpl) { int i, j; @@ -4777,7 +4777,7 @@ static void cvQuadSensFreeVectors(CVodeMem cv_mem) static int cvInitialSetup(CVodeMem cv_mem) { int ier; - booleantype conOK; + sunbooleantype conOK; /* Did the user specify tolerances? */ if (cv_mem->cv_itol == CV_NN) { @@ -5050,7 +5050,7 @@ static int cvHin(CVodeMem cv_mem, sunrealtype tout) int retval, sign, count1, count2; sunrealtype tdiff, tdist, tround, hlb, hub; sunrealtype hg, hgs, hs, hnew, hrat, h0, yddnrm; - booleantype hgOK; + sunbooleantype hgOK; /* If tout is too close to tn, give up */ @@ -5422,9 +5422,9 @@ static int cvStep(CVodeMem cv_mem) int pflag; /* projection return flag */ int eflag; /* error test return flag */ int retval, is; - booleantype doProjection; /* flag to apply projection in this step */ - booleantype do_sensi_stg; /* staggered strategy */ - booleantype do_sensi_stg1; /* staggered 1 strategy */ + sunbooleantype doProjection; /* flag to apply projection in this step */ + sunbooleantype do_sensi_stg; /* staggered strategy */ + sunbooleantype do_sensi_stg1; /* staggered 1 strategy */ /* Are we computing sensitivities with a staggered approach? */ @@ -6402,8 +6402,8 @@ static void cvSetTqBDF(CVodeMem cv_mem, sunrealtype hsum, sunrealtype alpha0, static int cvNls(CVodeMem cv_mem, int nflag) { int flag = CV_SUCCESS; - booleantype callSetup; - booleantype do_sensi_sim; + sunbooleantype callSetup; + sunbooleantype do_sensi_sim; long int nni_inc = 0; long int nnf_inc = 0; @@ -6525,7 +6525,7 @@ static int cvNls(CVodeMem cv_mem, int nflag) static int cvCheckConstraints(CVodeMem cv_mem) { - booleantype constraintsPassed; + sunbooleantype constraintsPassed; sunrealtype vnorm; N_Vector mm = cv_mem->cv_ftemp; N_Vector tmp = cv_mem->cv_tempv; @@ -6664,7 +6664,7 @@ static int cvQuadSensNls(CVodeMem cv_mem) static int cvStgrNls(CVodeMem cv_mem) { - booleantype callSetup; + sunbooleantype callSetup; int flag=CV_SUCCESS; long int nniS_inc = 0; long int nnfS_inc = 0; @@ -6719,7 +6719,7 @@ static int cvStgrNls(CVodeMem cv_mem) static int cvStgr1Nls(CVodeMem cv_mem, int is) { - booleantype callSetup; + sunbooleantype callSetup; long int nniS1_inc = 0; long int nnfS1_inc = 0; int flag=CV_SUCCESS; @@ -7980,7 +7980,7 @@ static int cvRcheck1(CVodeMem cv_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; for (i = 0; i < cv_mem->cv_nrtfn; i++) cv_mem->cv_iroots[i] = 0; cv_mem->cv_tlo = cv_mem->cv_tn; @@ -8048,7 +8048,7 @@ static int cvRcheck2(CVodeMem cv_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; if (cv_mem->cv_irfnd == 0) return(CV_SUCCESS); @@ -8244,7 +8244,7 @@ static int cvRootfind(CVodeMem cv_mem) { sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; - booleantype zroot, sgnchg; + sunbooleantype zroot, sgnchg; imax = 0; diff --git a/src/cvodes/cvodes_bandpre.c b/src/cvodes/cvodes_bandpre.c index ed39b7cfd8..02edf174f3 100644 --- a/src/cvodes/cvodes_bandpre.c +++ b/src/cvodes/cvodes_bandpre.c @@ -34,7 +34,7 @@ /* Prototypes of cvBandPrecSetup and cvBandPrecSolve */ static int cvBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bp_data); static int cvBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, @@ -337,7 +337,7 @@ int CVBandPrecGetNumRhsEvals(void *cvode_mem, long int *nfevalsBP) 1 if the band factorization failed. -----------------------------------------------------------------*/ static int cvBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bp_data) { CVBandPrecData pdata; diff --git a/src/cvodes/cvodes_bbdpre.c b/src/cvodes/cvodes_bbdpre.c index d4816465dc..c84f844b7d 100644 --- a/src/cvodes/cvodes_bbdpre.c +++ b/src/cvodes/cvodes_bbdpre.c @@ -36,7 +36,7 @@ /* Prototypes of functions cvBBDPrecSetup and cvBBDPrecSolve */ static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bbd_data); static int cvBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, @@ -458,7 +458,7 @@ int CVBBDPrecGetNumGfnEvals(void *cvode_mem, 1 for a recoverable error (step will be retried). -----------------------------------------------------------------*/ static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - booleantype jok, booleantype *jcurPtr, + sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *bbd_data) { CVBBDPrecData pdata; diff --git a/src/cvodes/cvodes_diag.c b/src/cvodes/cvodes_diag.c index 53e1dd6d17..5854403436 100644 --- a/src/cvodes/cvodes_diag.c +++ b/src/cvodes/cvodes_diag.c @@ -32,7 +32,7 @@ static int CVDiagInit(CVodeMem cv_mem); static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, @@ -324,12 +324,12 @@ static int CVDiagInit(CVodeMem cv_mem) */ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { sunrealtype r; N_Vector ftemp, y; - booleantype invOK; + sunbooleantype invOK; CVDiagMem cvdiag_mem; int retval; @@ -396,7 +396,7 @@ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur) { - booleantype invOK; + sunbooleantype invOK; sunrealtype r; CVDiagMem cvdiag_mem; diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index b2463e9f56..9e0a28f618 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -245,35 +245,35 @@ typedef struct CVodeMemRec { sunrealtype cv_reltol; /* relative tolerance */ sunrealtype cv_Sabstol; /* scalar absolute tolerance */ N_Vector cv_Vabstol; /* vector absolute tolerance */ - booleantype cv_atolmin0; /* flag indicating that min(abstol) = 0 */ - booleantype cv_user_efun; /* SUNTRUE if user sets efun */ + sunbooleantype cv_atolmin0; /* flag indicating that min(abstol) = 0 */ + sunbooleantype cv_user_efun; /* SUNTRUE if user sets efun */ CVEwtFn cv_efun; /* function to set ewt */ void *cv_e_data; /* user pointer passed to efun */ - booleantype cv_constraintsSet; /* constraints vector present: + sunbooleantype cv_constraintsSet; /* constraints vector present: do constraints calc */ /*----------------------- Quadrature Related Data -----------------------*/ - booleantype cv_quadr; /* SUNTRUE if integrating quadratures */ + sunbooleantype cv_quadr; /* SUNTRUE if integrating quadratures */ CVQuadRhsFn cv_fQ; /* q' = fQ(t, y(t)) */ - booleantype cv_errconQ; /* SUNTRUE if quadrs. are included in error test */ + sunbooleantype cv_errconQ; /* SUNTRUE if quadrs. are included in error test */ int cv_itolQ; /* itolQ = CV_SS or CV_SV */ sunrealtype cv_reltolQ; /* relative tolerance for quadratures */ sunrealtype cv_SabstolQ; /* scalar absolute tolerance for quadratures */ N_Vector cv_VabstolQ; /* vector absolute tolerance for quadratures */ - booleantype cv_atolQmin0; /* flag indicating that min(abstolQ) = 0 */ + sunbooleantype cv_atolQmin0; /* flag indicating that min(abstolQ) = 0 */ /*------------------------ Sensitivity Related Data ------------------------*/ - booleantype cv_sensi; /* SUNTRUE if computing sensitivities */ + sunbooleantype cv_sensi; /* SUNTRUE if computing sensitivities */ int cv_Ns; /* Number of sensitivities */ @@ -282,7 +282,7 @@ typedef struct CVodeMemRec { CVSensRhsFn cv_fS; /* fS = (df/dy)*yS + (df/dp) */ CVSensRhs1Fn cv_fS1; /* fS1 = (df/dy)*yS_i + (df/dp) */ void *cv_fS_data; /* data pointer passed to fS */ - booleantype cv_fSDQ; /* SUNTRUE if using internal DQ functions */ + sunbooleantype cv_fSDQ; /* SUNTRUE if using internal DQ functions */ int cv_ifS; /* ifS = ALLSENS or ONESENS */ sunrealtype *cv_p; /* parameters in f(t,y,p) */ @@ -291,31 +291,31 @@ typedef struct CVodeMemRec { int cv_DQtype; /* central/forward finite differences */ sunrealtype cv_DQrhomax; /* cut-off value for separate/simultaneous FD */ - booleantype cv_errconS; /* SUNTRUE if yS are considered in err. control */ + sunbooleantype cv_errconS; /* SUNTRUE if yS are considered in err. control */ int cv_itolS; sunrealtype cv_reltolS; /* relative tolerance for sensitivities */ sunrealtype *cv_SabstolS; /* scalar absolute tolerances for sensi. */ N_Vector *cv_VabstolS; /* vector absolute tolerances for sensi. */ - booleantype *cv_atolSmin0; /* flags indicating that min(abstolS[i]) = 0 */ + sunbooleantype *cv_atolSmin0; /* flags indicating that min(abstolS[i]) = 0 */ /*----------------------------------- Quadrature Sensitivity Related Data -----------------------------------*/ - booleantype cv_quadr_sensi; /* SUNTRUE if computing sensitivties of quadrs. */ + sunbooleantype cv_quadr_sensi; /* SUNTRUE if computing sensitivties of quadrs. */ CVQuadSensRhsFn cv_fQS; /* fQS = (dfQ/dy)*yS + (dfQ/dp) */ void *cv_fQS_data; /* data pointer passed to fQS */ - booleantype cv_fQSDQ; /* SUNTRUE if using internal DQ functions */ + sunbooleantype cv_fQSDQ; /* SUNTRUE if using internal DQ functions */ - booleantype cv_errconQS; /* SUNTRUE if yQS are considered in err. con. */ + sunbooleantype cv_errconQS; /* SUNTRUE if yQS are considered in err. con. */ int cv_itolQS; sunrealtype cv_reltolQS; /* relative tolerance for yQS */ sunrealtype *cv_SabstolQS; /* scalar absolute tolerances for yQS */ N_Vector *cv_VabstolQS; /* vector absolute tolerances for yQS */ - booleantype *cv_atolQSmin0; /* flags indicating that min(abstolQS[i]) = 0 */ + sunbooleantype *cv_atolQSmin0; /* flags indicating that min(abstolQS[i]) = 0 */ /*----------------------- Nordsieck History Array @@ -366,7 +366,7 @@ typedef struct CVodeMemRec { N_Vector *cv_tempvS; /* temporary storage vector (~ tempv) */ N_Vector *cv_ftempS; /* temporary storage vector (~ ftemp) */ - booleantype cv_stgr1alloc; /* Did we allocate ncfS1, ncfnS1, and nniS1? */ + sunbooleantype cv_stgr1alloc; /* Did we allocate ncfS1, ncfnS1, and nniS1? */ /*-------------------------------------- Quadrature Sensitivity Related Vectors @@ -383,8 +383,8 @@ typedef struct CVodeMemRec { Tstop information -----------------*/ - booleantype cv_tstopset; - booleantype cv_tstopinterp; + sunbooleantype cv_tstopset; + sunbooleantype cv_tstopinterp; sunrealtype cv_tstop; /*--------- @@ -423,10 +423,10 @@ typedef struct CVodeMemRec { sunrealtype cv_crateS; /* estimated corrector convergence rate (Stgr) */ sunrealtype cv_delp; /* norm of previous nonlinear solver update */ sunrealtype cv_acnrm; /* | acor | */ - booleantype cv_acnrmcur; /* is | acor | current? */ + sunbooleantype cv_acnrmcur; /* is | acor | current? */ sunrealtype cv_acnrmQ; /* | acorQ | */ sunrealtype cv_acnrmS; /* | acorS | */ - booleantype cv_acnrmScur; /* is | acorS | current? */ + sunbooleantype cv_acnrmScur; /* is | acorS | current? */ sunrealtype cv_acnrmQS; /* | acorQS | */ sunrealtype cv_nlscoef; /* coeficient in nonlinear convergence test */ int *cv_ncfS1; /* Array of Ns local counters for conv. @@ -519,20 +519,20 @@ typedef struct CVodeMemRec { ---------------------*/ SUNNonlinearSolver NLS; /* nonlinear solver object */ - booleantype ownNLS; /* flag indicating NLS ownership */ + sunbooleantype ownNLS; /* flag indicating NLS ownership */ SUNNonlinearSolver NLSsim; /* NLS object for the simultaneous corrector */ - booleantype ownNLSsim; /* flag indicating NLS ownership */ + sunbooleantype ownNLSsim; /* flag indicating NLS ownership */ SUNNonlinearSolver NLSstg; /* NLS object for the staggered corrector */ - booleantype ownNLSstg; /* flag indicating NLS ownership */ + sunbooleantype ownNLSstg; /* flag indicating NLS ownership */ SUNNonlinearSolver NLSstg1; /* NLS object for the staggered1 corrector */ - booleantype ownNLSstg1; /* flag indicating NLS ownership */ + sunbooleantype ownNLSstg1; /* flag indicating NLS ownership */ int sens_solve_idx; /* index of the current staggered1 solve */ long int nnip; /* previous total number of iterations */ - booleantype sens_solve; /* flag indicating if the current solve is a + sunbooleantype sens_solve; /* flag indicating if the current solve is a staggered or staggered1 sensitivity solve */ CVRhsFn nls_f; /* f(t,y(t)) used in the nonlinear solver */ int convfail; /* flag to indicate when a Jacobian update may @@ -554,8 +554,8 @@ typedef struct CVodeMemRec { /* flags indicating if vector wrappers for the simultaneous and staggered correctors have been allocated */ - booleantype simMallocDone; - booleantype stgMallocDone; + sunbooleantype simMallocDone; + sunbooleantype stgMallocDone; /*------------------ @@ -567,7 +567,7 @@ typedef struct CVodeMemRec { int (*cv_linit)(struct CVodeMemRec *cv_mem); int (*cv_lsetup)(struct CVodeMemRec *cv_mem, int convfail, - N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, + N_Vector ypred, N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); int (*cv_lsolve)(struct CVodeMemRec *cv_mem, N_Vector b, N_Vector weight, @@ -581,7 +581,7 @@ typedef struct CVodeMemRec { long int cv_msbp; /* max number of steps between lsetip calls */ sunrealtype cv_dgmax_lsetup; /* gamma ratio threshold to signal for a linear * solver setup */ - booleantype cv_forceSetup; /* flag to request a call to the setup routine */ + sunbooleantype cv_forceSetup; /* flag to request a call to the setup routine */ /*------------ Saved Values @@ -592,7 +592,7 @@ typedef struct CVodeMemRec { sunrealtype cv_h0u; /* actual initial stepsize */ sunrealtype cv_hu; /* last successful h value used */ sunrealtype cv_saved_tq5; /* saved value of tq[5] */ - booleantype cv_jcur; /* is Jacobian info for linear solver current? */ + sunbooleantype cv_jcur; /* is Jacobian info for linear solver current? */ int cv_convfail; /* flag storing previous solver failure mode */ sunrealtype cv_tolsf; /* tolerance scale factor */ int cv_qmax_alloc; /* value of qmax used when allocating mem */ @@ -606,20 +606,20 @@ typedef struct CVodeMemRec { and read by CVodeReInit, CVodeSensReInit, and CVodeQuadReInit --------------------------------------------------------------------*/ - booleantype cv_VabstolMallocDone; - booleantype cv_MallocDone; - booleantype cv_constraintsMallocDone; + sunbooleantype cv_VabstolMallocDone; + sunbooleantype cv_MallocDone; + sunbooleantype cv_constraintsMallocDone; - booleantype cv_VabstolQMallocDone; - booleantype cv_QuadMallocDone; + sunbooleantype cv_VabstolQMallocDone; + sunbooleantype cv_QuadMallocDone; - booleantype cv_VabstolSMallocDone; - booleantype cv_SabstolSMallocDone; - booleantype cv_SensMallocDone; + sunbooleantype cv_VabstolSMallocDone; + sunbooleantype cv_SabstolSMallocDone; + sunbooleantype cv_SensMallocDone; - booleantype cv_VabstolQSMallocDone; - booleantype cv_SabstolQSMallocDone; - booleantype cv_QuadSensMallocDone; + sunbooleantype cv_VabstolQSMallocDone; + sunbooleantype cv_SabstolQSMallocDone; + sunbooleantype cv_QuadSensMallocDone; /*------------------------------------------- Error handler function and error ouput file @@ -639,7 +639,7 @@ typedef struct CVodeMemRec { Stability Limit Detection -------------------------*/ - booleantype cv_sldeton; /* is Stability Limit Detection on? */ + sunbooleantype cv_sldeton; /* is Stability Limit Detection on? */ sunrealtype cv_ssdat[6][4]; /* scaled data array for STALD */ int cv_nscon; /* counter for STALD method */ long int cv_nor; /* counter for number of order reductions */ @@ -663,7 +663,7 @@ typedef struct CVodeMemRec { int cv_taskc; /* copy of parameter itask */ int cv_irfnd; /* flag showing whether last step had a root */ long int cv_nge; /* counter for g evaluations */ - booleantype *cv_gactive; /* array with active/inactive event functions */ + sunbooleantype *cv_gactive; /* array with active/inactive event functions */ int cv_mxgnull; /* number of warning messages about possible g==0 */ /*--------------- @@ -671,8 +671,8 @@ typedef struct CVodeMemRec { ---------------*/ CVodeProjMem proj_mem; /* projection memory structure */ - booleantype proj_enabled; /* flag indicating if projection is enabled */ - booleantype proj_applied; /* flag indicating if projection was applied */ + sunbooleantype proj_enabled; /* flag indicating if projection is enabled */ + sunbooleantype proj_applied; /* flag indicating if projection was applied */ sunrealtype proj_p[L_MAX]; /* coefficients of p(x) (degree q poly) */ /*----------------------- @@ -687,11 +687,11 @@ typedef struct CVodeMemRec { Adjoint sensitivity data ------------------------*/ - booleantype cv_adj; /* SUNTRUE if performing ASA */ + sunbooleantype cv_adj; /* SUNTRUE if performing ASA */ struct CVadjMemRec *cv_adj_mem; /* Pointer to adjoint memory structure */ - booleantype cv_adjMallocDone; + sunbooleantype cv_adjMallocDone; } *CVodeMem; @@ -722,13 +722,13 @@ struct CVckpntMemRec { N_Vector ck_zn[L_MAX]; /* Do we need to carry quadratures? */ - booleantype ck_quadr; + sunbooleantype ck_quadr; /* Nordsieck History Array for quadratures */ N_Vector ck_znQ[L_MAX]; /* Do we need to carry sensitivities? */ - booleantype ck_sensi; + sunbooleantype ck_sensi; /* number of sensitivities */ int ck_Ns; @@ -737,7 +737,7 @@ struct CVckpntMemRec { N_Vector *ck_znS[L_MAX]; /* Do we need to carry quadrature sensitivities? */ - booleantype ck_quadr_sensi; + sunbooleantype ck_quadr_sensi; /* Nordsieck History Array for quadrature sensitivities */ N_Vector *ck_znQS[L_MAX]; @@ -787,7 +787,7 @@ struct CVckpntMemRec { * ----------------------------------------------------------------- */ -typedef booleantype (*cvaIMMallocFn)(CVodeMem cv_mem); +typedef sunbooleantype (*cvaIMMallocFn)(CVodeMem cv_mem); typedef void (*cvaIMFreeFn)(CVodeMem cv_mem); typedef int (*cvaIMGetYFn)(CVodeMem cv_mem, sunrealtype t, N_Vector y, N_Vector *yS); typedef int (*cvaIMStorePntFn)(CVodeMem cv_mem, CVdtpntMem d); @@ -846,8 +846,8 @@ struct CVodeBMemRec { /* Flags to indicate that this backward problem's RHS or quad RHS * require forward sensitivities */ - booleantype cv_f_withSensi; - booleantype cv_fQ_withSensi; + sunbooleantype cv_f_withSensi; + sunbooleantype cv_fQ_withSensi; /* Right hand side function for backward run */ CVRhsFnB cv_f; @@ -903,15 +903,15 @@ struct CVadjMemRec { sunrealtype ca_tinitial, ca_tfinal; /* Flag for first call to CVodeF */ - booleantype ca_firstCVodeFcall; + sunbooleantype ca_firstCVodeFcall; /* Flag if CVodeF was called with TSTOP */ - booleantype ca_tstopCVodeFcall; + sunbooleantype ca_tstopCVodeFcall; sunrealtype ca_tstopCVodeF; /* Flag if CVodeF was called in CV_NORMAL_MODE and encountered a root after tout */ - booleantype ca_rootret; + sunbooleantype ca_rootret; sunrealtype ca_troot; /* ---------------------- @@ -928,7 +928,7 @@ struct CVadjMemRec { struct CVodeBMemRec *ca_bckpbCrt; /* Flag for first call to CVodeB */ - booleantype ca_firstCVodeBcall; + sunbooleantype ca_firstCVodeBcall; /* ---------------- * Check point data @@ -969,10 +969,10 @@ struct CVadjMemRec { cvaIMGetYFn ca_IMget; /* interpolate forward solution */ /* Flags controlling the interpolation module */ - booleantype ca_IMmallocDone; /* IM initialized? */ - booleantype ca_IMnewData; /* new data available in dt_mem?*/ - booleantype ca_IMstoreSensi; /* store sensitivities? */ - booleantype ca_IMinterpSensi; /* interpolate sensitivities? */ + sunbooleantype ca_IMmallocDone; /* IM initialized? */ + sunbooleantype ca_IMnewData; /* new data available in dt_mem?*/ + sunbooleantype ca_IMstoreSensi; /* store sensitivities? */ + sunbooleantype ca_IMinterpSensi; /* interpolate sensitivities? */ /* Workspace for the interpolation module */ N_Vector ca_Y[L_MAX]; /* pointers to zn[i] */ @@ -1049,7 +1049,7 @@ struct CVadjMemRec { /* * ----------------------------------------------------------------- * int (*cv_lsetup)(CVodeMem cv_mem, int convfail, N_Vector ypred, - * N_Vector fpred, booleantype *jcurPtr, + * N_Vector fpred, sunbooleantype *jcurPtr, * N_Vector vtemp1, N_Vector vtemp2, * N_Vector vtemp3); * ----------------------------------------------------------------- diff --git a/src/cvodes/cvodes_io.c b/src/cvodes/cvodes_io.c index db1e6673c6..1111e09142 100644 --- a/src/cvodes/cvodes_io.c +++ b/src/cvodes/cvodes_io.c @@ -279,7 +279,7 @@ int CVodeSetMaxHnilWarns(void *cvode_mem, int mxhnil) * Turns on/off the stability limit detection algorithm */ -int CVodeSetStabLimDet(void *cvode_mem, booleantype sldet) +int CVodeSetStabLimDet(void *cvode_mem, sunbooleantype sldet) { CVodeMem cv_mem; @@ -722,7 +722,7 @@ int CVodeSetStopTime(void *cvode_mem, sunrealtype tstop) * Specifies to use interpolation to fill the returned solution at the stop time (instead of a copy). */ -int CVodeSetInterpolateStopTime(void *cvode_mem, booleantype interp) +int CVodeSetInterpolateStopTime(void *cvode_mem, sunbooleantype interp) { CVodeMem cv_mem; @@ -812,7 +812,7 @@ int CVodeSetMaxConvFails(void *cvode_mem, int maxncf) int CVodeSetMaxNonlinIters(void *cvode_mem, int maxcor) { CVodeMem cv_mem; - booleantype sensi_sim; + sunbooleantype sensi_sim; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", @@ -1028,7 +1028,7 @@ int CVodeSetConstraints(void *cvode_mem, N_Vector constraints) * ================================================================= */ -int CVodeSetQuadErrCon(void *cvode_mem, booleantype errconQ) +int CVodeSetQuadErrCon(void *cvode_mem, sunbooleantype errconQ) { CVodeMem cv_mem; @@ -1078,7 +1078,7 @@ int CVodeSetSensDQMethod(void *cvode_mem, int DQtype, sunrealtype DQrhomax) /*-----------------------------------------------------------------*/ -int CVodeSetSensErrCon(void *cvode_mem, booleantype errconS) +int CVodeSetSensErrCon(void *cvode_mem, sunbooleantype errconS) { CVodeMem cv_mem; @@ -1098,7 +1098,7 @@ int CVodeSetSensErrCon(void *cvode_mem, booleantype errconS) int CVodeSetSensMaxNonlinIters(void *cvode_mem, int maxcorS) { CVodeMem cv_mem; - booleantype sensi_stg; + sunbooleantype sensi_stg; if (cvode_mem==NULL) { cvProcessError(NULL, CV_MEM_NULL, "CVODES", @@ -1197,7 +1197,7 @@ int CVodeSetSensParams(void *cvode_mem, sunrealtype *p, sunrealtype *pbar, int * /*-----------------------------------------------------------------*/ -int CVodeSetQuadSensErrCon(void *cvode_mem, booleantype errconQS) +int CVodeSetQuadSensErrCon(void *cvode_mem, sunbooleantype errconQS) { CVodeMem cv_mem; diff --git a/src/cvodes/cvodes_ls.c b/src/cvodes/cvodes_ls.c index b6ebe97c0f..8ca7d8c8b2 100644 --- a/src/cvodes/cvodes_ls.c +++ b/src/cvodes/cvodes_ls.c @@ -44,7 +44,7 @@ =================================================================*/ static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); @@ -69,10 +69,10 @@ static int cvLsJacBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, CVLsPrecSetupFn, and wrap around user-provided functions of type CVLsPrecSetupFnB and CVLsPrecSetupFnBS, respectively */ static int cvLsPrecSetupBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - booleantype jokB, booleantype *jcurPtrB, + sunbooleantype jokB, sunbooleantype *jcurPtrB, sunrealtype gammaB, void *cvode_mem); static int cvLsPrecSetupBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - booleantype jokB, booleantype *jcurPtrB, + sunbooleantype jokB, sunbooleantype *jcurPtrB, sunrealtype gammaB, void *cvode_mem); /* cvLsPrecSolveBWrapper and cvLsPrecSolveBSWrapper have type @@ -109,13 +109,13 @@ static int cvLsJacTimesVecBSWrapper(N_Vector vB, N_Vector JvB, sunrealtype t, wrap around user-provided functions of type CVLsLinSysFnB and CVLsLinSysFnBS, respectively */ static int cvLsLinSysBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - SUNMatrix AB, booleantype jokB, - booleantype *jcurB, sunrealtype gammaB, + SUNMatrix AB, sunbooleantype jokB, + sunbooleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); static int cvLsLinSysBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - SUNMatrix AB, booleantype jokB, - booleantype *jcurB, sunrealtype gammaB, + SUNMatrix AB, sunbooleantype jokB, + sunbooleantype *jcurB, sunrealtype gammaB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3); @@ -137,8 +137,8 @@ int CVodeSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, CVodeMem cv_mem; CVLsMem cvls_mem; int retval, LSType; - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Return immediately if either cvode_mem or LS inputs are NULL */ if (cvode_mem == NULL) { @@ -492,7 +492,7 @@ int CVodeSetJacEvalFrequency(void *cvode_mem, long int msbj) /* CVodeSetLinearSolutionScaling enables or disables scaling the linear solver solution to account for changes in gamma. */ -int CVodeSetLinearSolutionScaling(void *cvode_mem, booleantype onoff) +int CVodeSetLinearSolutionScaling(void *cvode_mem, sunbooleantype onoff) { CVodeMem cv_mem; CVLsMem cvls_mem; @@ -1398,7 +1398,7 @@ int cvLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, Setup the linear system A = I - gamma J -----------------------------------------------------------------*/ static int cvLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, - booleantype jok, booleantype *jcur, sunrealtype gamma, + sunbooleantype jok, sunbooleantype *jcur, sunrealtype gamma, void *cvode_mem, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { @@ -1618,7 +1618,7 @@ int cvLsInitialize(CVodeMem cv_mem) This routine then calls the LS 'setup' routine with A. -----------------------------------------------------------------*/ int cvLsSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { CVLsMem cvls_mem; @@ -1726,7 +1726,7 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, sunrealtype bnorm = ZERO; sunrealtype deltar, delta, w_mean; int curiter, nli_inc, retval; - booleantype do_sensi_sim, do_sensi_stg, do_sensi_stg1; + sunbooleantype do_sensi_sim, do_sensi_stg, do_sensi_stg1; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG sunrealtype resnorm; long int nps_inc; @@ -2209,7 +2209,7 @@ int CVodeSetLSNormFactorB(void *cvode_mem, int which, sunrealtype nrmfacB) int CVodeSetLinearSolutionScalingB(void *cvode_mem, int which, - booleantype onoffB) + sunbooleantype onoffB) { CVodeMem cv_mem; CVadjMem ca_mem; @@ -2498,7 +2498,7 @@ static int cvLsJacBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, /* cvLsPrecSetupBWrapper interfaces to the CVLsPrecSetupFnB routine provided by the user */ static int cvLsPrecSetupBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - booleantype jokB, booleantype *jcurPtrB, + sunbooleantype jokB, sunbooleantype *jcurPtrB, sunrealtype gammaB, void *cvode_mem) { CVodeMem cv_mem; @@ -2528,7 +2528,7 @@ static int cvLsPrecSetupBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, /* cvLsPrecSetupBSWrapper interfaces to the CVLsPrecSetupFnBS routine provided by the user */ static int cvLsPrecSetupBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - booleantype jokB, booleantype *jcurPtrB, + sunbooleantype jokB, sunbooleantype *jcurPtrB, sunrealtype gammaB, void *cvode_mem) { CVodeMem cv_mem; @@ -2761,8 +2761,8 @@ static int cvLsJacTimesVecBSWrapper(N_Vector vB, N_Vector JvB, sunrealtype t, /* cvLsLinSysBWrapper interfaces to the CVLsLinSysFnB routine provided by the user. cvLsLinSysBWrapper is of type CVLsLinSysFn. */ static int cvLsLinSysBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - SUNMatrix AB, booleantype jokB, - booleantype *jcurB, sunrealtype gammaB, + SUNMatrix AB, sunbooleantype jokB, + sunbooleantype *jcurB, sunrealtype gammaB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { @@ -2795,8 +2795,8 @@ static int cvLsLinSysBWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, /* cvLsLinSysBSWrapper interfaces to the CVLsLinSysFnBS routine provided by the user. cvLsLinSysBSWrapper is of type CVLsLinSysFn. */ static int cvLsLinSysBSWrapper(sunrealtype t, N_Vector yB, N_Vector fyB, - SUNMatrix AB, booleantype jokB, - booleantype *jcurB, sunrealtype gammaB, + SUNMatrix AB, sunbooleantype jokB, + sunbooleantype *jcurB, sunrealtype gammaB, void *cvode_mem, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) { diff --git a/src/cvodes/cvodes_ls_impl.h b/src/cvodes/cvodes_ls_impl.h index 72e62df299..b7854ce2c2 100644 --- a/src/cvodes/cvodes_ls_impl.h +++ b/src/cvodes/cvodes_ls_impl.h @@ -54,19 +54,19 @@ extern "C" { typedef struct CVLsMemRec { /* Linear solver type information */ - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Jacobian construction & storage */ - booleantype jacDQ; /* SUNTRUE if using internal DQ Jac approx. */ + sunbooleantype jacDQ; /* SUNTRUE if using internal DQ Jac approx. */ CVLsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* user data is passed to jac */ - booleantype jbad; /* heuristic suggestion for pset */ + sunbooleantype jbad; /* heuristic suggestion for pset */ sunrealtype dgmax_jbad; /* if convfail = FAIL_BAD_J and the gamma ratio * * |gamma/gammap-1| < dgmax_jbad then J is bad */ /* Matrix-based solver, scale solution to account for change in gamma */ - booleantype scalesol; + sunbooleantype scalesol; /* Iterative solver tolerance */ sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ @@ -114,7 +114,7 @@ typedef struct CVLsMemRec { * (b) internal jtimes * - jt_data == cvode_mem * - jtimesDQ == SUNTRUE */ - booleantype jtimesDQ; + sunbooleantype jtimesDQ; CVLsJacTimesSetupFn jtsetup; CVLsJacTimesVecFn jtimes; CVRhsFn jt_f; @@ -127,7 +127,7 @@ typedef struct CVLsMemRec { * (b) internal linsys function: * - user_linsys = SUNFALSE * - A_data = cvode_mem */ - booleantype user_linsys; + sunbooleantype user_linsys; CVLsLinSysFn linsys; void* A_data; @@ -162,7 +162,7 @@ int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, /* Generic linit/lsetup/lsolve/lfree interface routines for CVode to call */ int cvLsInitialize(CVodeMem cv_mem); int cvLsSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, booleantype *jcurPtr, + N_Vector fpred, sunbooleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur); diff --git a/src/cvodes/cvodes_nls.c b/src/cvodes/cvodes_nls.c index 2cc0c32179..0b0c472e78 100644 --- a/src/cvodes/cvodes_nls.c +++ b/src/cvodes/cvodes_nls.c @@ -25,7 +25,7 @@ static int cvNlsResidual(N_Vector ycor, N_Vector res, void* cvode_mem); static int cvNlsFPFunction(N_Vector ycor, N_Vector res, void* cvode_mem); -static int cvNlsLSetup(booleantype jbad, booleantype* jcur, void* cvode_mem); +static int cvNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem); static int cvNlsLSolve(N_Vector delta, void* cvode_mem); static int cvNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* cvode_mem); @@ -230,7 +230,7 @@ int cvNlsInit(CVodeMem cvode_mem) } -static int cvNlsLSetup(booleantype jbad, booleantype* jcur, void* cvode_mem) +static int cvNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem) { CVodeMem cv_mem; int retval; diff --git a/src/cvodes/cvodes_nls_sim.c b/src/cvodes/cvodes_nls_sim.c index ceace6e955..89d654522a 100644 --- a/src/cvodes/cvodes_nls_sim.c +++ b/src/cvodes/cvodes_nls_sim.c @@ -36,7 +36,7 @@ static int cvNlsResidualSensSim(N_Vector ycorSim, N_Vector resSim, static int cvNlsFPFunctionSensSim(N_Vector ycorSim, N_Vector resSim, void* cvode_mem); -static int cvNlsLSetupSensSim(booleantype jbad, booleantype* jcur, +static int cvNlsLSetupSensSim(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem); static int cvNlsLSolveSensSim(N_Vector deltaSim, void* cvode_mem); static int cvNlsConvTestSensSim(SUNNonlinearSolver NLS, @@ -279,7 +279,7 @@ int cvNlsInitSensSim(CVodeMem cvode_mem) } -static int cvNlsLSetupSensSim(booleantype jbad, booleantype* jcur, +static int cvNlsLSetupSensSim(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem) { CVodeMem cv_mem; diff --git a/src/cvodes/cvodes_nls_stg.c b/src/cvodes/cvodes_nls_stg.c index efde4e21a9..ddc6e5be11 100644 --- a/src/cvodes/cvodes_nls_stg.c +++ b/src/cvodes/cvodes_nls_stg.c @@ -27,7 +27,7 @@ static int cvNlsResidualSensStg(N_Vector ycorStg, N_Vector resStg, static int cvNlsFPFunctionSensStg(N_Vector ycorStg, N_Vector resStg, void* cvode_mem); -static int cvNlsLSetupSensStg(booleantype jbad, booleantype* jcur, +static int cvNlsLSetupSensStg(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem); static int cvNlsLSolveSensStg(N_Vector deltaStg, void* cvode_mem); static int cvNlsConvTestSensStg(SUNNonlinearSolver NLS, @@ -224,7 +224,7 @@ int cvNlsInitSensStg(CVodeMem cvode_mem) } -static int cvNlsLSetupSensStg(booleantype jbad, booleantype* jcur, +static int cvNlsLSetupSensStg(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem) { CVodeMem cv_mem; diff --git a/src/cvodes/cvodes_nls_stg1.c b/src/cvodes/cvodes_nls_stg1.c index cffeb4d3c8..e230119d5f 100644 --- a/src/cvodes/cvodes_nls_stg1.c +++ b/src/cvodes/cvodes_nls_stg1.c @@ -26,7 +26,7 @@ static int cvNlsResidualSensStg1(N_Vector ycor, N_Vector res, static int cvNlsFPFunctionSensStg1(N_Vector ycor, N_Vector res, void* cvode_mem); -static int cvNlsLSetupSensStg1(booleantype jbad, booleantype* jcur, +static int cvNlsLSetupSensStg1(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem); static int cvNlsLSolveSensStg1(N_Vector delta, void* cvode_mem); static int cvNlsConvTestSensStg1(SUNNonlinearSolver NLS, @@ -189,7 +189,7 @@ int cvNlsInitSensStg1(CVodeMem cvode_mem) } -static int cvNlsLSetupSensStg1(booleantype jbad, booleantype* jcur, +static int cvNlsLSetupSensStg1(sunbooleantype jbad, sunbooleantype* jcur, void* cvode_mem) { CVodeMem cv_mem; diff --git a/src/cvodes/cvodes_proj.c b/src/cvodes/cvodes_proj.c index 80e79c1354..c7f51ba4f4 100644 --- a/src/cvodes/cvodes_proj.c +++ b/src/cvodes/cvodes_proj.c @@ -103,7 +103,7 @@ int CVodeSetProjFn(void *cvode_mem, CVProjFn pfun) * ===========================================================================*/ -int CVodeSetProjErrEst(void *cvode_mem, booleantype onoff) +int CVodeSetProjErrEst(void *cvode_mem, sunbooleantype onoff) { int retval; CVodeMem cv_mem; diff --git a/src/cvodes/cvodes_proj_impl.h b/src/cvodes/cvodes_proj_impl.h index b7fa4e683c..dbe75ee684 100644 --- a/src/cvodes/cvodes_proj_impl.h +++ b/src/cvodes/cvodes_proj_impl.h @@ -49,9 +49,9 @@ extern "C" { * ---------------------------------------------------------------------------*/ typedef struct CVodeProjMemRec { - booleantype internal_proj; /* use the internal projection algorithm? */ - booleantype err_proj; /* is error projection enabled? */ - booleantype first_proj; /* is this the first time we project? */ + sunbooleantype internal_proj; /* use the internal projection algorithm? */ + sunbooleantype err_proj; /* is error projection enabled? */ + sunbooleantype first_proj; /* is this the first time we project? */ long int freq; /* projection frequency */ long int nstlprj; /* step number of last projection */ diff --git a/src/ida/ida.c b/src/ida/ida.c index 28c357295a..dd8e1c5604 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -183,11 +183,11 @@ * ================================================================= */ -static booleantype IDACheckNvector(N_Vector tmpl); +static sunbooleantype IDACheckNvector(N_Vector tmpl); /* Memory allocation/deallocation */ -static booleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl); +static sunbooleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl); static void IDAFreeVectors(IDAMem IDA_mem); /* Initial setup */ @@ -375,7 +375,7 @@ int IDAInit(void *ida_mem, IDAResFn res, { int retval; IDAMem IDA_mem; - booleantype nvectorOK, allocOK; + sunbooleantype nvectorOK, allocOK; sunindextype lrw1, liw1; SUNNonlinearSolver NLS; @@ -909,7 +909,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) } IDA_mem->ida_gactive = NULL; - IDA_mem->ida_gactive = (booleantype *) malloc(nrt*sizeof(booleantype)); + IDA_mem->ida_gactive = (sunbooleantype *) malloc(nrt*sizeof(sunbooleantype)); if (IDA_mem->ida_gactive == NULL) { free(IDA_mem->ida_glo); IDA_mem->ida_glo = NULL; free(IDA_mem->ida_ghi); IDA_mem->ida_ghi = NULL; @@ -986,7 +986,7 @@ int IDASolve(void *ida_mem, sunrealtype tout, sunrealtype *tret, int sflag, istate, ier, irfndp, ir; sunrealtype tdist, troundoff, ypnorm, rh, nrm; IDAMem IDA_mem; - booleantype inactive_roots; + sunbooleantype inactive_roots; /* Check for legal inputs in all cases. */ @@ -1572,7 +1572,7 @@ void IDAFree(void **ida_mem) * If any of them is missing it returns SUNFALSE. */ -static booleantype IDACheckNvector(N_Vector tmpl) +static sunbooleantype IDACheckNvector(N_Vector tmpl) { if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -1609,7 +1609,7 @@ static booleantype IDACheckNvector(N_Vector tmpl) * allocated here. */ -static booleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl) +static sunbooleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl) { int i, j, maxcol; @@ -1794,7 +1794,7 @@ static void IDAFreeVectors(IDAMem IDA_mem) int IDAInitialSetup(IDAMem IDA_mem) { - booleantype conOK; + sunbooleantype conOK; int ier; /* Test for more vector operations, depending on options */ @@ -2469,7 +2469,7 @@ static void IDASetCoeffs(IDAMem IDA_mem, sunrealtype *ck) static int IDANls(IDAMem IDA_mem) { int retval; - booleantype constraintsPassed, callLSetup; + sunbooleantype constraintsPassed, callLSetup; sunrealtype temp1, temp2, vnorm; N_Vector mm, tmp; long int nni_inc = 0; @@ -3207,7 +3207,7 @@ int IDAGetSolution(void *ida_mem, sunrealtype t, N_Vector yret, N_Vector ypret) */ sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - booleantype mask) + sunbooleantype mask) { sunrealtype nrm; @@ -3239,7 +3239,7 @@ static int IDARcheck1(IDAMem IDA_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; for (i = 0; i < IDA_mem->ida_nrtfn; i++) IDA_mem->ida_iroots[i] = 0; @@ -3308,7 +3308,7 @@ static int IDARcheck2(IDAMem IDA_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; if (IDA_mem->ida_irfnd == 0) return(IDA_SUCCESS); @@ -3504,7 +3504,7 @@ static int IDARootfind(IDAMem IDA_mem) { sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; - booleantype zroot, sgnchg; + sunbooleantype zroot, sgnchg; imax = 0; diff --git a/src/ida/ida_ic.c b/src/ida/ida_ic.c index 1892ee0903..7016819e58 100644 --- a/src/ida/ida_ic.c +++ b/src/ida/ida_ic.c @@ -59,7 +59,7 @@ extern int IDAInitialSetup(IDAMem IDA_mem); extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - booleantype mask); + sunbooleantype mask); static int IDAnlsIC(IDAMem IDA_mem); static int IDANewtonIC(IDAMem IDA_mem); @@ -461,7 +461,7 @@ static int IDANewtonIC(IDAMem IDA_mem) static int IDALineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm) { - booleantype conOK; + sunbooleantype conOK; int retval, nbacks; sunrealtype f1norm, fnormp, f1normp, ratio, lambda, minlam, slpi; N_Vector mc; diff --git a/src/ida/ida_impl.h b/src/ida/ida_impl.h index 2543fc06b2..d55f1c4c39 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -104,14 +104,14 @@ typedef struct IDAMemRec { sunrealtype ida_rtol; /* relative tolerance */ sunrealtype ida_Satol; /* scalar absolute tolerance */ N_Vector ida_Vatol; /* vector absolute tolerance */ - booleantype ida_atolmin0; /* flag indicating that min(atol) = 0 */ - booleantype ida_user_efun; /* SUNTRUE if user provides efun */ + sunbooleantype ida_atolmin0; /* flag indicating that min(atol) = 0 */ + sunbooleantype ida_user_efun; /* SUNTRUE if user provides efun */ IDAEwtFn ida_efun; /* function to set ewt */ void *ida_edata; /* user pointer passed to efun */ - booleantype ida_constraintsSet; /* constraints vector present: + sunbooleantype ida_constraintsSet; /* constraints vector present: do constraints calc */ - booleantype ida_suppressalg; /* SUNTRUE means suppress algebraic vars + sunbooleantype ida_suppressalg; /* SUNTRUE means suppress algebraic vars in local error tests */ /*----------------------------------------------- @@ -159,7 +159,7 @@ typedef struct IDAMemRec { N_Vector ida_yp0; /* initial y' vector (user-supplied). */ int ida_icopt; /* IC calculation user option */ - booleantype ida_lsoff; /* IC calculation linesearch turnoff option */ + sunbooleantype ida_lsoff; /* IC calculation linesearch turnoff option */ int ida_maxnh; /* max. number of h tries in IC calculation */ int ida_maxnj; /* max. number of J tries in IC calculation */ int ida_maxnit; /* max. number of Netwon iterations in IC calc. */ @@ -172,7 +172,7 @@ typedef struct IDAMemRec { /* Tstop information */ - booleantype ida_tstopset; + sunbooleantype ida_tstopset; sunrealtype ida_tstop; /* Step Data */ @@ -254,14 +254,14 @@ typedef struct IDAMemRec { /* Flags to verify correct calling sequence */ - booleantype ida_SetupDone; /* set to SUNFALSE by IDAMalloc and IDAReInit + sunbooleantype ida_SetupDone; /* set to SUNFALSE by IDAMalloc and IDAReInit set to SUNTRUE by IDACalcIC or IDASolve */ - booleantype ida_VatolMallocDone; - booleantype ida_constraintsMallocDone; - booleantype ida_idMallocDone; + sunbooleantype ida_VatolMallocDone; + sunbooleantype ida_constraintsMallocDone; + sunbooleantype ida_idMallocDone; - booleantype ida_MallocDone; /* set to SUNFALSE by IDACreate + sunbooleantype ida_MallocDone; /* set to SUNFALSE by IDACreate set to SUNTRUE by IDAMAlloc tested by IDAReInit and IDASolve */ @@ -270,7 +270,7 @@ typedef struct IDAMemRec { ---------------------*/ SUNNonlinearSolver NLS; /* nonlinear solver object */ - booleantype ownNLS; /* flag indicating NLS ownership */ + sunbooleantype ownNLS; /* flag indicating NLS ownership */ IDAResFn nls_res; /* F(t,y(t),y'(t))=0; used in the nonlinear solver */ @@ -301,7 +301,7 @@ typedef struct IDAMemRec { /* Flag to indicate successful ida_linit call */ - booleantype ida_linitOK; + sunbooleantype ida_linitOK; /*---------------- Rootfinding Data @@ -322,7 +322,7 @@ typedef struct IDAMemRec { int ida_taskc; /* copy of parameter itask */ int ida_irfnd; /* flag showing whether last step had a root */ long int ida_nge; /* counter for g evaluations */ - booleantype *ida_gactive; /* array with active/inactive event functions */ + sunbooleantype *ida_gactive; /* array with active/inactive event functions */ int ida_mxgnull; /* number of warning messages about possible g==0 */ /* Arrays for Fused Vector Operations */ @@ -452,7 +452,7 @@ void IDAErrHandler(int error_code, const char *module, const char *function, /* Norm functions. Also used for IC, so they are global.*/ sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - booleantype mask); + sunbooleantype mask); /* Nonlinear solver initialization */ diff --git a/src/ida/ida_io.c b/src/ida/ida_io.c index fdb7ba8c7a..f811f0dd0d 100644 --- a/src/ida/ida_io.c +++ b/src/ida/ida_io.c @@ -513,7 +513,7 @@ int IDASetMaxNonlinIters(void *ida_mem, int maxcor) /*-----------------------------------------------------------------*/ -int IDASetSuppressAlg(void *ida_mem, booleantype suppressalg) +int IDASetSuppressAlg(void *ida_mem, sunbooleantype suppressalg) { IDAMem IDA_mem; @@ -801,7 +801,7 @@ int IDASetMaxBacksIC(void *ida_mem, int maxbacks) /*-----------------------------------------------------------------*/ -int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff) +int IDASetLineSearchOffIC(void *ida_mem, sunbooleantype lsoff) { IDAMem IDA_mem; diff --git a/src/ida/ida_ls.c b/src/ida/ida_ls.c index 1279dc25c4..17a75ed3c3 100644 --- a/src/ida/ida_ls.c +++ b/src/ida/ida_ls.c @@ -49,8 +49,8 @@ int IDASetLinearSolver(void *ida_mem, SUNLinearSolver LS, SUNMatrix A) IDAMem IDA_mem; IDALsMem idals_mem; int retval, LSType; - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Return immediately if any input is NULL */ if (ida_mem == NULL) { @@ -359,7 +359,7 @@ int IDASetLSNormFactor(void *ida_mem, sunrealtype nrmfac) /* IDASetLinearSolutionScaling enables or disables scaling the linear solver solution to account for changes in cj. */ -int IDASetLinearSolutionScaling(void *ida_mem, booleantype onoff) +int IDASetLinearSolutionScaling(void *ida_mem, sunbooleantype onoff) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -1595,7 +1595,7 @@ int idaLsPerf(IDAMem IDA_mem, int perftask) IDALsMem idals_mem; sunrealtype rcfn, rcfl; long int nstd, nnid; - booleantype lcfn, lcfl; + sunbooleantype lcfn, lcfl; /* access IDALsMem structure */ if (IDA_mem->ida_lmem == NULL) { diff --git a/src/ida/ida_ls_impl.h b/src/ida/ida_ls_impl.h index 767b19efa2..1971a5935b 100644 --- a/src/ida/ida_ls_impl.h +++ b/src/ida/ida_ls_impl.h @@ -35,11 +35,11 @@ extern "C" { typedef struct IDALsMemRec { /* Linear solver type information */ - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Jacobian construction & storage */ - booleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ + sunbooleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ IDALsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* J_data is passed to jac */ @@ -54,7 +54,7 @@ typedef struct IDALsMemRec { N_Vector rcur; /* rcur = F(tn, ycur, ypcur) */ /* Matrix-based solver, scale solution to account for change in cj */ - booleantype scalesol; + sunbooleantype scalesol; /* Iterative solver tolerance */ sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ @@ -99,7 +99,7 @@ typedef struct IDALsMemRec { (b) internal jtimes - jt_data == ida_mem - jtimesDQ == SUNTRUE */ - booleantype jtimesDQ; + sunbooleantype jtimesDQ; IDALsJacTimesSetupFn jtsetup; IDALsJacTimesVecFn jtimes; IDAResFn jt_res; diff --git a/src/ida/ida_nls.c b/src/ida/ida_nls.c index 84b1917585..5660360f0d 100644 --- a/src/ida/ida_nls.c +++ b/src/ida/ida_nls.c @@ -28,7 +28,7 @@ /* private functions passed to nonlinear solver */ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem); -static int idaNlsLSetup(booleantype jbad, booleantype* jcur, void* ida_mem); +static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem); static int idaNlsLSolve(N_Vector delta, void* ida_mem); static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem); @@ -233,7 +233,7 @@ int idaNlsInit(IDAMem IDA_mem) } -static int idaNlsLSetup(booleantype jbad, booleantype* jcur, void* ida_mem) +static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; diff --git a/src/idas/idaa.c b/src/idas/idaa.c index e113a11b93..115a9e6606 100644 --- a/src/idas/idaa.c +++ b/src/idas/idaa.c @@ -49,25 +49,25 @@ static IDAckpntMem IDAAckpntInit(IDAMem IDA_mem); static IDAckpntMem IDAAckpntNew(IDAMem IDA_mem); static void IDAAckpntCopyVectors(IDAMem IDA_mem, IDAckpntMem ck_mem); -static booleantype IDAAckpntAllocVectors(IDAMem IDA_mem, IDAckpntMem ck_mem); +static sunbooleantype IDAAckpntAllocVectors(IDAMem IDA_mem, IDAckpntMem ck_mem); static void IDAAckpntDelete(IDAckpntMem *ck_memPtr); static void IDAAbckpbDelete(IDABMem *IDAB_memPtr); -static booleantype IDAAdataMalloc(IDAMem IDA_mem); +static sunbooleantype IDAAdataMalloc(IDAMem IDA_mem); static void IDAAdataFree(IDAMem IDA_mem); static int IDAAdataStore(IDAMem IDA_mem, IDAckpntMem ck_mem); static int IDAAckpntGet(IDAMem IDA_mem, IDAckpntMem ck_mem); -static booleantype IDAAhermiteMalloc(IDAMem IDA_mem); +static sunbooleantype IDAAhermiteMalloc(IDAMem IDA_mem); static void IDAAhermiteFree(IDAMem IDA_mem); static int IDAAhermiteStorePnt(IDAMem IDA_mem, IDAdtpntMem d); static int IDAAhermiteGetY(IDAMem IDA_mem, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS); -static booleantype IDAApolynomialMalloc(IDAMem IDA_mem); +static sunbooleantype IDAApolynomialMalloc(IDAMem IDA_mem); static void IDAApolynomialFree(IDAMem IDA_mem); static int IDAApolynomialStorePnt(IDAMem IDA_mem, IDAdtpntMem d); static int IDAApolynomialGetY(IDAMem IDA_mem, sunrealtype t, @@ -75,7 +75,7 @@ static int IDAApolynomialGetY(IDAMem IDA_mem, sunrealtype t, N_Vector *yyS, N_Vector *ypS); static int IDAAfindIndex(IDAMem ida_mem, sunrealtype t, - long int *indx, booleantype *newpoint); + long int *indx, sunbooleantype *newpoint); static int IDAAres(sunrealtype tt, N_Vector yyB, N_Vector ypB, @@ -364,7 +364,7 @@ int IDASolveF(void *ida_mem, sunrealtype tout, sunrealtype *tret, IDAdtpntMem *dt_mem; long int nstloc; int flag, i; - booleantype allocOK, earlyret; + sunbooleantype allocOK, earlyret; sunrealtype ttest; /* Is the mem OK? */ @@ -1455,7 +1455,7 @@ int IDASolveB(void *ida_mem, sunrealtype tBout, int itaskB) IDABMem IDAB_mem, tmp_IDAB_mem; int flag=0, sign; sunrealtype tfuzz, tBret, tBn; - booleantype gotCkpnt, reachedTBout, isActive; + sunbooleantype gotCkpnt, reachedTBout, isActive; /* Is the mem OK? */ if (ida_mem == NULL) { @@ -1951,7 +1951,7 @@ static void IDAAckpntDelete(IDAckpntMem *ck_memPtr) * current state of IDAMem. * */ -static booleantype IDAAckpntAllocVectors(IDAMem IDA_mem, IDAckpntMem ck_mem) +static sunbooleantype IDAAckpntAllocVectors(IDAMem IDA_mem, IDAckpntMem ck_mem) { int j, jj; @@ -2093,7 +2093,7 @@ static void IDAAckpntCopyVectors(IDAMem IDA_mem, IDAckpntMem ck_mem) * at any other time. */ -static booleantype IDAAdataMalloc(IDAMem IDA_mem) +static sunbooleantype IDAAdataMalloc(IDAMem IDA_mem) { IDAadjMem IDAADJ_mem; IDAdtpntMem *dt_mem; @@ -2328,13 +2328,13 @@ static int IDAAckpntGet(IDAMem IDA_mem, IDAckpntMem ck_mem) * at any other time. */ -static booleantype IDAAhermiteMalloc(IDAMem IDA_mem) +static sunbooleantype IDAAhermiteMalloc(IDAMem IDA_mem) { IDAadjMem IDAADJ_mem; IDAdtpntMem *dt_mem; IDAhermiteDataMem content; long int i, ii=0; - booleantype allocOK; + sunbooleantype allocOK; allocOK = SUNTRUE; @@ -2570,7 +2570,7 @@ static int IDAAhermiteGetY(IDAMem IDA_mem, sunrealtype t, int flag, is, NS; long int indx; - booleantype newpoint; + sunbooleantype newpoint; /* local variables for fused vector oerations */ int retval; @@ -2767,13 +2767,13 @@ static int IDAAhermiteGetY(IDAMem IDA_mem, sunrealtype t, * data point. */ -static booleantype IDAApolynomialMalloc(IDAMem IDA_mem) +static sunbooleantype IDAApolynomialMalloc(IDAMem IDA_mem) { IDAadjMem IDAADJ_mem; IDAdtpntMem *dt_mem; IDApolynomialDataMem content; long int i, ii=0; - booleantype allocOK; + sunbooleantype allocOK; allocOK = SUNTRUE; @@ -3018,7 +3018,7 @@ static int IDAApolynomialGetY(IDAMem IDA_mem, sunrealtype t, int flag, dir, order, i, j, is, NS, retval; long int indx, base; - booleantype newpoint; + sunbooleantype newpoint; sunrealtype delt, factor, Psi, Psiprime; IDAADJ_mem = IDA_mem->ida_adj_mem; @@ -3285,13 +3285,13 @@ static int IDAAGettnSolutionYpS(IDAMem IDA_mem, N_Vector *ypS) */ static int IDAAfindIndex(IDAMem ida_mem, sunrealtype t, - long int *indx, booleantype *newpoint) + long int *indx, sunbooleantype *newpoint) { IDAadjMem IDAADJ_mem; IDAMem IDA_mem; IDAdtpntMem *dt_mem; int sign; - booleantype to_left, to_right; + sunbooleantype to_left, to_right; IDA_mem = (IDAMem) ida_mem; IDAADJ_mem = IDA_mem->ida_adj_mem; diff --git a/src/idas/idaa_io.c b/src/idas/idaa_io.c index 9d266c861d..7ecc060bbd 100644 --- a/src/idas/idaa_io.c +++ b/src/idas/idaa_io.c @@ -324,7 +324,7 @@ int IDASetMaxStepB(void *ida_mem, int which, sunrealtype hmaxB) return IDASetMaxStep(ida_memB, hmaxB); } -int IDASetSuppressAlgB(void *ida_mem, int which, booleantype suppressalgB) +int IDASetSuppressAlgB(void *ida_mem, int which, sunbooleantype suppressalgB) { IDAMem IDA_mem; IDAadjMem IDAADJ_mem; diff --git a/src/idas/idas.c b/src/idas/idas.c index 3e4750e411..40327c6e10 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -241,20 +241,20 @@ * ================================================================= */ -static booleantype IDACheckNvector(N_Vector tmpl); +static sunbooleantype IDACheckNvector(N_Vector tmpl); /* Memory allocation/deallocation */ -static booleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl); +static sunbooleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl); static void IDAFreeVectors(IDAMem IDA_mem); -static booleantype IDAQuadAllocVectors(IDAMem IDA_mem, N_Vector tmpl); +static sunbooleantype IDAQuadAllocVectors(IDAMem IDA_mem, N_Vector tmpl); static void IDAQuadFreeVectors(IDAMem IDA_mem); -static booleantype IDASensAllocVectors(IDAMem IDA_mem, N_Vector tmpl); +static sunbooleantype IDASensAllocVectors(IDAMem IDA_mem, N_Vector tmpl); static void IDASensFreeVectors(IDAMem IDA_mem); -static booleantype IDAQuadSensAllocVectors(IDAMem ida_mem, N_Vector tmpl); +static sunbooleantype IDAQuadSensAllocVectors(IDAMem ida_mem, N_Vector tmpl); static void IDAQuadSensFreeVectors(IDAMem ida_mem); /* Initial setup */ @@ -563,7 +563,7 @@ int IDAInit(void *ida_mem, IDAResFn res, { int retval; IDAMem IDA_mem; - booleantype nvectorOK, allocOK; + sunbooleantype nvectorOK, allocOK; sunindextype lrw1, liw1; SUNNonlinearSolver NLS; @@ -989,7 +989,7 @@ int IDAWFtolerances(void *ida_mem, IDAEwtFn efun) int IDAQuadInit(void *ida_mem, IDAQuadRhsFn rhsQ, N_Vector yQ0) { IDAMem IDA_mem; - booleantype allocOK; + sunbooleantype allocOK; sunindextype lrw1Q, liw1Q; int retval; @@ -1222,7 +1222,7 @@ int IDASensInit(void *ida_mem, int Ns, int ism, { IDAMem IDA_mem; - booleantype allocOK; + sunbooleantype allocOK; int is, retval; SUNNonlinearSolver NLS; @@ -1616,7 +1616,7 @@ int IDASensSStolerances(void *ida_mem, sunrealtype reltolS, sunrealtype *abstolS if ( !(IDA_mem->ida_SatolSMallocDone) ) { IDA_mem->ida_SatolS = NULL; IDA_mem->ida_SatolS = (sunrealtype *)malloc(IDA_mem->ida_Ns*sizeof(sunrealtype)); - IDA_mem->ida_atolSmin0 = (booleantype *)malloc(IDA_mem->ida_Ns*sizeof(booleantype)); + IDA_mem->ida_atolSmin0 = (sunbooleantype *)malloc(IDA_mem->ida_Ns*sizeof(sunbooleantype)); IDA_mem->ida_lrw += IDA_mem->ida_Ns; IDA_mem->ida_SatolSMallocDone = SUNTRUE; } @@ -1677,7 +1677,7 @@ int IDASensSVtolerances(void *ida_mem, sunrealtype reltolS, N_Vector *abstolS) if ( SUNFALSE == IDA_mem->ida_VatolSMallocDone ) { IDA_mem->ida_VatolS = N_VCloneVectorArray(IDA_mem->ida_Ns, IDA_mem->ida_tempv1); - IDA_mem->ida_atolSmin0 = (booleantype *)malloc(IDA_mem->ida_Ns*sizeof(booleantype)); + IDA_mem->ida_atolSmin0 = (sunbooleantype *)malloc(IDA_mem->ida_Ns*sizeof(sunbooleantype)); IDA_mem->ida_lrw += IDA_mem->ida_Ns*IDA_mem->ida_lrw1; IDA_mem->ida_liw += IDA_mem->ida_Ns*IDA_mem->ida_liw1; IDA_mem->ida_VatolSMallocDone = SUNTRUE; @@ -1722,7 +1722,7 @@ int IDASensEEtolerances(void *ida_mem) int IDAQuadSensInit(void *ida_mem, IDAQuadSensRhsFn rhsQS, N_Vector *yQS0) { IDAMem IDA_mem; - booleantype allocOK; + sunbooleantype allocOK; int is, retval; if (ida_mem==NULL) { @@ -1917,7 +1917,7 @@ int IDAQuadSensSStolerances(void *ida_mem, sunrealtype reltolQS, sunrealtype *ab if ( !(IDA_mem->ida_SatolQSMallocDone) ) { IDA_mem->ida_SatolQS = (sunrealtype *)malloc(IDA_mem->ida_Ns*sizeof(sunrealtype)); - IDA_mem->ida_atolQSmin0 = (booleantype *)malloc(IDA_mem->ida_Ns*sizeof(booleantype)); + IDA_mem->ida_atolQSmin0 = (sunbooleantype *)malloc(IDA_mem->ida_Ns*sizeof(sunbooleantype)); IDA_mem->ida_lrw += IDA_mem->ida_Ns; IDA_mem->ida_SatolQSMallocDone = SUNTRUE; } @@ -1982,7 +1982,7 @@ int IDAQuadSensSVtolerances(void *ida_mem, sunrealtype reltolQS, N_Vector *absto if ( !(IDA_mem->ida_VatolQSMallocDone) ) { IDA_mem->ida_VatolQS = N_VCloneVectorArray(IDA_mem->ida_Ns, abstolQS[0]); - IDA_mem->ida_atolQSmin0 = (booleantype *)malloc(IDA_mem->ida_Ns*sizeof(booleantype)); + IDA_mem->ida_atolQSmin0 = (sunbooleantype *)malloc(IDA_mem->ida_Ns*sizeof(sunbooleantype)); IDA_mem->ida_lrw += IDA_mem->ida_Ns*IDA_mem->ida_lrw1Q; IDA_mem->ida_liw += IDA_mem->ida_Ns*IDA_mem->ida_liw1Q; IDA_mem->ida_VatolQSMallocDone = SUNTRUE; @@ -2202,7 +2202,7 @@ int IDARootInit(void *ida_mem, int nrtfn, IDARootFn g) } IDA_mem->ida_gactive = NULL; - IDA_mem->ida_gactive = (booleantype *) malloc(nrt*sizeof(booleantype)); + IDA_mem->ida_gactive = (sunbooleantype *) malloc(nrt*sizeof(sunbooleantype)); if (IDA_mem->ida_gactive == NULL) { free(IDA_mem->ida_glo); IDA_mem->ida_glo = NULL; free(IDA_mem->ida_ghi); IDA_mem->ida_ghi = NULL; @@ -2279,7 +2279,7 @@ int IDASolve(void *ida_mem, sunrealtype tout, sunrealtype *tret, int sflag, istate, ier, irfndp, ir, is; sunrealtype tdist, troundoff, ypnorm, rh, nrm; IDAMem IDA_mem; - booleantype inactive_roots; + sunbooleantype inactive_roots; /* Check for legal inputs in all cases. */ @@ -3768,7 +3768,7 @@ void IDAQuadSensFree(void* ida_mem) * If any of them is missing it returns SUNFALSE. */ -static booleantype IDACheckNvector(N_Vector tmpl) +static sunbooleantype IDACheckNvector(N_Vector tmpl) { if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -3805,7 +3805,7 @@ static booleantype IDACheckNvector(N_Vector tmpl) * allocated here. */ -static booleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl) +static sunbooleantype IDAAllocVectors(IDAMem IDA_mem, N_Vector tmpl) { int i, j, maxcol; @@ -3981,7 +3981,7 @@ static void IDAFreeVectors(IDAMem IDA_mem) * IDAQuadReInit. */ -static booleantype IDAQuadAllocVectors(IDAMem IDA_mem, N_Vector tmpl) +static sunbooleantype IDAQuadAllocVectors(IDAMem IDA_mem, N_Vector tmpl) { int i, j; @@ -4072,7 +4072,7 @@ static void IDAQuadFreeVectors(IDAMem IDA_mem) * Allocates space for the N_Vectors, plist, and pbar required for FSA. */ -static booleantype IDASensAllocVectors(IDAMem IDA_mem, N_Vector tmpl) +static sunbooleantype IDASensAllocVectors(IDAMem IDA_mem, N_Vector tmpl) { int j, maxcol; @@ -4267,7 +4267,7 @@ static void IDASensFreeVectors(IDAMem IDA_mem) * using the N_Vector 'tmpl' as a template. */ -static booleantype IDAQuadSensAllocVectors(IDAMem IDA_mem, N_Vector tmpl) +static sunbooleantype IDAQuadSensAllocVectors(IDAMem IDA_mem, N_Vector tmpl) { int i, j, maxcol; @@ -4389,7 +4389,7 @@ static void IDAQuadSensFreeVectors(IDAMem IDA_mem) int IDAInitialSetup(IDAMem IDA_mem) { - booleantype conOK; + sunbooleantype conOK; int ier; /* Test for more vector operations, depending on options */ @@ -5307,7 +5307,7 @@ static int IDAStep(IDAMem IDA_mem) int ncf, nef; int nflag, kflag; int retval; - booleantype sensi_stg, sensi_sim; + sunbooleantype sensi_stg, sensi_sim; /* Are we computing sensitivities with the staggered or simultaneous approach? */ sensi_stg = (IDA_mem->ida_sensi && (IDA_mem->ida_ism==IDA_STAGGERED)); @@ -5666,7 +5666,7 @@ static void IDASetCoeffs(IDAMem IDA_mem, sunrealtype *ck) static int IDANls(IDAMem IDA_mem) { int retval; - booleantype constraintsPassed, callLSetup, sensi_sim; + sunbooleantype constraintsPassed, callLSetup, sensi_sim; sunrealtype temp1, temp2, vnorm; N_Vector mm, tmp; long int nni_inc = 0; @@ -5909,7 +5909,7 @@ static void IDAQuadPredict(IDAMem IDA_mem) static int IDASensNls(IDAMem IDA_mem) { - booleantype callLSetup; + sunbooleantype callLSetup; long int nniS_inc = 0; long int nnfS_inc = 0; int retval; @@ -6166,7 +6166,7 @@ static int IDAQuadTestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype errQ_k, errQ_km1, errQ_km2; sunrealtype terr_k, terr_km1, terr_km2; N_Vector tempv; - booleantype check_for_reduction = SUNFALSE; + sunbooleantype check_for_reduction = SUNFALSE; /* Rename ypQ */ tempv = IDA_mem->ida_ypQ; @@ -6249,7 +6249,7 @@ static int IDASensTestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype errS_k, errS_km1, errS_km2; sunrealtype terr_k, terr_km1, terr_km2; N_Vector *tempv; - booleantype check_for_reduction = SUNFALSE; + sunbooleantype check_for_reduction = SUNFALSE; int retval; /* Rename deltaS */ @@ -6347,7 +6347,7 @@ static int IDAQuadSensTestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype errQS_k, errQS_km1, errQS_km2; sunrealtype terr_k, terr_km1, terr_km2; N_Vector *tempv; - booleantype check_for_reduction = SUNFALSE; + sunbooleantype check_for_reduction = SUNFALSE; int retval; tempv = IDA_mem->ida_yyQS; @@ -7097,7 +7097,7 @@ int IDAGetSolution(void *ida_mem, sunrealtype t, N_Vector yret, N_Vector ypret) */ sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - booleantype mask) + sunbooleantype mask) { sunrealtype nrm; @@ -7122,7 +7122,7 @@ sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, */ sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, - booleantype mask) + sunbooleantype mask) { int is; sunrealtype nrm; @@ -7192,7 +7192,7 @@ static sunrealtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS, - booleantype mask) + sunbooleantype mask) { sunrealtype snrm; @@ -7233,7 +7233,7 @@ static int IDARcheck1(IDAMem IDA_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; for (i = 0; i < IDA_mem->ida_nrtfn; i++) IDA_mem->ida_iroots[i] = 0; @@ -7302,7 +7302,7 @@ static int IDARcheck2(IDAMem IDA_mem) { int i, retval; sunrealtype smallh, hratio, tplus; - booleantype zroot; + sunbooleantype zroot; if (IDA_mem->ida_irfnd == 0) return(IDA_SUCCESS); @@ -7498,7 +7498,7 @@ static int IDARootfind(IDAMem IDA_mem) { sunrealtype alph, tmid, gfrac, maxfrac, fracint, fracsub; int i, retval, imax, side, sideprev; - booleantype zroot, sgnchg; + sunbooleantype zroot, sgnchg; imax = 0; diff --git a/src/idas/idas_ic.c b/src/idas/idas_ic.c index e2b768ab75..edc8034758 100644 --- a/src/idas/idas_ic.c +++ b/src/idas/idas_ic.c @@ -59,12 +59,12 @@ extern int IDAInitialSetup(IDAMem IDA_mem); extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, - N_Vector w, booleantype mask); + N_Vector w, sunbooleantype mask); extern sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, - N_Vector *wS, booleantype mask); + N_Vector *wS, sunbooleantype mask); extern sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS, - booleantype mask); + sunbooleantype mask); extern int IDASensEwtSet(IDAMem IDA_mem, N_Vector *yScur, N_Vector *weightS); @@ -126,7 +126,7 @@ int IDACalcIC(void *ida_mem, int icopt, sunrealtype tout1) int is; sunrealtype tdist, troundoff, minid, hic, ypnorm; IDAMem IDA_mem; - booleantype sensi_stg, sensi_sim; + sunbooleantype sensi_stg, sensi_sim; /* Check if IDA memory exists */ @@ -489,7 +489,7 @@ static int IDANlsIC(IDAMem IDA_mem) { int retval, nj, is; N_Vector tv1, tv2, tv3; - booleantype sensi_sim; + sunbooleantype sensi_sim; /* Are we computing sensitivities with the IDA_SIMULTANEOUS approach? */ sensi_sim = (IDA_mem->ida_sensi && (IDA_mem->ida_ism==IDA_SIMULTANEOUS)); @@ -593,7 +593,7 @@ static int IDANewtonIC(IDAMem IDA_mem) { int retval, mnewt, is; sunrealtype delnorm, fnorm, fnorm0, oldfnrm, rate; - booleantype sensi_sim; + sunbooleantype sensi_sim; /* Are we computing sensitivities with the IDA_SIMULTANEOUS approach? */ sensi_sim = (IDA_mem->ida_sensi && (IDA_mem->ida_ism==IDA_SIMULTANEOUS)); @@ -697,11 +697,11 @@ static int IDANewtonIC(IDAMem IDA_mem) static int IDALineSrch(IDAMem IDA_mem, sunrealtype *delnorm, sunrealtype *fnorm) { - booleantype conOK; + sunbooleantype conOK; int retval, is, nbacks; sunrealtype f1norm, fnormp, f1normp, ratio, lambda, minlam, slpi; N_Vector mc; - booleantype sensi_sim; + sunbooleantype sensi_sim; /* Initialize work space pointers, f1norm, ratio. (Use of mc in constraint check does not conflict with ypnew.) */ diff --git a/src/idas/idas_impl.h b/src/idas/idas_impl.h index f6e9098aa2..0afa86d94a 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -114,44 +114,44 @@ typedef struct IDAMemRec { sunrealtype ida_rtol; /* relative tolerance */ sunrealtype ida_Satol; /* scalar absolute tolerance */ N_Vector ida_Vatol; /* vector absolute tolerance */ - booleantype ida_atolmin0; /* flag indicating that min(atol) = 0 */ - booleantype ida_user_efun; /* SUNTRUE if user provides efun */ + sunbooleantype ida_atolmin0; /* flag indicating that min(atol) = 0 */ + sunbooleantype ida_user_efun; /* SUNTRUE if user provides efun */ IDAEwtFn ida_efun; /* function to set ewt */ void *ida_edata; /* user pointer passed to efun */ - booleantype ida_constraintsSet; /* constraints vector present: + sunbooleantype ida_constraintsSet; /* constraints vector present: do constraints calc */ - booleantype ida_suppressalg; /* SUNTRUE means suppress algebraic vars + sunbooleantype ida_suppressalg; /* SUNTRUE means suppress algebraic vars in local error tests */ /*----------------------- Quadrature Related Data -----------------------*/ - booleantype ida_quadr; + sunbooleantype ida_quadr; IDAQuadRhsFn ida_rhsQ; void *ida_user_dataQ; - booleantype ida_errconQ; + sunbooleantype ida_errconQ; int ida_itolQ; sunrealtype ida_rtolQ; sunrealtype ida_SatolQ; /* scalar absolute tolerance for quadratures */ N_Vector ida_VatolQ; /* vector absolute tolerance for quadratures */ - booleantype ida_atolQmin0; /* flag indicating that min(atolQ) = 0 */ + sunbooleantype ida_atolQmin0; /* flag indicating that min(atolQ) = 0 */ /*------------------------ Sensitivity Related Data ------------------------*/ - booleantype ida_sensi; + sunbooleantype ida_sensi; int ida_Ns; int ida_ism; IDASensResFn ida_resS; void *ida_user_dataS; - booleantype ida_resSDQ; + sunbooleantype ida_resSDQ; sunrealtype *ida_p; sunrealtype *ida_pbar; @@ -159,31 +159,31 @@ typedef struct IDAMemRec { int ida_DQtype; sunrealtype ida_DQrhomax; - booleantype ida_errconS; /* SUNTRUE if sensitivities in err. control */ + sunbooleantype ida_errconS; /* SUNTRUE if sensitivities in err. control */ int ida_itolS; sunrealtype ida_rtolS; /* relative tolerance for sensitivities */ sunrealtype *ida_SatolS; /* scalar absolute tolerances for sensi. */ N_Vector *ida_VatolS; /* vector absolute tolerances for sensi. */ - booleantype *ida_atolSmin0; /* flag indicating that min(atolS[is]) = 0 */ + sunbooleantype *ida_atolSmin0; /* flag indicating that min(atolS[is]) = 0 */ /*----------------------------------- Quadrature Sensitivity Related Data -----------------------------------*/ - booleantype ida_quadr_sensi; /* SUNTRUE if computing sensitivities of quadrs. */ + sunbooleantype ida_quadr_sensi; /* SUNTRUE if computing sensitivities of quadrs. */ IDAQuadSensRhsFn ida_rhsQS; /* fQS = (dfQ/dy)*yS + (dfQ/dp) */ void *ida_user_dataQS; /* data pointer passed to fQS */ - booleantype ida_rhsQSDQ; /* SUNTRUE if using internal DQ functions */ + sunbooleantype ida_rhsQSDQ; /* SUNTRUE if using internal DQ functions */ - booleantype ida_errconQS; /* SUNTRUE if yQS are considered in err. con. */ + sunbooleantype ida_errconQS; /* SUNTRUE if yQS are considered in err. con. */ int ida_itolQS; sunrealtype ida_rtolQS; /* relative tolerance for yQS */ sunrealtype *ida_SatolQS; /* scalar absolute tolerances for yQS */ N_Vector *ida_VatolQS; /* vector absolute tolerances for yQS */ - booleantype *ida_atolQSmin0; /* flag indicating that min(atolQS[is]) = 0 */ + sunbooleantype *ida_atolQSmin0; /* flag indicating that min(atolQS[is]) = 0 */ /*----------------------------------------------- Divided differences array and associated arrays @@ -282,7 +282,7 @@ typedef struct IDAMemRec { N_Vector ida_yp0; /* initial y' vector (user-supplied). */ int ida_icopt; /* IC calculation user option */ - booleantype ida_lsoff; /* IC calculation linesearch turnoff option */ + sunbooleantype ida_lsoff; /* IC calculation linesearch turnoff option */ int ida_maxnh; /* max. number of h tries in IC calculation */ int ida_maxnj; /* max. number of J tries in IC calculation */ int ida_maxnit; /* max. number of Netwon iterations in IC calc. */ @@ -295,7 +295,7 @@ typedef struct IDAMemRec { /* Tstop information */ - booleantype ida_tstopset; + sunbooleantype ida_tstopset; sunrealtype ida_tstop; /* Step Data */ @@ -401,42 +401,42 @@ typedef struct IDAMemRec { /* Flags to verify correct calling sequence */ - booleantype ida_SetupDone; /* set to SUNFALSE by IDAMalloc and IDAReInit + sunbooleantype ida_SetupDone; /* set to SUNFALSE by IDAMalloc and IDAReInit set to SUNTRUE by IDACalcIC or IDASolve */ - booleantype ida_VatolMallocDone; - booleantype ida_constraintsMallocDone; - booleantype ida_idMallocDone; + sunbooleantype ida_VatolMallocDone; + sunbooleantype ida_constraintsMallocDone; + sunbooleantype ida_idMallocDone; - booleantype ida_MallocDone; /* set to SUNFALSE by IDACreate + sunbooleantype ida_MallocDone; /* set to SUNFALSE by IDACreate set to SUNTRUE by IDAMAlloc tested by IDAReInit and IDASolve */ - booleantype ida_VatolQMallocDone; - booleantype ida_quadMallocDone; + sunbooleantype ida_VatolQMallocDone; + sunbooleantype ida_quadMallocDone; - booleantype ida_VatolSMallocDone; - booleantype ida_SatolSMallocDone; - booleantype ida_sensMallocDone; + sunbooleantype ida_VatolSMallocDone; + sunbooleantype ida_SatolSMallocDone; + sunbooleantype ida_sensMallocDone; - booleantype ida_VatolQSMallocDone; - booleantype ida_SatolQSMallocDone; - booleantype ida_quadSensMallocDone; + sunbooleantype ida_VatolQSMallocDone; + sunbooleantype ida_SatolQSMallocDone; + sunbooleantype ida_quadSensMallocDone; /*--------------------- Nonlinear Solver Data ---------------------*/ SUNNonlinearSolver NLS; /* nonlinear solver object */ - booleantype ownNLS; /* flag indicating NLS ownership */ + sunbooleantype ownNLS; /* flag indicating NLS ownership */ SUNNonlinearSolver NLSsim; /* nonlinear solver object for DAE+Sens solves with the simultaneous corrector option */ - booleantype ownNLSsim; /* flag indicating NLS ownership */ + sunbooleantype ownNLSsim; /* flag indicating NLS ownership */ SUNNonlinearSolver NLSstg; /* nonlinear solver object for DAE+Sens solves with the staggered corrector option */ - booleantype ownNLSstg; /* flag indicating NLS ownership */ + sunbooleantype ownNLSstg; /* flag indicating NLS ownership */ /* The following vectors are NVector wrappers for use with the simultaneous and staggered corrector methods: @@ -454,8 +454,8 @@ typedef struct IDAMemRec { /* flags indicating if vector wrappers for the simultaneous and staggered correctors have been allocated */ - booleantype simMallocDone; - booleantype stgMallocDone; + sunbooleantype simMallocDone; + sunbooleantype stgMallocDone; IDAResFn nls_res; /* F(t,y(t),y'(t))=0; used in the nonlinear solver */ @@ -487,11 +487,11 @@ typedef struct IDAMemRec { /* Flag to request a call to the setup routine */ - booleantype ida_forceSetup; + sunbooleantype ida_forceSetup; /* Flag to indicate successful ida_linit call */ - booleantype ida_linitOK; + sunbooleantype ida_linitOK; /*---------------- Rootfinding Data @@ -512,7 +512,7 @@ typedef struct IDAMemRec { int ida_taskc; /* copy of parameter itask */ int ida_irfnd; /* flag showing whether last step had a root */ long int ida_nge; /* counter for g evaluations */ - booleantype *ida_gactive; /* array with active/inactive event functions */ + sunbooleantype *ida_gactive; /* array with active/inactive event functions */ int ida_mxgnull; /* number of warning messages about possible g==0 */ /* Arrays for Fused Vector Operations */ @@ -529,11 +529,11 @@ typedef struct IDAMemRec { Adjoint sensitivity data ------------------------*/ - booleantype ida_adj; /* SUNTRUE if performing ASA */ + sunbooleantype ida_adj; /* SUNTRUE if performing ASA */ struct IDAadjMemRec *ida_adj_mem; /* Pointer to adjoint memory structure */ - booleantype ida_adjMallocDone; + sunbooleantype ida_adjMallocDone; } *IDAMem; @@ -569,7 +569,7 @@ typedef struct IDABMemRec *IDABMem; * ----------------------------------------------------------------- */ -typedef booleantype (*IDAAMMallocFn)(IDAMem IDA_mem); +typedef sunbooleantype (*IDAAMMallocFn)(IDAMem IDA_mem); typedef void (*IDAAMFreeFn)(IDAMem IDA_mem); typedef int (*IDAAGetYFn)(IDAMem IDA_mem, sunrealtype t, N_Vector yy, N_Vector yp, @@ -596,13 +596,13 @@ struct IDAckpntMemRec { N_Vector ck_phi[MXORDP1]; /* Do we need to carry quadratures? */ - booleantype ck_quadr; + sunbooleantype ck_quadr; /* Modified divided difference array for quadratures */ N_Vector ck_phiQ[MXORDP1]; /* Do we need to carry sensitivities? */ - booleantype ck_sensi; + sunbooleantype ck_sensi; /* number of sensitivities */ int ck_Ns; @@ -611,7 +611,7 @@ struct IDAckpntMemRec { N_Vector *ck_phiS[MXORDP1]; /* Do we need to carry quadrature sensitivities? */ - booleantype ck_quadr_sensi; + sunbooleantype ck_quadr_sensi; /* Modified divided difference array for quadrature sensitivities */ N_Vector *ck_phiQS[MXORDP1]; @@ -706,8 +706,8 @@ struct IDABMemRec { /* Flags to indicate that this backward problem's RHS or quad RHS * require forward sensitivities */ - booleantype ida_res_withSensi; - booleantype ida_rhsQ_withSensi; + sunbooleantype ida_res_withSensi; + sunbooleantype ida_rhsQ_withSensi; /* Residual function for backward run */ IDAResFnB ida_res; @@ -766,15 +766,15 @@ struct IDAadjMemRec { sunrealtype ia_tinitial, ia_tfinal; /* Flag for first call to IDASolveF */ - booleantype ia_firstIDAFcall; + sunbooleantype ia_firstIDAFcall; /* Flag if IDASolveF was called with TSTOP */ - booleantype ia_tstopIDAFcall; + sunbooleantype ia_tstopIDAFcall; sunrealtype ia_tstopIDAF; /* Flag if IDASolveF was called in IDA_NORMAL_MODE and encountered a root after tout */ - booleantype ia_rootret; + sunbooleantype ia_rootret; sunrealtype ia_troot; /* ---------------------- @@ -791,7 +791,7 @@ struct IDAadjMemRec { struct IDABMemRec *ia_bckpbCrt; /* Flag for first call to IDASolveB */ - booleantype ia_firstIDABcall; + sunbooleantype ia_firstIDABcall; /* ---------------- * Check point data @@ -834,12 +834,12 @@ struct IDAadjMemRec { IDAAMFreeFn ia_free; /* destroys data point */ /* Flags controlling the interpolation module */ - booleantype ia_mallocDone; /* IM initialized? */ - booleantype ia_newData; /* new data available in dt_mem? */ - booleantype ia_storeSensi; /* store sensitivities? */ - booleantype ia_interpSensi; /* interpolate sensitivities? */ + sunbooleantype ia_mallocDone; /* IM initialized? */ + sunbooleantype ia_newData; /* new data available in dt_mem? */ + sunbooleantype ia_storeSensi; /* store sensitivities? */ + sunbooleantype ia_interpSensi; /* interpolate sensitivities? */ - booleantype ia_noInterp; /* interpolations are temporarly */ + sunbooleantype ia_noInterp; /* interpolations are temporarly */ /* disabled ( IDACalcICB ) */ /* Workspace for polynomial interpolation */ @@ -969,14 +969,14 @@ void IDAErrHandler(int error_code, const char *module, const char *function, /* Norm functions. Also used for IC, so they are global.*/ sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - booleantype mask); + sunbooleantype mask); sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector *xS, N_Vector *wS, - booleantype mask); + sunbooleantype mask); sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, N_Vector *xS, N_Vector *wS, - booleantype mask); + sunbooleantype mask); /* Nonlinear solver initialization */ diff --git a/src/idas/idas_io.c b/src/idas/idas_io.c index fef2fc6c7e..164d536eb2 100644 --- a/src/idas/idas_io.c +++ b/src/idas/idas_io.c @@ -492,7 +492,7 @@ int IDASetMaxConvFails(void *ida_mem, int maxncf) int IDASetMaxNonlinIters(void *ida_mem, int maxcor) { IDAMem IDA_mem; - booleantype sensi_sim; + sunbooleantype sensi_sim; if (ida_mem==NULL) { IDAProcessError(NULL, IDA_MEM_NULL, "IDAS", @@ -531,7 +531,7 @@ int IDASetMaxNonlinIters(void *ida_mem, int maxcor) /*-----------------------------------------------------------------*/ -int IDASetSuppressAlg(void *ida_mem, booleantype suppressalg) +int IDASetSuppressAlg(void *ida_mem, sunbooleantype suppressalg) { IDAMem IDA_mem; @@ -819,7 +819,7 @@ int IDASetMaxBacksIC(void *ida_mem, int maxbacks) /*-----------------------------------------------------------------*/ -int IDASetLineSearchOffIC(void *ida_mem, booleantype lsoff) +int IDASetLineSearchOffIC(void *ida_mem, sunbooleantype lsoff) { IDAMem IDA_mem; @@ -866,7 +866,7 @@ int IDASetStepToleranceIC(void *ida_mem, sunrealtype steptol) /*-----------------------------------------------------------------*/ -int IDASetQuadErrCon(void *ida_mem, booleantype errconQ) +int IDASetQuadErrCon(void *ida_mem, sunbooleantype errconQ) { IDAMem IDA_mem; @@ -921,7 +921,7 @@ int IDASetSensDQMethod(void *ida_mem, int DQtype, sunrealtype DQrhomax) /*-----------------------------------------------------------------*/ -int IDASetSensErrCon(void *ida_mem, booleantype errconS) +int IDASetSensErrCon(void *ida_mem, sunbooleantype errconS) { IDAMem IDA_mem; @@ -1026,7 +1026,7 @@ int IDASetSensParams(void *ida_mem, sunrealtype *p, sunrealtype *pbar, int *plis * are considered or not in the error control. * ----------------------------------------------------------------- */ -int IDASetQuadSensErrCon(void *ida_mem, booleantype errconQS) +int IDASetQuadSensErrCon(void *ida_mem, sunbooleantype errconQS) { IDAMem IDA_mem; diff --git a/src/idas/idas_ls.c b/src/idas/idas_ls.c index 48b18c3a4a..87a35eddf7 100644 --- a/src/idas/idas_ls.c +++ b/src/idas/idas_ls.c @@ -100,8 +100,8 @@ int IDASetLinearSolver(void *ida_mem, SUNLinearSolver LS, SUNMatrix A) IDAMem IDA_mem; IDALsMem idals_mem; int retval, LSType; - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Return immediately if any input is NULL */ if (ida_mem == NULL) { @@ -410,7 +410,7 @@ int IDASetLSNormFactor(void *ida_mem, sunrealtype nrmfac) /* IDASetLinearSolutionScaling enables or disables scaling the linear solver solution to account for changes in cj. */ -int IDASetLinearSolutionScaling(void *ida_mem, booleantype onoff) +int IDASetLinearSolutionScaling(void *ida_mem, sunbooleantype onoff) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -1646,7 +1646,7 @@ int idaLsPerf(IDAMem IDA_mem, int perftask) IDALsMem idals_mem; sunrealtype rcfn, rcfl; long int nstd, nnid; - booleantype lcfn, lcfl; + sunbooleantype lcfn, lcfl; /* access IDALsMem structure */ if (IDA_mem->ida_lmem == NULL) { @@ -1978,7 +1978,7 @@ int IDASetLSNormFactorB(void *ida_mem, int which, sunrealtype nrmfacB) } -int IDASetLinearSolutionScalingB(void *ida_mem, int which, booleantype onoffB) +int IDASetLinearSolutionScalingB(void *ida_mem, int which, sunbooleantype onoffB) { IDAadjMem IDAADJ_mem; IDAMem IDA_mem; diff --git a/src/idas/idas_ls_impl.h b/src/idas/idas_ls_impl.h index a72dea9c48..49adc45603 100644 --- a/src/idas/idas_ls_impl.h +++ b/src/idas/idas_ls_impl.h @@ -35,11 +35,11 @@ extern "C" { typedef struct IDALsMemRec { /* Linear solver type information */ - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Jacobian construction & storage */ - booleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ + sunbooleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ IDALsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* J_data is passed to jac */ @@ -54,7 +54,7 @@ typedef struct IDALsMemRec { N_Vector rcur; /* rcur = F(tn, ycur, ypcur) */ /* Matrix-based solver, scale solution to account for change in cj */ - booleantype scalesol; + sunbooleantype scalesol; /* Iterative solver tolerance */ sunrealtype eplifac; /* nonlinear -> linear tol scaling factor */ @@ -99,7 +99,7 @@ typedef struct IDALsMemRec { (b) internal jtimes - jt_data == ida_mem - jtimesDQ == SUNTRUE */ - booleantype jtimesDQ; + sunbooleantype jtimesDQ; IDALsJacTimesSetupFn jtsetup; IDALsJacTimesVecFn jtimes; IDAResFn jt_res; diff --git a/src/idas/idas_nls.c b/src/idas/idas_nls.c index 702f7099da..6b7a6a07a9 100644 --- a/src/idas/idas_nls.c +++ b/src/idas/idas_nls.c @@ -28,7 +28,7 @@ /* private functions passed to nonlinear solver */ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem); -static int idaNlsLSetup(booleantype jbad, booleantype* jcur, void* ida_mem); +static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem); static int idaNlsLSolve(N_Vector delta, void* ida_mem); static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem); @@ -233,7 +233,7 @@ int idaNlsInit(IDAMem IDA_mem) } -static int idaNlsLSetup(booleantype jbad, booleantype* jcur, void* ida_mem) +static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; diff --git a/src/idas/idas_nls_sim.c b/src/idas/idas_nls_sim.c index 8338bd5b4b..ecd04a7026 100644 --- a/src/idas/idas_nls_sim.c +++ b/src/idas/idas_nls_sim.c @@ -29,7 +29,7 @@ /* private functions passed to nonlinear solver */ static int idaNlsResidualSensSim(N_Vector ycor, N_Vector res, void* ida_mem); -static int idaNlsLSetupSensSim(booleantype jbad, booleantype* jcur, +static int idaNlsLSetupSensSim(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem); static int idaNlsLSolveSensSim(N_Vector delta, void* ida_mem); static int idaNlsConvTestSensSim(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, @@ -265,7 +265,7 @@ int idaNlsInitSensSim(IDAMem IDA_mem) } -static int idaNlsLSetupSensSim(booleantype jbad, booleantype* jcur, +static int idaNlsLSetupSensSim(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; diff --git a/src/idas/idas_nls_stg.c b/src/idas/idas_nls_stg.c index 09c223bf0f..1d8935ea5f 100644 --- a/src/idas/idas_nls_stg.c +++ b/src/idas/idas_nls_stg.c @@ -29,7 +29,7 @@ /* private functions passed to nonlinear solver */ static int idaNlsResidualSensStg(N_Vector ycor, N_Vector res, void* ida_mem); -static int idaNlsLSetupSensStg(booleantype jbad, booleantype* jcur, +static int idaNlsLSetupSensStg(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem); static int idaNlsLSolveSensStg(N_Vector delta, void* ida_mem); static int idaNlsConvTestSensStg(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, @@ -219,7 +219,7 @@ int idaNlsInitSensStg(IDAMem IDA_mem) } -static int idaNlsLSetupSensStg(booleantype jbad, booleantype* jcur, +static int idaNlsLSetupSensStg(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 1d79a46a7c..dda1a70a48 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -162,17 +162,17 @@ * ================================================================= */ -static booleantype KINCheckNvector(N_Vector tmpl); -static booleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl); +static sunbooleantype KINCheckNvector(N_Vector tmpl); +static sunbooleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl); static int KINSolInit(KINMem kin_mem); static int KINConstraint(KINMem kin_mem ); static void KINForcingTerm(KINMem kin_mem, sunrealtype fnormp); static void KINFreeVectors(KINMem kin_mem); static int KINFullNewton(KINMem kin_mem, sunrealtype *fnormp, - sunrealtype *f1normp, booleantype *maxStepTaken); + sunrealtype *f1normp, sunbooleantype *maxStepTaken); static int KINLineSearch(KINMem kin_mem, sunrealtype *fnormp, - sunrealtype *f1normp, booleantype *maxStepTaken); + sunrealtype *f1normp, sunbooleantype *maxStepTaken); static int KINPicardAA(KINMem kin_mem); static int KINFP(KINMem kin_mem); @@ -181,7 +181,7 @@ static int KINPicardFcnEval(KINMem kin_mem, N_Vector gval, N_Vector uval, N_Vector fval1); static sunrealtype KINScFNorm(KINMem kin_mem, N_Vector v, N_Vector scale); static sunrealtype KINScSNorm(KINMem kin_mem, N_Vector v, N_Vector u); -static int KINStop(KINMem kin_mem, booleantype maxStepTaken, +static int KINStop(KINMem kin_mem, sunbooleantype maxStepTaken, int sflag); static int AndersonAcc(KINMem kin_mem, N_Vector gval, N_Vector fv, N_Vector x, N_Vector x_old, long int iter, sunrealtype *R, sunrealtype *gamma); @@ -340,7 +340,7 @@ int KINInit(void *kinmem, KINSysFn func, N_Vector tmpl) { sunindextype liw1, lrw1; KINMem kin_mem; - booleantype allocOK, nvectorOK, dotprodSB; + sunbooleantype allocOK, nvectorOK, dotprodSB; /* check kinmem */ @@ -482,7 +482,7 @@ int KINSol(void *kinmem, N_Vector u, int strategy_in, sunrealtype fnormp, f1normp, epsmin; KINMem kin_mem; int ret, sflag; - booleantype maxStepTaken; + sunbooleantype maxStepTaken; /* intialize to avoid compiler warning messages */ @@ -782,7 +782,7 @@ void KINFree(void **kinmem) * SUNTRUE. Otherwise, SUNFALSE is returned. */ -static booleantype KINCheckNvector(N_Vector tmpl) +static sunbooleantype KINCheckNvector(N_Vector tmpl) { if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || @@ -813,7 +813,7 @@ static booleantype KINCheckNvector(N_Vector tmpl) * returns SUNFALSE. */ -static booleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl) +static sunbooleantype KINAllocVectors(KINMem kin_mem, N_Vector tmpl) { /* allocate unew, fval, pp, vtemp1 and vtemp2. */ /* allocate df, dg, q, for Anderson Acceleration, Broyden and EN */ @@ -1574,10 +1574,10 @@ static int KINLinSolDrv(KINMem kin_mem) */ static int KINFullNewton(KINMem kin_mem, sunrealtype *fnormp, sunrealtype *f1normp, - booleantype *maxStepTaken) + sunbooleantype *maxStepTaken) { sunrealtype pnorm, ratio; - booleantype fOK; + sunbooleantype fOK; int ircvr, retval; *maxStepTaken = SUNFALSE; @@ -1707,13 +1707,13 @@ static int KINFullNewton(KINMem kin_mem, sunrealtype *fnormp, sunrealtype *f1nor */ static int KINLineSearch(KINMem kin_mem, sunrealtype *fnormp, sunrealtype *f1normp, - booleantype *maxStepTaken) + sunbooleantype *maxStepTaken) { sunrealtype pnorm, ratio, slpi, rlmin, rlength, rl, rlmax, rldiff; sunrealtype rltmp, rlprev, pt1trl, f1nprv, rllo, rlinc, alpha, beta; sunrealtype alpha_cond, beta_cond, rl_a, tmp1, rl_b, tmp2, disc; int ircvr, nbktrk_l, retval; - booleantype firstBacktrack, fOK; + sunbooleantype firstBacktrack, fOK; /* Initializations */ @@ -2040,7 +2040,7 @@ static int KINConstraint(KINMem kin_mem) * sflag is one of KIN_SUCCESS, STEP_TOO_SMALL */ -static int KINStop(KINMem kin_mem, booleantype maxStepTaken, int sflag) +static int KINStop(KINMem kin_mem, sunbooleantype maxStepTaken, int sflag) { sunrealtype fmax, rlength, omexp; N_Vector delta; @@ -2837,7 +2837,7 @@ static int AndersonAcc(KINMem kin_mem, N_Vector gval, N_Vector fv, sunrealtype alfa; sunrealtype onembeta; sunrealtype a, b, temp, c, s; - booleantype dotprodSB = SUNFALSE; + sunbooleantype dotprodSB = SUNFALSE; /* local shortcuts for fused vector operation */ int nvec=0; diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index 885965876c..64e58bb849 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -99,21 +99,21 @@ typedef struct KINMemRec { long int kin_mxnbcf; /* maximum number of beta condition failures */ int kin_etaflag; /* choices are KIN_ETACONSTANT, KIN_ETACHOICE1 and KIN_ETACHOICE2 */ - booleantype kin_noMinEps; /* flag controlling whether or not the value + sunbooleantype kin_noMinEps; /* flag controlling whether or not the value of eps is bounded below */ - booleantype kin_constraintsSet; /* flag indicating if constraints are being + sunbooleantype kin_constraintsSet; /* flag indicating if constraints are being used */ - booleantype kin_jacCurrent; /* flag indicating if the Jacobian info. + sunbooleantype kin_jacCurrent; /* flag indicating if the Jacobian info. used by the linear solver is current */ - booleantype kin_callForcingTerm; /* flag set if using either KIN_ETACHOICE1 + sunbooleantype kin_callForcingTerm; /* flag set if using either KIN_ETACHOICE1 or KIN_ETACHOICE2 */ - booleantype kin_noResMon; /* flag indicating if the nonlinear + sunbooleantype kin_noResMon; /* flag indicating if the nonlinear residual monitoring scheme should be used */ - booleantype kin_retry_nni; /* flag indicating if nonlinear iteration + sunbooleantype kin_retry_nni; /* flag indicating if nonlinear iteration should be retried (set by residual monitoring algorithm) */ - booleantype kin_update_fnorm_sub; /* flag indicating if the fnorm associated + sunbooleantype kin_update_fnorm_sub; /* flag indicating if the fnorm associated with the subinterval needs to be updated (set by residual monitoring algorithm) */ @@ -129,7 +129,7 @@ typedef struct KINMemRec { (choice #2) */ sunrealtype kin_eta_alpha; /* alpha value used in eta calculation (choice #2) */ - booleantype kin_noInitSetup; /* flag controlling whether or not the KINSol + sunbooleantype kin_noInitSetup; /* flag controlling whether or not the KINSol routine makes an initial call to the linear solver setup routine (lsetup) */ sunrealtype kin_sthrsh; /* threshold value for calling the linear @@ -172,8 +172,8 @@ typedef struct KINMemRec { N_Vector kin_vtemp3; /* scratch vector #3 */ /* fixed point and Picard options */ - booleantype kin_ret_newest; /* return the newest FP iteration */ - booleantype kin_damping; /* flag to apply damping in FP/Picard */ + sunbooleantype kin_ret_newest; /* return the newest FP iteration */ + sunbooleantype kin_damping; /* flag to apply damping in FP/Picard */ sunrealtype kin_beta; /* damping parameter for FP/Picard */ /* space requirements for AA, Broyden and NLEN */ @@ -198,7 +198,7 @@ typedef struct KINMemRec { SUNQRAddFn kin_qr_func; /* QRAdd function for AA orthogonalization */ SUNQRData kin_qr_data; /* Additional parameters required for QRAdd routine set for AA */ - booleantype kin_damping_aa; /* flag to apply damping in AA */ + sunbooleantype kin_damping_aa; /* flag to apply damping in AA */ sunrealtype *kin_cv; /* scalar array for fused vector operations */ N_Vector *kin_Xv; /* vector array for fused vector operations */ @@ -226,7 +226,7 @@ typedef struct KINMemRec { int (*kin_lfree)(struct KINMemRec *kin_mem); - booleantype kin_inexact_ls; /* flag set by the linear solver module + sunbooleantype kin_inexact_ls; /* flag set by the linear solver module (in linit) indicating whether this is an iterative linear solver (SUNTRUE), or a direct linear solver (SUNFALSE) */ @@ -241,7 +241,7 @@ typedef struct KINMemRec { (set by lsolve) */ sunrealtype kin_fnorm_sub; /* value of L2-norm of fscale*fval (subinterval) */ - booleantype kin_eval_omega; /* flag indicating that omega must be evaluated. */ + sunbooleantype kin_eval_omega; /* flag indicating that omega must be evaluated. */ sunrealtype kin_omega; /* constant value for real scalar used in test to determine if reduction of norm of nonlinear residual is sufficient. Unless a valid constant @@ -267,7 +267,7 @@ typedef struct KINMemRec { * ----------------------------------------------------------------- */ - booleantype kin_MallocDone; /* flag indicating if KINMalloc has been + sunbooleantype kin_MallocDone; /* flag indicating if KINMalloc has been called yet */ /* message files */ @@ -306,7 +306,7 @@ typedef struct KINMemRec { * but system memory allocation should be done by the subroutine * that actually initializes the environment for liner solver * package. If the linear system is to be preconditioned, then the - * variable setupNonNull (type booleantype) should be set to SUNTRUE + * variable setupNonNull (type sunbooleantype) should be set to SUNTRUE * (predefined constant) and the kin_lsetup routine should be * appropriately defined. * diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index bec14904c4..fc1867757c 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -324,7 +324,7 @@ int KINSetDampingAA(void *kinmem, sunrealtype beta) * ----------------------------------------------------------------- */ -int KINSetReturnNewest(void *kinmem, booleantype ret_newest) +int KINSetReturnNewest(void *kinmem, sunbooleantype ret_newest) { KINMem kin_mem; @@ -376,7 +376,7 @@ int KINSetNumMaxIters(void *kinmem, long int mxiter) * ----------------------------------------------------------------- */ -int KINSetNoInitSetup(void *kinmem, booleantype noInitSetup) +int KINSetNoInitSetup(void *kinmem, sunbooleantype noInitSetup) { KINMem kin_mem; @@ -397,7 +397,7 @@ int KINSetNoInitSetup(void *kinmem, booleantype noInitSetup) * ----------------------------------------------------------------- */ -int KINSetNoResMon(void *kinmem, booleantype noResMon) +int KINSetNoResMon(void *kinmem, sunbooleantype noResMon) { KINMem kin_mem; @@ -666,7 +666,7 @@ int KINSetResMonConstValue(void *kinmem, sunrealtype omegaconst) * ----------------------------------------------------------------- */ -int KINSetNoMinEps(void *kinmem, booleantype noMinEps) +int KINSetNoMinEps(void *kinmem, sunbooleantype noMinEps) { KINMem kin_mem; diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index b7ee56d89a..ee988d0307 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -47,8 +47,8 @@ int KINSetLinearSolver(void *kinmem, SUNLinearSolver LS, SUNMatrix A) KINMem kin_mem; KINLsMem kinls_mem; int retval, LSType; - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Return immediately if either kinmem or LS inputs are NULL */ if (kinmem == NULL) { @@ -951,7 +951,7 @@ int kinLsBandDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, fails (recoverably). ------------------------------------------------------------------*/ int kinLsDQJtimes(N_Vector v, N_Vector Jv, N_Vector u, - booleantype *new_u, void *kinmem) + sunbooleantype *new_u, void *kinmem) { sunrealtype sigma, sigma_inv, sutsv, sq1norm, sign, vtv; KINMem kin_mem; diff --git a/src/kinsol/kinsol_ls_impl.h b/src/kinsol/kinsol_ls_impl.h index 773540cbab..78d9fcc1eb 100644 --- a/src/kinsol/kinsol_ls_impl.h +++ b/src/kinsol/kinsol_ls_impl.h @@ -43,11 +43,11 @@ extern "C" { typedef struct KINLsMemRec { /* Linear solver type information */ - booleantype iterative; /* is the solver iterative? */ - booleantype matrixbased; /* is a matrix structure used? */ + sunbooleantype iterative; /* is the solver iterative? */ + sunbooleantype matrixbased; /* is a matrix structure used? */ /* Jacobian construction & storage */ - booleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ + sunbooleantype jacDQ; /* SUNTRUE if using internal DQ Jacobian approx. */ KINLsJacFn jac; /* Jacobian routine to be called */ void *J_data; /* J_data is passed to jac */ @@ -68,7 +68,7 @@ typedef struct KINLsMemRec { long int ncfl; /* ncfl = total number of convergence failures */ long int njtimes; /* njtimes = total number of calls to jtimes */ - booleantype new_uu; /* flag indicating if the iterate has been + sunbooleantype new_uu; /* flag indicating if the iterate has been updated - the Jacobian must be updated or reevaluated (meant to be used by a user-supplied jtimes function */ @@ -94,7 +94,7 @@ typedef struct KINLsMemRec { (b) internal jtimes - jt_data == kin_mem - jtimesDQ == SUNTRUE */ - booleantype jtimesDQ; + sunbooleantype jtimesDQ; KINLsJacTimesVecFn jtimes; KINSysFn jt_func; void *jt_data; @@ -114,7 +114,7 @@ int kinLsPSolve(void *kinmem, N_Vector r, N_Vector z, /* Difference quotient approximation for Jacobian times vector */ int kinLsDQJtimes(N_Vector v, N_Vector Jv, N_Vector u, - booleantype *new_u, void *data); + sunbooleantype *new_u, void *data); /* Difference-quotient Jacobian approximation routines */ int kinLsDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index 5859c2365c..2ea12cc836 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -61,9 +61,9 @@ static int FusedBuffer_CopyToDevice(N_Vector v); static int FusedBuffer_Free(N_Vector v); // Kernel launch parameters -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, size_t& block, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, cudaStream_t& stream, size_t n = 0); -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, size_t& block, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, cudaStream_t& stream, bool& atomic, size_t n = 0); static void PostKernelLaunch(); @@ -91,7 +91,7 @@ static void PostKernelLaunch(); struct _N_PrivateVectorContent_Cuda { - booleantype use_managed_mem; /* do data pointers use managed memory */ + sunbooleantype use_managed_mem; /* do data pointers use managed memory */ // reduction workspace SUNMemory device_counter; // device memory for a counter (used in LDS reductions) @@ -253,7 +253,7 @@ N_Vector N_VNew_Cuda(sunindextype length, SUNContext sunctx) return(v); } -N_Vector N_VNewWithMemHelp_Cuda(sunindextype length, booleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) +N_Vector N_VNewWithMemHelp_Cuda(sunindextype length, sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) { N_Vector v; @@ -464,7 +464,7 @@ void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) * Return a flag indicating if the memory for the vector data is managed */ -booleantype N_VIsManagedMemory_Cuda(N_Vector x) +sunbooleantype N_VIsManagedMemory_Cuda(N_Vector x) { return NVEC_CUDA_PRIVATE(x)->use_managed_mem; } @@ -1201,7 +1201,7 @@ void N_VCompare_Cuda(sunrealtype c, N_Vector X, N_Vector Z) PostKernelLaunch(); } -booleantype N_VInvTest_Cuda(N_Vector X, N_Vector Z) +sunbooleantype N_VInvTest_Cuda(N_Vector X, N_Vector Z) { bool atomic; size_t grid, block, shMemSize; @@ -1252,7 +1252,7 @@ booleantype N_VInvTest_Cuda(N_Vector X, N_Vector Z) return (gpu_result < HALF); } -booleantype N_VConstrMask_Cuda(N_Vector C, N_Vector X, N_Vector M) +sunbooleantype N_VConstrMask_Cuda(N_Vector C, N_Vector X, N_Vector M) { bool atomic; size_t grid, block, shMemSize; @@ -2079,7 +2079,7 @@ int N_VBufUnpack_Cuda(N_Vector x, void *buf) */ -int N_VEnableFusedOps_Cuda(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Cuda(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2126,7 +2126,7 @@ int N_VEnableFusedOps_Cuda(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombination_Cuda(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2135,7 +2135,7 @@ int N_VEnableLinearCombination_Cuda(N_Vector v, booleantype tf) } -int N_VEnableScaleAddMulti_Cuda(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2144,7 +2144,7 @@ int N_VEnableScaleAddMulti_Cuda(N_Vector v, booleantype tf) } -int N_VEnableDotProdMulti_Cuda(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2154,7 +2154,7 @@ int N_VEnableDotProdMulti_Cuda(N_Vector v, booleantype tf) } -int N_VEnableLinearSumVectorArray_Cuda(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2163,7 +2163,7 @@ int N_VEnableLinearSumVectorArray_Cuda(N_Vector v, booleantype tf) } -int N_VEnableScaleVectorArray_Cuda(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2172,7 +2172,7 @@ int N_VEnableScaleVectorArray_Cuda(N_Vector v, booleantype tf) } -int N_VEnableConstVectorArray_Cuda(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2181,7 +2181,7 @@ int N_VEnableConstVectorArray_Cuda(N_Vector v, booleantype tf) } -int N_VEnableWrmsNormVectorArray_Cuda(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2190,7 +2190,7 @@ int N_VEnableWrmsNormVectorArray_Cuda(N_Vector v, booleantype tf) } -int N_VEnableWrmsNormMaskVectorArray_Cuda(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2200,7 +2200,7 @@ int N_VEnableWrmsNormMaskVectorArray_Cuda(N_Vector v, booleantype tf) } -int N_VEnableScaleAddMultiVectorArray_Cuda(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2210,7 +2210,7 @@ int N_VEnableScaleAddMultiVectorArray_Cuda(N_Vector v, booleantype tf) } -int N_VEnableLinearCombinationVectorArray_Cuda(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Cuda(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2279,7 +2279,7 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) { int alloc_fail = 0; int copy_fail = 0; - booleantype alloc_mem = SUNFALSE; + sunbooleantype alloc_mem = SUNFALSE; size_t bytes = n * sizeof(sunrealtype); // Get the vector private memory structure @@ -2396,7 +2396,7 @@ static int CopyReductionBufferFromDevice(N_Vector v, size_t n) static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) { int alloc_fail = 0; - booleantype alloc_mem = SUNFALSE; + sunbooleantype alloc_mem = SUNFALSE; // pad buffer with single precision data #if defined(SUNDIALS_SINGLE_PRECISION) @@ -2638,7 +2638,7 @@ static int FreeDeviceCounter(N_Vector v) /* Get the kernel launch parameters based on the kernel type (reduction or not), * using the appropriate kernel execution policy. */ -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, cudaStream_t& stream, bool& atomic, size_t n) { @@ -2699,7 +2699,7 @@ static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, return(0); } -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, cudaStream_t& stream, size_t n) { diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index 3ac5587de9..2121a38cb3 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -50,9 +50,9 @@ static void FreeReductionBuffer(N_Vector v); static int CopyReductionBufferFromDevice(N_Vector v, size_t n = 1); // Kernel launch parameters -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, size_t& block, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, hipStream_t& stream, size_t n = 0); -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, size_t& block, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, hipStream_t& stream, bool& atomic, size_t n = 0); static void PostKernelLaunch(); @@ -80,7 +80,7 @@ static void PostKernelLaunch(); struct _N_PrivateVectorContent_Hip { - booleantype use_managed_mem; /* indicates if the data pointers and buffer pointers are managed memory */ + sunbooleantype use_managed_mem; /* indicates if the data pointers and buffer pointers are managed memory */ size_t reduce_buffer_allocated_bytes; /* current size of the reduction buffer */ SUNMemory reduce_buffer_dev; /* device buffer used for reductions */ SUNMemory reduce_buffer_host; /* host buffer used for reductions */ @@ -230,7 +230,7 @@ N_Vector N_VNew_Hip(sunindextype length, SUNContext sunctx) return(v); } -N_Vector N_VNewWithMemHelp_Hip(sunindextype length, booleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) +N_Vector N_VNewWithMemHelp_Hip(sunindextype length, sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) { N_Vector v; @@ -441,7 +441,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) * Return a flag indicating if the memory for the vector data is managed */ -booleantype N_VIsManagedMemory_Hip(N_Vector x) +sunbooleantype N_VIsManagedMemory_Hip(N_Vector x) { return NVEC_HIP_PRIVATE(x)->use_managed_mem; } @@ -1177,7 +1177,7 @@ void N_VCompare_Hip(sunrealtype c, N_Vector X, N_Vector Z) PostKernelLaunch(); } -booleantype N_VInvTest_Hip(N_Vector X, N_Vector Z) +sunbooleantype N_VInvTest_Hip(N_Vector X, N_Vector Z) { bool atomic; size_t grid, block, shMemSize; @@ -1228,7 +1228,7 @@ booleantype N_VInvTest_Hip(N_Vector X, N_Vector Z) return (gpu_result < HALF); } -booleantype N_VConstrMask_Hip(N_Vector C, N_Vector X, N_Vector M) +sunbooleantype N_VConstrMask_Hip(N_Vector C, N_Vector X, N_Vector M) { bool atomic; size_t grid, block, shMemSize; @@ -2050,7 +2050,7 @@ int N_VBufUnpack_Hip(N_Vector x, void *buf) */ -int N_VEnableFusedOps_Hip(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2097,7 +2097,7 @@ int N_VEnableFusedOps_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombination_Hip(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2115,7 +2115,7 @@ int N_VEnableLinearCombination_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_Hip(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2133,7 +2133,7 @@ int N_VEnableScaleAddMulti_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_Hip(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2154,7 +2154,7 @@ int N_VEnableDotProdMulti_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_Hip(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2172,7 +2172,7 @@ int N_VEnableLinearSumVectorArray_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_Hip(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2190,7 +2190,7 @@ int N_VEnableScaleVectorArray_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_Hip(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2208,7 +2208,7 @@ int N_VEnableConstVectorArray_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_Hip(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2226,7 +2226,7 @@ int N_VEnableWrmsNormVectorArray_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_Hip(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2244,7 +2244,7 @@ int N_VEnableWrmsNormMaskVectorArray_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_Hip(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2262,7 +2262,7 @@ int N_VEnableScaleAddMultiVectorArray_Hip(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_Hip(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Hip(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2338,7 +2338,7 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) { int alloc_fail = 0; int copy_fail = 0; - booleantype alloc_mem = SUNFALSE; + sunbooleantype alloc_mem = SUNFALSE; size_t bytes = n * sizeof(sunrealtype); // Get the vector private memory structure @@ -2477,7 +2477,7 @@ static int FreeDeviceCounter(N_Vector v) /* Get the kernel launch parameters based on the kernel type (reduction or not), * using the appropriate kernel execution policy. */ -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, hipStream_t& stream, bool& atomic, size_t n) { @@ -2538,7 +2538,7 @@ static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, return(0); } -static int GetKernelParameters(N_Vector v, booleantype reduction, size_t& grid, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& grid, size_t& block, size_t& shMemSize, hipStream_t& stream, size_t n) { diff --git a/src/nvector/manyvector/nvector_manyvector.c b/src/nvector/manyvector/nvector_manyvector.c index 3b0c46bbdb..baa4e0921f 100644 --- a/src/nvector/manyvector/nvector_manyvector.c +++ b/src/nvector/manyvector/nvector_manyvector.c @@ -53,7 +53,7 @@ /* ----------------------------------------------------------------- Prototypes of utility routines -----------------------------------------------------------------*/ -static N_Vector ManyVectorClone(N_Vector w, booleantype cloneempty); +static N_Vector ManyVectorClone(N_Vector w, sunbooleantype cloneempty); #ifdef MANYVECTOR_BUILD_WITH_MPI static int SubvectorMPIRank(N_Vector w); #endif @@ -219,7 +219,7 @@ N_Vector N_VNew_MPIManyVector(sunindextype num_subvectors, SUNContext sunctx) { sunindextype i; - booleantype nocommfound; + sunbooleantype nocommfound; void* tmpcomm; MPI_Comm comm, *vcomm; int retval, comparison; @@ -1098,10 +1098,10 @@ void MVAPPEND(N_VCompare)(sunrealtype c, N_Vector x, N_Vector z) If any subvector does not implement the N_VInvTestLocal routine (NULL function pointer), then this routine will call N_VInvTest instead. */ -booleantype MVAPPEND(N_VInvTestLocal)(N_Vector x, N_Vector z) +sunbooleantype MVAPPEND(N_VInvTestLocal)(N_Vector x, N_Vector z) { sunindextype i; - booleantype val, subval; + sunbooleantype val, subval; /* initialize output*/ val = SUNTRUE; @@ -1132,7 +1132,7 @@ booleantype MVAPPEND(N_VInvTestLocal)(N_Vector x, N_Vector z) combining the results. This routine does not check that x and z are ManyVectors, if they have the same number of subvectors, or if these subvectors are compatible. */ -booleantype N_VInvTest_MPIManyVector(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_MPIManyVector(N_Vector x, N_Vector z) { sunrealtype val, gval; val = gval = (N_VInvTestLocal_MPIManyVector(x, z)) ? ONE : ZERO; @@ -1150,10 +1150,10 @@ booleantype N_VInvTest_MPIManyVector(N_Vector x, N_Vector z) If any subvector does not implement the N_VConstrMaskLocal routine (NULL function pointer), then this routine will call N_VConstrMask instead. */ -booleantype MVAPPEND(N_VConstrMaskLocal)(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype MVAPPEND(N_VConstrMaskLocal)(N_Vector c, N_Vector x, N_Vector m) { sunindextype i; - booleantype val, subval; + sunbooleantype val, subval; /* initialize output*/ val = SUNTRUE; @@ -1186,7 +1186,7 @@ booleantype MVAPPEND(N_VConstrMaskLocal)(N_Vector c, N_Vector x, N_Vector m) combining the results. This routine does not check that c, x and m are ManyVectors, if they have the same number of subvectors, or if these subvectors are compatible. */ -booleantype N_VConstrMask_MPIManyVector(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_MPIManyVector(N_Vector c, N_Vector x, N_Vector m) { sunrealtype val, gval; val = gval = (N_VConstrMaskLocal_MPIManyVector(c, x, m)) ? ONE : ZERO; @@ -1766,7 +1766,7 @@ int MVAPPEND(N_VBufUnpack)(N_Vector x, void *buf) Enable / Disable fused and vector array operations ----------------------------------------------------------------- */ -int MVAPPEND(N_VEnableFusedOps)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableFusedOps)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1811,7 +1811,7 @@ int MVAPPEND(N_VEnableFusedOps)(N_Vector v, booleantype tf) } -int MVAPPEND(N_VEnableLinearCombination)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableLinearCombination)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1829,7 +1829,7 @@ int MVAPPEND(N_VEnableLinearCombination)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableScaleAddMulti)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableScaleAddMulti)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1847,7 +1847,7 @@ int MVAPPEND(N_VEnableScaleAddMulti)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableDotProdMulti)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableDotProdMulti)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1865,7 +1865,7 @@ int MVAPPEND(N_VEnableDotProdMulti)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableLinearSumVectorArray)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableLinearSumVectorArray)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1883,7 +1883,7 @@ int MVAPPEND(N_VEnableLinearSumVectorArray)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableScaleVectorArray)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableScaleVectorArray)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1901,7 +1901,7 @@ int MVAPPEND(N_VEnableScaleVectorArray)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableConstVectorArray)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableConstVectorArray)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1919,7 +1919,7 @@ int MVAPPEND(N_VEnableConstVectorArray)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableWrmsNormVectorArray)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableWrmsNormVectorArray)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1937,7 +1937,7 @@ int MVAPPEND(N_VEnableWrmsNormVectorArray)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableWrmsNormMaskVectorArray)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableWrmsNormMaskVectorArray)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1955,7 +1955,7 @@ int MVAPPEND(N_VEnableWrmsNormMaskVectorArray)(N_Vector v, booleantype tf) return(0); } -int MVAPPEND(N_VEnableDotProdMultiLocal)(N_Vector v, booleantype tf) +int MVAPPEND(N_VEnableDotProdMultiLocal)(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1980,7 +1980,7 @@ int MVAPPEND(N_VEnableDotProdMultiLocal)(N_Vector v, booleantype tf) /* This function performs a generic clone operation on an input N_Vector. Based on the 'cloneempty' flag it will either call "nvclone" or "nvcloneempty" when creating subvectors in the cloned vector. */ -static N_Vector ManyVectorClone(N_Vector w, booleantype cloneempty) +static N_Vector ManyVectorClone(N_Vector w, sunbooleantype cloneempty) { N_Vector v; MVAPPEND(N_VectorContent) content; diff --git a/src/nvector/openmp/nvector_openmp.c b/src/nvector/openmp/nvector_openmp.c index 545fbb7f64..82385f2fcc 100644 --- a/src/nvector/openmp/nvector_openmp.c +++ b/src/nvector/openmp/nvector_openmp.c @@ -431,7 +431,7 @@ void N_VLinearSum_OpenMP(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N sunindextype i, N; sunrealtype c, *xd, *yd, *zd; N_Vector v1, v2; - booleantype test; + sunbooleantype test; i = 0; /* initialize to suppress clang warning */ xd = yd = zd = NULL; @@ -903,7 +903,7 @@ void N_VCompare_OpenMP(sunrealtype c, N_Vector x, N_Vector z) * Compute componentwise inverse z[i] = ONE/x[i] and checks if x[i] == ZERO */ -booleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z) { sunindextype i, N; sunrealtype *xd, *zd, val; @@ -937,12 +937,12 @@ booleantype N_VInvTest_OpenMP(N_Vector x, N_Vector z) * Compute constraint mask of a vector */ -booleantype N_VConstrMask_OpenMP(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_OpenMP(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; sunrealtype temp; sunrealtype *cd, *xd, *md; - booleantype test; + sunbooleantype test; i = 0; /* initialize to suppress clang warning */ cd = xd = md = NULL; @@ -1305,7 +1305,7 @@ int N_VLinearSumVectorArray_OpenMP(int nvec, sunrealtype c; N_Vector* V1; N_Vector* V2; - booleantype test; + sunbooleantype test; i = 0; /* initialize to suppress clang warning */ j = 0; @@ -2451,7 +2451,7 @@ static int VaxpyVectorArray_OpenMP(int nvec, sunrealtype a, N_Vector* X, N_Vecto * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_OpenMP(N_Vector v, booleantype tf) +int N_VEnableFusedOps_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2496,7 +2496,7 @@ int N_VEnableFusedOps_OpenMP(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_OpenMP(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2514,7 +2514,7 @@ int N_VEnableLinearCombination_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_OpenMP(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2532,7 +2532,7 @@ int N_VEnableScaleAddMulti_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_OpenMP(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2553,7 +2553,7 @@ int N_VEnableDotProdMulti_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_OpenMP(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2571,7 +2571,7 @@ int N_VEnableLinearSumVectorArray_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_OpenMP(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2589,7 +2589,7 @@ int N_VEnableScaleVectorArray_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_OpenMP(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2607,7 +2607,7 @@ int N_VEnableConstVectorArray_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_OpenMP(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2625,7 +2625,7 @@ int N_VEnableWrmsNormVectorArray_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2643,7 +2643,7 @@ int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2661,7 +2661,7 @@ int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); diff --git a/src/nvector/openmpdev/nvector_openmpdev.c b/src/nvector/openmpdev/nvector_openmpdev.c index 028405b71a..a901c1c219 100644 --- a/src/nvector/openmpdev/nvector_openmpdev.c +++ b/src/nvector/openmpdev/nvector_openmpdev.c @@ -510,7 +510,7 @@ void N_VLinearSum_OpenMPDEV(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y sunindextype i, N; sunrealtype c, *xd_dev, *yd_dev, *zd_dev; N_Vector v1, v2; - booleantype test; + sunbooleantype test; int dev; xd_dev = yd_dev = zd_dev = NULL; @@ -1070,7 +1070,7 @@ void N_VCompare_OpenMPDEV(sunrealtype c, N_Vector x, N_Vector z) * Compute componentwise inverse z[i] = ONE/x[i] and checks if x[i] == ZERO */ -booleantype N_VInvTest_OpenMPDEV(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_OpenMPDEV(N_Vector x, N_Vector z) { sunindextype i, N; sunrealtype *xd_dev, *zd_dev, val; @@ -1107,7 +1107,7 @@ booleantype N_VInvTest_OpenMPDEV(N_Vector x, N_Vector z) * Compute constraint mask of a vector */ -booleantype N_VConstrMask_OpenMPDEV(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_OpenMPDEV(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; sunrealtype temp; @@ -1443,7 +1443,7 @@ int N_VLinearSumVectorArray_OpenMPDEV(int nvec, sunindextype j, N; N_Vector* V1; N_Vector* V2; - booleantype test; + sunbooleantype test; sunrealtype c; sunrealtype* xd_dev=NULL; sunrealtype* yd_dev=NULL; @@ -2788,7 +2788,7 @@ static int VaxpyVectorArray_OpenMPDEV(int nvec, sunrealtype a, N_Vector* X, N_Ve * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableFusedOps_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2833,7 +2833,7 @@ int N_VEnableFusedOps_OpenMPDEV(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2851,7 +2851,7 @@ int N_VEnableLinearCombination_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2869,7 +2869,7 @@ int N_VEnableScaleAddMulti_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2890,7 +2890,7 @@ int N_VEnableDotProdMulti_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2908,7 +2908,7 @@ int N_VEnableLinearSumVectorArray_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2926,7 +2926,7 @@ int N_VEnableScaleVectorArray_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2944,7 +2944,7 @@ int N_VEnableConstVectorArray_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2962,7 +2962,7 @@ int N_VEnableWrmsNormVectorArray_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2980,7 +2980,7 @@ int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2998,7 +2998,7 @@ int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); diff --git a/src/nvector/parallel/nvector_parallel.c b/src/nvector/parallel/nvector_parallel.c index a0a09c734d..b4ad097c92 100644 --- a/src/nvector/parallel/nvector_parallel.c +++ b/src/nvector/parallel/nvector_parallel.c @@ -440,7 +440,7 @@ void N_VLinearSum_Parallel(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, sunindextype i, N; sunrealtype c, *xd, *yd, *zd; N_Vector v1, v2; - booleantype test; + sunbooleantype test; xd = yd = zd = NULL; @@ -834,7 +834,7 @@ void N_VCompare_Parallel(sunrealtype c, N_Vector x, N_Vector z) return; } -booleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z) +sunbooleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z) { sunindextype i, N; sunrealtype *xd, *zd, val; @@ -859,7 +859,7 @@ booleantype N_VInvTestLocal_Parallel(N_Vector x, N_Vector z) return(SUNTRUE); } -booleantype N_VInvTest_Parallel(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Parallel(N_Vector x, N_Vector z) { sunrealtype val, gval; val = (N_VInvTestLocal_Parallel(x, z)) ? ONE : ZERO; @@ -870,12 +870,12 @@ booleantype N_VInvTest_Parallel(N_Vector x, N_Vector z) return(SUNTRUE); } -booleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; sunrealtype temp; sunrealtype *cd, *xd, *md; - booleantype test; + sunbooleantype test; cd = xd = md = NULL; @@ -905,7 +905,7 @@ booleantype N_VConstrMaskLocal_Parallel(N_Vector c, N_Vector x, N_Vector m) return (temp == ONE) ? SUNFALSE : SUNTRUE; } -booleantype N_VConstrMask_Parallel(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Parallel(N_Vector c, N_Vector x, N_Vector m) { sunrealtype temp, temp2; temp = (N_VConstrMaskLocal_Parallel(c, x, m)) ? ZERO : ONE; @@ -915,7 +915,7 @@ booleantype N_VConstrMask_Parallel(N_Vector c, N_Vector x, N_Vector m) sunrealtype N_VMinQuotientLocal_Parallel(N_Vector num, N_Vector denom) { - booleantype notEvenOnce; + sunbooleantype notEvenOnce; sunindextype i, N; sunrealtype *nd, *dd, min; @@ -1185,7 +1185,7 @@ int N_VLinearSumVectorArray_Parallel(int nvec, sunrealtype c; N_Vector* V1; N_Vector* V2; - booleantype test; + sunbooleantype test; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -2088,7 +2088,7 @@ static int VaxpyVectorArray_Parallel(int nvec, sunrealtype a, N_Vector* X, N_Vec * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_Parallel(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2133,7 +2133,7 @@ int N_VEnableFusedOps_Parallel(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_Parallel(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2151,7 +2151,7 @@ int N_VEnableLinearCombination_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_Parallel(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2169,7 +2169,7 @@ int N_VEnableScaleAddMulti_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_Parallel(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2187,7 +2187,7 @@ int N_VEnableDotProdMulti_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_Parallel(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2205,7 +2205,7 @@ int N_VEnableLinearSumVectorArray_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_Parallel(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2223,7 +2223,7 @@ int N_VEnableScaleVectorArray_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_Parallel(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2241,7 +2241,7 @@ int N_VEnableConstVectorArray_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_Parallel(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2259,7 +2259,7 @@ int N_VEnableWrmsNormVectorArray_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2277,7 +2277,7 @@ int N_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_Parallel(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2295,7 +2295,7 @@ int N_VEnableScaleAddMultiVectorArray_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2313,7 +2313,7 @@ int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMultiLocal_Parallel(N_Vector v, booleantype tf) +int N_VEnableDotProdMultiLocal_Parallel(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); diff --git a/src/nvector/parhyp/nvector_parhyp.c b/src/nvector/parhyp/nvector_parhyp.c index bfb542979e..000a8ba34d 100644 --- a/src/nvector/parhyp/nvector_parhyp.c +++ b/src/nvector/parhyp/nvector_parhyp.c @@ -482,7 +482,7 @@ void N_VLinearSum_ParHyp(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N sunindextype i, N; sunrealtype c, *xd, *yd, *zd; N_Vector v1, v2; - booleantype test; + sunbooleantype test; xd = yd = zd = NULL; @@ -856,7 +856,7 @@ void N_VCompare_ParHyp(sunrealtype c, N_Vector x, N_Vector z) return; } -booleantype N_VInvTestLocal_ParHyp(N_Vector x, N_Vector z) +sunbooleantype N_VInvTestLocal_ParHyp(N_Vector x, N_Vector z) { sunindextype i, N; sunrealtype *xd, *zd, val; @@ -878,7 +878,7 @@ booleantype N_VInvTestLocal_ParHyp(N_Vector x, N_Vector z) return(SUNTRUE); } -booleantype N_VInvTest_ParHyp(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_ParHyp(N_Vector x, N_Vector z) { sunrealtype val, gval; val = (N_VInvTestLocal_ParHyp(x, z)) ? ONE : ZERO; @@ -889,12 +889,12 @@ booleantype N_VInvTest_ParHyp(N_Vector x, N_Vector z) return(SUNTRUE); } -booleantype N_VConstrMaskLocal_ParHyp(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMaskLocal_ParHyp(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; sunrealtype temp; sunrealtype *cd, *xd, *md; - booleantype test; + sunbooleantype test; N = NV_LOCLENGTH_PH(x); xd = NV_DATA_PH(x); @@ -922,7 +922,7 @@ booleantype N_VConstrMaskLocal_ParHyp(N_Vector c, N_Vector x, N_Vector m) return (temp == ONE) ? SUNFALSE : SUNTRUE; } -booleantype N_VConstrMask_ParHyp(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_ParHyp(N_Vector c, N_Vector x, N_Vector m) { sunrealtype temp, temp2; temp = (N_VConstrMaskLocal_ParHyp(c, x, m)) ? ZERO : ONE; @@ -932,7 +932,7 @@ booleantype N_VConstrMask_ParHyp(N_Vector c, N_Vector x, N_Vector m) sunrealtype N_VMinQuotientLocal_ParHyp(N_Vector num, N_Vector denom) { - booleantype notEvenOnce; + sunbooleantype notEvenOnce; sunindextype i, N; sunrealtype *nd, *dd, min; @@ -1788,7 +1788,7 @@ static void VLin2_ParHyp(sunrealtype a, N_Vector x, N_Vector y, N_Vector z) * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_ParHyp(N_Vector v, booleantype tf) +int N_VEnableFusedOps_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1833,7 +1833,7 @@ int N_VEnableFusedOps_ParHyp(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_ParHyp(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1851,7 +1851,7 @@ int N_VEnableLinearCombination_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_ParHyp(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1869,7 +1869,7 @@ int N_VEnableScaleAddMulti_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_ParHyp(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1887,7 +1887,7 @@ int N_VEnableDotProdMulti_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_ParHyp(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1905,7 +1905,7 @@ int N_VEnableLinearSumVectorArray_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_ParHyp(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1923,7 +1923,7 @@ int N_VEnableScaleVectorArray_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_ParHyp(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1941,7 +1941,7 @@ int N_VEnableConstVectorArray_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_ParHyp(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1959,7 +1959,7 @@ int N_VEnableWrmsNormVectorArray_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_ParHyp(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1977,7 +1977,7 @@ int N_VEnableWrmsNormMaskVectorArray_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1995,7 +1995,7 @@ int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2013,7 +2013,7 @@ int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMultiLocal_ParHyp(N_Vector v, booleantype tf) +int N_VEnableDotProdMultiLocal_ParHyp(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); diff --git a/src/nvector/petsc/nvector_petsc.c b/src/nvector/petsc/nvector_petsc.c index 903bf1c7dd..e86bea8472 100644 --- a/src/nvector/petsc/nvector_petsc.c +++ b/src/nvector/petsc/nvector_petsc.c @@ -766,7 +766,7 @@ void N_VCompare_Petsc(sunrealtype c, N_Vector x, N_Vector z) return; } -booleantype N_VInvTestLocal_Petsc(N_Vector x, N_Vector z) +sunbooleantype N_VInvTestLocal_Petsc(N_Vector x, N_Vector z) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); @@ -793,7 +793,7 @@ booleantype N_VInvTestLocal_Petsc(N_Vector x, N_Vector z) return(SUNTRUE); } -booleantype N_VInvTest_Petsc(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Petsc(N_Vector x, N_Vector z) { sunrealtype val2; sunrealtype val = (N_VInvTestLocal_Petsc(x, z)) ? ONE : ZERO; @@ -804,12 +804,12 @@ booleantype N_VInvTest_Petsc(N_Vector x, N_Vector z) return(SUNTRUE); } -booleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, N_Vector m) { sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(x); sunrealtype temp; - booleantype test; + sunbooleantype test; Vec xv = NV_PVEC_PTC(x); Vec cv = NV_PVEC_PTC(c); Vec mv = NV_PVEC_PTC(m); @@ -846,7 +846,7 @@ booleantype N_VConstrMaskLocal_Petsc(N_Vector c, N_Vector x, N_Vector m) return (temp == ONE) ? SUNFALSE : SUNTRUE; } -booleantype N_VConstrMask_Petsc(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Petsc(N_Vector c, N_Vector x, N_Vector m) { sunrealtype temp2; sunrealtype temp = (N_VConstrMaskLocal_Petsc(c, x, m)) ? ZERO : ONE; @@ -856,7 +856,7 @@ booleantype N_VConstrMask_Petsc(N_Vector c, N_Vector x, N_Vector m) sunrealtype N_VMinQuotientLocal_Petsc(N_Vector num, N_Vector denom) { - booleantype notEvenOnce = SUNTRUE; + sunbooleantype notEvenOnce = SUNTRUE; sunindextype i; sunindextype N = NV_LOCLENGTH_PTC(num); @@ -1596,7 +1596,7 @@ int N_VBufUnpack_Petsc(N_Vector x, void *buf) * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_Petsc(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1641,7 +1641,7 @@ int N_VEnableFusedOps_Petsc(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_Petsc(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1659,7 +1659,7 @@ int N_VEnableLinearCombination_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_Petsc(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1677,7 +1677,7 @@ int N_VEnableScaleAddMulti_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_Petsc(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1695,7 +1695,7 @@ int N_VEnableDotProdMulti_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_Petsc(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1713,7 +1713,7 @@ int N_VEnableLinearSumVectorArray_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_Petsc(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1731,7 +1731,7 @@ int N_VEnableScaleVectorArray_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_Petsc(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1749,7 +1749,7 @@ int N_VEnableConstVectorArray_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_Petsc(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1767,7 +1767,7 @@ int N_VEnableWrmsNormVectorArray_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_Petsc(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1785,7 +1785,7 @@ int N_VEnableWrmsNormMaskVectorArray_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_Petsc(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1803,7 +1803,7 @@ int N_VEnableScaleAddMultiVectorArray_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1821,7 +1821,7 @@ int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMultiLocal_Petsc(N_Vector v, booleantype tf) +int N_VEnableDotProdMultiLocal_Petsc(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); diff --git a/src/nvector/pthreads/nvector_pthreads.c b/src/nvector/pthreads/nvector_pthreads.c index 181f22cd6e..c9fa90cf0a 100644 --- a/src/nvector/pthreads/nvector_pthreads.c +++ b/src/nvector/pthreads/nvector_pthreads.c @@ -503,7 +503,7 @@ void N_VLinearSum_Pthreads(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, sunrealtype c; N_Vector v1, v2; - booleantype test; + sunbooleantype test; if ((b == ONE) && (z == y)) { /* BLAS usage: axpy y <- ax+y */ Vaxpy_Pthreads(a,x,y); @@ -2017,7 +2017,7 @@ static void *N_VCompare_PT(void *thread_data) * Compute componentwise inverse z[i] = ONE/x[i] and check if x[i] == ZERO */ -booleantype N_VInvTest_Pthreads(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Pthreads(N_Vector x, N_Vector z) { sunindextype N; int i, nthreads; @@ -2115,7 +2115,7 @@ static void *N_VInvTest_PT(void *thread_data) * Compute constraint mask of a vector */ -booleantype N_VConstrMask_Pthreads(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Pthreads(N_Vector c, N_Vector x, N_Vector m) { sunindextype N; int i, nthreads; @@ -2718,7 +2718,7 @@ int N_VLinearSumVectorArray_Pthreads(int nvec, sunrealtype a, N_Vector* X, sunrealtype c; N_Vector* V1; N_Vector* V2; - booleantype test; + sunbooleantype test; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -5305,7 +5305,7 @@ static void N_VInitThreadData(Pthreads_Data *thread_data) * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_Pthreads(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5350,7 +5350,7 @@ int N_VEnableFusedOps_Pthreads(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_Pthreads(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5368,7 +5368,7 @@ int N_VEnableLinearCombination_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_Pthreads(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5386,7 +5386,7 @@ int N_VEnableScaleAddMulti_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_Pthreads(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5407,7 +5407,7 @@ int N_VEnableDotProdMulti_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_Pthreads(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5425,7 +5425,7 @@ int N_VEnableLinearSumVectorArray_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_Pthreads(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5443,7 +5443,7 @@ int N_VEnableScaleVectorArray_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_Pthreads(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5461,7 +5461,7 @@ int N_VEnableConstVectorArray_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_Pthreads(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5479,7 +5479,7 @@ int N_VEnableWrmsNormVectorArray_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5497,7 +5497,7 @@ int N_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -5515,7 +5515,7 @@ int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_Pthreads(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Pthreads(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index 18a7f4ff0f..a9609c0451 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -83,7 +83,7 @@ static constexpr sunindextype zeroIdx = 0; struct _N_PrivateVectorContent_Raja { - booleantype use_managed_mem; /* do data pointers use managed memory */ + sunbooleantype use_managed_mem; /* do data pointers use managed memory */ /* fused op workspace */ SUNMemory fused_buffer_dev; /* device memory for fused ops */ @@ -249,7 +249,7 @@ N_Vector N_VNew_Raja(sunindextype length, SUNContext sunctx) } N_Vector N_VNewWithMemHelp_Raja(sunindextype length, - booleantype use_managed_mem, + sunbooleantype use_managed_mem, SUNMemoryHelper helper, SUNContext sunctx) { @@ -502,7 +502,7 @@ void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) /* ---------------------------------------------------------------------------- * Return a flag indicating if the memory for the vector data is managed */ -booleantype N_VIsManagedMemory_Raja(N_Vector x) +sunbooleantype N_VIsManagedMemory_Raja(N_Vector x) { return NVEC_RAJA_PRIVATE(x)->use_managed_mem; } @@ -958,7 +958,7 @@ void N_VCompare_Raja(sunrealtype c, N_Vector X, N_Vector Z) ); } -booleantype N_VInvTest_Raja(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Raja(N_Vector x, N_Vector z) { const sunrealtype *xdata = NVEC_RAJA_DDATAp(x); const sunindextype N = NVEC_RAJA_CONTENT(x)->length; @@ -978,7 +978,7 @@ booleantype N_VInvTest_Raja(N_Vector x, N_Vector z) return (minimum < HALF); } -booleantype N_VConstrMask_Raja(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Raja(N_Vector c, N_Vector x, N_Vector m) { const sunrealtype *cdata = NVEC_RAJA_DDATAp(c); const sunrealtype *xdata = NVEC_RAJA_DDATAp(x); @@ -1493,7 +1493,7 @@ int N_VBufUnpack_Raja(N_Vector x, void *buf) * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_Raja(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1533,7 +1533,7 @@ int N_VEnableFusedOps_Raja(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombination_Raja(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1551,7 +1551,7 @@ int N_VEnableLinearCombination_Raja(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_Raja(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1569,7 +1569,7 @@ int N_VEnableScaleAddMulti_Raja(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_Raja(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1587,7 +1587,7 @@ int N_VEnableLinearSumVectorArray_Raja(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_Raja(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1605,7 +1605,7 @@ int N_VEnableScaleVectorArray_Raja(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_Raja(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1623,7 +1623,7 @@ int N_VEnableConstVectorArray_Raja(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_Raja(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1641,7 +1641,7 @@ int N_VEnableScaleAddMultiVectorArray_Raja(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_Raja(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Raja(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1717,7 +1717,7 @@ int AllocateData(N_Vector v) static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) { int alloc_fail = 0; - booleantype alloc_mem = SUNFALSE; + sunbooleantype alloc_mem = SUNFALSE; size_t bytes = nreal * sizeof(sunrealtype) + nptr * sizeof(sunrealtype*); // Get the vector private memory structure diff --git a/src/nvector/serial/nvector_serial.c b/src/nvector/serial/nvector_serial.c index 18a003cd24..57f7f83f26 100644 --- a/src/nvector/serial/nvector_serial.c +++ b/src/nvector/serial/nvector_serial.c @@ -390,7 +390,7 @@ void N_VLinearSum_Serial(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N sunindextype i, N; sunrealtype c, *xd, *yd, *zd; N_Vector v1, v2; - booleantype test; + sunbooleantype test; xd = yd = zd = NULL; @@ -764,11 +764,11 @@ void N_VCompare_Serial(sunrealtype c, N_Vector x, N_Vector z) return; } -booleantype N_VInvTest_Serial(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Serial(N_Vector x, N_Vector z) { sunindextype i, N; sunrealtype *xd, *zd; - booleantype no_zero_found; + sunbooleantype no_zero_found; xd = zd = NULL; @@ -787,12 +787,12 @@ booleantype N_VInvTest_Serial(N_Vector x, N_Vector z) return no_zero_found; } -booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m) { sunindextype i, N; sunrealtype temp; sunrealtype *cd, *xd, *md; - booleantype test; + sunbooleantype test; cd = xd = md = NULL; @@ -824,7 +824,7 @@ booleantype N_VConstrMask_Serial(N_Vector c, N_Vector x, N_Vector m) sunrealtype N_VMinQuotient_Serial(N_Vector num, N_Vector denom) { - booleantype notEvenOnce; + sunbooleantype notEvenOnce; sunindextype i, N; sunrealtype *nd, *dd, min; @@ -1030,7 +1030,7 @@ int N_VLinearSumVectorArray_Serial(int nvec, sunrealtype c; N_Vector* V1; N_Vector* V2; - booleantype test; + sunbooleantype test; /* invalid number of vectors */ if (nvec < 1) return(-1); @@ -1921,7 +1921,7 @@ static int VaxpyVectorArray_Serial(int nvec, sunrealtype a, N_Vector* X, N_Vecto * ----------------------------------------------------------------- */ -int N_VEnableFusedOps_Serial(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1966,7 +1966,7 @@ int N_VEnableFusedOps_Serial(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_Serial(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -1984,7 +1984,7 @@ int N_VEnableLinearCombination_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMulti_Serial(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2002,7 +2002,7 @@ int N_VEnableScaleAddMulti_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableDotProdMulti_Serial(N_Vector v, booleantype tf) +int N_VEnableDotProdMulti_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2023,7 +2023,7 @@ int N_VEnableDotProdMulti_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearSumVectorArray_Serial(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2041,7 +2041,7 @@ int N_VEnableLinearSumVectorArray_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleVectorArray_Serial(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2059,7 +2059,7 @@ int N_VEnableScaleVectorArray_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableConstVectorArray_Serial(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2077,7 +2077,7 @@ int N_VEnableConstVectorArray_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormVectorArray_Serial(N_Vector v, booleantype tf) +int N_VEnableWrmsNormVectorArray_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2095,7 +2095,7 @@ int N_VEnableWrmsNormVectorArray_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, booleantype tf) +int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2113,7 +2113,7 @@ int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); @@ -2131,7 +2131,7 @@ int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, booleantype tf) return(0); } -int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return(-1); diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index 5ae4d8055d..e0013594a9 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -66,7 +66,7 @@ using namespace sundials::sycl; struct _N_PrivateVectorContent_Sycl { - booleantype use_managed_mem; /* do data pointers use managed memory */ + sunbooleantype use_managed_mem; /* do data pointers use managed memory */ /* reduction workspace */ SUNMemory reduce_buffer_dev; /* device memory for reductions */ @@ -109,7 +109,7 @@ static int FusedBuffer_CopyToDevice(N_Vector v); static int FusedBuffer_Free(N_Vector v); /* Kernel launch parameters */ -static int GetKernelParameters(N_Vector v, booleantype reduction, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& nthreads_total, size_t& nthreads_per_block); @@ -279,7 +279,7 @@ N_Vector N_VNew_Sycl(sunindextype length, ::sycl::queue *Q, SUNContext sunctx) N_Vector N_VNewWithMemHelp_Sycl(sunindextype length, - booleantype use_managed_mem, + sunbooleantype use_managed_mem, SUNMemoryHelper helper, ::sycl::queue *Q, SUNContext sunctx) @@ -589,7 +589,7 @@ void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) /* Return a flag indicating if the memory for the vector data is managed */ -booleantype N_VIsManagedMemory_Sycl(N_Vector x) +sunbooleantype N_VIsManagedMemory_Sycl(N_Vector x) { return NVEC_SYCL_PRIVATE(x)->use_managed_mem; } @@ -1279,7 +1279,7 @@ void N_VCompare_Sycl(sunrealtype c, N_Vector x, N_Vector z) } -booleantype N_VInvTest_Sycl(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Sycl(N_Vector x, N_Vector z) { const sunindextype N = NVEC_SYCL_LENGTH(z); const sunrealtype *xdata = NVEC_SYCL_DDATAp(x); @@ -1323,7 +1323,7 @@ booleantype N_VInvTest_Sycl(N_Vector x, N_Vector z) } -booleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Sycl(N_Vector c, N_Vector x, N_Vector m) { const sunindextype N = NVEC_SYCL_LENGTH(x); const sunrealtype *cdata = NVEC_SYCL_DDATAp(c); @@ -1909,7 +1909,7 @@ int N_VBufUnpack_Sycl(N_Vector x, void *buf) * -------------------------------------------------------------------------- */ -int N_VEnableFusedOps_Sycl(N_Vector v, booleantype tf) +int N_VEnableFusedOps_Sycl(N_Vector v, sunbooleantype tf) { /* check that vector is non-NULL */ if (v == NULL) return -1; @@ -1950,7 +1950,7 @@ int N_VEnableFusedOps_Sycl(N_Vector v, booleantype tf) } -int N_VEnableLinearCombination_Sycl(N_Vector v, booleantype tf) +int N_VEnableLinearCombination_Sycl(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -1959,7 +1959,7 @@ int N_VEnableLinearCombination_Sycl(N_Vector v, booleantype tf) } -int N_VEnableScaleAddMulti_Sycl(N_Vector v, booleantype tf) +int N_VEnableScaleAddMulti_Sycl(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -1968,7 +1968,7 @@ int N_VEnableScaleAddMulti_Sycl(N_Vector v, booleantype tf) } -int N_VEnableLinearSumVectorArray_Sycl(N_Vector v, booleantype tf) +int N_VEnableLinearSumVectorArray_Sycl(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -1977,7 +1977,7 @@ int N_VEnableLinearSumVectorArray_Sycl(N_Vector v, booleantype tf) } -int N_VEnableScaleVectorArray_Sycl(N_Vector v, booleantype tf) +int N_VEnableScaleVectorArray_Sycl(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -1986,7 +1986,7 @@ int N_VEnableScaleVectorArray_Sycl(N_Vector v, booleantype tf) } -int N_VEnableConstVectorArray_Sycl(N_Vector v, booleantype tf) +int N_VEnableConstVectorArray_Sycl(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -1995,7 +1995,7 @@ int N_VEnableConstVectorArray_Sycl(N_Vector v, booleantype tf) } -int N_VEnableScaleAddMultiVectorArray_Sycl(N_Vector v, booleantype tf) +int N_VEnableScaleAddMultiVectorArray_Sycl(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2005,7 +2005,7 @@ int N_VEnableScaleAddMultiVectorArray_Sycl(N_Vector v, booleantype tf) } -int N_VEnableLinearCombinationVectorArray_Sycl(N_Vector v, booleantype tf) +int N_VEnableLinearCombinationVectorArray_Sycl(N_Vector v, sunbooleantype tf) { if (v == NULL) return -1; if (v->ops == NULL) return -1; @@ -2067,7 +2067,7 @@ static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t { int alloc_fail = 0; int copy_fail = 0; - booleantype alloc_mem = SUNFALSE; + sunbooleantype alloc_mem = SUNFALSE; size_t bytes = n * sizeof(sunrealtype); /* Get the vector private memory structure */ @@ -2189,7 +2189,7 @@ static int CopyReductionBufferFromDevice(N_Vector v, size_t n) static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) { int alloc_fail = 0; - booleantype alloc_mem = SUNFALSE; + sunbooleantype alloc_mem = SUNFALSE; size_t bytes = nreal * sizeof(sunrealtype) + nptr * sizeof(sunrealtype*); /* Get the vector private memory structure */ @@ -2391,7 +2391,7 @@ static int FusedBuffer_Free(N_Vector v) /* Get the kernel launch parameters based on the kernel type (reduction or not), * using the appropriate kernel execution policy. */ -static int GetKernelParameters(N_Vector v, booleantype reduction, +static int GetKernelParameters(N_Vector v, sunbooleantype reduction, size_t& nthreads_total, size_t& nthreads_per_block) { diff --git a/src/nvector/trilinos/nvector_trilinos.cpp b/src/nvector/trilinos/nvector_trilinos.cpp index 5449f70072..ffffe41f21 100644 --- a/src/nvector/trilinos/nvector_trilinos.cpp +++ b/src/nvector/trilinos/nvector_trilinos.cpp @@ -433,7 +433,7 @@ void N_VCompare_Trilinos(sunrealtype c, N_Vector x, N_Vector z) /* * Elementwise inverse with zero checking: z[i] = 1/x[i], x[i] != 0 */ -booleantype N_VInvTest_Trilinos(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_Trilinos(N_Vector x, N_Vector z) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP zv = N_VGetVector_Trilinos(z); @@ -445,7 +445,7 @@ booleantype N_VInvTest_Trilinos(N_Vector x, N_Vector z) * Checks constraint violations for vector x. Constraints are defined in * vector c, and constraint violation flags are stored in vector m. */ -booleantype N_VConstrMask_Trilinos(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_Trilinos(N_Vector c, N_Vector x, N_Vector m) { Teuchos::RCP cv = N_VGetVector_Trilinos(c); Teuchos::RCP xv = N_VGetVector_Trilinos(x); @@ -532,7 +532,7 @@ sunrealtype N_VWSqrSumMaskLocal_Trilinos(N_Vector x, N_Vector w, N_Vector id) /* * MPI task-local elementwise inverse with zero checking: z[i] = 1/x[i], x[i] != 0 */ -booleantype N_VInvTestLocal_Trilinos(N_Vector x, N_Vector z) +sunbooleantype N_VInvTestLocal_Trilinos(N_Vector x, N_Vector z) { Teuchos::RCP xv = N_VGetVector_Trilinos(x); Teuchos::RCP zv = N_VGetVector_Trilinos(z); @@ -544,7 +544,7 @@ booleantype N_VInvTestLocal_Trilinos(N_Vector x, N_Vector z) * MPI task-local constraint checking for vector x. Constraints are defined in * vector c, and constraint violation flags are stored in vector m. */ -booleantype N_VConstrMaskLocal_Trilinos(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMaskLocal_Trilinos(N_Vector c, N_Vector x, N_Vector m) { Teuchos::RCP cv = N_VGetVector_Trilinos(c); Teuchos::RCP xv = N_VGetVector_Trilinos(x); diff --git a/src/sundials/sundials_band.c b/src/sundials/sundials_band.c index 10d53417e5..14a8898aec 100644 --- a/src/sundials/sundials_band.c +++ b/src/sundials/sundials_band.c @@ -104,7 +104,7 @@ sunindextype SUNDlsMat_bandGBTRF(sunrealtype **a, sunindextype n, sunindextype m sunindextype i, j, k, l, storage_l, storage_k, last_col_k, last_row_k; sunrealtype *a_c, *col_k, *diag_k, *sub_diag_k, *col_j, *kptr, *jptr; sunrealtype max, temp, mult, a_kj; - booleantype swap; + sunbooleantype swap; /* zero out the first smu - mu rows of the rectangular array a */ diff --git a/src/sundials/sundials_context_impl.h b/src/sundials/sundials_context_impl.h index dd09076611..fb2825d42d 100644 --- a/src/sundials/sundials_context_impl.h +++ b/src/sundials/sundials_context_impl.h @@ -28,9 +28,9 @@ extern "C" { struct _SUNContext { SUNProfiler profiler; - booleantype own_profiler; + sunbooleantype own_profiler; SUNLogger logger; - booleantype own_logger; + sunbooleantype own_logger; }; #ifdef __cplusplus diff --git a/src/sundials/sundials_cuda.h b/src/sundials/sundials_cuda.h index 244e6e76ef..77c004419b 100644 --- a/src/sundials/sundials_cuda.h +++ b/src/sundials/sundials_cuda.h @@ -58,7 +58,7 @@ extern "C" { * Utility functions * ---------------------------------------------------------------------------*/ -inline booleantype SUNDIALS_CUDA_Assert(cudaError_t cuerr, const char *file, int line) +inline sunbooleantype SUNDIALS_CUDA_Assert(cudaError_t cuerr, const char *file, int line) { if (cuerr != cudaSuccess) { @@ -75,7 +75,7 @@ inline booleantype SUNDIALS_CUDA_Assert(cudaError_t cuerr, const char *file, int return SUNTRUE; /* Assert OK */ } -inline booleantype SUNDIALS_CUSPARSE_Assert(cusparseStatus_t status, const char *file, int line) +inline sunbooleantype SUNDIALS_CUSPARSE_Assert(cusparseStatus_t status, const char *file, int line) { if (status != CUSPARSE_STATUS_SUCCESS) { @@ -92,7 +92,7 @@ inline booleantype SUNDIALS_CUSPARSE_Assert(cusparseStatus_t status, const char return SUNTRUE; /* Assert OK */ } -inline booleantype SUNDIALS_CUSOLVER_Assert(cusolverStatus_t status, const char *file, int line) +inline sunbooleantype SUNDIALS_CUSOLVER_Assert(cusolverStatus_t status, const char *file, int line) { if (status != CUSOLVER_STATUS_SUCCESS) { diff --git a/src/sundials/sundials_hip.h b/src/sundials/sundials_hip.h index 8a735cb474..e246e5996b 100644 --- a/src/sundials/sundials_hip.h +++ b/src/sundials/sundials_hip.h @@ -52,7 +52,7 @@ extern "C" { /* --------------------------------------------------------------------------- * Utility functions * ---------------------------------------------------------------------------*/ -inline booleantype SUNDIALS_HIP_Assert(hipError_t hiperr, const char *file, int line) +inline sunbooleantype SUNDIALS_HIP_Assert(hipError_t hiperr, const char *file, int line) { if (hiperr != hipSuccess) { diff --git a/src/sundials/sundials_linearsolver.c b/src/sundials/sundials_linearsolver.c index 55a91ea732..33304de3f8 100644 --- a/src/sundials/sundials_linearsolver.c +++ b/src/sundials/sundials_linearsolver.c @@ -150,7 +150,7 @@ int SUNLinSolSetScalingVectors(SUNLinearSolver S, return(ier); } -int SUNLinSolSetZeroGuess(SUNLinearSolver S, booleantype onoff) +int SUNLinSolSetZeroGuess(SUNLinearSolver S, sunbooleantype onoff) { if (S->ops->setzeroguess) return ((int) S->ops->setzeroguess(S, onoff)); diff --git a/src/sundials/sundials_math.c b/src/sundials/sundials_math.c index 18534776e7..c30904e7aa 100644 --- a/src/sundials/sundials_math.c +++ b/src/sundials/sundials_math.c @@ -25,7 +25,7 @@ static long double sunNextafterl(long double from, long double to); -static booleantype sunIsInf(sunrealtype a) +static sunbooleantype sunIsInf(sunrealtype a) { #if defined(__cplusplus) || defined(SUNDIALS_C_COMPILER_HAS_ISINF_ISNAN) return(isinf(a)); @@ -34,7 +34,7 @@ static booleantype sunIsInf(sunrealtype a) #endif } -static booleantype sunIsNaN(sunrealtype a) +static sunbooleantype sunIsNaN(sunrealtype a) { #if defined(__cplusplus) || defined(SUNDIALS_C_COMPILER_HAS_ISINF_ISNAN) return(isnan(a)); @@ -76,12 +76,12 @@ sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent) #endif } -booleantype SUNRCompare(sunrealtype a, sunrealtype b) +sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b) { return(SUNRCompareTol(a, b, 10*SUN_UNIT_ROUNDOFF)); } -booleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) +sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) { sunrealtype diff; sunrealtype norm; diff --git a/src/sundials/sundials_memory.c b/src/sundials/sundials_memory.c index c013f9a977..6271d44680 100644 --- a/src/sundials/sundials_memory.c +++ b/src/sundials/sundials_memory.c @@ -85,7 +85,7 @@ int SUNMemoryHelper_CopyOps(SUNMemoryHelper src, SUNMemoryHelper dst) } -booleantype SUNMemoryHelper_ImplementsRequiredOps(SUNMemoryHelper helper) +sunbooleantype SUNMemoryHelper_ImplementsRequiredOps(SUNMemoryHelper helper) { if (helper->ops->alloc == NULL || helper->ops->dealloc == NULL || helper->ops->copy == NULL) diff --git a/src/sundials/sundials_nonlinearsolver.c b/src/sundials/sundials_nonlinearsolver.c index c2ed026b0a..c50652a251 100644 --- a/src/sundials/sundials_nonlinearsolver.c +++ b/src/sundials/sundials_nonlinearsolver.c @@ -125,7 +125,7 @@ int SUNNonlinSolSetup(SUNNonlinearSolver NLS, N_Vector y, void* mem) int SUNNonlinSolSolve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { int ier; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(NLS)); diff --git a/src/sundials/sundials_nvector.c b/src/sundials/sundials_nvector.c index 57c8362822..018a8f20e4 100644 --- a/src/sundials/sundials_nvector.c +++ b/src/sundials/sundials_nvector.c @@ -496,20 +496,20 @@ void N_VCompare(sunrealtype c, N_Vector x, N_Vector z) return; } -booleantype N_VInvTest(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest(N_Vector x, N_Vector z) { - booleantype result; + sunbooleantype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((booleantype) z->ops->nvinvtest(x, z)); + result = ((sunbooleantype) z->ops->nvinvtest(x, z)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -booleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask(N_Vector c, N_Vector x, N_Vector m) { - booleantype result; + sunbooleantype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(c)); - result = ((booleantype) x->ops->nvconstrmask(c, x, m)); + result = ((sunbooleantype) x->ops->nvconstrmask(c, x, m)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(c)); return(result); } @@ -861,20 +861,20 @@ sunrealtype N_VWSqrSumMaskLocal(N_Vector x, N_Vector w, N_Vector id) return(result); } -booleantype N_VInvTestLocal(N_Vector x, N_Vector z) +sunbooleantype N_VInvTestLocal(N_Vector x, N_Vector z) { - booleantype result; + sunbooleantype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((booleantype) z->ops->nvinvtestlocal(x,z)); + result = ((sunbooleantype) z->ops->nvinvtestlocal(x,z)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } -booleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, N_Vector m) { - booleantype result; + sunbooleantype result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(x)); - result = ((booleantype) x->ops->nvconstrmasklocal(c,x,m)); + result = ((sunbooleantype) x->ops->nvconstrmasklocal(c,x,m)); SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(x)); return(result); } diff --git a/src/sundials/sundials_nvector_senswrapper.c b/src/sundials/sundials_nvector_senswrapper.c index bb77419557..3b7500acda 100644 --- a/src/sundials/sundials_nvector_senswrapper.c +++ b/src/sundials/sundials_nvector_senswrapper.c @@ -476,10 +476,10 @@ void N_VCompare_SensWrapper(sunrealtype c, N_Vector x, N_Vector z) } -booleantype N_VInvTest_SensWrapper(N_Vector x, N_Vector z) +sunbooleantype N_VInvTest_SensWrapper(N_Vector x, N_Vector z) { int i; - booleantype no_zero_found, tmp; + sunbooleantype no_zero_found, tmp; no_zero_found = SUNTRUE; @@ -492,10 +492,10 @@ booleantype N_VInvTest_SensWrapper(N_Vector x, N_Vector z) } -booleantype N_VConstrMask_SensWrapper(N_Vector c, N_Vector x, N_Vector m) +sunbooleantype N_VConstrMask_SensWrapper(N_Vector c, N_Vector x, N_Vector m) { int i; - booleantype test, tmp; + sunbooleantype test, tmp; test = SUNTRUE; diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index 476d7c427b..3b4c86bc03 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -187,7 +187,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc * Set functions */ -int SUNLinSol_MagmaDense_SetAsync(SUNLinearSolver S, booleantype onoff) +int SUNLinSol_MagmaDense_SetAsync(SUNLinearSolver S, sunbooleantype onoff) { if (S == NULL) return SUNLS_MEM_NULL; ASYNCHRONOUS(S) = onoff; diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index eadd8e3cde..fc0558c9c9 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -258,7 +258,7 @@ int SUNLinSolSetScalingVectors_PCG(SUNLinearSolver S, N_Vector s, } -int SUNLinSolSetZeroGuess_PCG(SUNLinearSolver S, booleantype onoff) +int SUNLinSolSetZeroGuess_PCG(SUNLinearSolver S, sunbooleantype onoff) { /* set flag indicating a zero initial guess */ if (S == NULL) return(SUNLS_MEM_NULL); @@ -302,8 +302,8 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, N_Vector x, /* local data and shortcut variables */ sunrealtype alpha, beta, r0_norm, rho, rz, rz_old; N_Vector r, p, z, Ap, w; - booleantype UsePrec, UseScaling, converged; - booleantype *zeroguess; + sunbooleantype UsePrec, UseScaling, converged; + sunbooleantype *zeroguess; int l, l_max, pretype, ier; void *A_data, *P_data; SUNATimesFn atimes; @@ -332,7 +332,7 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, N_Vector x, *nli = 0; converged = SUNFALSE; - /* set booleantype flags for internal solver options */ + /* set sunbooleantype flags for internal solver options */ UsePrec = ( (pretype == SUN_PREC_BOTH) || (pretype == SUN_PREC_LEFT) || (pretype == SUN_PREC_RIGHT) ); diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index 1039169d25..6177e2587a 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -280,7 +280,7 @@ int SUNLinSolSetScalingVectors_SPBCGS(SUNLinearSolver S, N_Vector s1, } -int SUNLinSolSetZeroGuess_SPBCGS(SUNLinearSolver S, booleantype onoff) +int SUNLinSolSetZeroGuess_SPBCGS(SUNLinearSolver S, sunbooleantype onoff) { /* set flag indicating a zero initial guess */ if (S == NULL) return(SUNLS_MEM_NULL); @@ -324,8 +324,8 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, N_Vector x, /* local data and shortcut variables */ sunrealtype alpha, beta, omega, omega_denom, beta_num, beta_denom, r_norm, rho; N_Vector r_star, r, p, q, u, Ap, vtemp; - booleantype preOnLeft, preOnRight, scale_x, scale_b, converged; - booleantype *zeroguess; + sunbooleantype preOnLeft, preOnRight, scale_x, scale_b, converged; + sunbooleantype *zeroguess; int l, l_max, ier; void *A_data, *P_data; N_Vector sx, sb; @@ -362,7 +362,7 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, N_Vector x, *nli = 0; converged = SUNFALSE; - /* set booleantype flags for internal solver options */ + /* set sunbooleantype flags for internal solver options */ preOnLeft = ( (PRETYPE(S) == SUN_PREC_LEFT) || (PRETYPE(S) == SUN_PREC_BOTH) ); preOnRight = ( (PRETYPE(S) == SUN_PREC_RIGHT) || diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index 585183fc15..65aea62df8 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -368,7 +368,7 @@ int SUNLinSolSetScalingVectors_SPFGMR(SUNLinearSolver S, N_Vector s1, } -int SUNLinSolSetZeroGuess_SPFGMR(SUNLinearSolver S, booleantype onoff) +int SUNLinSolSetZeroGuess_SPFGMR(SUNLinearSolver S, sunbooleantype onoff) { /* set flag indicating a zero initial guess */ if (S == NULL) return(SUNLS_MEM_NULL); @@ -412,8 +412,8 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector *V, *Z, xcor, vtemp, s1, s2; sunrealtype **Hes, *givens, *yg, *res_norm; sunrealtype beta, rotation_product, r_norm, s_product, rho; - booleantype preOnRight, scale1, scale2, converged; - booleantype *zeroguess; + sunbooleantype preOnRight, scale1, scale2, converged; + sunbooleantype *zeroguess; int i, j, k, l, l_max, krydim, ier, ntries, max_restarts, gstype; int *nli; void *A_data, *P_data; @@ -455,7 +455,7 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, *nli = 0; converged = SUNFALSE; - /* Set booleantype flags for internal solver options */ + /* Set sunbooleantype flags for internal solver options */ preOnRight = ( (SPFGMR_CONTENT(S)->pretype == SUN_PREC_LEFT) || (SPFGMR_CONTENT(S)->pretype == SUN_PREC_RIGHT) || (SPFGMR_CONTENT(S)->pretype == SUN_PREC_BOTH) ); diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 925201d7a1..4a2be34ea3 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -356,7 +356,7 @@ int SUNLinSolSetScalingVectors_SPGMR(SUNLinearSolver S, N_Vector s1, } -int SUNLinSolSetZeroGuess_SPGMR(SUNLinearSolver S, booleantype onff) +int SUNLinSolSetZeroGuess_SPGMR(SUNLinearSolver S, sunbooleantype onff) { /* set flag indicating a zero initial guess */ if (S == NULL) return(SUNLS_MEM_NULL); @@ -400,8 +400,8 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector *V, xcor, vtemp, s1, s2; sunrealtype **Hes, *givens, *yg, *res_norm; sunrealtype beta, rotation_product, r_norm, s_product, rho; - booleantype preOnLeft, preOnRight, scale2, scale1, converged; - booleantype *zeroguess; + sunbooleantype preOnLeft, preOnRight, scale2, scale1, converged; + sunbooleantype *zeroguess; int i, j, k, l, l_plus_1, l_max, krydim, ier, ntries, max_restarts, gstype; int *nli; void *A_data, *P_data; @@ -443,7 +443,7 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, *nli = 0; converged = SUNFALSE; - /* Set booleantype flags for internal solver options */ + /* Set sunbooleantype flags for internal solver options */ preOnLeft = ( (SPGMR_CONTENT(S)->pretype == SUN_PREC_LEFT) || (SPGMR_CONTENT(S)->pretype == SUN_PREC_BOTH) ); preOnRight = ( (SPGMR_CONTENT(S)->pretype == SUN_PREC_RIGHT) || diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 505bbde392..55a76b9a82 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -295,7 +295,7 @@ int SUNLinSolSetScalingVectors_SPTFQMR(SUNLinearSolver S, } -int SUNLinSolSetZeroGuess_SPTFQMR(SUNLinearSolver S, booleantype onoff) +int SUNLinSolSetZeroGuess_SPTFQMR(SUNLinearSolver S, sunbooleantype onoff) { /* set flag indicating a zero initial guess */ if (S == NULL) return(SUNLS_MEM_NULL); @@ -340,8 +340,8 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, sunrealtype rho[2]; sunrealtype r_init_norm, r_curr_norm; sunrealtype temp_val; - booleantype preOnLeft, preOnRight, scale_x, scale_b, converged, b_ok; - booleantype *zeroguess; + sunbooleantype preOnLeft, preOnRight, scale_x, scale_b, converged, b_ok; + sunbooleantype *zeroguess; int n, m, ier, l_max; void *A_data, *P_data; SUNATimesFn atimes; @@ -383,7 +383,7 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, converged = SUNFALSE; b_ok = SUNFALSE; - /* set booleantype flags for internal solver options */ + /* set sunbooleantype flags for internal solver options */ preOnLeft = ( (SPTFQMR_CONTENT(S)->pretype == SUN_PREC_LEFT) || (SPTFQMR_CONTENT(S)->pretype == SUN_PREC_BOTH) ); preOnRight = ( (SPTFQMR_CONTENT(S)->pretype == SUN_PREC_RIGHT) || diff --git a/src/sunmatrix/band/sunmatrix_band.c b/src/sunmatrix/band/sunmatrix_band.c index 2409ca60a3..7048d49e8d 100644 --- a/src/sunmatrix/band/sunmatrix_band.c +++ b/src/sunmatrix/band/sunmatrix_band.c @@ -31,8 +31,8 @@ /* Private function prototypes */ -static booleantype SMCompatible_Band(SUNMatrix A, SUNMatrix B); -static booleantype SMCompatible2_Band(SUNMatrix A, N_Vector x, N_Vector y); +static sunbooleantype SMCompatible_Band(SUNMatrix A, SUNMatrix B); +static sunbooleantype SMCompatible2_Band(SUNMatrix A, N_Vector x, N_Vector y); static int SMScaleAddNew_Band(sunrealtype c, SUNMatrix A, SUNMatrix B); @@ -420,7 +420,7 @@ int SUNMatSpace_Band(SUNMatrix A, long int *lenrw, long int *leniw) * ----------------------------------------------------------------- */ -static booleantype SMCompatible_Band(SUNMatrix A, SUNMatrix B) +static sunbooleantype SMCompatible_Band(SUNMatrix A, SUNMatrix B) { /* both matrices must be SUNMATRIX_BAND */ if (SUNMatGetID(A) != SUNMATRIX_BAND) @@ -439,7 +439,7 @@ static booleantype SMCompatible_Band(SUNMatrix A, SUNMatrix B) } -static booleantype SMCompatible2_Band(SUNMatrix A, N_Vector x, N_Vector y) +static sunbooleantype SMCompatible2_Band(SUNMatrix A, N_Vector x, N_Vector y) { /* matrix must be SUNMATRIX_BAND */ if (SUNMatGetID(A) != SUNMATRIX_BAND) diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index 1b3562fa2c..112cc18fa2 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -37,7 +37,7 @@ using namespace sundials::sunmatrix_cusparse; #define ONE SUN_RCONST(1.0) /* Private function prototypes */ -static booleantype SMCompatible_cuSparse(SUNMatrix, SUNMatrix); +static sunbooleantype SMCompatible_cuSparse(SUNMatrix, SUNMatrix); static SUNMatrix SUNMatrix_cuSparse_NewEmpty(SUNContext sunctx); #if CUDART_VERSION >= 11000 static cusparseStatus_t CreateSpMatDescr(SUNMatrix, cusparseSpMatDescr_t*); @@ -613,7 +613,7 @@ cusparseMatDescr_t SUNMatrix_cuSparse_MatDescr(SUNMatrix A) return(NULL); } -int SUNMatrix_cuSparse_SetFixedPattern(SUNMatrix A, booleantype yesno) +int SUNMatrix_cuSparse_SetFixedPattern(SUNMatrix A, sunbooleantype yesno) { if (SUNMatGetID(A) != SUNMATRIX_CUSPARSE) return(SUNMAT_ILL_INPUT); @@ -1188,7 +1188,7 @@ int SUNMatMatvec_cuSparse(SUNMatrix A, N_Vector x, N_Vector y) /* ----------------------------------------------------------------- * Function to check compatibility of two sparse SUNMatrix objects */ -static booleantype SMCompatible_cuSparse(SUNMatrix A, SUNMatrix B) +static sunbooleantype SMCompatible_cuSparse(SUNMatrix A, SUNMatrix B) { /* both matrices must be sparse */ if ( (SUNMatGetID(A) != SUNMATRIX_CUSPARSE) || diff --git a/src/sunmatrix/dense/sunmatrix_dense.c b/src/sunmatrix/dense/sunmatrix_dense.c index 79bce74cfc..55f5788a07 100644 --- a/src/sunmatrix/dense/sunmatrix_dense.c +++ b/src/sunmatrix/dense/sunmatrix_dense.c @@ -27,8 +27,8 @@ #define ONE SUN_RCONST(1.0) /* Private function prototypes */ -static booleantype compatibleMatrices(SUNMatrix A, SUNMatrix B); -static booleantype compatibleMatrixAndVectors(SUNMatrix A, N_Vector x, N_Vector y); +static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B); +static sunbooleantype compatibleMatrixAndVectors(SUNMatrix A, N_Vector x, N_Vector y); /* * ----------------------------------------------------------------- @@ -331,7 +331,7 @@ int SUNMatSpace_Dense(SUNMatrix A, long int* lenrw, long int* leniw) * ----------------------------------------------------------------- */ -static booleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) +static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) { /* both matrices must be SUNMATRIX_DENSE */ if ((SUNMatGetID(A) != SUNMATRIX_DENSE) || (SUNMatGetID(B) != SUNMATRIX_DENSE)) { @@ -346,7 +346,7 @@ static booleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) return SUNTRUE; } -static booleantype compatibleMatrixAndVectors(SUNMatrix A, N_Vector x, N_Vector y) +static sunbooleantype compatibleMatrixAndVectors(SUNMatrix A, N_Vector x, N_Vector y) { /* Vectors must provide nvgetarraypointer and cannot be a parallel vector */ if (!x->ops->nvgetarraypointer || !y->ops->nvgetarraypointer) { diff --git a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp index 4f2a57a6d5..c8a4bd5160 100644 --- a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp +++ b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp @@ -57,8 +57,8 @@ using namespace sundials::sunmatrix_gpudense::hip; #endif /* Private function prototypes */ -static booleantype SMCompatible_MagmaDense(SUNMatrix A, SUNMatrix B); -static booleantype SMCompatible2_MagmaDense(SUNMatrix A, N_Vector x, N_Vector y); +static sunbooleantype SMCompatible_MagmaDense(SUNMatrix A, SUNMatrix B); +static sunbooleantype SMCompatible2_MagmaDense(SUNMatrix A, N_Vector x, N_Vector y); /* * ---------------------------------------------------------------------------- @@ -610,7 +610,7 @@ int SUNMatSpace_MagmaDense(SUNMatrix Amat, long int *lenrw, long int *leniw) * ----------------------------------------------------------------- */ -static booleantype SMCompatible_MagmaDense(SUNMatrix Amat, SUNMatrix Bmat) +static sunbooleantype SMCompatible_MagmaDense(SUNMatrix Amat, SUNMatrix Bmat) { SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); SUNMatrixContent_MagmaDense B = SMLD_CONTENT(Bmat); @@ -632,7 +632,7 @@ static booleantype SMCompatible_MagmaDense(SUNMatrix Amat, SUNMatrix Bmat) return(SUNTRUE); } -static booleantype SMCompatible2_MagmaDense(SUNMatrix Amat, N_Vector x, N_Vector y) +static sunbooleantype SMCompatible2_MagmaDense(SUNMatrix Amat, N_Vector x, N_Vector y) { SUNMatrixContent_MagmaDense A = SMLD_CONTENT(Amat); diff --git a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp index c8dafadec5..0f1b700212 100644 --- a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp +++ b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp @@ -57,11 +57,11 @@ #define MAT_QUEUE(A) (MAT_CONTENT(A)->queue) // Private function prototypes -static booleantype Compatible_AB(SUNMatrix A, SUNMatrix B); -static booleantype Compatible_Axy(SUNMatrix A, N_Vector x, N_Vector y); +static sunbooleantype Compatible_AB(SUNMatrix A, SUNMatrix B); +static sunbooleantype Compatible_Axy(SUNMatrix A, N_Vector x, N_Vector y); // Kernel launch parameters -static int GetKernelParameters(SUNMatrix A, booleantype reduction, +static int GetKernelParameters(SUNMatrix A, sunbooleantype reduction, size_t& nthreads_total, size_t& nthreads_per_block); @@ -675,7 +675,7 @@ int SUNMatSpace_OneMklDense(SUNMatrix A, long int *lenrw, long int *leniw) // Get the kernel launch parameters -static int GetKernelParameters(SUNMatrix A, booleantype reduction, +static int GetKernelParameters(SUNMatrix A, sunbooleantype reduction, size_t& nthreads_total, size_t& nthreads_per_block) { @@ -706,7 +706,7 @@ static int GetKernelParameters(SUNMatrix A, booleantype reduction, } -static booleantype Compatible_AB(SUNMatrix A, SUNMatrix B) +static sunbooleantype Compatible_AB(SUNMatrix A, SUNMatrix B) { // Both matrices must have the SUNMATRIEX_MKLDENSE ID if (SUNMatGetID(A) != SUNMATRIX_ONEMKLDENSE) @@ -744,7 +744,7 @@ static booleantype Compatible_AB(SUNMatrix A, SUNMatrix B) } -static booleantype Compatible_Axy(SUNMatrix A, N_Vector x, N_Vector y) +static sunbooleantype Compatible_Axy(SUNMatrix A, N_Vector x, N_Vector y) { // Vectors must implement N_VGetDeviceArrayPointer if (!(x->ops->nvgetdevicearraypointer) || !(y->ops->nvgetdevicearraypointer)) diff --git a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c index 6e2bc48e52..da187aa7f5 100644 --- a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c +++ b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c @@ -68,7 +68,7 @@ #define ZERO SUN_RCONST(0.0) /* Private function prototypes */ -static booleantype SMCompatible_SLUNRloc(SUNMatrix A, SUNMatrix B); +static sunbooleantype SMCompatible_SLUNRloc(SUNMatrix A, SUNMatrix B); /* * ---------------------------------------------------------------------------- @@ -155,7 +155,7 @@ gridinfo_t* SUNMatrix_SLUNRloc_ProcessGrid(SUNMatrix A) return(SM_GRID_SLUNRLOC(A)); } -booleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A) +sunbooleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A) { return(SM_OWNDATA_SLUNRLOC(A)); } @@ -389,7 +389,7 @@ int SUNMatSpace_SLUNRloc(SUNMatrix A, long int *lenrw, long int *leniw) /* Function to check compatibility of two sparse SUNMatrix objects. Checks to make sure that the the matrices are both SLUNRLOC, have the same number of rows, cols and nonzeros.*/ -static booleantype SMCompatible_SLUNRloc(SUNMatrix A, SUNMatrix B) +static sunbooleantype SMCompatible_SLUNRloc(SUNMatrix A, SUNMatrix B) { /* both matrices must be SLUNRLOC */ if ((SUNMatGetID(A) != SUNMATRIX_SLUNRLOC) || diff --git a/src/sunmatrix/sparse/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index 93f2451e21..298160c662 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -31,8 +31,8 @@ #define ONE SUN_RCONST(1.0) /* Private function prototypes */ -static booleantype SMCompatible_Sparse(SUNMatrix A, SUNMatrix B); -static booleantype SMCompatible2_Sparse(SUNMatrix A, N_Vector x, N_Vector y); +static sunbooleantype SMCompatible_Sparse(SUNMatrix A, SUNMatrix B); +static sunbooleantype SMCompatible2_Sparse(SUNMatrix A, N_Vector x, N_Vector y); static int Matvec_SparseCSC(SUNMatrix A, N_Vector x, N_Vector y); static int Matvec_SparseCSR(SUNMatrix A, N_Vector x, N_Vector y); static int format_convert(const SUNMatrix A, SUNMatrix B); @@ -573,7 +573,7 @@ int SUNMatCopy_Sparse(SUNMatrix A, SUNMatrix B) int SUNMatScaleAddI_Sparse(sunrealtype c, SUNMatrix A) { sunindextype j, i, p, nz, newvals, M, N, cend, nw; - booleantype newmat, found; + sunbooleantype newmat, found; sunindextype *w, *Ap, *Ai, *Cp, *Ci; sunrealtype *x, *Ax, *Cx; SUNMatrix C; @@ -794,7 +794,7 @@ int SUNMatScaleAddI_Sparse(sunrealtype c, SUNMatrix A) int SUNMatScaleAdd_Sparse(sunrealtype c, SUNMatrix A, SUNMatrix B) { sunindextype j, i, p, nz, newvals, M, N, cend; - booleantype newmat; + sunbooleantype newmat; sunindextype *w, *Ap, *Ai, *Bp, *Bi, *Cp, *Ci; sunrealtype *x, *Ax, *Bx, *Cx; SUNMatrix C; @@ -1047,7 +1047,7 @@ int SUNMatSpace_Sparse(SUNMatrix A, long int *lenrw, long int *leniw) * Function to check compatibility of two sparse SUNMatrix objects */ -static booleantype SMCompatible_Sparse(SUNMatrix A, SUNMatrix B) +static sunbooleantype SMCompatible_Sparse(SUNMatrix A, SUNMatrix B) { /* both matrices must be sparse */ if ( (SUNMatGetID(A) != SUNMATRIX_SPARSE) || @@ -1071,7 +1071,7 @@ static booleantype SMCompatible_Sparse(SUNMatrix A, SUNMatrix B) * N_Vectors (A*x = b) */ -static booleantype SMCompatible2_Sparse(SUNMatrix A, N_Vector x, N_Vector y) +static sunbooleantype SMCompatible2_Sparse(SUNMatrix A, N_Vector x, N_Vector y) { /* vectors must implement N_VGetArrayPointer */ if ( (x->ops->nvgetarraypointer == NULL) || diff --git a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c index 3b73649a7c..3f0b8ba392 100644 --- a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +++ b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c @@ -183,7 +183,7 @@ int SUNNonlinSolInitialize_FixedPoint(SUNNonlinearSolver NLS) ---------------------------------------------------------------------------*/ int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, - booleantype callSetup, void* mem) + sunbooleantype callSetup, void* mem) { /* local variables */ int retval; @@ -471,7 +471,7 @@ static int AndersonAccelerate(SUNNonlinearSolver NLS, N_Vector gval, int nvec, retval, i_pt, i, j, lAA, maa, *ipt_map; sunrealtype a, b, rtemp, c, s, beta, onembeta, *cvals, *R, *gamma; N_Vector fv, vtemp, gold, fold, *df, *dg, *Q, *Xvecs; - booleantype damping; + sunbooleantype damping; /* local shortcut variables */ vtemp = x; /* use result as temporary vector */ diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index 5e785f26f8..d1c4a2d4a9 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -187,11 +187,11 @@ int SUNNonlinSolInitialize_Newton(SUNNonlinearSolver NLS) int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { /* local variables */ int retval; - booleantype jbad; + sunbooleantype jbad; N_Vector delta; /* check that the inputs are non-null */ diff --git a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c index a822240678..a8cf32c2fd 100644 --- a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c +++ b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c @@ -162,7 +162,7 @@ int SUNNonlinSolInitialize_PetscSNES(SUNNonlinearSolver NLS) int SUNNonlinSolSolve_PetscSNES(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, N_Vector w, sunrealtype tol, - booleantype callLSetup, void* mem) + sunbooleantype callLSetup, void* mem) { /* local variables */ PetscErrorCode ierr; diff --git a/swig/sundials/fsundials_types_mod.i b/swig/sundials/fsundials_types_mod.i index 5f00272317..085b370c19 100644 --- a/swig/sundials/fsundials_types_mod.i +++ b/swig/sundials/fsundials_types_mod.i @@ -24,7 +24,7 @@ #define SUNDIALS_INT64_T #define SUNDIALS_INDEX_TYPE int64_t #define SUNDIALS_DOUBLE_PRECISION -#define booleantype int +#define sunbooleantype int // Insert code into the C wrapper to check that the sizes match %{ diff --git a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp index 9ecb397a70..c207bf7d3d 100644 --- a/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp +++ b/test/unit_tests/arkode/CXX_parallel/ark_test_heat2D_mri.cpp @@ -86,8 +86,8 @@ typedef struct { // User-supplied Functions Called by the Solver static int f(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data); -static int PSet(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data); +static int PSet(sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data); static int PSol(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data); @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) { sunrealtype *data; sunindextype N, Ntot, i, j; int numfails; - booleantype linear; + sunbooleantype linear; sunrealtype t; long int ark_nst, ark_nfe, ark_nfi, ark_nsetups, ark_nli, ark_nJv, ark_nlcf, ark_nni, ark_ncfn, ark_npe, ark_nps; long int mri_nst, mri_nfse, mri_nfsi, mri_nsetups, mri_nli, mri_nJv, mri_nlcf, mri_nni, mri_ncfn, mri_npe, mri_nps; @@ -563,8 +563,8 @@ static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data) } // Preconditioner setup routine (fills inverse of Jacobian diagonal) -static int PSet(sunrealtype t, N_Vector y, N_Vector fy, booleantype jok, - booleantype *jcurPtr, sunrealtype gamma, void *user_data) +static int PSet(sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, + sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data) { UserData *udata = (UserData *) user_data; // variable shortcuts sunrealtype kx = udata->kx; diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp index 623d91693c..23c608ca6b 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_analytic_sys_mri.cpp @@ -92,7 +92,7 @@ int main(int argc, char* argv[]) void *mristep_mem = NULL; // empty MRIStep memory structure void *inner_mem = NULL; // empty inner ARKStep memory structure int numfails; - booleantype fixedpoint; + sunbooleantype fixedpoint; sunrealtype t, tcur; long int ark_nst, ark_nfe, ark_nfi, ark_nsetups, ark_nje, ark_nfeLS, ark_nni, ark_ncfn; long int mri_nst, mri_nfse, mri_nfsi, mri_nsetups, mri_nje, mri_nfeLS, mri_nni, mri_ncfn; From c9de0958724121c8b927a1fac76c25308c892314 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:50:10 -0700 Subject: [PATCH 10/85] changelog note --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1c49a4a2..8f0b8458b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # SUNDIALS Changelog +## Changes to SUNDIALS in release 7.0.0 + +The previously deprecated types `realtype` and `booleantype` were removed from `sundials_types.h`. +Users should use `sunrealtype` and `sunbooleantype` instead, but the old names for the types +can be used by including the header file `sundials_types_old.h`. + ## Changes to SUNDIALS in release X.X.X From 08a4a43ed7a90f74c5baa1d0d5ca4179a8030958 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:50:46 -0700 Subject: [PATCH 11/85] fix redefinition --- include/sundials/sundials_types.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index 346645f209..a1dcea797e 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -138,11 +138,6 @@ typedef SUNDIALS_INDEX_TYPE sunindextype; *------------------------------------------------------------------ */ -/* deprecated */ -#ifndef sunbooleantype -#define sunbooleantype int -#endif - #ifndef sunbooleantype #define sunbooleantype int #endif From c9db3f5abbe22cdccd8b6e5c19841ae3cb35026f Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:51:05 -0700 Subject: [PATCH 12/85] regen swig --- src/arkode/fmod/farkode_arkstep_mod.f90 | 4 +- src/arkode/fmod/farkode_mod.c | 2 +- src/arkode/fmod/farkode_mod.f90 | 24 +-- src/arkode/fmod/farkode_mristep_mod.f90 | 4 +- src/cvode/fmod/fcvode_mod.f90 | 4 +- src/cvodes/fmod/fcvodes_mod.f90 | 4 +- src/ida/fmod/fida_mod.f90 | 8 +- src/idas/fmod/fidas_mod.f90 | 8 +- src/kinsol/fmod/fkinsol_mod.c | 28 --- src/kinsol/fmod/fkinsol_mod.f90 | 52 ------ src/nvector/openmp/fmod/fnvector_openmp_mod.c | 38 ---- .../openmp/fmod/fnvector_openmp_mod.f90 | 72 -------- .../parallel/fmod/fnvector_parallel_mod.c | 38 ---- .../parallel/fmod/fnvector_parallel_mod.f90 | 72 -------- .../pthreads/fmod/fnvector_pthreads_mod.c | 38 ---- .../pthreads/fmod/fnvector_pthreads_mod.f90 | 72 -------- src/nvector/serial/fmod/fnvector_serial_mod.c | 38 ---- .../serial/fmod/fnvector_serial_mod.f90 | 72 -------- .../fmod/fsundials_linearsolver_mod.c | 80 --------- .../fmod/fsundials_linearsolver_mod.f90 | 164 ------------------ src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c | 28 --- src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 | 52 ------ .../spbcgs/fmod/fsunlinsol_spbcgs_mod.c | 28 --- .../spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 | 52 ------ .../spfgmr/fmod/fsunlinsol_spfgmr_mod.c | 28 --- .../spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 | 52 ------ .../spgmr/fmod/fsunlinsol_spgmr_mod.c | 28 --- .../spgmr/fmod/fsunlinsol_spgmr_mod.f90 | 52 ------ .../sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c | 28 --- .../sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 | 52 ------ .../fmod/fsunnonlinsol_fixedpoint_mod.c | 28 --- .../fmod/fsunnonlinsol_fixedpoint_mod.f90 | 52 ------ .../newton/fmod/fsunnonlinsol_newton_mod.c | 28 --- .../newton/fmod/fsunnonlinsol_newton_mod.f90 | 52 ------ 34 files changed, 29 insertions(+), 1353 deletions(-) diff --git a/src/arkode/fmod/farkode_arkstep_mod.f90 b/src/arkode/fmod/farkode_arkstep_mod.f90 index f9f0c191eb..d799f7d477 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -3968,13 +3968,13 @@ function FARKStepGetJacTime(arkode_mem, t_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), target, intent(inout) :: t_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(t_j) +farg2 = c_loc(t_j(1)) fresult = swigc_FARKStepGetJacTime(farg1, farg2) swig_result = fresult end function diff --git a/src/arkode/fmod/farkode_mod.c b/src/arkode/fmod/farkode_mod.c index c6b6c17b6e..94f8017cc5 100644 --- a/src/arkode/fmod/farkode_mod.c +++ b/src/arkode/fmod/farkode_mod.c @@ -931,7 +931,7 @@ SWIGEXPORT void _wrap_ARKodeSPRKTableMem_op_assign__(SwigClassWrapper *farg1, Sw } -SWIGEXPORT void * _wrap_FARKodeSPRKTable_Create(int const *farg1, int const *farg2, double const *farg3, double const *farg4) { +SWIGEXPORT void * _wrap_FARKodeSPRKTable_Create(int const *farg1, int const *farg2, double *farg3, double *farg4) { void * fresult ; int arg1 ; int arg2 ; diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 3f51ff8cec..1e0a747d25 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -1431,51 +1431,51 @@ function swigf_ARKodeSPRKTableMem_stages_get(self) & subroutine swigf_ARKodeSPRKTableMem_a_set(self, a) use, intrinsic :: ISO_C_BINDING class(ARKodeSPRKTableMem), intent(in) :: self -real(C_DOUBLE), target, intent(inout) :: a +real(C_DOUBLE), dimension(*), target, intent(inout) :: a type(SwigClassWrapper) :: farg1 type(C_PTR) :: farg2 farg1 = self%swigdata -farg2 = c_loc(a) +farg2 = c_loc(a(1)) call swigc_ARKodeSPRKTableMem_a_set(farg1, farg2) end subroutine function swigf_ARKodeSPRKTableMem_a_get(self) & result(swig_result) use, intrinsic :: ISO_C_BINDING -real(C_DOUBLE), pointer :: swig_result +real(C_DOUBLE), dimension(:), pointer :: swig_result class(ARKodeSPRKTableMem), intent(in) :: self type(C_PTR) :: fresult type(SwigClassWrapper) :: farg1 farg1 = self%swigdata fresult = swigc_ARKodeSPRKTableMem_a_get(farg1) -call c_f_pointer(fresult, swig_result) +call c_f_pointer(fresult, swig_result, [1]) end function subroutine swigf_ARKodeSPRKTableMem_ahat_set(self, ahat) use, intrinsic :: ISO_C_BINDING class(ARKodeSPRKTableMem), intent(in) :: self -real(C_DOUBLE), target, intent(inout) :: ahat +real(C_DOUBLE), dimension(*), target, intent(inout) :: ahat type(SwigClassWrapper) :: farg1 type(C_PTR) :: farg2 farg1 = self%swigdata -farg2 = c_loc(ahat) +farg2 = c_loc(ahat(1)) call swigc_ARKodeSPRKTableMem_ahat_set(farg1, farg2) end subroutine function swigf_ARKodeSPRKTableMem_ahat_get(self) & result(swig_result) use, intrinsic :: ISO_C_BINDING -real(C_DOUBLE), pointer :: swig_result +real(C_DOUBLE), dimension(:), pointer :: swig_result class(ARKodeSPRKTableMem), intent(in) :: self type(C_PTR) :: fresult type(SwigClassWrapper) :: farg1 farg1 = self%swigdata fresult = swigc_ARKodeSPRKTableMem_ahat_get(farg1) -call c_f_pointer(fresult, swig_result) +call c_f_pointer(fresult, swig_result, [1]) end function function swigf_create_ARKodeSPRKTableMem() & @@ -1521,8 +1521,8 @@ function FARKodeSPRKTable_Create(s, q, a, ahat) & type(C_PTR) :: swig_result integer(C_INT), intent(in) :: s integer(C_INT), intent(in) :: q -real(C_DOUBLE), target, intent(inout) :: a -real(C_DOUBLE), target, intent(inout) :: ahat +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +real(C_DOUBLE), dimension(*), target, intent(inout) :: ahat type(C_PTR) :: fresult integer(C_INT) :: farg1 integer(C_INT) :: farg2 @@ -1531,8 +1531,8 @@ function FARKodeSPRKTable_Create(s, q, a, ahat) & farg1 = s farg2 = q -farg3 = c_loc(a) -farg4 = c_loc(ahat) +farg3 = c_loc(a(1)) +farg4 = c_loc(ahat(1)) fresult = swigc_FARKodeSPRKTable_Create(farg1, farg2, farg3, farg4) swig_result = fresult end function diff --git a/src/arkode/fmod/farkode_mristep_mod.f90 b/src/arkode/fmod/farkode_mristep_mod.f90 index c0358e1ad1..d740e4e8a1 100644 --- a/src/arkode/fmod/farkode_mristep_mod.f90 +++ b/src/arkode/fmod/farkode_mristep_mod.f90 @@ -3186,13 +3186,13 @@ function FMRIStepGetJacTime(arkode_mem, t_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), target, intent(inout) :: t_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(t_j) +farg2 = c_loc(t_j(1)) fresult = swigc_FMRIStepGetJacTime(farg1, farg2) swig_result = fresult end function diff --git a/src/cvode/fmod/fcvode_mod.f90 b/src/cvode/fmod/fcvode_mod.f90 index 738f334a3f..6cad0fc9f2 100644 --- a/src/cvode/fmod/fcvode_mod.f90 +++ b/src/cvode/fmod/fcvode_mod.f90 @@ -3132,13 +3132,13 @@ function FCVodeGetJacTime(cvode_mem, t_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem -real(C_DOUBLE), target, intent(inout) :: t_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = cvode_mem -farg2 = c_loc(t_j) +farg2 = c_loc(t_j(1)) fresult = swigc_FCVodeGetJacTime(farg1, farg2) swig_result = fresult end function diff --git a/src/cvodes/fmod/fcvodes_mod.f90 b/src/cvodes/fmod/fcvodes_mod.f90 index 505ed54f8a..d34ac805dd 100644 --- a/src/cvodes/fmod/fcvodes_mod.f90 +++ b/src/cvodes/fmod/fcvodes_mod.f90 @@ -6722,13 +6722,13 @@ function FCVodeGetJacTime(cvode_mem, t_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem -real(C_DOUBLE), target, intent(inout) :: t_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = cvode_mem -farg2 = c_loc(t_j) +farg2 = c_loc(t_j(1)) fresult = swigc_FCVodeGetJacTime(farg1, farg2) swig_result = fresult end function diff --git a/src/ida/fmod/fida_mod.f90 b/src/ida/fmod/fida_mod.f90 index d4bcd98bc9..b868c16a47 100644 --- a/src/ida/fmod/fida_mod.f90 +++ b/src/ida/fmod/fida_mod.f90 @@ -2837,13 +2837,13 @@ function FIDAGetJacCj(ida_mem, cj_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: ida_mem -real(C_DOUBLE), target, intent(inout) :: cj_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = ida_mem -farg2 = c_loc(cj_j) +farg2 = c_loc(cj_j(1)) fresult = swigc_FIDAGetJacCj(farg1, farg2) swig_result = fresult end function @@ -2853,13 +2853,13 @@ function FIDAGetJacTime(ida_mem, t_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: ida_mem -real(C_DOUBLE), target, intent(inout) :: t_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = ida_mem -farg2 = c_loc(t_j) +farg2 = c_loc(t_j(1)) fresult = swigc_FIDAGetJacTime(farg1, farg2) swig_result = fresult end function diff --git a/src/idas/fmod/fidas_mod.f90 b/src/idas/fmod/fidas_mod.f90 index 1f4e76d256..81f8480540 100644 --- a/src/idas/fmod/fidas_mod.f90 +++ b/src/idas/fmod/fidas_mod.f90 @@ -6452,13 +6452,13 @@ function FIDAGetJacCj(ida_mem, cj_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: ida_mem -real(C_DOUBLE), target, intent(inout) :: cj_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = ida_mem -farg2 = c_loc(cj_j) +farg2 = c_loc(cj_j(1)) fresult = swigc_FIDAGetJacCj(farg1, farg2) swig_result = fresult end function @@ -6468,13 +6468,13 @@ function FIDAGetJacTime(ida_mem, t_j) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: ida_mem -real(C_DOUBLE), target, intent(inout) :: t_j +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = ida_mem -farg2 = c_loc(t_j) +farg2 = c_loc(t_j(1)) fresult = swigc_FIDAGetJacTime(farg1, farg2) swig_result = fresult end function diff --git a/src/kinsol/fmod/fkinsol_mod.c b/src/kinsol/fmod/fkinsol_mod.c index ca1b5e31a9..680828b473 100644 --- a/src/kinsol/fmod/fkinsol_mod.c +++ b/src/kinsol/fmod/fkinsol_mod.c @@ -683,20 +683,6 @@ SWIGEXPORT int _wrap_FKINSetInfoHandlerFn(void *farg1, KINInfoHandlerFn farg2, v } -SWIGEXPORT int _wrap_FKINSetInfoFile(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)KINSetInfoFile(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -711,20 +697,6 @@ SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { } -SWIGEXPORT int _wrap_FKINSetDebugFile(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)KINSetDebugFile(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINGetWorkSpace(void *farg1, long *farg2, long *farg3) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/kinsol/fmod/fkinsol_mod.f90 b/src/kinsol/fmod/fkinsol_mod.f90 index c60ae37fb3..4928d79822 100644 --- a/src/kinsol/fmod/fkinsol_mod.f90 +++ b/src/kinsol/fmod/fkinsol_mod.f90 @@ -101,9 +101,7 @@ module fkinsol_mod public :: FKINSetErrHandlerFn public :: FKINSetErrFile public :: FKINSetInfoHandlerFn - public :: FKINSetInfoFile public :: FKINSetPrintLevel - public :: FKINSetDebugFile public :: FKINGetWorkSpace public :: FKINGetNumNonlinSolvIters public :: FKINGetNumFuncEvals @@ -440,15 +438,6 @@ function swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) & integer(C_INT) :: fresult end function -function swigc_FKINSetInfoFile(farg1, farg2) & -bind(C, name="_wrap_FKINSetInfoFile") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINSetPrintLevel(farg1, farg2) & bind(C, name="_wrap_FKINSetPrintLevel") & result(fresult) @@ -458,15 +447,6 @@ function swigc_FKINSetPrintLevel(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FKINSetDebugFile(farg1, farg2) & -bind(C, name="_wrap_FKINSetDebugFile") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINGetWorkSpace(farg1, farg2, farg3) & bind(C, name="_wrap_FKINGetWorkSpace") & result(fresult) @@ -1283,22 +1263,6 @@ function FKINSetInfoHandlerFn(kinmem, ihfun, ih_data) & swig_result = fresult end function -function FKINSetInfoFile(kinmem, infofp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_PTR) :: infofp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = kinmem -farg2 = infofp -fresult = swigc_FKINSetInfoFile(farg1, farg2) -swig_result = fresult -end function - function FKINSetPrintLevel(kinmem, printfl) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1315,22 +1279,6 @@ function FKINSetPrintLevel(kinmem, printfl) & swig_result = fresult end function -function FKINSetDebugFile(kinmem, debugfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_PTR) :: debugfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = kinmem -farg2 = debugfp -fresult = swigc_FKINSetDebugFile(farg1, farg2) -swig_result = fresult -end function - function FKINGetWorkSpace(kinmem, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.c b/src/nvector/openmp/fmod/fnvector_openmp_mod.c index 659cce835b..d403deb446 100644 --- a/src/nvector/openmp/fmod/fnvector_openmp_mod.c +++ b/src/nvector/openmp/fmod/fnvector_openmp_mod.c @@ -946,44 +946,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector farg1, in } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_OpenMP(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_OpenMP(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_OpenMP(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_OpenMP(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_OpenMP(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_OpenMP(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_OpenMP(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 b/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 index 8518caf673..ab547e6c94 100644 --- a/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 +++ b/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 @@ -80,9 +80,6 @@ module fnvector_openmp_mod public :: FN_VEnableConstVectorArray_OpenMP public :: FN_VEnableWrmsNormVectorArray_OpenMP public :: FN_VEnableWrmsNormMaskVectorArray_OpenMP - public :: FN_VCloneVectorArray_OpenMP - public :: FN_VCloneVectorArrayEmpty_OpenMP - public :: FN_VDestroyVectorArray_OpenMP public :: FN_VGetArrayPointer_OpenMP @@ -564,31 +561,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_OpenMP(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_OpenMP") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_OpenMP") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_OpenMP") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_OpenMP(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_OpenMP") & @@ -1473,50 +1445,6 @@ function FN_VEnableWrmsNormMaskVectorArray_OpenMP(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_OpenMP(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_OpenMP(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_OpenMP(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_OpenMP(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_OpenMP(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_OpenMP(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_OpenMP(v) & result(swig_result) diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.c b/src/nvector/parallel/fmod/fnvector_parallel_mod.c index 1855376ccf..12a91f0714 100644 --- a/src/nvector/parallel/fmod/fnvector_parallel_mod.c +++ b/src/nvector/parallel/fmod/fnvector_parallel_mod.c @@ -1130,44 +1130,6 @@ SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_Parallel(N_Vector farg1, int co } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Parallel(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Parallel(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Parallel(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Parallel(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Parallel(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Parallel(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Parallel(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 b/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 index d8e7fcb23e..43fb070b88 100644 --- a/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 +++ b/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 @@ -92,9 +92,6 @@ module fnvector_parallel_mod public :: FN_VEnableWrmsNormVectorArray_Parallel public :: FN_VEnableWrmsNormMaskVectorArray_Parallel public :: FN_VEnableDotProdMultiLocal_Parallel - public :: FN_VCloneVectorArray_Parallel - public :: FN_VCloneVectorArrayEmpty_Parallel - public :: FN_VDestroyVectorArray_Parallel public :: FN_VGetArrayPointer_Parallel @@ -686,31 +683,6 @@ function swigc_FN_VEnableDotProdMultiLocal_Parallel(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Parallel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Parallel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Parallel") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Parallel(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Parallel") & @@ -1793,50 +1765,6 @@ function FN_VEnableDotProdMultiLocal_Parallel(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Parallel(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Parallel(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Parallel(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Parallel(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Parallel(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Parallel(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Parallel(v) & result(swig_result) diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c index 5e1f205c7b..933b3d5d42 100644 --- a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c +++ b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c @@ -946,44 +946,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector farg1, } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Pthreads(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Pthreads(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Pthreads(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Pthreads(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Pthreads(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Pthreads(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Pthreads(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 index 4456bf0f8a..40fac42471 100644 --- a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 +++ b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 @@ -80,9 +80,6 @@ module fnvector_pthreads_mod public :: FN_VEnableConstVectorArray_Pthreads public :: FN_VEnableWrmsNormVectorArray_Pthreads public :: FN_VEnableWrmsNormMaskVectorArray_Pthreads - public :: FN_VCloneVectorArray_Pthreads - public :: FN_VCloneVectorArrayEmpty_Pthreads - public :: FN_VDestroyVectorArray_Pthreads public :: FN_VGetArrayPointer_Pthreads @@ -564,31 +561,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_Pthreads(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Pthreads") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Pthreads") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Pthreads") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Pthreads(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Pthreads") & @@ -1473,50 +1445,6 @@ function FN_VEnableWrmsNormMaskVectorArray_Pthreads(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Pthreads(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Pthreads(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Pthreads(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Pthreads(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Pthreads(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Pthreads(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Pthreads(v) & result(swig_result) diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.c b/src/nvector/serial/fmod/fnvector_serial_mod.c index 48754ff3da..fd4aa8c1e0 100644 --- a/src/nvector/serial/fmod/fnvector_serial_mod.c +++ b/src/nvector/serial/fmod/fnvector_serial_mod.c @@ -940,44 +940,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Serial(N_Vector farg1, in } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Serial(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Serial(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Serial(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Serial(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Serial(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Serial(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Serial(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.f90 b/src/nvector/serial/fmod/fnvector_serial_mod.f90 index 97b2660ec9..8bf8ca4fd9 100644 --- a/src/nvector/serial/fmod/fnvector_serial_mod.f90 +++ b/src/nvector/serial/fmod/fnvector_serial_mod.f90 @@ -80,9 +80,6 @@ module fnvector_serial_mod public :: FN_VEnableConstVectorArray_Serial public :: FN_VEnableWrmsNormVectorArray_Serial public :: FN_VEnableWrmsNormMaskVectorArray_Serial - public :: FN_VCloneVectorArray_Serial - public :: FN_VCloneVectorArrayEmpty_Serial - public :: FN_VDestroyVectorArray_Serial public :: FN_VGetArrayPointer_Serial @@ -561,31 +558,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_Serial(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Serial") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Serial") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Serial") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Serial(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Serial") & @@ -1461,50 +1433,6 @@ function FN_VEnableWrmsNormMaskVectorArray_Serial(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Serial(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Serial(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Serial(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Serial(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Serial(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Serial(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Serial(v) & result(swig_result) diff --git a/src/sundials/fmod/fsundials_linearsolver_mod.c b/src/sundials/fmod/fsundials_linearsolver_mod.c index aaf21e5143..dde63dc63a 100644 --- a/src/sundials/fmod/fsundials_linearsolver_mod.c +++ b/src/sundials/fmod/fsundials_linearsolver_mod.c @@ -211,26 +211,6 @@ SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, } -SWIGEXPORT int _wrap_FModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { - int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - int arg3 ; - int arg4 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - int result; - - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (int)(*farg3); - arg4 = (int)(*farg4); - arg5 = (sunrealtype *)(farg5); - result = (int)ModifiedGS(arg1,arg2,arg3,arg4,arg5); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; @@ -255,30 +235,6 @@ SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, } -SWIGEXPORT int _wrap_FClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { - int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - int arg3 ; - int arg4 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; - N_Vector *arg7 = (N_Vector *) 0 ; - int result; - - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (int)(*farg3); - arg4 = (int)(*farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - arg7 = (N_Vector *)(farg7); - result = (int)ClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { int fresult ; int arg1 ; @@ -297,24 +253,6 @@ SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, in } -SWIGEXPORT int _wrap_FQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { - int fresult ; - int arg1 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - int arg4 ; - int result; - - arg1 = (int)(*farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (int)(*farg4); - result = (int)QRfact(arg1,arg2,arg3,arg4); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { int fresult ; int arg1 ; @@ -333,24 +271,6 @@ SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, dou } -SWIGEXPORT int _wrap_FQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { - int fresult ; - int arg1 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; - int result; - - arg1 = (int)(*farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (sunrealtype *)(farg4); - result = (int)QRsol(arg1,arg2,arg3,arg4); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; diff --git a/src/sundials/fmod/fsundials_linearsolver_mod.f90 b/src/sundials/fmod/fsundials_linearsolver_mod.f90 index e5fc92eb13..2c4272768e 100644 --- a/src/sundials/fmod/fsundials_linearsolver_mod.f90 +++ b/src/sundials/fmod/fsundials_linearsolver_mod.f90 @@ -18,13 +18,6 @@ module fsundials_linearsolver_mod private ! DECLARATION CONSTRUCTS - enum, bind(c) - enumerator :: PREC_NONE - enumerator :: PREC_LEFT - enumerator :: PREC_RIGHT - enumerator :: PREC_BOTH - end enum - public :: PREC_NONE, PREC_LEFT, PREC_RIGHT, PREC_BOTH enum, bind(c) enumerator :: SUN_PREC_NONE enumerator :: SUN_PREC_LEFT @@ -32,24 +25,15 @@ module fsundials_linearsolver_mod enumerator :: SUN_PREC_BOTH end enum public :: SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH - enum, bind(c) - enumerator :: MODIFIED_GS = 1 - enumerator :: CLASSICAL_GS = 2 - end enum - public :: MODIFIED_GS, CLASSICAL_GS enum, bind(c) enumerator :: SUN_MODIFIED_GS = 1 enumerator :: SUN_CLASSICAL_GS = 2 end enum public :: SUN_MODIFIED_GS, SUN_CLASSICAL_GS public :: FSUNModifiedGS - public :: FModifiedGS public :: FSUNClassicalGS - public :: FClassicalGS public :: FSUNQRfact - public :: FQRfact public :: FSUNQRsol - public :: FQRsol public :: FSUNQRAdd_MGS public :: FSUNQRAdd_ICWY public :: FSUNQRAdd_ICWY_SB @@ -170,18 +154,6 @@ function swigc_FSUNModifiedGS(farg1, farg2, farg3, farg4, farg5) & integer(C_INT) :: fresult end function -function swigc_FModifiedGS(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FModifiedGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT), intent(in) :: farg3 -integer(C_INT), intent(in) :: farg4 -type(C_PTR), value :: farg5 -integer(C_INT) :: fresult -end function - function swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & bind(C, name="_wrap_FSUNClassicalGS") & result(fresult) @@ -196,20 +168,6 @@ function swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) integer(C_INT) :: fresult end function -function swigc_FClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & -bind(C, name="_wrap_FClassicalGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT), intent(in) :: farg3 -integer(C_INT), intent(in) :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -type(C_PTR), value :: farg7 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRfact(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FSUNQRfact") & result(fresult) @@ -221,17 +179,6 @@ function swigc_FSUNQRfact(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function -function swigc_FQRfact(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FQRfact") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -integer(C_INT), intent(in) :: farg4 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRsol(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FSUNQRsol") & result(fresult) @@ -243,17 +190,6 @@ function swigc_FSUNQRsol(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function -function swigc_FQRsol(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FQRsol") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRAdd_MGS(farg1, farg2, farg3, farg4, farg5, farg6) & bind(C, name="_wrap_FSUNQRAdd_MGS") & result(fresult) @@ -511,31 +447,6 @@ function FSUNModifiedGS(v, h, k, p, new_vk_norm) & swig_result = fresult end function -function FModifiedGS(v, h, k, p, new_vk_norm) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: v -type(C_PTR), target, intent(inout) :: h -integer(C_INT), intent(in) :: k -integer(C_INT), intent(in) :: p -real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -integer(C_INT) :: farg3 -integer(C_INT) :: farg4 -type(C_PTR) :: farg5 - -farg1 = v -farg2 = c_loc(h) -farg3 = k -farg4 = p -farg5 = c_loc(new_vk_norm(1)) -fresult = swigc_FModifiedGS(farg1, farg2, farg3, farg4, farg5) -swig_result = fresult -end function - function FSUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -567,37 +478,6 @@ function FSUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & swig_result = fresult end function -function FClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: v -type(C_PTR), target, intent(inout) :: h -integer(C_INT), intent(in) :: k -integer(C_INT), intent(in) :: p -real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm -real(C_DOUBLE), dimension(*), target, intent(inout) :: stemp -type(C_PTR) :: vtemp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -integer(C_INT) :: farg3 -integer(C_INT) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 -type(C_PTR) :: farg7 - -farg1 = v -farg2 = c_loc(h) -farg3 = k -farg4 = p -farg5 = c_loc(new_vk_norm(1)) -farg6 = c_loc(stemp(1)) -farg7 = vtemp -fresult = swigc_FClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) -swig_result = fresult -end function - function FSUNQRfact(n, h, q, job) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -620,28 +500,6 @@ function FSUNQRfact(n, h, q, job) & swig_result = fresult end function -function FQRfact(n, h, q, job) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -integer(C_INT), intent(in) :: n -type(C_PTR), target, intent(inout) :: h -real(C_DOUBLE), dimension(*), target, intent(inout) :: q -integer(C_INT), intent(in) :: job -integer(C_INT) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -integer(C_INT) :: farg4 - -farg1 = n -farg2 = c_loc(h) -farg3 = c_loc(q(1)) -farg4 = job -fresult = swigc_FQRfact(farg1, farg2, farg3, farg4) -swig_result = fresult -end function - function FSUNQRsol(n, h, q, b) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -664,28 +522,6 @@ function FSUNQRsol(n, h, q, b) & swig_result = fresult end function -function FQRsol(n, h, q, b) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -integer(C_INT), intent(in) :: n -type(C_PTR), target, intent(inout) :: h -real(C_DOUBLE), dimension(*), target, intent(inout) :: q -real(C_DOUBLE), dimension(*), target, intent(inout) :: b -integer(C_INT) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 - -farg1 = n -farg2 = c_loc(h) -farg3 = c_loc(q(1)) -farg4 = c_loc(b(1)) -fresult = swigc_FQRsol(farg1, farg2, farg3, farg4) -swig_result = fresult -end function - function FSUNQRAdd_MGS(q, r, df, m, mmax, qrdata) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c index 880b808399..f2c3f51ee1 100644 --- a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c +++ b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_PCG(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_PCG(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_PCG(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_PCG(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_PCG(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 index faf98e9503..6334343b52 100644 --- a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 +++ b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_pcg_mod public :: FSUNLinSolLastFlag_PCG public :: FSUNLinSolSpace_PCG public :: FSUNLinSolFree_PCG - public :: FSUNLinSolSetInfoFile_PCG - public :: FSUNLinSolSetPrintLevel_PCG ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_PCG(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_PCG(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_PCG") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_PCG(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_PCG") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_PCG(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_PCG(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_PCG(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_PCG(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_PCG(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c index bc5daa8f6f..404d520680 100644 --- a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c +++ b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPBCGS(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPBCGS(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPBCGS(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPBCGS(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPBCGS(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 index 301bcf85d5..2159bfe002 100644 --- a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 +++ b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_spbcgs_mod public :: FSUNLinSolLastFlag_SPBCGS public :: FSUNLinSolSpace_SPBCGS public :: FSUNLinSolFree_SPBCGS - public :: FSUNLinSolSetInfoFile_SPBCGS - public :: FSUNLinSolSetPrintLevel_SPBCGS ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_SPBCGS(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPBCGS(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPBCGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPBCGS(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPBCGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_SPBCGS(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPBCGS(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPBCGS(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPBCGS(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPBCGS(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c index 4d24389307..f56328e942 100644 --- a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c +++ b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c @@ -478,32 +478,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPFGMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPFGMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPFGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPFGMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPFGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 index f62b8e6dd8..c6ed64bf5b 100644 --- a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 +++ b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 @@ -55,8 +55,6 @@ module fsunlinsol_spfgmr_mod public :: FSUNLinSolLastFlag_SPFGMR public :: FSUNLinSolSpace_SPFGMR public :: FSUNLinSolFree_SPFGMR - public :: FSUNLinSolSetInfoFile_SPFGMR - public :: FSUNLinSolSetPrintLevel_SPFGMR ! WRAPPER DECLARATIONS interface @@ -233,24 +231,6 @@ function swigc_FSUNLinSolFree_SPFGMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPFGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPFGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPFGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPFGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -566,37 +546,5 @@ function FSUNLinSolFree_SPFGMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPFGMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPFGMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPFGMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPFGMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c index 35611eb64d..2f9165a238 100644 --- a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c +++ b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c @@ -478,32 +478,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPGMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPGMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPGMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 index d185bd8d43..77873a000a 100644 --- a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 +++ b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 @@ -55,8 +55,6 @@ module fsunlinsol_spgmr_mod public :: FSUNLinSolLastFlag_SPGMR public :: FSUNLinSolSpace_SPGMR public :: FSUNLinSolFree_SPGMR - public :: FSUNLinSolSetInfoFile_SPGMR - public :: FSUNLinSolSetPrintLevel_SPGMR ! WRAPPER DECLARATIONS interface @@ -233,24 +231,6 @@ function swigc_FSUNLinSolFree_SPGMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -566,37 +546,5 @@ function FSUNLinSolFree_SPGMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPGMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPGMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPGMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPGMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c index b8def5d190..6035841980 100644 --- a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c +++ b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPTFQMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPTFQMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPTFQMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPTFQMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPTFQMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 index 5f3b43ecf2..c4d9abe539 100644 --- a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 +++ b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_sptfqmr_mod public :: FSUNLinSolLastFlag_SPTFQMR public :: FSUNLinSolSpace_SPTFQMR public :: FSUNLinSolFree_SPTFQMR - public :: FSUNLinSolSetInfoFile_SPTFQMR - public :: FSUNLinSolSetPrintLevel_SPTFQMR ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_SPTFQMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPTFQMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPTFQMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPTFQMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPTFQMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_SPTFQMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPTFQMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPTFQMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPTFQMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPTFQMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c index 86714082dc..d200856483 100644 --- a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c +++ b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c @@ -416,32 +416,4 @@ SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_FixedPoint(SUNNonlinearSolver farg1, } -SWIGEXPORT int _wrap_FSUNNonlinSolSetInfoFile_FixedPoint(SUNNonlinearSolver farg1, void *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNNonlinSolSetInfoFile_FixedPoint(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNNonlinSolSetPrintLevel_FixedPoint(SUNNonlinearSolver farg1, int const *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNNonlinSolSetPrintLevel_FixedPoint(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 index 4b7cf6dfcb..a1b693a285 100644 --- a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 +++ b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 @@ -45,8 +45,6 @@ module fsunnonlinsol_fixedpoint_mod public :: FSUNNonlinSolGetCurIter_FixedPoint public :: FSUNNonlinSolGetNumConvFails_FixedPoint public :: FSUNNonlinSolGetSysFn_FixedPoint - public :: FSUNNonlinSolSetInfoFile_FixedPoint - public :: FSUNNonlinSolSetPrintLevel_FixedPoint ! WRAPPER DECLARATIONS interface @@ -182,24 +180,6 @@ function swigc_FSUNNonlinSolGetSysFn_FixedPoint(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNNonlinSolSetInfoFile_FixedPoint(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetInfoFile_FixedPoint") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNNonlinSolSetPrintLevel_FixedPoint(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetPrintLevel_FixedPoint") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -447,37 +427,5 @@ function FSUNNonlinSolGetSysFn_FixedPoint(nls, sysfn) & swig_result = fresult end function -function FSUNNonlinSolSetInfoFile_FixedPoint(nls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(nls) -farg2 = info_file -fresult = swigc_FSUNNonlinSolSetInfoFile_FixedPoint(farg1, farg2) -swig_result = fresult -end function - -function FSUNNonlinSolSetPrintLevel_FixedPoint(nls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(nls) -farg2 = print_level -fresult = swigc_FSUNNonlinSolSetPrintLevel_FixedPoint(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c index 78c2e36aef..94d12cb79b 100644 --- a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c +++ b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c @@ -426,32 +426,4 @@ SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver farg1, void } -SWIGEXPORT int _wrap_FSUNNonlinSolSetInfoFile_Newton(SUNNonlinearSolver farg1, void *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNNonlinSolSetInfoFile_Newton(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNNonlinSolSetPrintLevel_Newton(SUNNonlinearSolver farg1, int const *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNNonlinSolSetPrintLevel_Newton(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 index 52fb84ca61..634bc969c0 100644 --- a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 +++ b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 @@ -46,8 +46,6 @@ module fsunnonlinsol_newton_mod public :: FSUNNonlinSolGetCurIter_Newton public :: FSUNNonlinSolGetNumConvFails_Newton public :: FSUNNonlinSolGetSysFn_Newton - public :: FSUNNonlinSolSetInfoFile_Newton - public :: FSUNNonlinSolSetPrintLevel_Newton ! WRAPPER DECLARATIONS interface @@ -190,24 +188,6 @@ function swigc_FSUNNonlinSolGetSysFn_Newton(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNNonlinSolSetInfoFile_Newton(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetInfoFile_Newton") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNNonlinSolSetPrintLevel_Newton(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetPrintLevel_Newton") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -465,37 +445,5 @@ function FSUNNonlinSolGetSysFn_Newton(nls, sysfn) & swig_result = fresult end function -function FSUNNonlinSolSetInfoFile_Newton(nls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(nls) -farg2 = info_file -fresult = swigc_FSUNNonlinSolSetInfoFile_Newton(farg1, farg2) -swig_result = fresult -end function - -function FSUNNonlinSolSetPrintLevel_Newton(nls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(nls) -farg2 = print_level -fresult = swigc_FSUNNonlinSolSetPrintLevel_Newton(farg1, farg2) -swig_result = fresult -end function - end module From e70954df52f93b20331047eaf3cb72e0ce8e0bbb Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:51:44 -0700 Subject: [PATCH 13/85] update swig --- src/kinsol/fmod/fkinsol_mod.c | 28 --- src/kinsol/fmod/fkinsol_mod.f90 | 52 ------ src/nvector/openmp/fmod/fnvector_openmp_mod.c | 38 ---- .../openmp/fmod/fnvector_openmp_mod.f90 | 72 -------- .../parallel/fmod/fnvector_parallel_mod.c | 38 ---- .../parallel/fmod/fnvector_parallel_mod.f90 | 72 -------- .../pthreads/fmod/fnvector_pthreads_mod.c | 38 ---- .../pthreads/fmod/fnvector_pthreads_mod.f90 | 72 -------- src/nvector/serial/fmod/fnvector_serial_mod.c | 38 ---- .../serial/fmod/fnvector_serial_mod.f90 | 72 -------- .../fmod/fsundials_linearsolver_mod.c | 80 --------- .../fmod/fsundials_linearsolver_mod.f90 | 164 ------------------ src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c | 28 --- src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 | 52 ------ .../spbcgs/fmod/fsunlinsol_spbcgs_mod.c | 28 --- .../spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 | 52 ------ .../spfgmr/fmod/fsunlinsol_spfgmr_mod.c | 28 --- .../spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 | 52 ------ .../spgmr/fmod/fsunlinsol_spgmr_mod.c | 28 --- .../spgmr/fmod/fsunlinsol_spgmr_mod.f90 | 52 ------ .../sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c | 28 --- .../sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 | 52 ------ .../fmod/fsunnonlinsol_fixedpoint_mod.c | 28 --- .../fmod/fsunnonlinsol_fixedpoint_mod.f90 | 52 ------ .../newton/fmod/fsunnonlinsol_newton_mod.c | 28 --- .../newton/fmod/fsunnonlinsol_newton_mod.f90 | 52 ------ 26 files changed, 1324 deletions(-) diff --git a/src/kinsol/fmod/fkinsol_mod.c b/src/kinsol/fmod/fkinsol_mod.c index 29e070fbb6..2836479531 100644 --- a/src/kinsol/fmod/fkinsol_mod.c +++ b/src/kinsol/fmod/fkinsol_mod.c @@ -683,20 +683,6 @@ SWIGEXPORT int _wrap_FKINSetInfoHandlerFn(void *farg1, KINInfoHandlerFn farg2, v } -SWIGEXPORT int _wrap_FKINSetInfoFile(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)KINSetInfoFile(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -711,20 +697,6 @@ SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { } -SWIGEXPORT int _wrap_FKINSetDebugFile(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)KINSetDebugFile(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINGetWorkSpace(void *farg1, long *farg2, long *farg3) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/kinsol/fmod/fkinsol_mod.f90 b/src/kinsol/fmod/fkinsol_mod.f90 index c60ae37fb3..4928d79822 100644 --- a/src/kinsol/fmod/fkinsol_mod.f90 +++ b/src/kinsol/fmod/fkinsol_mod.f90 @@ -101,9 +101,7 @@ module fkinsol_mod public :: FKINSetErrHandlerFn public :: FKINSetErrFile public :: FKINSetInfoHandlerFn - public :: FKINSetInfoFile public :: FKINSetPrintLevel - public :: FKINSetDebugFile public :: FKINGetWorkSpace public :: FKINGetNumNonlinSolvIters public :: FKINGetNumFuncEvals @@ -440,15 +438,6 @@ function swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) & integer(C_INT) :: fresult end function -function swigc_FKINSetInfoFile(farg1, farg2) & -bind(C, name="_wrap_FKINSetInfoFile") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINSetPrintLevel(farg1, farg2) & bind(C, name="_wrap_FKINSetPrintLevel") & result(fresult) @@ -458,15 +447,6 @@ function swigc_FKINSetPrintLevel(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FKINSetDebugFile(farg1, farg2) & -bind(C, name="_wrap_FKINSetDebugFile") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINGetWorkSpace(farg1, farg2, farg3) & bind(C, name="_wrap_FKINGetWorkSpace") & result(fresult) @@ -1283,22 +1263,6 @@ function FKINSetInfoHandlerFn(kinmem, ihfun, ih_data) & swig_result = fresult end function -function FKINSetInfoFile(kinmem, infofp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_PTR) :: infofp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = kinmem -farg2 = infofp -fresult = swigc_FKINSetInfoFile(farg1, farg2) -swig_result = fresult -end function - function FKINSetPrintLevel(kinmem, printfl) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1315,22 +1279,6 @@ function FKINSetPrintLevel(kinmem, printfl) & swig_result = fresult end function -function FKINSetDebugFile(kinmem, debugfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_PTR) :: debugfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = kinmem -farg2 = debugfp -fresult = swigc_FKINSetDebugFile(farg1, farg2) -swig_result = fresult -end function - function FKINGetWorkSpace(kinmem, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.c b/src/nvector/openmp/fmod/fnvector_openmp_mod.c index 4216804206..91edfc2791 100644 --- a/src/nvector/openmp/fmod/fnvector_openmp_mod.c +++ b/src/nvector/openmp/fmod/fnvector_openmp_mod.c @@ -946,44 +946,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector farg1, in } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_OpenMP(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_OpenMP(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_OpenMP(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_OpenMP(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_OpenMP(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_OpenMP(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_OpenMP(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 b/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 index 8518caf673..ab547e6c94 100644 --- a/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 +++ b/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 @@ -80,9 +80,6 @@ module fnvector_openmp_mod public :: FN_VEnableConstVectorArray_OpenMP public :: FN_VEnableWrmsNormVectorArray_OpenMP public :: FN_VEnableWrmsNormMaskVectorArray_OpenMP - public :: FN_VCloneVectorArray_OpenMP - public :: FN_VCloneVectorArrayEmpty_OpenMP - public :: FN_VDestroyVectorArray_OpenMP public :: FN_VGetArrayPointer_OpenMP @@ -564,31 +561,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_OpenMP(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_OpenMP") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_OpenMP") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_OpenMP") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_OpenMP(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_OpenMP") & @@ -1473,50 +1445,6 @@ function FN_VEnableWrmsNormMaskVectorArray_OpenMP(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_OpenMP(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_OpenMP(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_OpenMP(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_OpenMP(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_OpenMP(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_OpenMP(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_OpenMP(v) & result(swig_result) diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.c b/src/nvector/parallel/fmod/fnvector_parallel_mod.c index cc4244981e..c2668e3c4c 100644 --- a/src/nvector/parallel/fmod/fnvector_parallel_mod.c +++ b/src/nvector/parallel/fmod/fnvector_parallel_mod.c @@ -1130,44 +1130,6 @@ SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_Parallel(N_Vector farg1, int co } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Parallel(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Parallel(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Parallel(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Parallel(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Parallel(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Parallel(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Parallel(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 b/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 index d8e7fcb23e..43fb070b88 100644 --- a/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 +++ b/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 @@ -92,9 +92,6 @@ module fnvector_parallel_mod public :: FN_VEnableWrmsNormVectorArray_Parallel public :: FN_VEnableWrmsNormMaskVectorArray_Parallel public :: FN_VEnableDotProdMultiLocal_Parallel - public :: FN_VCloneVectorArray_Parallel - public :: FN_VCloneVectorArrayEmpty_Parallel - public :: FN_VDestroyVectorArray_Parallel public :: FN_VGetArrayPointer_Parallel @@ -686,31 +683,6 @@ function swigc_FN_VEnableDotProdMultiLocal_Parallel(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Parallel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Parallel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Parallel") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Parallel(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Parallel") & @@ -1793,50 +1765,6 @@ function FN_VEnableDotProdMultiLocal_Parallel(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Parallel(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Parallel(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Parallel(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Parallel(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Parallel(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Parallel(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Parallel(v) & result(swig_result) diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c index d34088af42..73c8ca0c51 100644 --- a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c +++ b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c @@ -946,44 +946,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector farg1, } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Pthreads(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Pthreads(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Pthreads(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Pthreads(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Pthreads(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Pthreads(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Pthreads(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 index 4456bf0f8a..40fac42471 100644 --- a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 +++ b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 @@ -80,9 +80,6 @@ module fnvector_pthreads_mod public :: FN_VEnableConstVectorArray_Pthreads public :: FN_VEnableWrmsNormVectorArray_Pthreads public :: FN_VEnableWrmsNormMaskVectorArray_Pthreads - public :: FN_VCloneVectorArray_Pthreads - public :: FN_VCloneVectorArrayEmpty_Pthreads - public :: FN_VDestroyVectorArray_Pthreads public :: FN_VGetArrayPointer_Pthreads @@ -564,31 +561,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_Pthreads(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Pthreads") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Pthreads") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Pthreads") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Pthreads(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Pthreads") & @@ -1473,50 +1445,6 @@ function FN_VEnableWrmsNormMaskVectorArray_Pthreads(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Pthreads(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Pthreads(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Pthreads(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Pthreads(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Pthreads(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Pthreads(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Pthreads(v) & result(swig_result) diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.c b/src/nvector/serial/fmod/fnvector_serial_mod.c index ed9a774185..591ee2c0f7 100644 --- a/src/nvector/serial/fmod/fnvector_serial_mod.c +++ b/src/nvector/serial/fmod/fnvector_serial_mod.c @@ -940,44 +940,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Serial(N_Vector farg1, in } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Serial(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Serial(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Serial(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Serial(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Serial(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Serial(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Serial(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.f90 b/src/nvector/serial/fmod/fnvector_serial_mod.f90 index 97b2660ec9..8bf8ca4fd9 100644 --- a/src/nvector/serial/fmod/fnvector_serial_mod.f90 +++ b/src/nvector/serial/fmod/fnvector_serial_mod.f90 @@ -80,9 +80,6 @@ module fnvector_serial_mod public :: FN_VEnableConstVectorArray_Serial public :: FN_VEnableWrmsNormVectorArray_Serial public :: FN_VEnableWrmsNormMaskVectorArray_Serial - public :: FN_VCloneVectorArray_Serial - public :: FN_VCloneVectorArrayEmpty_Serial - public :: FN_VDestroyVectorArray_Serial public :: FN_VGetArrayPointer_Serial @@ -561,31 +558,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_Serial(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Serial") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Serial") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Serial") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Serial(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Serial") & @@ -1461,50 +1433,6 @@ function FN_VEnableWrmsNormMaskVectorArray_Serial(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Serial(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Serial(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Serial(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Serial(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Serial(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Serial(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Serial(v) & result(swig_result) diff --git a/src/sundials/fmod/fsundials_linearsolver_mod.c b/src/sundials/fmod/fsundials_linearsolver_mod.c index c755ea1949..9c6ed9076e 100644 --- a/src/sundials/fmod/fsundials_linearsolver_mod.c +++ b/src/sundials/fmod/fsundials_linearsolver_mod.c @@ -211,26 +211,6 @@ SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, } -SWIGEXPORT int _wrap_FModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { - int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; - int arg3 ; - int arg4 ; - realtype *arg5 = (realtype *) 0 ; - int result; - - arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); - arg3 = (int)(*farg3); - arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); - result = (int)ModifiedGS(arg1,arg2,arg3,arg4,arg5); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; @@ -255,30 +235,6 @@ SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, } -SWIGEXPORT int _wrap_FClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { - int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; - int arg3 ; - int arg4 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; - N_Vector *arg7 = (N_Vector *) 0 ; - int result; - - arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); - arg3 = (int)(*farg3); - arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); - arg7 = (N_Vector *)(farg7); - result = (int)ClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { int fresult ; int arg1 ; @@ -297,24 +253,6 @@ SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, in } -SWIGEXPORT int _wrap_FQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { - int fresult ; - int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; - int arg4 ; - int result; - - arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (int)(*farg4); - result = (int)QRfact(arg1,arg2,arg3,arg4); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { int fresult ; int arg1 ; @@ -333,24 +271,6 @@ SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, dou } -SWIGEXPORT int _wrap_FQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { - int fresult ; - int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; - realtype *arg4 = (realtype *) 0 ; - int result; - - arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (realtype *)(farg4); - result = (int)QRsol(arg1,arg2,arg3,arg4); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; diff --git a/src/sundials/fmod/fsundials_linearsolver_mod.f90 b/src/sundials/fmod/fsundials_linearsolver_mod.f90 index e5fc92eb13..2c4272768e 100644 --- a/src/sundials/fmod/fsundials_linearsolver_mod.f90 +++ b/src/sundials/fmod/fsundials_linearsolver_mod.f90 @@ -18,13 +18,6 @@ module fsundials_linearsolver_mod private ! DECLARATION CONSTRUCTS - enum, bind(c) - enumerator :: PREC_NONE - enumerator :: PREC_LEFT - enumerator :: PREC_RIGHT - enumerator :: PREC_BOTH - end enum - public :: PREC_NONE, PREC_LEFT, PREC_RIGHT, PREC_BOTH enum, bind(c) enumerator :: SUN_PREC_NONE enumerator :: SUN_PREC_LEFT @@ -32,24 +25,15 @@ module fsundials_linearsolver_mod enumerator :: SUN_PREC_BOTH end enum public :: SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH - enum, bind(c) - enumerator :: MODIFIED_GS = 1 - enumerator :: CLASSICAL_GS = 2 - end enum - public :: MODIFIED_GS, CLASSICAL_GS enum, bind(c) enumerator :: SUN_MODIFIED_GS = 1 enumerator :: SUN_CLASSICAL_GS = 2 end enum public :: SUN_MODIFIED_GS, SUN_CLASSICAL_GS public :: FSUNModifiedGS - public :: FModifiedGS public :: FSUNClassicalGS - public :: FClassicalGS public :: FSUNQRfact - public :: FQRfact public :: FSUNQRsol - public :: FQRsol public :: FSUNQRAdd_MGS public :: FSUNQRAdd_ICWY public :: FSUNQRAdd_ICWY_SB @@ -170,18 +154,6 @@ function swigc_FSUNModifiedGS(farg1, farg2, farg3, farg4, farg5) & integer(C_INT) :: fresult end function -function swigc_FModifiedGS(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FModifiedGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT), intent(in) :: farg3 -integer(C_INT), intent(in) :: farg4 -type(C_PTR), value :: farg5 -integer(C_INT) :: fresult -end function - function swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & bind(C, name="_wrap_FSUNClassicalGS") & result(fresult) @@ -196,20 +168,6 @@ function swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) integer(C_INT) :: fresult end function -function swigc_FClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & -bind(C, name="_wrap_FClassicalGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT), intent(in) :: farg3 -integer(C_INT), intent(in) :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -type(C_PTR), value :: farg7 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRfact(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FSUNQRfact") & result(fresult) @@ -221,17 +179,6 @@ function swigc_FSUNQRfact(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function -function swigc_FQRfact(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FQRfact") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -integer(C_INT), intent(in) :: farg4 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRsol(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FSUNQRsol") & result(fresult) @@ -243,17 +190,6 @@ function swigc_FSUNQRsol(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function -function swigc_FQRsol(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FQRsol") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRAdd_MGS(farg1, farg2, farg3, farg4, farg5, farg6) & bind(C, name="_wrap_FSUNQRAdd_MGS") & result(fresult) @@ -511,31 +447,6 @@ function FSUNModifiedGS(v, h, k, p, new_vk_norm) & swig_result = fresult end function -function FModifiedGS(v, h, k, p, new_vk_norm) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: v -type(C_PTR), target, intent(inout) :: h -integer(C_INT), intent(in) :: k -integer(C_INT), intent(in) :: p -real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -integer(C_INT) :: farg3 -integer(C_INT) :: farg4 -type(C_PTR) :: farg5 - -farg1 = v -farg2 = c_loc(h) -farg3 = k -farg4 = p -farg5 = c_loc(new_vk_norm(1)) -fresult = swigc_FModifiedGS(farg1, farg2, farg3, farg4, farg5) -swig_result = fresult -end function - function FSUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -567,37 +478,6 @@ function FSUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & swig_result = fresult end function -function FClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: v -type(C_PTR), target, intent(inout) :: h -integer(C_INT), intent(in) :: k -integer(C_INT), intent(in) :: p -real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm -real(C_DOUBLE), dimension(*), target, intent(inout) :: stemp -type(C_PTR) :: vtemp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -integer(C_INT) :: farg3 -integer(C_INT) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 -type(C_PTR) :: farg7 - -farg1 = v -farg2 = c_loc(h) -farg3 = k -farg4 = p -farg5 = c_loc(new_vk_norm(1)) -farg6 = c_loc(stemp(1)) -farg7 = vtemp -fresult = swigc_FClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) -swig_result = fresult -end function - function FSUNQRfact(n, h, q, job) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -620,28 +500,6 @@ function FSUNQRfact(n, h, q, job) & swig_result = fresult end function -function FQRfact(n, h, q, job) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -integer(C_INT), intent(in) :: n -type(C_PTR), target, intent(inout) :: h -real(C_DOUBLE), dimension(*), target, intent(inout) :: q -integer(C_INT), intent(in) :: job -integer(C_INT) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -integer(C_INT) :: farg4 - -farg1 = n -farg2 = c_loc(h) -farg3 = c_loc(q(1)) -farg4 = job -fresult = swigc_FQRfact(farg1, farg2, farg3, farg4) -swig_result = fresult -end function - function FSUNQRsol(n, h, q, b) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -664,28 +522,6 @@ function FSUNQRsol(n, h, q, b) & swig_result = fresult end function -function FQRsol(n, h, q, b) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -integer(C_INT), intent(in) :: n -type(C_PTR), target, intent(inout) :: h -real(C_DOUBLE), dimension(*), target, intent(inout) :: q -real(C_DOUBLE), dimension(*), target, intent(inout) :: b -integer(C_INT) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 - -farg1 = n -farg2 = c_loc(h) -farg3 = c_loc(q(1)) -farg4 = c_loc(b(1)) -fresult = swigc_FQRsol(farg1, farg2, farg3, farg4) -swig_result = fresult -end function - function FSUNQRAdd_MGS(q, r, df, m, mmax, qrdata) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c index 3bdb6ea15f..68489d3520 100644 --- a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c +++ b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_PCG(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_PCG(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_PCG(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_PCG(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_PCG(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 index faf98e9503..6334343b52 100644 --- a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 +++ b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_pcg_mod public :: FSUNLinSolLastFlag_PCG public :: FSUNLinSolSpace_PCG public :: FSUNLinSolFree_PCG - public :: FSUNLinSolSetInfoFile_PCG - public :: FSUNLinSolSetPrintLevel_PCG ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_PCG(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_PCG(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_PCG") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_PCG(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_PCG") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_PCG(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_PCG(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_PCG(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_PCG(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_PCG(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c index 1d58f0c9b1..e6e3e56704 100644 --- a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c +++ b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPBCGS(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPBCGS(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPBCGS(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPBCGS(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPBCGS(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 index 301bcf85d5..2159bfe002 100644 --- a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 +++ b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_spbcgs_mod public :: FSUNLinSolLastFlag_SPBCGS public :: FSUNLinSolSpace_SPBCGS public :: FSUNLinSolFree_SPBCGS - public :: FSUNLinSolSetInfoFile_SPBCGS - public :: FSUNLinSolSetPrintLevel_SPBCGS ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_SPBCGS(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPBCGS(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPBCGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPBCGS(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPBCGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_SPBCGS(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPBCGS(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPBCGS(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPBCGS(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPBCGS(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c index 8332d7967a..69904ab23d 100644 --- a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c +++ b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c @@ -478,32 +478,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPFGMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPFGMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPFGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPFGMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPFGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 index f62b8e6dd8..c6ed64bf5b 100644 --- a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 +++ b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 @@ -55,8 +55,6 @@ module fsunlinsol_spfgmr_mod public :: FSUNLinSolLastFlag_SPFGMR public :: FSUNLinSolSpace_SPFGMR public :: FSUNLinSolFree_SPFGMR - public :: FSUNLinSolSetInfoFile_SPFGMR - public :: FSUNLinSolSetPrintLevel_SPFGMR ! WRAPPER DECLARATIONS interface @@ -233,24 +231,6 @@ function swigc_FSUNLinSolFree_SPFGMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPFGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPFGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPFGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPFGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -566,37 +546,5 @@ function FSUNLinSolFree_SPFGMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPFGMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPFGMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPFGMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPFGMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c index eec1e72e4a..eaa89837b1 100644 --- a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c +++ b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c @@ -478,32 +478,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPGMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPGMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPGMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 index d185bd8d43..77873a000a 100644 --- a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 +++ b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 @@ -55,8 +55,6 @@ module fsunlinsol_spgmr_mod public :: FSUNLinSolLastFlag_SPGMR public :: FSUNLinSolSpace_SPGMR public :: FSUNLinSolFree_SPGMR - public :: FSUNLinSolSetInfoFile_SPGMR - public :: FSUNLinSolSetPrintLevel_SPGMR ! WRAPPER DECLARATIONS interface @@ -233,24 +231,6 @@ function swigc_FSUNLinSolFree_SPGMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -566,37 +546,5 @@ function FSUNLinSolFree_SPGMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPGMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPGMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPGMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPGMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c index ebc9c85d8b..9a46dee3a2 100644 --- a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c +++ b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPTFQMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPTFQMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPTFQMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPTFQMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPTFQMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 index 5f3b43ecf2..c4d9abe539 100644 --- a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 +++ b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_sptfqmr_mod public :: FSUNLinSolLastFlag_SPTFQMR public :: FSUNLinSolSpace_SPTFQMR public :: FSUNLinSolFree_SPTFQMR - public :: FSUNLinSolSetInfoFile_SPTFQMR - public :: FSUNLinSolSetPrintLevel_SPTFQMR ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_SPTFQMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPTFQMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPTFQMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPTFQMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPTFQMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_SPTFQMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPTFQMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPTFQMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPTFQMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPTFQMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c index 905b285380..3afafbe18c 100644 --- a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c +++ b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c @@ -416,32 +416,4 @@ SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_FixedPoint(SUNNonlinearSolver farg1, } -SWIGEXPORT int _wrap_FSUNNonlinSolSetInfoFile_FixedPoint(SUNNonlinearSolver farg1, void *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNNonlinSolSetInfoFile_FixedPoint(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNNonlinSolSetPrintLevel_FixedPoint(SUNNonlinearSolver farg1, int const *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNNonlinSolSetPrintLevel_FixedPoint(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 index 4b7cf6dfcb..a1b693a285 100644 --- a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 +++ b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 @@ -45,8 +45,6 @@ module fsunnonlinsol_fixedpoint_mod public :: FSUNNonlinSolGetCurIter_FixedPoint public :: FSUNNonlinSolGetNumConvFails_FixedPoint public :: FSUNNonlinSolGetSysFn_FixedPoint - public :: FSUNNonlinSolSetInfoFile_FixedPoint - public :: FSUNNonlinSolSetPrintLevel_FixedPoint ! WRAPPER DECLARATIONS interface @@ -182,24 +180,6 @@ function swigc_FSUNNonlinSolGetSysFn_FixedPoint(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNNonlinSolSetInfoFile_FixedPoint(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetInfoFile_FixedPoint") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNNonlinSolSetPrintLevel_FixedPoint(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetPrintLevel_FixedPoint") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -447,37 +427,5 @@ function FSUNNonlinSolGetSysFn_FixedPoint(nls, sysfn) & swig_result = fresult end function -function FSUNNonlinSolSetInfoFile_FixedPoint(nls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(nls) -farg2 = info_file -fresult = swigc_FSUNNonlinSolSetInfoFile_FixedPoint(farg1, farg2) -swig_result = fresult -end function - -function FSUNNonlinSolSetPrintLevel_FixedPoint(nls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(nls) -farg2 = print_level -fresult = swigc_FSUNNonlinSolSetPrintLevel_FixedPoint(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c index ae1c387991..fc17b3040e 100644 --- a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c +++ b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c @@ -426,32 +426,4 @@ SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver farg1, void } -SWIGEXPORT int _wrap_FSUNNonlinSolSetInfoFile_Newton(SUNNonlinearSolver farg1, void *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNNonlinSolSetInfoFile_Newton(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNNonlinSolSetPrintLevel_Newton(SUNNonlinearSolver farg1, int const *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNNonlinSolSetPrintLevel_Newton(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 index 52fb84ca61..634bc969c0 100644 --- a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 +++ b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 @@ -46,8 +46,6 @@ module fsunnonlinsol_newton_mod public :: FSUNNonlinSolGetCurIter_Newton public :: FSUNNonlinSolGetNumConvFails_Newton public :: FSUNNonlinSolGetSysFn_Newton - public :: FSUNNonlinSolSetInfoFile_Newton - public :: FSUNNonlinSolSetPrintLevel_Newton ! WRAPPER DECLARATIONS interface @@ -190,24 +188,6 @@ function swigc_FSUNNonlinSolGetSysFn_Newton(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNNonlinSolSetInfoFile_Newton(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetInfoFile_Newton") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNNonlinSolSetPrintLevel_Newton(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetPrintLevel_Newton") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -465,37 +445,5 @@ function FSUNNonlinSolGetSysFn_Newton(nls, sysfn) & swig_result = fresult end function -function FSUNNonlinSolSetInfoFile_Newton(nls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(nls) -farg2 = info_file -fresult = swigc_FSUNNonlinSolSetInfoFile_Newton(farg1, farg2) -swig_result = fresult -end function - -function FSUNNonlinSolSetPrintLevel_Newton(nls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(nls) -farg2 = print_level -fresult = swigc_FSUNNonlinSolSetPrintLevel_Newton(farg1, farg2) -swig_result = fresult -end function - end module From bde381129369630c626b2d82969517ac53f8308e Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 27 Oct 2023 11:01:05 -0700 Subject: [PATCH 14/85] Apply suggestions from code review Co-authored-by: Daniel R. Reynolds --- examples/kinsol/serial/kinAnalytic_fp.c | 4 ---- examples/kinsol/serial/kinLaplace_picard_kry.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/examples/kinsol/serial/kinAnalytic_fp.c b/examples/kinsol/serial/kinAnalytic_fp.c index c635dcb520..fb3dbe2106 100644 --- a/examples/kinsol/serial/kinAnalytic_fp.c +++ b/examples/kinsol/serial/kinAnalytic_fp.c @@ -231,11 +231,7 @@ int main(int argc, char *argv[]) infofp = fopen("kinsol.log", "w"); if (check_retval((void *)infofp, "fopen", 0)) return(1); - // retval = KINSetInfoFile(kmem, infofp); - // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - // retval = KINSetPrintLevel(kmem, 1); - // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ------------- * Initial guess diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index 9122e8b0ef..7edd10866b 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -144,11 +144,7 @@ int main() infofp = fopen("KINSOL.log", "w"); - // retval = KINSetInfoFile(kmem, infofp); - // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - // retval = KINSetPrintLevel(kmem, 3); - // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ---------------------- * Create SUNLinearSolver From f96e164f0f7407e8769f924c4eab76da6e654efe Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 27 Oct 2023 15:43:04 -0700 Subject: [PATCH 15/85] Feature: Fortran interface for lapack dense solver (#353) Added Fortran support for the LAPACK dense SUNLinearSolver implementation. --------- Co-authored-by: Daniel R. Reynolds --- CHANGELOG.md | 3 + doc/arkode/guide/source/Introduction.rst | 3 + doc/cvode/guide/source/Introduction.rst | 2 + doc/cvodes/guide/source/Introduction.rst | 2 + doc/ida/guide/source/Introduction.rst | 2 + doc/idas/guide/source/Introduction.rst | 2 + doc/kinsol/guide/source/Introduction.rst | 2 + examples/sunlinsol/lapackdense/CMakeLists.txt | 56 +++ .../test_fsunlinsol_lapackdense_mod.f90 | 185 ++++++++++ scripts/shared | 4 + src/sunlinsol/lapackdense/CMakeLists.txt | 5 + src/sunlinsol/lapackdense/fmod/CMakeLists.txt | 32 ++ .../fmod/fsunlinsol_lapackdense_mod.c | 337 ++++++++++++++++++ .../fmod/fsunlinsol_lapackdense_mod.f90 | 280 +++++++++++++++ swig/Makefile | 2 +- swig/sunlinsol/fsunlinsol_lapackdense_mod.i | 31 ++ 16 files changed, 947 insertions(+), 1 deletion(-) create mode 100644 examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 create mode 100644 src/sunlinsol/lapackdense/fmod/CMakeLists.txt create mode 100644 src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c create mode 100644 src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 create mode 100644 swig/sunlinsol/fsunlinsol_lapackdense_mod.i diff --git a/CHANGELOG.md b/CHANGELOG.md index cf25b99bf6..b766f5c334 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,11 +27,14 @@ Fixed scaling bug in `SUNMatScaleAddI_Sparse` for non-square matrices. Fixed missing soversions in some `SUNLinearSolver` and `SUNNonlinearSolver` CMake targets. +Added Fortran support for the LAPACK dense `SUNLinearSolver` implementations. + Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. Added the fourth order ERK method `ARKODE_SOFRONIOU_SPALETTA_5_3_4`. + ## Changes to SUNDIALS in release 6.6.1 Updated the Tpetra NVector interface to support Trilinos 14. diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 7fbe137950..c33aca7415 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -156,8 +156,11 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` CMake targets. +Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. + Added the fourth order ERK method ``ARKODE_SOFRONIOU_SPALETTA_5_3_4``. + Changes in v5.6.1 ----------------- diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index b28e54a07a..7a175c0ca0 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -129,6 +129,8 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` CMake targets. +Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. + Changes in v6.6.1 ----------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 567c0b0284..bb561ccca5 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -132,6 +132,8 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` CMake targets. +Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. + Changes in v6.6.1 ----------------- diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 5fae985f15..9f54d64a68 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -90,6 +90,8 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` CMake targets. +Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. + Changes in v6.6.1 ----------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 4d1d3b3c4c..0073960dc2 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -107,6 +107,8 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` CMake targets. +Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. + Changes in v5.6.1 ----------------- diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index d91d300fbb..ee33d5a33a 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -102,6 +102,8 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` CMake targets. +Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. + Changes in v6.6.1 ----------------- diff --git a/examples/sunlinsol/lapackdense/CMakeLists.txt b/examples/sunlinsol/lapackdense/CMakeLists.txt index ef9b00cf55..eb5ef45b0a 100644 --- a/examples/sunlinsol/lapackdense/CMakeLists.txt +++ b/examples/sunlinsol/lapackdense/CMakeLists.txt @@ -30,6 +30,16 @@ set(sunlinsol_lapackdense_dependencies test_sunlinsol ) +# If building F2003 tests +if (BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_lapackdense_fortran_examples + "test_fsunlinsol_lapackdense_mod\;10 0 0\;" + "test_fsunlinsol_lapackdense_mod\;100 0 0\;" + "test_fsunlinsol_lapackdense_mod\;500 0 0\;" + "test_fsunlinsol_lapackdense_mod\;1000 0 0\;" + ) +endif() + # Add source directory to include directories include_directories(. ..) @@ -82,6 +92,52 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) endforeach(example_tuple ${sunlinsol_lapackdense_examples}) +# Add the build and install targets for each example +foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_args) + list(GET example_tuple 2 example_type) + + # check if this example has already been added, only need to add + # example source files once for testing with different inputs + if(NOT TARGET ${example}) + # example source files + add_executable(${example} ${example}.f90 + ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) + + # folder to organize targets in an IDE + set_target_properties(${example} PROPERTIES FOLDER "Examples") + + # set fortran module directory to avoid name collisions + set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + + # libraries to link against + target_link_libraries(${example} + sundials_nvecserial + sundials_fnvecserial_mod + sundials_sunlinsollapackdense + sundials_fsunlinsollapackdense_mod + ${EXE_EXTRA_LINK_LIBS}) + + # check if example args are provided and set the test name + if("${example_args}" STREQUAL "") + set(test_name ${example}) + else() + string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) + endif() + + # add example to regression tests + sundials_add_test(${test_name} ${example} + TEST_ARGS ${example_args} + EXAMPLE_TYPE ${example_type} + NODIFF) + endif() + +endforeach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) + if(EXAMPLES_INSTALL) diff --git a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 new file mode 100644 index 0000000000..797c77ced5 --- /dev/null +++ b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 @@ -0,0 +1,185 @@ +! ----------------------------------------------------------------- +! Programmer(s): Daniel R. Reynolds @ SMU +! ----------------------------------------------------------------- +! SUNDIALS Copyright Start +! Copyright (c) 2002-2023, 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 file tests the Fortran 2003 interface to the SUNDIALS +! LAPACK-Dense SUNLinearSolver implementation. +! ----------------------------------------------------------------- + +module test_fsunlinsol_lapackdense + use, intrinsic :: iso_c_binding + use test_utilities + implicit none + + integer(C_LONG), private, parameter :: N = 100 + +contains + + integer(C_INT) function unit_tests() result(fails) + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + use fsundials_matrix_mod + use fsundials_linearsolver_mod + use fnvector_serial_mod + use fsunmatrix_dense_mod + use fsunlinsol_lapackdense_mod + use test_sunlinsol + + implicit none + + type(SUNLinearSolver), pointer :: LS ! test linear solver + type(SUNMatrix), pointer :: A, I ! test matrices + type(N_Vector), pointer :: x, b ! test vectors + real(C_DOUBLE), pointer :: colj(:), colIj(:) ! matrix column data + real(C_DOUBLE), pointer :: xdata(:) ! x vector data + real(C_DOUBLE) :: tmpr ! temporary real value + integer(C_LONG) :: j, k + integer(C_INT) :: tmp + + fails = 0 + + A => FSUNDenseMatrix(N, N, sunctx) + I => FSUNDenseMatrix(N, N, sunctx) + x => FN_VNew_Serial(N, sunctx) + b => FN_VNew_Serial(N, sunctx) + + ! fill A matrix with uniform random data in [0, 1/N) + do j=1, N + colj => FSUNDenseMatrix_Column(A, j-1) + do k=1, N + call random_number(tmpr) + colj(k) = tmpr / N + end do + end do + + ! create anti-identity matrix + j = N + do k=1, N + colj => FSUNDenseMatrix_Column(I, j-1) + colj(k) = ONE + j = j-1 + end do + + ! add anti-identity to ensure the solver needs to do row-swapping + do k=1, N + do j=1, N + colj => FSUNDenseMatrix_Column(A, j-1) + colIj => FSUNDenseMatrix_Column(I, j-1) + colj(k) = colj(k) + colIj(k) + end do + end do + + ! fill x vector with uniform random data in [0, 1) + xdata => FN_VGetArrayPointer(x) + do j=1, N + call random_number(tmpr) + xdata(j) = tmpr + end do + + ! create RHS vector for linear solve + fails = FSUNMatMatvec(A, x, b) + if (fails /= 0) then + call FSUNMatDestroy(A) + call FSUNMatDestroy(I) + call FN_VDestroy(x) + call FN_VDestroy(b) + return + end if + + ! create dense linear solver + LS => FSUNLinSol_LapackDense(x, A, sunctx) + + ! run tests + fails = fails + Test_FSUNLinSolInitialize(LS, 0) + fails = fails + Test_FSUNLinSolSetup(LS, A, 0) + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, 0) + + fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0) + fails = fails + Test_FSUNLinSolLastFlag(LS, 0) + fails = fails + Test_FSUNLinSolSpace(LS, 0) + + ! cleanup + tmp = FSUNLinSolFree(LS) + call FSUNMatDestroy(A) + call FSUNMatDestroy(I) + call FN_VDestroy(x) + call FN_VDestroy(b) + + end function unit_tests + +end module + +integer(C_INT) function check_vector(X, Y, tol) result(failure) + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + use test_utilities + + implicit none + type(N_Vector) :: x, y + real(C_DOUBLE) :: tol, maxerr + integer(C_LONG) :: i, xlen, ylen + real(C_DOUBLE), pointer :: xdata(:), ydata(:) + + failure = 0 + + xdata => FN_VGetArrayPointer(x) + ydata => FN_VGetArrayPointer(y) + + xlen = FN_VGetLength(x) + ylen = FN_VGetLength(y) + + if (xlen /= ylen) then + print *, 'FAIL: check_vector: different data array lengths' + failure = 1 + return + end if + + do i = 1, xlen + failure = failure + FNEQTOL(xdata(i), ydata(i), tol) + end do + + if (failure > 0) then + maxerr = ZERO + do i = 1, xlen + maxerr = max(abs(xdata(i)-ydata(i))/abs(ydata(i)), maxerr) + end do + write(*,'(A,E14.7,A,E14.7,A)') & + "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", tol, ")" + end if + +end function check_vector + +program main + !======== Inclusions ========== + use, intrinsic :: iso_c_binding + use test_fsunlinsol_lapackdense + + !======== Declarations ======== + implicit none + integer(C_INT) :: fails = 0 + + !============== Introduction ============= + print *, 'LAPACK-Dense SUNLinearSolver Fortran 2003 interface test' + + call Test_Init(c_null_ptr) + + fails = unit_tests() + if (fails /= 0) then + print *, 'FAILURE: n unit tests failed' + stop 1 + else + print *,'SUCCESS: all unit tests passed' + end if + + call Test_Finalize() + +end program main diff --git a/scripts/shared b/scripts/shared index 7304bc5df8..74cb6bfbba 100755 --- a/scripts/shared +++ b/scripts/shared @@ -490,6 +490,9 @@ echo " --- Add sunlinsol/lapackdense module to $tarfile" $tar $tarfile $distrobase/src/sunlinsol/lapackdense/CMakeLists.txt $tar $tarfile $distrobase/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c +$tar $tarfile $distrobase/src/sunlinsol/lapackdense/fmod/CMakeLists.txt +$tar $tarfile $distrobase/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c +$tar $tarfile $distrobase/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 echo " --- Add sunlinsol/magmadense module to $tarfile" @@ -713,6 +716,7 @@ $tar $tarfile $distrobase/examples/sunlinsol/kokkos/CMakeLists.txt $tar $tarfile $distrobase/examples/sunlinsol/lapackband/test_sunlinsol_lapackband.c $tar $tarfile $distrobase/examples/sunlinsol/lapackband/CMakeLists.txt $tar $tarfile $distrobase/examples/sunlinsol/lapackdense/test_sunlinsol_lapackdense.c +$tar $tarfile $distrobase/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 $tar $tarfile $distrobase/examples/sunlinsol/lapackdense/CMakeLists.txt $tar $tarfile $distrobase/examples/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp diff --git a/src/sunlinsol/lapackdense/CMakeLists.txt b/src/sunlinsol/lapackdense/CMakeLists.txt index e52a4b6825..c03f8c896e 100644 --- a/src/sunlinsol/lapackdense/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/CMakeLists.txt @@ -37,3 +37,8 @@ sundials_add_library(sundials_sunlinsollapackdense ) message(STATUS "Added SUNLINSOL_LAPACKDENSE module") + +# Add module if F2003 interface is enabled +if(BUILD_FORTRAN_MODULE_INTERFACE) + add_subdirectory(fmod) +endif() diff --git a/src/sunlinsol/lapackdense/fmod/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod/CMakeLists.txt new file mode 100644 index 0000000000..d7b281ec71 --- /dev/null +++ b/src/sunlinsol/lapackdense/fmod/CMakeLists.txt @@ -0,0 +1,32 @@ +# ---------------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# ---------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2023, 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 +# ---------------------------------------------------------------------- +# CMakeLists.txt file for the F2003 LAPACK dense SUNLinearSolver +# object library +# ---------------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunlinsollapackdense_mod + SOURCES + fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c + OBJECT_LIBRARIES + sundials_fgeneric_mod_obj + LINK_LIBRARIES + PUBLIC sundials_fsunmatrixdense_mod + OUTPUT_NAME + sundials_fsunlinsollapackdense_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) +message(STATUS "Added SUNLINSOL_LAPACKDENSE F2003 interface") diff --git a/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c new file mode 100644 index 0000000000..2ed9147d9f --- /dev/null +++ b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c @@ -0,0 +1,337 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.0 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +/* --------------------------------------------------------------- + * Programmer(s): Auto-generated by swig. + * --------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2023, 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 section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* qualifier for exported *const* global data variables*/ +#ifndef SWIGEXTERN +# ifdef __cplusplus +# define SWIGEXTERN extern +# else +# define SWIGEXTERN +# endif +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + + +#include +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# ifndef snprintf +# define snprintf _snprintf +# endif +#endif + + +/* Support for the `contract` feature. + * + * Note that RETURNNULL is first because it's inserted via a 'Replaceall' in + * the fortran.cxx file. + */ +#define SWIG_contract_assert(RETURNNULL, EXPR, MSG) \ + if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); } + + +#define SWIGVERSION 0x040000 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include "sundials/sundials_linearsolver.h" + + +#include "sunlinsol/sunlinsol_lapackdense.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_LapackDense(N_Vector farg1, SUNMatrix farg2, void *farg3) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNLinearSolver)SUNLinSol_LapackDense(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_LapackDense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_LapackDense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolInitialize_LapackDense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_LapackDense(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_LapackDense(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_LapackDense(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + realtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (realtype)(*farg5); + result = (int)SUNLinSolSolve_LapackDense(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int64_t _wrap_FSUNLinSolLastFlag_LapackDense(SUNLinearSolver farg1) { + int64_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_LapackDense(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_LapackDense(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SUNLinSolSpace_LapackDense(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolFree_LapackDense(arg1); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 new file mode 100644 index 0000000000..a615f9ba43 --- /dev/null +++ b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 @@ -0,0 +1,280 @@ +! This file was automatically generated by SWIG (http://www.swig.org). +! Version 4.0.0 +! +! Do not make changes to this file unless you know what you are doing--modify +! the SWIG interface file instead. + +! --------------------------------------------------------------- +! Programmer(s): Auto-generated by swig. +! --------------------------------------------------------------- +! SUNDIALS Copyright Start +! Copyright (c) 2002-2023, 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 +! --------------------------------------------------------------- + +module fsunlinsol_lapackdense_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_linearsolver_mod + use fsundials_types_mod + use fsundials_context_mod + use fsundials_nvector_mod + use fsundials_context_mod + use fsundials_types_mod + use fsundials_matrix_mod + use fsundials_nvector_mod + use fsundials_context_mod + use fsundials_types_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNLinSol_LapackDense + public :: FSUNLinSolGetType_LapackDense + public :: FSUNLinSolGetID_LapackDense + public :: FSUNLinSolInitialize_LapackDense + public :: FSUNLinSolSetup_LapackDense + public :: FSUNLinSolSolve_LapackDense + public :: FSUNLinSolLastFlag_LapackDense + public :: FSUNLinSolSpace_LapackDense + public :: FSUNLinSolFree_LapackDense + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_LapackDense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSol_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolGetType_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetup_LapackDense(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSolve_LapackDense(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT64_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_LapackDense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolFree_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_LapackDense(y, a, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(y) +farg2 = c_loc(a) +farg3 = sunctx +fresult = swigc_FSUNLinSol_LapackDense(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolGetType_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetup_LapackDense(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_LapackDense(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_LapackDense(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_LapackDense(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolLastFlag_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT64_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT64_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_LapackDense(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_LapackDense(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_LapackDense(farg1) +swig_result = fresult +end function + + +end module diff --git a/swig/Makefile b/swig/Makefile index ce4f536a66..4a062e0445 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -23,7 +23,7 @@ KINSOL=fkinsol_mod GENERIC=fsundials_types_mod fsundials_nvector_mod fsundials_matrix_mod fsundials_linearsolver_mod fsundials_nonlinearsolver_mod fsundials_futils_mod fsundials_context_mod fsundials_profiler_mod fsundials_logger_mod NVECTOR=openmp pthreads serial parallel manyvector mpiplusx SUNMATRIX=band dense sparse -SUNLINSOL=band dense klu spbcgs spfgmr spgmr sptfqmr pcg +SUNLINSOL=band dense lapackdense klu spbcgs spfgmr spgmr sptfqmr pcg SUNNONLINSOL=newton fixedpoint INCLUDES=-I../include diff --git a/swig/sunlinsol/fsunlinsol_lapackdense_mod.i b/swig/sunlinsol/fsunlinsol_lapackdense_mod.i new file mode 100644 index 0000000000..8ab3d7792c --- /dev/null +++ b/swig/sunlinsol/fsunlinsol_lapackdense_mod.i @@ -0,0 +1,31 @@ +// --------------------------------------------------------------- +// Programmer: Cody J. Balos @ LLNL +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2023, 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 +// --------------------------------------------------------------- +// Swig interface file +// --------------------------------------------------------------- + +%module fsunlinsol_lapackdense_mod + +// include code common to all nvector implementations +%include "fsunlinsol.i" + +%{ +#include "sunlinsol/sunlinsol_lapackdense.h" +%} + +// sunlinsol_impl macro defines some ignore and inserts with the linear solver name appended +%sunlinsol_impl(LapackDense) + +// Process and wrap functions in the following files +%include "sunlinsol/sunlinsol_lapackdense.h" + From a21247280c95bc6e6d94d6ff8af240eaca06e93c Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" Date: Sat, 28 Oct 2023 18:59:04 -0500 Subject: [PATCH 16/85] Feature/new tables (#359) Additional embedded explicit Runge--Kutta methods to ARKODE. --------- Co-authored-by: Steven Roberts Co-authored-by: David J. Gardner --- CHANGELOG.md | 6 +- doc/arkode/guide/source/Butcher.rst | 492 ++++++++++++++---- doc/arkode/guide/source/Constants.rst | 22 + doc/arkode/guide/source/Introduction.rst | 15 +- doc/arkode/guide/source/Mathematics.rst | 13 +- .../figs/arkode/shu_osher_erk_stab_region.png | Bin 0 -> 24768 bytes .../figs/arkode/v65b_erk_stab_region.png | Bin 0 -> 24305 bytes .../figs/arkode/v76_erk_stab_region.png | Bin 0 -> 24295 bytes .../figs/arkode/v87_erk_stab_region.png | Bin 0 -> 24583 bytes .../figs/arkode/v98_erk_stab_region.png | Bin 0 -> 24583 bytes doc/shared/sundials.bib | 40 +- include/arkode/arkode_arkstep.h | 2 + include/arkode/arkode_butcher_erk.h | 7 +- include/arkode/arkode_erkstep.h | 2 + src/arkode/arkode_arkstep.c | 9 +- src/arkode/arkode_butcher_erk.def | 380 +++++++++++++- src/arkode/arkode_erkstep.c | 9 +- test/answers | 2 +- .../arkode/CXX_serial/ark_test_butcher.cpp | 4 +- .../arkode/CXX_serial/ark_test_butcher.out | 24 + 20 files changed, 900 insertions(+), 127 deletions(-) create mode 100644 doc/shared/figs/arkode/shu_osher_erk_stab_region.png create mode 100644 doc/shared/figs/arkode/v65b_erk_stab_region.png create mode 100644 doc/shared/figs/arkode/v76_erk_stab_region.png create mode 100644 doc/shared/figs/arkode/v87_erk_stab_region.png create mode 100644 doc/shared/figs/arkode/v98_erk_stab_region.png diff --git a/CHANGELOG.md b/CHANGELOG.md index b766f5c334..34c8cf9949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,11 @@ Added Fortran support for the LAPACK dense `SUNLinearSolver` implementations. Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. -Added the fourth order ERK method `ARKODE_SOFRONIOU_SPALETTA_5_3_4`. +Added the third order ERK method `ARKODE_SHU_OSHER_3_2_3`, the fourth order +ERK method `ARKODE_SOFRONIOU_SPALETTA_5_3_4`, the sixth order ERK method +`ARKODE_VERNER_9_5_6`, the seventh order ERK method `ARKODE_VERNER_10_6_7`, +the eighth order ERK method `ARKODE_VERNER_13_7_8`, and the ninth order ERK +method `ARKODE_VERNER_16_8_9`. ## Changes to SUNDIALS in release 6.6.1 diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index c9166aa55a..b9654211f5 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -297,6 +297,39 @@ method from :cite:p:`KenCarp:03`). region is outlined in blue; the embedding's region is in red. +Shu-Osher-3-2-3 +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. index:: Shu-Osher-3-2-3 ERK method + +Accessible via the constant ``ARKODE_SHU_OSHER_3_2_3`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_SHU_OSHER_3_2_3"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName`. +(from :cite:p:`ShOs:88` with embedding from :cite:p:`FCS:21`). + +.. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|ccc} + 0 & 0 & 0 & 0 \\ + 1 & 0 & 0 & 0 \\ + \frac{1}{2} & \frac{1}{4} & \frac{1}{4} & 0 \\ + \hline + 3 & \frac{1}{6} & \frac{1}{6} & \frac{2}{3} \\ + 2 & \frac{291485418878409}{1000000000000000} & \frac{291485418878409}{1000000000000000} & \frac{208514581121591}{500000000000000} + \end{array} + +.. figure:: /figs/arkode/shu_osher_erk_stab_region.png + :scale: 50 % + :align: center + + Linear stability region for the Shu-Osher method. The method's + region is outlined in blue; the embedding's region is in red. + + .. _Butcher.Knoth_Wolke: @@ -355,6 +388,7 @@ Accessible via the string ``"ARKODE_SOFRONIOU_SPALETTA_5_3_4"`` to \frac{3}{5} & -\frac{3}{20} & \frac{3}{4} & 0 & 0 & 0 \\ 1 & \frac{19}{44} & -\frac{15}{44} & \frac{10}{11} & 0 & 0 \\ 1 & \frac{11}{72} & \frac{25}{72} & \frac{25}{72} & \frac{11}{72} & 0 \\ + \hline 4 & \frac{11}{72} & \frac{25}{72} & \frac{25}{72} & \frac{11}{72} & 0 \\ 3 & \frac{1251515}{8970912} & \frac{3710105}{8970912} & \frac{2519695}{8970912} & \frac{61105}{8970912} & \frac{119041}{747576} \\ \end{array} @@ -467,21 +501,27 @@ Accessible via the string ``"ARKODE_ARK437L2SA_ERK_7_3_4"`` to This is the explicit portion of the 4th order additive method (the explicit portion of the ARK4(3)7L[2]SA method from :cite:p:`KenCarp:19`). -.. math:: +.. only:: html - \renewcommand{\arraystretch}{1.5} - \begin{array}{r|ccccccc} - 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{247}{1000} & \frac{247}{1000} & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{4276536705230}{10142255878289} & \frac{247}{4000} & \frac{2694949928731}{7487940209513} & 0 & 0 & 0 & 0 & 0 \\ - \frac{67}{200} & \frac{464650059369}{8764239774964} & \frac{878889893998}{2444806327765} & -\frac{952945855348}{12294611323341} & 0 & 0 & 0 & 0 \\ - \frac{3}{40} & \frac{476636172619}{8159180917465} & -\frac{1271469283451}{7793814740893} & -\frac{859560642026}{4356155882851} & \frac{1723805262919}{4571918432560} & 0 & 0 & 0 \\ - \frac{7}{10} & \frac{6338158500785}{11769362343261} & -\frac{4970555480458}{10924838743837} & \frac{3326578051521}{2647936831840} & -\frac{880713585975}{1841400956686} & -\frac{1428733748635}{8843423958496} & 0 & 0 \\ - 1 & \frac{760814592956}{3276306540349} & \frac{760814592956}{3276306540349} & -\frac{47223648122716}{6934462133451} & \frac{71187472546993}{9669769126921} & -\frac{13330509492149}{9695768672337} & \frac{11565764226357}{8513123442827} & 0 \\ - \hline - 4 & 0 & 0 & \frac{9164257142617}{17756377923965} & -\frac{10812980402763}{74029279521829} & \frac{1335994250573}{5691609445217} & \frac{2273837961795}{8368240463276} & \frac{247}{2000} \\ - 3 & 0 & 0 & \frac{4469248916618}{8635866897933} & -\frac{621260224600}{4094290005349} & \frac{696572312987}{2942599194819} & \frac{1532940081127}{5565293938103} & \frac{2441}{20000} - \end{array} + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|ccccccc} + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{247}{1000} & \frac{247}{1000} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{4276536705230}{10142255878289} & \frac{247}{4000} & \frac{2694949928731}{7487940209513} & 0 & 0 & 0 & 0 & 0 \\ + \frac{67}{200} & \frac{464650059369}{8764239774964} & \frac{878889893998}{2444806327765} & -\frac{952945855348}{12294611323341} & 0 & 0 & 0 & 0 \\ + \frac{3}{40} & \frac{476636172619}{8159180917465} & -\frac{1271469283451}{7793814740893} & -\frac{859560642026}{4356155882851} & \frac{1723805262919}{4571918432560} & 0 & 0 & 0 \\ + \frac{7}{10} & \frac{6338158500785}{11769362343261} & -\frac{4970555480458}{10924838743837} & \frac{3326578051521}{2647936831840} & -\frac{880713585975}{1841400956686} & -\frac{1428733748635}{8843423958496} & 0 & 0 \\ + 1 & \frac{760814592956}{3276306540349} & \frac{760814592956}{3276306540349} & -\frac{47223648122716}{6934462133451} & \frac{71187472546993}{9669769126921} & -\frac{13330509492149}{9695768672337} & \frac{11565764226357}{8513123442827} & 0 \\ + \hline + 4 & 0 & 0 & \frac{9164257142617}{17756377923965} & -\frac{10812980402763}{74029279521829} & \frac{1335994250573}{5691609445217} & \frac{2273837961795}{8368240463276} & \frac{247}{2000} \\ + 3 & 0 & 0 & \frac{4469248916618}{8635866897933} & -\frac{621260224600}{4094290005349} & \frac{696572312987}{2942599194819} & \frac{1532940081127}{5565293938103} & \frac{2441}{20000} + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. .. figure:: /figs/arkode/stab_region_34.png :scale: 50 % @@ -676,22 +716,29 @@ Accessible via the string ``"ARKODE_ARK548L2SA_ERK_8_4_5"`` to This is the explicit portion of the default 5th order additive method (the explicit portion of the ARK5(4)8L[2]SA method from :cite:p:`KenCarp:03`). -.. math:: +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cccccccc} + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{41}{100} & \frac{41}{100} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{2935347310677}{11292855782101} & \frac{367902744464}{2072280473677} & \frac{677623207551}{8224143866563} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{1426016391358}{7196633302097} & \frac{1268023523408}{10340822734521} & 0 & \frac{1029933939417}{13636558850479} & 0 & 0 & 0 & 0 & 0 \\ + \frac{92}{100} & \frac{14463281900351}{6315353703477} & 0 & \frac{66114435211212}{5879490589093} & -\frac{54053170152839}{4284798021562} & 0 & 0 & 0 & 0 \\ + \frac{24}{100} & \frac{14090043504691}{34967701212078} & 0 & \frac{15191511035443}{11219624916014} & -\frac{18461159152457}{12425892160975} & -\frac{281667163811}{9011619295870} & 0 & 0 & 0 \\ + \frac{3}{5} & \frac{19230459214898}{13134317526959} & 0 & \frac{21275331358303}{2942455364971} & -\frac{38145345988419}{4862620318723} & -\frac{1}{8} & -\frac{1}{8} & 0 & 0 \\ + 1 & -\frac{19977161125411}{11928030595625} & 0 & -\frac{40795976796054}{6384907823539} & \frac{177454434618887}{12078138498510} & \frac{782672205425}{8267701900261} & -\frac{69563011059811}{9646580694205} & \frac{7356628210526}{4942186776405} & 0 \\ + \hline + 5 & -\frac{872700587467}{9133579230613} & 0 & 0 & \frac{22348218063261}{9555858737531} & -\frac{1143369518992}{8141816002931} & -\frac{39379526789629}{19018526304540} & \frac{32727382324388}{42900044865799} & \frac{41}{200} \\ + 4 & -\frac{975461918565}{9796059967033} & 0 & 0 & \frac{78070527104295}{32432590147079} & -\frac{548382580838}{3424219808633} & -\frac{33438840321285}{15594753105479} & \frac{3629800801594}{4656183773603} & \frac{4035322873751}{18575991585200} + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. - \renewcommand{\arraystretch}{1.5} - \begin{array}{r|cccccccc} - 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{41}{100} & \frac{41}{100} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{2935347310677}{11292855782101} & \frac{367902744464}{2072280473677} & \frac{677623207551}{8224143866563} & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{1426016391358}{7196633302097} & \frac{1268023523408}{10340822734521} & 0 & \frac{1029933939417}{13636558850479} & 0 & 0 & 0 & 0 & 0 \\ - \frac{92}{100} & \frac{14463281900351}{6315353703477} & 0 & \frac{66114435211212}{5879490589093} & -\frac{54053170152839}{4284798021562} & 0 & 0 & 0 & 0 \\ - \frac{24}{100} & \frac{14090043504691}{34967701212078} & 0 & \frac{15191511035443}{11219624916014} & -\frac{18461159152457}{12425892160975} & -\frac{281667163811}{9011619295870} & 0 & 0 & 0 \\ - \frac{3}{5} & \frac{19230459214898}{13134317526959} & 0 & \frac{21275331358303}{2942455364971} & -\frac{38145345988419}{4862620318723} & -\frac{1}{8} & -\frac{1}{8} & 0 & 0 \\ - 1 & -\frac{19977161125411}{11928030595625} & 0 & -\frac{40795976796054}{6384907823539} & \frac{177454434618887}{12078138498510} & \frac{782672205425}{8267701900261} & -\frac{69563011059811}{9646580694205} & \frac{7356628210526}{4942186776405} & 0 \\ - \hline - 5 & -\frac{872700587467}{9133579230613} & 0 & 0 & \frac{22348218063261}{9555858737531} & -\frac{1143369518992}{8141816002931} & -\frac{39379526789629}{19018526304540} & \frac{32727382324388}{42900044865799} & \frac{41}{200} \\ - 4 & -\frac{975461918565}{9796059967033} & 0 & 0 & \frac{78070527104295}{32432590147079} & -\frac{548382580838}{3424219808633} & -\frac{33438840321285}{15594753105479} & \frac{3629800801594}{4656183773603} & \frac{4035322873751}{18575991585200} - \end{array} .. figure:: /figs/arkode/stab_region_9.png :scale: 50 % @@ -721,22 +768,28 @@ Accessible via the string ``"ARKODE_ARK548L2SAb_ERK_8_4_5"`` to This is the explicit portion of the 5th order ARK5(4)8L[2]SA method from :cite:p:`KenCarp:19`. -.. math:: +.. only:: html - \renewcommand{\arraystretch}{1.5} - \begin{array}{r|cccccccc} - 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{4}{9} & \frac{4}{9} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{6456083330201}{8509243623797} & \frac{1}{9} & \frac{1183333538310}{1827251437969} & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{1632083962415}{14158861528103} & \frac{895379019517}{9750411845327} & \frac{477606656805}{13473228687314} & \frac{-112564739183}{9373365219272} & 0 & 0 & 0 & 0 & 0 \\ - \frac{6365430648612}{17842476412687} & \frac{-4458043123994}{13015289567637} & \frac{-2500665203865}{9342069639922} & \frac{983347055801}{8893519644487} & \frac{2185051477207}{2551468980502} & 0 & 0 & 0 & 0 \\ - \frac{18}{25} & \frac{-167316361917}{17121522574472} & \frac{1605541814917}{7619724128744} & \frac{991021770328}{13052792161721} & \frac{2342280609577}{11279663441611} & \frac{3012424348531}{12792462456678} & 0 & 0 & 0 \\ - \frac{191}{200} & \frac{6680998715867}{14310383562358} & \frac{5029118570809}{3897454228471} & \frac{2415062538259}{6382199904604} & \frac{-3924368632305}{6964820224454} & \frac{-4331110370267}{15021686902756} & \frac{-3944303808049}{11994238218192} & 0 & 0 \\ - 1 & \frac{2193717860234}{3570523412979} & \frac{2193717860234}{3570523412979} & \frac{5952760925747}{18750164281544} & \frac{-4412967128996}{6196664114337} & \frac{4151782504231}{36106512998704} & \frac{572599549169}{6265429158920} & \frac{-457874356192}{11306498036315} & 0 \\ - \hline - 5 & 0 & 0 & \frac{3517720773327}{20256071687669} & \frac{4569610470461}{17934693873752} & \frac{2819471173109}{11655438449929} & \frac{3296210113763}{10722700128969} & \frac{-1142099968913}{5710983926999} & \frac{2}{9} \\ - 4 & 0 & 0 & \frac{520639020421}{8300446712847} & \frac{4550235134915}{17827758688493} & \frac{1482366381361}{6201654941325} & \frac{5551607622171}{13911031047899} & \frac{-5266607656330}{36788968843917} & \frac{1074053359553}{5740751784926} - \end{array} + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cccccccc} + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{4}{9} & \frac{4}{9} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{6456083330201}{8509243623797} & \frac{1}{9} & \frac{1183333538310}{1827251437969} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{1632083962415}{14158861528103} & \frac{895379019517}{9750411845327} & \frac{477606656805}{13473228687314} & \frac{-112564739183}{9373365219272} & 0 & 0 & 0 & 0 & 0 \\ + \frac{6365430648612}{17842476412687} & \frac{-4458043123994}{13015289567637} & \frac{-2500665203865}{9342069639922} & \frac{983347055801}{8893519644487} & \frac{2185051477207}{2551468980502} & 0 & 0 & 0 & 0 \\ + \frac{18}{25} & \frac{-167316361917}{17121522574472} & \frac{1605541814917}{7619724128744} & \frac{991021770328}{13052792161721} & \frac{2342280609577}{11279663441611} & \frac{3012424348531}{12792462456678} & 0 & 0 & 0 \\ + \frac{191}{200} & \frac{6680998715867}{14310383562358} & \frac{5029118570809}{3897454228471} & \frac{2415062538259}{6382199904604} & \frac{-3924368632305}{6964820224454} & \frac{-4331110370267}{15021686902756} & \frac{-3944303808049}{11994238218192} & 0 & 0 \\ + 1 & \frac{2193717860234}{3570523412979} & \frac{2193717860234}{3570523412979} & \frac{5952760925747}{18750164281544} & \frac{-4412967128996}{6196664114337} & \frac{4151782504231}{36106512998704} & \frac{572599549169}{6265429158920} & \frac{-457874356192}{11306498036315} & 0 \\ + \hline + 5 & 0 & 0 & \frac{3517720773327}{20256071687669} & \frac{4569610470461}{17934693873752} & \frac{2819471173109}{11655438449929} & \frac{3296210113763}{10722700128969} & \frac{-1142099968913}{5710983926999} & \frac{2}{9} \\ + 4 & 0 & 0 & \frac{520639020421}{8300446712847} & \frac{4550235134915}{17827758688493} & \frac{1482366381361}{6201654941325} & \frac{5551607622171}{13911031047899} & \frac{-5266607656330}{36788968843917} & \frac{1074053359553}{5740751784926} + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. .. figure:: /figs/arkode/stab_region_35.png @@ -790,6 +843,107 @@ This is the default 6th order explicit method (from :cite:p:`Ver:78`). +.. _Butcher.Verner-6-5b: + +Verner-9-5-6 +^^^^^^^^^^^^^^ + +.. index:: Verner-9-5-6 ERK method + +Accessible via the constant ``ARKODE_VERNER_9_5_6`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` +or :c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_VERNER_9_5_6"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName`. +This is the 6th order explicit method IIIXb-6(5) from :cite:p:`Ver:10`. + +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|ccccccccc} + 0 & 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{3}{50} & \frac{3}{50}& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{1439}{15000} & \frac{519479}{27000000}& \frac{2070721}{27000000}& 0& 0& 0& 0& 0& 0& 0\\ + \frac{1439}{10000} & \frac{1439}{40000}& 0& \frac{4317}{40000}& 0& 0& 0& 0& 0& 0\\ + \frac{4973}{10000} & \frac{109225017611}{82828840000}& 0& -\frac{417627820623}{82828840000}& \frac{43699198143}{10353605000}& 0& 0& 0& 0& 0\\ + \frac{389}{400} & -\frac{8036815292643907349452552172369}{191934985946683241245914401600}& 0& \frac{246134619571490020064824665}{1543816496655405117602368}& -\frac{13880495956885686234074067279}{113663489566254201783474344}& \frac{755005057777788994734129}{136485922925633667082436}& 0& 0& 0& 0\\ + \frac{1999}{2000} & -\frac{1663299841566102097180506666498880934230261}{30558424506156170307020957791311384232000}& 0& \frac{130838124195285491799043628811093033}{631862949514135618861563657970240}& -\frac{3287100453856023634160618787153901962873}{20724314915376755629135711026851409200}& \frac{2771826790140332140865242520369241}{396438716042723436917079980147600}& -\frac{1799166916139193}{96743806114007800}& 0& 0& 0\\ + 1 & -\frac{832144750039369683895428386437986853923637763}{15222974550069600748763651844667619945204887}& 0& \frac{818622075710363565982285196611368750}{3936576237903728151856072395343129}& -\frac{9818985165491658464841194581385463434793741875}{61642597962658994069869370923196463581866011}& \frac{31796692141848558720425711042548134769375}{4530254033500045975557858016006308628092}& -\frac{14064542118843830075}{766928748264306853644}& -\frac{1424670304836288125}{2782839104764768088217}& 0& 0\\ + 1 & \frac{382735282417}{11129397249634}& 0& 0& \frac{5535620703125000}{21434089949505429}& \frac{13867056347656250}{32943296570459319}& \frac{626271188750}{142160006043}& -\frac{51160788125000}{289890548217}& \frac{163193540017}{946795234}& 0\\ + \hline + 6 & \frac{382735282417}{11129397249634}& 0& 0& \frac{5535620703125000}{21434089949505429}& \frac{13867056347656250}{32943296570459319}& \frac{626271188750}{142160006043}& -\frac{51160788125000}{289890548217}& \frac{163193540017}{946795234}& 0 \\ + 5 & \frac{273361583}{5567482366}& 0& 0& \frac{1964687500000}{8727630165387}& \frac{596054687500}{1269637976277}& \frac{12740367500}{15795556227}& 0& -\frac{4462730789736252634813752317}{7350663039626676022821734166}& \frac{441454562788983500}{7763730504400359099} + \end{array} + + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. + + + +.. figure:: /figs/arkode/v65b_erk_stab_region.png + :scale: 75 % + :align: center + + Linear stability region for the Verner-9-5-6 method. The method's + region is outlined in blue; the embedding's region is in red. + + + +.. _Butcher.Verner-7-6: + +Verner-10-6-7 +^^^^^^^^^^^^^^ + +.. index:: Verner-10-6-7 ERK method + +Accessible via the constant ``ARKODE_VERNER_10_6_7`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` +or :c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_VERNER_10_6_7"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName`. +This is the default 7th order explicit method (from :cite:p:`Ver:10`). + +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cccccccccc} + 0 & 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{1}{200} & \frac{1}{200}& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{49}{450} & -\frac{4361}{4050}& \frac{2401}{2025}& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{49}{300} & \frac{49}{1200}& 0& \frac{49}{400}& 0& 0& 0& 0& 0& 0& 0\\ + \frac{911}{2000} & \frac{2454451729}{3841600000}& 0& -\frac{9433712007}{3841600000}& \frac{4364554539}{1920800000}& 0& 0& 0& 0& 0& 0\\ + \frac{3480084980}{5709648941} & -\frac{6187101755456742839167388910402379177523537620}{2324599620333464857202963610201679332423082271}& 0& \frac{27569888999279458303270493567994248533230000}{2551701010245296220859455115479340650299761}& -\frac{37368161901278864592027018689858091583238040000}{4473131870960004275166624817435284159975481033}& \frac{1392547243220807196190880383038194667840000000}{1697219131380493083996999253929006193143549863}& 0& 0& 0& 0& 0\\ + \frac{221}{250} & \frac{11272026205260557297236918526339}{1857697188743815510261537500000}& 0& -\frac{48265918242888069}{1953194276993750}& \frac{26726983360888651136155661781228}{1308381343805114800955157615625}& -\frac{2090453318815827627666994432}{1096684189897834170412307919}& \frac{1148577938985388929671582486744843844943428041509}{1141532118233823914568777901158338927629837500000}& 0& 0& 0& 0\\ + \frac{37}{40} & \frac{1304457204588839386329181466225966641}{108211771565488329642169667802016000}& 0& -\frac{1990261989751005}{40001418792832}& \frac{2392691599894847687194643439066780106875}{58155654089143548047476915856270826016}& -\frac{1870932273351008733802814881998561250}{419326053051486744762255151208232123}& \frac{1043329047173803328972823866240311074041739158858792987034783181}{510851127745017966999893975119259285040213723744255237522144000}& -\frac{311918858557595100410788125}{3171569057622789618800376448}& 0& 0& 0\\ + 1 & \frac{17579784273699839132265404100877911157}{1734023495717116205617154737841023480}& 0& -\frac{18539365951217471064750}{434776548575709731377}& \frac{447448655912568142291911830292656995992000}{12511202807447096607487664209063950964109}& -\frac{65907597316483030274308429593905808000000}{15158061430635748897861852383197382130691}& \frac{273847823027445129865693702689010278588244606493753883568739168819449761}{136252034448398939768371761610231099586032870552034688235302796640584360}& \frac{694664732797172504668206847646718750}{1991875650119463976442052358853258111}& -\frac{19705319055289176355560129234220800}{72595753317320295604316217197876507}& 0& 0\\ + 1 & -\frac{511858190895337044664743508805671}{11367030248263048398341724647960}& 0& \frac{2822037469238841750}{15064746656776439}& -\frac{23523744880286194122061074624512868000}{152723005449262599342117017051789699}& \frac{10685036369693854448650967542704000000}{575558095977344459903303055137999707}& -\frac{6259648732772142303029374363607629515525848829303541906422993}{876479353814142962817551241844706205620792843316435566420120}& \frac{17380896627486168667542032602031250}{13279937889697320236613879977356033}& 0& 0& 0\\ + \hline + 7 & \frac{96762636172307789}{2051985304794103980}& 0& 0& \frac{312188947591288252500000}{1212357694274963646019729}& \frac{13550580884964304000000000000}{51686919683339547115937980629}& \frac{72367769693133178898676076432831566019684378142853445230956642801}{475600216991873963561768100160364792981629064220601844848928537580}& \frac{1619421054120605468750}{3278200730370057108183}& -\frac{66898316144057728000}{227310933007074849597}& \frac{181081444637946577}{2226845467039736466}& 0 \\ + 6 & \frac{117807213929927}{2640907728177740}& 0& 0& \frac{4758744518816629500000}{17812069906509312711137}& \frac{1730775233574080000000000}{7863520414322158392809673}& \frac{2682653613028767167314032381891560552585218935572349997}{12258338284789875762081637252125169126464880985167722660}& \frac{40977117022675781250}{178949401077111131341}& 0& 0& \frac{2152106665253777}{106040260335225546} + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. + + +.. figure:: /figs/arkode/v76_erk_stab_region.png + :scale: 75 % + :align: center + + Linear stability region for the Verner-10-6-7 method. The method's + region is outlined in blue; the embedding's region is in red. + + + .. _Butcher.Fehlberg-8-7: Fehlberg-13-7-8 @@ -837,6 +991,117 @@ This is the default 8th order explicit method (from :cite:p:`Butcher:08`). +.. _Butcher.Verner-8-7: + +Verner-13-7-8 +^^^^^^^^^^^^^^ + +.. index:: Verner-13-7-8 ERK method + +Accessible via the constant ``ARKODE_VERNER_13_7_8`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` +or :c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_VERNER_13_7_8"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName`. +This is the 8th order explicit method IIIX-8(7) from :cite:p:`Ver:10`. + + +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|ccccccccccccc} + 0 & 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{1}{20} & \frac{1}{20}& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{341}{3200} & -\frac{7161}{1024000}& \frac{116281}{1024000}& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{1023}{6400} & \frac{1023}{25600}& 0& \frac{3069}{25600}& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{39}{100} & \frac{4202367}{11628100}& 0& -\frac{3899844}{2907025}& \frac{3982992}{2907025}& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{93}{200} & \frac{5611}{114400}& 0& 0& \frac{31744}{135025}& \frac{923521}{5106400}& 0& 0& 0& 0& 0& 0& 0& 0\\ + \frac{31}{200} & \frac{21173}{343200}& 0& 0& \frac{8602624}{76559175}& -\frac{26782109}{689364000}& \frac{5611}{283500}& 0& 0& 0& 0& 0& 0& 0\\ + \frac{943}{1000} & -\frac{1221101821869329}{690812928000000}& 0& 0& -\frac{125}{2}& -\frac{1024030607959889}{168929280000000}& \frac{1501408353528689}{265697280000000}& \frac{6070139212132283}{92502016000000}& 0& 0& 0& 0& 0& 0\\ + \frac{7067558016280}{7837150160667} & -\frac{1472514264486215803881384708877264246346044433307094207829051978044531801133057155}{1246894801620032001157059621643986024803301558393487900440453636168046069686436608}& 0& 0& -\frac{5172294311085668458375175655246981230039025336933699114138315270772319372469280000}{124619381004809145897278630571215298365257079410236252921850936749076487132995191}& -\frac{12070679258469254807978936441733187949484571516120469966534514296406891652614970375}{2722031154761657221710478184531100699497284085048389015085076961673446140398628096}& \frac{780125155843893641323090552530431036567795592568497182701460674803126770111481625}{183110425412731972197889874507158786859226102980861859505241443073629143100805376}& \frac{664113122959911642134782135839106469928140328160577035357155340392950009492511875}{15178465598586248136333023107295349175279765150089078301139943253016877823170816}& \frac{10332848184452015604056836767286656859124007796970668046446015775000000}{1312703550036033648073834248740727914537972028638950165249582733679393783}& 0& 0& 0& 0& 0\\ + \frac{909}{1000} & -\frac{29055573360337415088538618442231036441314060511}{22674759891089577691327962602370597632000000000}& 0& 0& -\frac{20462749524591049105403365239069}{454251913499893469596231268750}& -\frac{180269259803172281163724663224981097}{38100922558256871086579832832000000}& \frac{21127670214172802870128286992003940810655221489}{4679473877997892906145822697976708633673728000}& \frac{318607235173649312405151265849660869927653414425413}{6714716715558965303132938072935465423910912000000}& \frac{212083202434519082281842245535894}{20022426044775672563822865371173879}& -\frac{2698404929400842518721166485087129798562269848229517793703413951226714583}{469545674913934315077000442080871141884676035902717550325616728175875000000}& 0& 0& 0& 0\\ + \frac{47}{50} & -\frac{2342659845814086836951207140065609179073838476242943917}{1358480961351056777022231400139158760857532162795520000}& 0& 0& -\frac{996286030132538159613930889652}{16353068885996164905464325675}& -\frac{26053085959256534152588089363841}{4377552804565683061011299942400}& \frac{20980822345096760292224086794978105312644533925634933539}{3775889992007550803878727839115494641972212962174156800}& \frac{890722993756379186418929622095833835264322635782294899}{13921242001395112657501941955594013822830119803764736}& \frac{161021426143124178389075121929246710833125}{10997207722131034650667041364346422894371443}& \frac{300760669768102517834232497565452434946672266195876496371874262392684852243925359864884962513}{4655443337501346455585065336604505603760824779615521285751892810315680492364106674524398280000}& -\frac{31155237437111730665923206875}{392862141594230515010338956291}& 0& 0& 0\\ + 1 & -\frac{2866556991825663971778295329101033887534912787724034363}{868226711619262703011213925016143612030669233795338240}& 0& 0& -\frac{16957088714171468676387054358954754000}{143690415119654683326368228101570221}& -\frac{4583493974484572912949314673356033540575}{451957703655250747157313034270335135744}& \frac{2346305388553404258656258473446184419154740172519949575}{256726716407895402892744978301151486254183185289662464}& \frac{1657121559319846802171283690913610698586256573484808662625}{13431480411255146477259155104956093505361644432088109056}& \frac{345685379554677052215495825476969226377187500}{74771167436930077221667203179551347546362089}& -\frac{3205890962717072542791434312152727534008102774023210240571361570757249056167015230160352087048674542196011}{947569549683965814783015124451273604984657747127257615372449205973192657306017239103491074738324033259120}& \frac{40279545832706233433100438588458933210937500}{8896460842799482846916972126377338947215101}& -\frac{6122933601070769591613093993993358877250}{1050517001510235513198246721302027675953}& 0& 0\\ + 1 & -\frac{618675905535482500672800859344538410358660153899637}{203544282118214047100119475340667684874292102389760}& 0& 0& -\frac{4411194916804718600478400319122931000}{40373053902469967450761491269633019}& -\frac{16734711409449292534539422531728520225}{1801243715290088669307203927210237952}& \frac{135137519757054679098042184152749677761254751865630525}{16029587794486289597771326361911895112703716593983488}& \frac{38937568367409876012548551903492196137929710431584875}{340956454090191606099548798001469306974758443147264}& -\frac{6748865855011993037732355335815350667265625}{7002880395717424621213565406715087764770357}& -\frac{1756005520307450928195422767042525091954178296002788308926563193523662404739779789732685671}{348767814578469983605688098046186480904607278021030540735333862087061574934154942830062320}& \frac{53381024589235611084013897674181629296875}{8959357584795694524874969598508592944141}& 0& 0& 0\\ + \hline + 8 & \frac{44901867737754616851973}{1014046409980231013380680}& 0& 0& 0& 0& \frac{791638675191615279648100000}{2235604725089973126411512319}& \frac{3847749490868980348119500000}{15517045062138271618141237517}& -\frac{13734512432397741476562500000}{875132892924995907746928783}& \frac{12274765470313196878428812037740635050319234276006986398294443554969616342274215316330684448207141}{489345147493715517650385834143510934888829280686609654482896526796523353052166757299452852166040}& -\frac{9798363684577739445312500000}{308722986341456031822630699}& \frac{282035543183190840068750}{12295407629873040425991}& -\frac{306814272936976936753}{1299331183183744997286}& 0\\ + 7 & \frac{10835401739407019406577}{244521829356935137978320}& 0& 0& 0& 0& \frac{13908189778321895491375000}{39221135527894265375640567}& \frac{73487947527027243487625000}{296504045773342769773399443}& \frac{68293140641257649609375000}{15353208647806945749946119}& \frac{22060647948996678611017711379974578860522018208949721559448560203338437626022142776381}{1111542009262325874512959185795727215759010577565736079641376621381577236680929558640}& -\frac{547971229495642458203125000}{23237214025700991642563601}& 0& 0& -\frac{28735456870978964189}{79783493704265043693} + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. + + +.. figure:: /figs/arkode/v87_erk_stab_region.png + :scale: 75 % + :align: center + + Linear stability region for the Verner-13-7-8 method. The method's + region is outlined in blue; the embedding's region is in red. + + + +.. _Butcher.Verner-9-8: + +Verner-16-8-9 +^^^^^^^^^^^^^^ + +.. index:: Verner-16-8-9 ERK method + +Accessible via the constant ``ARKODE_VERNER_16_8_9`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` +or :c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_VERNER_16_8_9"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName`. +This is the default 9th order explicit method (from :cite:p:`Ver:10`). + + +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cccccccccccccccc} + 0 & 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.03462 & 0.03462& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.09702435063878044594828361677100617517633 & -0.0389335438857287327017042687229284478532& 0.1359578945245091786499878854939346230295& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.1455365259581706689224254251565092627645 & 0.03638413148954266723060635628912731569111& 0& 0.1091523944686280016918190688673819470733& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.561 & 2.025763914393969636805657604282571047511& 0& -7.638023836496292020387602153091964592952& 6.173259922102322383581944548809393545442& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.2290079115904850126662751771814700052182 & 0.05112275589406060872792270881648288397197& 0& 0& 0.1770823794555021537929910813839068684087& 0.00080277624092225014536138698108025283759& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.5449920884095149873337248228185299947818 & 0.1316006357975216279279871693164256985334& 0& 0& -0.2957276252669636417685183174672273730699& 0.0878137803564295237421124704053886667082& 0.6213052975225274774321435005639430026100& 0& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.645 & 0.07166666666666666666666666666666666666667& 0& 0& 0& 0& 0.3305533578915319409260346730051472207728& 0.2427799754418013924072986603281861125606& 0& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.48375 & 0.071806640625& 0& 0& 0& 0& 0.3294380283228177160744825466257672816401& 0.1165190029271822839255174533742327183599& -0.034013671875& 0& 0& 0& 0& 0& 0& 0& 0\\ + 0.06757 & 0.04836757646340646986611287718844085773549& 0& 0& 0& 0& 0.03928989925676163974333190042057047002852& 0.1054740945890344608263649267140088017604& -0.02143865284648312665982642293830533996214& -0.1041229174627194437759832813847147895623& 0& 0& 0& 0& 0& 0& 0\\ + 0.25 & -0.02664561487201478635337289243849737340534& 0& 0& 0& 0& 0.03333333333333333333333333333333333333333& -0.1631072244872467239162704487554706387141& 0.03396081684127761199487954930015522928244& 0.1572319413814626097110769806810024118077& 0.2152267478031879552303534778794770376960& 0& 0& 0& 0& 0& 0\\ + 0.6590650618730998549405331618649220295334 & 0.03689009248708622334786359863227633989718& 0& 0& 0& 0& -0.1465181576725542928653609891758501156785& 0.2242577768172024345345469822625833796001& 0.02294405717066072637090897902753790803034& -0.0035850052905728761357394424889330334334& 0.08669223316444385506869203619044453906053& 0.4383840651968337846196219974168630120572& 0& 0& 0& 0& 0\\ + 0.8206 & -0.4866012215113340846662212357570395295088& 0& 0& 0& 0& -6.304602650282852990657772792012007122988& -0.281245618289472564778284183790118418111& -2.679019236219849057687906597489223155566& 0.518815663924157511565311164615012522024& 1.365353187603341710683633635235238678626& 5.885091088503946585721274891680604830712& 2.802808786272062889819965117517532194812& 0& 0& 0& 0\\ + 0.9012 & 0.4185367457753471441471025246471931649633& 0& 0& 0& 0& 6.724547581906459363100870806514855026676& -0.425444280164611790606983409697113064616& 3.343279153001265577811816947557982637749& 0.617081663117537759528421117507709784737& -0.929966123939932833937749523988800852013& -6.099948804751010722472962837945508844846& -3.002206187889399044804158084895173690015& 0.2553202529443445472336424602988558373637& 0& 0& 0\\ + 1 & -0.779374086122884664644623040843840506343& 0& 0& 0& 0& -13.93734253810777678786523664804936051203& 1.252048853379357320949735183924200895136& -14.69150040801686878191527989293072091588& -0.494705058533141685655191992136962873577& 2.242974909146236657906984549543692874755& 13.36789380382864375813864978592679139881& 14.39665048665068644512236935340272139005& -0.7975813331776800379127866056663258667437& 0.4409353709534277758753793068298041158235& 0& 0\\ + 1 & 2.058051337466886442151242368989994043993& 0& 0& 0& 0& 22.35793772796803295519317565842520212899& 0.90949810997556332745009198137971890783& 35.89110098240264104710550686568482456493& -3.442515027624453437985000403608480262211& -4.865481358036368826566013387928704014496& -18.90980381354342625688427480879773032857& -34.26354448030451782929251177395134170515& 1.264756521695642578827783499806516664686& 0& 0& 0\\ + \hline + 9 & 0.01461197685842315252051541915018784713459& 0& 0& 0& 0& 0& 0& -0.3915211862331339089410228267288242030810& 0.2310932500289506415909675644868993669908& 0.1274766769992852382560589467488989175618& 0.2246434176204157731566981937082069688984& 0.5684352689748512932705226972873692126743& 0.05825871557215827200814768021863420902155& 0.1364317403482215641609022744494239843327& 0.03057013983082797397721005067920369646664& 0\\ + 8 & 0.01996996514886773085518508418098868756464& 0& 0& 0& 0& 0& 0& 2.191499304949330054530747099310837524864& 0.08857071848208438030833722031786358862953& 0.1140560234865965622484956605091432032674& 0.2533163805345107065564577734569651977347& -2.056564386240941011158999594595981300493& 0.3408096799013119935160094894224543812830& 0& 0& 0.04834231373823958314376726739772871714902 + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. + + +.. figure:: /figs/arkode/v98_erk_stab_region.png + :scale: 75 % + :align: center + + Linear stability region for the Verner-16-8-9 method. The method's + region is outlined in blue; the embedding's region is in red. + + + .. _Butcher.implicit: @@ -1303,19 +1568,26 @@ Accessible via the string ``"ARKODE_KVAERNO_5_3_4"`` to :c:func:`ARKodeButcherTable_LoadDIRKByName`. Both the method and embedding are A-stable (from :cite:p:`Kva:04`). -.. math:: +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|ccccc} + 0 & 0 & 0 & 0 & 0 & 0 \\ + 0.871733043 & 0.4358665215 & 0.4358665215 & 0 & 0 & 0 \\ + 0.468238744853136 & 0.140737774731968 & -0.108365551378832 & 0.4358665215 & 0 & 0 \\ + 1 & 0.102399400616089 & -0.376878452267324 & 0.838612530151233 & 0.4358665215 & 0 \\ + 1 & 0.157024897860995 & 0.117330441357768 & 0.61667803039168 & -0.326899891110444 & 0.4358665215 \\ + \hline + 4 & 0.157024897860995 & 0.117330441357768 & 0.61667803039168 & -0.326899891110444 & 0.4358665215 \\ + 3 & 0.102399400616089 & -0.376878452267324 & 0.838612530151233 & 0.4358665215 & 0 + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. - \renewcommand{\arraystretch}{1.5} - \begin{array}{r|ccccc} - 0 & 0 & 0 & 0 & 0 & 0 \\ - 0.871733043 & 0.4358665215 & 0.4358665215 & 0 & 0 & 0 \\ - 0.468238744853136 & 0.140737774731968 & -0.108365551378832 & 0.4358665215 & 0 & 0 \\ - 1 & 0.102399400616089 & -0.376878452267324 & 0.838612530151233 & 0.4358665215 & 0 \\ - 1 & 0.157024897860995 & 0.117330441357768 & 0.61667803039168 & -0.326899891110444 & 0.4358665215 \\ - \hline - 4 & 0.157024897860995 & 0.117330441357768 & 0.61667803039168 & -0.326899891110444 & 0.4358665215 \\ - 3 & 0.102399400616089 & -0.376878452267324 & 0.838612530151233 & 0.4358665215 & 0 - \end{array} .. figure:: /figs/arkode/stab_region_19.png :scale: 50 % @@ -1521,21 +1793,28 @@ Accessible via the string ``"ARKODE_KVAERNO_7_4_5"`` to Both the method and embedding are A-stable; additionally the method is L-stable (from :cite:p:`Kva:04`). -.. math:: +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|ccccccc} + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0.52 & 0.26 & 0.26 & 0 & 0 & 0 & 0 & 0 \\ + 1.230333209967908 & 0.13 & 0.84033320996790809 & 0.26 & 0 & 0 & 0 & 0 \\ + 0.895765984350076 & 0.22371961478320505 & 0.47675532319799699 & -0.06470895363112615 & 0.26 & 0 & 0 & 0 \\ + 0.436393609858648 & 0.16648564323248321 & 0.10450018841591720 & 0.03631482272098715 & -0.13090704451073998 & 0.26 & 0 & 0 \\ + 1 & 0.13855640231268224 & 0 & -0.04245337201752043 & 0.02446657898003141 & 0.61943039072480676 & 0.26 & 0 \\ + 1 & 0.13659751177640291 & 0 & -0.05496908796538376 & -0.04118626728321046 & 0.62993304899016403 & 0.06962479448202728 & 0.26 \\ + \hline + 5 & 0.13659751177640291 & 0 & -0.05496908796538376 & -0.04118626728321046 & 0.62993304899016403 & 0.06962479448202728 & 0.26 \\ + 4 & 0.13855640231268224 & 0 & -0.04245337201752043 & 0.02446657898003141 & 0.61943039072480676 & 0.26 & 0 + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. - \renewcommand{\arraystretch}{1.5} - \begin{array}{r|ccccccc} - 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - 0.52 & 0.26 & 0.26 & 0 & 0 & 0 & 0 & 0 \\ - 1.230333209967908 & 0.13 & 0.84033320996790809 & 0.26 & 0 & 0 & 0 & 0 \\ - 0.895765984350076 & 0.22371961478320505 & 0.47675532319799699 & -0.06470895363112615 & 0.26 & 0 & 0 & 0 \\ - 0.436393609858648 & 0.16648564323248321 & 0.10450018841591720 & 0.03631482272098715 & -0.13090704451073998 & 0.26 & 0 & 0 \\ - 1 & 0.13855640231268224 & 0 & -0.04245337201752043 & 0.02446657898003141 & 0.61943039072480676 & 0.26 & 0 \\ - 1 & 0.13659751177640291 & 0 & -0.05496908796538376 & -0.04118626728321046 & 0.62993304899016403 & 0.06962479448202728 & 0.26 \\ - \hline - 5 & 0.13659751177640291 & 0 & -0.05496908796538376 & -0.04118626728321046 & 0.62993304899016403 & 0.06962479448202728 & 0.26 \\ - 4 & 0.13855640231268224 & 0 & -0.04245337201752043 & 0.02446657898003141 & 0.61943039072480676 & 0.26 & 0 - \end{array} .. figure:: /figs/arkode/stab_region_21.png :scale: 50 % @@ -1568,22 +1847,29 @@ default 5th order additive method. Both the method and embedding are A-stable; additionally the method is L-stable (the implicit portion of the ARK5(4)8L[2]SA method from :cite:p:`KenCarp:03`). -.. math:: +.. only:: html + + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cccccccc} + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{41}{100} & \frac{41}{200} & \frac{41}{200} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{2935347310677}{11292855782101} & \frac{41}{400} & -\frac{567603406766}{11931857230679} & \frac{41}{200} & 0 & 0 & 0 & 0 & 0 \\ + \frac{1426016391358}{7196633302097} & \frac{683785636431}{9252920307686} & 0 & -\frac{110385047103}{1367015193373} & \frac{41}{200} & 0 & 0 & 0 & 0 \\ + \frac{92}{100} & \frac{3016520224154}{10081342136671} & 0 & \frac{30586259806659}{12414158314087} & -\frac{22760509404356}{11113319521817} & \frac{41}{200} & 0 & 0 & 0 \\ + \frac{24}{100} & \frac{218866479029}{1489978393911} & 0 & \frac{638256894668}{5436446318841} & -\frac{1179710474555}{5321154724896} & -\frac{60928119172}{8023461067671} & \frac{41}{200} & 0 & 0 \\ + \frac{3}{5} & \frac{1020004230633}{5715676835656} & 0 & \frac{25762820946817}{25263940353407} & -\frac{2161375909145}{9755907335909} & -\frac{211217309593}{5846859502534} & -\frac{4269925059573}{7827059040749} & \frac{41}{200} & 0 \\ + 1 & -\frac{872700587467}{9133579230613} & 0 & 0 & \frac{22348218063261}{9555858737531} & -\frac{1143369518992}{8141816002931} & -\frac{39379526789629}{19018526304540} & \frac{32727382324388}{42900044865799} & \frac{41}{200} \\ + \hline + 5 & -\frac{872700587467}{9133579230613} & 0 & 0 & \frac{22348218063261}{9555858737531} & -\frac{1143369518992}{8141816002931} & -\frac{39379526789629}{19018526304540} & \frac{32727382324388}{42900044865799} & \frac{41}{200} \\ + 4 & -\frac{975461918565}{9796059967033} & 0 & 0 & \frac{78070527104295}{32432590147079} & -\frac{548382580838}{3424219808633} & -\frac{33438840321285}{15594753105479} & \frac{3629800801594}{4656183773603} & \frac{4035322873751}{18575991585200} + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. - \renewcommand{\arraystretch}{1.5} - \begin{array}{r|cccccccc} - 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{41}{100} & \frac{41}{200} & \frac{41}{200} & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{2935347310677}{11292855782101} & \frac{41}{400} & -\frac{567603406766}{11931857230679} & \frac{41}{200} & 0 & 0 & 0 & 0 & 0 \\ - \frac{1426016391358}{7196633302097} & \frac{683785636431}{9252920307686} & 0 & -\frac{110385047103}{1367015193373} & \frac{41}{200} & 0 & 0 & 0 & 0 \\ - \frac{92}{100} & \frac{3016520224154}{10081342136671} & 0 & \frac{30586259806659}{12414158314087} & -\frac{22760509404356}{11113319521817} & \frac{41}{200} & 0 & 0 & 0 \\ - \frac{24}{100} & \frac{218866479029}{1489978393911} & 0 & \frac{638256894668}{5436446318841} & -\frac{1179710474555}{5321154724896} & -\frac{60928119172}{8023461067671} & \frac{41}{200} & 0 & 0 \\ - \frac{3}{5} & \frac{1020004230633}{5715676835656} & 0 & \frac{25762820946817}{25263940353407} & -\frac{2161375909145}{9755907335909} & -\frac{211217309593}{5846859502534} & -\frac{4269925059573}{7827059040749} & \frac{41}{200} & 0 \\ - 1 & -\frac{872700587467}{9133579230613} & 0 & 0 & \frac{22348218063261}{9555858737531} & -\frac{1143369518992}{8141816002931} & -\frac{39379526789629}{19018526304540} & \frac{32727382324388}{42900044865799} & \frac{41}{200} \\ - \hline - 5 & -\frac{872700587467}{9133579230613} & 0 & 0 & \frac{22348218063261}{9555858737531} & -\frac{1143369518992}{8141816002931} & -\frac{39379526789629}{19018526304540} & \frac{32727382324388}{42900044865799} & \frac{41}{200} \\ - 4 & -\frac{975461918565}{9796059967033} & 0 & 0 & \frac{78070527104295}{32432590147079} & -\frac{548382580838}{3424219808633} & -\frac{33438840321285}{15594753105479} & \frac{3629800801594}{4656183773603} & \frac{4035322873751}{18575991585200} - \end{array} .. figure:: /figs/arkode/stab_region_22.png :scale: 50 % @@ -1612,22 +1898,28 @@ Both the method and embedding are A-stable; additionally the method is L-stable (this is the implicit portion of the 5th order ARK5(4)8L[2]SA method from :cite:p:`KenCarp:19`). -.. math:: +.. only:: html - \renewcommand{\arraystretch}{1.5} - \begin{array}{r|cccccccc} - 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{4}{9} & \frac{2}{9} & \frac{2}{9} & 0 & 0 & 0 & 0 & 0 & 0 \\ - \frac{6456083330201}{8509243623797} & \frac{2366667076620}{8822750406821} & \frac{2366667076620}{8822750406821} & \frac{2}{9} & 0 & 0 & 0 & 0 & 0 \\ - \frac{1632083962415}{14158861528103} & -\frac{257962897183}{4451812247028} & -\frac{257962897183}{4451812247028} & \frac{128530224461}{14379561246022} & \frac{2}{9} & 0 & 0 & 0 & 0 \\ - \frac{6365430648612}{17842476412687} & -\frac{486229321650}{11227943450093} & -\frac{486229321650}{11227943450093} & -\frac{225633144460}{6633558740617} & \frac{1741320951451}{6824444397158} & \frac{2}{9} & 0 & 0 & 0 \\ - \frac{18}{25} & \frac{621307788657}{4714163060173} & \frac{621307788657}{4714163060173} & -\frac{125196015625}{3866852212004} & \frac{940440206406}{7593089888465} & \frac{961109811699}{6734810228204} & \frac{2}{9} & 0 & 0 \\ - \frac{191}{200} & \frac{2036305566805}{6583108094622} & \frac{2036305566805}{6583108094622} & -\frac{3039402635899}{4450598839912} & -\frac{1829510709469}{31102090912115} & -\frac{286320471013}{6931253422520} & \frac{8651533662697}{9642993110008} & \frac{2}{9} & 0 \\ - 1 & 0 & 0 & \frac{3517720773327}{20256071687669} & \frac{4569610470461}{17934693873752} & \frac{2819471173109}{11655438449929} & \frac{3296210113763}{10722700128969} & -\frac{1142099968913}{5710983926999} & \frac{2}{9} \\ - \hline - 5 & 0 & 0 & \frac{3517720773327}{20256071687669} & \frac{4569610470461}{17934693873752} & \frac{2819471173109}{11655438449929} & \frac{3296210113763}{10722700128969} & -\frac{1142099968913}{5710983926999} & \frac{2}{9} \\ - 4 & 0 & 0 & \frac{520639020421}{8300446712847} & \frac{4550235134915}{17827758688493} & \frac{1482366381361}{6201654941325} & \frac{5551607622171}{13911031047899} & -\frac{5266607656330}{36788968843917} & \frac{1074053359553}{5740751784926} - \end{array} + .. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cccccccc} + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{4}{9} & \frac{2}{9} & \frac{2}{9} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \frac{6456083330201}{8509243623797} & \frac{2366667076620}{8822750406821} & \frac{2366667076620}{8822750406821} & \frac{2}{9} & 0 & 0 & 0 & 0 & 0 \\ + \frac{1632083962415}{14158861528103} & -\frac{257962897183}{4451812247028} & -\frac{257962897183}{4451812247028} & \frac{128530224461}{14379561246022} & \frac{2}{9} & 0 & 0 & 0 & 0 \\ + \frac{6365430648612}{17842476412687} & -\frac{486229321650}{11227943450093} & -\frac{486229321650}{11227943450093} & -\frac{225633144460}{6633558740617} & \frac{1741320951451}{6824444397158} & \frac{2}{9} & 0 & 0 & 0 \\ + \frac{18}{25} & \frac{621307788657}{4714163060173} & \frac{621307788657}{4714163060173} & -\frac{125196015625}{3866852212004} & \frac{940440206406}{7593089888465} & \frac{961109811699}{6734810228204} & \frac{2}{9} & 0 & 0 \\ + \frac{191}{200} & \frac{2036305566805}{6583108094622} & \frac{2036305566805}{6583108094622} & -\frac{3039402635899}{4450598839912} & -\frac{1829510709469}{31102090912115} & -\frac{286320471013}{6931253422520} & \frac{8651533662697}{9642993110008} & \frac{2}{9} & 0 \\ + 1 & 0 & 0 & \frac{3517720773327}{20256071687669} & \frac{4569610470461}{17934693873752} & \frac{2819471173109}{11655438449929} & \frac{3296210113763}{10722700128969} & -\frac{1142099968913}{5710983926999} & \frac{2}{9} \\ + \hline + 5 & 0 & 0 & \frac{3517720773327}{20256071687669} & \frac{4569610470461}{17934693873752} & \frac{2819471173109}{11655438449929} & \frac{3296210113763}{10722700128969} & -\frac{1142099968913}{5710983926999} & \frac{2}{9} \\ + 4 & 0 & 0 & \frac{520639020421}{8300446712847} & \frac{4550235134915}{17827758688493} & \frac{1482366381361}{6201654941325} & \frac{5551607622171}{13911031047899} & -\frac{5266607656330}{36788968843917} & \frac{1074053359553}{5740751784926} + \end{array} + +.. only:: latex + + The Butcher table is too large to fit in the PDF version of this documentation. Please see the HTML documentation for the table coefficients. .. figure:: /figs/arkode/stab_region_37.png diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 95b6a43125..9510f656a0 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -106,6 +106,16 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_ARK548L2SAb_ERK_8_4_5` | Use the ARK-8-4-5b ERK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SHU_OSHER_3_2_3` | Use the Shu-Osher-3-2-3 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_VERNER_9_5_6` | Use the Verner-9-5-6 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_VERNER_10_6_7` | Use the Verner-10-6-7 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_VERNER_13_7_8` | Use the Verner-13-7-8 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_VERNER_16_8_9` | Use the Verner-16-8-9 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKSTEP_DEFAULT_ERK_2` | Use ARKStep's default second-order ERK method | | | (ARKODE_HEUN_EULER_2_1_2). | +-----------------------------------------------+------------------------------------------------------------+ @@ -121,9 +131,15 @@ contains the ARKODE output constants. | :index:`ARKSTEP_DEFAULT_ERK_6` | Use ARKStep's default sixth-order ERK method | | | (ARKODE_VERNER_8_5_6). | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKSTEP_DEFAULT_ERK_7` | Use ARKStep's default seventh-order ERK method | + | | (ARKODE_VERNER_10_6_7). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKSTEP_DEFAULT_ERK_8` | Use ARKStep's default eighth-order ERK method | | | (ARKODE_FEHLBERG_13_7_8). | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKSTEP_DEFAULT_ERK_9` | Use ARKStep's default ninth-order ERK method | + | | (ARKODE_VERNER_16_8_9). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ERKSTEP_DEFAULT_2` | Use ERKStep's default second-order ERK method | | | (ARKODE_HEUN_EULER_2_1_2). | +-----------------------------------------------+------------------------------------------------------------+ @@ -139,9 +155,15 @@ contains the ARKODE output constants. | :index:`ERKSTEP_DEFAULT_6` | Use ERKStep's default sixth-order ERK method | | | (ARKODE_VERNER_8_5_6). | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ERKSTEP_DEFAULT_7` | Use ERKStep's default seventh-order ERK method | + | | (ARKODE_VERNER_10_6_7). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ERKSTEP_DEFAULT_8` | Use ERKStep's default eighth-order ERK method | | | (ARKODE_FEHLBERG_13_7_8). | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ERKSTEP_DEFAULT_9` | Use ERKStep's default ninth-order ERK method | + | | (ARKODE_VERNER_16_8_9). | + +-----------------------------------------------+------------------------------------------------------------+ | | | +-----------------------------------------------+------------------------------------------------------------+ | **Implicit Butcher table specification** | | diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index c33aca7415..8a0e8702d2 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -64,8 +64,8 @@ for splittings tuned for use with optimal implicit solver algorithms. This framework allows for significant freedom over the constitutive methods used for each component, and ARKODE is packaged with a wide array of built-in methods for use. These built-in Butcher tables -include adaptive explicit methods of orders 2-8, adaptive implicit -methods of orders 2-5, and adaptive ImEx methods of orders 3-5. +include adaptive explicit methods of orders 2-9, adaptive implicit +methods of orders 2-5, and adaptive ImEx methods of orders 2-5. *ERKStep* focuses specifically on problems posed in explicit form, @@ -77,7 +77,7 @@ methods of orders 2-5, and adaptive ImEx methods of orders 3-5. allowing for increased computational efficiency and memory savings. The algorithms used in ERKStep are adaptive- and fixed-step explicit Runge--Kutta methods. As with ARKStep, the ERKStep module is packaged -with adaptive explicit methods of orders 2-8. +with adaptive explicit methods of orders 2-9. *SPRKStep* focuses on Hamiltonian systems posed in the form, @@ -156,10 +156,13 @@ Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` CMake targets. -Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. - -Added the fourth order ERK method ``ARKODE_SOFRONIOU_SPALETTA_5_3_4``. +Added the third order ERK method ``ARKODE_SHU_OSHER_3_2_3``, the fourth order +ERK method ``ARKODE_SOFRONIOU_SPALETTA_5_3_4``, the sixth order ERK method +``ARKODE_VERNER_9_5_6``, the seventh order ERK method ``ARKODE_VERNER_10_6_7``, +the eighth order ERK method ``ARKODE_VERNER_13_7_8``, and the ninth order ERK +method ``ARKODE_VERNER_16_8_9``. +Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. Changes in v5.6.1 ----------------- diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index ec66f9838b..6c9b7ec4e2 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -375,10 +375,11 @@ described in the section :numref:`Butcher`. For mixed stiff/nonstiff problems, a user should provide both of the functions :math:`f^E` and :math:`f^I` that define the IVP system. For such problems, ARKStep currently implements the ARK methods proposed in -:cite:p:`KenCarp:03`, allowing for methods having order of accuracy :math:`q = -\{3,4,5\}` and embeddings with orders :math:`p = \{2, 3, 4\}`; -the tables for these methods are given in section :numref:`Butcher.additive`. -Additionally, user-defined ARK tables are supported. +:cite:p:`KenCarp:03,KenCarp:19,giraldo2013implicit`, allowing for methods having +order of accuracy :math:`q = \{2,3,4,5\}` and embeddings with orders :math:`p = +\{1,2,3,4\}`; the tables for these methods are given in section +:numref:`Butcher.additive`. Additionally, user-defined ARK tables are +supported. For nonstiff problems, a user may specify that :math:`f^I = 0`, i.e. the equation :eq:`ARKODE_IMEX_IVP` reduces to the non-split IVP @@ -391,8 +392,8 @@ In this scenario, the coefficients :math:`A^I=0`, :math:`c^I=0`, :math:`b^I=0` and :math:`\tilde{b}^I=0` in :eq:`ARKODE_ARK`, and the ARK methods reduce to classical :index:`explicit Runge--Kutta methods` (ERK). For these classes of methods, ARKODE provides coefficients -with orders of accuracy :math:`q = \{2,3,4,5,6,8\}`, with embeddings -of orders :math:`p = \{1,2,3,4,5,7\}`. These default to the methods in +with orders of accuracy :math:`q = \{2,3,4,5,6,7,8,9\}`, with embeddings +of orders :math:`p = \{1,2,3,4,5,6,7,8\}`. These default to the methods in sections :numref:`Butcher.Heun_Euler`, :numref:`Butcher.Bogacki_Shampine`, :numref:`Butcher.Zonneveld`, diff --git a/doc/shared/figs/arkode/shu_osher_erk_stab_region.png b/doc/shared/figs/arkode/shu_osher_erk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..25c75d6ed8cc9eb3921dfb22d5587850dcf37eb6 GIT binary patch literal 24768 zcmdqJcRbeb|2O;=GAiS&ki8OR?>$aLgp`z>>^-t~oI=RRD6=GFZz2>zRCZR8mF&IO z{W|siUDx%yuj{`5y&sRe$K&&<^L(%4eH^dxd_G^V;|#l{u5^x=nixTlb2pR~ZX*b; z4T7ACB0L4(__%(afxn0xm31B=2qg;pAC5(O51fS%xZF@vB$y$lrX*#gq|fGuuUK6a z@4MV_Fn4h`b~Z!QeEw-@&IkCi?2VQp{z)1SL9T@ zr5cVex8&aR8HrKFjSc;|CLbM*SvWd+k=^U$Ff=r>kh1RCu-3X{>bCtg<>k(WZpI5n=g2JOl|4V^xL^FaAIIaNfZchm0wa$A|*m+^Uq(LPyf-ydcV|2V*Dq{nmi)oElG4YPNE%XF(N|LTy;b<=yGkx+2BJtw+0S(}UPQWP;Ze7WtVmocU%F^jVn~CSAk}xN#e&d)}&+ znSawQHU08ERU$7p7enUc!n^~zUYFb}^P(#qg}@J(c_k3NcCYA;e`w762zRk!%T zr#Dg3drhP=R96c1-948}1 z_KxC=j`s$nyf%1`+}EbQNVqTcrPuFFgwu~T>(-NIQ~W4hB)QY$jJ|zEBh7ZKzAh?v zd7voW>F6;o!Q8QKjf)j8Lji*eh78{B(}(7T4KnWFp^SFpjlbP{J(2WM!*dgTuQM}Q zxw*glju^goHe(Gpwl)fnUCb^mb)IUAk#0{(NT67;j)*ne$a0!&k*3hErlXlp@n8A< zDLy`4T6+3$drahLzND32p#DQ~G4DbLE!kMeoijE=h9MkbP852&QIczIqjlZ|+`$bG zO-%MT=d-1@X0&RDcA2m%ZOLVU4%M@NKm9h*u!mYv+--sC%fmq%qw{F3d-t~I2OKu% z`lbJH@bEOOf0vLs+L`oTdVl31e%ZUv;glAprXSYYuN{3o`1>ZRe)EUkUhnSu4Cy6) zR$E2f#?T@|G2i{gs&v1-cUz)jVxBD#mv9M4Z2NLFU0pY8T<5nIN2*M}plnqCGD}Mz zE&CsP@B9ggdm0|T*$QJ;#&qi2*j5!0F{Sw*d7Ahv43*7f-gxf(=uv07OoPYj#7vrZ zVMYdef1vBN{PyyggK>6`V@GFa=eKXJFJHvOjN2V`zfp3Z?NKCj`u*|oO96|yYu4XW z#Ew|oLg>Bz!n6&fbL&^HJSLzgd^IR5$SButwZFBvH~A@uU_Luc_-}~%3FFN`8)w?wxOg+~SwjEpnJJr(CS{SX{Uz_gW z(yRQiR5LH`z9eZoSp4K1%^rIv-0ohW7Wdh4OgzP@S9vqt6V~1RmuuqksTaE9zhDL_Iqy4y znZr~L6d5&`v_6A>`GcG5RocGmd;~8(+na3@b?45VNF&wtKi}4?372dpVaELTdeeUt z=-t!Qj7d(G@Yz{`q19aYv%lPMJjrle4PFUrf8_Ed_VV_qw?k_B-}+*3d7sVxdm^@j(FqAZvNh6ICtGc#wC@$@ z3V~UCOBONmUaa_4>&_tK=hK^|_G_#wJ$_*(G4PCx%}}SoZIe0PVCAwsLGi|k$tam0 zd7?Z#MU|C5TEDh@=Uy81oT0O;jElSAu%4NfMO}OI{YI2dwc~4Vi;8!5vZ*`Bd}P|h z6Vb;R7wr#IQq*Vcs(xi1S7l~4x6Tnim`zc)Ff*HmxlxTW3l9(X9uKD65W82X|L*u2 z7uUBPHkRuVUB_k%I@7l^qhyXmIXJ#d-!b$*be+_TPe`Z{Dc_juS3SOdL1yW}l>cIF z;!Ihmv_L{DRluo2!pU66?rJBKviT3+`FV`$f9l=1xoGqFt~Qd4A>F%7nA8+PTH9%| zkdv5_lF!xm{?QCX%?|}`48Br_IxV@mS0^hi`l_8KJEix(wu)~wlnP3Fu_q;s-RD7v zCM8ib6xAFb?Qdp7ayZ)Vanl)WY(yt+_Ey@Blv#92uYVQb?(OaAQBM&aU(@z0H1)5) za4N^_PHkrIfiW@p^}x8^qr?5kTK((STVC*)9PJG>cpaz+$1|Qkf4;1=)N6a`SG}*d ziL;8Dnw0xeig5O78;X)LF*^G9YHB3G9wDo8cJIs7)Plsh!4i|bS~>~0o9ShbX1>=C z*deMjF5>&!%gb*((4ic6vMe8+e#uyOk%NzKb?VFW;e(2biqXP@E}p^*X{bz@ieC$KmOC?{=Sh8wMiunWFBUb)+mN;;RdJ6 z4f{*AdmH)roDAu)2?^%G?^F)y`g98;8JB~L7 zHymviRoRVD_$V%b|G~S|d2j!iVUTdk*B;Of%6aFyr18@CLd&r)S3ocDa6kBAn;+hlm!ppMSn3&&NN^Z(dli zby#-DElu&$*IVq7wM_9}7%TyhVo>7(f$dIYFC~}mRA)AX?!HTo2GtCXe>&3}ytnNW ze>6``O@V7HLH0e^S#1g1+kc_^<%m}O+mF&A1O9-f3(OIC90l-tWA`$jG02RH`ahWb z&8b_i?0*;1ig5RI+rxv05^f7GRz+N#oJ#gp8%2^d)YKyV?mLWrcrR@rBa#>wr*-%4 zw08{deQ}d_`r5U8J~xvDzwAy{cjevVnf&U<)`m@d$L*b+1KClR1gFL=>T4>F@9x?&fw}3>!&2#pKVs$=QU5UPlb?W{da|UpE^J^Vee$NNNGo3}e?sN$a z=uejXh|ni~_xTMrcn|kRM4UbL_Sz|nXlYM^(79URwYBi>*am!%er&9+)Tik215{=$ z%w=t>l0%X8NM%8Z+II%-GkK(kcMJ{fQwq0J-W3!G33nf^G?6|oFwK71?SuKEyJeAh zw%?d|yeVF=r)F!|rr}_%0~?W#4tD1UiUtUzy48|}3jnqS5s+@JpX*E!6R`P_?|(RN z1mQYAKi?(&(+Fc-OZYjxa?6Fii z5ZajSooS0<+3TvuCW;}swnLqoyLsBP>r^9)7&1tPeG-;WtQB5>`^-i~ez{&$0il2X zd}Ly7b4!cc;&4TIdEcQFZlNzz^BJBGzxglIUL0p`b6qktX9ye`n9I*cB##f)_Y_HM zraKaC5{1gG`{$a&&JQbuG>xy)ZPe~tmecgZmnz=6y1Ge#?P6nNQ&UsZ(!hGQAvqgD zmKkloGs91PZ9a%pnwO*u@;=kyDjb$@`TP6mXeoZ$`yAEV%uK5FgqCAF9tbl2$45s- z9#!xcy_8qJPT8NiyrQl3%iJ6D9{Sol0XVqj1SKUUoAUz$lc|QE|WbmAdQKI*p0zd;3&vW%E7Tjm4C2w4kK3I{LIX@M{q6CgGv6eT$02r5h zQixjVblAbStJj~=?(UBr8}2{z$KvRX+4XKEhS_5wdc4E&nVw6%@g0{rT8bV==SMa- zD@+Q-M^Xzpr?+}oIUeq9Mjo$ue7^ayf(N6ltXw_*gyv^H(A1iBP#pe}bat5H6?VW(v3>Dev z=u8{^(a>tl!Qyk4gPpw#H3OqtuAU@Wywa7xrDy0hdwDXF%pih_5BnA-EfL*m32||F zw9Iwy)?0`_IJ+ORY;GXt{q^SJ;0Ba1`5Z^y!Vus83dAF3`XUC{&M;Nl|FW*c(7P@SYC6zMI8TMH8gXj~;SAI}Fy#}vXZ`Tx zMb{U-7pT3lLvMRrzrU2sZ}xPnIxEY3uJ4`yP7_0f0D$^~Sq=Z5^ikIVgS|wrrYGmH zR#i~23V90V${YCRhN@r!w*mG2KwDtbOTTI>S|K`Z@)c&LGdtEkw*OTl1qQKKVFVBn z3;KO%yXgH7R(Ezhd|$9~DHQ6IwX_Z$cMIINpf{bYk;2~Yw zmxA;Dt1%%tLZ`Vtj!Ct@krw_D_d4IZlL!bG%#K+Ag?1%5UDM|$j@6T`t z*L}Zf`?e*xXa=d@>oEpqV48hjI8$X*Ef#!*fZv~?~c$GKf0bqAi9W+{A>A7z1D@4phEoj+QX2b1?Jy|v$CG0;(Y~(j+no5biZ&cvQl~%J1vWb@#Y28Ng>FGrVqWo4pnZdANI;B%UH3cbbw-$yTb4>!p zOBS@s&}f)W&>Qtx|8`k5fm6TQ@n^Nu@Skkb_1XQyL(Q3r!HL$f2yl?HLlMItgBiJPse!&7K`uh%@@`BE8M=_!&UV&L#ChfTbA{hyQeU<*hvSN{e*zFEX~#Z zlCh(sBl2;JX!X0Od+!e%RWvlV$(iNj8B^Krm6jDYSs_?x?2;r2fk-r*E4$F37Apln zR1`V-+gD-#YY!WP#*Vf`CY#N_CD{#^&%&|o>JU7ix*Ag3C zc5zZ;WBJ_{27$Xmww9Ld=!c#c4PGh$4nAV6AFnu zs$~a8;vr2XPLtOQYE411z@i&FAw!5@;XL&@g@vG2Mmps@BXbs|1x_R7f8+y_qtDN^ z`{`o8hqsx^FOJ6?&r2#Z{T%pE=PxQ8_Vnq~0=+8jd-qyfTSe@K1tla#TKAkpX$eSZ z*}1stK*h1OUATMCAU-*nrg3xDQM7(BM)rK<-9iYj1I3#NJs!>l9DnY zblO=NA1bqeaQX_&z9WIFtj2|~t8RNVk2ISTQ~f8&2Eb>3xz(LB;hAh#Pa(FE!pcRX ze*1Qly`a>%12EOAvIj~#R$(&$@~P$BPh=60brzj5zy$$Us=wq9?t4gdawVP>8lX;D zS=m6Lfz1b_D+`}TJ_?5No*e7;x#=iMJ50y8QCow9Anc)dvy>rCnzwJS?My}`CMLpU zY-GzEzU#jXrGetJ7A5n%AYj5nt)pm!ZAAeK_#N))=&^z>ZWF^e-v#={)Rbw#xwWz5 zqwNl!2Jqb`FrFR1_*KIa1d-K-V6RR2i8|tsNn?Bbwbn=)N*bE|FIUomI_|s>xOPo- zN$n|qT);+0+bI>mExQ69g z1`bhA3d|P~Q+s=RJ~tsq^=8V^e?VwE$xIJiDI zM_LqirT*6sE2=s=LmxcXpV5k;o{7kKZTy7~^}BzP9Y2VnpWzW9h<>WLtMyQ+85V-6 z{{;QO&+iEGZqsTQsF7bfJI4UziH_1TDPf0S=(ap61@!>nSULt|3LO8QXRP3aAPaM# z>KRno8$i6Vwzf7lHrCYCw6>muuvOS_;J3eJZyjMt=I` z%a^b!$ZwZ+KUu?ipZ8=B0Zjw5`10k8T9P0+8l(ZA)z6e2i98xNZ({XtYwKJxW-hKp z;GBDB2Ea?d2@Mc3=~mi;EJX)WRc!3qXG$Z>V=hk4n<^?OH0$NdZx2F_oO-i08~_U5 zzJ2>Sn;Hs*!jPTd)3>_Sj>c#-T3=t^&8>2a1Hv6Q50A)q0rw^Sf*eQ*5N$o-3PX=^ ze5Pg~0Zk3Vl7zMrG2ZiQk$9IVt~%UC$nH)_Gup&(gH8{FAC3c6jFpY8(q@2LO3D`^ z_;51_3B*in>M1!=Ts%A=L#SzJ@Njeg$fA|@sRly@d?k%l+svlhyjqwl;Jx6gNTR-=CJ<{2RHXKkh|L2L_Jns2~PveB1cb6PtPuwxi61aS3?3F zP8D@RC-b|`^;K7kqB0}9NWsFrYoW%F?ls4;=%lXxU26O19esUC^RF*}ZCRdA_m~I+ zh6b{Ll?LdtI+~g#mfg&Yrd4DaFgmQR2w*ouF?{ZzT0K=nH( zt18kGuMba)0-oj%mg?Gbe2i}sQo;$Z_3dKl5<%^#Qj^6keHa*Qe^O_`M!6(KnHpBt6!1g zvSPaIF&+RfY&0G@I}1CE`hY&Svvd3>8VVF4A9x8F_F&pxCCCMx?*H+lexpZq>9~jb zOfVUMWppUA#OE#DX0pZC7krQYeD&O$ z&88z!0-XzzxHRB$C@ZE&dh+|IMs_h{-z)`W9*vj$(-i}Ty&=nC;o zu&fFLn4c#3J~vloCzY|Ndg3XlFftom@>qdb__CPTE(8Fdts#p|Pk>~_078upCMY4O z^=D1Z%!~mIl@B2~*MExn=fjlSh6&~spn1i{qViNB3C5}iM!456P*Tp!%ycG;@Jt2EeZ-myV=f?OQ&1V{#9fMO7n^}0!k!PnH4V}%8BQgMMe?nA9$;jy=oxf#RXfb&oQf;4VA9n#bd zoQi!&ATW5L^m0H&D)?)Nv7=`Sxw9wD0gvE??>Hm-r4%018!ZuV)X*z@W z%CDTecu`@mpo8E&iL9plv>LJO@64z$973<)HeXptJO9s_L9s&*G9t`IZx*;23m;zz z@E~B*dH0Hbut8<^4j~_w0o;><0?=?AMC?(w5j%7!O!DsTESMTpNC5Ev0?#SGl%<|Z zO-X4H;dJzMl24B9$`x?6|5K_-)Fg~aOw6{Jfb3QCp@5vIhjThgZT$5b8~#V5sm~u@ z=vx&Mm@?SabRWd*sZ$Nyab5PE@ek0`*e5*SF!y$ZXL zAENR%ZiJCdV2R;+uhKJG4h+cT$xct8nEsh+^5A8wNnl@iE{KYitCxZPqeDT*rJk7` zt&4EhD36NstQ zS4JJ1&VgtW@1z2Prpk~SQim+Q8v)At0Tln(c|MWpSZY(O?~ zu)99o3kC-z+`ms~?0LTnJop$OK1Sg;p+b!i(j*GX%bq3JuCUf$EG=3GaCBE&J1aA@ z`Z%wqW_YJ>8ufB;@II5m!-pA84*`^c$wc0Pwt>HEm4JgFzih1cLP$(YORHA7g`n;B`;0B0wpV}A4YsBG`Jb~u%fk6EBMV?qJ# zD4Ct#xZD0#l+}2%P%n3UIpHW;-l2W4y8%5YfWxW}=0TTk$v*meJ^&yZos8d4 zvkcYT>%0(h$ndrwWo5R6u6UFV_tv;S&Cf4RY!QF|{yo$Qzzn;&vq;_pP@=eSfhrs8 zXi%<)k^lEx6$!a2IrRzx?rT``5Q0Q-i7i+w$(r5kHw>)Ei>aRJXU`%)&hCy;&#d`h zQyGxcPYuVhmsJ64yp=fwT7UK0HG*^0Q#0AyAlHDn2nN5m0o;^S=AcV7TV@^aH&oi) zI7R@62Kwv$wG6^TWE{Q3OYe{QK?dssG6JP%Lv3wg)3)gAk<_p#^Z;u=1>&D)yZLvd z${~6=9cl&eM)wRoFSD?i01O7f*#%%*+e}mAwwP;h_1SNr8y_X&3%?Z8UX$R3z?9B!)^1Z&R|!bVP6gm6RK;{F ztS=s5;gK;2qcX?4oi;W$!DN8E0aVAVX3&nMkG_%%f>a9mtbqz@bz5VQLqNK)fi{Lc zi5&rr2S>Y|{yixsrJ1d5{+1K(O`l@^TV7alEZrXz>6YDh+H2^gm;3Q+>m86p3;k|XBsX;S(FP+hToB~UWIeAx{0BWP>eZp`%NFw^Wozp3Q%ZSOBZiwblq z5#)0RmxE!ODkX$5Y74(2gdBV$#*CT0UE{9B4PQO#k0@{^RM;9L%bUNXbL4eeKj!+4 zH)rIT;OpDJlLf$((q{AI8z$fCrY~P*dm@MXRxuFofd$^nP?Pw5MLmfh)1ukyO78Ym z#H*TE3Ms7cwB(e{FG1BursWk%Xny#r68$txRNJ#Sf(iZ)FLs^O zNzPrLJvo&KJR-)Yn zE|v#y+iuK)CEX9-Odaa!eCc;2BQQ^)BvX{CF|3>>o14SNYQ_J!Y(PIDPXcp|68?OP z!`b;O=NT?vhc_UPRlUGir$j!lZrv+@!eNAqMIWkOc!kP{bG=frsbQWMAfp^z52$1r zloaUcIe~vJKnWGYDYPkxi@B)j-rx>(pN41CtHK6FA zbNlMY(-EmvJHsVOiUzY}r@5<2!ul*uzn^YaC@v4>{r)idH%K`oA!HNn*NVz(IAu3p z*D<$8)0vrQb}AR>nLc1>^Hc|EL2c(?z0=0p8tPrpT2a7#hD@#PS$D_|JJ&VtUXn%p z;b>f<9wQ)I;Hyu`Cf;SImBP*Xe(PP{yLDx)EQ62#=e7)HF`Dtvd3EA5Bnn7Y*fPV? zkAh?wo-gg~&Mz};E%e&LQc&?Z6u}CTz4$ASVkG>W1qfCE6?VsLzp(GhJ@(~FpS(CR70&$LaIE-LzT(UmdX&e~y@^exLv;doC`OClsB1bu;jLC}Ua5Gla; zdEvPCL&EdlP_1fOwWP(6?+P+8Z&`&JvML*av;dVjKuSL$rh~73o0~u=m?W-?Ot3K1 z&JPYUDo0EA{rCYHB44kn5THl168qBys?GBCFf9^h2Ij+E_7<$d(jySk#Ap7Mic10rNK^%+1aUIj50wVKbr$IWRo-*iOT>Jzt^Yd5&!hRbCK`3GA8@gyZ&8jvw33O&s zCUp*nSB_7f>mX{Vn=Leom+5wLcvNSMt)#O1RsUbTq^MgohjfcU;pPt@K`HJHvQ0mW zdJ5i^%PcWWK>3YPmi%mtzH0$Bkg>UOt(Y4$9CT zNmEQSoS!Kx#H@=ckY{zDN}#ce4)Aq+SHT$?70NyS)eEDn0}qy9lu*I!gj!xmBm3gU z4TB^5MU|z*t;Lo>eeTH$4G}8zp*}YY3u*BoYiY>BRY6OnUw@PEiV_S4Nuu(*$-Cr%5rGfJbmUf1_CEr3vnA$f_u zq$PxWhJ&{ryi$Uq`D^ay-=dc$<$9iRoP)`wEq(JaH0oC3?&9cM23Cn@H(}}sG4a3uEGBO3MQ9EvxH{Wbj@ z?GCws1TJK>a=BASOiJuw)&xitTyP-!>=vq@#G~c!#H(|t99$;!-9AY&N$h+GD}R(g zV{)k`&gUdEe2a$n=sr#4fp*inC`7swe151MZtf_L8AP z+Zt8(`LKR4`m{v}4ijD#yB3`cZGhvelbnJSXsEndd;HO=j%mn0u35*HJqqu&#>B+Y7@@D2LN8dWT zs%h6JgJAG1N?xC}%U6=~xkU*VgeRISpTs59)p2zJVixIB;}gCO8886R@N@XlbaAb0 z2=ZDn5VO!m(mq*p2_Y0iu}&$vY0)PmWK4$k>P^_$V_;=fbh`y#JrIK&XBmWXAtZTl z4GG|dfjBdX{+6L*7$Oc(Hd&yLk7i^dpLnxYE+;dDhn(>kUZnyBI_2{dPC~dpB_5fb z{+^t3N&*oPYD>ux(ZfL$C@e~hAK?)cUqob^V;GGs^!acmSjeQxHJQ%Axuxmtn6klQ zF7ZD0s0Bg=v40jy!z>z50OC9h{1+LmtmjfA1iggN;h3)m0zgTn zvI>jz)u_{!NGN^E=PhgK8V9}y0+1D?u6*wB;c87fSo1?Cv>rc{YOqbPShx)>6ofHY zS=~uX5&MP@^nfY0oF7{F%+Dm}rD$DF{|UzyKOnXHM4DH)78tZPh==I)aAz40#M2R> zG{fFRt%XJ*WZ$Y|PeX#uk(^**B)~4BUG(_GXk_fCfP=>I>z>U@vedDgK~txQSWu?b z(UiDy^KY=%WhCs2)V9Bj#S6=k^TDnoGKhc3NRCe>Kns^#|A(ElC(GZi?cn1mv$I{N zf?1C02*D##C1;2Sdr%HF(8bvZ+OUR#wnN=!f>S%RLRAoe#@*S`QI>Jb8EblK2x9vb zZ?+#)kSZu~PF^^)0xVU)9-|M2WO5$KoN+d?ZNor?tO58cD50(#nJvbO#xMkYtP7E% zv|njd48wRIxU(uN(1Q6kDkF?sWA z1>(2MX5!6oj=!wVzt=Tx8J7q5 zc*T!3pKDfR>iSY|gmoEkWVOrXm~BI&tidq?AfXYG!euZfyhFyf*8>#>qZz^T@Ls(> zaaclJ6s9r92f2kqgnE5F@D|mTd_-+>qbr{$1TA8vKrTf(2pt zdy@Fjk4-SKmiox=@ZK-R=!dJYvqV^lCN4L}6S;K>t8pT{A$VboU1#53wWdcdCVdhx`u2BYJKbb{m2t!pkhz=uob}5w<>nAh2pL2HgxT#R^>HC&WLGmZH;0fC#Jd&SMC=-;HnyiRz_HfnWT-)arY3pfC8e z@@5x8gsep35q-q<6M_vyjB<@vs2Tg^aaoa9>c9gEclwc&&E-ACw>IYz(XksrXdXqUW9UQ1dxwsQLK{VE?KcTkC1?Lpc$3{c-Y-H7@8iKN%;3p z6dsX=^7*UdS8$P!oIsrX_@THJR#k&!L4gp+>0@SchpaWdwUYARcGblf?Ph%xIv zQ%j4{wp>|jyddzGR=}HB2L9s`LogWxMN+AaF4)a81{DZ+)0ISZ=F;Uk$4_?$k${hb zug>*6TiAPp!Fxw_l~&f{i(g#H{D3d}AY=(xpzbC=qEeVoV7D(W{k~)&cu_tW7dd6# zfVT^;;|7Eu=n6?l)8tv`?OcY63Dx-R8|b-5=Ny%==b1F%z1szS4N6|#J1fR{XP_|o zinf-m4F~r$A=BR0;y!fu=@~%L6sZ^#k~>;*Z}0{Y4?_km7ob;H_J78)eWD(X1U!JF z#7s{}8IFGFIS?@!Lc0;sdA9oow8<>Daze0Y1PqD78L%m(^5JJaadY4DuRtP(2vccPY)05Zx*!* zC&bO|ZcyvV(=HH)`egh)!y%9tL8>2` zLj^xxXduTyWG#nYoh!}Bv4s9s=)Vx$Zv=7Z&-66@dN=e3y`L|v1rfCdHqum$`FXcR zGePV4eQ*ZeWvJvna2HmNMu%!h@3Klr?9YIV11*zxX1>CG4q)Y=kK+f(9MA=hfAAXH zpe*Y25F$QyBSaB&Phhw5K=y?lSclkd>Vq_RCsZ+57l`kmgo22kO2!QBsZeMDi`D>T znMTkOIwzMMMRW7=pnkLhjiX24Uwf9)Q06#XbnvHH2{{72Xb|eL5tjrYxn!$}!3Gfn z*b4(aP|z!R0L=%RtGdaq1=F0B55cU-nfJ$A%#F60%%bq#ad2_@LK_P-Suc540#Sy+ zLm7dMl@)JY2j)#(P3;%-y*ur}$oHYd3&()IL*)T-@1m8%wlv2??|>s15PU`9Z-9q{^Ik?^cE7p$G=BD`+>A zf=icBgJ=!9Ska-{1-kg_f528MAwWPl+vvNaLBs@Y&`Clz2`^s!m4@0`@jb#{e*23s z%TTNQ;IWD|yUkhf0u&n0vrGXl)+;j#?3*x=lluhz)U?e3q6&7~gbZ|FLNy25l{?%F zt$0WCM#n1Z>d@|4+qB&c*J*zDBU*#)Pn2kkkhC?lEmVQ0Lpn&4^elyz0BpohKR&Ps zXEuosn>eG6exA@V&w7THq>Jznm4(O8%z8jj=GM~NFvqNJJe!PVfF$?Y*Nl@$| zVge0>?_ca=->-mJgY8d(2Gg0TsR&xJQYfg?7kxNNKi*AmqdW@%3BU4YG|2FvAJxGo z3Gf!EkdI5tuS`N!68T88f4L2IIoN~LI1CyUjW;dn?bYN|-1_d-iwGGj9EH~=VuI52 z@mdED)S+|?Xkm7y2bWcno<1dJ!doSWyIkE;jRuGd`L4OOYZ6EZvJwRo0ZxyN_1CTy zaEI#uJ)cdFO|#f=4>eT5)pSiJ9K0v#XR+}Z?)IN{4JdUR`Rz`FoA|9gPxqiDUCYfY zeCjg<57l}AiDJ+sYH_qq@1#v1WT4hb$p`|7P-N0D1ZYRJ?0WTh*;BGoCByzKDhHAf zLPiBI0T^{)j#*iS#+el<_}{$wH4y(y<2`I7jvr!?gMPnWt-vW=+mHVGG3OB84tka(__*+Ypcl-^Wk9$`yIJuOM3PCa@k~-?pZpBm0E=!;03gw_W$f+$f=B_^ z&;X1?P^>-~H&moH0`QSO5DWlhiJpM03~oXB+z@l<^>F}@mA2XhRpN6*D8E;iZc7Qu zpZcFrO$OF_G#Zdy4<&rv_Ks}W>GACsw`k*qPxF)Or@TfbSusfImRfs;X*a6KJ5 zGxu*Bc*J+jFHiBpZn1zgz(a)GA|^sHDL%VJHMtM(bD~d?Tf+#c8W<5OF){YGaJ(>H zMun>p?F7ihXhw43DZ;zt%s8@MzzPWN&E!Us5y?UemNk4l$8_5c-u@pa7*`0@qPb^* z8;}pr7Vrzea(#p&hLPMa<+~OTefDr5J1la{%!K6DlPNhE5WmvP`3!Md7)^7c zx9su%Zv@#?K_CuGeu-9VZ{dIls~j048+a>i6!nD-X`5`_FLTSZU`QmgC;|3rORN8i zv@H~?hXgA0G0L$=CI3KT|1q;rHjMJLlifLF@YEq=)8{(U%Pcs%!Qc7Y-&k-4{B79&Jgyuf9m z+nhS35VNoQ>lPW-MT5;L%A|62zb42cW5ywByTC9Wh{pjnrU(ralUW*SI%TqUfvqsp zYlv;oWF<8~CK_Ja?ocwK%2Pfl zL&|W_cvHyC^t6s9`=(gI5f8_!<-Wr{- z?6R5*JEYuQPsjpoYyvE=3%ub65l-*5e9BsRat>~&;S+2Ba`~sqVi9-Di%Yt4iX1g zDxSE5v42Vj9{4VEI3AIXBljIoj51^Us)-RBtFkf%Ol0^CP6wz!|H$kVIuviQJK*k5 zFR7jr^+Q?7;R&-Gdqg@4Ap@0E`RR#KA%tM&Q;H^;Ykw(-6hcRoqmN&HUAn@BVl`D# zja%EH!?_=P;vZ-nV53oE8J|GHRr6T3+CxlF z?PRpCsnD3=zukxe3dlAE{5C>BsK68DXZ9*R@~oSrc;O7DxgfsfX7JqxwSbKO;KCia z6S2uh zbrQn;+p9^hAJ?o3sM@hAf4tHXp>j8v-RL7}CedZh#Q+Px?e%}_65wwcp@o8_ zkc5^ab29cm`BYq)#_tFd9ubN+vPF55SDk%@#VqO0vm8~Yv@FI)}81fA`naop< zC$5Liz23a^fQ$h|0$E4VcLh{_Lb3*O4%-W&pk1AME&EK1hzT{vKZMMVlEzZpw2EeY z+{L8B9+Z3f;9qnEftQ%ZjEwm;#S%pn1E}n;TP_N>ze;;eTUk@GoK!%7`mn4KN}OaB#_tI}3U`A@(!%6HJ@$3dj)(WLGN8 zltM9DXkLt{L=cogWt*K=gZl_$qE#HvMgO};F=1rP8nXiWG}EuZA-X9L(({{c*m;sO z8#@eF()3U$B(Yq^e%TT~9Gg*fYJuxQSk%91(3I_2Gsu)O8mu6c zEu}BvM6K^kXy>rqg;!^npHaTl&4qG9{|sV)QD`wMsf6&D4a(-Ul4k##$8Zxo3z zax$0N&EmwvR}#BT-_QS!))hVS;<|pHc{0l-NVd23^^?xksUU2zuKw zWZ116P{$3Y;L7K|KxWO&6x)Kad>f*iOXwQfr#-R%g8cmXrZ8Km@zlX-1F&Viy`#e* zixgVc8!D+(D#KbUR2H{c~ zhYyPzqWQl#|1Nq5wtp9LQb>L zFmZ{zPuzddHYfA`LFqgx4@5PLu(fR;PO z4*{}$CWK%9%9~`C=MQ!aM*n{HpVVz|-4jlS?TdrZdJAbDyR){9;#~1XXVW-7k_~yg zwvQPteiJMZRG(rncn-(81qEE}?DwG|9Xk8Mq5_QCV!E5}(`W_P>GW+-ZAd8hlcKJ( zDi_g`w8HNZl<$Z_ixIRf=c(ci5{U69{jHFb8jN?{*NjfT;e)Lg=RqBKXT4K~68jq~ zu=Q?ux&glNfL@z?cFG3~-15hS8JY3r&xZq5iYdeABGm9*ndQ9R8ojE6{i55)B=7?( zrJr#YBG|tC{b)Aq_VCv-cO}_Q5D78#tQ7o!^nrg7KL?XzZm@}|tP0vVWW0M+lYI^) z+syaW^ujACeifZ0I{Bk7&aFyNg2TCwp<%s_bNwKUSv$S5a^ktM32+4MH#d52N9>%x zIA!gHA$~ZYhL13RoOP-DeVV+vrYeGd)GQ*3&sJj%Qm3roc&^=iR{>)Wr=5G$O|IS( z14Oz*9O&a@SW2QFB4hse{zT{R=vt;mN1n?BE7w1&nM>{o8GapkAP_~Y^o!xDVz zHzwtBA(nmACKMu9@*+*>AIS|)*T7C1D&QQsb-t{Z$hRJ$&)**xgX0$qWSBO`upBC=enV0MR!`;GvC4t&1iP3}DKVPI1sY0G%Eo4D{B!^zAwMxKqEE<=lBbzQ)-LeCSZB z@r^C?vFFW@qc}CSe~A@Aw{CyASFh5vaIC!&CI8_L;cGJ`4Yd{=KfD9*YV019#wW6u zaLo6pO4}dbf}Ag#+2`pQx-aS2YQ`aZ0V>V`ijs!(Xi4W!#3cg%FchNM)Y&2L)9G+$ zl;Td7nHK547YenPt`D03aFsQ;zQH$9IQJ>>D{dGpGz8zd7fneYLUD;anh+j1rDz%S z7G|g9KBP$mnNs*Sj{n~7j8VL)WzZ2E4HJ$86#u6N`;R@tHIJ}VnvwHAQ;ZOv`Om=q za|Byu0imHW@ZUQB|NRCffH%ncp(h5ooR+Sx7yP&Y{7gzhf?Kbe2=qYd7;r=R?;mX3 zi%m>)A8*7@41@m2bdWx=>Fh>KhJv=XHuS{yza?aurM$&n9KrbtFVpBc1=*Hj;Kp=T zvVHr>51hbmOlZfJ_VEB33f0xa{vy8$+adluRRR#6&!IATu-g5q6|@h+Pk9Z4Xbl-+ zdAMS}g~p*g_W^<^H2jYpSg|cB*g~U)#Th2(;WKg7L6A`Ef7@|jlayfVxFfBk$1TF{ zQZv=O4v@bdL{b$#UwfWF2YGE55+HWdT2;egLDWn5;TUFZUO3~T8P7##xgT~w&!FX} zpB{eq$FV(*1G_J-5_VN7G`ygC_@ul#Hp?D%JAs1eCQ1uC)nE@>16Ia@9guFbJ)h^C zaS*b8DBDlAK7Ik6VRm)}M}i_E*k588HHV-1ng+Ch-8KqpWJE-SavUibVtd!=|CZFE z@St|>4qb~Iu;XO^|7zsQCofQAha&F3l|sy>9it?i*j^j^S^ljBVpqIHfg0<^vA zXn}W(;(j%wx#{1&eOtUx`0S}H1>|~2b&TnX))BN-?b(%;=K=A9%qesbZ|7pB_E|pu z@+r#K)PWH%?uATzS3R&49Ec0Dx9X@eycjoj$pooSd;tzxc(VSJz%muvMg^3{^L(5 zVsj}enkMHdv326V7=w`%Tkm;&KHsm|4Paf<(Hh4J0B_dw_@d^OceR2#r{l%dQOPK{ zzmWwk+*)i-qp^TPt%1E= z!}fE~Qm&N*ulxu07R!3Cz-(@Y za=;P0X`0?!D|pFz@iW)kZEVbAvV>J1`+je`NZ*id9EjM?E-sv<>Co=HAYh^Z>u^(0 z^uI1yE_B(+8EoIt`B0^-GHItZSHGyqS)QBH%#B-EUiE`ne=J-(dgz_Rse_TK35_XC zfq(XeW$ZRgPAH*XaoZWs>-bJf_&sAOHZg9&DM>zlg?N;=b zBl?Qh|DmwbP2_Cfv(P@}lidd=%WvBBej0u>96bLl@cC5KkFllm^P$T(^rXPrFQ2mz z4u9}q9O7m@s-vT0msq_2yDpJ0v$JoX_dbJfO^Jn?y1M!_nKJj%yDk)lCOV|Va$S3+ z3Ng;$V1~8q{LD<}vvZ?UQ?iMAv7gb>?-EVpWodT?2-LmN;&tBxXdw||J78K5)vv#L zQ98k35Qw}yJX=^gh2}?(9<}l{HfV|@ODM`POJxkG!2Iqfo}Abdw=>d59G426Ok;sW z&WSyKs&@j4l2X#rE>4J@lD{;f>*aqnRYfQx!a4|+6t1*6 zxTKZMX*JIR9;vCSDv=3XnDfdxmP)68VzWyyU-h-Pce$o}OLOywkr8th@n;goI*#7mXNc0JP?lf9#B+V>vho1;CA>97Zn~7*O>F{XXA6{o={0#T>c6x zkAFwIAbWpp!>{%$1NF1Mw1`HOm63^~tp-hAusw9-ESG2Ud63B-lBb(rrZQIh?y-R4 z`EAJSb{0!jQZhVnuDziluc+v%XZIqFZ3&9)#OP?%O!l4br;^Pz&VQP0Lg?r0yklS? zjISPYrro!iIGm8orD0kc+0G>Tknw}JT$m~_Fwok%4<}1Qjmvg7DizsQXW#P7nW! z7ppmQ){Zn<>gi{F?)?J7rI3`7wr<_3z}7;@{8v_Ls)*1ZmYqp=RxsrSA}kA&^>eVg z(eFk?Qu?k{cVs9j%E#ns$i^0Xzr&9=eUD}Y$LEGf*0t;^2O~;ogH$u0M;W!#p!u)a zN~lPZt16|r$hF&IVVKWMUXBNgg??YdhLxn;M6ZbB9XR4yL)+=6_^$k6{Q7C z?VSd6eMIHD967&5&}6@S!;#znI5nMpmobT$*&RCBS9Qbc)lwzIYvWhHltjnGm`UF< z8fGxGXfzQb7h~(NICjhz&ZI>}vW83)U9$^KP6}1lQ$s@zd#5wDgs$d^cV>YT<~MuX z-aa$j^~t0{+-vTlRfr2wIG$qzC@S9c9G#d@gVY@PcWG&< z8y{CuIsbjcaEg@(0j120M|vCgxgbrde)jBcED&heF`Vtn&C6S}W{n>+AeA~?zqt}+ zXI2(zG8v{L-fTwrsx(hY{6&EhBnb`j4|sw(E3g_H8=*3}2r>eGZn85>5Z=FkuawTB ztxmXN*|?2-CMYw4=OhdbPubZG;<%pw{`2tgjijVfp8<{f;CmNFQuFSGq}6mj`dSD7 zFW4I%m|-z*lO+Vwbocc1_Re-svC0~>Y=6Cg$aRf;u_r=1r%{Y(v+!5BX8`@<7+U}z+L9=uLv8%y6pM)&vg zThGt0#4(e!YRzyrS%2Aa=kI#?z(N7FiKj0f!IeNTk6g!P@eqD!^K#2K!eRzjxKAL2 z7;~Xy0zvaXUohnsc?8BrX%xr=!r+=sQrzp8OZYm21TIsNO>NT?Zqv-sF?+}BRfOW$ zWUD}Y!ra){Sc1+hw=#cd!T$6K1`ncwf({%`O?CB~jt(p*<`YL`DDZ8}%-*8VZxIK_ zENU>YWCeo=ZRY_crIs3Lc*jBs%;(s(FAXG>vggmAXJ)?W?M*+?keQj8l9JNa)>c}o z;0Labok=BBr&q_}bv!lBeJ#KR7A+^7Lk>}4pQ;J{x@wJ=j}M*s5ymY+OkL8q*;!vOBYs`_I=uo&r2h zg>{tE?{Kr0S=Wj|Tii>bR73pb<`(NrTM}ihiyHdNfdD2fFap@TZQE1K4pf_-K4c1| zr>}2<%_a&9=e~#Xt7~B3dD|JJDMzGMZ&ebh4l2={9Os~*zK#yRMA9mP#S!j|aJZ)_ zZ|!A~uV7cf=~FOKPs;bqnJWKrb1SP}$dX~8`)KJK|NQxna0v0Q9)OR-r+c9`pOH4J z($*!}r(iGi^z^`Zcq(l-A*^js_5gwLoI;_*HgUO=bAJ=Vn5b^u4T zix)56KQ;=#Lx`i0a}}*Bo;(q1M=|0*7lh%}Q19a(N3t5*=8cMx+WF>wZEsfTjy-!0yO#C$+mO=k+^G$iO#A)c zF&o7NO^{u4Q3yoGChu3C={CzWM(Hik4uW6ArAxEQgTKC-Tu0Cf!^R35*4Nj^xr3by zW1e}aWezASi>sY4=2{)Upx)Bgp&}#U^?l0K+uNwDS&olc+Ov=HtFA6ge)ID35V$aW z{1e8X*w~G1Eo@ya?nuoe%;6MmkZFuUUrZy&qU`d658xgtZqy!YlbwZl4>k%g$N6PC z88_nc{@`^4>EDKJD#dMfl@G2tl)QUvfrZSE-OX6`^Y?GTGHGg(mX$?i)7AW{vE_$~ zhK87!80Xy`B=pA>6?lK_kppcGTw>I8z>}E>ksfxtASR+h@V`G*5Zn19`{XG?Sm#~AmD(7vp4f|#BdL68%dR26j* z1n(At;KmT*!Yhw9+;iav(H&J|R|KJ@LjS|Lnc5AXLI~V0X(|y+5i?K;QFD_#jDwdr z+?1}k={ecBd0uz1Ml|L1HRQ3p7=2r7jOKMWTO%izTdusAOO7}ArLGLo!ROh~&nviC zUw5-}a>VG{-L^(9i1KOOaO1lmc;O=E{6z`j3litWv|F)J2!cT_Daz}6CC?9e`%$}( z9j$03-M^yt{xze?8#a=Y`0pKa8C~XxEhs343QY|ana?R*Q_{I^EZ0{POwu+{d}ZPZ zOZp;PB_mecM2R;+;WH;;fr|%aMk#0OQnc~SX49`3&opdSePp)T;it?qjk8WNeT|i- z{5Wu(_`HTo=y1HdrWyl3w8QX;;D`JFCx48s^CQ^F+1`9?cxB}szwFD|Ybl z*5c5c>k9trp@i2LWv|@pUQs_k#@YVT(v&}O*jjG6(6s7;=i*>*zR}WfT}^GRDdF|E zR|;zus~<5*iZ~7X{d#woNzxwH=XPx#Gtr(Z=M?yq&Ug))dZRL&LF ze0Z~E*ORp{TzA!HFk372^=saue9fnVqrcwY>;C=l;lnUypL3+vks7|6^Up5cY;QO^ zSQ;C%4EuP!%mj|`BTXSph1r{9xyWI2zW?ZOtKs1FavM)kspF7|593eSAMfuGSk!uT zbr8?Y%=Bbwt~CTWI5=Rj*hm__(g?u8vt>iM{$_Ekwuc7ez zeTxU~wGZeQscv55r~5wBlkHTuVJK_iI8yJQFh|ZPrX67S^|^3wf0^GX1@?zS`D`uB z2SosJnUZkW`5R3wsg7Tsp7){6CRS2XqKW*pHaH9u;6*IxG%V$v9Yrs^T7CJ_rHEn& zi+~+#uQr;yP0=h%b1p)*oiE>2Tyz;%wHSyUpPX#t3ELzucO0rd^jz>TD{wi0At^4t zAnWVBRJRo`5XCHQva^|-oNOP!7PZ}Qa?b0N@ORGkPTNl+Z(v-kU^aac*|gujee1us znZQiY{jJc$|7rK`#vBt_*!uS7fK%YgC)&&hQRTM>?q?$k_eoESI+|KrXHtxfw>};y zzdhHT895;FIZ+^yrNX|Kn~#rA$~sc0t(t{Z5k|4E&`e!jorIV;-ka^`Ym>4(=ig05 zb(hNz`{h&oar<)?M{&Pj4LMqr+IGPQd8FMXQj$cSWCHfRD3UZaH1xA{ zjn^i>-s89bb>ZU0feNRk@;7kJ_1{@8+B|gg@!MOdD6#npx0&#yBUM&527jkhft;%& z)B5w16UtYu#>Q&GB@2@n&X=R*=hCAo>b^MWy}dkI zcB^kw?*)uR?Mf4ax3{nbn**mW+Nee^c+{+BTd$0LGM5dW>JszYULHBztbnQM?(W`P7>K4j zpRScE;~2U#lbt&3^*icol4u|d8mz9ZLD!BO(bAK17xQ*Er9ZPXrFX!k!wg4DZ~ka~ zd{$aEl;fQMR^lW?)#F57vub^b1!`*Qo9)S50_5XQjf^KDWr#^j58b+?{E&|IYzrim z_9Rg)W3B+mJ|8|{XWo9YJT2nzbYP(2aCa^_nK9R^&(u}Z-rgRDLgf)-u2ja|c)m(k zOvtfipF3882Xht^&1kqtZw<1`Mny%Pkk}n?D92#Ee+9ld9CGh7%iA2T_unI6_LB2~ zB_w6pNI0|dDUz0ln|t5$XTb7%f<#_pHd(VepAG-5A)^Uq>4wUo8c+1>FojxbYO_N% zTa6Law|et9Lw-~`|K8tOTU%XqtQ@_+I8>vREcRCZ-tiX77xmU0GwJqQ%^g1rO_vixo2bpP%rp z&A;C4Ru|yt@%T<=Mh3@(a{N$3eBG2B$7}se>v(K6iRlD~xuW^5_g+Q|4bQWXmvk0uKo!nb$ zDDrb(9dB*>I9IMR(dDs6h<-7z_?RZoi@Q5&j-R0CkS)8ydv|NuV{cwuT-=eR78c-C zM{3~YvzvoY&T?`dZ2yjSOd?)(AQ~s&4DT`MO)XJB;3Q*JfyL=mzoWc!vj^tm?TzO8 zqr*LOf#N)>jITE8moClp=Jyp;4CmES3@mJt(DJL^;w~bC>}+4=GgQ19c9xW=d%`6% zE2}MY_i%4%qQL*?U~Ba`tm(}_hkM&@Fys~u0Ra!rhCG$=uP(I_rp_p0>vt&c$<|Vz zlVl{bc=dW5C+@@5VAAn{E#BxMM^DKMy+>@gmtyX+tjV>_XA5dct%TItGz1*P3vix2 z`&od`xL9!~ZuKGDZfepvCVsjmXA=YUHuYagwt3HSEyZ74lkXnJ_M zI90}7_l2Lmb0cskEHZvx^740UClf6KsvruihdSc9^u8Zr5AOz!MVwt-TT7@B3q14# zpfTaecjb+o$>Mi``hbI7sL~MM5Tr1QPZCEU>#SzwrDE`QPLj~@##k5}rV2|+UNx_` z?P5D35DC}Ho_Du@dxeJIbo!21TU%TF(MH7;UPyp02NLokj)PaK=H#d{DA;6V4k3Q` zCzG69TwLOhN-WA9o|PUJTYrwF z1tu023v+Y+2Bm(r&Kw=~D!Mky?5wQg|8t(!XL>>{A|fK%x_S&&WoaaZg$)jgrASy> zSYERjJSy}%O zLI!YRc|LRIJ@Up_Z))vSoC&kDUV-dAn(yW4{#e>~Gv0!mmzVU7gMG){7}{Sj=2zzA z^AuJ|{R&LV=moC@74w$>wz=8yqQFJ34Ud6^6`TO@a8n$LR zRJBmh^f0=9xVP9^eL|ivWZ-6E_Mvmqbv4IEPcgqAuah@b$sMhMgG03w5bD5 z4MQc!^(1naws@{p;<@hyu2rT`USbm;(hKLcy`pc-*7IO<%U6QxCpt)WZG$?aSl*a9 zo;`$4+$Ez_yPtm(GAx&8TCE?CK+)a6y%!VxHJ(K@79pRVg7w|M;PIBQwB7cY{nk3+ zBF^|o!hN=dWN7wB{3j?XOPFIF_m||_vNjnBy>Z6-%i=TGm!4oICcDk zs^V&eC@**DPoG!zKHT@V4lVs;8M~JAQ})V{uaQknV`F1A^WbF>S)y+HvPXaqjm=CZ zYD~)PGr1M3{XHfcAGb}c9=V(GCtmmt&{)SLXVxJ$M=d7ra-ZB`^1aGN)^WPX+YSI3 zqor0`*rTOfHfDQo50sxec@nUh4-D5TF^^HcX9+~1@FX6WUQM>`?^m5R7Kirkk;}wbFv<8;<`o> z_NEbtDL&>xW^00oY9@&o$S{dICa=G9 zthi}o({_7sXJ-e;vD1}?p=PMwYh?`Zu(}o#Su?<*aiV)xX?2WWpIubxy)sY6Bq8KD zxD87iP$Ugj-_Q^sNzu!f*8s!>oGAl5nm@>735(3E+O5C*_Emri`lk#CVJr%(Ch3a= zxX#M1nha5__fuVaub)zQcV9feu2G(ZL-lcZWaM1eE4Y5?Ga65q=Sw>3cW3jvS8Ho) zk&5N@9<9$fY@D2&JUsb;E@3X*!Sx=5rrs*fkplCWCdxPf;-%IX3!Xk%ri`n3p} zJpq3HC%#`w?R(W0GMI4!B=UQ?H6{2$?(B7VDk+8T|5!5`2RPQ2okl$9?Ck7veo!X3 zuPWu<;b!PkkyxokNcPLDe`uZo`!q+p~k}lx;mxny~DSNXlQOx!(zMXz^G>ZTa z&#kWX&?$Aaa0G7D9XfUJOso$JmDC}cz*m!> zn%rU)2ueMDxK#O@Y@!DsMN1&P`P`HJ5#D!w-y$GHYy5VK_rDd~%;1QT{UJD*_Y$BF z^%;$r<|yl%H=`Lu+dDojuQannM@Bxr=@E||znSWv^*W$OpCh?2?=ZR7eC%cDoj!6_ zeF(*Gu<(cLd<9@y>eud4jG?p1(8_c5Rs6w#lv7yFermO!U13g6j?1hQYe;eP0HnBy zEa{}LS@vU#a@$8I<6uTxsIRnadA+&9`+i7(BStGbncfrdLL$Fe95ah-fZs%0!m7G% zH134ilA5|Ylt(`4fQ??Ggtb|NFc(sH507%c`}05ED%e}N>ZLf1M0W;II_fj6#Z+z$ z`%bXDfrxH1I0OCBM)IQ9yC9s^8$}zHdz%Zs(Dx`9h-i)S%0YIIcfHRO-Qe=Dpf4gz zdSY_YWB$hqBna*Ad}dWH6R|4Hu};o*Z?E{><_k%D_2I(@ty-e-I_k5RDXkBW*a>vBr9L;r<|Ymor@E4&%~V+9;nR#u>${PN`sqmXUPKqvLijq2dt zdmFFX-u@WtYe)*P!5Cd;fBy7o4x{GSoLL(MSBPzQ#wCDHsolFfW4K&z{QC9X%T<98 z>3vaXfAl9Nk5OglRB@^nEjAnlOkBPELTaWg^6feSpzS5!q3~kj=3Bv~CI#kB#^0e> zTj!A&1g{@)S+(_Baop7^rD@EDnhF_pv*%t7^Yb?N4}(OcyKtWTQt&z>iDj9|P&{DiFgidprpOY=F|V>-7PH zZ;b>7LgiYeDkAE(DS<`|(2APzf%u(YauwoS*aS@e{>kE8z3jH4>Y?4twj24IJ(nIa zieIp5p{O{*KYQlPBNo|VSLNvWd54LkG@wp4fi*eiWu!3S;b->9jNj<;wm{39V~U?W!6uF;XfgL~ng}fSlkcs!qB~ z{ym@KjA~yIPr=-`Ty~4B{f5sAlOX|ED?;iFo?j(OlT*5kgEM)vRI|F?5ehAzDg*pq zyblLHu^1R9zzJe0?exO-8JU^Kq{BOA+#H8%cUC7p_nCQ`H9ul9IAO-i$M^N~XIF_7 zXn%g5=qDL0G^-gudI%A<16|PT_V2hyZkMxN;lsL1`M|f7+4VH_U9WYSXhUz5n;X)4 z8e=^@7Cr+|jaI1So6=gbTEz2EUq3Y2j@k?nVNS>egw0Lb87o71NoC z!0mFMI|m6@V>JJrVz zr(Vxeg>|yY8?wsE1_B2LA1>~9XxJNC@>!oA71=n+_Qb{T70h3irg7Mt(MSYYyDq|# z+MXgQ>a%V;ac~EC1zq4|fY3ZHmQGRqRNQqEZX52o%74$p?vk?d@m$XRZ8qdxW6r&G zJ0OLiodLS2LuStb=m21*8r){OkCD&-?Fcotil_Pa48VOZ&rcYk0G?`e|z16Z{SLNd1be zyJmfTy|S`0l2)LtA|-}V%1fKDtI$j`rR^Akyp*NN@HEVK2U>JuVnR#ypwz8~BfF={ zXJZzapDWdgFNcreBS_~7cDsFJ;HUtw13IFIu1iM;02Kr(pbGoG!UE4O;N;yDWK~ly zr$}r7*alcB#>JHjUpm_92qY#Uk=+@83~6C&y6fYSZ-S@vaRjm9JdqrZ{U+~YWN7#u zh-PSofzu^tmbzl%1?d~g$M&~eJ)n!sp;{f(O2b04*UFW<Pha?H3J+XZ*WP8CWP!c*Z*2dstB1V(MV2J*Key-4q4v zm=3>1wOj5!H-gByS@M>9LK#Cj8<yKBAIV7yVH1A50Y`(7VlcsBSki2mJx z7^L*$6$j}3+HAf&ee1Wgnr~FpM$*&W{la&#%I53yoj@lc@^)MVqo%mlAx)%9-Q}l- zgHUj$?@YabFaIroOrE5se&tDtJf$I`LcT;?Rzpe^f?=kDBsf&zGdbuVuIVfs$U+PT z=UwtN0g;^K;N#=SH5=eFd}wi$smj(Q^OWFIPZ^&fIAcc)cVC@ifFq&T_n*EDK|%)S zK#BO3U@7^>L+blvEM>5M@{w0!-# z(3y5`$g!ifmFwKOHvo?H!~2qR}Puk~61hUvM;?dJ&z?!YHP8f_fQJzEk8YgA|S%gU+BBFc=|NjP~EvY1?#)LwH4O$AYaAc1Y<15cKc;435eR|up|u}cTLTnvDWD4( z8I;&D%r_uh0j=endKtWy-wWS^T$x!X1pG!uhGJDatb~kokY!4s#Ba>?1p;ylrGPiP z4&QiZZ#tYm=$|0?JLcpR&mSB!e&7bYM}L2Rcbq`OK2%W%W^O=NK-hPGfW=M3dPeI7 zuQVSQ*V}=G*4Ea&t);{#jL>vndVB`bU>#^(rB*PA*ziyiTA!gI=-NQ#_&l)-@H$EO zmQ9%nWKMyClE9;Y$WPrcIFO+)sRPq=E@T>}xi+QFcguwL37|HVUhIxbH1}z>d>ey_ z3Wh+vc6t5YI{TTXoFl)PA8&u_X-RWRUshM28-codum|O702CyDJrbjOK~`1Oq5sa%O!;3Ou4Oun z)VF2Bh@8R>dJNod3k9}yxWXxQ-3u}bjBo`||D2)FPY|-=KFiGp2C)qlq^Pi_KnM6# z-yRT2`g$hJ2+GiXm*1)Wo5q%wmOeh!E-8D9HAQV^>{!7#NT?rO8Q9o+$$mPBOkit< z__Y?jfTo8G4eWJ?rh&e`epL-*cJIZ@0PfG{PG!akF-~=+DRlQdKC6|Ll~rBvI62vL zqL7jmU66_?P&KOE=lCt^2iG|5eyIzK25ih4RD@p6)+1!ya65@@Y-)NT>Dhjpsl$`i z^3QsOtFmpmFR(CBaRlu%422XANxr~eg$ZqEvT>-es-oE1-;X3SvY~py2ttz@6}e|| zvcK$>Q40xPR3|x_(6$L>Q5YNcab+x0z^9(WfQFbA%0mc+{NRmcD6Af0jKC>p)sBM} z>pImAR4u3giBHyn9h8uA``$cQFehng$(bZd zp;TF0TSJ2hOu-CH9mqxOA+}xVN(Z|ea9RE!09~?MeNVtbYV{j3*ip0WA=D zY<225n7l4>-4Dl3-_`RiS6u6dz=RY&#{Q>1{4XiKQb6QCmW_W43c?z@%Jq*I;7_GN zs{n2%S|88^os%^-1{HvoMcPMb{3-~1f7b)bZ3$FjgttI_T8p7Q{+?AH6nz0e1s5+~ z^ql`exym>7PeG7ecHdkYNqzRL3P_-TJ{zQJ1b7~*L%Cg#@>1}x22_Ygw&j*|e+5F^Uc21boa6G}Bz=p6(J&SlS64~5>1!1Ot}ZUb#KiL+d%)Z~RZY;a zHi8-laMcf*X*j5jwY3>&FpdlYe0*lLUe5CJ@|KokuwFoEDzaa~h8Hy)N}N4AHCW|Z zG3fF+oRYmZ0RLz%S;E~O5Fs#Jn(FF$0qH=T{+D_(z_2yn|M>A^Jrfh|+neAEkn~)f zhvUH1;Yn96xBbWJFM zlZS8L#SSTUK5@`80N005z-W=)S%M-A>mC*XT1+xenfuIeMt(|v=zRC}Z(;c}92^>{ zGDD+xDoqPn0{7oStpbq+TB_BXC$VnRo$~FCPz+oKUNcZx{i3^shfFs5#pqaq41neh z!`Cs-GeRjep9?(`bsFw3xoPzJN}6d2tZ*&qjresjKE8rL0C!tU01+Jk5od%#8ZYU0 zfD6;F=Mfj*NiZ^xWd=RVbJ$yj@H`kLkgY?|MI;y>p|3dhy@0a*jf#)Nim9l(rzcx8 ziH3oJCj^WJ??Z^Fxp{a%isP>1KDD|OcvLgUFAJauCH|_6@q@wrGC7{klEHHRyz;@+ z_5V^n2G5Mm3{(`Y+JUSWN>MT7k>qk6Ak5anK(=Xjji=K@&m;)M&`rYoIEx1*9Wv?~ z8X8(!Mvmk4dy9H9C*YC*o@D#|1VM$h5tegic2!lC`|LM3Vwp<{4&L!U*AXj(1Wn&a z_wxU@#3VxR7q2yRzeUx+6Zqq*PR9zMuS}~lAcHw3-G(+3tRc9Ad!T~p>FEub1NCG0 z=X{XFv;DaJ+4><}4(jGojNNB&%yB6p#7BWAUSwos{?&>_Xi=pt;*MA9_kct&U*0(5 zruNYgx8K*nVII=)pgHu0d8>AqIs7z;;ImpU+^$YP$)gma;y|8KugNP%K=To}*?$wN zPWQFhm^~mFONxu*)q%A~0}|PK@#M*q#6(YE)+;NIlpXV=`I@f`8@grp1>mOa2GaFrYUl!$)RHXY}GEM4Pn68Q}WU@1rycU2Ck z2EY%M1867NcXgo4{Zp-0p;m&p&fQ09m4X4)UfR)G(r^3DhA0VY&}QUv4AjQoz4eUX$j0G20Ul*^%#78kG9 zEY&}rdH+o$xF@Hs^iP1t znQ3Xazzo5i^qG>;r**p&1|14+c4lTBOq)yMC<5}kwic0`#rnN?#g1eBGj22|PeLCK zELC=PcFhTm!Yr5%xFjiPVIh&fUpRPo7Y~>Ue-o4E1BiXuoPJO0;d(YCl~boq2|EoB zt{IfwR9{avdr?`x{S63Lz$&0Awv=QX=l?4an#R29&s0wY{J|+J4KoW=1AGP)BAd~KZR|^{ssTFGG;fz+`s)RdqtKsLMYXMM{Ea~Y8&3mk^yckT~W1DeVujOAK$z=xt2g@F=MDr)!0vxUWgts4nIMk`3Gb>y1adBhi z9QHibIMaZ_-@%z6Dj4$$ybp_2E&`tb2^1R+*8?R^uW+#*20w;Xp?+sF3D}W`K&~Ir zv_vB7N`Cm*&ufX&&o6RbeBgU_MAQ}4_C5fmCj(3YHe5?)M={kB41kKrEL_s>KpOrWmOG*|T+c5kYGsqlxukdO%8m z!v}bwRTz-QQb9e&=yy-%J1q!DSzB&=KU@A2=k(gr+Jz4ULDxO2{>| zfBqL;{ndT{jnn?mn)JWm+5bJjKNQA)8bs=BPaNc(YMzF5Y|l>2Kir3aAE(k$F7KJ9 zJ%&~nMB_e`T&$O3)2|DuMV?%um!IQb!{um^Tj(#D0<{MlJ^~&`pTuKwEiL_*d#+^< zdUiNMmIPQdW(@5qBAHd2{_ERP|5_@Lc%N63CTJUu8eHq%(K!k{|v{rY1`Q zE2u#YJ71mF`Huz7#_e%cn;soxvsaPU`)J|HH3F@<07;LJm)CExYHFRIFzA}ax6 z(fclHajKxv&Ie|pAjP2WGyqvZw3iH9hp44c);;@9$Lr|V%RvM|H=kBcGMFy*)3Phx>AL*|Z zo)Z&7+^|d;p1LE=85tQT7(`Un8NnqfXVMK6X3bFH)tw+)>+i?sxVzF%VA4CAM$G{0 z9FV6NLv4Yz?^pLcE)L5hLSd5S^o9(d04Mxh*S@P391yU3wdu?`uuZ|hoy2}g7S|(m zUi&IKr*{FYCyDwc||Zd3Z(UhySO z4hmM3nu8XTQZek;bfDjZJ{SCzCo$<-9LNwf#nS?>J!4nC1loJf-1P5Ax_WEPn=lsA zUodHWuYJ_d=k{{!qa=^64?G@d8p5?!^)#~%&-k0So5pAq^j2?W=`R{RJENe_%%!*+ zkg!cC#{;=xlzQ=3&d!T(G3sn8trQ7Sh9kI*jefx9P-)9J6PI$x}lB3pLLLUbQmV^VdQZK4C-%_)4-B)(>?!fE}8lw0xnY7P=E2cLbdf^Q-+&4rJ4WgB57+vEZa+VIR%lRH<0sko;&u(3UNGLrIh1f zlgC}Ylu9pG{3<(0A)}Z+?(fC;>sbH!v7Dlaze1GiT~Q1ZyHR+PEuP#44DNp7i~jS2 zzQUDxSPoX|pzm<1b#-Tb>Emg6&sDu?Fn@Qa;r3Q4c=>r*v47noMr|gU$^FOMsyk;L zkZL${mnwSZ8@A`~iXjIvn7h+h51~^mtgDH{YUmM&iKxP9d~8%)9%lJ{Q>23GaTc|t zcP0x_mSJR`Q-#q6G3VUF*LXB<8{ig>PvOC#`mS_(m2ToGIaQE{YD|#$33>*>B2$BFNV0&IZ^JtzBAw);W z^rwh9HH+qa!#%rg7aZGAd?LkjCw{Z{QzF{Z5FTulE0hRDEBdX-`#90)wf4HRTmLRR2!yTC)n;8d%#gnh4H`XJg$Wq+$&2zf~a00r7H zZ}7*dsi_S<0VL}OxwrZx(IoY5hDt9xg5gz-89qfz3!u^m)N<(8ZbFk4N+Ibn?**oL zu(pAwi&}p@ajtur7@UN7Kz>F#ulWAf1i~0dJG7fIt%RNjKyXuYb0A3dZ{HqP$7E$> zfG}=ns!VrfdX6~PKjiH0MT9we5s{TL2a$y`g9ivaZqE>PHKanjFhYKo+TO$X0e!jZDZpd*h&D@ z{?=?S4;ToS#@@xC)Abl2lAf{gGf-fm!2;UhD^OqPn?hA@86hfO@=#@Hk%h6tU5koV z-0CZARKZty+;tJoA2bY;A)e9>q`umU^WtC?O{CHi)%zUmNWckrlP+>$2rRn*R?o01 zDk*&ek$%wpkDt5L?v+Z_H4e8xP&iHzbxVeQWR-5|=-Bde2VQxUkL=;u#@;JkNR$#NF9#SLO*9v*>4VZtGc=kZv@MsMCig5==~zq;U7!!N@TRW%SIBpi?-#!Fug z7fGikq9QzwXNw?EZi(-)%`r4LKLmBS7M38mf?<;j7CH=&H-W(fH)9G|`22xZg9`qw=3$VN#uy$V zSWlPeJZo?{S?oNhCQA)R!${0N*jcfw6vb!ydqXMPNjIlA}G3AQP>76 z8gy*G>9jD9rQw5i$)(2T=35pL&|*wm21%&0KbSm<5) zZG@r43{@Nt*ZyXOi)b|dAkzJVsaVAByadi0G6xvzmxbjR;BL|^xAD0`!14qrO-)l1 zHnH69FGdyU49^I7`^y(nBHd!kPsDaXo6x#%@RMi+FM^=$WnGK^3~V7?CJoVYt@>JU}f3Wp6)FL-|X<{D25$ z*PCY$c(gYHv5M-5tE;QC4%8rGPLsx9LMec7bhfvjg?$dba1?GMvG4a>*RskAHkjmnstAL zlZ9O?bgAeafOWOVq5)+jH`j)37fo)Rd6;qct@9$zpK^4AL$wtWF0=P|EU>S;7T`Ys zdlYJhu`e^cX#s}H;(-OwzuG216Lh(JxqW-(H*jhDwbHPnF0#sh_#w9SCyCa@DtCid z(+iqnC{MsjOx!A}^MJ(&o;>hvHo?E%}5+dzb(ib+o$qm17bLg$6DzG^<$_(6pQRa2#>4iED5g&Pku zh#FuPbO@b+8K~k*td<37SSRcP$|oEL2msz`LY*3q+eJm-Q9N=2*5g{60H{|P1lVx8 zPf<_28F!)+*wUn=CeKHEf4RZL!V}n&+06FfbkQkEDIm~UL(Xw=IbY@H{9IYd{pc!G z-a3y0gGX1#oX2GiAB3zfKW#?8>h3qc^O@g(Tnx?ylGh{bnC!*CqJtyP< z!<)Y$TJPJ`;u~vgFN6J-h;{7uZx}+`l76Yah^PX`qjuPN$Sxw{0Td2|a-nfaR;?dk z8Em-yFfS#XtP`?D=JwNs1Yy{WwXmrRGzORurcfFWge+j9GeRN2cefgjQetB60G(l5 zaSKux;mun79pL?lScRgZ(kcSOdaX!kQs;6Qb<$JG|>ZBoRce@q&5qJnRht z4-hbxXDuEJ-`9qZ%549_E7$^3>>6)Vl8zq;=h$#C?arA&E(J zddOMpmEgrOpSt&O^{N3|h^1x7*mpyD=PK-5@Px31LpEL>{TNCCLWnOwJU*Jp;ZJv; zUFs)CkjnGJs?WQ-by@KN-5_%4A6{pO7}p);tC0EK2d zTvFs{8#3vhfMde};X+Z`Y&VS_(1`|zs$3|As1@E{zZ&T)06Yl?0Hh!cAA~oZ&{zII zB4v05(}v=q^P*5MZQ)cgs{Tk&4tQaLDaV>_=CR@+_p$H??btV!aD0RgL>GaRCxhT=$9M3e0 znT!@%YU*y{MhYh~B4bJ^w<7aJzeaGkq#pL8<;FUp2m@$)6l;GM3ldqx^{RH0&UO*!|SBJFf(6jIO?ZhW}~GnGAc?pT%k9?KE;XfRgD@rB9_7 zahRrI38jGi{$$%%ABf&2x5z>IJOQsj&o4IL>fM9i6opUA%bm$t{C5Ikrow=Fq< zZR&LRyZccNJ_!ZPRg7`92Q{$G^>y4%fyE0+hxX*j^`(&`&?in^3iLkKBnM$xn>CTst?@jGI0zaV6z=*dqp$JW3} z6$UAUe)27z)Q?UrBO*z=#nb3x9V}DR$ldu}R^udLP6-6q zpB{d<#~vdL)A8~IyvkKd9Q$Pz4g%+@AMwqJL;dy!{b`)8fxoruLY$=QxssQXZtEIp;DiP$3j_K-SP*Cyrfz zC?ruYiTnhYoFLVSDTb|T2KiUz=T{1FI#I;F5|aBwyFK=s9S#x@g-=AM`?Q)@E$U}5 zqaCB4Ch`GPTRMa7rn+;k9BeF_Kaf%tS=D#%KK!(ZZI4BQEPz*`GruxNaQgKL1elpg zibZ7`7b`2>huu?2I4`;25~w6XB#!qhitN%OsNF*Fls`B7G4TtyUK-T&A4PHHE^K-=XaOJh zWShji|2aDT3iltv?Tc20y*xMj$9G$!nJ7yL#-ebV-9f!3KE*h@(sw$?PJzJCC9n)sgGaMlW0Jj;qp_-P1N$_${CkuRtuv zQ)-E~eaio5ncX+Ckhb4oH2rge8xhc)S}vwUa}R%wt7_q}oUjSTr(lMr z)u1O$EiS3QC0KeIO0bX>UMC?DmE23WoVbUpN&Pwd-yBcH01bd%tv27F&IJiqjuYJo z8y$QIShj`qvntOI@o)uYs5pXViEkxjRJmFSKYDpHffM)v5Rr&5Rv&0Nzb3Nhd$!cJ zGhIgMeE4W5iQYR`_1DKwXs|vQIDW8>kUqdClH-xkzhqyN6hmxgSLMwbv<#K4)AVV2 z#*|~}PrZ$h^>f>~0e{9EW+o(>Oy`0NeWmc{vU(BazYdEqRl3KYv?)k%yLF9hqtLG5 z_)A)<3}T?Oz^wd`VhnIv9T5Lt-jx(;+cI&6R{S{i!OXte*{LS|1!WMwYRp}U{~|>Q zCcF`m^!@UDx`?|&g+SrdK%X*3<&RiJo$rZ5dgEVR;+hM8U*OTDDt^X-(pCPt!^fY~ z_NR{cev$}UQU4LtPRD>EUh(G5a@Ev}o*Il?X(y}Nu7HZy#dH=SbG&eT;E)zzYqnGE ziZYZduu8o4G!DwS@yPh2Lg+ovhhs4Ln~4qkoH8<~bIOMnKipn9Sy-y{Ta(Hk9=G6! z!Idf(Yjg8qXwK(7YT#Cv8*Hqklgc+J6c^Z6D1$t}nvH5Q|B4hvp2o<&R;lo9mDXnb zYZwmIz(auGk}2)rqGAo-0!pru?>ZR3sehIrFo{K`)VFms@$zVk_bo8IVzp9IFrP?e+vOR zD$ibjVButEt;LlSj>QN)R3-%D45^3_wi95Of~!( z&ZPXu5mvi=sxGhgwCA{$$lpFQxnsJg5kgkW4JaH4LW=5YlPC48BP9|1Nc4BbzgP8N zaPMz~7bN~Cb^LL5{i8DcXUUZM@1^*E5AeS|h$&)qB-cns{I|>;9T&lr!%L%X^5-8I z&^Gu_LK`Hb8e?!yKmbVaU6j=kFb2;oMf%^~6J$C9-#E0HB~S|ZTBS%DuwXlYZPMC$ z0?h!h6TR;9F~s0s3G|THq8>gf%EyPwm}Mpf-5;(xR-vBQT^dp(PZ3RT%H7**U@0MC z&C+W1#dN5NDe%ThKHx8MjPJUWtZP|+g`rTstAf7n6LYR z(0~9R0e3CB>*H{@uK{iOm%4G}PW`RJ$S{E$iO?Ag;6QW#m~jJtLm=##&C$zlkK10u-7p2QUSHz|7!8!+S;0aZpUw zN$b)j=c^y^At74#IFko+CEK$S}3BU3M)g?Jpb+ol#`q4A&jnt=! z4!J#M{)7|Mi9w}YcDs;`K3;`xN*z%7F;wJ|mYKu+DzFp4+CWEx zc1ZBR5Q^P92$w#}QD499Lh{k7+%Q!-6aF`b1cA3=End2QG0>7b&H7o{;v{z`((g#p?QBZJ!-)Hl#NEbaiq{9cFCzuH1UzN>{Id z1ohEeP_46RPqwqMIrF&nByp&Z_?}Z;O^u|MGy0^nWzy3b=GZhrHn#Md8eiZPnV6Uq zGjwxdR63HyFIu<71AV*3gn^GDviGl5hYiDh!;?{l8v;i@d`QpER^gyJMnDkx$rARc zo6Br~+^~O(5*L})H!=!i=tu5-wQA10A(A>=T3UMYCiqY56Njo&eY#&XhLmFnI2e)6-ArO9SY#X7#aUqBX@dZ^X;!ugt zDpB-GiY`^AuWEC1BL;}!t!u%8Nzt(V%3KjPIeh#1Gtc}*Z0!5nsB9uAPj{&&DJCWc z_&5dz*mLq-kd*y#YjH^lCsivb8}O7ACPv0>GN2EUAc7W*FMHx=0BrCmDtHpZ`%~3b zRh%3gViFRobm&9#kmwkcjzWU2FEgSSj?f+da|8e3=bAj(6KKxCELvV#8m`D@WMss` z!UE6as=s$Z0v>q;QN6LT0UfowEBddbqGC$&+zowW=B41wRP4ynh2) zQiS5zz9LmoqSy@>*JHG|H`;{wC!S#+!vvqLT z2LWXJ(PuiSP+yyxvNAJ6m*gI*y1K5x-N8fYWQ%F4|`0m8XJQNtGTbQ0v^-D$~p?Q8G0dbDvFMDt&sONY1{g(%hM_=u2UWV20GE{ z`_I7G>g!wMvjd71-Tg~iT2nlNuUuxoaoxWT+qj2%dOmvcHt|bKr(Ayuk5{`$`caT{ zWRxxvjGqU<_RxpI)RBIK#H5g`ze;s#>4|_vyWkgahgZe5w_n!M(z<_raipQ+#x-T! z-X_eSlQ(@(eU8&){vHx%X<1pB&kl4a5!1lW?uS@g>FVl++rr}rc4;^XzJp=10bm8V z3&G92$`tARwxWUsbWr6{m_k^dru=0M9&LVM?KFZEJ&PybYD#PHNh4=$r!9pExx5I$aN=@P|Wd zyKH$64-Z9jktk>!9fR|`VSo3KxLs#_m~q<6@~symTshE|k?Tuwcu&?l)z7PJa+ z3JUj9Qc_;M`VA-Ipt^MZdRkamSadWw#A9@w&_HMBuemwj@fOPRH~IOuK=pu-0KYFC z{ZnNjr$|zNIn61=&?< z&jVs_@Qk|pXRxfoKGjn+G|$^pS!TqQK-&X-aj4$Erl5c?`t50=lx$W1u*Jp2<>h5~ zDj>utIQ9`3{zog<{tsoo$DiaN#$|9YYTeu1)+J#zo6(qzYgGbL)}dPwd2>2>~tbNn(dzdZBI^L)Oa@B8z8 zUt~LP7F_T-ae@?@!{KHxu}=+JK7(Qyy1xFgCg_ZXO2vM!o$>wa&B{#{DAX2FS=o^U z6D1jbS#$HXq4(^kRo}P;73Gf#dOfdiUHi#skat;NA1^#&sHd-Ax5kx2UY|SHueI0n z-Z4Yf!0LwD+9+_h5Iescb+j^@ABdZv8PHuGB9)QHzi(JHu`H3%XHq0LqmwjG|64~O znA$_EiJ;A&^Ya@j$lsH18I+upbDYcN`uhG0Qk90cLZR_MPF(9$l%N=*8qsw9ZoSfD zG!+#`7Q)2}8Qo5KGVwEgKf0E3OwG*9R##V@v>aGKS5z5ENX7mA{oz^g;~hOprSf88 z-m2$Q57xc>M6=)|Q+-vv<>tPG$MAnyP-b4gzE%D9ZnFGNjpXs_AnAaMv>ZIJgAefEG^mX?|MCyh^yj8aX?MIyMS zVnE&Pr_*_q9_PY|(#uZQ zu+(EP3hoRBKWl1gnnF+Q>T+T*S`!nA(qlX{qsy0NV`Depy^D)aa`CvzEXuP9*W7A+ zL47_uTV0|J09PmO<)^1dMMwWz-%Q|AI)L;0`uck0LG*NYi(%b@wPRsn0S7ETjgh-Q zZUHwG``6Dns&_G^?0$P5$wR}1eE>5`0~3Smci%~}*=()tR>l<-6_9R$Lx1Lq!+FTN zYDaf%XX@XYg>MfFv%lUNQEkC{xaF0V)BgyOtCz^AtNX^wOLc&)CiKuQTzs^{Uqd%( z*B8b)!scdpjKmTb+d4Z#;9-wr2d4w)2t}foeS6&26{Me7KN=fbhh`r4`_HB(Vb%eO z#BIUP{5AHH0vp1D^4^w2EkuV7$wvN>)zTTO?SV3iyi89^P4qnj2g+SuA61*(5|*jit|gaL$0F`n#{ zA_hq&a_-|F+$iGb&*Rpgrm(y?oOM!XFRlXfgDnn2r{%tQ1HIVT*o1@+!1(Yhi5QmT zMS|h-YeMFfF%UGf$k`w=Iyw_klH^7R$IF_y3WdNTO&=}sUwr;~9v`oLLuEU-_4e~1 z6cZMgmLRTk2lR3+9can+_w-x>;|-O>8b*i1kTdl5LW4$XkT&d58QAoZX(SK`=4RoZ zK*!!_vDMZ63No_!S2%a&a5#R*5-lm|n3#x3yg(z`9GFr&h~IK`9h0lfYYV8;;6@i` zx>KDERed;|$!1R&gs7f}9r)#m1Yi0-H{MY;U zAz844)TQf_rBszYktq^{1+yVdp15HGi3gqjb9}`SLq49y<<7ti%3H8hvX=s(3CYaN z)MRsN&m6@8Z^lkrqydawL5I-Ow2KUW6A+IOBpmCy8Ym;9F;sC}%O*^NYHe-3vH%4? z#pYv4NJ?D9ut5cKu}Qjy6C3zdtfPN$Hed}64*pP3P+9#FSdE1_<8BV{uuAq-@3R%5 zP-0*uQ_)WC==9JxZBCt9vP7GVE|%Y59ahZP7-w|_;0$2g+t05VWr8=@YLUVa${ zsoGjEaRfOb`RFK>c^R)L%cExSGIJlyBB*9@ZSBo$qNXBSg3wUJO%g1Yf`S5~>vqV< zl$Dp;0n?%_H+Y17s;;cuen7JP;DO_wqA+-}tBk=?3DIL3VYO0Hy+a|cZhDMEXnl^p^evpW#cuMN(xo{c*pe}eA z=lmJRIr8%Iq~z#M?6>C9yp3feD(rnLvs|n!`*bYNbvGREK>Gn)NMF%^(ASs6$1s20 zJ~Ydo($PO%kp3LLZ>08EP|kxqo>FYT;1~M@)N-~1S@yPp)p>ka8u9gG%I4;k5N|Pn zYLGN`x**kSbZF?h{X%Aay)E_l$&;b;(HO|1UkiqYynsTcg35$Ky<)7X?F zSSJxN9>1-P4Q7NxYvY!M)|U5F6O?k>tGPLhwy~sWNLH4zaoWMbfy)&mh2fOlgcOm;{sotW1jr)q lA!J8*+DT{u|Ig1Q#-?8W{_lrhXpxt7IdqtHi+TF5zXK#8FN**G literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/v76_erk_stab_region.png b/doc/shared/figs/arkode/v76_erk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..eed5da6a7cf6f59b922167b3e0fc3e13f76cf8e3 GIT binary patch literal 24295 zcmeFZbyQVt*Dk&Yfh`J1NK0)*MM*)rMA(RcfKt+uA|Tx%0)ikVrIZ4KgrKA}A}W$1 zB`sYd-F4>jdEWDVzw!IVIDejh4r9Ep&)$2*z3zM7b6)eh=3JpSRTWPjXE=@^$Vnxf zyas|0*dPdg6bU|j6S3iv1OH$i;B=i3gq9NhAD(5}4>$@Tc2-ikMm%$zk@7MZX`MS4 ze1&zsrsJ$>Z{h4_;%JVj$lkgkD|eCgmX$fHiixw8w!Nc`(?wP#ySqFRI>U5uJUe>) zRY!9ZXKQ;q)?3!L=7_+ROKNwWFA4Ao2(t1EiU|pb35wEeQ#?lyRzyi&_Lh6{?_q0q z>f0k*E6oP_ zwbWZ9lX4-9_SNsLyRyD$9n%SXXcTI(UmK$q)3+d0NhCkoUu-$k`n>plf6?1J zq-^(v2d~i@IQQJvF17BmnEn1r+rTAGY;CS9JI*7JVs373W4{FgvlCbSU@7v}@JOUzWYHGsd#gD`+`MT1_ z4HoWqNUYs>Ovdbd$z!n0mbY$yweIL(si;Vxe9*Rh5U%wiDamW8W-EAy=)**WxN3?R zjcKsmaHUF;@TK+rZ{NOITU+<{_g@V@QL(?;a<#hgD!F8LxxLY1#z1)##rQX_v~?pn zc9NBzd%v{P=V}WlCxe_L&PWctzx$O!+~-&Q!+{;Rd#+T8_s%NLQ12l9l$;1t1TOWz z9$nluztZ*Y*9f7?WWCt<_<{SvM_ZfCaoiJ{^+Od-J+!vH`MUKU%`GjZr9L}T2`f35 z9IAKc^Vn)bZhijzx$?BQ!+4`{SmnXy;3s|Dr{I%UwWro3br<$wHg4a({V{cQI?4VX z3xl9V_-4hmYu75vWF&&N?+Gn)cj}L77mc4Q3;a{FH3DYCU~uh2%(G|2WK3^{$YyR< zjqI?!j+8$9x#-GWURb@_oSo`<-I{a`2IYPH!&m6~+}-5jvF zGU{FI*f+6~uUkC*>*FJrH-ggAbzWP4q^RzcSe?3m2rGS|Y7e&4b0HfobMw~%J|op0 zrDvO}mTK=*shqx~=lqq~t^1Wl{R1qnANI_(nv{fuE1v6CQ?50h8$>7Q_>AlQAG7#w zZ?8-=H;Ot<$Nv3$qviptt(~v)YN)-VL%Wt!di&R-jfFlIDen(OMUH!$i!<#hHvL6Y zuM-RhG87|EaVY3N_;`$Mz8@xql(+gF?A|oLL(wZ&+!_Kg13ZaxAx<;xImFJtUH4!b z$4BrGhhibFAC{roR51Wn8KmX@lqU`9FGmo|&H?v&lvg^dU^U4Fmc z@o;Cx?axpJSnJl1lUhssr5+EM-XwZKi*w~Es@a>_Rv!b7;c0*Lv-v$-wN>bMVB_H6 zU~X={^=BBYMAWz*Ni+4`oy(>*bT?^xA%reTx!tf`@n)6dBZX+HBmCkdW8DHP1 zXOtveP9B)wJQHGyhj%3+{dS(#TfNfNG%1()TN|61O3&mje*8+MCh=;-cdhM;edXNQ z4Le6i$CRV!4}U5boUiTw8Lk?29kgv;Y;A3g=1{y)u9hNpTT_!Noods-Z5RyNKF2NL z(jC{9OXY!UPY%UR!GU#1AMNjMEC>n+*j2B5QF?Z^r_jiV*^nD`o1-Kd-z_wbt{!*Z{obOuMt~8xKwz=Ij^IGt)7&mq@)Gcs;jN} zi@(N~dbEvhTPUlkkqbw5&2?`|tj(P+w(4X*YQLu@eNa*s+_Wd#TY384CZ(@WQnev^ z_**GGJv|0fryi5VYD4?mw|iiU=-&w^wQX)sMCLhx1J>|4$H8&6DoQ;=A&1;r{MJtF z`r+PEc2?GIb#oYR?Hhw`Fs6M*?SiU5VjJ2w_sfjbx4lN|Qq`n( z3_i&?KRjL9TW$LJiE-SA;XiP$PRbhGu2V|PyqS7&dc)(|V(+GI5PG7vt&2Okd^u8c zn%6L&=atJs@0hd$xSDyY!E*aTRq}&Nv^PRjpHxow`Q8tr;7Q>AscBbt;JQ)JX3^DS zFlea=%f0jaLz(Shs))mQwBnhS=c&=rE8tPKFJ5S^Fa&dfD4g10FRavX6*@&Z&{``|LWK zx06try^CQY``VeI7`HQQ=k`urYd-P%sdKWy#ajmp4q_=%ch0UdpHdAt;g|GS(<#LC zjQcM@HA{1A>n#?~g}3D;dsR?{@X=F>LoAkT# zAj|qxf)UwK=)kO~^X&H=&FtL%hB-7wd5+fljPa^4E`5n$uKL*lh8xgUcyI#sdGqV} z`T53b- z)1-X5E!)zhjh_GMdRF5w@r7Hvz`1Jp_3PJ?p6fTW-G2X6H@G#45lAjgl=iFLeY5E| z)X*U3vTIXVbK3J$ugPLbjjFBiU|wPEylYinZf=RnG2tXzFp-hbvrXWBt&GHy3C{=O zR8)LmX6g=i7t+(&ZSU5nUki)fp}nM+=`&p6Gy^auAt7P!GRCSd`qL;IR=SDAuK$tAhd7lnuFuza5rFv_#^apFM%|ENtJ<%;kQZ?*5-iR@;EbA8+ z5-P2%)bn|=c}}+2qODt?#N2J}2j~94dM$Cfp+C<;U!gW_&pVT=i}5)<>vLV#aDbD> z$QKG+?w6`DzH&VbrQ+f-ss-FIh3;9`-SN+1Ha?iDVZ+Chi$_yy;8ko#YlpLi_%B_u zJ>1`c{m{305~r-JnUG<#)VJG{yHzvOv$K-_X^Un&l<@qk)z#JS92#6IFEUf=>}Ec8 zmJv_R%y3ir)ZQ%7o%#Oi>cCNw+v32~QS8r@wy#r;Iiu49PK9sU*rcS_@W3mS+}^qG zYWqD+%q4fL9P?x5gJmMd5wOYp)t#N4`Sq2FuiRAjH5*zk>6@~0G(EddnI0_d z^$9x9-b~|CFjw5ZPf_|_|JC35vKr`k!H`ut^^{3eK*vMM_SwPih9=8Et&dk?>6{O_ ze2qVE?Y3zUOPU2&oG1ISmBIL54^B^w?hn=a?6F-9wz{LhD16`j_s{na;!i6DtoP;X z3Z`w-{XTCySa!0^L2kMK)O^36cRStd&2)#V;Q_5m2!^`P3v8D5q&XY=z2)haBn#Uk zElX+(DLAk=(Td?e+D1O5YH3n<$vM3l``O31?neo_;?sabQU~9CmHgJ>CXzwZ0;mB5@CB*ahKTnNBVKn-L$&05cN?K5y zS7TT>xM=tNauNs4Vj7u$^{>VPe>- zQq=s%elSj}$41nrPX`xYwylOpU_blSl12`Ts~VQFXr(JXR@s|fVn1qVAF|$mYJf`Z zUUuG5m1m8i?K_BiFu=YM?Z7lv8=oZ)7hj2mWuG8-(~D)v01p8xkD!1VU?4;>?(^q$ z%kKAodCJ&BAAeCdCLw{gJ$-X&bhOw~E$ztp)7S$M@AkeoHADLQyt4wH>$7$HQ@qVe zghrlouOY=)8Fm}J&BDxY8d&f;sKRw1OlSLqQpIG9^8QR@;HR}tm(kP&^Z_l{m z6ak}+ImNTsdd$Dm@;jUg(!3+G^f2)>#f#0|%g2r#t5hX8AGl24D{0a|I2GJA*9uT8 z(!qYDTG!qLl7*sz_dhEtDlX}jh``ui2-yTeh_L}|!O6)9PfzL^GhkTbnd8Igx;W4S z85D#kp?lpp`y4rv$DbTVJZ6r0zky6*e$l^;*kxpI?AGlCFSXfy_xXcbx#Vb8&V-nl zALW2heDYDFnsU$V%H?SNo6AQ_hnVZv4Q(v~}y(lUQ(4cMp2mY$N zgp_7?7%eFqEXXH=$LFj8avB<@I&N=FL`w5;b8CwC!{SQ))O8QQI4%Bmt#bTf%@){k zv>+rTG;e!kl=9@s@x@`QV}D{}sY_3!-6nAto)%m3Ips~O=%%=xwUWe~EO9(UBW4+sTz6Sv{=|?>^85`03x&Cme4N4*5B$YP5F`MDa(#-!reTU-z@Te16^)M3r0s8bvcn| zBpG%?VMzdB&Q}CTo{4mIf7tP|ef!+Gb2kIR1{YHW%%AKkv-}=9%@$bU3W?nO#zXIR zm;4l?e&zvR<$?F#Dve4x%?T@wS6*D=U2DMmR9vdZ0X>8`Uj5vxq)eQe$z%0 zA=%S3G|W=oIzCNx=G@}qcbNUw*1Od9($sl-(+y=3Ew}yVUMFwzjXp_aD7yHhs)VD2HnXcWfJi@a-SXuwdNCERmlyke(+{rVG6Jw;A=6dDhdmFp-6 zmK$yVgGh?q%L&+eH-Gnc0fd1a<1p3`G#^J9NI^qGGhowU6RBXmSH5FJraoAbrI7sM z#S1;PgG+(mH{FvYy~;eTI>sK%iaEH6$Q1^qLq0r@;q7jb`+2{t(tsD6T-ueY;`Sw+ zK3gqK%Z^3D{lT{w&iSj?Bk>n?RWERJ1ES6y^4;vWEVXP13v@lk=Kb7_@_ym3W2-(kwJwTRE8L#l@mF@^; z`or*Ojl9)s@)jfnS1}tc4iC^g#xw*e=51yti5AJpCoeA;88~aWc z^Jb$lj}219H%8{bO=xDT8kAT?yS`CWPzV;ll zg=SOA0D?y_A1G|8RO<P zl11AKYqfmlW%dTuY)!B0WjM;rzJ(s)V>ud{nx%KY_1K#kcu6};O0oCg5LM!xi$yM)0?GLmyUvMIztMf&4cKkmlwqh-!7fbA04cetlh4^>FzUxnks*x3-5& z0PY7$ZQ>Tn6|`qdZ@$jV1S0B<8>Dgp24zAe%Y6l4r@%H{_NtJp0?>_M7JqTY zzCg8lp`hwGDQW4EtC7c4oRRlR(7>30BZMvP3m1MIR)V|tS^dU^$NNBkrp74GYB9v$ z*>>&CEVvH1WT_^gxPY3D!iwn^fJITJ>4@P>PEJnwh-Y5eC#8#x75<#c@k}BQWGYhP z;$GJzx-btpbx7Lu=C4?jl=t5UrwayVKFRTZ{ugAJ^pc(>p4wgygcBjAYkQeDK*lmP zJ^f|oLD@(R%e1!5wzH3fiw{^vOm*D>Igx;<*XD0XTLE4#thfW%Pk8oBbH>5%Or#~` z^Oo(&6|?DK1(ov`3^D|`xw)^{4ot4NL!M1p#pXLUSY#fyd$bUHUNhBmJ_i?n`f$KQ zBK0Jr@VQ~mBq5t#$W4rsR(|&vqd`zbMa9*%%(dQ{8jdNo=}QIN36#dbVZuj?g0&HH zwn}mKm&@f9Y!YWW0J*u$erKDa8UQ5kPL_)c#AjcDNEja*+uhxrnVr1_7wt7^S~l4p zAwQbPS%C0zH6S0rhmW?tezj%CnWVP(XMg`l_(@!{B=b5`CB3{=1s;DeQAGSbR@CmC z>*?tMkJ6X=M@RISlC^b?!?jlt7Vx~VRl$3_(VlK=Y2hesWD&jQZaPZ&B1>OLFh)+o1HL8_(^2r$J zXl#_sCrYYj;3Z(g3knLxZO=MZDS3b# zpl4(LuA(kz%OaQTNcVzS3c>s}WX6c8t_^NwBv^PummP(hO97|w_wY>nlkzBbMnnd)d(f~xf&%1?Rl5Mwg_N?*ySCU_8t z?>hmcJa2My#eDZaxbC*6hzCv6T|p54V{n49s%q_G*f`q+W?U1yMdUg3;chk%{VGs^xi81j1KDa0Z zk;k4t|817i-<<=r1d3A%)aW|EkKZ2?{?{>qzESU3QI+A;D;Dgv!Ebf2)Fa|OI&O76ehX;Fi-!DHRCg;(4 z_iK6V(|a9}^f2_+_;234aR=y6c1Ge&$_Jml&Hep-*u9P8G*|3LlGD=az^Ce5Wa_+z z-UshKz*-<{flCvpq`4u4sK?fb zVv9OoAM^Yv>X zyCEGk8Ij)mT};ER1>#y2)L;ABMl=vKw=P8!SC4)eRw}?M=K|>)+#uV3wJUDu|oJx0*^tgw)JqO zi-$*rYwFJ04EO6zAQ5znEdV>9+D#BeO9F4?fd%P}rK)SYZrUW+ro?xvca9^JPu7i^ zu4gJMD|27Gcq_{rh-I?J8L)uQpFfAlpnkUfg^)4{Kag)zc5rb>gIZgMN^KGZ%wY{L z0R;?t5t>b%2Wo~|4$VsOjO=#T=j_S{7dFti2s%*N;3Ai5^3CafIIqpZrZfFBxX{@1 zg|)l66zo^7XdAS{hJ&YoB-w9!jM%)nOHCSRSzMHbtTYbspTcrJ-{4KmgV=%QadtD4 zlPAtdxI^*)Il|Ild7*#<(AZ>;??Rw#9)@SWt)<0dSgj-a^HQJ{u;7r6Mly?+!OH4g zF$Uxc5j{RR`C_2ekIZk6$fdyj#b%5&Hw@ct0dLfsdz;(58BJtCu7G6Eqbp0LITjYG zbI}zgh~^#E;BjFHvp>W5s4TI*BmdbH6<~HDyhEIG3H4m7VRj z(5oWeajASrV?miimM?|~LAuuH*)vMW#F)qy<+HnTQimKMy8$T&u-su-E||>56ob&c z$s@;H0%EdrlDws{sGRm&{m&Uu$4tPtQfp=w7QMSaa1`iHzsLnsD`OOf4)v38Vp6ghOUw1;O`~w*w^$dx=L?! zYaWuHe;Ong5*~hnO`f@c-~H3cE5Q1qn>ED|QfW{;AR&?R**&KTOt?Zqi;(?@gi9*u zL;z%FeJ;@j38RlO16hC(Ac=5#LHG$s}~Pte|WGu`Hg_+1cjWLr6p*I z?)^pP35K3IF=tVw=fP=3UcL|@}by3I3CioF{nBV$r=g+r7=^@|*{b}Cnyf+2ghiqRT5t~6HQ-P8tB7pPDLZE!%O^kTC<u| zpZ)p&;OQx3banf|w}Q)L+2BM|KG16(le3WdrJ_L%J^)MR(H$l`90iLgg8-)pIm{@K zl-&u{Fgq|r*y_R39R&tet7~ht7j-B$OmAL6?JR1R;fkFEFw7vK(i@QYMw|ZC#Y<EK7oZTjpco1*cw+14eb54R^Q(|o`cV5xx*s}m;pNoBZLc<+M5fl^zX&q3sHsIkY8tlr^K)|h)|3HKZ5Y+>* z6m*w_!*H$BHh^2WV$=J3955olETC{G#-CfJc5ckC&2(rR7660eh}@7cq9iLSbUcYE2L}gvOWb+LA6|bNvx3lI zVKEJ3hz$jLn^Nw^bAit@x{(sAAp%p4p;RcFN?{5&H>pLT)_?Q-!C>_R7RA73!&W&cUbg4V)bMZD8TO|i@W`SWkxlkl(pQv0?+NS$8m$;z5vCHz$OQ272;0bjbuKPfKOvT zKR9G;>O$;;+JJD!L6CXD=gWmaS;OO2N!)0Hu`!d2A*-LX+_BAH9Y5f`EN~t zsHiSUCunlSEZ*Oz9N!vLX?ff_ziRKdm*lDM3lR#8B;Vyd2{9TpB$bpb4%Ui6(gW%O z(!bQ+rnWX3x$Wc-OSCYc3a}HkoIa%c1EI`f&fD{Og(ZJo;Nq|_2!M9OyFe=+U+a-R zSnmQ>0|sDC>j>N%mIEb)7!rV3o2q~!3?s~0aA77fza1g>|b0M)AMES5q{ex_R$ z{CRPQ>0pU9c(_zPqXR%fV9P5W=L7{cy{;sC;NR#(vx8KPXcbts}7+XEs zum`Bm$fABDsY+7!ATf^Sv0ivA@SE>UJ^?TvJYqBVR}S<&+_6kM521&?jIuqC>z~Lo z^9tacHTqP{-Fezea6>679}S`TaPYT$#79l%)Rj$#U6w`;05Y_F`=(B$sW?27=4W{G z=F61Te#^Ad`~3o~+E8)O5Bm}_Kn)Gwr%ZraI>ptPVY5!a4k^gb@9r%FQi6n*6d*bt z5~@5%@O@$9;1R_*2q`XA!)lTnu}4?WL~^Z8@!l!RPfwSt*@L`C`}S>=3;`p4dSwJq z#B^IywrXL1zJ8HesB8O!>6}MNc9q|<%RqEjsMR@V^@tF`p0>Ti!T(+hK<*JZI?L8X zbuBGnz)-M0w{G8F9If*M5)Vx444<(~U<>R>R4j)iy$>WQU_Oo@1X;nx2G~M3ofiqQ z84!x!_9qsJGZ2D(Kt~sFneT=qoJG>}mQN@;2JoEdHDS|l!4ovs0+|FA2D=b( z*az4tA;bD_`HklUIiLytf~?V8&WCudw*6cS3RsQDGTm6R0f$ ziF@t*`SWSstD&0@MCZ?bYx#Pa2(r5C%F0g*@R1v=y_X_-cjPwRCBWB%n^ny&zEf@| zMevN{mags&5P+6uX3q27Id+A$;EhpgVsdi(#LHfBwZOxrqeFX8pCC5c;y?Y-w`cdh zy{d%;BXBlQ)v9G zwDb||A@EomoC*3xkhX#U?&YMuKg(Zy zH-5eE3(gxx_Yo-D0jyeJEg@PyG?(n&`s6bp(AYA0lv5)*E-w#-6u7?n2%EFKd6&{?>e7kZgiX0AJ z=C&25uQ*ppr$O)>E?qy5dy1^H%i{af?5uy|5K&-H_KiCJf{pDY47jPo?*uX1*(Z>a zlA?zMTA313XkwclKrDO<`+~#)oFk(FDYAdzm#Aq-IAZ#QkUk!=iIXf+LsO2SAM{OW zko{xgNvtNF55~405oSh1jodUJ2)f7}4d)KkWWC2SvI*s4bmKfdIV?WUa1YeZwC-(@;YC?zF>oE?_=j7xgaA0UDFi z6gf#@e0uWp2aPM`j^Ctj2i{4p39(u`GA|dPG&4r^F)+038_$10n5ew;u$m;1g!Uk; z+_;J7>09M?=;KKOR%W|lMPNpsE& zS}gt{4#RcsVJe?=W1TAtrkokJ}K}Hb(glzw*YrTr3r=&h^zB~AAT3Lgy)>_KNEb#OZV3L zi>-0lJ7&MRuY5j>ckddb*#~_dZOCur-IdYbDyx^UXIOOmMKGmPGX|r@zH}k~BifdAezt7K8IAq~`&@ z(jR}1wG+o;K>4DltX5c2&n)gCA6R7~(WMB5qU~O7r%aM}yJPE*CMkrmKw3o2=J!s= zJ@|=tVJcVD_i41r<|DH`*|V@8FwNt(hM0%HXL-%;VvU*Mo6w-|F%&r5t7F#TCxUrm zQRA0MXDy+N+&?3w5;9r&^Dk@i=#*agSE)BiN5M_sSE7kOhVEhCR>Id9^KRTzuz(HVpLv@@$7t*6f@{@*N?y@w>0ILx4_FH^#EbQ&^heW&_ zop)KkR5P^%Z@{xOp6>6&m56+KHv0ZPJ115lfRKVpp7zuCajT1_9Qh9kF|5s2&X`fSiUWUFI&j zdrn?~@YUv{Oe$>tBSMS}Nzq*yd4)j5LGqY#%*6mgjQ{o<*?WZk=&~zwh#&v>nE+4b z3MJN9U8^G^Q$arR2YHNY)H`bUMl@ckh2!HX{+FANCMAz8z>RxNKa;+VX24?|z(x7r z*7@^J=;JBGG?)<6)S=hk`Ga`QRG|3gi=ywj>|+!xCbC$Zj9$EzCsqXC z{}h}VIN1TQ5KA}8e=m7}xCrK6gH0TNB_TEz8#u}sQ+_TJo@J8F!#mb{!`L)gmFcv6 z0HGPH(}(oVQwSv(7T=ZUYjLd=bVw^KL1JR^Ddp*#Cq$3^A;#d)FJfBz)yql)_PzIH z^;X7Ty<>uh5pXQ~9?gtbe+%ya97k7z)#pT_Sm08`m`Cw}d4yrg9mXV5X!)0H5_8zbJb25^o1B{j?dGe1}kCqe3#9^-9F?{he`9 zG7Zu5`i>grCP+Ome8P{uV5d|nfcTHXlwf3YIcm%lb>eR+QuyD5ajaxs*VlM^0%7HY z0rGiJCP>)eLpXs!h2IKQ&W*!Ex?#cSuBJ9}cD#U!XQ21SRdO3Sdz%0KaQ&ZO)Ei{( z>tHaHAuJxgMj?@iu`L$IdS+5de>ES2y!;dMln04QlX#_^Dujo~L&$23|Iddf89!xC zC{b2obx$HP-BGL$6Qj7CzZIWF{NF%5btjk7Y>b(Z|A(lVTck2N5SHYhV=I(ndJv?M z&^Ah@yNRlDQkM#mxdCTd#jrU$@R1=m87Z+8$6`wQm5KlaCuXoC}HdP(_#$xNs@`NuS_AWVk5J&Q*by54i-ugdhr_?*T#G8>z17yvC;96jg-{tw&H| zmI&0?GALtuSzSG3xf^ndn-Qrp%B;J+H+XeOVSi&PCS8fj3-h#?XPbeY-*auPfaDwHC zZo0TB%#qJ+fkUwXkJWSEum5fGd8Me*2Nn8Tpwj^ChN=!D9UUuY(GYH@D6R{Ps4*S(VkEhE}21S{DaBP$3JEAohuM1liW0<@?SK*6OzC^e=Bp|&Ffa@mFM zoM)$8*i>5?>RX4Ms1RcYY*YP^UAg03D9kvFBx4l5SUbh)dn5Vd4Sg}B-V7FYve7?| zx76;QMVm2G1yQ(p?-H4ObF=i;`XfSLlioCBoWr;T`;nL;9s*q;-%^EFNTdw@^6_WB zj}RB|)V?OQbPC>t2pw#g#IxOC8MFxbG2K~WI zDSVp*!68_jPQp&5G$l+_D8!pE0i!KNur^kcC{_~#i{p1;X=T{iWE-B`aNU1_p1}ua zM0|@dqC(FAt$|xWntIt*l-MCy$Jr#kWy?6A9)EbTY&E? z9Rq?MPG}k#NQy*}Vkol|$*&^FI3&9CSZ4y3lOXfVK}1B5mk?g2<7ZELGno=2O%Mz785o8`bF$@uOBEI+X(t#%t|4i`jtx*r~kQl(~|FoX8J|U7qknk8_;3{uxYx_az zB3f+>^@OUa61oNkDKRmQP@5!V_5D{fcOjFsuQ%}DPYX`5!br{HCxtp9hsHiVhJtMm zNN>IugU$wqeg7~0&LI`F)AH973C;IhV(+BVOYb9Q_1vz$6Bp{GhH8nMzAf-c#oQEqnz+E&K1HV-O{AhPnz}x-!C*)M# z21zjW>J2l)xqvb40|<3BG#r7cCuP$syDtg_=-^HRQ_+-d37A!odB80}Ge;fh67IKl z?r8Zce}0UqEl|11?tgA<&F(f};45EoFM#-Wg>4F1s`}d%b&}}RR9|o{_ArW#J|i_1 zm8U)~{w%(#2%;e<%a}>8yOS2Pjav_lpWVOYW3IVTN7AOvKi=4kips}RtS^F;_uj@T_Y3vG|PFJ*bHt2VJ(BhXn@htgv@$t zanRD4O@@`poEX8i*RzxYp%-dFe4uA(YGwv_kD_+oU8s~+eJ(Jy zzt)ikln6=)bod>joCGkA9#ECBP<;bNgGs!LZG&2OV8H$MR}|R-hwXrh=!fPIG)6&r z9H{mG7&_<#Xu%^|7}_x{2scK1R9t*JN1;CnC`;(Wn1*`JxbxYnDV5N2p_(kR0?dh# zYri>Ls?AhEDZhEZ$o$!Jr({Z2K9*nLJ{n5mki7uH=mW?yLG8h=--ohvX=y*u4_vDx zWBTSt>*~7ZhN?Y^U3ZNRR}+BthFyP}nmW+EGHz4@E@y8|6-&Z8u>I?w4SP8z3kuz# zEvFzicXzdgH_hu$1-OZ136CFBj+|UvP~C3`C9Hi$em=gwzThS}{DAXx#jsVnE&UO! zvFR%SqP{r;CZ*Rbi!cX@tQR2$!wTNry#SO8jhsH5E!733F@Y3d@nLg$1Yi&XPT`rM zb|1^p^VOGgKF zP_5=437RcuOc30rNg}re-+wn%nZYPCSV@04@d}h+;7KMfZ*!LhToblZ@VUq_|9;OnCDUT$+eT&{)s-Avf1C^Xt z?*DuMH51VMVw6&Qujc}rd?2kdY!5!6HBKC-6fENn*jBEEXdBL`bC(LVy?g{!<_vVd zn2&?ndU&wp2X1y4etPd^4cm&)vX*cMNK*`(DFX`)xx{iku!b`oX{ewDB_n5~ytkM9 zj;g*+cz}QT(baYLU>-H^7H>=ul(k0d7w~!0)6;`gKFtv+QG`~aw*Ci346=YdD6 zPjBrbIvU7<$*Nw4xL_`(w&`26W1x^|oqe$3*dR_lr z+yTvX87+9eVE_Z(A!|=FbMo`4{gu3xX){8wLD^ej^tbm)p1F zI)mUVomhBGD1qEw(q%(ErQbB8k`oLIn#-oArVfCCLI=3yyH({s^QaoipvH|D$Ni%( zAP8N%H^vdrE~sg=a!^!fw*2cO-prUcTGa9WZY`lMxC~gB$EjS#c~}Z*6wG8=z{(BS z6w({uQ^YvF1cUSF)FOuC(a6s-unk6W`X8_Ysm&y~MMw`C(xlIyw+0&ceID_fV>3+n z5LB2jj-cLFQeyAEhcTOeWx^Ce_UB6lb)p# zAZCy(!y-YoNfT>l5*t+|KoVyT*@ktInBqoMwT|1?`Isca>7}2_i!PENFvN2ph9dCn?N=>l4aTtMKYNIaU;0!qhZeY40qPmLH`!<2N~Xp0J<0C@wC5_|FE z<;NiyxQHN{oqxHkl7%1(0JAUL=sIz}^)@$B{{(>Y=`KP+Ibf3?!ll@z#iee*6JW6b z_&?uJ@e0qyL$DX%L(}D)aJVcE_Yamgr(*vPmhXChUlu(DO&(fqME^Ys3rEF%i!dks zdto#$I4d5137*Ga9zbo+^NW$E;CzffAx2ry{EVP^CxYa_Q7+R96z9>Wegq5?m1_uf zAP(`5#zochw$gt2`#oS-wpPY3t$J6G`XTg(8~tn=6mTsf9Dk+1Jm|0m&_)Gf)E$!O zl$2qJKak)t8c>^Fo1?IBQA1WcmpkNm;UKs>5xe(CSs-Xr9q7&$gRA+DSRmwC*={`#o%N>gC zAwX_$d~4xVp#WD887~y0N4t)LP!G9x+=~~xX-E4Y=UegqfF>vqJ%9Fv=WazrTrlAX}&@c5HDRA{KHo8WGTkUK@H^1E#y2o2t6e9Xs`<3opIyRv81;aBt$3V0M zVHC=MAk37uC&$H234Sgz;JncmODl29A)W;ZIrC389lQX71gOT6uD^dmqjwk7PwCBY z@m~M5K9MBaLXOBkg5VY>$cfRoktE!<=$hvSM@U(HXHE0S&CB~5POqt4=BJ8bk7qje}GVWk07?m0p zXtJbKfujtd2K4gts$F^2%a<=deE0x)ccUT+hRl*1ovWq?!f7v|$`j@zZd=5%ohhl! z!ucAGB#S)Su<)CjCLzLi#x_c}2D(MTkWR~WOT&ZH%JgKYA6$mqZalguZEt62E32p>NF=a+L>T)q3fkXSa)Z_h&T&{X zgYSM45XlgUl9?1;`S5FK0$~*#fFn3=@1@*QoW+A!bCMEXEKxd|!_E3_7eP?lA#XD)6$E2QO0nXSQs*Nnn*HzCc2^2&QUMbsgp|c z=<~TFvK6A>Zg{Rx>!iiWozn6BXe4SGK37(@2N%#L=2Zyi1(fKW@A$vK0wWsz6HBJKakZUWCdGRw%*u}I@7 z3}sZ>K5=R3en#fIhI<4u`rvl+ZaQV&{t+vD{RdyDj>fJmgTXNhZCDSzl7qdstIx6x z)ELg5B4||9p|D)TyQt_T#nhs%WjH9^{p1eb`-Un^uPh^w?Y;9%bCJPH@{C-|4_~8H ze6eT5EkfmI4b6CkxM@x^vX&9rLbj;<3HrPmTX^9`|+0d{fZll3I(he2bh$mLrIv=y{3A}f=#1p z0?AZ{n5bW#9=?+K=i2^uQVBiNeS-Jon3gQKlOFeR6A~A(0Y>l_8~@ab$>?E1JM z-VRKheBi`@gWQW7#&{jXN>2hIIw9%)O!V5B-v}o*206l;g4fZnf|;xlm#a34WA8Se ze%?gw5Ko?d;(oYn>p)kFGy5)BMB$S1=8` zI;gN(@iNMor7=)@xV>(;`tnsdQ;?`u>R;J%bY7q*mcOP0LaxmI1FJz$nLcpbk-H8* z6WxsX)5&CkeG!y#&K);dA{7O7Q~vz>kI9~yocPtH9^>n%$K}kUgk%UOBEN2uquLBGcb5#hLYCqa;3}DwUNfjNP$)iDy}``**po#BDt40snXD=Xx(;J7oT!)P3M6Kw!R&CuD zqjzUHrHVLUASYVTcanh2{Pm1i>#Q8ot(tVU2gf0stK^JVUNzTvRvdqI?40W&8H?0D zL|dpH{Q&J63Vrx8EVe|;-vk>U(XF!7UZQjlQ`FBa@Qs4oGvT62_tw&mpl=H8JkKD- zqd1k8W{Yp$8uW8K^j$?ppO4`Fc2mfG+#^EWFcAKs+%f0fyYF+(7d}}bO&_y8Vr1x@ zg0GMiM?RcolMU8TS6_iFV-p|+Kzz@%Bs69Ror1T}tlD2(vp>gfFRwYf|3_MlxzY6b zJK=w$_iDEE!MBMOiJi%3F77-Yr}%h}5@oZ(Ul|YbH+-sb7?MmT|H1wrLfjMz&g{zX z)C@v_2Q-3X*wAK7sBi+>;x$OSUv3k#vIRarPtYDJCeV?Em1=<6aZ{*<93YDTq@zih z`Cn4=)qCG>{VOzosWC(_Y{nL>TKMls7)F9Rwi72O&63*A1_A^4-&E%M$56c?^5mq< zwfw--TArfLZkPubyQ;Za=t?{=2`_k#@N6_cs~Qhcu@;a*i{b%OOgLkqi-Ll zv;HXX*h*I4$09B!_@-eu&uPz!2OLKi5e5n6Z2WE(5!~|7fCvLy zub#;{Wj#0?pEU~?B?d1fX%W^U!0C)R7h!LHp++n2Vc$gEoDK8e>+r|@BlRIsM)iW} zk5lmwIdCfeG{>s=gwzGHM5wTt;I5FoHKk{G*&KwsvgiyU{zk`cJj=}Z-Vh#nSw;?( zmSv3Z4Y6IvUq%n^4md|&L6N|K--?!ilF+IPywuy1b>zI-#MM6w6w~y?#$n9k00Wy& zjfOd5CGS8pv<|5IluFE)F>*2!&4lEioTERnathwJB8;%!%lB{=KmR@V!X5u@64Z+z z>K3I;^!Y5(fBOkItcw$L@t^C?6PltO1UTx$8RU9N z$mw_Q^a{gHHvRqXBHkU&pjXxc&gqOwW^e?K30E1-( z`+=}#IV2B#)6tFdI!#?(%%7V+vH!aY{io1j>m2F6;ld&XxV&VDkSi@PC@b*K`K{qTWFJ zLQyIdu0oL)ltaQFfN`P9bBK%_1XEC&b;E$chWCur!3%iiW1*yylnt%U;=b?-awA=j ziFdpCwVk)=J~c1!==j(a)|yAN+VDfK9F!aW{{0&oBF!x=tMm(ih_{2*2!%dqmocUT z6&1?OUE$p?s;ceawV^{IE)>eI7@>ateGqiXeEm&#&7Ra&8oz=lwzJLT<>b7LaCJ!Yl!gfO4FqLc)Ng{ z6WS+Le-CCBs9p4pHF6=qKwD+Q@Qq0Ljq8!S&EU=W7%bN?Q;<@Y4>`7=FVuqeCA1l5 z(Un)P0i3#T|YyN!hBV zNYBqlD;{BIR4g};?m^jNsf~69_Y)S@OWhd)6zPC)(<~(T_T7S$qoZn?)S@6-a}GtVafd_4{zn3X+7d0& zgwVYO){_RWY!vvPY3sy1~o}@vaN!IJv*4gMjP@q{m8m!uS`DT8L{8uFLDcu+h z?{mIHz7H?Xvg#V% zAu5NOVk0J*tTZ`=C?>TUL()k$g>sg2h#F^wS=K4ljC7hJHaR4R#vxgWSS@*+NrjZG z1{+es^ZD-n3C}aX%*)HncV_PIec#u0U)SgTIim_KL_$I_pAQ*&C68wx6f});Er$OQ z*jt}Iy*rsY>f~F#>osOf*BeI~g7~wdg#%eMFf@!!HX&)JThKUQ{q09~i*PSpqH@gf z*1MKDRx}v{1;>)o(*5b$CNvI+y5*Dvk9jm@rl+SvV&QaRnbTfdyC=6}#cIxud2~#^ zZ@Ojn`g6h$>X*#3u*Qb=!A1#c1Qm{XzV(Vss^yLsulmu%g>KZ zUK(@w$dS*4Sx-#NiyJ$Rj2w$mPBlX^Y{3XwnZ~CdIBu5ek1Yv}0sdE}VL??q}&MGT@^zJek? zRSbIv>NT*pCwJ&yV%v%jDm5oi<~PjsVA{uzzQZu7DG4%PYn|{53{=ke`|p4yPC^55pPfuads-qE=g(15x9bF5ffgnV zNd5-6fr=AWANBxsb@lxcryrn~9U2nS+tX88TFSX{<;KoXy)9ezX{5<7oaECbB_)?H zUv6Y%WarFXX2M{A&GK)WnVF#~M7MZ&d%r4j6(`p{d$tTiQ4KUKAr9@ZrBwlf=aybx zxumVO5$T5nEUz_k{171&(d!|c_BK#(lq?Tu0vZ?RG44bM@&sk!@|Ot zOs0j!3s@>SxVrx6;O$oEKg8s^!UaSlaKi-<;ns+&$GBC&pR>)g%+1US`F!3sFYZhK zbdF7aa$@3RL@)f@u<-C$DY0+7qq#p)Lqq2@x&kDxZ4h;O(w+L#%*n7Y`WL0A=>|cg zV0}>3teY?QXj6&cFsMYU0mMr)Z`bLqaxQ5dzePq~`0VZNjcxHTaC*xe_?oG?b@piF zMxql1wR2h7_NH5gRh36tj#q_jt40-4hC-pp$pz1h9rx`O7k_zXI{sc}rZZp^Bn(PQ zO6cm{=@Hh=-*nVo8C@3!gMC>jVDZLz;mLm53U2trUF6rpRp-7SsTJHeXc8V*Yx@G=N%m#370we*VL7aPuYbhF#+I@ORrtqg2@Mx&{)LXW^sPZ zR?pY(Sa^69W;B~Ak)kM^P~FX2Cg(Da{`1F$MlFe;4)uD=pyTrbc=JWY85kH?$X}Mj z-|yeMB{A2?$hem6w7z=nn&*<0J9S3e58l|G8t3WdwI45Lng!%j{azDPngW!%2K!SShf8fwM&J3On5%k2sdse1ePs7GwC z1M(NG2e^x$y05fe3HC?_Msg!P~WnskniN?lvs!7KGA*@}oCva~Eh!8a<3bn4WH zt{`+g8qnI>3RW!BPUFFY2a!mH(7Z*j_Bb~wDXDZeC(?vf5sdHNuwjnJpc3wq zgF{2b#l_`cC9$Z2iF%^!LLUKzYh&@* z1nlE{PEAu27LY9s4Og`sjo;KFX(iLw%9Ea{QmIr;%?C{Y1b;$q=Xlj-oI5w-+-5uL5}e1U*UzOZPfa(qssj7mj(BWzKhKNze=jZf(v$vmCfiq`j1_ zon77`RfLwr{fhAojg6bNvi_rv37?H{wYk|{U~{rgt56G-&I@$pEw{PgzPa9t(kix3^3z|r+O)>!!& zLZ>JY2nZSvPFVsy#4IEt2vQIcw5db6l%JP3CI|xc?CI)Sryd#_+Sl8AvOFLwC#SKd z<_^zOl=PB!k@ysC0C|J%=Ca z=s1AYSQ*+sJIgYPc9E@r{`>=wChG#b0YN;j=kxMcNzw#_UdzcC-pQ{DrW$FAXmF$Q z2T=16jYC{nQ!}m61+f?!8V?_zVZNG%hDru%RUawAkcpZL+eMecyYh7tG()Lz@R@YF zW+OzJlEH|QsMJ!Ma9j-WoZJfaL6G$}Jv~7mKgIDXGDLfO`+}Ffy&*v2k#;5VC=i^eB9Sa4<&;TrYiqR-;;2-vYq>-Kqyl&D+zGkfU*;c8>^n$- zGx?(!a0WzH^=W~DfvZ}7Kfg1);;5As!_;&QVL|e$zh6@SZN{L~QqqL9G3sK2GV9h= z1b=q(Eziz&!|lgBz>y0MGhLsq-aDEb4~GWg(KO^#}D9d#X+Bc=EtIJ?8O8ETe z_4T5nqBDNGtD4chJ-Cus$_z$xbMxN4duwWHpiGXBk4JBI*xEncj>X#kX1QgG@BLF= zUVWG+&_WM$^YinuOCb>17P&OSq_|R?T{-9O?A%safmN^$_bh60Q>s};W+p-uBrytT z5w_Gd{5jj*-mdFhpSWrLv$nQkbosKf>ilGyiXcv?L`fINFTPJ-XYEgLV~!tz3QMqm z8wPPDp;}mv{0w<2GT;x{5$|T_=GGjBF^nK@XMd`B))cG7>@|AFQ2E}q^l)-=Y7rYa ztFKTdOq#f|8{;)0n{L5mfI-7fXx9jK9IjJS5Nd(V~d=XxoMii%WA8YkpB zh0eNoy^=6PTpfS+gRJz5rR3ny&@cHAab#b>go%2NR9jg^<-XN@M3bvmWeX;7B0c$- zWFcYzR3cl75(52jeSJODX_LS7SB2`6;d~f? z69Zeb0w>icI<9;6>@hK^Ljt?FFLMVeY6G!iM=m$IK-xmM&mrk6Q}YA93~&`YB+MKP zga20EmGBOyU|}I4I-NcnF2_FpnDx+3V;8h#uODAx0Hf;}ZhHuO3LT?pdgKC~EO&q= zLYkP8b(kHqMrlo|sR$tUX?tzomRlL* zIxiR7Jxi;r7lApZrKfweCu6>0PrxP{GU$$~#1bV`Oz{|U(1R!i`?(ac{{N59&5KLU X8ysxc)~uT$uDjRd0HeUz;lh6b^WdYU literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/v87_erk_stab_region.png b/doc/shared/figs/arkode/v87_erk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..237f215969ad967810c923a1baf45812743fde5d GIT binary patch literal 24583 zcmdSBc{r7A+dh1ufd;Jz4aO2>PLY{bDpLrhWQd|r=6SAEG^tEs5k-bV88TCnF++%C zo-&0(nf2|f`+1-D`Mtm2w|(2UZQnnid%L$5>sr@!Ugve3$FU##zMm^lTl3h)b=%hw z1hG+7MOlX+=sXF6_5nRD{*rul<`Dj2uv0nXNDypH)cvZI_ldi3WldGwNIdS}up2i`v5VzhXbME7&PM7p;9jqONxK(Y=i^!es z+=}COQjb6EU~cMUX=}r+XL-e(5I-oab>2x>TugjF_rCoy65=uvl1&^b_X&cVP*pyp z=SKP7>F&ks-1q0FR^-joYVXq64Ptk$582V?P~|YTZWD>rmgaDp#yxh+p7qz()vU`O z9c8tn8MHeiLr0f1Dpm(clmfCVu?V ze54N_@XJ@B;1_MSKxX_iy7T|r52dMKFtr`|&g%4=w{5%Y_|_)JcdClNu|FUn;NA7L z;S0hmBAaM8x^k?Nb)8sRS)5F$_%+u0XL-^${ffJn{q(n5>aR=F^^K|`{=+S)XMc@; z&K72oqyIKYZ`JhUQBuX&$vH7;cE;2izn(nz>2KfLGWAmpvVH%ol$Mft{M#=3^juxb z>G}P&$FI>}BTYlED>#Goi+z^!v+k32^6@=4%yUTSvORI);b*H*&aX6CGGYpx9kg5kHU>TMp{jLPl|NBGJVgiCAZnXNGnFp z{m;sBWB){FL1KJ-uF;k6UtTLN{kT3OwRi8x4K`zXavQn!!yUGZb(B1d+Q`Y0KV24? z3_Kq#9N*vE==uA5L}a8vs(}Po&UDG2W!rBbBaHPuCyQpcAGG=Iob9u`U{v5z`+lA9 z**6q9_l%)myLRq;`s~?QYkGHq>*O&m@8e>=xIUOvYLy)}NPQ;% zx_z@U`uV1NTlbO2`rIA{2cMUWGO8cnxI=PPBH{S$<3m@2XGb^Yj17GICQ$Rnw!63| zL^%F?drrE;VD)aJJ7(w4d;c-`R{zAL(IrG&T->WI@|KP&B`w&vRZC4xV9%aCBf?L7 z7LunDdf(p??2d|wndlEEd2x!QZZ~H7BRgDqSyXSnPGi<8rpa6OYloJY~Lr7ESiP92goZ`BA$5 z*nM_}9!@T|o~wjSt*fAZ+RKwKS`=4)Zc4Ww13`_ zHZ;t&>s9Jv)ZjOt``jt$g(8%52G>leXSl zbzEHDEX{pjGufc2p0D%aHVbBCBvepeO-pfkMz^(WekAcpb3R>|9cIv55G_((m8DXI`vtd3mO3tVPDuepx{4Na?fcUV^L7eTjepH< z>>n7oFp{z`7;ZB0<#j*S;&EXWkpfWqr8NF`0MzqB1 z$Gf%24J$}dXWv|&Z`Rc+TAHfa?R~W5ezCQCeEOyO7j67)Dm1a~Bclee-iH=G2seDInztwh& zgDQ0~@`8%@@7)Vs+^euK{OtAX*ACjUK1;cxfti}oGR~vT_C_n^J8Ub1FfEhLvS~4H zeGDZlyq7xje`VGy2+H3N3gQyK5HK_MHQV~gkt3Wk4;7Jh@34u6JxMdj9*wvd^V2*i zZLJv+oNl6K=j-#w3=Iu)Y&y$>xJ=^6t9i=G@9h|>i;jwjm~S||3D>j4Y}$BMFF4E; z85s79xkaY?=`(GIDn2jGPbYjfGc!{& z;K!qBbF51~Ti=+VZY0}Yv^Y^vEgn+DmDsAqb5WwV@nB7_UDlQMQ$7;>{1xw8Pu|uV zvXff3Zr#G{&9VI3~|LH*u%B(xQuA>*1t#O)(B zv&=S5uOElpYwHyjHReal0+~Zi(wjI#yWcb&o5LrU1`Mr99={HCkc4YBV&ztA`F9G6HOw70iMb_i~I?j^TiESj1iHOua^;paGwb;j?FGrG zK@&;MkdmZp52QF4Z*}-zl#HsUNbj;8{}{1xP|*(+6*Z#5#)YTnA5Gnrh^noPI;f?h@*wU%gb zA)%^qSFc`OokE}4=Jox{zKWv2OjNdNqs2#3H%KTU zC~gZA1(S_UO`)M1)x$+XTTJquk{wD=iT4T#eXOl@PI1sSe&nzed6VYTv+VS4G=-6pR}65cH}0gIeBp!4SbRB-SJvhG zgPc=&4(5Zi-$Pqp4{16-sQ!gyRs`gQz%8LJ;lY}4(b@d$vuL{5(_W_7izI z+Dh=*vu8uKQLaCF4w+A08y>#oF6+bLogRM5w_g6%6UCT>Tw|Us52W6!*w~~EZ7%4q z2+~h8$#=gIa_>x4RaGN7as31F9nsQ`N9SGLQBcRuHb-$J=jNU+UJxA0cqphsF}r#; zVa};qN7{S5T5&^{TmME(Z&NZyOGTOV`SK0(38+}^^GPS3#oqv22xSuxZIX;S-sUv; zYu&_egmNN)lBVs3%Byw@2&jOG}R_k&dVS`M?3X@QxQ17MXjkX?&M|>09QR9P9oi%xQ6qNrB?YsOT$4 z=Uha7@KEagomz`1MPHvp&FBuv;sDP@iu-X&xTuNGSZWS}aOmr?V>|zFI^+}5&h=KG zQ$nq2u1RtYp(YNnpu!?^YEq9x7ucJd7|0I(3ou2e|?jJ-2!b*j8y2xjwxou*vN81}+7|wBFwfVTjH79Wv33{tkUw zgAVhyMz`L_eW$e_|0-b_XL8J>&$DmFV?ugq>8H?#U+d!hUXS+f-np|6n8EAk2R2(E zB0TGtFM;c*uteS16!1$`Rkir?=s;EQczcfPg8EmsQ!hSS7HbTSuf6X3KF0L@&1Ezv z;e7T>Ki+RDa31?TKlG#~opJkt%JkIvxsi~Ad+oPhn??=HOEY0T_2Q&-o!&N&3sVPH zlLMv(YXnUkWXVa*$4ux=U!U&iTG;(+ZRyD~#nX?fzrXXNp+gbn_oe{nN6WcSVYaF1 zdBzIu48`KO4yzXD@3HD^x8ji6a7U%jv{F?cKT`Iczd0kt!_)irD&1_S>yxaX&yPoO z%DQOK??aM8&yaWDVy0h4O5!0Zbtdp=MA=@Cev2{4bxX5Gbe9q^M2?`6v zA=P7f{FvRDS&ti}Lwy@`A3l5-jYh5`Z~DvY^CpPd*=}DGgP4ejk$zTV?_VdS?Ra^4 zZp#b5hU%Y$%Q8q< zH7CWNxu@3GpBP-;s}>YJN_YGA?SYE4l7y+LsSqtXmWExsb`6?Id9P~a^nAMEm`R9N z0G%hdVd#SFthU9b6usoeB2QO$rjFg}VS6qH+iz^Z!x1?dE@Gti_1RcwFWs+Q%pYm@ zB-VK^j3f?HoVvYdoxguMp+;%6TH&iJER>sPRkp~KmXP?|oe_FOP3?AwcFvXd-*f#z z>b|z$0f(bqyH0d%)wLXMh(idW$#@j=ZD1f|w^LZz*ztX8-ZOL`(z&#J)Ai{$^VZqf zqc^yA?b^bxv4Y~}G$UE*-61n;lLQAR@1_?osKp441NX#qpEfk~ni)RfE@@HFnZ~Z! zdtg{XN=HX0KK6WO8=od+5C8Q?-`4$nTcM?2;^RHPqJ<=N%H~jBv6EEDa$3mwoEs#x zl|OU*ZLnfB(nb~Br{bq}Cni49;qtDhb>lXi{}sKqEcVd#fwG90m^6xiWA?X~2%0Ik zXRh7eIa{1P&A0rZb<5p#eM;^`OxNzzZ;Q1Y3QIo@OXtc>f83uIEVYoGtuqFMkEcCo zZ)<63nVg)w+otV(5Tbczvu-1pZ99lvSh zC4aKYUXb{dFDmD|PIdA3_#lJwK)cW5+HZ}Wo65tr5-H1WU$ZP*(@nxTpD1{HU`ug#(IDC6)X=!KpJ7ez zFKlizl-`m9{DI2)XQoLjn$Jhjl5~^w6kz4>%?$tX0b;Z-B-4V=k3;PK~Kb0 z(yrr`4*;=OP_D1P{}v;M%%ukI!BUVCRbzt3^Z-%2iaZZmHCI|Da$5L_js#cB&jJlT zduet1&K-44O>~0}kt$jffs?JDW(_&{&810#4gefppIA0>s=L@b)K=Pcg3@mMrSZrpnjXi3&E_l*+siDe znRq-Ou~@xjYf{p49c)UG6GuJIp`3UBYS)KiSo@efZ0l(}N*y z=BgCNTZhj`^WM3ATjzduczO>2OZ}j|P8eP9kH=EW%XM^*q!2OVS!{qiPJERv-@o+c z=?A6+?(bRsLqobLE*2)spStWTwIgVPHP10 zWtOBDm^OvC==@Xjm-CHzlmUf~n40z?OFZ$Mkj~K+X-z%bIv!GUYZI5xMBWf3jdtpY zRac>Vb$H6D)P=T-Pg0GG42=6E?F~{}katkV_P)?xoEhmqAgmJ0MD40{yHt z0|OR(wSmkaOULZ9$vn93W;_wV07?&1lq@$(Mak%A)6+3J!%NUw8s zvXdd^*2TUu_?+XAW^%zrz%(lKZESVJ(Vz%eSy(=&o0v#;oyoL#$F9sYK#SC7e&Iq#uKi*96UAQh zScoBl`kD#e@7Ut(7Ut*rM_PZai`-?uZ~>K)+5)-#eEQjHxpUH|HP7*4qV(HyMD>}c z_c>%wC2De9sbPL2MIz40eY`*L0R$4Y$thHy>icj<@YG8w?**qs21=Z6Q=%4?FT^t# z@Z1O9FJH5gCM>e zn3)p!S?`#mIlOV>2C8a`6PGX^BnAxbMJNA!e9LOk-wiZKjX8K^^V365PLo~o2M@ZUVFsQFW{r`uH~Z1^j!o2f2?_gb zj*U^HCo>aM=~4%i7lRj_7af_tcvUgYKmRS*d%QtO?&#qA26ft36Uz2rxvr?Ihb zE$5SU69@EhPd(cLn}RW~>v$w>Iv$6ICmI%CsA8Hw2^qkx{Is*y*Ed%dznl*;x3Kt) z1`dom!T}lg>%}MDE*Sqh7J)+0payItrKJ548hEoQe+v=2uRO)`gtoTWm9JUgw@}{I zjUPXLJohci7Oh6>`yJat*Fb!Ur)5eskjjDl;IF5o_-}O+qO0Y1#mfNF6mT9K-ig? z84%tFE`PDBe85AqY)0C`nDh+L-++yV=;1nVk`ES1&|gJe{ROJKlamvb3?N~(jkTm& zx29oLhYFm$eeWI%x$MISBT(!<=fQs?W$f`!LW)H4thI2|(D;auNYHO;YI^qcsXvwB z*ymbV5QPMbOazJ!rOWE|X@3$#keCcT;FavtLKc}+m8a1dyjfIK)Ch8Q99s z2^%bG$*9_1JL*yfJB1N~6bfyrs;k4Fk@vvIKhC;zh#$R)5EzZ6=cL>aI{BF_Wxjx5w`5Xi=lD}ou%QKmmCENL*c#-M~Qw+E6*deHu<_;_Z{POtm*4E=J=nFcH5NL+3{IbrY zAz?_YYpuT}CpUBem@+xdK+7(aDBuarhckMz{7eWSV4UfO7VBRr@8ct#T zI_|>b->j=k4}Hmgu$m>&*|7Tt=@|8fBQ*H7x5QcFu&xYqbu+W4*5()5vM;w$*BQ0L zNIc0zRykO{1WrIy{x~A~<43Bi z?7Be$i%SmB>2QP~`XsCEGP>SJ;gCwLe}8X7n1g3;d<4#ug^jH~T2|kfUs2H)z0AtQ z`may#L#quLhP+~om;}*R_e4?g+*?0DB$h2(pb zN~j-t;@cH|FNjlqq5IFuERY_+5Ar(L^Tx);jLgh#xBh!b`08VKfqBu(Q)_3Z&17?O z6J{06**#=_L-4&tTKD|^YRp*qW>zR~jaKc4e+Y@jj=#fx#mR zWoaN-i;-PQOq+{zNNMe^Z14w2vzLt45!;_}B^KL_+zeWhKPi>{clqqJq4nebD_~#w zZ`E6%uXyxt;*S+rKnDKb-~Z1FLBAG!gGtt>{QALX9qsY7NMWmoa{_PysgYlmmysMIkODGJ6mKm1!}$0k+S3dkx+Tlp}Yao zx)c-vJpxC7NQ_(>y|JDR!YbNb<{dkrpT>lSvh3I)>onW|guRXjNTnEn2$A$TSr=e$ z5K_3^S2rJ@m8VDUWMpJOYgw~lYXd^AZbC zQ~}jA^hpvFM6_vN&_-UkFaX*KwD0gtIo(>u_{7Aap&|9CBIIXiRNx);i#(i7N(|k4 z{A3VMiO!n|VrAb_g6ytc{qNRtZ6SmBD8Rv>RnTOha!jp5a$q5&(Lgy7l#$6tRiiS} z8PvpT-HO%)0gn2(j;F7$kJ?;%wL%m-iwwS&%j-uVf6S}XLgawiF3jwfnFKz3qhtU%q+17`e(sGr}zjt5VF*TrGzDpFTk z7y_G2?y}PoEc>|l$rb-m9v=RW@?e$8JOe4>?1_SazFo{ zN=_ecQ#D=f#!_p^%I;ZamE*^+bQc%3)|R?bk>11WJ`|6O;v>JF+(8XFdhFOi%f^9x zGGKr|Nt1cUui;OJ=d%Dz$N><1^zvTW_m_i!IUzCv1TbYuRTo-P3v4=NxMqt1IDs{h zK?Dv?p^of%vXF8Ati0!MJp~A1H%WbXu#HW?TL>cwn~u|Yn$WR}Y*>rW50D6A_x^_N z4OBLI&z^w5Kzr}xq$HL3W=oX^dJ>ni4MNxBu|oq$HEeu&W`AOB%M1NUuwDui%N==+ z09dXbdleLn=bOWwJ5qEKZcio81YW?>aZ-Ct4!FhXQ8{MOD@(<(raa=}8MqsiJV$TU z?G3s|OI8+MG%*!)ifnB9X+DV(q@QMJ?}58JTb)?^QgWG5fR~zRaIG8(0c(lx{{{54xxP( zRH2VgamHn+*&_WGamtFCCd;5P*RzRG4q)c1f+1noK#j6C+DXVLbtn%H|3}>dS8LwA z0x$vAbs!NpA-HD`_5C2vNetND{wHQ*a1i=AdQR=Mks6tVACStWL&w2>nRg3?B=ygv zy?SK_)KtA=tID%csAO4!TaXvr=Lf@az?sV|@6yj>mOi2c;dB90sry_bLfY}U9LFOdIuK0Ak=4aN8JPJ{FNR>-c++;7 z9I$5Nb|I5uLuvY|=`KONq*sVhcu0aEa)cQl*VOdE3WCnR$M#*gv)VV`XD^pIS`G%-CN_9P4{P-CD9^G_f z`Bwd9`IDss%~O8racrO_>uPI_kgDX)rv{;6Q*zC9x|NEd=_hF)^6@|;$|`ICkk29S z(LBDutLb|}|9cgTF36Kek_owIKw%>YlaltN)~tqCZ?ClUJeDCcg7XjIrTv(jceku7pp?0-wB+%*L4fsq<(Wqh$=bN6az#r!VG=m-ilsv8L+~2qJ3V~SV%w4Xsl@jW zk~8E`caYtjU7ES8lsZZHOr+)*Mg2s$(26%<$F@4LRvjLe2fD>c;k}Xkvpu&PCF8Fm{qs9$Bzo z=pt<*WDfPM@+0;|_*d~>Jg&NTsGrw~R*co)GtDI-zt?ItH;4TW-l&NS{^m?90JD?y z(&ojrud1b(>YcCYa(y{kM;}eh1eGyxZ@nhQ*zR28b8n02My?EtGm|eS>>A!Mz9le* z=BFM#(?|1~-m;bFq|_1}`bO)b^&Dv%_A~MO5$kI$cXvLoZw!AxPfx4>K+@lB*br$W zecWp#t6_aAUkz{nKSyRvJ$gr;TN6}0Jfiz(M$slLn=8@3i$XZvFJp)enMiIv5aEAI zc|h7Bk5PQqb-g)Xy|SL!@hg@uB_c3ni7%Xe;k~9c@g0CjhCRJ)Zt%N`54}IJN+aXB$UXylzh3-G$75|(eMKU%ds%9m@T#`~DilAS z%FNvTVk*{}aZQuCRS)UTDf4P74OK?QDHpG`u*BSNh5fZ5)iaat%#rSZC}P9C#S}Uj zry+~s#^{E;jUFoYDc@#BibuPdmP{1@awIoqGlhTpBQ>$r#{Vu=cKH- zF~9VEj~zfKD6`M{JFmPYST{j$UY0hIB>W_C}R+8eer;WS)(vm)= zkFSD7>C3s7GNeZnWyj0o#zJOqI^P%cvm9;>Gf^ zqrc_rdQ^FjV@y!+L=;iVw;Z`D5KlMO{08UQO=PTbQrV5~Ncqloe^a9wlSr7*gLR-?{58=2z3Sv$v($bn8d+ zITOA2%0_N6^J{KkmwE*&20iM_GiUqQP1La;-E%9wz}MW4k)S_+_vGw*)OVlhsBZLi z!wmLlZV&a%bfUh2VWTpKRz{@ZTUE*(t7=E6ot%OUWKBT+2KZLNM_L-O4*OL(<@7(t z0K%kJ2<|wpM6H#D){>(~jvS{*ofx~OwDywfTH-B(Go>r_^y{7b_dAyQGr<335Wbox zC=B_}5UKfyv2ho?f!%P|fpM8%?DF?t)p}!t!@-pHlTp{g^m2P#MwK4h?;uLq1Do!Y zEDegf6fBSDbc=lOWC-uQjzst%Zw(>7Cv`N2YA*mouw%c426~Syk@aLY>Rr_X{_qM5 z3rk8$iip@C_ck&`)$++d2t&cYRu^r0ALsDX=bOkMIs_IaL3TqZtj4>A4YKSOb;xAe z)X{Pm&xKumd~#+Jw8S+%C62_4={|L&7F&Q$wQ%JhN_^>6etO#B<}V|@~rPy^mOH2G*!?_oVY7VOv& zzlcM=^4OR9Q3|Y?4$=?}TLPJn9(Kj;kT(W0uTl1tAqbuuWekVos7LYylri+%G2=KT zdT#qt?v4s|0q|P%G&tMUs88gqL^^^bu0j!`|JsBPw@%NZ*IEIl0b=rR` z6aP%@@|@G(KkvpdTgOKraL@)adkjARN%@Ii{CS!9o$gX!QU9F(cNj9{KL3^6z^K0$ zDMcarXU~94zt3AVPxPiZ(I$C}rhyIT_eX*uhBxE0hp4w8!vcQ8iCb275vCTjSS;jb zaMlpjL0&iKYn$HwjewX5fPMjX8hvtbRMc3OS3~R}a99oTDyDbVfis!8gZIJDiyGxO zL&2)x@+}1JCkFtc!cTk)LL_KMKr#b1u|n;4c($4m>`QebZTLtHfK!4R%U~(YESorF z4hRU0LO{P4u;=xz%Wy<$YTjQk->_ci3g7vgvFem0LS^+`_NkYEN16~^KEV|8;!9)&?lC6+Aq}F!I{)ksWnXH zNj-Szid&@zo`8SUh!8(QzYm>vx*%+dxgr~;ZP-_yUSlR=Wo_t`9z*Wyg%JoUdM@x7 zBm^qM;_O|TU_d>KzgR1wv?k$Xr#@6Ia0d0&)!kTky?fF6 zaL71u+pO8U>-DQz#kjs_!{CzpI?WJ>I>FU4NV>tg=9;8$)K%+ki?qLkw z&chk)6F}tWr-r6i_Z`Nl)&w>&Q?uO{SSQC`z%);9V_$kCujzSC2}}jn zjSY;%UtIE^J8k?e99>*zIGx#w-Llbv{eI4OvKO$kT0G~Ux*=fs2=(KSy zDBTZzd-z$x%$L1zZ zmd)psERTcTVwbx3m`!DVMh>m_*%TRd!O{BTD@ccq{fy6dg%#Uiz;Ce({q$AJj;dDern7b z|0_H@dFx=I1clO_YyZCc;6z(yA_i#Qu}IZYMGU1Z8{;7^!bP2a_beSMh2TR2wzr$$ ze!{f+w84Fb)bSa6SEj2Ef|ElUf#V!>dhu8WhkoXmDUvQ?=vBa2fm)rfBS`atH8eW#+Dp z>{36{eV471UGuSPiH2?sg#Mp^aubaSH5hCcI$k{5l@Tr91<38+dhg9_cDeKLFum+Q z6QD+U1l(0L*LMfR|8!yGXDcu{U{$g{nC-2Zpvo7V3SMrIkEy$r!VHmtq3{%<93aNI z@F*X3Rpt${1~Qx8YT7|0D;-;wG6zfqkK2U$N8K-l`-j4-9w81#BzSOq5{l?o*vElQ zQ5*EjbKS8G2I;?|yuA9K1<~|EUzDc|E`;hiObk(aHDZN);`waAOcMeis*B^lx|$=43t3M9CkYzk3VF0pRm5X#;W)MLhN%Q?SA@@KCvl z#6g|eT9EYaJ_S`5)N&8|2np+_F`o(wCCAChecLxA7v%o2-%s(>N>@1NomYvir+)RI znverPALM&~w#o7I@l<`55mNJh{I$-WkXsdU-zY=-g524ERHR+^j~7U^d%jra4zZMK ztPm6sa9FfLK-Xma1Yyd+I<77-c>=2wbG`5z9Zvuh>sZq9aSc&?HT$0-o^ z$pOf%A@+;7^sD;#}XDf{^ukrnW82Cs~OVax4LLSQ8{pxh`$mLS&1u_m54e!hT}$c&K4veE!fS4`zwL4?+|+j8(>AXi&_=vGWp04;GH!wm#E4 za;EJS;QV?gx`R5>nMf(BT@Ge_o-!z#SY(4P9N(z9jea$*#UcRKIPThzb4QB@vOaeu zj)#pRmMUWrJP}yQ zD%gQ9BA5ys9vwzqVEvyUL?`h0@PU`O9C|Q+PK!aD=k&kN^Ys}6$6wq-KL7C{08j6~ zcN3FoSt1e6TLYQDJ~RF27)%*;@3H?Xfdl`bDDn>JEdb8D?05RxPxBDOhO1O`_8#rQ z(Ib7zmv-Iy7bauv!%UVR?o+1U`?{Nt`WbnAW?-KWo^3Q+OpJoUzLdbe}8x$bG!rN$DvMjl?)Z65XzrR0)LWvFe^teOsl1>GK zd|%;eC4qAT5A=cJTyIB_1E82=^D&$aaGD=iW8tHW9Z3F$p5ciKB>^ssFw4t<^?~^*1 zI^67q`8^D-rJky?-Q8-B?Pu6}12N^(bT#~&Y3tt?_S>Bk+kzglv}28**s;FCD^mki z*ahSB6=ekqlT51a>C;kPb3ah;!H^WKEQ}fFsOAdECPxNaK0=$a zP)HHQfuh?dBqHK7k`Rtft56hMv$C>c*+{cbBdJ{!w|!SwXlR1h=z$swq;NGgH4BSx z*iO9<0I`QvxZ^}EFmu;KDcj7`Lc5DDWVV6KhTbjXG_2Ioe0#A$_3s_OJ?$*|zxO7a z-vOi>J-gp@2e|d}*DO`~6VMs3p*c|>`e9p^rLJ%_%l+I*M4QZ!z8Ny-+hWgIn^yg` z8@7@<`us&_9UU8^Fi3eZ>7<=H07JByyHa@lb!ES4BVlMV=wp3Q3g=s?KAu_)7HOUp56Y%N%XTvdLHK^DmaZrJ4LK zxB)!H9`Fcu!_-#+IQi_Qv*2FJKtz!4QeR!bt5r50w&FG*VjiFiIh32;0wSFt(Sk5w zob7Kx^ta&UmVHmsFHG+Z~uS2QFnYe9?#vcXQzGXTu1X|ChF;Tf{!Vc zmxyv2Ms~`jb_`C#%0D7jaYz$>Wr44H?Q)x)9#MhgIvmIthmUh33l!##yjR61l+2N1 zqCLs{&jOI_xB{7bhhwfDzPl5>A@!ZT$(x2cBQ>d0strb^wK7r9Nf@6tb0Bl>J?ddhL))&wY{Qh(AxmIGG&yeI?BU?EbO_}(Zb<608 z9$BVDU$|@b+4a1Ivx`R=Oh(IxL$9RSsn=LK`Xb*K3GPQ!_tMcZ9VPXgMW=O5QDHYp$FY$vh$(Xebn*#@YpYmLc4^S;t&uhWV%G>GqLh}og)3c4r^d~cQPfW z|1Z2Mw_ZoIgsOHMW{00w^U2Hq!L7#Kpw1g8<4MTHUA}*)X?bS!v-(&D_ZDhs{kYrq zuyC=)WW_9}z1wH;if{Mh2M>DkA4rF82s{%^5aKyB+#j*}qws|XwHCoopl;^_Jdgw6 zSu;Z$3NZf?HkgujUc;L#w+_?0b8n7gR%={7AuZ_ls`tN>(eBzYk-f-8AyV*W;9Cj$ z`}!m=f8j3TU8`%U3dL)qoe z37u(tdSrd;Ao69i{Y_zf!e5pC&_vmIiNf5jRrI#;w4;A>l})%-w9Lu2uOj|{zrfaP zWQ`{ZM)W@`cLlAAb8BET_`+i!Hw)4HFE^WG6S*Wo$D{8urOTS8!DqiHUenE~ zS@;d;5z?;(7Z&!t6wUex`pW>Vp}>^lkf)^5_Q3 zr*(pI(n+IhNG)JquYKqx-IvWQ+jaS|R0jc};#zI*gOq|w9@D-UnJf2Y{Os^8AX#>a z8NsWVjt*P{V-h8I) z!DA4c7!N%|qutI!<`><1w$jlnLLs=Y$HV23>V`W4T7+pJzxZwO~NR?B8WM-KUg%<+A>PH`}yzBWF~O^Apd&=;ZGn)C^XQ zkgXDqD{nn>k^z$By)uU3j-otWu`CtciRYfPd8J4pZ*w7)Y`vD@oA{n*LYYfu?HZGa zVn=BwhXG>i`aote(ucx6Mu&?Ht1Xr`NkkKO15P==wcB!U%r&y3N-Xjxgh8e_X1`u- zoa9rHyiDk?=xYL6&LMj5Mvf_Ja^=tyGN9Ve8M^YF&}ng9cat@l`$zAC9qDvptf1qc zIi^f**&w`5EPHh4;0lSI7s@A;BF^~jn)z;PB3qSCNBU62Gx&&S;KAwlJN?{1;t~v0 z?+%)-TLi2)N8k|& z`;TNldB1lwnWI`Q<&ECO5UsRlnNiLqPQ8RLdW_p&qEZfxt~Q=PRB zx6)-Dm|zS&NSP_w3MGJQA5VC`wMRs5x1b5%*+!W#_sN%M-gGcf1$~Ctmm#Jax!+!s z>Ml+QO2{{i8V`M}V4(7d1Z{tpK)q*}f24S*c3o?6k@UG`sl&h9R}ox@p;eEqXSVP> z2&XmNI}CM`B3!iXd4uP!S8M3)edc_G+xN9($Ihijy8gZ>FrS$ zNC@Wx8}eZo6mpmla(1P`AKu5o{YjhZ#H@T{Mfv&Pl0j(S6Zg2el&V0ZB#$v^b6GMe zxjlpL^j}}{!xHhhl!GdB#|limV5I8xKJz~-xb};SWABKCWEAt?AE;?*&Op=znF9ne zcrsW~=HWyf+zm%D8<}dm)Zc@*y}7X=<^ODssQ|#UG7=%;M2OjwYpG!0Bj<8k1}s;w zF~h59AjE13XZuD^eD}Ml zs3r-0xZPRF)IGb`*KT^#KJL5F^yJZ_N7$X51!DvpvBj@mX^+v;(p%1;0en}(S970h2M2I7{Dyz`$y z8I(*_3!+b1h9?BlQ7N#eX{7}5;E*aM2jp!EWKtgkxS;mhpGwv_Lcf`XWzfkp4sbe9 z_OIiE+MOQi3&Hmi?0s@nxnrVt0e575f}L1%2(l7}9WiKZk$J|T3np%GF05O&z%_a# zZw244bK_|(a3`@Fd=3mFKfhAht+EOX3=f@jMA2bij?@Q@k*eELopDsx2tjzkc7}icel6AiD}(Oe6ay&opJtPPrG~#-IR5VS zK-eRjfcT((w^i)Uf7yPiTQ2_D>p>9N|88C3&4%R!qr>9(fA$Ce|Mv2Ie{x*Y4;`o2 z?s#iUx9{3*KZB!Nzj|;Vc~NOcQeI87Z7==(Y&R>8xc;~`FZ*fg2eqT`pL)%)=@Kc# zUir2Pjr9q^QTpp*W>@Je>FM>>>nbZ9s#4-D=6X{bb(1hyiCX=8!Fy-Djijr~ncrr! zZ5L_$PEsdZ3Db(7x01+8_&En{kRa|fz!c;cFq0>8?rkMVwEFt=^mMjBWfvEhiHV7u zH*XrUttOT^@GuBcoqh4W^73-n^)3;&5lfp@{9qzkmP!mal|E{Z?$~)8-2AA=O|nN=k|V z9o_Z&_Zc6mY$1`jAF3d!=6kN6sG%cv3W$nglc}LT4bgFaVdN)kdH;7KZ*Ol84-a$m zguJ}G(9q8?Rho;RIePRa9O?xHp01O9^P*JM!f#!j{fe-hTw!LW?ypA7Zhd`Fz<@(u zP>`09k&&`;8Io2+GAx7G9*~lruITyuWpFU_K^8P*#0HX7#e7ak$d+H8*Kaa%RP)xM zgtUDA?C$24)W^3O){A`y4miR6r;`j_8y|?hs6z1-6cW<&-Ah{X);f9U5Y1+!aLw~8 za4(Y{YVb9wLJP!B!mUh0-Tvgbmf!gPn#~UlMOrVVCnujcz8dfOah`LEH_pw?C7rOa zusD49x`!v3e9cOL`negxmGPH|n3x#oo#tjI?3OTlotvHg3xt|@#AP_X!HtH6g&DF@ zX~Kqd9{b;#BH_o590AjbuY@!Be96`pd!a0`3Cq-!dOkYZzx){SYW*^moFn{<{uR$6 z{}s>W{TK9&jg5VLe7wDjRCwW`c64<;c;LW5{vM+jX=!!U)!0th(A1Qf^Y`b~tDgKl zjM(+L@BC$u&GtrjG(*F}x?m{;6{CFN%9Zia(dyvMoL1J>h&wRgh%={7Yr9i=mLb8}k)^|kY1 z!21-Z>-BKL`%J8Ch~ZlOU{!N3J3oBKZ99XjzK@TCJ=%w@9nYUX2b-L%x1F8c3;Snc zmOR;*m>z|OnqRpBe>QH$`Ud%gkwP4UKt*i`8OzNF^WKNzv3$C~c-~i!D z74nrsf`c8wFJto+$`-cEw;HllhGBOSNd211%1e+lI5{~bBqX3nq7rw2Z^Lf&ytMny zg`E?fy+afAJ@Y3B)gF^BVm(MJKGr+1&NntU$9EOuE2mzcX6NFnKWUopw6f&>`g9>! zdaS85>)z9_{GS%W{@~}Qg;=qe!k@`f^;PWAkl3D?kx^#$6Qh)sm6c9bTgxhHjAO9L z>gE5{$hC$;owwmhXHi&bO=&emOS=(8aw_AvPB~PDF%Bz94azV`W4OGTS|xJmAch<> zql1*g#=EQ(O=4qH4w2J@w2=_K_rHDLPw$tVFLPZO|KI#h&;2~lecwm0qe8;M@Bvp> z*9{8!>oEq}`><(F-CQmyIc6EwNOCZe3#t*1$BV4W%~g@bABH%mF@LYGmwATqRYn~$ zascD<4YC4quLs{~fp84)Rd*B^5ay4rD`$@AAaUmoFpF2U=q=7_R;3 zmCn!4^9aT5tJHjz&#&<4h-vk1Vx4rALvH`}?AbmBqvr12)RFtSPM)6j)RXtQAQUWT zu~;a;FI@cIIl+qW*f?-pc($(r4ne+NUN@mD6RsNBcF`u!sYsOq(z`Iw+dLrPds!G2 z1eEFQHr7c!y=*?L-sb zRfU}cKnv5TaR?ycM%Y)kuYk`dd{l%&Ve^2Cat@9bvVRI{pPC(aZw`QiP04{)*)%sA zOe<=Aimzaq@zHSUKj%Z_mAlm!Nn2e#T2xx<;NVbNQlhJ;cklM?$c4`pwrbe3!JxT^ zhYwX6v}=EPiiwD1v#;uh#0DG<40ONcWA5g5$wgzJZoU|_mi-#3kdE|MCN1O$1V8BO ze|mApf6tyhOeWJKy)I28vZtW_*=mqlal2X5@WnX!=3M_4(`pA|8Rj$$4X^I1)k3Km zMi+06&p?YI7K_nBOxwl~+2R7ggtS1b%tB*H7+t;WM?s($G=|MhXpa=CDU!*|7q|V; zL<03AZX_tNeMeGSS{O!yW)l?MAqTIB4%1hPb;|DD1A7O6xuvIv14)v>Hpg&W|29;* zW$w@I=N}l?EQtT|ue#Cya=dhH={X77dySRV(x>Lfe9hpS5?RoTCg$wS3_&W#4Ov%b zHuaMQmEZ|VON0M@!$m{Mw#J{Bc)RYR%!S#>dU6Z_15MX%9E4!_7S!I~d`uZ{< z7jSrs{F$VrB;g00L{xy{Mm)_0nq0o)7F9WGCUYF^*>f9q<$P!jO^itM?WlkBizEaU zs;iImN%WLg89W$UpuHDw$zEHUT>H|rZ&Xu|$${X;9McwCNJKX!T|5K>U9YHk7XsCt zI|&Wkb59Qs+s==*i|pQ#A<#;ibv;B8kB(xlHs_%K+h#I-L5kcp75i><^rDq2I2PEx zhCC%SmE=||!I3?7?3mcWLDbx=O7ZviAGc{!+Q)T7kB9ncUz)331U(J-@dciu3DzBs@=>9R)hS&J;;pr>4LmPowrhANM-h6XN?t|03 z!-Q9!iv}{Z+WK>F?LvPG_!)7-UN&|v^ zb%p%RH#!LqA45;{=Y!}f@k%o_H8l`U`pjObo(h^C$AkPQK5vOp&0ft*q1)u$&d%;d zTS$Ui+uk0AG~44qJs03KIazMDza-v5T%B*2%i=!^6xn1sa7N5QEi-orpZCf=)1-@x1dqZ^=~7<+onDI?s>^d1%_ z4Q>Uu_N^hstR6l=M}yDgI8X&5(o`CK;$cCtece51|k z>M&%rzqCE?ogW%;-(Eu%V&V&Aqfv7oj|oyvo;-<*eMzh_oji-g^zq}zkXHo2cfdZV zL?Fo23%Zt>Ne3H+A&JiG5@GRT(qUTpQ8y^!t*swH%>hgc*3k*dFtc)yA)5)!V$hJlHX|;XERLIEo|Z z>w5>31^8VQKW%GiNdgjrSaNimU?Oj6_78c@>5p5GfM^{@5YGhSK#f$p- zH=M~QP!}!2f@O!pzsLL3aOZS1TsNWX-bCR$9`^D|%F4=u^gSbkE&k*CsVj*Y<9x#X zl|2U{B=j^@bFU^Qf?fOMS1iFshibh^BswIjkRVCP--jPUOBH58?gFYi8eg=pJB@%5 z2Eru}g|m}Wa#j|@#YOdk6^%xNsX$L>XYpm7ZQIT#fY_IR>y3)#xr?Fy_At%T4M=Wy z7!67m^dU|^K`?knK ziV_0LRh&L7UhySh+=Rx~Rwv(?V&hy5^idt`?RW0jVH7=E*0A<7SW<-wOG#QWy~PHk zn0yqG(6-Pr(Ug~@$VtY_@u(^xP(YjW9q(6E;O-09>J9P;I1pH9gqIy{PIS5*72_VA z$%Wh7R9AQpk4h6}XYhz%>d&(7`%XU-G!Z%9l?EvhmrzQ!?|ykzUEI{qSvoQoQc zZol+P0^kI+(Yk8Co}5WekX*IO^@p*sG3xcwo;F4oet|};ESifKkrZ|)W)x?bFCs}1 z6$R2|I3AG|6dDkYAEhA55-F(L9kpG%+1t}aaeC>I&~fa$FT_EO^a%)v02htH=)t2wCxIPvp_=xiZCYB6&w0*q zk-EBCT5Om&T3ViN-vyAhc=2MO%5s1n!gRLEC*#f)%7x*YX!JUSgc^GCx0aS*lx_HY zK6(*ww}?No)%H;Rlfl75>(-@vuJZ{DypocF&PgjP*{KN2=j-P;0Fo9;Mlb93dRDXd zP?58K83+W?ZTU0~=cEY003hjj#Z|?~l-DC8)>IVF9KTyywA<%a#zNN}=gl~h>gtwT z6)Y_+r>kWK$LK*W5~SfF;`?>uIBv=T`p5J0L1XnpQHk&~sE*KSD{!XU*(J_uSzv2Z zU7Vb9v|oa*m2oQxz)xCQI!egDe?KDugo@|)O3{oABzFA7{?GIC$jA{j(Dy+L>9Ouc zlT(Ju%F3FWs6I5+)zyha=MvC+{&~9_6pWx?xeTdfW@ciGB4tLmX!u#K>sh1FVHsIO z$g!T9nzyGn8iZOsS1iMnm6e5pxD#|j_B&EGgV;uFcR8M_uI?lnX#j4vM|5>`esXXy ziJUy_4LEz04PvdaJ#E^%Q9_8BC+}Nm` zBa8!sVv=K4X{-Vx`tDSxA`oB@T;ffYk>~u7S{Raz3pH3VK&r zS&0j~D2uX`^sP)V%ErAMQ)L-_ef>$pr^qg_F@W!hJ=PUt(^U~RMq{z=QYk1U#&A~* zVJSij1cE1RZ6AJ}?#5T(6zI*)&X$*zfzT%Cs5*<<$)^A1!4{TZBgsFBD2O!wI3Rsl X?jTmpRW9M3AmWs@xjj|5*DLlvT_1t= literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/v98_erk_stab_region.png b/doc/shared/figs/arkode/v98_erk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..cfbf657c42f16d19e58b8bfa6a0d27193c3c5329 GIT binary patch literal 24583 zcmdSBc{r7A+dh1ufd;Jz4KkD{bBfHgQkg<1B|{X2GS73RqDf^6izqS_%8;3oj2S{C z^OPw=D6_tObwBU(KEL<(`?hcUw(a}pb8q+7VqNRH&g;C6^Emcn-}iF`XlWeZxNiG8 zf*>}kC@X0b1f2&#&_1N6#b1)n%^b!*47SQ=9SDMriTXdyrKb%zidgHYa^mRP!F4;B z#Cgr0yG`OxJdQ`tIO^D#JGz+In-M1t>#83n3v%gRHsd;B;&@rl#@@<7kW0n-g0SqF zj;%O;7xnlf_GTuI7B<#gx)xW>2(d##nim{}#6-moaP2=JEq*}yfaJF$$1Mqhi%?NI ztm{ho(c$LF?9}_`r)I>hGpg@X+4W;~tqr5Uh2D`;Q6X|u~_gK_&Us|58vS8-q3yl&^8(ns;l5rVdT3MWkFaI^#@@IL%C+(`6r``1T8tSi0({&9h!hS=|Dd&ET ze901Gk){7WKyTSN`8ctB^wgZF6gy)|wQqN>+w}Jztr>bL`dL1IR!U09+N3T_u&>}pHsr^uT4HMYszl+E7XjZ zb^Eij+|W1Pk)IG3mt%PK$JaLsOOrQdB=_wbzR6}pPi`gGe7wtcsg{y!UK24<{HN1A zgMs^#xxy|$FYxk~Q&z?UYZAt6OcbPcO>DBZ>*vM@lq&7-M!1z=&ne3n4<=y7AKK9** z_){O$o{gvK^?bbc+HSZZp7%tAtK>HKnW0#NV$G-WQ)(~u(uAv12i6CXN-VQN2dK~F zU$<{sNm`p`->GwP>oU^6%ZdcUb7D z_d?QCe9wp50$q{O(c^t#Bu@_El@_lV8d^XFvG2mP=Tz0I39%el`y zlY;_u&M zZ89ktS6ap9?VcaI&&14pL+9nWr z#~-jWbaQaJc3&f`Yg`2MQeT~V*{rbgb5ojC(M*FHr_a)xCC8t=AL-U?(8{>1sP*%% zlz~BxZI8mA`M?=TX=(R`nPIPmnIzpL?UN@@9y?a{`T23gX8cu#D5Yb^R%VO;oU-xS zs_pFjc4_V-oACw>wLI;QcUUkZ!yy8Cs+tPRGdeA$^TP>Gs{)_;tju?_2w%jb*LI6@ zp6C=3XXli(jX}gWl>GSdBjZwC^Q*Isqs`LJKN6Qz&8(VVJrc3H+V=M9*VnPd1L_(Y z)*X3SjV1b7mLZud{+oBleOO+e?W%jSf472yvA(>^xItRLG=fyi`%b)C*zeJnx-MF} z*n6ehgny5B2q!kzn)>*iiW7n5zkh@EWBIn_Jn)(yE6pE#CdF)$O zLtlUY#o^?IfiUCouW$OWCgiD%dYs3;ZQOn^(e&dTjw*+lq0gJ- z=eQ0Wn8upA+W6vxrDbyZ`Xo{>7Q8)O&_~m7Ighu4n}+g=S~TrOnv(9_+b}%*koyQ_ z-6STiLV$129=ZAcpy>78EeSzm7+>Y%J>`L%SQs|*Qv;FWR?TrLK}a_(sfOo_1{Wua zpGsVfn30r_I6eQ;>hrUs)(Y20v+b7Ve)_CTKi#%%8%CRQE}KK_qVnu`N7TCMYLQ~k z$@goK8&;5_&b_@d-=w2ixHMJ0$Lm<}gCZ-pxU|c4(Q_aoZkKAUAPe@Svm_Jdp7;(s^Gu1FZ_Q-AiVr}E9(|HbDzN>8) z2b620Xyq9uB0x~qBq@6~Z>RMAIIGqHIjyD&M8yFa5TX&QNavH~yS96z^-QO`-8xlGv`)FR<6%G%Xv86yk`4+OtwX1nR$lWnX|2j%fBqmPse{TH8oY$ z=fk6Eb*N1`SJx1)W+>BExHz6)B^F%Bnb4xieM!8h;ZSvtZRXXs)868IeB~cnPTkQQ zw3S@9Zr#G{#KhYx<{9%T*`1GDkeqKUX&V?&>~~`pLyWbZ=^gkRBE+qpJ$pv^EoRj$ zIPe0~GobG_UCOLkQ7rzkaQT_1!b0l6{K9Bj$iPYSA#G0j0ll6$B(xRpL8Iyd#O-5M z(~MRQ&&k7XHFfff>hmL|0n8!BX^k8qU2hwY&*78H{O9)7UVF#-?gom`-H*Fc*jZRk zojJ2tBvDJ1gzSxV2W{r7< zaYs!QqmsLOUgI^Z`k41$Ug{ZpjEN@<*xA`3I|Mbp@RVIJ5=n`doMrc3ab55zB=6<2 zyLA_lqA?$I_T}l6lh2QN{cgQv?Q?T6L^9>H6`4%NB8WU_@l0JGL4t>zk@;eZ_M$}O zfU$%|aB<@Ghmt!PZ@2qhl8CIMNbR;6`xJg)DgujkdZ{C{w^54yLA0EQ``&1hX;tvP zh6pot${v4jH@n`-D@rM$hK$GOEVg4 zN(x#^MH*JA4q@ZsR{D~B>d=+1=QCRE?d`Fa_(W_P;sOei()l!uQ4i;(daGpK5BHlI^vO-g{94cr!WEqLEil&I|QE ztzfF^P?x99Z#uiV$(}5$76kDrBOhelhBu-72FnYzUi&g`msE^>C)3~kX#Z>Eltpg3 zzTw&I!JKTCXUFbux8EQ9(YmuBcfxFXmYv>}rXWJ%sy^=Y=H28|FTIf&i>}1-$TZP=!*{gW~xpYJ%ltJo2D z!CC!%LW(p=>p5L>$jWf<%dAjg!x3kSH`XL&S47JRsYeMZr123|Ihz#0fW}kzw~JHc z)l_UO>SM0m*3@N6pyRH4(SMLGto>!VdB#2~8lUA~dKS6H$Gd(BahM-xlBakuD)`9K zITey0K9c-!x5hkD!N)s6BdT4Z$lqg;;&y@(CSvS8nv#tm9Q=0t_^v-3_IZSqQ=R3P zk^!UsEPe7sIbVK8Wc%xk!>jOEjC$Oo@%r*G$fh!-Pj~=yFgnVEg7=0eTs{R zyR<&`Nc_#J7lo*&dtG9eHpUiQU-X_atag~2G!bX?`*5LmW>jYO%_ok%*{yG{p1b|Q zB%_u8R5FiMv_^#44~OONh!7zWb!FwPKz6_-!8JLk zfWPf@G=k;)1zD>RG0Xf<#2Cv;OLd)lGL1I{G@8EIz$tH#+VguM6tOwKLpqAl&%Rf4 zz<%Dw@b-t;AGCI3-^49qjgK4mdi2h?k4r5r{S^H8YhA4Gn~|P9yLR;gGkE^|$YujX zglGNg6>uFDmZ%w-0Dh^cs1#ip>8}hLYs+?7Q2WMq`sEjkBK3i>wKse|M4NoLwT$K@ zjMr{y^24Tlr_tZ@gHNl|7`Gp+NK2WY8xB6S&u;tmY1F{nRAbiDFHcF;>TYwtICXF} z*?(%FTEN&|hMd@R+?d|v&6)Pjg*~s=mYh0UH2t{h$9rEIIuubpFA8vel&sqnW}BLx zXDrdqP|Qzgvubku9<9o9Eefs)b5Q(3D_QyJ6J`H}TQic}+&%BE(amN(W6IEXyn>+r@y|rV2qfZ?ea0!j}8wX?qfCb`gKammWPKY zE-tPq@g&+8Q=qG<=JxcqF%7l;NaOX~yLRpJT;4#VjYJn0$CD)Gy1ejfu63 zQ)1lN`>MTt2|;B&s)11>ba(FD=`T+$j-Q&E3f81!so%YO_kgLS*Qyo{k7pZ>8wY#( z(|K?ige=I+YMF0J)=g?C^l))wYTu(4y7y9$-Nt%69N|-8!iK8fo{x6)(EZxY{E2pN zLao=raKZq^vCC`L>BrZTs+0!H72eu{0@-<1CG!j^aq%x*=^;l|Rqq6AWnXRkJ=Yhg z=40~%a5&1P^JM2%9gCs*ScDLojK|U6`}>3UIEI#vp4hMIHAD9?jZ@PnO^<#vPpz#T zdV}lNuP^)>%`a+7HI$Ls6FjpvQD9)=URu$DYP8@Oa8GpC83O~)nW2+z66X0Gsq7j( z2ZzKZwY9b5VlHH~@@i1_^4)m+ecjJ@<(hiM-d^)7nn+TotqFy`#UISl1;yoluBgF-jxtx^DP%RSLU|^DC5C z)bw-d7XxJ9r;~Pxh)jIgq!9d+|6F9b|lg81h=5m}#gDvQ6z1{jq3+q|FDd~fL3R2HV0Kv{PEmTA$FW*o-xRNl)SYkEpe zd(+y1p*u@UOUsM1YJpuof4p)f67L0H_|(|Y(0||}psV&`Oi((z*CtvIF3KErUK%wO zga%uJ_%y3j5`i95RT9zmAoPEgqA}biWq&cI>O23F)t8a6m(ED3ezVRNm^gK^VT0tJ zef<2un4wFVju}M)J7rxb1zbGcCgy(j4RGG4E{dmrmJ)7<7<`OYNGz;wE~Hk;zH8P=q} zf~HmjsV&*SAE>NV4~&otN{m~nG}gJaQE${+t$8KGt9HS5~6wXheM1YWVESvS>7ae|jcHzs%!s0`6pSGq^LdAJ`k8vpKG@J{L)uBI`?>yGtZcrEh%a+S? z-)qlpGowRlvIhFga{q?I{(!^l6H13qcNKYs*hsmIQ`(HaHXI#6)8ml8*^K2;Td4&# z6OZK~7OS>wO)MRr*Qp53m{#_Dx+87N)7l=}E1dQar#=dfP9uhv_bv->1yhpiU1`wklAz(d*3uWn~cE`Ma<oM*(X1SoXW#H0sV;;F~DRJM+AOUk*HvEb_4n>fA4a|bD@v{Oed zI}6;Z!jey?EVN#FnqpL_Z`3Pcr=QY{yn`~f@1@@2%y8d9A>|k*YFDMxx$5I^v%FF9 zIUj|nezY`LDJ~27vb?UB?(0 z7_i{0^rZ(_+Gn3nssl2~!IE_6h%`_b&p)kA2j~qk6?PnW)vYl*_fw5vPU!1Y9ajzER|(r$XJePA z6F*qL?Oo~c_oSm*)}#%6{4oD zF8C`)IlrR_D`m$aYuU+nbb)fepBO(sJv}{r;J|?~XAf|VUv|(A=NEd+Ru%t2dY!A4 znFuzsD)N!W=Ntw#lJYMBrct49LyIep21UTi!ty1}*jTDVg=ii74Y~!jI|X>x`qH4Y zes0t8t{d+-=(9cl)QX#Aw*|6G*?<4EZJ00fY=-%Jb|t2MTBJ6!ix=B-?2gc%Eb^Sk zLJStr(}?$a&lYRDFhAEf-12K(#BRHVi>Q>;7RdGIvoDs*9TVOyxek{Sq~4t;s?I)p zuv6xAg2v9P)y!`tNyK^CPY?P(f z2RqvkHzg${_jeq!G*n!rc=2M~7fXN&FhAYka*F1^@6dk0OTB~hnaLiHgMxPZ<@{M$ zjQW1>a%=j)+pBFk+1K_5AN;)O`n`V*m=Cq(-o1P1$s;^7NR^;xx%@7Fes=TN0Eq8; zW~Kx_*1KkC4sYJPiK?3H$SH&ei2;Lq(ayUN*Ss3^cRdYKV>TYy{Pf^cSvN6${^Z2O z3d=0sJ$vHg;&fk~IXU_al=%>`ELoW2`m+~_{Q;)}2OFCn*pEMp#eZa6C%g5Gy}qC~ z1=r}|`h4oxR|o)~RBjw8VRfQJZ`rcNaiUZ1&>?p6Yqq+Jt7nzO3J;|O?pgv78CQ% zVm?VHpxDowbMxP5 z;J~OO9FTFpU3%)}jPb8y;V%FUs?SDJOgs>-jyD_gwh%G<%aT1#YH5jH{gw%S3*}wS z=*g2ObKfIv&}y`N*s(2S4aAo?TBZbj$!y3Ee!7YZ|5hmYP31KR5)=z97P&C$xT$J| z#DA+5ET03JiB(W4bdTagq;>~-f;dYiUvEC@Ywb6`6tO~;FKpTN(-w6HGW&c^W+eEZ zaqbM*6fItGeAMP)xG^DQ{U#3CClpEnQiJ&K94ycN{(fY*mv8J6uTj;Os{Zcx zH$VWl=GZ-NUVV57WBb?TJQ!(wlZVO!>g{?;ZX$vuu6`>mD|?ZUaLLTl#Y%s7`xNfL8(8@EXOaqN3s&-C9(l&q?P27LAZ|fY3R&ZEHnP0GEU2l1gy^gq@k0 z0pWe{%2(Tphuk#Frlc*5iO&K3_1S2MZq5tFd0>$Q{FK$yUZT1?IyzFx01{T)Xmg5H zODa}%2>+=&_wTciOFw=z1jX)s0sJ>o#$LZfq(~&s8gmDA^-lB63PB-iH$^h-Ee&XB#Cih-G&eW*c@KR2lgx`NOY>xZJmrcuDbKmrtyip@5k-&2Y z^_awB^ev~x{M_sFhrtZT?GY)O>vgD;%SHer`CC-JI-7AtqK)sV=dSEN%_pMV`}cni zeC|(DgjmQTHB_GDzg4_NoMw8CJ3^2H*KnN7@k|X*&w>`i-Eq`Rq8PAi_ijXW0c4<-u()gTX6r6LOGc|o?Wp=SO>q;wiol!fC zgi}mpeEP9UN`eWHpS7yCQv)3M%s+160=3X$la!%#R1VXVg7V=&6a!1yu$ z?wcgAxMY9rb_WQePcvJupzD1c2C3BQ_m5VDIe7Ml$KX6!*x2f#Wb};q6cl{W%dCvA z|Mu(wwA$by$SX#ONf3RtPZbo-zw-q|V%f3<8j(E&5N2NWq0Yj5(lewBEK)-RBf2ZW z_`1QTKAmCr13Baty8f)p0_g$#Ag_ZxZ)j*p&&cR0b~wRUz`Pc$Vp zVphSN-ACp(0N-1vdEfW1#;nRZ?0i{xeI3Qj%^{ z{h-2o9C{1DO+zVMf%K*xaZp8{Y3I)6-)%O321I-wwIpf9mV^qOTbV0Yc)%g2um6}r zS?UkcWMr2V)#4-_R$RL~3;Y4n>}A7s#P;W$2}QQUw*r^sPDy6{T|T?4X??l=3fNcw zTlMDeEgJco_+$7Nkb(dA_y4m((60sGV4QjRGu91V(E!jAH337wDoS%eu0}Z+Yt7*6 zzIpiU--rrlmvt4Dl5#`;NYgb1;WsEKXm+A&Vo|!awY9R%#P;%kc>yXb@3IQ5b2ZUo zrH<@8JC$<6*@2I;gz3jOCppm&?<#WAq)8V+&MZUl&Jtctfm*M4wDg2u1XSKMC~ttY z&iREvkH8Ti5+jyIZmws8u!?qFMdvTGnjXT91$`{w?e$={Th2?!JIE4XIBOvQ#$b`)O&w6lzQ& zRX{Zjd720X5pCL6w2>Dt_Jei;?K?D6Mz@wRE+JuXa8NC>5cwGz6?jLzLU$+QVguK1 zUuncsg41S#SlPc6FSC1h-}|+kTgV_j@^LU|6*L*B98>F%99YO`G*C_iq^0vv)u@bg zIyJFcwV-uDfTKRHS4r8bwIEfB@dA%m~w^qdUfi++7ZknBI(=~0(fSO+cPn<3~O z5Jx8w`q`cCYV>j=4@jxm=rEwqUa|-Xu7e~GN+E6! zc!>=C6!Z&s0t34W+%ht4%kFI>`=gRb7mjAN7zKqI6uM`jV<7wE1oJtwA8v1otoe=< zxr|EEunx;4we`yBGI`@>yGTi};|c2Fke%2W%TYIUff@fH>gNxvyKs@woG<^U zlGBUZR7q34xztj;vS*fA`NWBe@?(qP{4Yv}Wl`Ah&4vOfeL-Q3r9ePtkEP6`hL0Zds?)rIDieCrNr&e5yVpM;z|JcvF;RKG$wK*|uK49F{gCx|?9c#G3>sdYJ&;h-{8DcMte5=wa(k`= z0G5mUK6!bg`KBt3AdP7I_?G~&%sM& zd%e!F;+2J$jZFC+!W$cZnoXbt>7^Rjx#RB6RV5U?(piV#0;Ni6BqwZnAodqSJ_%%w zeU3E&AzDRUJ$Oyz+IEO?AO?fg-dcC)=R05JoQ=jrgonFfRaI2v_gut{uB7U$Luj7^ zRp{+qlzs(jws4<$tdfF;@iJ)4^=!hFgP8fsAV}ENP@}92cM;Nx?Mg#K|53NV)tYs! z08D^&?N7i>2<+WUeLv7+0t2?Q`-#~Y7=V6`o>MDzxLP`X5>mNT$Qal!vo68l#J-u- z*RO4XnyPkeRenAKl`K^7%2MnCbhuUuhet`E4I+WDF-9E(xxow4q(cmz@d9urP! z$IHmLckkZyS^9b0!drwO94}%jbzZ24OF6ud-T4@Z4g?c&WL42m24-H=i$T~n-nL#L z`>)x!UC_A5K#IO{x>G9#+^#{x_ zlD-0PKQMb*@rr({XJC5FjYn*l^GGo>Ra4X6lAG%X#_NidmBHX_L4W#dkGgP&bH1E_ zfPjdIh=jyjTuOs3yLvBx1N2s)4Wv7vj!sm5cesm6OO+C6z9TA*QC$z0K0SfIM<>ll zu0?NI?o>&C)0D4TEE}lF+L{_eq$=49DS>F%6kT#0Z>L~rdWl+xz1`7>vI^+~89CVVC)XjCzW^Nmke;E!_#nn4ebCN1sEo08!* z8#I`hm<-r%xy3^o27(wO7XvK)8f8mN$=yhpJSZJj!BQdhB6tn+93Q=GwrS7#Ts|J>!|Vbi_TsyuFHOFf}$jmKTUGmF3zM2T} zm#~K%KKve~Ik4kpVt8kZhMaUczWTvbRYO~46tTe%=OSs@8#ziU4KLU& zbdoj^(uaFj`4aoX{VI7bolw~~*vI2YE6S?>h32xL?;F+XTSLBwZdS(zeRm=jfZ0j9 zsq+J0!taVwq6%yY;&sizQ09eBWJq#*@>6qw)Jlr-w_x? z(=+$(>0`N#@7T(+lWT}}J;QZTx(>AU2blPLiS;!Wdpcg!HH1B+rzchbAnEVbZ-}s# zI^j8-S-(Dox0U&PkR@|5hTEbYC$wLr?;#s^p3~;pcsbg^ zc%V{_k0$054)Ap5`z@tZ&wNHD-yu?|+CbvAfr%9pZ}Pr>-d1(CiC+Kl$G}@fn&Bze z?2-)iEXuWE^p?_?o9^1EdUI{v%OkvplA4>0?p$5VYb~a=)3+8tb8q{OgR48(SaRy5 zh~Vu3%=!&rnNm#sF>^ENN0e&P z>D4hlO?I>Wmo)mw!BiQ7YyNY8jZWo?92U7^4es# z{aU+pb4BHlC`+&V?X66{CjqISKc_J?i#~E`c(AYEhL%`E?p<}S+K?`f>qFwZBSSp@ z;QKPAOEod;J*TDDZt%T^4}CbfN!OlM_Xe{vkw>M%#9FZALNQ$s-u3xSJp8@G9cG7VcNarA#nL zVq;}4Llg&vC}F_>{hzhGXg+$4KaOs+(d!EhsF8Ap%kM9m9&~?_bI$9;%qmiuGDXq0 zvSvu1ZPoVf*L3uHJQ`eQwlH6%B}k{0DJxR8-HJv=(WKr@K65vk&90?tWo=8f?$V3m zbs~E1mk!@%=F`}~F8LZ(40_a;=T3Gpo2X+yw)b{gzK@wLBSC-R-l^FSsPEp>kzMHP zh8XP7+#c?o=|Fu0!$xHeEe%OSw=0#}SJeztJ2`o2$eMus_3*8NkF+pk9rCSo%gIGik0?H|+d-7D2Q=O- zUK$W_&R-tO?h^j!!4TGS1Bviq?ixaDZ^}qC)m{LGV8;P-b@U#Y!t2Rw)Vrz!{NWK2 z5|WUR5EiyZ?rmU-tl^b=7>a^_y*A3^0nXv8$2*=kco-~7yv&9WSdI4x>1Wz5YLm&d zDI;ah9t*pBd1XzvL9R@BAYtcREpsRY|^&j`$WM+=)5l<+*FPy5he2z(xhuyL&!aef+@M z=SL8G#YZG*j5}(>5&OiF(oVkaj~(AmFynT78)6lHBY(gug02+;30cQTIB(v_L}Xhu9tAnwXH$5px;#Mz|D|{laXY3 zG`2pCTz7(c(Zfo;e(yhf;Y>A;Buy?_Q~yRU&BV9i0oEsR88zU8eWSMq^&ZyaV?hq> zaf>+Q8@FAFFD2iK=@1Q3za@bA*bx`p4tZk$^BN@&X@cOsS;}xEmU<+&eVJ>fhGQ66P^bO2 zGV#sSEYCUq{qr6ivvq730tamXv-`k{pOl~Y#gB)H&+#7h74^?~e}^GW?)6*A35fiA zkrEW5fA$PW_j$iV^F(ig6K#^iXzJN;em^7_VrVlydzg9)(k$RN9Jyp<7GY{Zi^W22 z0%r|T9prUWo|eg--w22qf9Mxrr_m<|MMjQhde+Ar28UH2r)+X}9XOMjyLcb`yoh05 z6BMj+PM-qcezHFxD*VK^Aw+_91SHdE6D`nsk7uh9&c0MD+=`D>131O2vJ8~K%(7{x z^g(|95eVq_{rA4veFct44UGp2W*gRPU*)}UD@KiyNGPwq$3FE6@JIuK%V(HkUVhQn z(s~GqL?x+&8v4ZYF1v*q>+Ci#ho$gQr#YQ1xxTpV5kQ{zL&;?-j{u4SCpepOI;EPa zEU_C8U16(K|5Naf>fvHX>Gz}aP7{DlF-LgAv^D$6v+K-6jEps%;uFYyJum`6Mb7~q zgM>h3Se(2{;`OO#@e^$!6xYO`>d=F#1 zpPkZ?y`vegA<(YxWwf#phsx<+P%+zf671qhomoUxKTicZ!4QPFgQbEjA_IGFJNCS>P z3CwU*rECdsU~yOabAgDXU9ck`nv2><_*!Fq>L+fZCEmGW4Z7XiMoTCT;uSab)w_py zC3I1ZAnx5R4X8g>OpTbp(g3Z)Z&wlT67iwg9vYB8v12)#Gq`c%|({*ZdD~}9x1s~8JlhG zaH%eOC!FSBXl2tNT8o1${wpJFr(Bm(QC6;~to(ejCAMx^aN^T4X;sSEvuEq%W+|j+_yFu?Nw9+q{z@~$3;?eH+d*f*b zL)YT*Y}UAf0Pwoc?v6GDbUG}+(rH+do0*xXK_LI=D*gjXDgXwIVrma#t9i(YlJ~** z00%W?mjrC|)s0D$*4Ro{?1OZ8$o&KbYX(1NXK7+@vach2?S{qe6si!&86`(`E|6;|%K!uev^!w3~f+e_Y$d30U8@+nB zkfB=Gq4OmBWBLs8L^hK{E90D?Au85y}-y7@U4}WA}6fObELJqwo&cg@|XL=cGz_wi^{!haY~^8=J7&N1 z(Z9m8gQpf2N>C_WId&hq4vn{FBw&DM?Tb_`RoFn%q9G3AB3#sI_s-FwQV2ZKXM48^ z?k7yEcPrdyNF86WcV)Wj5I8xc5jf64M{eJI^2PZ=Fu;c(Ie=SgX!KbgHAWjgKdA7> zB1^wI{VWC{8k_Lw2zVY<4UHn0BSnR%Gnn z$SygV=Cf>-gvwQw;wBEf^>lTbvz!9EUb zirS!8mg9zPFi8L9Wo1?WEQrRJdLrDVa3NI9VPc4qYtajK{7A-GxIwsFlgIbS$RJ`t ze#w};B}^x*0bV{f$g2H!51{Z1L&ALzzDS)O{sFOEOK_QhhU8^lto zu|j~K-+s{&0bQN`6ND)Px4nZyRH&NDK{4&wE)FaW(vakVWduXGs0kSWS4BWcNy!s> zs#)t%kaIUlQ%%ug7N4|`4Xe}b{>Dm6X?REom|sb5rGGe>j?R^Yd)eEe;kiiIpP)e8 zC;KC}2HP#-)_WAw0(9;~q83t@o{b20d8bx*8F?*KhCQ*f%8Vl50lg z$$zG*MacB0`d*NzWQwNTuO>)`-)o};L}bBLBL0d&WF;nn8w z+ln2WpaH?U!QwESDiG`i>jqTGC?n=UY;uIRY_}Ztho!g8OXl9+hsU+I-l~`V;N^#; zXDCM4{8-d_rTK4m-1`U<2kB@%w|`{W;hP5uq6}%*LM;5%X#qQ(!1jx3$EJWlE+c&< zWKY}4!};}IWCwMmGZB(hyBy5=+@(-9vB(CTcYdelHu}}L77IUEIZw-!?=j*}P_cn@6RzxVZ$)f~S8 zRj>nJgfr#aKR$xG!1_Nyh<3nwg5Qqw%g@rH_c5D8?I5&*$1=- z$BySyHeng0FWc(ze^m052CfY!%tN9L=D1)e<( zBUk-x?14l-0Tx=9{v=3TQ29--z?+b_g;zS-oRb!RiX-87x{JgHRgCx0p%#mI)E-{- zCow9IHl&rh4pT58zVg7ol0ZFJf$p>8R9&Pc`4oghhzhWmiOR{zNlQzMi=P^$-Ol=j zinVW59*%!>9HOy^UaA4S2*K;&ZIFim3vZ)M@v_9O5-;Pgetv!w3MD4^^OJVn%i84( za=its75UHiKhy(?bGZ{q_J?AQ&Bt&yz-fL$m4%lwdNAobdWNUUlz6y&#+>s>z1Vu# zk|%iUXbSqRTZelE@1x9O^|!p#gFVmEFm&>WI2va6BfT?iNGZ@JcKK~RWKC%{+b?-2 zWvIy$^LqqbOC42ZySLR2+t0A|24c$R=_>d)Q`dhe=(9a9x&=LCN&6aK(c`@ZSEu?b zu?xog8_Eh4Cg~KNGiM|{=O$6_!H^WLEQ}gutKyPc?r;i+vyUv|pC zKu`h2fuhqZC@kzf93O^Ft56hMGBYz{*hsU_BB)&ymtALQNJzZr$iZrJq;OSLRde(2 z*iOA40I{1@sQqLOFmvZ4Nt=u_f_n-tX0(FLhTbjhIHcI#bZ4<%lVGW z8@7_#d;LUa9UK}WF-SR4sl;8{07JAHyH|&95t)!O=@6tPZxH_pEHu;S_aJ9JrAEXa ziP^W5K`!?m0H-MRdjW7n2f{Zjk@|#>W6g3V zOa0S0J60~ca#MeyS3y7hRgNLZ5=oT|s?L3&=xWs8Up56WOCM{)vdL5I^(&IPt&#LS zs2)7UUhoLEL)2IPIQi`5bKqV|K}3-5QD0ret5w$SHe%KwVjiLkIh>Q$3?iK%(Sk5w zob78y^f%+>mP4_BFPeF**NHmsDg5Y_rQO>QF~%24$s}UdzW3wTzk_MChF;TfsZMX z6OVKpLUzibb_|X~N|WKMc1jVxr2(&dY;&3%A5($jIvmIti;r_53l!uGe^9|E6wQ!h zqCCia&;60?I0Kk_hN7<>xwi|wA@!YoNt*^cA~dK|ss%=+r#jc3I$6HbxQ>;JmGm(6 z7u*)Ti_3FfoSSe0s--?Q>K7r9Nf@6Na{zPBed=MV%9MA8wbX-FffdOq??|lV!R@c2 z4*;uG7p&rkM^%NVonxn|sX;x5*^%B=?fE;UZ{CQYz6JIs7=u%y9;XVz&6PZjr)UOV zzQ9&_Y~&!ayp}$X#yh}*vmX0B)G}QuBBt6+KOt~i;n9eT4;z# zmVm}h5QDHYp&Q*~lGEXs{nYV#bK5P9K)ZyQ;xG^>WV!^WvoUh}93%WZkEmmMcQGZT z{V%*Kmu`EMxQbRQW`~bQ1(<&Y8%%K+G7e{9ASq{@+R8r3vH z1c)WD1SblEzDtenZ+L6Dx$~sIlO8QjmH(@`(UtnuC zviehbL;9Z;y8~Cny4JJlf8{n2+(syan}ulpmz&MDj#v_>tc{uPWFt%2+)ECs{Z%XSgWaV>vD^cnV0NOvFw-{^`O%bN`i@<2Sya8n zvswXJsl<^rq-HR$*FW}<9>`>r?!NLwvYmiXalNMJVRC*2w@Gib^wkH_zP9)lkWAZz z^q^Ht$A&a$xbC5-->+bwmWy4*5O~NDq^3PWLgf}@-cV@mr!hoQl zoY$Belz(9)xY99SBBRus!mda3_~E!@nUJV{4Z6I>t9qmM;9>tNCgTVBr5$PM5nzg& z`nLu9ak<=*AE23P+Mzd6U)i&Yv}RY9FhO)F$Lgr^G0y*qU}e}7wCR4>yyUi{tGHw_ zTEpDNKborh8~#*AE%4sdc(98&^8D1!`dFC*WioyNw_3GyB4(6N@Db0!=;ZAg&la1LYG+5l7s1jXc*i5iN>mBD^VL>Ab{q@Zj_Z9Di;gaS8;e zbp=k>E&^7ZC-8^_bFD1HMr8sH8T~v;<7<5R)Y_7-g(t?^vnr0ie-No2x=Qg6!Y4*q zv%&DLpD4rHFRs?}ZKYSm!mGZ$X8fzP#@O=hkQ&!b-e*nOHm=I{J|Ob1&8}VNU>17G zrQ>`*_iuB~xrFM-k=@|6M z14px-e%LpXw6jVz`K|7yVqUuhmur0*wZdZ$s0KeMi7{K)8Dob=_OUbCY;5i1RhhL5 zv(#bjA7>0XM42hx3MGJQACG^rwOd$rkAN}nxd!P_w~1G0-?lSQ1$~B?SHULgIp5!q zYA=loh|ATF7!7_ZXQ1+k1Z`g@f1O9DUxZkQR&7gBq15?h$s@npRuP99J4SX)bhvU;fMeg2PrOmv}Y)(V#b23&=+q@$dfi*5Db}2EJ!& z`G_M_-I%}SJnK94_!FmM%GD@7B zNC+1K>hoY26to`~baJ7=A3nsw{YjhR$gFg8Md`)gl0j(Q7jwV0lp;@~D2Fj=aau4b zx;}^R^j}}{!xH|aWG7YTj^Q7F$w<}fz2|?Ha~=>A!`=~diAd(ZKTy+Boq(tb@=g%Q z;K^V`nTHc`U=JL{Y-FnKQg1Kb_Ts{Zl>f6irW^pz(omR)6((j+t)+r}_v|aJ>9AbE z#tg5bz96dwob4Mu@ZB?4-xGfFxF7msjPt#HfeNf-sv-0NG72$?0o+B?jSW#{<>lB< zuSI_n-#4M974vs|Gk&GRA3-?XBmv5H!e%= zGAN#^5}JDsF`lzuY{%YdUtEZ}s2 z%wNX`wL3lB8;tKI*!T39Qu}z%0`AD_Bs;O@Fk~eRJAA;%Jmai>CrsSnTv)ekfot?= z?h3wN=jO8-;7(!>_#7BUe*Va)TgQ#BVMsBMx9ODSR>B6OtiL7|@A~9%Lsiu(&`j{J zdBXGxV(aUbx9Et>&CE`v8F_tuZK5B>sHjX0FifpTRT!wo&(GkPwV_g2FHSU+K%7~s zIn)I_@a(M_9jO-@BUQJhI^(FW5rXi9?F|3?{aUL3R|eg`DF#sFKg}lpN)3OvaQxlt zfv`t50r5foZmXDG|FZp3w_N&^ z+40VXZvXW=zWT?ueskwK`m(~7q_mo5+dldSS+15lWBX#)yy~N=8_QikMdXypupy!q0hVg9LH69;P5)|CwCj^Y1D^qSe)HdZ8fpH6AyzR)!G%^FDom9UGEjXh6aYq%F0S`u5EDCMn;}W}92~ z*lw^QtbAWHykC(jgOBnEI9b0nHk8q)cE*4l9D-Z--eD-85m+g zhNsr(po9c+&B*8|r-FBTS=q6@TOz{4_YX?8wY6b$V6HHUSP-Ws1}+>c=Q;P#|K9!k zaQip4?cBLDATc@lPGmZ9-uLfDCUWnO5Xd7%Mc!6cFUhf5Ht^!{?OMBb?Sm0eBE(kF zhms!LTh`sUaRVpE7V_ryc6BAycrm!M;ZVeO?N_mOI_7bQ8F zpN{Uvg9nU{l(&#bT#uBIRP#L6k5|(XyZA*!u*uXwkA`T!urU0SwXE-lp_iAJySuxY zS$uA8Zb--%m@3W0&K^5<3l8=Cd=Hn2-gyzKYT>)C)^0^eR<J{imG-T^k>Wxui_-5fBvA_1Q;S^3ptY_%O|8q;QQ3 zD{wE99;x#-sz3|GPQtBBgI#{)*yi8({+i8?41`-QrzItwJh2+@`Es0hj5Er~$swII zH#a|Wj`eUp=w^$UcWSojq3YB@_p>}X_Idt$~f8Jihm#L|>RaMwdSl`%~k^T4Q_3Q4u zy^PrPx&Oiykj-|6cQrynLpxz91Qnxn@#@vFk&&vP%^a3iR){+=;D|GX`)GIfJEx=4 zAKS)KS!`T<*3<>kD${Ogmnsd#+JHgTN;ViG;1Iqg4ZKNDGXG918=F9X|2ZgY;@>#s zJu6h?*dgwG#yo`cB~1;EvazthXq%Lps_|S-RMZxipajPq0Ml(^VlqN!;OgqS1nO(o zBmWP{jyLMyg!dj_*$~aS`r)dk9(F$Xj$3yHRsI+o1ADX|TRUF7cmXy!Nq0LtyC?R~ zL@#-;F)=+32{F5R75;48jMYu@NkhYBsMPj`Y-_=wTUc7^8ynX-aZ8^%cMe=}BftT| zl`7;b1qTH=fM3SuE0is4mv1p(s|dyJB#`>m6&05uXK-+Eh>MFukwhhK2j7O>>ba>8 zoC-R|J9-Ak>$>Mp5-Q!soy2;OR=litVV!SiYKrSD!dFhcIm6D$S$E1L&v9kR?ai42 zu=H3{sa8E_VEI2Ii2cDY&Iqz%F@-&sq3WyHqanUMBR##;^e09sBO@b~q`H<>#0bY= zlhv#LtC4FBhdOV=lg^^B(wfq0h?aIEisV$rah-Cg3}YNtk{Xm@kj8L%Gqp+u?b)+^3`Wh}yQw4hbDcar?Wrg4b3rIr z&SJ4pfM2-yy>o&U-?4GvxbSRW0~~^Uy}WKhS0-FFvhAWxo>P%31*CUjptpHI!1uB+ zDhMdk*=?+odV1M>SjU;CRVL@K4arIRZvWsuYj@qhU+x){jPG7m^bZZ`vBWO!?(VyH z6LRbF^77;K%yCs*frEpf=sNdvJdCSC`v0|;FLU?%^RNC50+2l>!-R5|#40ZYmz^?zn`OD{R%UXM;g= z4-X%zG-%iU@)Q#h$!1^G4~Y#p8W`w)%g5Z!?UIYeK;3*XXf69SQXw7buS{CV5eRWOrs0cm^3A#aEvD5D#4^lj7#d#PRjY+k zGmI|Y9G`&}Lo61fg_yRDA+p58RVN5E#ux12d(-Fr+q67RwuQGTrwm^F?-jcnxG`aSrY2T=(Ad>^ZjX9<*wvdQ!O1gLm2D)BR@h$|a zJ9iQqxaXc89=4qyYZuwQB}1TYby5L=;%c&Rd6h@ zeGPd^Xe!CASb`&a?AS4}gM+BKS(W1N?>}zSrnHe6&N}&W{%+s%eWse8o4NP6&n_H% z-PgC5ibW>-DuI(!n7^7S!S#Z57*$?LNznacstvF4;ltBcZihAkwM_RI&%F8OklY8S zd4~zFJQodQXtnj{;M#@$h)}b2shL?FygaJWa)+FxxB*T*M0F3|V^EIu-rU*MI}~={ zbXQieys6x%mqNG6yPcig zi?)yix3;}K3~9EzjMY=QfljseoJJ&QGkq9U4?On?7^Q+jJjrCK9%+3jS99{5I^ z)zx9hYJX{a-a9`u;=a9xD#XMW$VQ{)J{}XKoIH6F7yFV}V>)>jiRt6Vk0GxJfbW2P zP>Dd0sTXuDGm{QB3PTc|*CoQ@#iYZu@}q80#9LcGf|>)E7ObNal*f&Y`VoKq%uu+J zo_@f?W3<2jgD@l|0UhJ&>T0Y7K_PnZ2lA1X1b(vv-~d3!nWj>po`i~o!{JaW+3$TA z3hURcv!ufQav>;a&59MuIZ#vm{XrrN7|w*$5&1BHO{$Gw$Evq^d3ms7Y{Pj({%{mW z&e!)2C=2krD1O@3(vk!u1hM4kXi4|Aq$J1v``f#QEG#UgqAAIg4_jEcQn3eUw0Y- zBMgK~APQ$Er{t_GhKq~p1uGhj22+8a&d%b?I@`9LPXMtm|JEB7%X1e)|LtL#r5ljk z@Gu&bEb7I~%qOCI;Fqt$Rxx$x?Ci7$A7K2|E(&2ZJ9`~56lEOAC9$7AvGw%y^7n0# zhZH3Qma8~@SiIs(z_ivBM~Owya_8XRxFS6_%2;VtR`W zNHO^+BB5=eWuhrBNs*I`m*Y`YLZE;)=R4l7sKDJ9u+xUPcDeoP>*wyiUKW4{uOoDO9AvRS*EHKjkYM}3f7Sdzg zjV7lIm6eq>HBo(Ns;jFLiOwaU_x$sAHz*iE!EzZ=$;`~e7DdX8Zqe|wT-UQkp~Et= zh>&AFH8pQfZ!`$CdahW8DJv@r1#u_ngzR^uYzDE7*zR&XRbAalG|~XvY>(*b==|j1 zU=lfb*vY9CX^u-S8-)hwlY_vUDW1mRh>0N;xkQ3JnHXZkD=aCoecSdN@I1=3ueq^N zIY$@=2E`=DtkPHoM)cjOPDLQVAh^VvDkISa&TM6S$jI){)osQN09^y2-{gE+5ft>U zva%8vc2O2(Dd}68V3dt}Ii|`o`uh5lhEI`QU}FH^6ML*H#-^(xY>dWY-KA1cN{r#I z7{XG776=4S+S)$+I^B)0z$wt1ot-T&D+8fT&{1_3wUbT%%Y!W}zebXO5>XIo{&7J1 ZvfM$enyXyGJ3+)LYjb<5aIaVFe*n4yfq4J` literal 0 HcmV?d00001 diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index af8882cc04..7e9bf27d08 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -445,9 +445,9 @@ @book{HaWa:91 address = {Berlin}, year = 1991, } -@book{HaWa:06, -author = {Hairer, Ernst and Wanner, Gerhard and Lubich, Christian}, -title = {{Geometric Numerical Integration, Structure-Preserving Algorithms for Ordinary Differential Equations}}, +@book{HaWa:06, +author = {Hairer, Ernst and Wanner, Gerhard and Lubich, Christian}, +title = {{Geometric Numerical Integration, Structure-Preserving Algorithms for Ordinary Differential Equations}}, publisher = {Springer Series in Computational Mathematics}, doi = {10.1007/3-540-30666-8}, year = {2006} @@ -1806,6 +1806,17 @@ @article{HaSo:05 publisher={SIAM} } +@article{FCS:21, + author = {Imre Fekete and Sidafa Conde and John N. Shadid}, + title = {Embedded pairs for optimal explicit strong stability preserving {Runge--Kutta} methods}, + journal = {Journal of Computational and Applied Mathematics}, + volume = {412}, + pages = {114325}, + year = {2022}, + issn = {0377-0427}, + doi = {10.1016/j.cam.2022.114325} +} + @article{FFKMS:14, author = {Falgout, R.D. and Friedhoff, S. and Kolev, TZ.V. and MacLachlan, S.P. and Schroder, J.B.}, title = {Parallel Time Integration with Multigrid}, @@ -1998,6 +2009,18 @@ @article{Shampine:80 doi = {10.1137/0901005} } +@article{ShOs:88, + author = {Chi-Wang Shu and Stanley Osher}, + title = {Efficient implementation of essentially non-oscillatory shock-capturing schemes}, + journal = {Journal of Computational Physics}, + volume = {77}, + number = {2}, + pages = {439-471}, + year = {1988}, + issn = {0021-9991}, + doi = {10.1016/0021-9991(88)90177-5} +} + @article{Sod:98, author = {Soderlind, G.}, title = {The automatic control of numerical integration}, @@ -2076,6 +2099,17 @@ @article{Ver:78 doi = {10.1137/0715051} } +@article{Ver:10, + author = {Verner, J.H}, + title = {Numerically optimal {Runge–Kutta} pairs with interpolants}, + journal = {Numerical Algorithms}, + volume = {53}, + number = {2}, + pages = {383-396}, + year = {2010}, + doi = {10.1007/s11075-009-9290-3} +} + @article{Ruth:93, title = {A canonical integration technique}, author = {Ruth, Ronald D}, diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 91167b7f5a..80f21352c0 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -41,7 +41,9 @@ static const int ARKSTEP_DEFAULT_ERK_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3; static const int ARKSTEP_DEFAULT_ERK_4 = ARKODE_ZONNEVELD_5_3_4; static const int ARKSTEP_DEFAULT_ERK_5 = ARKODE_CASH_KARP_6_4_5; static const int ARKSTEP_DEFAULT_ERK_6 = ARKODE_VERNER_8_5_6; +static const int ARKSTEP_DEFAULT_ERK_7 = ARKODE_VERNER_10_6_7; static const int ARKSTEP_DEFAULT_ERK_8 = ARKODE_FEHLBERG_13_7_8; +static const int ARKSTEP_DEFAULT_ERK_9 = ARKODE_VERNER_16_8_9; /* implicit */ static const int ARKSTEP_DEFAULT_DIRK_2 = ARKODE_SDIRK_2_1_2; diff --git a/include/arkode/arkode_butcher_erk.h b/include/arkode/arkode_butcher_erk.h index fa5a1581c7..e0c3c546a1 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -43,7 +43,12 @@ typedef enum { ARKODE_ARK548L2SAb_ERK_8_4_5, ARKODE_ARK2_ERK_3_1_2, ARKODE_SOFRONIOU_SPALETTA_5_3_4, - ARKODE_MAX_ERK_NUM = 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_MAX_ERK_NUM = ARKODE_VERNER_16_8_9 } ARKODE_ERKTableID; /* Accessor routine to load built-in ERK table */ diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index cd4e5c7018..76a1cfb380 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -36,7 +36,9 @@ static const int ERKSTEP_DEFAULT_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3; static const int ERKSTEP_DEFAULT_4 = ARKODE_ZONNEVELD_5_3_4; static const int ERKSTEP_DEFAULT_5 = ARKODE_CASH_KARP_6_4_5; static const int ERKSTEP_DEFAULT_6 = ARKODE_VERNER_8_5_6; +static const int ERKSTEP_DEFAULT_7 = ARKODE_VERNER_10_6_7; static const int ERKSTEP_DEFAULT_8 = ARKODE_FEHLBERG_13_7_8; +static const int ERKSTEP_DEFAULT_9 = ARKODE_VERNER_16_8_9; /* ------------------- * Exported Functions diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 2bedd445eb..3bd782f41f 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -2021,14 +2021,19 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) etable = ARKSTEP_DEFAULT_ERK_6; break; case(7): + etable = ARKSTEP_DEFAULT_ERK_7; + break; case(8): etable = ARKSTEP_DEFAULT_ERK_8; break; + case(9): + etable = ARKSTEP_DEFAULT_ERK_9; + break; default: /* no available method, set default */ arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", "arkStep_SetButcherTables", - "No explicit method at requested order, using q=6."); - etable = ARKSTEP_DEFAULT_ERK_6; + "No explicit method at requested order, using q=9."); + etable = ARKSTEP_DEFAULT_ERK_9; break; } diff --git a/src/arkode/arkode_butcher_erk.def b/src/arkode/arkode_butcher_erk.def index 5cfb3f2af6..ba719b24bc 100644 --- a/src/arkode/arkode_butcher_erk.def +++ b/src/arkode/arkode_butcher_erk.def @@ -36,11 +36,12 @@ are known precisely enough for use in quad precision (128-bit) calculations. - imeth QP - -------------------------------- + imeth QP + -------------------------------------- ARKODE_HEUN_EULER_2_1_2 Y ARKODE_BOGACKI_SHAMPINE_4_2_3 Y ARKODE_ARK324L2SA_ERK_4_2_3* N + ARKODE_SHU_OSHER_3_2_3 Y ARKODE_SOFRONIOU_SPALETTA_5_3_4 Y ARKODE_ZONNEVELD_5_3_4 Y ARKODE_ARK436L2SA_ERK_6_3_4* N @@ -54,9 +55,13 @@ ARKODE_VERNER_8_5_6 Y ARKODE_FEHLBERG_13_7_8 Y ARKODE_ARK2_ERK_3_1_2 Y - -------------------------------- + ARKODE_VERNER_9_5_6 Y + ARKODE_VERNER_10_6_7 Y + ARKODE_VERNER_13_7_8 Y + ARKODE_VERNER_16_8_9 Y + -------------------------------------- ARKODE_KNOTH_WOLKE_3_3^ Y - -------------------------------- + -------------------------------------- */ ARK_BUTCHER_TABLE(ARKODE_ERK_NONE, { @@ -166,6 +171,29 @@ ARK_BUTCHER_TABLE(ARKODE_ARK324L2SA_ERK_4_2_3, { /* ARK3(2)4L[2]SA-ERK */ return B; }) +ARK_BUTCHER_TABLE(ARKODE_SHU_OSHER_3_2_3, { /* Shu-Osher-ERK */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(3, SUNTRUE); + B->q = 3; + B->p = 2; + + B->A[1][0] = RCONST(1.0); + B->A[2][0] = RCONST(1.0)/RCONST(4.0); + B->A[2][1] = RCONST(1.0)/RCONST(4.0); + + B->b[0] = RCONST(1.0)/RCONST(6.0); + B->b[1] = RCONST(1.0)/RCONST(6.0); + B->b[2] = RCONST(2.0)/RCONST(3.0); + + B->d[0] = RCONST(291485418878409.0)/RCONST(1.0e15); + B->d[1] = RCONST(291485418878409.0)/RCONST(1.0e15); + B->d[2] = RCONST(208514581121591.0)/RCONST(5.0e14); + + B->c[1] = RCONST(1.0); + B->c[2] = RCONST(1.0)/RCONST(2.0); + + return B; + }) + ARK_BUTCHER_TABLE(ARKODE_SOFRONIOU_SPALETTA_5_3_4, { /* Sofroniou-Spaletta-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; @@ -642,6 +670,350 @@ ARK_BUTCHER_TABLE(ARKODE_VERNER_8_5_6, { /* Verner-6-5 */ return B; }) +ARK_BUTCHER_TABLE(ARKODE_VERNER_9_5_6, { /* Verner-6-5b (DOI: 10.1007/s11075-009-9290-3) */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(9, SUNTRUE); + B->q = 6; + B->p = 5; + + B->A[1][0] = RCONST(0.06); + B->A[2][0] = RCONST(0.01923996296296296218408805600574851268902); + B->A[2][1] = RCONST(0.07669337037037037008158080197972594760358); + B->A[3][0] = RCONST(0.035975); + B->A[3][2] = RCONST(0.107925); + B->A[4][0] = RCONST(1.318683415233148359391179837984964251518); + B->A[4][2] = RCONST(-5.042058063628561903612990136025473475456); + B->A[4][3] = RCONST(4.220674648395413619539340288611128926277); + B->A[5][0] = RCONST(-41.87259166432750845388000016100704669952); + B->A[5][2] = RCONST(159.432562163137475863550207577645778656); + B->A[5][3] = RCONST(-122.1192135650100425436903606168925762177); + B->A[5][4] = RCONST(5.531743066200053071668207849143072962761); + B->A[6][0] = RCONST(-54.43015693531650356362661113962531089783); + B->A[6][2] = RCONST(207.0672513650184782818541862070560455322); + B->A[6][3] = RCONST(-158.6108137845899932472093496471643447876); + B->A[6][4] = RCONST(6.99181658595024213553870140458457171917); + B->A[6][5] = RCONST(-0.01859723106220323093906721112489321967587); + B->A[7][0] = RCONST(-54.66374178728197819054912542924284934998); + B->A[7][2] = RCONST(207.9528062553893619224254507571458816528); + B->A[7][3] = RCONST(-159.2889574744995115906931459903717041016); + B->A[7][4] = RCONST(7.018743740796944408089075295720249414444); + B->A[7][5] = RCONST(-0.01833878590504572220210022237552038859576); + B->A[7][6] = RCONST(-0.000511948499788209866745436471546781831421); + B->A[8][0] = RCONST(0.0343895786835703570760713887466408777982); + B->A[8][3] = RCONST(0.2582624555633503682372520415810868144035); + B->A[8][4] = RCONST(0.4209371189673536961528554911637911573052); + B->A[8][5] = RCONST(4.405396469669310199890333024086430668831); + B->A[8][6] = RCONST(-176.4831190242986451721662888303399085999); + B->A[8][7] = RCONST(172.3641334014150743314530700445175170898); + + B->b[0] = RCONST(0.0343895786835703570760713887466408777982); + B->b[3] = RCONST(0.2582624555633503682372520415810868144035); + B->b[4] = RCONST(0.4209371189673536961528554911637911573052); + B->b[5] = RCONST(4.405396469669310199890333024086430668831); + B->b[6] = RCONST(-176.4831190242986451721662888303399085999); + B->b[7] = RCONST(172.3641334014150743314530700445175170898); + + B->d[0] = RCONST(0.04909967648382489863179145572757988702506); + B->d[3] = RCONST(0.2251112229516524232408869465871248394251); + B->d[4] = RCONST(0.4694682253029561769253064085205551236868); + B->d[5] = RCONST(0.806579224998886790132246460416354238987); + B->d[7] = RCONST(-0.607119489177795901291290192602900788188); + B->d[8] = RCONST(0.05686113944047568868889186433079885318875); + + B->c[1] = RCONST(0.06); + B->c[2] = RCONST(0.09593333333333333333333333333333333333333); + B->c[3] = RCONST(0.1439); + B->c[4] = RCONST(0.4973); + B->c[5] = RCONST(0.9725); + B->c[6] = RCONST(0.9995); + B->c[7] = RCONST(1.0); + B->c[8] = RCONST(1.0); + return B; + }) + +ARK_BUTCHER_TABLE(ARKODE_VERNER_10_6_7, { /* Verner-7-6 (DOI: 10.1007/s11075-009-9290-3) */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(10, SUNTRUE); + B->q = 7; + B->p = 6; + + B->A[1][0] = RCONST(0.005); + B->A[2][0] = RCONST(-1.076790123456790123456790123456790123457); + B->A[2][1] = RCONST(1.185679012345679012345679012345679012346); + B->A[3][0] = RCONST(0.04083333333333333333333333333333333333333); + B->A[3][2] = RCONST(0.1225); + B->A[4][0] = RCONST(0.6389139236255726439495106205868069082499); + B->A[4][2] = RCONST(-2.45567263822365688952231721486896276474); + B->A[4][3] = RCONST(2.272258714598084150537715686368755996227); + B->A[5][0] = RCONST(-2.661577375018756796976049372460693120956); + B->A[5][2] = RCONST(10.80451388645613874928130826447159051895); + B->A[5][3] = RCONST(-8.353914657396199316963247838430106639862); + B->A[5][4] = RCONST(0.8204875949566569071080834874010179191828); + B->A[6][0] = RCONST(6.067741434696771740675558248767629265785); + B->A[6][2] = RCONST(-24.71127363591108760942915978375822305679); + B->A[6][3] = RCONST(20.42751793078889477328630164265632629395); + B->A[6][4] = RCONST(-1.906157978816647169395537275704555213451); + B->A[6][5] = RCONST(1.006172249242067939789535557792987674475); + B->A[7][0] = RCONST(12.05467007625320441377425595419481396675); + B->A[7][2] = RCONST(-49.75478495046898785858502378687262535095); + B->A[7][3] = RCONST(41.14288863860467415634047938510775566101); + B->A[7][4] = RCONST(-4.461760149974003830664059933042153716087); + B->A[7][5] = RCONST(2.042334822239175284863677006796933710575); + B->A[7][6] = RCONST(-0.0983484366540610666085342472797492519021); + B->A[8][0] = RCONST(10.13814652288180795380867493804544210434); + B->A[8][2] = RCONST(-42.64113603171750099818382295779883861542); + B->A[8][3] = RCONST(35.76384003992257021309342235326766967773); + B->A[8][4] = RCONST(-4.348022840392907539808220462873578071594); + B->A[8][5] = RCONST(2.009862268377035743327496675192378461361); + B->A[8][6] = RCONST(0.3487490460338271702767087845131754875183); + B->A[8][7] = RCONST(-0.2714390051048312657577810114162275567651); + B->A[9][0] = RCONST(-45.03007203429867644217665656469762325287); + B->A[9][2] = RCONST(187.3272437654588884470285847783088684082); + B->A[9][3] = RCONST(-154.0288236935018630902050063014030456543); + B->A[9][4] = RCONST(18.56465306347536170505918562412261962891); + B->A[9][5] = RCONST(-7.141809679295079149596858769655227661133); + B->A[9][6] = RCONST(1.3088085781613787439425777847645804286); + + B->b[0] = RCONST(0.04715561848627222024665783806085528340191); + B->b[3] = RCONST(0.2575056429843415317648691598151344805956); + B->b[4] = RCONST(0.2621665397741262393260797125549288466573); + B->b[5] = RCONST(0.1521609265673855848621798259046045131981); + B->b[6] = RCONST(0.4939969170032484924171001239301403984427); + B->b[7] = RCONST(-0.2943031171403250323415079492406221106648); + B->b[8] = RCONST(0.08131747232495110944139327102675451897085); + + B->d[0] = RCONST(0.04460860660634117375034080055229424033314); + B->d[3] = RCONST(0.2671640378571372709259890143584925681353); + B->d[4] = RCONST(0.2201018300177293163244485185714438557625); + B->d[5] = RCONST(0.2188431703143156881186115469972719438374); + B->d[6] = RCONST(0.2289871705411202773561285539472009986639); + B->d[9] = RCONST(0.02029518466335628046337546948052477091551); + + B->c[1] = RCONST(0.005); + B->c[2] = RCONST(0.1088888888888888888888888888888888888889); + B->c[3] = RCONST(0.1633333333333333333333333333333333333333); + B->c[4] = RCONST(0.4555); + B->c[5] = RCONST(0.6095094489978380991601625282783061265945); + B->c[6] = RCONST(0.884); + B->c[7] = RCONST(0.925); + B->c[8] = RCONST(1.0); + B->c[9] = RCONST(1.0); + return B; + }) + +ARK_BUTCHER_TABLE(ARKODE_VERNER_13_7_8, { /* Verner-8-7 (DOI: 10.1007/s11075-009-9290-3) */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(13, SUNTRUE); + B->q = 8; + B->p = 7; + + B->A[1][0] = RCONST(0.05); + B->A[2][0] = RCONST(-0.006993164062499999597544153573380754096434); + B->A[2][1] = RCONST(0.1135556640625000057731597280508140102029); + B->A[3][0] = RCONST(0.0399609375); + B->A[3][2] = RCONST(0.1198828125); + B->A[4][0] = RCONST(0.3613975628004575391116759419674053788185); + B->A[4][2] = RCONST(-1.341524066700492845427561405813321471214); + B->A[4][3] = RCONST(1.370126503900035208616259296832140535116); + B->A[5][0] = RCONST(0.04904720279720279491053602782812959048897); + B->A[5][3] = RCONST(0.2350972042214404811311112553084967657924); + B->A[5][4] = RCONST(0.1808555929813567275665775468951324000955); + B->A[6][0] = RCONST(0.06169289044289043982827180911954201292247); + B->A[6][3] = RCONST(0.112365683146402772774052891691098921001); + B->A[6][4] = RCONST(-0.03885046071451366683779937716280983295292); + B->A[6][5] = RCONST(0.01979188712522046006414555563424073625356); + B->A[7][0] = RCONST(-1.767630240222326953869469434721395373344); + B->A[7][3] = RCONST(-62.5); + B->A[7][4] = RCONST(-6.061889377376669330033109872601926326752); + B->A[7][5] = RCONST(5.6508231982227634659921022830531001091); + B->A[7][6] = RCONST(65.6216964193762350987526588141918182373); + B->A[8][0] = RCONST(-1.180945066554970779293398663867264986038); + B->A[8][3] = RCONST(-41.50473441114321104805640061385929584503); + B->A[8][4] = RCONST(-4.434438319103724879255423729773610830307); + B->A[8][5] = RCONST(4.26040818858613334896290325559675693512); + B->A[8][6] = RCONST(43.75364022446171219371535698883235454559); + B->A[8][7] = RCONST(0.007871425489912309975126802896738809067756); + B->A[9][0] = RCONST(-1.281405999441488363643770753697026520967); + B->A[9][3] = RCONST(-45.04713996013986587740873801521956920624); + B->A[9][4] = RCONST(-4.731362069449575713520061981398612260818); + B->A[9][5] = RCONST(4.514967016593807613844546722248196601868); + B->A[9][6] = RCONST(47.4490955717298490412758837919682264328); + B->A[9][7] = RCONST(0.01059228297111661047658071055366235668771); + B->A[9][8] = RCONST(-0.005746842263844615696088968803678653785028); + B->A[10][0] = RCONST(-1.724470134262485077059068316884804517031); + B->A[10][3] = RCONST(-60.92349008483054007001555874012410640717); + B->A[10][4] = RCONST(-5.951518376222391992769189528189599514008); + B->A[10][5] = RCONST(5.55652373069845673114741657627746462822); + B->A[10][6] = RCONST(63.98301198033306036450085230171680450439); + B->A[10][7] = RCONST(0.01464202825041496271174512600055095390417); + B->A[10][8] = RCONST(0.06460408772358203211005900357122300192714); + B->A[10][9] = RCONST(-0.07930323169008879347074980614706873893738); + B->A[11][0] = RCONST(-3.30162266774707902072805154602974653244); + B->A[11][3] = RCONST(-118.0112723597525103969019255600869655609); + B->A[11][4] = RCONST(-10.14142238845611210251718148356303572655); + B->A[11][5] = RCONST(9.139311332232058049385159392841160297394); + B->A[11][6] = RCONST(123.3759428284042769519146531820297241211); + B->A[11][7] = RCONST(4.623244378874581173022306757047772407532); + B->A[11][8] = RCONST(-3.383277738068201756505004595965147018433); + B->A[11][9] = RCONST(4.527592100324618229478801367804408073425); + B->A[11][10] = RCONST(-5.828495485811623133542980212951079010963); + B->A[12][0] = RCONST(-3.039515033766308604867845133412629365921); + B->A[12][3] = RCONST(-109.260868089417627402326615992933511734); + B->A[12][4] = RCONST(-9.290642497400291688336437800899147987366); + B->A[12][5] = RCONST(8.43050498176491203139448771253228187561); + B->A[12][6] = RCONST(114.2010010378331372749016736634075641632); + B->A[12][7] = RCONST(-0.9637271342145479202656588313402608036995); + B->A[12][8] = RCONST(-5.034884088802189516798080148873850703239); + B->A[12][9] = RCONST(5.958130824002923375815043982584029436111); + + B->b[0] = RCONST(0.04427989419007950788742533632103004492819); + B->b[5] = RCONST(0.3541049391724448991425333588267676532269); + B->b[6] = RCONST(0.2479692154956437688539949704136233776808); + B->b[7] = RCONST(-15.69420203883808540012978482991456985474); + B->b[8] = RCONST(25.08406496555856435293208051007241010666); + B->b[9] = RCONST(-31.73836778626027665950459777377545833588); + B->b[10] = RCONST(22.93828327398878386134128959383815526962); + B->b[11] = RCONST(-0.2361324633071542056228508954518474638462); + + B->d[0] = RCONST(0.04431261522908979538781792939516890328377); + B->d[5] = RCONST(0.3546095642343226606030270886549260467291); + B->d[6] = RCONST(0.2478480431366653080615947146725375205278); + B->d[7] = RCONST(4.448134732475784502980786783155053853989); + B->d[8] = RCONST(19.8468863661187349123338208300992846489); + B->d[9] = RCONST(-23.58162337746561831863800762221217155457); + B->d[12] = RCONST(-0.3601679437289775354003040774841792881489); + + B->c[1] = RCONST(0.05); + B->c[2] = RCONST(0.1065625); + B->c[3] = RCONST(0.15984375); + B->c[4] = RCONST(0.39); + B->c[5] = RCONST(0.465); + B->c[6] = RCONST(0.155); + B->c[7] = RCONST(0.943); + B->c[8] = RCONST(0.9018020417358569851273841777583584189415); + B->c[9] = RCONST(0.909); + B->c[10] = RCONST(0.94); + B->c[11] = RCONST(1.0); + B->c[12] = RCONST(1.0); + return B; + }) + +ARK_BUTCHER_TABLE(ARKODE_VERNER_16_8_9, { /* Verner-9-8 (DOI: 10.1007/s11075-009-9290-3) */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(16, SUNTRUE); + B->q = 9; + B->p = 8; + + B->A[1][0] = RCONST(0.3462e-1); + B->A[2][0] = RCONST(-0.389335438857287327017042687229284478532e-1); + B->A[2][1] = RCONST(0.1359578945245091786499878854939346230295); + B->A[3][0] = RCONST(0.3638413148954266723060635628912731569111e-1); + B->A[3][2] = RCONST(0.1091523944686280016918190688673819470733); + B->A[4][0] = RCONST(2.025763914393969636805657604282571047511); + B->A[4][2] = RCONST(-7.638023836496292020387602153091964592952); + B->A[4][3] = RCONST(6.173259922102322383581944548809393545442); + B->A[5][0] = RCONST(0.5112275589406060872792270881648288397197e-1); + B->A[5][3] = RCONST(0.1770823794555021537929910813839068684087); + B->A[5][4] = RCONST(0.80277624092225014536138698108025283759e-3); + B->A[6][0] = RCONST(0.1316006357975216279279871693164256985334); + B->A[6][3] = RCONST(-0.2957276252669636417685183174672273730699); + B->A[6][4] = RCONST(0.878137803564295237421124704053886667082e-1); + B->A[6][5] = RCONST(0.6213052975225274774321435005639430026100); + B->A[7][0] = RCONST(0.7166666666666666666666666666666666666667e-1); + B->A[7][5] = RCONST(0.3305533578915319409260346730051472207728); + B->A[7][6] = RCONST(0.2427799754418013924072986603281861125606); + B->A[8][0] = RCONST(0.7180664062500000000000000000000000000000e-1); + B->A[8][5] = RCONST(0.3294380283228177160744825466257672816401); + B->A[8][6] = RCONST(0.1165190029271822839255174533742327183599); + B->A[8][7] = RCONST(-0.3401367187500000000000000000000000000000e-1); + B->A[9][0] = RCONST(0.4836757646340646986611287718844085773549e-1); + B->A[9][5] = RCONST(0.3928989925676163974333190042057047002852e-1); + B->A[9][6] = RCONST(0.1054740945890344608263649267140088017604); + B->A[9][7] = RCONST(-0.2143865284648312665982642293830533996214e-1); + B->A[9][8] = RCONST(-0.1041229174627194437759832813847147895623); + B->A[10][0] = RCONST(-0.2664561487201478635337289243849737340534e-1); + B->A[10][5] = RCONST(0.3333333333333333333333333333333333333333e-1); + B->A[10][6] = RCONST(-0.1631072244872467239162704487554706387141); + B->A[10][7] = RCONST(0.3396081684127761199487954930015522928244e-1); + B->A[10][8] = RCONST(0.1572319413814626097110769806810024118077); + B->A[10][9] = RCONST(0.2152267478031879552303534778794770376960); + B->A[11][0] = RCONST(0.3689009248708622334786359863227633989718e-1); + B->A[11][5] = RCONST(-0.1465181576725542928653609891758501156785); + B->A[11][6] = RCONST(0.2242577768172024345345469822625833796001); + B->A[11][7] = RCONST(0.2294405717066072637090897902753790803034e-1); + B->A[11][8] = RCONST(-0.35850052905728761357394424889330334334e-2); + B->A[11][9] = RCONST(0.8669223316444385506869203619044453906053e-1); + B->A[11][10] = RCONST(0.4383840651968337846196219974168630120572); + B->A[12][0] = RCONST(-0.4866012215113340846662212357570395295088); + B->A[12][5] = RCONST(-6.304602650282852990657772792012007122988); + B->A[12][6] = RCONST(-0.281245618289472564778284183790118418111); + B->A[12][7] = RCONST(-2.679019236219849057687906597489223155566); + B->A[12][8] = RCONST(0.518815663924157511565311164615012522024); + B->A[12][9] = RCONST(1.365353187603341710683633635235238678626); + B->A[12][10] = RCONST(5.885091088503946585721274891680604830712); + B->A[12][11] = RCONST(2.802808786272062889819965117517532194812); + B->A[13][0] = RCONST(0.4185367457753471441471025246471931649633); + B->A[13][5] = RCONST(6.724547581906459363100870806514855026676); + B->A[13][6] = RCONST(-0.425444280164611790606983409697113064616); + B->A[13][7] = RCONST(3.343279153001265577811816947557982637749); + B->A[13][8] = RCONST(0.617081663117537759528421117507709784737); + B->A[13][9] = RCONST(-0.929966123939932833937749523988800852013); + B->A[13][10] = RCONST(-6.099948804751010722472962837945508844846); + B->A[13][11] = RCONST(-3.002206187889399044804158084895173690015); + B->A[13][12] = RCONST(0.2553202529443445472336424602988558373637); + B->A[14][0] = RCONST(-0.779374086122884664644623040843840506343); + B->A[14][5] = RCONST(-13.93734253810777678786523664804936051203); + B->A[14][6] = RCONST(1.252048853379357320949735183924200895136); + B->A[14][7] = RCONST(-14.69150040801686878191527989293072091588); + B->A[14][8] = RCONST(-0.494705058533141685655191992136962873577); + B->A[14][9] = RCONST(2.242974909146236657906984549543692874755); + B->A[14][10] = RCONST(13.36789380382864375813864978592679139881); + B->A[14][11] = RCONST(14.39665048665068644512236935340272139005); + B->A[14][12] = RCONST(-0.7975813331776800379127866056663258667437); + B->A[14][13] = RCONST(0.4409353709534277758753793068298041158235); + B->A[15][0] = RCONST(2.058051337466886442151242368989994043993); + B->A[15][5] = RCONST(22.35793772796803295519317565842520212899); + B->A[15][6] = RCONST(0.90949810997556332745009198137971890783); + B->A[15][7] = RCONST(35.89110098240264104710550686568482456493); + B->A[15][8] = RCONST(-3.442515027624453437985000403608480262211); + B->A[15][9] = RCONST(-4.865481358036368826566013387928704014496); + B->A[15][10] = RCONST(-18.90980381354342625688427480879773032857); + B->A[15][11] = RCONST(-34.26354448030451782929251177395134170515); + B->A[15][12] = RCONST(1.264756521695642578827783499806516664686); + + B->b[0] = RCONST(0.1461197685842315252051541915018784713459e-1); + B->b[7] = RCONST(-0.3915211862331339089410228267288242030810); + B->b[8] = RCONST(0.2310932500289506415909675644868993669908); + B->b[9] = RCONST(0.1274766769992852382560589467488989175618); + B->b[10] = RCONST(0.2246434176204157731566981937082069688984); + B->b[11] = RCONST(0.5684352689748512932705226972873692126743); + B->b[12] = RCONST(0.5825871557215827200814768021863420902155e-1); + B->b[13] = RCONST(0.1364317403482215641609022744494239843327); + B->b[14] = RCONST(0.3057013983082797397721005067920369646664e-1); + + B->d[0] = RCONST(0.1996996514886773085518508418098868756464e-1); + B->d[7] = RCONST(2.191499304949330054530747099310837524864); + B->d[8] = RCONST(0.8857071848208438030833722031786358862953e-1); + B->d[9] = RCONST(0.1140560234865965622484956605091432032674); + B->d[10] = RCONST(0.2533163805345107065564577734569651977347); + B->d[11] = RCONST(-2.056564386240941011158999594595981300493); + B->d[12] = RCONST(0.3408096799013119935160094894224543812830); + B->d[15] = RCONST(0.4834231373823958314376726739772871714902e-1); + + B->c[1] = RCONST(0.3462e-1); + B->c[2] = RCONST(0.9702435063878044594828361677100617517633e-1); + B->c[3] = RCONST(0.1455365259581706689224254251565092627645); + B->c[4] = RCONST(0.561); + B->c[5] = RCONST(0.2290079115904850126662751771814700052182); + B->c[6] = RCONST(0.5449920884095149873337248228185299947818); + B->c[7] = RCONST(0.645); + B->c[8] = RCONST(0.48375); + B->c[9] = RCONST(0.6757e-1); + B->c[10] = RCONST(0.25); + B->c[11] = RCONST(0.6590650618730998549405331618649220295334); + B->c[12] = RCONST(0.8206); + B->c[13] = RCONST(0.9012); + B->c[14] = RCONST(1.0); + B->c[15] = RCONST(1.0); + return B; + }) + ARK_BUTCHER_TABLE(ARKODE_FEHLBERG_13_7_8, { /* Fehlberg-8-7 */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(13, SUNTRUE); B->q = 8; diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index f21aa2602b..ebc413e576 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -957,14 +957,19 @@ int erkStep_SetButcherTable(ARKodeMem ark_mem) etable = ERKSTEP_DEFAULT_6; break; case(7): + etable = ERKSTEP_DEFAULT_7; + break; case(8): etable = ERKSTEP_DEFAULT_8; break; + case(9): + etable = ERKSTEP_DEFAULT_9; + break; default: /* no available method, set default */ arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ERKStep", "erkStep_SetButcherTable", - "No explicit method at requested order, using q=6."); - etable = ERKSTEP_DEFAULT_6; + "No explicit method at requested order, using q=9."); + etable = ERKSTEP_DEFAULT_9; break; } diff --git a/test/answers b/test/answers index 8f1d469a42..37f4e6b5b6 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 8f1d469a426ffb562361ab2aa1702ad15194cb2c +Subproject commit 37f4e6b5b68e407ea302facba92883126dd39bf7 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp index 8ad033603d..3bf3f3e4c1 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp @@ -34,7 +34,9 @@ int main() { "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_ARK437L2SA_ERK_7_3_4", - "ARKODE_ARK548L2SAb_ERK_8_4_5"}; + "ARKODE_ARK548L2SAb_ERK_8_4_5", "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"}; std::vector Tables_DIRK = {"ARKODE_SDIRK_2_1_2", "ARKODE_ARK2_DIRK_3_1_2", "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", diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out index 8d7971338b..b7c11bcecf 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out @@ -22,6 +22,30 @@ ARKodeButcherTable_CheckOrder: embedding order = 6 Testing method ARKODE_ARK437L2SA_ERK_7_3_4: table matches predicted method/embedding orders of 4/3 Testing method ARKODE_ARK548L2SAb_ERK_8_4_5: table matches predicted method/embedding orders of 5/4 +Testing method ARKODE_SOFRONIOU_SPALETTA_5_3_4: table matches predicted method/embedding orders of 4/3 +Testing method ARKODE_SHU_OSHER_3_2_3: table matches predicted method/embedding orders of 3/2 +Testing method ARKODE_VERNER_9_5_6: table matches predicted method/embedding orders of 6/5 +Testing method ARKODE_VERNER_10_6_7: WARNING: +ARKodeButcherTable_CheckOrder: + method order >= 6; reverting to simplifying assumptions + method order = 6 + + embedding order >= 6; reverting to simplifying assumptions + embedding order = 6 +Testing method ARKODE_VERNER_13_7_8: WARNING: +ARKodeButcherTable_CheckOrder: + method order >= 6; reverting to simplifying assumptions + method order = 6 + + embedding order >= 6; reverting to simplifying assumptions + embedding order = 6 +Testing method ARKODE_VERNER_16_8_9: WARNING: +ARKodeButcherTable_CheckOrder: + method order >= 6; reverting to simplifying assumptions + method order = 6 + + embedding order >= 6; reverting to simplifying assumptions + embedding order = 6 Testing individual DIRK methods: From b5488556df92d4832690ca1df443d80eb1f2d21b Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 30 Oct 2023 16:59:58 -0700 Subject: [PATCH 17/85] remove implementation of SUNLinsSol and SUNNonlinSol printinfo functions --- src/sunlinsol/pcg/sunlinsol_pcg.c | 30 ------------------ src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 30 ------------------ src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 31 ------------------- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 30 ------------------ src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 30 ------------------ .../fixedpoint/sunnonlinsol_fixedpoint.c | 28 ----------------- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 28 ----------------- 7 files changed, 207 deletions(-) diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index eb21a71da2..46d0a24842 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -577,33 +577,3 @@ int SUNLinSolFree_PCG(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_PCG(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - PCG_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_PCG(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - PCG_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index f2e6360251..efdc437f70 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -779,33 +779,3 @@ int SUNLinSolFree_SPBCGS(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPBCGS(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPBCGS_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPBCGS(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPBCGS_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index 23ce66f615..ef5e759eee 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -818,34 +818,3 @@ int SUNLinSolFree_SPFGMR(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPFGMR(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPFGMR_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPFGMR(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPFGMR_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} - diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 3aa0934c13..4922c71740 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -867,33 +867,3 @@ int SUNLinSolFree_SPGMR(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPGMR(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPGMR_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPGMR(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPGMR_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 47c6544819..4a5c5e6c8d 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -906,33 +906,3 @@ int SUNLinSolFree_SPTFQMR(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPTFQMR(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPTFQMR_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPTFQMR(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPTFQMR_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c index 5204d53be7..64249652b3 100644 --- a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +++ b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c @@ -739,31 +739,3 @@ static void FreeContent(SUNNonlinearSolver NLS) return; } - -int SUNNonlinSolSetInfoFile_FixedPoint(SUNNonlinearSolver NLS, - FILE* info_file) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - FP_CONTENT(NLS)->info_file = info_file; - - return(SUN_NLS_SUCCESS); -} - -int SUNNonlinSolSetPrintLevel_FixedPoint(SUNNonlinearSolver NLS, - int print_level) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUN_NLS_ILL_INPUT); - - FP_CONTENT(NLS)->print_level = print_level; - - return(SUN_NLS_SUCCESS); -} diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index 6422b24963..75781e6018 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -499,31 +499,3 @@ int SUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver NLS, SUNNonlinSolSysFn *SysFn *SysFn = NEWTON_CONTENT(NLS)->Sys; return(SUN_NLS_SUCCESS); } - -int SUNNonlinSolSetInfoFile_Newton(SUNNonlinearSolver NLS, - FILE* info_file) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - NEWTON_CONTENT(NLS)->info_file = info_file; - - return(SUN_NLS_SUCCESS); -} - -int SUNNonlinSolSetPrintLevel_Newton(SUNNonlinearSolver NLS, - int print_level) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUN_NLS_ILL_INPUT); - - NEWTON_CONTENT(NLS)->print_level = print_level; - - return(SUN_NLS_SUCCESS); -} From e252417190b61103151d1fa532fe84d35ba53782 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 30 Oct 2023 17:00:20 -0700 Subject: [PATCH 18/85] replace use of SetDiagnostics in some arkode examples --- .../ark_brusselator1D_task_local_nls.cpp | 53 +++++---------- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 67 +++---------------- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 44 +++--------- examples/arkode/CXX_serial/ark_heat2D.cpp | 38 ++--------- .../ark_brusselator1D_task_local_nls.c | 56 +++++----------- .../arkode/C_parallel/ark_diurnal_kry_p.c | 6 +- 6 files changed, 65 insertions(+), 199 deletions(-) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp index a6d081357c..69db66ca35 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -142,6 +142,20 @@ int main(int argc, char *argv[]) retval = SetupProblem(argc, argv, &udata, &uopt, ctx); if (check_retval(&retval, "SetupProblem", 1)) MPI_Abort(comm, 1); + /* Setup diagnostic logging if it is enabled */ + if (uopt.monitor) + { + SUNLogger logger; + + sprintf(fname, "%s/diagnostics.%06d.txt", uopt.outputdir, udata.myid); + + retval = SUNContext_GetLogger(ctx, &logger); + if (check_retval(&retval, "SUNContext_GetLogger", 1)) return 1; + + retval = SUNLogger_SetInfoFilename(logger, fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; + } + /* Create solution vector */ y = N_VMake_MPIPlusX(udata.comm, LocalNvector(udata.NEQ, ctx), ctx); if (check_retval((void *) y, "N_VMake_MPIPlusX", 0)) MPI_Abort(comm, 1); @@ -218,7 +232,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Create the ARK timestepper module */ @@ -241,16 +254,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1)) return 1; - } - /* Create the (non)linear solver */ if (uopt->global) { @@ -278,7 +281,7 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, { /* The custom task-local nonlinear solver handles the linear solve as well, so we do not need a SUNLinearSolver. */ - NLS = TaskLocalNewton(ctx, y, DFID); + NLS = TaskLocalNewton(ctx, y); if (check_retval((void *)NLS, "TaskLocalNewton", 0)) return 1; /* Attach nonlinear solver */ @@ -318,9 +321,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1); @@ -380,7 +380,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - FILE* DFID; /* diagnostics output file */ char fname[MXSTR]; /* Create the ERK timestepper module */ @@ -403,16 +402,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ERKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ERKStepSetDiagnostics", 1)) return 1; - } - /* Output initial condition */ if (udata->myid == 0 && uopt->monitor) { @@ -445,9 +434,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ERKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ERKStepGetNumSteps", 1); @@ -1083,7 +1069,7 @@ int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, } -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { void* tmp_comm; SUNNonlinearSolver NLS; @@ -1135,13 +1121,6 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) content->ncnf = 0; - /* Setup the local nonlinear solver monitoring */ - if (DFID != NULL) - { - SUNNonlinSolSetInfoFile_Newton(LOCAL_NLS(NLS), DFID); - SUNNonlinSolSetPrintLevel_Newton(LOCAL_NLS(NLS), 1); - } - return NLS; } diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 15fac77098..f64b849eaa 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -291,7 +291,6 @@ struct UserData int maxsteps = 0; // max steps between outputs (0 = use default) bool linear = true; // enable/disable linearly implicit option bool diagnostics = false; // output diagnostics - FILE *diagfp = NULL; // diagnostics output file // ----------------------------------------- // Nonlinear solver settings @@ -507,6 +506,17 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "PrintUserData", 1)) return 1; } + if (udata.diagnostics || udata.lsinfo) + { + SUNLogger logger; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) return 1; + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + } + // -------------- // Create vectors // -------------- @@ -519,13 +529,6 @@ int main(int argc, char* argv[]) // Create linear solver // -------------------- - // Open diagnostics file - if (outproc && (udata.diagnostics || udata.lsinfo)) - { - udata.diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) (udata.diagfp), "fopen", 0)) return 1; - } - // Preconditioning type int prectype = (udata.prec) ? SUN_PREC_RIGHT : SUN_PREC_NONE; @@ -536,29 +539,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, udata.diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, udata.diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -708,8 +693,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (outproc && (udata.diagnostics || udata.lsinfo)) fclose(udata.diagfp); - switch(udata.integrator) { case(0): @@ -1029,13 +1012,6 @@ static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, flag = ARKStepSetStopTime(*arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = ARKStepSetDiagnostics(*arkode_mem, udata->diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - return 0; } @@ -1084,13 +1060,6 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, flag = ARKStepSetMaxNumSteps(inner_arkode_mem, udata->maxsteps); if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = ARKStepSetDiagnostics(inner_arkode_mem, udata->diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // Wrap ARKODE as an MRIStepInnerStepper flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, stepper); @@ -1159,13 +1128,6 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, flag = MRIStepSetStopTime(*arkode_mem, udata->tf); if (check_flag(&flag, "MRIStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = MRIStepSetDiagnostics(*arkode_mem, udata->diagfp); - if (check_flag(&flag, "MRIStepSetDiagnostics", 1)) return 1; - } - return 0; } @@ -1319,13 +1281,6 @@ static int SetupMRICVODE(SUNContext ctx, UserData *udata, N_Vector y, flag = MRIStepSetStopTime(*arkode_mem, udata->tf); if (check_flag(&flag, "MRIStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = MRIStepSetDiagnostics(*arkode_mem, udata->diagfp); - if (check_flag(&flag, "MRIStepSetDiagnostics", 1)) return 1; - } - return 0; } diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 32623f530c..d0029a06a5 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -278,7 +278,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables double t1 = 0.0; @@ -326,13 +325,17 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; + } - // Open diagnostics output file - if (udata->diagnostics || udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } + if (udata->diagnostics || udata->lsinfo) + { + SUNLogger logger = NULL; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) return 1; + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; } // ------------------------ @@ -362,29 +365,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -483,13 +468,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && outproc) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -572,8 +550,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && outproc) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index 3a78042a25..e21a015142 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -207,7 +207,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables chrono::time_point t1; @@ -236,11 +235,15 @@ int main(int argc, char* argv[]) flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - // Open diagnostics output file if (udata->diagnostics || udata->lsinfo) { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; + SUNLogger logger = NULL; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) return 1; + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; } // ---------------------- @@ -270,29 +273,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -391,13 +376,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -477,8 +455,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->diagnostics || udata->lsinfo) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c index bd7b19fccf..e035acb675 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -70,6 +70,7 @@ #include "arkode/arkode_erkstep.h" /* ERKStep */ #include "nvector/nvector_mpiplusx.h" /* MPI+X N_Vector */ #include "nvector/nvector_serial.h" /* serial N_Vector */ +#include "sundials/sundials_logger.h" #include "sunmatrix/sunmatrix_dense.h" /* dense SUNMatrix */ #include "sunlinsol/sunlinsol_dense.h" /* dense SUNLinearSolver */ #include "sunlinsol/sunlinsol_spgmr.h" /* GMRES SUNLinearSolver */ @@ -183,7 +184,7 @@ typedef struct #define LOCAL_NLS(NLS) ( GET_NLS_CONTENT(NLS)->local_nls ) /* SUNNonlinearSolver constructor */ -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID); +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); /* @@ -280,6 +281,20 @@ int main(int argc, char *argv[]) retval = SetupProblem(argc, argv, udata, uopt, ctx); if (check_retval(&retval, "SetupProblem", 1)) MPI_Abort(comm, 1); + /* Setup diagnostic logging if it is enabled */ + if (uopt->monitor) + { + SUNLogger logger; + + sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); + + retval = SUNContext_GetLogger(ctx, &logger); + if (check_retval(&retval, "SUNContext_GetLogger", 1)) return 1; + + retval = SUNLogger_SetInfoFilename(logger, fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; + } + /* Create solution vector */ y = N_VMake_MPIPlusX(udata->comm, N_VNew_Serial(udata->NEQ, ctx), ctx); if (check_retval((void *) y, "N_VMake_MPIPlusX", 0)) MPI_Abort(comm, 1); @@ -351,7 +366,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npre, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Create the ARK timestepper module */ @@ -374,16 +388,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1)) return 1; - } - /* Create the (non)linear solver */ if (uopt->global) { @@ -411,7 +415,7 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, { /* The custom task-local nonlinear solver handles the linear solve as well, so we do not need a SUNLinearSolver */ - NLS = TaskLocalNewton(ctx, y, DFID); + NLS = TaskLocalNewton(ctx, y); if (check_retval((void *)NLS, "TaskLocalNewton", 0)) return 1; /* Attach nonlinear solver */ @@ -451,9 +455,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1); @@ -516,7 +517,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - FILE* DFID; /* diagnostics output file */ char fname[MXSTR]; /* Create the ERK timestepper module */ @@ -539,16 +539,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ERKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ERKStepSetDiagnostics", 1)) return 1; - } - /* Output initial condition */ if (udata->myid == 0 && uopt->monitor) { @@ -581,9 +571,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ERKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ERKStepGetNumSteps", 1); @@ -1173,7 +1160,7 @@ int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, } -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { void* tmp_comm; SUNNonlinearSolver NLS; @@ -1225,13 +1212,6 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) content->ncnf = 0; - /* Setup the local nonlinear solver monitoring */ - if (DFID != NULL) - { - SUNNonlinSolSetInfoFile_Newton(LOCAL_NLS(NLS), DFID); - SUNNonlinSolSetPrintLevel_Newton(LOCAL_NLS(NLS), 1); - } - return NLS; } diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index 1946966c76..8fe41d8e7f 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -834,7 +834,7 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, /* jok = SUNTRUE: Copy Jbd to P */ for (ly = 0; ly < MYSUB; ly++) for (lx = 0; lx < MXSUB; lx++) - denseCopy(Jbd[lx][ly], P[lx][ly], NVARS, NVARS); + SUNDlsMat_denseCopy(Jbd[lx][ly], P[lx][ly], NVARS, NVARS); *jcurPtr = SUNFALSE; @@ -869,7 +869,7 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, IJth(j,1,2) = -Q2*c1 + q4coef; IJth(j,2,1) = Q1*C3 - Q2*c2; IJth(j,2,2) = (-Q2*c1 - q4coef) + diag; - denseCopy(j, a, NVARS, NVARS); + SUNDlsMat_denseCopy(j, a, NVARS, NVARS); } } @@ -880,7 +880,7 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, /* Scale by -gamma */ for (ly = 0; ly < MYSUB; ly++) for (lx = 0; lx < MXSUB; lx++) - denseScale(-gamma, P[lx][ly], NVARS, NVARS); + SUNDlsMat_denseScale(-gamma, P[lx][ly], NVARS, NVARS); /* Add identity matrix and do LU decompositions on blocks in place */ for (lx = 0; lx < MXSUB; lx++) { From 9939d98352f11b32545981f33213ac372f6342ab Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 30 Oct 2023 17:08:48 -0700 Subject: [PATCH 19/85] make INFO level the default for logging --- cmake/SundialsBuildOptionsPre.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index b9959f745d..227c734045 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -76,12 +76,12 @@ sundials_option(SUNDIALS_BUILD_WITH_PROFILING BOOL "${DOCSTR}" OFF) # --------------------------------------------------------------- set(DOCSTR "Build with logging capabilities enabled (0 = no logging, 1 = errors, 2 = +warnings, 3 = +info, 4 = +debug, 5 = +extras") -sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 0 +sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 3 OPTIONS "0;1;2;3;4;5") -if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 1) +if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 4) message(STATUS "SUNDIALS logging level set to ${SUNDIALS_LOGGING_LEVEL}") - message(WARNING "SUNDIALS built with logging turned on, performance may be affected.") + message(WARNING "SUNDIALS built with debug logging turned on, performance may be affected.") endif() set(DOCSTR "Build SUNDIALS logging with MPI support") From 28e931e612d1222f990964bb8d7ad702e4450122 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Wed, 1 Nov 2023 21:14:19 -0700 Subject: [PATCH 20/85] change arkode INFO logging to DEBUG --- src/arkode/arkode.c | 8 ++++---- src/arkode/arkode_adapt.c | 16 ++++++++-------- src/arkode/arkode_arkstep.c | 8 ++++---- src/arkode/arkode_erkstep.c | 12 ++++++------ src/arkode/arkode_interp.c | 8 ++++---- src/arkode/arkode_ls.c | 8 ++++---- src/arkode/arkode_mristep.c | 14 +++++++------- src/arkode/arkode_relaxation.c | 8 ++++---- src/sundials/sundials_logger.c | 10 +++++----- 9 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 601abca7ae..2174eab0f6 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -840,8 +840,8 @@ int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, attempts++; ark_mem->nst_attempts++; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkEvolve", "start-step", "step = %li, attempt = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, attempts, ark_mem->h, ark_mem->tcur); @@ -2423,8 +2423,8 @@ int arkCompleteStep(ARKodeMem ark_mem, realtype dsm) ark_mem->tcur = ark_mem->tstop; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkCompleteStep", "end-step", "step = %li, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, ark_mem->h, ark_mem->tcur); diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 617681e9f5..1082a565ae 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -183,18 +183,18 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1], hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1], h_acc, h_cfl); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "error-history", "ecur = %"RSYM", ehist[0] = %"RSYM", ehist[0] = %"RSYM, ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1]); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "step-history", "hcur = %"RSYM", hhist[0] = %"RSYM", hhist[0] = %"RSYM, hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1]); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-before-bounds", "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif @@ -213,8 +213,8 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, if (ark_mem->report) fprintf(ark_mem->diagfp, "%"RSYM" %"RSYM" ", h_acc, h_cfl); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-after-max-min-bounds", "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif @@ -248,8 +248,8 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, if (ark_mem->report) fprintf(ark_mem->diagfp, "%"RSYM"\n", ark_mem->eta); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkAdapt", +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-eta", "eta = %"RSYM, ark_mem->eta); #endif diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 3bd782f41f..493983a410 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1638,8 +1638,8 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) else ark_mem->tcur = ark_mem->tn + step_mem->Be->c[is]*ark_mem->h; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "start-stage", "step = %li, stage = %i, implicit = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, is, implicit_stage, ark_mem->h, ark_mem->tcur); @@ -1857,8 +1857,8 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "ARKStep etest %li %"RSYM" %"RSYM"\n", ark_mem->nst, ark_mem->h, *dsmPtr); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "error-test", "step = %li, h = %"RSYM", dsm = %"RSYM, ark_mem->nst, ark_mem->h, *dsmPtr); diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index ebc413e576..2b78f28d6c 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -759,8 +759,8 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) cvals = step_mem->cvals; Xvecs = step_mem->Xvecs; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "start-stage", "step = %li, stage = 0, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, ark_mem->h, ark_mem->tcur); @@ -789,8 +789,8 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "ERKStep step %li %"RSYM" %i %"RSYM"\n", ark_mem->nst, ark_mem->h, is, ark_mem->tcur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "start-stage", "step = %li, stage = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, is, ark_mem->h, ark_mem->tcur); @@ -851,8 +851,8 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "ERKStep etest %li %"RSYM" %"RSYM"\n", ark_mem->nst, ark_mem->h, *dsmPtr); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "error-test", "step = %li, h = %"RSYM", dsm = %"RSYM, ark_mem->nst, ark_mem->h, *dsmPtr); diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index 30ee7aece8..e434175df1 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -504,8 +504,8 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, q = SUNMAX(order, 0); /* respect lower bound */ q = SUNMIN(q, HINT_DEGREE(interp)); /* respect max possible */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkInterpEvaluate_Hermite", "interp-eval", "tau = %"RSYM", d = %i, q = %i", tau, d, q); #endif @@ -1182,8 +1182,8 @@ int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp I, q = SUNMAX(degree, 0); /* respect lower bound */ q = SUNMIN(q, nhist-1); /* respect max possible */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkInterpEvaluate_Lagrange", "interp-eval", "tau = %"RSYM", d = %i, q = %i", tau, deriv, q); #endif diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 71c05682a6..2645a83116 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -2735,8 +2735,8 @@ int arkLsSolve(void* arkode_mem, N_Vector b, realtype tnow, fprintf(ark_mem->diagfp, "ARKLS kry %"RSYM" %"RSYM" %i %i\n", bnorm, resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkLsSolve", +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsSolve", "ls-stats", "bnorm = %"RSYM", resnorm = %"RSYM ", ls_iters = %i, prec_solves = %i", bnorm, resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); @@ -3154,8 +3154,8 @@ int arkLsMassSolve(void *arkode_mem, N_Vector b, realtype nlscoef) fprintf(ark_mem->diagfp, "ARKLS mass %"RSYM" %i %i\n", resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsMassSolve", "mass-ls-stats", "resnorm = %"RSYM", ls_iters = %i, prec_solves = %i", resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 11e74e86a5..610fa2701f 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1507,8 +1507,8 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "MRIStep step %li %"RSYM" %i %"RSYM"\n", ark_mem->nst, ark_mem->h, is, ark_mem->tcur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "start-stage", "step = %li, stage = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, is, ark_mem->h, ark_mem->tcur); @@ -1617,8 +1617,8 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "MRIStep etest %li %"RSYM" %"RSYM"\n", ark_mem->nst, ark_mem->h, *dsmPtr); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "error-test", "step = %li, h = %"RSYM", dsm = %"RSYM, ark_mem->nst, ark_mem->h, *dsmPtr); @@ -2744,7 +2744,7 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, if (stepper->ops == NULL) return ARK_ILL_INPUT; if (stepper->ops->evolve == NULL) return ARK_ILL_INPUT; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, "ARKODE::mriStepInnerStepper_Evolve", "start-inner-evolve", "t0 = %"RSYM", tout = %"RSYM, t0, tout); @@ -2752,7 +2752,7 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, stepper->last_flag = stepper->ops->evolve(stepper, t0, tout, y); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, "ARKODE::mriStepInnerStepper_Evolve", "end-inner-evolve", "flag = %i", stepper->last_flag); @@ -2785,7 +2785,7 @@ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, if (stepper == NULL) return ARK_ILL_INPUT; if (stepper->ops == NULL) return ARK_ILL_INPUT; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, "ARKODE::mriStepInnerStepper_Reset", "reset-inner-state", "tR = %"RSYM, tR); diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index cc9fb5d0b8..5e4eca24a4 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -817,8 +817,8 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, realtype* dsm_inout, /* Cut step size and try again */ ark_mem->eta = relax_mem->eta_fail; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "relaxation", "relaxation failed"); #endif @@ -834,8 +834,8 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, realtype* dsm_inout, N_VLinearSum(relax_val, ark_mem->ycur, (ONE - relax_val), ark_mem->yn, ark_mem->ycur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "relaxation", "relaxation parameter = %"RSYM", relaxed h = %"RSYM ", relaxed error = %"RSYM, diff --git a/src/sundials/sundials_logger.c b/src/sundials/sundials_logger.c index b0ae437223..872d1e4730 100644 --- a/src/sundials/sundials_logger.c +++ b/src/sundials/sundials_logger.c @@ -143,7 +143,7 @@ static sunbooleantype sunLoggerIsOutputRank(SUNLogger logger, int* rank_ref) #else if (rank_ref) { - *rank_ref = -1; + *rank_ref = 0; } retval = SUNTRUE; #endif @@ -260,7 +260,7 @@ int SUNLogger_SetErrorFilename(SUNLogger logger, const char* error_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for ERROR, but a ERROR file was provided. " "Set the logging level to >= %d and recompile if ERROR output level " - "is desired.\n", SUN_LOGLEVEL_ERROR, SUNDIALS_LOGGING_LEVEL); + "is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_ERROR); #endif } @@ -306,7 +306,7 @@ int SUNLogger_SetWarningFilename(SUNLogger logger, const char* warning_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for WARNING, but a WARNING file was provided. " "Set the logging level to >= %d and recompile if WARNING output " - "level is desired.\n", SUN_LOGLEVEL_WARNING, SUNDIALS_LOGGING_LEVEL); + "level is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_WARNING); #endif } @@ -352,7 +352,7 @@ int SUNLogger_SetInfoFilename(SUNLogger logger, const char* info_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for INFO, but a INFO file was provided. Set the " "logging level to >= %d and recompile if INFO output level is " - "desired.\n", SUN_LOGLEVEL_INFO, SUNDIALS_LOGGING_LEVEL); + "desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_INFO); #endif } @@ -398,7 +398,7 @@ int SUNLogger_SetDebugFilename(SUNLogger logger, const char* debug_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for DEBUG output, but a DEBUG file was provided. " "Set the logging level to >= %d and recompile if DEBUG output level " - "is desired.\n", SUN_LOGLEVEL_DEBUG, SUNDIALS_LOGGING_LEVEL); + "is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_DEBUG); #endif } From 37b4948c9cbc9c6ca9f4f15dfc453a85e983d072 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Wed, 1 Nov 2023 21:15:37 -0700 Subject: [PATCH 21/85] add debugging filename --- examples/arkode/CXX_serial/ark_heat2D.cpp | 3 +++ examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index e21a015142..1438406316 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -244,6 +244,9 @@ int main(int argc, char* argv[]) flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; } // ---------------------- diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c index e035acb675..3110dc980f 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -293,6 +293,9 @@ int main(int argc, char *argv[]) retval = SUNLogger_SetInfoFilename(logger, fname); if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; + + retval = SUNLogger_SetDebugFilename(logger, fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; } /* Create solution vector */ From ba66c1e78ea75f74dc5f6d4a82f8ff652a18172c Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 3 Nov 2023 11:30:33 -0600 Subject: [PATCH 22/85] clean up use of removed functions --- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 3 ++ examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 3 ++ .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 17 ------ .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 49 ----------------- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 54 ------------------- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 54 ------------------- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 49 ----------------- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 34 ------------ .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 35 ------------ .../CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 6 --- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp | 1 - .../kin_heat2D_nonlin_hypre_pfmg.cpp | 6 --- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 1 - 13 files changed, 6 insertions(+), 306 deletions(-) diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index f64b849eaa..f8ac079fb2 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -515,6 +515,9 @@ int main(int argc, char* argv[]) flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetDebugFilename", 1)) return 1; } // -------------- diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index d0029a06a5..7fc1447690 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -336,6 +336,9 @@ int main(int argc, char* argv[]) flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetDebugFilename", 1)) return 1; } // ------------------------ diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index f4b27d9bf8..98d0e607be 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -362,7 +362,6 @@ int main(int argc, char* argv[]) SUNMatrix A = NULL; // matrix for Jacobian SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables double t1 = 0.0; @@ -410,13 +409,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if (udata->diagnostics) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -533,13 +525,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && outproc) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -622,8 +607,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->diagnostics && outproc) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver SUNMatDestroy(A); // Free matrix diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index b9468dfc3f..c917d3b737 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -170,13 +170,11 @@ struct UserData int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off bool matvec; // use hypre matrix-vector product - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -321,7 +319,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables double t1 = 0.0; @@ -369,13 +366,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if (udata->diagnostics || udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -405,29 +395,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // --------------------- @@ -536,13 +508,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && outproc) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -625,8 +590,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && outproc) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -2076,13 +2039,11 @@ static int InitUserData(UserData *udata) udata->controller = 0; // PID controller udata->maxsteps = 0; // use default udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning udata->matvec = false; // use hypre matrix-vector product - udata->lsinfo = false; // output residual history udata->liniters = 10; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -2244,10 +2205,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { @@ -2257,10 +2214,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->matvec = true; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2415,10 +2368,8 @@ static void InputHelp() cout << " --order : method order" << endl; cout << " --fixedstep : used fixed step size" << endl; cout << " --controller : time step adaptivity controller" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --matvec : use hypre matrix-vector product" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index 9aae281556..e5a9c41b4f 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -177,13 +177,11 @@ struct UserData realtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off bool matvec; // use hypre matrix-vector product - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -355,7 +353,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure @@ -405,18 +402,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) - { - stringstream fname; - fname << "diagnostics." << setfill('0') << setw(5) << udata->myid_w - << ".txt"; - - const std::string tmp = fname.str(); - diagfp = fopen(tmp.c_str(), "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -446,29 +431,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // --------------------- @@ -572,13 +539,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) return 1; } - // Set diagnostics output file - if (udata->diagnostics && udata->myid_c == 0) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ------------------------ // Create XBraid interface // ------------------------ @@ -739,8 +699,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -2403,13 +2361,11 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->atol = RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning udata->matvec = false; // use hypre matrix-vector product - udata->lsinfo = false; // output residual history udata->liniters = 100; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -2596,10 +2552,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { @@ -2609,10 +2561,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->matvec = true; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2850,10 +2798,8 @@ static void InputHelp() cout << " --atol : absoltue tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order : method order" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --matvec : use hypre matrix-vector product" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index 938562ce40..256606cf59 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -175,12 +175,10 @@ struct UserData realtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -312,7 +310,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure @@ -362,18 +359,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) - { - stringstream fname; - fname << "diagnostics." << setfill('0') << setw(5) << udata->myid_w - << ".txt"; - - const std::string tmp = fname.str(); - diagfp = fopen(tmp.c_str(), "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -403,29 +388,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -519,13 +486,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) return 1; } - // Set diagnostics output file - if (udata->diagnostics && udata->myid_c == 0) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ------------------------ // Create XBraid interface // ------------------------ @@ -686,8 +646,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -1668,12 +1626,10 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->atol = RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning - udata->lsinfo = false; // output residual history udata->liniters = 100; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -1827,19 +1783,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { udata->pcg = false; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2068,9 +2016,7 @@ static void InputHelp() cout << " --atol : absoltue tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order : method order" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 5e4a0b9104..8b8c36dd82 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -120,12 +120,10 @@ struct UserData realtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -244,7 +242,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure @@ -302,18 +299,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "PrintUserData", 1)) return 1; } - // Open diagnostics output file - if (udata->diagnostics || udata->lsinfo) - { - stringstream fname; - fname << "diagnostics." << setfill('0') << setw(5) << udata->myid_w - << ".txt"; - - const std::string tmp = fname.str(); - diagfp = fopen(tmp.c_str(), "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } - // ---------------------- // Create serial vectors // ---------------------- @@ -341,29 +326,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -457,13 +424,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) return 1; } - // Set diagnostics output file - if (udata->diagnostics) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ------------------------ // Create XBraid interface // ------------------------ @@ -624,8 +584,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->diagnostics || udata->lsinfo) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -1012,12 +970,10 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->atol = RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning - udata->lsinfo = false; // output residual history udata->liniters = 100; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -1151,10 +1107,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->pcg = false; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1377,7 +1329,6 @@ static void InputHelp() cout << " --order : method order" << endl; cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index 547f6cd342..b7a896014f 100644 --- a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp +++ b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp @@ -168,7 +168,6 @@ struct UserData // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -292,7 +291,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *cvode_mem = NULL; // CVODE memory structure - FILE *diagfp = NULL; // diagnostics output file // SUNDIALS context sundials::Context sunctx(&comm_w); @@ -324,12 +322,6 @@ int main(int argc, char* argv[]) flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - // Open diagnostics output file - if (udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -359,29 +351,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -520,8 +494,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->lsinfo && outproc) fclose(diagfp); - CVodeFree(&cvode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -1290,7 +1262,6 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning - udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -1408,10 +1379,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->pcg = false; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1547,7 +1514,6 @@ static void InputHelp() cout << " --rtol : relative tolerance" << endl; cout << " --atol : absoltue tolerance" << endl; cout << " --gmres : use GMRES linear solver" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index 255520260f..fb783c1cea 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -176,7 +176,6 @@ struct UserData bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off bool matvec; // use hypre matrix-vector product - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -334,7 +333,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *cvode_mem = NULL; // CVODE memory structure - FILE *diagfp = NULL; // diagnostics output file // SUNDIALS context sundials::Context sunctx(&comm_w); @@ -363,13 +361,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if (udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -399,29 +390,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // --------------------- @@ -570,8 +543,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->lsinfo && outproc) fclose(diagfp); - CVodeFree(&cvode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -2023,7 +1994,6 @@ UserData::UserData(sundials::Context& sunctx) pcg = true; // use PCG (true) or GMRES (false) prec = true; // enable preconditioning matvec = false; // use hypre matrix-vector product - lsinfo = false; // output residual history liniters = 10; // max linear iterations msbp = 0; // use default (20 steps) epslin = ZERO; // use default (0.05) @@ -2172,10 +2142,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->matvec = true; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2321,7 +2287,6 @@ static void InputHelp() cout << " --atol : absoltue tolerance" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --matvec : use hypre matrix-vector product" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp index e3f1b20711..06ccccb4cc 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp @@ -1282,7 +1282,6 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options - udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations udata->epslin = RCONST(1.e-8); // relative stopping tolerance @@ -1412,10 +1411,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) udata->maxits = stoi((*argv)[arg_idx++]); } // Linear solver settings - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1488,7 +1483,6 @@ static void InputHelp() cout << " --damping : damping for Anderson Acceleration " << endl; cout << " --orthaa : orthogonalization routine used in Anderson Acceleration " << endl; cout << " --C : scalar value on exponential term " << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --pfmg_relax : relaxtion type in PFMG" << endl; diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp index dfdb220127..fb5a8c6ce1 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp @@ -108,7 +108,6 @@ struct UserData int maxits; // max number of fixed point iterations // Linear solver and preconditioner settings - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp index 1cb74e17ca..7a85c6b8d0 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp @@ -1452,7 +1452,6 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options - udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations udata->epslin = RCONST(1.e-8); // use default (0.05) @@ -1629,10 +1628,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) udata->c_int = stoi((*argv)[arg_idx++]); } // Linear solver settings - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1756,7 +1751,6 @@ static void InputHelp() cout << " --damping : damping for Anderson Acceleration " << endl; cout << " --orthaa : orthogonalization routine used in Anderson Acceleration " << endl; cout << " --c : nonlinear function parameter" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --pfmg_relax : relaxtion type in PFMG" << endl; diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp index 409ae447a3..723b93e8f7 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp @@ -139,7 +139,6 @@ struct UserData int maxits; // max number of fixed point iterations // Linear solver and preconditioner settings - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor From d445aa5bcdf503b84f286df15201779c02097317 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 09:05:13 -0700 Subject: [PATCH 23/85] remove deprecated arkode code --- include/arkode/arkode_arkstep.h | 49 ------------------------ include/arkode/arkode_butcher_dirk.h | 43 --------------------- include/arkode/arkode_butcher_erk.h | 43 --------------------- include/arkode/arkode_erkstep.h | 32 ---------------- include/arkode/arkode_mristep.h | 51 ------------------------- src/arkode/arkode_arkstep.c | 27 ------------- src/arkode/arkode_arkstep_io.c | 20 ---------- src/arkode/arkode_erkstep_io.c | 2 - src/arkode/arkode_mristep_io.c | 16 -------- src/arkode/fmod/farkode_arkstep_mod.c | 14 ------- src/arkode/fmod/farkode_arkstep_mod.f90 | 26 ------------- src/arkode/fmod/farkode_erkstep_mod.c | 14 ------- src/arkode/fmod/farkode_erkstep_mod.f90 | 26 ------------- src/arkode/fmod/farkode_mod.f90 | 38 ++---------------- src/arkode/fmod/farkode_mristep_mod.c | 14 ------- src/arkode/fmod/farkode_mristep_mod.f90 | 37 ------------------ 16 files changed, 3 insertions(+), 449 deletions(-) diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 361d637e72..80f21352c0 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -61,53 +61,6 @@ static const int ARKSTEP_DEFAULT_ARK_ITABLE_3 = ARKODE_ARK324L2SA_DIRK_4_2_3; static const int ARKSTEP_DEFAULT_ARK_ITABLE_4 = ARKODE_ARK436L2SA_DIRK_6_3_4; static const int ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5; -#ifndef DEFAULT_ERK_2 -/* DEPRECATED DEFAULT_ERK_2: use ARKSTEP_ERK_DEFAULT_2 */ -#define DEFAULT_ERK_2 ARKSTEP_ERK_DEFAULT_2 -#endif - -#ifndef DEFAULT_ERK_3 -/* DEPRECATED DEFAULT_ERK_3: use ARKSTEP_ERK_DEFAULT_3 */ -#define DEFAULT_ERK_3 ARKSTEP_ERK_DEFAULT_3 -#endif - -#ifndef DEFAULT_ERK_4 -/* DEPRECATED DEFAULT_ERK_4: use ARKSTEP_ERK_DEFAULT_4 */ -#define DEFAULT_ERK_4 ARKSTEP_ERK_DEFAULT_4 -#endif - -#ifndef DEFAULT_ERK_5 -/* DEPRECATED DEFAULT_ERK_5: use ARKSTEP_ERK_DEFAULT_5 */ -#define DEFAULT_ERK_5 ARKSTEP_ERK_DEFAULT_5 -#endif - -#ifndef DEFAULT_ERK_6 -/* DEPRECATED DEFAULT_ERK_6: use ARKSTEP_ERK_DEFAULT_6 */ -#define DEFAULT_ERK_6 ARKSTEP_ERK_DEFAULT_6 -#endif - -#ifndef DEFAULT_ERK_8 -/* DEPRECATED DEFAULT_ERK_8: use ARKSTEP_ERK_DEFAULT_8 */ -#define DEFAULT_ERK_8 ARKSTEP_ERK_DEFAULT_8 -#endif - -/* ImEx */ -/* DEPRECATED DEFAULT_ARK_ETABLE_3: use ARKSTEP_DEFAULT_ARK_ETABLE_3 */ -#define DEFAULT_ARK_ETABLE_3 ARKSTEP_DEFAULT_ARK_ETABLE_3 -/* DEPRECATED DEFAULT_ARK_ETABLE_4: use ARKSTEP_DEFAULT_ARK_ETABLE_4 */ -#define DEFAULT_ARK_ETABLE_4 ARKSTEP_DEFAULT_ARK_ETABLE_4 -/* DEPRECATED DEFAULT_ARK_ETABLE_5: use ARKSTEP_DEFAULT_ARK_ETABLE_4 */ -#define DEFAULT_ARK_ETABLE_5 ARKSTEP_DEFAULT_ARK_ETABLE_5 -/* DEPRECATED DEFAULT_ARK_ITABLE_3: use ARKSTEP_DEFAULT_ARK_ITABLE_3 */ -#define DEFAULT_ARK_ITABLE_3 ARKSTEP_DEFAULT_ARK_ITABLE_3 -/* DEPRECATED DEFAULT_ARK_ITABLE_4: use ARKSTEP_DEFAULT_ARK_ITABLE_4 */ -#define DEFAULT_ARK_ITABLE_4 ARKSTEP_DEFAULT_ARK_ITABLE_4 -/* DEPRECATED DEFAULT_ARK_ITABLE_5: use ARKSTEP_DEFAULT_ARK_ITABLE_5 */ -#define DEFAULT_ARK_ITABLE_5 ARKSTEP_DEFAULT_ARK_ITABLE_5 - -/* backwards-compatibility */ -typedef ARKStagePredictFn ARKStepStagePredictFn; - /* ------------------- * Exported Functions * ------------------- */ @@ -263,8 +216,6 @@ SUNDIALS_EXPORT int ARKStepSetErrFile(void *arkode_mem, FILE *errfp); SUNDIALS_EXPORT int ARKStepSetUserData(void *arkode_mem, void *user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDIALS_LOGGER instead") -int ARKStepSetDiagnostics(void *arkode_mem, FILE *diagfp); SUNDIALS_EXPORT int ARKStepSetPostprocessStepFn(void *arkode_mem, ARKPostProcessFn ProcessStep); diff --git a/include/arkode/arkode_butcher_dirk.h b/include/arkode/arkode_butcher_dirk.h index aecaf16a82..0dd8a788ea 100644 --- a/include/arkode/arkode_butcher_dirk.h +++ b/include/arkode/arkode_butcher_dirk.h @@ -23,49 +23,6 @@ extern "C" { #endif - -/* Butcher table accessor IDs - ERK: 0 - 99 - DIRK: 100 - 199 - MRI: 200 - 299 */ - -/* DEPRECATED SDIRK_2_1_2: use ARKODE_SDIRK_2_1_2 */ -#define SDIRK_2_1_2 100 -/* DEPRECATED BILLINGTON_3_3_2: use ARKODE_BILLINGTON_3_3_2 */ -#define BILLINGTON_3_3_2 101 -/* DEPRECATED TRBDF2_3_3_2: use ARKODE_TRBDF2_3_3_2 */ -#define TRBDF2_3_3_2 102 -/* DEPRECATED KVAERNO_4_2_3: use ARKODE_KVAERNO_4_2_3 */ -#define KVAERNO_4_2_3 103 -/* DEPRECATED ARK324L2SA_DIRK_4_2_3: use ARKODE_ARK324L2SA_DIRK_4_2_3 */ -#define ARK324L2SA_DIRK_4_2_3 104 -/* DEPRECATED CASH_5_2_4: use ARKODE_CASH_5_2_4 */ -#define CASH_5_2_4 105 -/* DEPRECATED CASH_5_3_4: use ARKODE_CASH_5_3_4 */ -#define CASH_5_3_4 106 -/* DEPRECATED SDIRK_5_3_4: use ARKODE_SDIRK_5_3_4 */ -#define SDIRK_5_3_4 107 -/* DEPRECATED KVAERNO_5_3_4: use ARKODE_KVAERNO_5_3_4 */ -#define KVAERNO_5_3_4 108 -/* DEPRECATED ARK436L2SA_DIRK_6_3_4: use ARKODE_ARK436L2SA_DIRK_6_3_4 */ -#define ARK436L2SA_DIRK_6_3_4 109 -/* DEPRECATED KVAERNO_7_4_5: use ARKODE_KVAERNO_7_4_5 */ -#define KVAERNO_7_4_5 110 -/* DEPRECATED ARK548L2SA_DIRK_8_4_5: use ARKODE_ARK548L2SA_DIRK_8_4_5 */ -#define ARK548L2SA_DIRK_8_4_5 111 -/* DEPRECATED ARK437L2SA_DIRK_7_3_4: use ARKODE_ARK437L2SA_DIRK_7_3_4 */ -#define ARK437L2SA_DIRK_7_3_4 112 -/* DEPRECATED ARK548L2SAb_DIRK_8_4_5: use ARKODE_ARK548L2SAb_DIRK_8_4_5 */ -#define ARK548L2SAb_DIRK_8_4_5 113 - -/* Utility #defines to ensure valid input IDs for DIRK tables */ - -/* DEPRECATED MIN_DIRK_NUM: use ARKODE_MIN_DIRK_NUM */ -#define MIN_DIRK_NUM 100 - -/* DEPRECATED MAX_DIRK_NUM: use ARKODE_MAX_DIRK_NUM */ -#define MAX_DIRK_NUM 113 - typedef enum { ARKODE_DIRK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_DIRK_NUM = 100, diff --git a/include/arkode/arkode_butcher_erk.h b/include/arkode/arkode_butcher_erk.h index cd552f58e3..e0c3c546a1 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -23,49 +23,6 @@ extern "C" { #endif -/* Butcher table accessor IDs - ERK: 0 - 99 - DIRK: 100 - 199 - MRI: 200 - 299 */ - -/* DEPRECATED HEUN_EULER_2_1_2: use ARKODE_HEUN_EULER_2_1_2 */ -#define HEUN_EULER_2_1_2 0 -/* DEPRECATED BOGACKI_SHAMPINE_4_2_3: use ARKODE_BOGACKI_SHAMPINE_4_2_3 */ -#define BOGACKI_SHAMPINE_4_2_3 1 -/* DEPRECATED ARK324L2SA_ERK_4_2_3: use ARKODE_ARK324L2SA_ERK_4_2_3 */ -#define ARK324L2SA_ERK_4_2_3 2 -/* DEPRECATED ZONNEVELD_5_3_4: use ARKODE_ZONNEVELD_5_3_4 */ -#define ZONNEVELD_5_3_4 3 -/* DEPRECATED ARK436L2SA_ERK_6_3_4: use ARKODE_ARK436L2SA_ERK_6_3_4 */ -#define ARK436L2SA_ERK_6_3_4 4 -/* DEPRECATED SAYFY_ABURUB_6_3_4: use ARKODE_SAYFY_ABURUB_6_3_4 */ -#define SAYFY_ABURUB_6_3_4 5 -/* DEPRECATED CASH_KARP_6_4_5: use ARKODE_CASH_KARP_6_4_5 */ -#define CASH_KARP_6_4_5 6 -/* DEPRECATED FEHLBERG_6_4_5: use ARKODE_FEHLBERG_6_4_5 */ -#define FEHLBERG_6_4_5 7 -/* DEPRECATED DORMAND_PRINCE_7_4_5: use ARKODE_DORMAND_PRINCE_7_4_5 */ -#define DORMAND_PRINCE_7_4_5 8 -/* DEPRECATED ARK548L2SA_ERK_8_4_5: use ARKODE_ARK548L2SA_ERK_8_4_5 */ -#define ARK548L2SA_ERK_8_4_5 9 -/* DEPRECATED VERNER_8_5_6: use ARKODE_VERNER_8_5_6 */ -#define VERNER_8_5_6 10 -/* DEPRECATED FEHLBERG_13_7_8: use ARKODE_FEHLBERG_13_7_8 */ -#define FEHLBERG_13_7_8 11 -/* DEPRECATED KNOTH_WOLKE_3_3: use ARKODE_KNOTH_WOLKE_3_3 */ -#define KNOTH_WOLKE_3_3 12 -/* DEPRECATED ARK437L2SA_ERK_7_3_4: use ARKODE_ARK437L2SA_ERK_7_3_4 */ -#define ARK437L2SA_ERK_7_3_4 13 -/* DEPRECATED ARK548L2SAb_ERK_8_4_5: use ARKODE_ARK548L2SAb_ERK_8_4_5 */ -#define ARK548L2SAb_ERK_8_4_5 14 - -/* Utility #defines to ensure valid input IDs for ERK tables */ - -/* DEPRECATED MIN_ERK_NUM: use ARKODE_MIN_ERK_NUM */ -#define MIN_ERK_NUM 0 -/* DEPRECATED MAX_ERK_NUM: use ARKODE_MAX_ERK_NUM */ -#define MAX_ERK_NUM 21 - typedef enum { ARKODE_ERK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_ERK_NUM = 0, diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index de656604d1..76a1cfb380 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -40,36 +40,6 @@ static const int ERKSTEP_DEFAULT_7 = ARKODE_VERNER_10_6_7; static const int ERKSTEP_DEFAULT_8 = ARKODE_FEHLBERG_13_7_8; static const int ERKSTEP_DEFAULT_9 = ARKODE_VERNER_16_8_9; -#ifndef DEFAULT_ERK_2 -/* DEPRECATED DEFAULT_ERK_2: use ERKSTEP_DEFAULT_2 */ -#define DEFAULT_ERK_2 ERKSTEP_DEFAULT_2 -#endif - -#ifndef DEFAULT_ERK_3 -/* DEPRECATED DEFAULT_ERK_3: use ERKSTEP_DEFAULT_3 */ -#define DEFAULT_ERK_3 ERKSTEP_DEFAULT_3 -#endif - -#ifndef DEFAULT_ERK_4 -/* DEPRECATED DEFAULT_ERK_4: use ERKSTEP_DEFAULT_4 */ -#define DEFAULT_ERK_4 ERKSTEP_DEFAULT_4 -#endif - -#ifndef DEFAULT_ERK_5 -/* DEPRECATED DEFAULT_ERK_5: use ERKSTEP_DEFAULT_5 */ -#define DEFAULT_ERK_5 ERKSTEP_DEFAULT_5 -#endif - -#ifndef DEFAULT_ERK_6 -/* DEPRECATED DEFAULT_ERK_6: use ERKSTEP_DEFAULT_6 */ -#define DEFAULT_ERK_6 ERKSTEP_DEFAULT_6 -#endif - -#ifndef DEFAULT_ERK_8 -/* DEPRECATED DEFAULT_ERK_8: use ERKSTEP_DEFAULT_8 */ -#define DEFAULT_ERK_8 ERKSTEP_DEFAULT_8 -#endif - /* ------------------- * Exported Functions * ------------------- */ @@ -176,8 +146,6 @@ SUNDIALS_EXPORT int ERKStepSetErrFile(void *arkode_mem, FILE *errfp); SUNDIALS_EXPORT int ERKStepSetUserData(void *arkode_mem, void *user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDIALS_LOGGER instead") -int ERKStepSetDiagnostics(void *arkode_mem, FILE *diagfp); SUNDIALS_EXPORT int ERKStepSetPostprocessStepFn(void *arkode_mem, ARKPostProcessFn ProcessStep); diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index d4d889813f..fbfb91c349 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -41,38 +41,6 @@ typedef enum { MRISTEP_IMEX } MRISTEP_METHOD_TYPE; - -/* MRI coupling table table accessor IDs: - ERK: 0 - 99 - DIRK: 100 - 199 - MRI: 200 - 299 */ - -/* DEPRECATED MIS_KW3: use ARKODE_MIS_KW3 */ -#define MIS_KW3 200 -/* DEPRECATED MRI_GARK_ERK33a: use ARKODE_MRI_GARK_ERK33a */ -#define MRI_GARK_ERK33a 201 -/* DEPRECATED MRI_GARK_ERK45a: use ARKODE_MRI_GARK_ERK45a */ -#define MRI_GARK_ERK45a 202 -/* DEPRECATED MRI_GARK_IRK21a: use ARKODE_MRI_GARK_IRK21a */ -#define MRI_GARK_IRK21a 203 -/* DEPRECATED MRI_GARK_ESDIRK34a: use ARKODE_MRI_GARK_ESDIRK34a */ -#define MRI_GARK_ESDIRK34a 204 -/* DEPRECATED MRI_GARK_ESDIRK46a: use ARKODE_MRI_GARK_ESDIRK46a */ -#define MRI_GARK_ESDIRK46a 205 -/* DEPRECATED IMEX_MRI_GARK3a: use ARKODE_IMEX_MRI_GARK3a */ -#define IMEX_MRI_GARK3a 206 -/* DEPRECATED IMEX_MRI_GARK3b: use ARKODE_IMEX_MRI_GARK3b */ -#define IMEX_MRI_GARK3b 207 -/* DEPRECATED IMEX_MRI_GARK4: use ARKODE_IMEX_MRI_GARK4 */ -#define IMEX_MRI_GARK4 208 - -/* Utility #defines to ensure valid input IDs for MRI tables */ - -/* DEPRECATED MIN_MRI_NUM: use ARKODE_MIN_MRI_NUM */ -#define MIN_MRI_NUM 200 -/* DEPRECATED MAX_MRI_NUM: use ARKODE_MAX_MRI_NUM */ -#define MAX_MRI_NUM 208 - typedef enum { ARKODE_MRI_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_MRI_NUM = 200, @@ -100,23 +68,6 @@ static const int MRISTEP_DEFAULT_IMPL_SD_4 = ARKODE_MRI_GARK_ESDIRK46a; static const int MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b; static const int MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4; -/* DEPRECATED DEFAULT_MRI_TABLE_3: use MRISTEP_DEFAULT_3 */ -#define DEFAULT_MRI_TABLE_3 MRISTEP_DEFAULT_3 /* backwards-compatibility */ -/* DEPRECATED DEFAULT_EXPL_MRI_TABLE_3: use MRISTEP_DEFAULT_EXPL_3 */ -#define DEFAULT_EXPL_MRI_TABLE_3 MRISTEP_DEFAULT_EXPL_3 -/* DEPRECATED DEFAULT_EXPL_MRI_TABLE_4: use MRISTEP_DEFAULT_EXPL_4 */ -#define DEFAULT_EXPL_MRI_TABLE_4 MRISTEP_DEFAULT_EXPL_4 -/* DEPRECATED DEFAULT_IMPL_SD_TABLE_2: use MRISTEP_DEFAULT_IMPL_SD_2 */ -#define DEFAULT_IMPL_SD_MRI_TABLE_2 MRISTEP_DEFAULT_IMPL_SD_2 -/* DEPRECATED DEFAULT_IMPL_SD_TABLE_3: use MRISTEP_DEFAULT_IMPL_SD_3 */ -#define DEFAULT_IMPL_SD_MRI_TABLE_3 MRISTEP_DEFAULT_IMPL_SD_3 -/* DEPRECATED DEFAULT_IMPL_SD_TABLE_4: use MRISTEP_DEFAULT_IMPL_SD_4 */ -#define DEFAULT_IMPL_SD_MRI_TABLE_4 MRISTEP_DEFAULT_IMPL_SD_4 -/* DEPRECATED DEFAULT_IMEX_SD_TABLE_3: use MRISTEP_DEFAULT_IMEX_SD_3 */ -#define DEFAULT_IMEX_SD_MRI_TABLE_3 MRISTEP_DEFAULT_IMEX_SD_3 -/* DEPRECATED DEFAULT_IMEX_SD_TABLE_4: use MRISTEP_DEFAULT_IMEX_SD_4 */ -#define DEFAULT_IMEX_SD_MRI_TABLE_4 MRISTEP_DEFAULT_IMEX_SD_4 - /* ------------------------------------ * MRIStep Inner Stepper Function Types * ------------------------------------ */ @@ -268,8 +219,6 @@ SUNDIALS_EXPORT int MRIStepSetErrFile(void *arkode_mem, FILE *errfp); SUNDIALS_EXPORT int MRIStepSetUserData(void *arkode_mem, void *user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDIALS_LOGGER instead") -int MRIStepSetDiagnostics(void *arkode_mem, FILE *diagfp); SUNDIALS_EXPORT int MRIStepSetPostprocessStepFn(void *arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_EXPORT int MRIStepSetPostprocessStageFn(void *arkode_mem, diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index ba5e4c3885..3bd782f41f 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1231,16 +1231,6 @@ int arkStep_Init(void* arkode_mem, int init_type) return (ARK_ILL_INPUT); } } - - /* If configured with either predictor 4 or 5 and a non-identity mass - matrix, reset to trivial predictor */ - if (step_mem->mass_type != MASS_IDENTITY) - if ((step_mem->predictor == 4) || (step_mem->predictor == 5)) - step_mem->predictor = 0; - - /* If the bootstrap predictor is enabled, signal to shared arkode module that - fullrhs is required after each step */ - if (step_mem->predictor == 4) ark_mem->call_fullrhs = SUNTRUE; } /* set appropriate TakeStep routine based on problem configuration */ @@ -2520,23 +2510,6 @@ int arkStep_StageSetup(ARKodeMem ark_mem, booleantype implicit) ONE : step_mem->gamma / step_mem->gammap; /* protect x/x != 1.0 */ } - /* If predictor==5, then sdata=0 (plus any implicit forcing). - Set sdata appropriately and return */ - if (implicit && (step_mem->predictor == 5)) { - - /* apply external polynomial forcing (updates nvec, cvals, Xvecs) */ - if (step_mem->impforcing) { - nvec = 0; - arkStep_ApplyForcing(step_mem, ark_mem->tcur, step_mem->gamma, &nvec); - retval = N_VLinearCombination(nvec, cvals, Xvecs, step_mem->sdata); - if (retval != 0) return(ARK_VECTOROP_ERR); - } else { - N_VConst(ZERO, step_mem->sdata); - } - return (ARK_SUCCESS); - - } - /* If implicit, initialize sdata to yn - zpred (here: zpred = zp), and set first entries for eventual N_VLinearCombination call */ nvec = 0; diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index fc2df26f98..26f6e1b6bc 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -44,8 +44,6 @@ int ARKStepSetErrHandlerFn(void *arkode_mem, ARKErrHandlerFn ehfun, return(arkSetErrHandlerFn(arkode_mem, ehfun, eh_data)); } int ARKStepSetErrFile(void *arkode_mem, FILE *errfp) { return(arkSetErrFile(arkode_mem, errfp)); } -int ARKStepSetDiagnostics(void *arkode_mem, FILE *diagfp) { - return(arkSetDiagnostics(arkode_mem, diagfp)); } int ARKStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int ARKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { @@ -1333,16 +1331,6 @@ int ARKStepSetPredictorMethod(void *arkode_mem, int pred_method) return(ARK_ILL_INPUT); } - /* Deprecate options 4 and 5 */ - if (pred_method == 4) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", "ARKStepSetPredictorMethod", - "Predictor option 4 is deprecated, and will be removed in an upcoming release"); - } - if (pred_method == 5) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", "ARKStepSetPredictorMethod", - "Predictor option 5 is deprecated, and will be removed in an upcoming release"); - } - /* set parameter */ step_mem->predictor = pred_method; @@ -1441,14 +1429,6 @@ int ARKStepSetStagePredictFn(void *arkode_mem, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); - /* override predictor method 5 if non-NULL PredictStage is supplied */ - if ((step_mem->predictor == 5) && (PredictStage != NULL)) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::ARKStep", - "ARKStepSetStagePredictFn", - "User-supplied predictor is incompatible with predictor method 5"); - return(ARK_ILL_INPUT); - } - step_mem->stage_predict = PredictStage; return(ARK_SUCCESS); } diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 34bb7d46c2..53ba691d34 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -45,8 +45,6 @@ int ERKStepSetErrFile(void *arkode_mem, FILE *errfp) { return(arkSetErrFile(arkode_mem, errfp)); } int ERKStepSetUserData(void *arkode_mem, void *user_data) { return(arkSetUserData(arkode_mem, user_data)); } -int ERKStepSetDiagnostics(void *arkode_mem, FILE *diagfp) { - return(arkSetDiagnostics(arkode_mem, diagfp)); } int ERKStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int ERKStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 5c6ced636e..da5a76442b 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -40,8 +40,6 @@ int MRIStepSetErrHandlerFn(void *arkode_mem, ARKErrHandlerFn ehfun, return(arkSetErrHandlerFn(arkode_mem, ehfun, eh_data)); } int MRIStepSetErrFile(void *arkode_mem, FILE *errfp) { return(arkSetErrFile(arkode_mem, errfp)); } -int MRIStepSetDiagnostics(void *arkode_mem, FILE *diagfp) { - return(arkSetDiagnostics(arkode_mem, diagfp)); } int MRIStepSetMaxNumSteps(void *arkode_mem, long int mxsteps) { return(arkSetMaxNumSteps(arkode_mem, mxsteps)); } int MRIStepSetMaxHnilWarns(void *arkode_mem, int mxhnil) { @@ -600,12 +598,6 @@ int MRIStepSetPredictorMethod(void *arkode_mem, int pred_method) &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); - /* Deprecate option 4 */ - if (pred_method == 4) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::MRIStep", "MRIStepSetPredictorMethod", - "Predictor option 4 is deprecated, and will be removed in an upcoming release"); - } - /* set parameter */ step_mem->predictor = pred_method; @@ -704,14 +696,6 @@ int MRIStepSetStagePredictFn(void *arkode_mem, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) return(retval); - /* override predictor method 5 if non-NULL PredictStage is supplied */ - if ((step_mem->predictor == 5) && (PredictStage != NULL)) { - arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE::MRIStep", - "MRIStepSetStagePredictFn", - "User-supplied predictor is incompatible with predictor method 5"); - return(ARK_ILL_INPUT); - } - step_mem->stage_predict = PredictStage; return(ARK_SUCCESS); } diff --git a/src/arkode/fmod/farkode_arkstep_mod.c b/src/arkode/fmod/farkode_arkstep_mod.c index 2ae77231a3..cf29b827f6 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.c +++ b/src/arkode/fmod/farkode_arkstep_mod.c @@ -1227,20 +1227,6 @@ SWIGEXPORT int _wrap_FARKStepSetUserData(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FARKStepSetDiagnostics(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)ARKStepSetDiagnostics(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_arkstep_mod.f90 b/src/arkode/fmod/farkode_arkstep_mod.f90 index c52006c929..f9f0c191eb 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -129,7 +129,6 @@ module farkode_arkstep_mod public :: FARKStepSetErrHandlerFn public :: FARKStepSetErrFile public :: FARKStepSetUserData - public :: FARKStepSetDiagnostics public :: FARKStepSetPostprocessStepFn public :: FARKStepSetPostprocessStageFn public :: FARKStepSetStagePredictFn @@ -865,15 +864,6 @@ function swigc_FARKStepSetUserData(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKStepSetDiagnostics(farg1, farg2) & -bind(C, name="_wrap_FARKStepSetDiagnostics") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FARKStepSetPostprocessStepFn(farg1, farg2) & bind(C, name="_wrap_FARKStepSetPostprocessStepFn") & result(fresult) @@ -2968,22 +2958,6 @@ function FARKStepSetUserData(arkode_mem, user_data) & swig_result = fresult end function -function FARKStepSetDiagnostics(arkode_mem, diagfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: diagfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = diagfp -fresult = swigc_FARKStepSetDiagnostics(farg1, farg2) -swig_result = fresult -end function - function FARKStepSetPostprocessStepFn(arkode_mem, processstep) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod/farkode_erkstep_mod.c b/src/arkode/fmod/farkode_erkstep_mod.c index 46836ba780..8616db5916 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.c +++ b/src/arkode/fmod/farkode_erkstep_mod.c @@ -895,20 +895,6 @@ SWIGEXPORT int _wrap_FERKStepSetUserData(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FERKStepSetDiagnostics(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)ERKStepSetDiagnostics(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FERKStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_erkstep_mod.f90 b/src/arkode/fmod/farkode_erkstep_mod.f90 index 3857ac1a7d..57279f04be 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -94,7 +94,6 @@ module farkode_erkstep_mod public :: FERKStepSetErrHandlerFn public :: FERKStepSetErrFile public :: FERKStepSetUserData - public :: FERKStepSetDiagnostics public :: FERKStepSetPostprocessStepFn public :: FERKStepSetPostprocessStageFn public :: FERKStepEvolve @@ -566,15 +565,6 @@ function swigc_FERKStepSetUserData(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepSetDiagnostics(farg1, farg2) & -bind(C, name="_wrap_FERKStepSetDiagnostics") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FERKStepSetPostprocessStepFn(farg1, farg2) & bind(C, name="_wrap_FERKStepSetPostprocessStepFn") & result(fresult) @@ -1798,22 +1788,6 @@ function FERKStepSetUserData(arkode_mem, user_data) & swig_result = fresult end function -function FERKStepSetDiagnostics(arkode_mem, diagfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: diagfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = diagfp -fresult = swigc_FERKStepSetDiagnostics(farg1, farg2) -swig_result = fresult -end function - function FERKStepSetPostprocessStepFn(arkode_mem, processstep) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 5ca5dcc9f2..3f51ff8cec 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -160,22 +160,6 @@ module farkode_mod public :: FARKodeButcherTable_Write public :: FARKodeButcherTable_CheckOrder public :: FARKodeButcherTable_CheckARKOrder - integer(C_INT), parameter, public :: SDIRK_2_1_2 = 100_C_INT - integer(C_INT), parameter, public :: BILLINGTON_3_3_2 = 101_C_INT - integer(C_INT), parameter, public :: TRBDF2_3_3_2 = 102_C_INT - integer(C_INT), parameter, public :: KVAERNO_4_2_3 = 103_C_INT - integer(C_INT), parameter, public :: ARK324L2SA_DIRK_4_2_3 = 104_C_INT - integer(C_INT), parameter, public :: CASH_5_2_4 = 105_C_INT - integer(C_INT), parameter, public :: CASH_5_3_4 = 106_C_INT - integer(C_INT), parameter, public :: SDIRK_5_3_4 = 107_C_INT - integer(C_INT), parameter, public :: KVAERNO_5_3_4 = 108_C_INT - integer(C_INT), parameter, public :: ARK436L2SA_DIRK_6_3_4 = 109_C_INT - integer(C_INT), parameter, public :: KVAERNO_7_4_5 = 110_C_INT - integer(C_INT), parameter, public :: ARK548L2SA_DIRK_8_4_5 = 111_C_INT - integer(C_INT), parameter, public :: ARK437L2SA_DIRK_7_3_4 = 112_C_INT - integer(C_INT), parameter, public :: ARK548L2SAb_DIRK_8_4_5 = 113_C_INT - integer(C_INT), parameter, public :: MIN_DIRK_NUM = 100_C_INT - integer(C_INT), parameter, public :: MAX_DIRK_NUM = 113_C_INT ! typedef enum ARKODE_DIRKTableID enum, bind(c) enumerator :: ARKODE_DIRK_NONE = -1 @@ -220,23 +204,6 @@ module farkode_mod integer(C_SIZE_T), public :: size = 0 end type public :: FARKodeButcherTable_LoadDIRKByName - integer(C_INT), parameter, public :: HEUN_EULER_2_1_2 = 0_C_INT - integer(C_INT), parameter, public :: BOGACKI_SHAMPINE_4_2_3 = 1_C_INT - integer(C_INT), parameter, public :: ARK324L2SA_ERK_4_2_3 = 2_C_INT - integer(C_INT), parameter, public :: ZONNEVELD_5_3_4 = 3_C_INT - integer(C_INT), parameter, public :: ARK436L2SA_ERK_6_3_4 = 4_C_INT - integer(C_INT), parameter, public :: SAYFY_ABURUB_6_3_4 = 5_C_INT - integer(C_INT), parameter, public :: CASH_KARP_6_4_5 = 6_C_INT - integer(C_INT), parameter, public :: FEHLBERG_6_4_5 = 7_C_INT - integer(C_INT), parameter, public :: DORMAND_PRINCE_7_4_5 = 8_C_INT - integer(C_INT), parameter, public :: ARK548L2SA_ERK_8_4_5 = 9_C_INT - integer(C_INT), parameter, public :: VERNER_8_5_6 = 10_C_INT - integer(C_INT), parameter, public :: FEHLBERG_13_7_8 = 11_C_INT - integer(C_INT), parameter, public :: KNOTH_WOLKE_3_3 = 12_C_INT - integer(C_INT), parameter, public :: ARK437L2SA_ERK_7_3_4 = 13_C_INT - integer(C_INT), parameter, public :: ARK548L2SAb_ERK_8_4_5 = 14_C_INT - integer(C_INT), parameter, public :: MIN_ERK_NUM = 0_C_INT - integer(C_INT), parameter, public :: MAX_ERK_NUM = 14_C_INT ! typedef enum ARKODE_ERKTableID enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 @@ -257,14 +224,15 @@ module farkode_mod enumerator :: ARKODE_ARK437L2SA_ERK_7_3_4 enumerator :: ARKODE_ARK548L2SAb_ERK_8_4_5 enumerator :: ARKODE_ARK2_ERK_3_1_2 - enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_ARK2_ERK_3_1_2 + enumerator :: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_SOFRONIOU_SPALETTA_5_3_4 end enum integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, 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_MAX_ERK_NUM + ARKODE_ARK548L2SAb_ERK_8_4_5, ARKODE_ARK2_ERK_3_1_2, ARKODE_SOFRONIOU_SPALETTA_5_3_4, ARKODE_MAX_ERK_NUM public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName ! typedef enum ARKODE_SPRKMethodID diff --git a/src/arkode/fmod/farkode_mristep_mod.c b/src/arkode/fmod/farkode_mristep_mod.c index 8ba7ad5296..0065b6553f 100644 --- a/src/arkode/fmod/farkode_mristep_mod.c +++ b/src/arkode/fmod/farkode_mristep_mod.c @@ -1171,20 +1171,6 @@ SWIGEXPORT int _wrap_FMRIStepSetUserData(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FMRIStepSetDiagnostics(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)MRIStepSetDiagnostics(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_mristep_mod.f90 b/src/arkode/fmod/farkode_mristep_mod.f90 index b80ca727f8..c0358e1ad1 100644 --- a/src/arkode/fmod/farkode_mristep_mod.f90 +++ b/src/arkode/fmod/farkode_mristep_mod.f90 @@ -47,17 +47,6 @@ module farkode_mristep_mod end enum integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX - integer(C_INT), parameter, public :: MIS_KW3 = 200_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ERK33a = 201_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ERK45a = 202_C_INT - integer(C_INT), parameter, public :: MRI_GARK_IRK21a = 203_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ESDIRK34a = 204_C_INT - integer(C_INT), parameter, public :: MRI_GARK_ESDIRK46a = 205_C_INT - integer(C_INT), parameter, public :: IMEX_MRI_GARK3a = 206_C_INT - integer(C_INT), parameter, public :: IMEX_MRI_GARK3b = 207_C_INT - integer(C_INT), parameter, public :: IMEX_MRI_GARK4 = 208_C_INT - integer(C_INT), parameter, public :: MIN_MRI_NUM = 200_C_INT - integer(C_INT), parameter, public :: MAX_MRI_NUM = 208_C_INT ! typedef enum ARKODE_MRITableID enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 @@ -168,7 +157,6 @@ module farkode_mristep_mod public :: FMRIStepSetErrHandlerFn public :: FMRIStepSetErrFile public :: FMRIStepSetUserData - public :: FMRIStepSetDiagnostics public :: FMRIStepSetPostprocessStepFn public :: FMRIStepSetPostprocessStageFn public :: FMRIStepSetPreInnerFn @@ -806,15 +794,6 @@ function swigc_FMRIStepSetUserData(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepSetDiagnostics(farg1, farg2) & -bind(C, name="_wrap_FMRIStepSetDiagnostics") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FMRIStepSetPostprocessStepFn(farg1, farg2) & bind(C, name="_wrap_FMRIStepSetPostprocessStepFn") & result(fresult) @@ -2448,22 +2427,6 @@ function FMRIStepSetUserData(arkode_mem, user_data) & swig_result = fresult end function -function FMRIStepSetDiagnostics(arkode_mem, diagfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: diagfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = diagfp -fresult = swigc_FMRIStepSetDiagnostics(farg1, farg2) -swig_result = fresult -end function - function FMRIStepSetPostprocessStepFn(arkode_mem, processstep) & result(swig_result) use, intrinsic :: ISO_C_BINDING From e57f71c22377097fca8fea38621d0511261cd405 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 09:07:27 -0700 Subject: [PATCH 24/85] remove direct and spils header files --- include/cvode/cvode_direct.h | 67 ----------------- include/cvode/cvode_spils.h | 92 ----------------------- include/cvodes/cvodes_direct.h | 79 -------------------- include/cvodes/cvodes_spils.h | 127 -------------------------------- include/ida/ida_direct.h | 68 ----------------- include/ida/ida_spils.h | 95 ------------------------ include/idas/idas_direct.h | 81 -------------------- include/idas/idas_spils.h | 131 --------------------------------- include/kinsol/kinsol_direct.h | 66 ----------------- include/kinsol/kinsol_spils.h | 85 --------------------- 10 files changed, 891 deletions(-) delete mode 100644 include/cvode/cvode_direct.h delete mode 100644 include/cvode/cvode_spils.h delete mode 100644 include/cvodes/cvodes_direct.h delete mode 100644 include/cvodes/cvodes_spils.h delete mode 100644 include/ida/ida_direct.h delete mode 100644 include/ida/ida_spils.h delete mode 100644 include/idas/idas_direct.h delete mode 100644 include/idas/idas_spils.h delete mode 100644 include/kinsol/kinsol_direct.h delete mode 100644 include/kinsol/kinsol_spils.h diff --git a/include/cvode/cvode_direct.h b/include/cvode/cvode_direct.h deleted file mode 100644 index 88568252d4..0000000000 --- a/include/cvode/cvode_direct.h +++ /dev/null @@ -1,67 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * CVODE; these routines now just wrap the updated CVODE generic - * linear solver interface in cvode_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVDLS_H -#define _CVDLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in cvode_ls.h) - =================================================================*/ - -typedef CVLsJacFn CVDlsJacFn; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in cvode_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFn instead") -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJacEvals instead") -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVDlsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVDlsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/cvode/cvode_spils.h b/include/cvode/cvode_spils.h deleted file mode 100644 index 2c60f794d4..0000000000 --- a/include/cvode/cvode_spils.h +++ /dev/null @@ -1,92 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODE; these routines now just wrap - * the updated CVODE generic linear solver interface in cvode_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVSPILS_H -#define _CVSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in cvode_ls.h) - ===============================================================*/ - -typedef CVLsPrecSetupFn CVSpilsPrecSetupFn; -typedef CVLsPrecSolveFn CVSpilsPrecSolveFn; -typedef CVLsJacTimesSetupFn CVSpilsJacTimesSetupFn; -typedef CVLsJacTimesVecFn CVSpilsJacTimesVecFn; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in cvode_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetEpsLin instead") -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditioner instead") -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, - CVSpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimes instead") -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, - CVSpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecEvals instead") -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecSolves instead") -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinIters instead") -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumConvFails instead") -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJTSetupEvals instead") -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJtimesEvals instead") -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVSpilsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/cvodes/cvodes_direct.h b/include/cvodes/cvodes_direct.h deleted file mode 100644 index a1b8a02cbe..0000000000 --- a/include/cvodes/cvodes_direct.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * CVODES; these routines now just wrap the updated CVODE generic - * linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVSDLS_H -#define _CVSDLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in cvodes_ls.h) - =================================================================*/ - -typedef CVLsJacFn CVDlsJacFn; -typedef CVLsJacFnB CVDlsJacFnB; -typedef CVLsJacFnBS CVDlsJacFnBS; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in cvodes_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFn instead") -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJacEvals instead") -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVDlsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVDlsGetReturnFlagName(long int flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolverB instead") -int CVDlsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS, SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFnB instead") -int CVDlsSetJacFnB(void *cvode_mem, int which, CVDlsJacFnB jacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacFnBS instead") -int CVDlsSetJacFnBS(void *cvode_mem, int which, CVDlsJacFnBS jacBS); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/cvodes/cvodes_spils.h b/include/cvodes/cvodes_spils.h deleted file mode 100644 index 76b986d880..0000000000 --- a/include/cvodes/cvodes_spils.h +++ /dev/null @@ -1,127 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODES; these routines now just wrap - * the updated CVODES generic linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _CVSSPILS_H -#define _CVSSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in cvodes_ls.h) - ===============================================================*/ - -typedef CVLsPrecSetupFn CVSpilsPrecSetupFn; -typedef CVLsPrecSolveFn CVSpilsPrecSolveFn; -typedef CVLsJacTimesSetupFn CVSpilsJacTimesSetupFn; -typedef CVLsJacTimesVecFn CVSpilsJacTimesVecFn; -typedef CVLsPrecSetupFnB CVSpilsPrecSetupFnB; -typedef CVLsPrecSetupFnBS CVSpilsPrecSetupFnBS; -typedef CVLsPrecSolveFnB CVSpilsPrecSolveFnB; -typedef CVLsPrecSolveFnBS CVSpilsPrecSolveFnBS; -typedef CVLsJacTimesSetupFnB CVSpilsJacTimesSetupFnB; -typedef CVLsJacTimesSetupFnBS CVSpilsJacTimesSetupFnBS; -typedef CVLsJacTimesVecFnB CVSpilsJacTimesVecFnB; -typedef CVLsJacTimesVecFnBS CVSpilsJacTimesVecFnBS; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in cvodes_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolver instead") -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetEpsLin instead") -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditioner instead") -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, - CVSpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimes instead") -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, - CVSpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinWorkSpace instead") -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecEvals instead") -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumPrecSolves instead") -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinIters instead") -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumConvFails instead") -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJTSetupEvals instead") -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumJtimesEvals instead") -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetNumLinRhsEvals instead") -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLastLinFlag instead") -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeGetLinReturnFlagName instead") -char *CVSpilsGetReturnFlagName(long int flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetLinearSolverB instead") -int CVSpilsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetEpsLinB instead") -int CVSpilsSetEpsLinB(void *cvode_mem, int which, realtype eplifacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditionerB instead") -int CVSpilsSetPreconditionerB(void *cvode_mem, int which, - CVSpilsPrecSetupFnB psetB, - CVSpilsPrecSolveFnB psolveB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetPreconditionerBS instead") -int CVSpilsSetPreconditionerBS(void *cvode_mem, int which, - CVSpilsPrecSetupFnBS psetBS, - CVSpilsPrecSolveFnBS psolveBS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimesB instead") -int CVSpilsSetJacTimesB(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnB jtsetupB, - CVSpilsJacTimesVecFnB jtimesB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use CVodeSetJacTimesBS instead") -int CVSpilsSetJacTimesBS(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnBS jtsetupBS, - CVSpilsJacTimesVecFnBS jtimesBS); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/ida/ida_direct.h b/include/ida/ida_direct.h deleted file mode 100644 index e45fc3018c..0000000000 --- a/include/ida/ida_direct.h +++ /dev/null @@ -1,68 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in ida_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDADLS_H -#define _IDADLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in ida_ls.h) - =================================================================*/ - -typedef IDALsJacFn IDADlsJacFn; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in ida_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFn instead") -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJacEvals instead") -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDADlsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDADlsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDADlsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/ida/ida_spils.h b/include/ida/ida_spils.h deleted file mode 100644 index 2d40789ac2..0000000000 --- a/include/ida/ida_spils.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Alan Hindmarsh, Radu Serban and Aaron Collier @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in IDA; these routines now just wrap - * the updated IDA generic linear solver interface in ida_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDASPILS_H -#define _IDASPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in ida_ls.h) - ===============================================================*/ - -typedef IDALsPrecSetupFn IDASpilsPrecSetupFn; -typedef IDALsPrecSolveFn IDASpilsPrecSolveFn; -typedef IDALsJacTimesSetupFn IDASpilsJacTimesSetupFn; -typedef IDALsJacTimesVecFn IDASpilsJacTimesVecFn; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in ida_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditioner instead") -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimes instead") -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetEpsLin instead") -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetIncrementFactor instead") -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecEvals instead") -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecSolves instead") -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinIters instead") -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinConvFails instead") -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJTSetupEvals instead") -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJtimesEvals instead") -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDASpilsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDASpilsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/idas/idas_direct.h b/include/idas/idas_direct.h deleted file mode 100644 index 7fc6f47cf2..0000000000 --- a/include/idas/idas_direct.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in idas_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDADLS_H -#define _IDADLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in ida_ls.h) - =================================================================*/ - -typedef IDALsJacFn IDADlsJacFn; -typedef IDALsJacFnB IDADlsJacFnB; -typedef IDALsJacFnBS IDADlsJacFnBS; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in idas_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, - SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFn instead") -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJacEvals instead") -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDADlsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDADlsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDADlsGetReturnFlagName(long int flag); - - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolverB instead") -int IDADlsSetLinearSolverB(void *ida_mem, int which, - SUNLinearSolver LS, SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFnB instead") -int IDADlsSetJacFnB(void *ida_mem, int which, IDADlsJacFnB jacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacFnBS instead") -int IDADlsSetJacFnBS(void *ida_mem, int which, IDADlsJacFnBS jacBS); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/idas/idas_spils.h b/include/idas/idas_spils.h deleted file mode 100644 index 9ea7b01749..0000000000 --- a/include/idas/idas_spils.h +++ /dev/null @@ -1,131 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in IDAS; these routines now just wrap - * the updated IDA generic linear solver interface in idas_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _IDASSPILS_H -#define _IDASSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in idas_ls.h) - ===============================================================*/ - -typedef IDALsPrecSetupFn IDASpilsPrecSetupFn; -typedef IDALsPrecSolveFn IDASpilsPrecSolveFn; -typedef IDALsJacTimesSetupFn IDASpilsJacTimesSetupFn; -typedef IDALsJacTimesVecFn IDASpilsJacTimesVecFn; -typedef IDALsPrecSetupFnB IDASpilsPrecSetupFnB; -typedef IDALsPrecSetupFnBS IDASpilsPrecSetupFnBS; -typedef IDALsPrecSolveFnB IDASpilsPrecSolveFnB; -typedef IDALsPrecSolveFnBS IDASpilsPrecSolveFnBS; -typedef IDALsJacTimesSetupFnB IDASpilsJacTimesSetupFnB; -typedef IDALsJacTimesSetupFnBS IDASpilsJacTimesSetupFnBS; -typedef IDALsJacTimesVecFnB IDASpilsJacTimesVecFnB; -typedef IDALsJacTimesVecFnBS IDASpilsJacTimesVecFnBS; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in idas_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolver instead") -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditioner instead") -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimes instead") -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetEpsLin instead") -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetIncrementFactor instead") -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinWorkSpace instead") -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecEvals instead") -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumPrecSolves instead") -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinIters instead") -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinConvFails instead") -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJTSetupEvals instead") -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumJtimesEvals instead") -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetNumLinResEvals instead") -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLastLinFlag instead") -int IDASpilsGetLastFlag(void *ida_mem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDAGetLinReturnFlagName instead") -char *IDASpilsGetReturnFlagName(long int flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetLinearSolverB instead") -int IDASpilsSetLinearSolverB(void *ida_mem, int which, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetEpsLinB instead") -int IDASpilsSetEpsLinB(void *ida_mem, int which, realtype eplifacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetIncrementFactorB instead") -int IDASpilsSetIncrementFactorB(void *ida_mem, int which, realtype dqincfacB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditionerB instead") -int IDASpilsSetPreconditionerB(void *ida_mem, int which, - IDASpilsPrecSetupFnB psetB, - IDASpilsPrecSolveFnB psolveB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetPreconditionerBS instead") -int IDASpilsSetPreconditionerBS(void *ida_mem, int which, - IDASpilsPrecSetupFnBS psetBS, - IDASpilsPrecSolveFnBS psolveBS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimesB instead") -int IDASpilsSetJacTimesB(void *ida_mem, int which, - IDASpilsJacTimesSetupFnB jtsetupB, - IDASpilsJacTimesVecFnB jtimesB); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use IDASetJacTimesBS instead") -int IDASpilsSetJacTimesBS(void *ida_mem, int which, - IDASpilsJacTimesSetupFnBS jtsetupBS, - IDASpilsJacTimesVecFnBS jtimesBS); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/kinsol/kinsol_direct.h b/include/kinsol/kinsol_direct.h deleted file mode 100644 index bc5c1c6307..0000000000 --- a/include/kinsol/kinsol_direct.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * KINSOL; these routines now just wrap the updated KINSOL generic - * linear solver interface in kinsol_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _KINDLS_H -#define _KINDLS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*================================================================= - Function Types (typedefs for equivalent types in kinsol_ls.h) - =================================================================*/ - -typedef KINLsJacFn KINDlsJacFn; - -/*=================================================================== - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - ===================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetLinearSolver instead") -int KINDlsSetLinearSolver(void *kinmem, SUNLinearSolver LS, SUNMatrix A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetJacFn instead") -int KINDlsSetJacFn(void *kinmem, KINDlsJacFn jac); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinWorkSpace instead") -int KINDlsGetWorkSpace(void *kinmem, long int *lenrw, long int *leniw); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumJacEvals instead") -int KINDlsGetNumJacEvals(void *kinmem, long int *njevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinFuncEvals instead") -int KINDlsGetNumFuncEvals(void *kinmem, long int *nfevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLastLinFlag instead") -int KINDlsGetLastFlag(void *kinmem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinReturnFlagName instead") -char *KINDlsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/kinsol/kinsol_spils.h b/include/kinsol/kinsol_spils.h deleted file mode 100644 index 075ff106ea..0000000000 --- a/include/kinsol/kinsol_spils.h +++ /dev/null @@ -1,85 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Scott Cohen, Alan Hindmarsh, Radu Serban, - * and Aaron Collier @ LLNL - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled Preconditioned Iterative - * Linear Solver interface in KINSOL; these routines now just wrap - * the updated KINSOL generic linear solver interface in kinsol_ls.h. - * -----------------------------------------------------------------*/ - -#ifndef _KINSPILS_H -#define _KINSPILS_H - -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - - -/*=============================================================== - Function Types (typedefs for equivalent types in kinsol_ls.h) - ===============================================================*/ - -typedef KINLsPrecSetupFn KINSpilsPrecSetupFn; -typedef KINLsPrecSolveFn KINSpilsPrecSolveFn; -typedef KINLsJacTimesVecFn KINSpilsJacTimesVecFn; - -/*==================================================================== - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - ====================================================================*/ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetLinearSolver instead") -int KINSpilsSetLinearSolver(void *kinmem, SUNLinearSolver LS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetPreconditioner instead") -int KINSpilsSetPreconditioner(void *kinmem, KINSpilsPrecSetupFn psetup, - KINSpilsPrecSolveFn psolve); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINSetJacTimesVecFn instead") -int KINSpilsSetJacTimesVecFn(void *kinmem, KINSpilsJacTimesVecFn jtv); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinWorkSpace instead") -int KINSpilsGetWorkSpace(void *kinmem, long int *lenrwLS, long int *leniwLS); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumPrecEvals instead") -int KINSpilsGetNumPrecEvals(void *kinmem, long int *npevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumPrecSolves instead") -int KINSpilsGetNumPrecSolves(void *kinmem, long int *npsolves); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinIters instead") -int KINSpilsGetNumLinIters(void *kinmem, long int *nliters); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinConvFails instead") -int KINSpilsGetNumConvFails(void *kinmem, long int *nlcfails); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumJtimesEvals instead") -int KINSpilsGetNumJtimesEvals(void *kinmem, long int *njvevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetNumLinFuncEvals instead") -int KINSpilsGetNumFuncEvals(void *kinmem, long int *nfevals); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLastLinFlag instead") -int KINSpilsGetLastFlag(void *kinmem, long int *flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use KINGetLinReturnFlagName instead") -char *KINSpilsGetReturnFlagName(long int flag); - - -#ifdef __cplusplus -} -#endif - -#endif From 106901b43d2553dd733aeb7767592df8afdede55 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 09:09:12 -0700 Subject: [PATCH 25/85] remove kinsol deprecated code --- include/kinsol/kinsol.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index 7d8c7da50d..196b708def 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -139,11 +139,7 @@ SUNDIALS_EXPORT int KINSetErrHandlerFn(void *kinmem, KINErrHandlerFn ehfun, SUNDIALS_EXPORT int KINSetErrFile(void *kinmem, FILE *errfp); SUNDIALS_EXPORT int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, void *ih_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -SUNDIALS_EXPORT int KINSetInfoFile(void *kinmem, FILE *infofp); SUNDIALS_EXPORT int KINSetPrintLevel(void *kinmem, int printfl); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetDebugFilename instead") -int KINSetDebugFile(void *kinmem, FILE *debugfp); /* Optional output functions */ From 5934bf2325d281395269725020ad0e358039b737 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:12:47 -0700 Subject: [PATCH 26/85] more changes for the removal of spils and direct --- .../serial/cvsRoberts_ASAi_dns_constraints.c | 1 - examples/sunlinsol/test_sunlinsol.h | 4 +- include/sundials/sundials_band.h | 43 --- include/sundials/sundials_dense.h | 48 ---- include/sundials/sundials_direct.h | 70 +---- include/sundials/sundials_iterative.h | 30 -- include/sundials/sundials_lapack.h | 258 ------------------ src/cvode/CMakeLists.txt | 4 - src/cvode/cvode_direct.c | 54 ---- src/cvode/cvode_spils.c | 76 ------ src/cvodes/CMakeLists.txt | 4 - src/cvodes/cvodes_direct.c | 65 ----- src/cvodes/cvodes_spils.c | 107 -------- src/ida/CMakeLists.txt | 4 - src/ida/ida_direct.c | 56 ---- src/ida/ida_spils.c | 81 ------ src/idas/CMakeLists.txt | 4 - src/idas/idas_direct.c | 66 ----- src/idas/idas_spils.c | 114 -------- src/kinsol/CMakeLists.txt | 3 - src/kinsol/kinsol_direct.c | 55 ---- src/kinsol/kinsol_spils.c | 73 ----- 22 files changed, 4 insertions(+), 1216 deletions(-) delete mode 100644 include/sundials/sundials_lapack.h delete mode 100644 src/cvode/cvode_direct.c delete mode 100644 src/cvode/cvode_spils.c delete mode 100644 src/cvodes/cvodes_direct.c delete mode 100644 src/cvodes/cvodes_spils.c delete mode 100644 src/ida/ida_direct.c delete mode 100644 src/ida/ida_spils.c delete mode 100644 src/idas/idas_direct.c delete mode 100644 src/idas/idas_spils.c delete mode 100644 src/kinsol/kinsol_direct.c delete mode 100644 src/kinsol/kinsol_spils.c diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c index 79c9d8038f..21538d367d 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c @@ -61,7 +61,6 @@ #include /* access to serial N_Vector */ #include /* access to dense SUNMatrix */ #include /* access to dense SUNLinearSolver */ -#include /* access to CVDls interface */ #include /* defs. of realtype, sunindextype */ #include /* defs. of SUNRabs, SUNRexp, etc. */ diff --git a/examples/sunlinsol/test_sunlinsol.h b/examples/sunlinsol/test_sunlinsol.h index d816f613de..7ae8aa000c 100644 --- a/examples/sunlinsol/test_sunlinsol.h +++ b/examples/sunlinsol/test_sunlinsol.h @@ -38,8 +38,8 @@ int Test_SUNLinSolSpace(SUNLinearSolver S, int myid); int Test_SUNLinSolNumIters(SUNLinearSolver S, int myid); int Test_SUNLinSolResNorm(SUNLinearSolver S, int myid); int Test_SUNLinSolResid(SUNLinearSolver S, int myid); -int Test_SUNLinSolSetATimes(SUNLinearSolver S, void* ATdata, ATimesFn ATimes, int myid); -int Test_SUNLinSolSetPreconditioner(SUNLinearSolver S, void* Pdata, PSetupFn PSetup, PSolveFn PSolve, int myid); +int Test_SUNLinSolSetATimes(SUNLinearSolver S, void* ATdata, SUNATimesFn ATimes, int myid); +int Test_SUNLinSolSetPreconditioner(SUNLinearSolver S, void* Pdata, SUNPSetupFn PSetup, SUNPSolveFn PSolve, int myid); int Test_SUNLinSolSetScalingVectors(SUNLinearSolver S, N_Vector s1, N_Vector s2, int myid); int Test_SUNLinSolSetZeroGuess(SUNLinearSolver S, int myid); int Test_SUNLinSolInitialize(SUNLinearSolver S, int myid); diff --git a/include/sundials/sundials_band.h b/include/sundials/sundials_band.h index 47ef42a4cf..9c306de2c1 100644 --- a/include/sundials/sundials_band.h +++ b/include/sundials/sundials_band.h @@ -79,19 +79,11 @@ extern "C" { SUNDIALS_EXPORT sunindextype SUNDlsMat_BandGBTRF(SUNDlsMat A, sunindextype* p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandGBTRF instead") -sunindextype BandGBTRF(DlsMat A, sunindextype *p); - SUNDIALS_EXPORT sunindextype SUNDlsMat_bandGBTRF(realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandGBTRF instead") -sunindextype bandGBTRF(realtype **a, sunindextype n, - sunindextype mu, sunindextype ml, - sunindextype smu, sunindextype *p); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_BandGBTRS @@ -113,17 +105,10 @@ sunindextype bandGBTRF(realtype **a, sunindextype n, SUNDIALS_EXPORT void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandGBTRS instead") -void BandGBTRS(DlsMat A, sunindextype *p, realtype *b); - SUNDIALS_EXPORT void SUNDlsMat_bandGBTRS(realtype **a, sunindextype n, sunindextype smu, sunindextype ml, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandGBTRS instead") -void bandGBTRS(realtype **a, sunindextype n, sunindextype smu, - sunindextype ml, sunindextype *p, realtype *b); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_BandCopy @@ -143,21 +128,11 @@ void bandGBTRS(realtype **a, sunindextype n, sunindextype smu, SUNDIALS_EXPORT void SUNDlsMat_BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandCopy instead") -void BandCopy(DlsMat A, DlsMat B, sunindextype copymu, - sunindextype copyml); - SUNDIALS_EXPORT void SUNDlsMat_bandCopy(realtype **a, realtype **b, sunindextype n, sunindextype a_smu, sunindextype b_smu, sunindextype copymu, sunindextype copyml); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandCopy instead") -void bandCopy(realtype **a, realtype **b, sunindextype n, - sunindextype a_smu, sunindextype b_smu, - sunindextype copymu, sunindextype copyml); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_BandScale @@ -174,17 +149,10 @@ void bandCopy(realtype **a, realtype **b, sunindextype n, void SUNDlsMat_BandScale(realtype c, SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandScale instead") -void BandScale(realtype c, DlsMat A); - SUNDIALS_EXPORT void SUNDlsMat_bandScale(realtype c, realtype **a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandScale instead") -void bandScale(realtype c, realtype **a, sunindextype n, - sunindextype mu, sunindextype ml, sunindextype smu); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_bandAddIdentity @@ -196,9 +164,6 @@ void bandScale(realtype c, realtype **a, sunindextype n, void SUNDlsMat_bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandAddIdentity instead") -void bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); - /* * ----------------------------------------------------------------- @@ -218,19 +183,11 @@ void bandAddIdentity(realtype **a, sunindextype n, sunindextype smu); SUNDIALS_EXPORT void SUNDlsMat_BandMatvec(SUNDlsMat A, realtype *x, realtype *y); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_BandMatvec instead") -void BandMatvec(DlsMat A, realtype *x, realtype *y); - SUNDIALS_EXPORT void SUNDlsMat_bandMatvec(realtype **a, realtype *x, realtype *y, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_bandMatvec instead") -void bandMatvec(realtype **a, realtype *x, realtype *y, - sunindextype n, sunindextype mu, - sunindextype ml, sunindextype smu); - #ifdef __cplusplus } #endif diff --git a/include/sundials/sundials_dense.h b/include/sundials/sundials_dense.h index 2ba052c968..201580cad4 100644 --- a/include/sundials/sundials_dense.h +++ b/include/sundials/sundials_dense.h @@ -71,27 +71,17 @@ extern "C" { SUNDIALS_EXPORT sunindextype SUNDlsMat_DenseGETRF(SUNDlsMat A, sunindextype *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseGETRF instead") -sunindextype DenseGETRF(DlsMat A, sunindextype *p); SUNDIALS_EXPORT void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseGETRS instead") -void DenseGETRS(DlsMat A, sunindextype *p, realtype *b); SUNDIALS_EXPORT sunindextype SUNDlsMat_denseGETRF(realtype **a, sunindextype m, sunindextype n, sunindextype *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseGETRF instead") -sunindextype denseGETRF(realtype **a, sunindextype m, - sunindextype n, sunindextype *p); SUNDIALS_EXPORT void SUNDlsMat_denseGETRS(realtype **a, sunindextype n, sunindextype *p, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseGETRS instead") -void denseGETRS(realtype **a, sunindextype n, sunindextype *p, - realtype *b); /* * ---------------------------------------------------------------------------- @@ -114,23 +104,15 @@ void denseGETRS(realtype **a, sunindextype n, sunindextype *p, SUNDIALS_EXPORT sunindextype SUNDlsMat_DensePOTRF(SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DensePOTRF instead") -sunindextype DensePOTRF(DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_DensePOTRS(SUNDlsMat A, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DensePOTRS instead") -void DensePOTRS(DlsMat A, realtype *b); SUNDIALS_EXPORT sunindextype SUNDlsMat_densePOTRF(realtype **a, sunindextype m); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_densePOTRF instead") -sunindextype densePOTRF(realtype **a, sunindextype m); SUNDIALS_EXPORT void SUNDlsMat_densePOTRS(realtype **a, sunindextype m, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_densePOTRS instead") -void densePOTRS(realtype **a, sunindextype m, realtype *b); /* * ----------------------------------------------------------------------------- @@ -160,32 +142,20 @@ void densePOTRS(realtype **a, sunindextype m, realtype *b); SUNDIALS_EXPORT int SUNDlsMat_DenseGEQRF(SUNDlsMat A, realtype *beta, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseGEQRF instead") -int DenseGEQRF(DlsMat A, realtype *beta, realtype *wrk); SUNDIALS_EXPORT int SUNDlsMat_DenseORMQR(SUNDlsMat A, realtype *beta, realtype *vn, realtype *vm, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseORMQR instead") -int DenseORMQR(DlsMat A, realtype *beta, realtype *vn, - realtype *vm, realtype *wrk); SUNDIALS_EXPORT int SUNDlsMat_denseGEQRF(realtype **a, sunindextype m, sunindextype n, realtype *beta, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseGEQRF instead") -int denseGEQRF(realtype **a, sunindextype m, sunindextype n, - realtype *beta, realtype *wrk); SUNDIALS_EXPORT int SUNDlsMat_denseORMQR(realtype **a, sunindextype m, sunindextype n, realtype *beta, realtype *v, realtype *w, realtype *wrk); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseORMQR instead") -int denseORMQR(realtype **a, sunindextype m, sunindextype n, - realtype *beta, realtype *v, realtype *w, - realtype *wrk); /* * ---------------------------------------------------------------------------- @@ -201,15 +171,10 @@ int denseORMQR(realtype **a, sunindextype m, sunindextype n, SUNDIALS_EXPORT void SUNDlsMat_DenseCopy(SUNDlsMat A, SUNDlsMat B); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseCopy instead") -void DenseCopy(DlsMat A, DlsMat B); SUNDIALS_EXPORT void SUNDlsMat_denseCopy(realtype **a, realtype **b, sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseCopy instead") -void denseCopy(realtype **a, realtype **b, sunindextype m, - sunindextype n); /* * ----------------------------------------------------------------------------- @@ -226,16 +191,10 @@ void denseCopy(realtype **a, realtype **b, sunindextype m, SUNDIALS_EXPORT void SUNDlsMat_DenseScale(realtype c, SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsSUNDlsMat_DenseScale_denseCopy instead") -void DenseScale(realtype c, DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_denseScale(realtype c, realtype **a, sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseScale instead") -void denseScale(realtype c, realtype **a, sunindextype m, - sunindextype n); - /* * ----------------------------------------------------------------------------- @@ -248,8 +207,6 @@ void denseScale(realtype c, realtype **a, sunindextype m, SUNDIALS_EXPORT void SUNDlsMat_denseAddIdentity(realtype **a, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseAddIdentity instead") -void denseAddIdentity(realtype **a, sunindextype n); /* @@ -268,15 +225,10 @@ void denseAddIdentity(realtype **a, sunindextype n); SUNDIALS_EXPORT void SUNDlsMat_DenseMatvec(SUNDlsMat A, realtype *x, realtype *y); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DenseMatvec instead") -void DenseMatvec(DlsMat A, realtype *x, realtype *y); SUNDIALS_EXPORT void SUNDlsMat_denseMatvec(realtype **a, realtype *x, realtype *y, sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_denseMatvec instead") -void denseMatvec(realtype **a, realtype *x, realtype *y, - sunindextype m, sunindextype n); #ifdef __cplusplus diff --git a/include/sundials/sundials_direct.h b/include/sundials/sundials_direct.h index b33c718032..b73ffeae7e 100644 --- a/include/sundials/sundials_direct.h +++ b/include/sundials/sundials_direct.h @@ -125,9 +125,8 @@ typedef struct _DlsMat { realtype *data; sunindextype ldata; realtype **cols; -} *SUNDlsMat; /* DEPRECATED DlsMat: use SUNDlsMat instead */ +} *SUNDlsMat; -typedef SUNDlsMat DlsMat; /* * ================================================================== @@ -155,11 +154,6 @@ typedef SUNDlsMat DlsMat; #define SUNDLS_DENSE_COL(A,j) ((A->cols)[j]) #define SUNDLS_DENSE_ELEM(A,i,j) ((A->cols)[j][i]) -/* DEPRECATED DENSE_COL: use SUNDLS_DENSE_COL instead */ -#define DENSE_COL(A,j) SUNDLS_DENSE_COL(A,j) -/* DEPRECATED DENSE_ELEM: use SUNDLS_DENSE_ELEM instead */ -#define DENSE_ELEM(A,i,j) SUNDLS_DENSE_ELEM(A,i,j) - /* * ----------------------------------------------------------------- * SUNDLS_BAND_COL, SUNDLS_BAND_COL_ELEM, and SUNDLS_BAND_ELEM @@ -185,14 +179,6 @@ typedef SUNDlsMat DlsMat; #define SUNDLS_BAND_COL(A,j) (((A->cols)[j])+(A->s_mu)) #define SUNDLS_BAND_COL_ELEM(col_j,i,j) (col_j[(i)-(j)]) #define SUNDLS_BAND_ELEM(A,i,j) ((A->cols)[j][(i)-(j)+(A->s_mu)]) - -/* DEPRECATED BAND_COL: use SUNDLS_BAND_COL */ -#define BAND_COL(A,j) SUNDLS_BAND_COL(A,j) -/* DEPRECATED BAND_COL_ELEM: use SUNDLS_BAND_COL_ELEM */ -#define BAND_COL_ELEM(col_j,i,j) SUNDLS_BAND_COL_ELEM(col_j,i,j) -/* DEPRECATED BAND_ELEM: use SUNDLS_BAND_ELEM */ -#define BAND_ELEM(A,i,j) SUNDLS_BAND_ELEM(A,i,j) - /* * ================================================================== * Exported function prototypes (functions working on SUNDlsMat) @@ -214,9 +200,6 @@ typedef SUNDlsMat DlsMat; SUNDIALS_EXPORT SUNDlsMat SUNDlsMat_NewDenseMat(sunindextype M, sunindextype N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewDenseMat instead") -DlsMat NewDenseMat(sunindextype M, sunindextype N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_NewBandMat @@ -241,10 +224,6 @@ SUNDIALS_EXPORT SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, sunindextype smu); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewBandMat instead") -DlsMat NewBandMat(sunindextype N, sunindextype mu, - sunindextype ml, sunindextype smu); - /* * ----------------------------------------------------------------- * Functions: SUNDlsMat_DestroyMat @@ -255,10 +234,7 @@ DlsMat NewBandMat(sunindextype N, sunindextype mu, */ SUNDIALS_EXPORT -void SUNDlsMat_DestroyMat(DlsMat A); - -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DestroyMat instead") -void DestroyMat(DlsMat A); +void SUNDlsMat_DestroyMat(SUNDlsMat A); /* * ----------------------------------------------------------------- @@ -273,9 +249,6 @@ void DestroyMat(DlsMat A); SUNDIALS_EXPORT int* SUNDlsMat_NewIntArray(int N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewIntArray instead") -int* NewIntArray(int N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_NewIndexArray @@ -290,9 +263,6 @@ int* NewIntArray(int N); SUNDIALS_EXPORT sunindextype* SUNDlsMat_NewIndexArray(sunindextype N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewIndexArray instead") -sunindextype* NewIndexArray(sunindextype N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_NewRealArray @@ -306,9 +276,6 @@ sunindextype* NewIndexArray(sunindextype N); SUNDIALS_EXPORT realtype* SUNDlsMat_NewRealArray(sunindextype N); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_NewRealArray instead") -realtype* NewRealArray(sunindextype N); - /* * ----------------------------------------------------------------- * Function: SUNDlsMat_DestroyArray @@ -322,9 +289,6 @@ realtype* NewRealArray(sunindextype N); SUNDIALS_EXPORT void SUNDlsMat_DestroyArray(void *p); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_DestroyArray instead") -void DestroyArray(void *p); - /* * ----------------------------------------------------------------- * Function : SUNDlsMat_AddIdentity @@ -340,9 +304,6 @@ void DestroyArray(void *p); SUNDIALS_EXPORT void SUNDlsMat_AddIdentity(SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_AddIdentity instead") -void AddIdentity(DlsMat A); - /* * ----------------------------------------------------------------- * Function : SUNDlsMat_SetToZero @@ -355,9 +316,6 @@ void AddIdentity(DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_SetToZero(SUNDlsMat A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_SetToZero instead") -void SetToZero(DlsMat A); - /* * ----------------------------------------------------------------- * Functions: SUNDlsMat_PrintMat @@ -373,9 +331,6 @@ void SetToZero(DlsMat A); SUNDIALS_EXPORT void SUNDlsMat_PrintMat(SUNDlsMat A, FILE *outfile); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_PrintMat") -void PrintMat(DlsMat A, FILE *outfile); - /* * ================================================================== * Exported function prototypes (functions working on realtype**) @@ -385,47 +340,26 @@ void PrintMat(DlsMat A, FILE *outfile); SUNDIALS_EXPORT realtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newDenseMat instead") -realtype** newDenseMat(sunindextype m, sunindextype n); - SUNDIALS_EXPORT realtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, sunindextype ml); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newBandMat instead") -realtype** newBandMat(sunindextype n, sunindextype smu, - sunindextype ml); SUNDIALS_EXPORT void SUNDlsMat_destroyMat(realtype** a); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_destroyMat instead") -void destroyMat(realtype** a); - SUNDIALS_EXPORT int* SUNDlsMat_newIntArray(int n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newIntArray instead") -int* newIntArray(int n); - SUNDIALS_EXPORT sunindextype* SUNDlsMat_newIndexArray(sunindextype n); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newIndexArray instead") -sunindextype* newIndexArray(sunindextype n); - SUNDIALS_EXPORT realtype* SUNDlsMat_newRealArray(sunindextype m); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_newRealArray instead") - realtype* newRealArray(sunindextype m); - SUNDIALS_EXPORT void SUNDlsMat_destroyArray(void* v); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNDlsMat_destroyArray instead") -void destroyArray(void* v); - #ifdef __cplusplus } diff --git a/include/sundials/sundials_iterative.h b/include/sundials/sundials_iterative.h index 80cf17ab75..ba909df174 100644 --- a/include/sundials/sundials_iterative.h +++ b/include/sundials/sundials_iterative.h @@ -51,11 +51,6 @@ extern "C" { * ----------------------------------------------------------------- */ -/* DEPRECATED PREC_NONE: use SUN_PREC_NONE */ -/* DEPRECATED PREC_LEFT: use SUN_PREC_LEFT */ -/* DEPRECATED PREC_RIGHT: use SUN_PREC_RIGHT */ -/* DEPRECATED PREC_BOTH: use SUN_PREC_BOTH */ -enum { PREC_NONE, PREC_LEFT, PREC_RIGHT, PREC_BOTH }; enum { SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH }; /* @@ -72,9 +67,6 @@ enum { SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH }; * ----------------------------------------------------------------- */ -/* DEPRECATED MODIFIED_GS: use SUN_MODIFIED_GS */ -/* DEPRECATED CLASSICAL_GS: use SUN_CLASSICAL_GS */ -enum { MODIFIED_GS = 1, CLASSICAL_GS = 2 }; enum { SUN_MODIFIED_GS = 1, SUN_CLASSICAL_GS = 2 }; /* @@ -90,8 +82,6 @@ enum { SUN_MODIFIED_GS = 1, SUN_CLASSICAL_GS = 2 }; * ----------------------------------------------------------------- */ -/* DEPRECATED ATimesFn: use SUNATimesFn */ -typedef int (*ATimesFn)(void *A_data, N_Vector v, N_Vector z); typedef int (*SUNATimesFn)(void *A_data, N_Vector v, N_Vector z); /* @@ -104,8 +94,6 @@ typedef int (*SUNATimesFn)(void *A_data, N_Vector v, N_Vector z); * ----------------------------------------------------------------- */ -/* DEPRECATED PSetupFn: use SUNPSetupFn */ -typedef int (*PSetupFn)(void *P_data); typedef int (*SUNPSetupFn)(void *P_data); /* @@ -134,9 +122,6 @@ typedef int (*SUNPSetupFn)(void *P_data); * ----------------------------------------------------------------- */ -/* DEPRECATED PSolveFn: use SUNPSolveFn */ -typedef int (*PSolveFn)(void *P_data, N_Vector r, N_Vector z, - realtype tol, int lr); typedef int (*SUNPSolveFn)(void *P_data, N_Vector r, N_Vector z, realtype tol, int lr); @@ -207,10 +192,6 @@ SUNDIALS_EXPORT int SUNModifiedGS(N_Vector* v, realtype **h, int k, int p, realtype *new_vk_norm); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNModifiedGS instead") -int ModifiedGS(N_Vector* v, realtype **h, int k, int p, - realtype *new_vk_norm); - /* * ----------------------------------------------------------------- * Function: SUNClassicalGS @@ -236,11 +217,6 @@ int SUNClassicalGS(N_Vector* v, realtype **h, int k, int p, realtype *new_vk_norm, realtype *stemp, N_Vector* vtemp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNClassicalGS instead") -int ClassicalGS(N_Vector* v, realtype **h, int k, int p, - realtype *new_vk_norm, realtype *stemp, - N_Vector* vtemp); - /* * ----------------------------------------------------------------- * Function: SUNQRfact @@ -276,9 +252,6 @@ int ClassicalGS(N_Vector* v, realtype **h, int k, int p, SUNDIALS_EXPORT int SUNQRfact(int n, realtype **h, realtype *q, int job); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNQRFact instead") -int QRfact(int n, realtype **h, realtype *q, int job); - /* * ----------------------------------------------------------------- * Function: SUNQRsol @@ -314,9 +287,6 @@ int QRfact(int n, realtype **h, realtype *q, int job); SUNDIALS_EXPORT int SUNQRsol(int n, realtype **h, realtype *q, realtype *b); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNQRsol instead") -int QRsol(int n, realtype **h, realtype *q, realtype *b); - /* * ----------------------------------------------------------------- * Function: SUNQRAdd_MGS diff --git a/include/sundials/sundials_lapack.h b/include/sundials/sundials_lapack.h deleted file mode 100644 index b7e6ef0cd4..0000000000 --- a/include/sundials/sundials_lapack.h +++ /dev/null @@ -1,258 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer: Radu Serban @ LLNL - * Daniel Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 a generic package of direct matrix - * operations for use with BLAS/LAPACK. - * -----------------------------------------------------------------*/ - -#ifndef _SUNDIALS_LAPACK_H -#define _SUNDIALS_LAPACK_H - -#include - -#warning "This header file is deprecated and will be removed in SUNDIALS v7.0.0" - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/* - * ================================================================== - * Blas and Lapack functions - * ================================================================== - */ - -#if defined(SUNDIALS_F77_FUNC) - -#define dcopy_f77 SUNDIALS_F77_FUNC(dcopy, DCOPY) -#define dscal_f77 SUNDIALS_F77_FUNC(dscal, DSCAL) -#define dgemv_f77 SUNDIALS_F77_FUNC(dgemv, DGEMV) -#define dtrsv_f77 SUNDIALS_F77_FUNC(dtrsv, DTRSV) -#define dsyrk_f77 SUNDIALS_F77_FUNC(dsyrk, DSKYR) - -#define dgbtrf_f77 SUNDIALS_F77_FUNC(dgbtrf, DGBTRF) -#define dgbtrs_f77 SUNDIALS_F77_FUNC(dgbtrs, DGBTRS) -#define dgetrf_f77 SUNDIALS_F77_FUNC(dgetrf, DGETRF) -#define dgetrs_f77 SUNDIALS_F77_FUNC(dgetrs, DGETRS) -#define dgeqp3_f77 SUNDIALS_F77_FUNC(dgeqp3, DGEQP3) -#define dgeqrf_f77 SUNDIALS_F77_FUNC(dgeqrf, DGEQRF) -#define dormqr_f77 SUNDIALS_F77_FUNC(dormqr, DORMQR) -#define dpotrf_f77 SUNDIALS_F77_FUNC(dpotrf, DPOTRF) -#define dpotrs_f77 SUNDIALS_F77_FUNC(dpotrs, DPOTRS) - -#define scopy_f77 SUNDIALS_F77_FUNC(scopy, SCOPY) -#define sscal_f77 SUNDIALS_F77_FUNC(sscal, SSCAL) -#define sgemv_f77 SUNDIALS_F77_FUNC(sgemv, SGEMV) -#define strsv_f77 SUNDIALS_F77_FUNC(strsv, STRSV) -#define ssyrk_f77 SUNDIALS_F77_FUNC(ssyrk, SSKYR) - -#define sgbtrf_f77 SUNDIALS_F77_FUNC(sgbtrf, SGBTRF) -#define sgbtrs_f77 SUNDIALS_F77_FUNC(sgbtrs, SGBTRS) -#define sgetrf_f77 SUNDIALS_F77_FUNC(sgetrf, SGETRF) -#define sgetrs_f77 SUNDIALS_F77_FUNC(sgetrs, SGETRS) -#define sgeqp3_f77 SUNDIALS_F77_FUNC(sgeqp3, SGEQP3) -#define sgeqrf_f77 SUNDIALS_F77_FUNC(sgeqrf, SGEQRF) -#define sormqr_f77 SUNDIALS_F77_FUNC(sormqr, SORMQR) -#define spotrf_f77 SUNDIALS_F77_FUNC(spotrf, SPOTRF) -#define spotrs_f77 SUNDIALS_F77_FUNC(spotrs, SPOTRS) - -#else - -#define dcopy_f77 dcopy_ -#define dscal_f77 dscal_ -#define dgemv_f77 dgemv_ -#define dtrsv_f77 dtrsv_ -#define dsyrk_f77 dsyrk_ - -#define dgbtrf_f77 dgbtrf_ -#define dgbtrs_f77 dgbtrs_ -#define dgeqp3_f77 dgeqp3_ -#define dgeqrf_f77 dgeqrf_ -#define dgetrf_f77 dgetrf_ -#define dgetrs_f77 dgetrs_ -#define dormqr_f77 dormqr_ -#define dpotrf_f77 dpotrf_ -#define dpotrs_f77 dpotrs_ - -#define scopy_f77 scopy_ -#define sscal_f77 sscal_ -#define sgemv_f77 sgemv_ -#define strsv_f77 strsv_ -#define ssyrk_f77 ssyrk_ - -#define sgbtrf_f77 sgbtrf_ -#define sgbtrs_f77 sgbtrs_ -#define sgeqp3_f77 sgeqp3_ -#define sgeqrf_f77 sgeqrf_ -#define sgetrf_f77 sgetrf_ -#define sgetrs_f77 sgetrs_ -#define sormqr_f77 sormqr_ -#define spotrf_f77 spotrf_ -#define spotrs_f77 spotrs_ - -#endif - -/* Level-1 BLAS */ - -extern void dcopy_f77(sunindextype *n, const double *x, - const sunindextype *inc_x, double *y, - const sunindextype *inc_y); - -extern void dscal_f77(sunindextype *n, const double *alpha, double *x, - const sunindextype *inc_x); - -extern void scopy_f77(sunindextype *n, const float *x, - const sunindextype *inc_x, float *y, - const sunindextype *inc_y); - -extern void sscal_f77(sunindextype *n, const float *alpha, float *x, - const sunindextype *inc_x); - -/* Level-2 BLAS */ - -extern void dgemv_f77(const char *trans, sunindextype *m, sunindextype *n, - const double *alpha, const double *a, sunindextype *lda, - const double *x, sunindextype *inc_x, const double *beta, - double *y, sunindextype *inc_y); - -extern void dtrsv_f77(const char *uplo, const char *trans, const char *diag, - const sunindextype *n, const double *a, - const sunindextype *lda, double *x, - const sunindextype *inc_x); - -extern void sgemv_f77(const char *trans, sunindextype *m, sunindextype *n, - const float *alpha, const float *a, sunindextype *lda, - const float *x, sunindextype *inc_x, const float *beta, - float *y, sunindextype *inc_y); - -extern void strsv_f77(const char *uplo, const char *trans, const char *diag, - const sunindextype *n, const float *a, - const sunindextype *lda, float *x, - const sunindextype *inc_x); - -/* Level-3 BLAS */ - -extern void dsyrk_f77(const char *uplo, const char *trans, - const sunindextype *n, const sunindextype *k, - const double *alpha, const double *a, - const sunindextype *lda, const double *beta, - const double *c, const sunindextype *ldc); - -extern void ssyrk_f77(const char *uplo, const char *trans, - const sunindextype *n, const sunindextype *k, - const float *alpha, const float *a, - const sunindextype *lda, const float *beta, - const float *c, const sunindextype *ldc); - -/* LAPACK */ - -extern void dgbtrf_f77(const sunindextype *m, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - double *ab, sunindextype *ldab, sunindextype *ipiv, - sunindextype *info); - -extern void dgbtrs_f77(const char *trans, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - const sunindextype *nrhs, double *ab, - const sunindextype *ldab, sunindextype *ipiv, - double *b, const sunindextype *ldb, sunindextype *info); - - -extern void dgeqp3_f77(const sunindextype *m, const sunindextype *n, double *a, - const sunindextype *lda, sunindextype *jpvt, double *tau, - double *work, const sunindextype *lwork, - sunindextype *info); - -extern void dgeqrf_f77(const sunindextype *m, const sunindextype *n, double *a, - const sunindextype *lda, double *tau, double *work, - const sunindextype *lwork, sunindextype *info); - -extern void dgetrf_f77(const sunindextype *m, const sunindextype *n, double *a, - sunindextype *lda, sunindextype *ipiv, - sunindextype *info); - -extern void dgetrs_f77(const char *trans, const sunindextype *n, - const sunindextype *nrhs, double *a, - const sunindextype *lda, sunindextype *ipiv, double *b, - const sunindextype *ldb, sunindextype *info); - - -extern void dormqr_f77(const char *side, const char *trans, - const sunindextype *m, const sunindextype *n, - const sunindextype *k, double *a, - const sunindextype *lda, double *tau, double *c, - const sunindextype *ldc, double *work, - const sunindextype *lwork, sunindextype *info); - -extern void dpotrf_f77(const char *uplo, const sunindextype *n, double *a, - sunindextype *lda, sunindextype *info); - -extern void dpotrs_f77(const char *uplo, const sunindextype *n, - const sunindextype *nrhs, double *a, - const sunindextype *lda, double *b, - const sunindextype *ldb, sunindextype *info); - - -extern void sgbtrf_f77(const sunindextype *m, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - float *ab, sunindextype *ldab, sunindextype *ipiv, - sunindextype *info); - -extern void sgbtrs_f77(const char *trans, const sunindextype *n, - const sunindextype *kl, const sunindextype *ku, - const sunindextype *nrhs, float *ab, - const sunindextype *ldab, sunindextype *ipiv, - float *b, const sunindextype *ldb, sunindextype *info); - - -extern void sgeqp3_f77(const sunindextype *m, const sunindextype *n, float *a, - const sunindextype *lda, sunindextype *jpvt, float *tau, - float *work, const sunindextype *lwork, - sunindextype *info); - -extern void sgeqrf_f77(const sunindextype *m, const sunindextype *n, float *a, - const sunindextype *lda, float *tau, float *work, - const sunindextype *lwork, sunindextype *info); - -extern void sgetrf_f77(const sunindextype *m, const sunindextype *n, float *a, - sunindextype *lda, sunindextype *ipiv, - sunindextype *info); - -extern void sgetrs_f77(const char *trans, const sunindextype *n, - const sunindextype *nrhs, float *a, - const sunindextype *lda, sunindextype *ipiv, - float *b, const sunindextype *ldb, sunindextype *info); - - -extern void sormqr_f77(const char *side, const char *trans, - const sunindextype *m, const sunindextype *n, - const sunindextype *k, float *a, const sunindextype *lda, - float *tau, float *c, const sunindextype *ldc, - float *work, const sunindextype *lwork, - sunindextype *info); - -extern void spotrf_f77(const char *uplo, const sunindextype *n, float *a, - sunindextype *lda, sunindextype *info); - -extern void spotrs_f77(const char *uplo, const sunindextype *n, - const sunindextype *nrhs, float *a, - const sunindextype *lda, float *b, - const sunindextype *ldb, sunindextype *info); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/cvode/CMakeLists.txt b/src/cvode/CMakeLists.txt index bcdbe0d513..ed1eb55dfe 100644 --- a/src/cvode/CMakeLists.txt +++ b/src/cvode/CMakeLists.txt @@ -23,12 +23,10 @@ set(cvode_SOURCES cvode_bandpre.c cvode_bbdpre.c cvode_diag.c - cvode_direct.c cvode_io.c cvode_ls.c cvode_nls.c cvode_proj.c - cvode_spils.c ) # Add variable cvode_HEADERS with the exported CVODE header files @@ -37,10 +35,8 @@ set(cvode_HEADERS cvode_bandpre.h cvode_bbdpre.h cvode_diag.h - cvode_direct.h cvode_ls.h cvode_proj.h - cvode_spils.h ) # Add prefix with complete path to the CVODE header files diff --git a/src/cvode/cvode_direct.c b/src/cvode/cvode_direct.c deleted file mode 100644 index ca7c25ec13..0000000000 --- a/src/cvode/cvode_direct.c +++ /dev/null @@ -1,54 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * CVODE; these routines now just wrap the updated CVODE generic - * linear solver interface in cvode_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in cvode_ls.h) - =================================================================*/ - -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, SUNMatrix A) -{ return(CVodeSetLinearSolver(cvode_mem, LS, A)); } - -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac) -{ return(CVodeSetJacFn(cvode_mem, jac)); } - -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals) -{ return(CVodeGetNumJacEvals(cvode_mem, njevals)); } - -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVDlsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVDlsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif diff --git a/src/cvode/cvode_spils.c b/src/cvode/cvode_spils.c deleted file mode 100644 index eebde519c5..0000000000 --- a/src/cvode/cvode_spils.c +++ /dev/null @@ -1,76 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Implementation file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODE; these routines now just wrap - * the updated CVODE generic linear solver interface in cvode_ls.h. - * -----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - CVSPILS Exported functions (wrappers for equivalent routines in - cvode_ls.h) - =================================================================*/ - -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS) -{ return(CVodeSetLinearSolver(cvode_mem, LS, NULL)); } - -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac) -{ return(CVodeSetEpsLin(cvode_mem, eplifac)); } - -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, CVSpilsPrecSolveFn psolve) -{ return(CVodeSetPreconditioner(cvode_mem, pset, psolve)); } - -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, CVSpilsJacTimesVecFn jtimes) -{ return(CVodeSetJacTimes(cvode_mem, jtsetup, jtimes)); } - -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals) -{ return(CVodeGetNumPrecEvals(cvode_mem, npevals)); } - -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves) -{ return(CVodeGetNumPrecSolves(cvode_mem, npsolves)); } - -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters) -{ return(CVodeGetNumLinIters(cvode_mem, nliters)); } - -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails) -{ return(CVodeGetNumLinConvFails(cvode_mem, nlcfails)); } - -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups) -{ return(CVodeGetNumJTSetupEvals(cvode_mem, njtsetups)); } - -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals) -{ return(CVodeGetNumJtimesEvals(cvode_mem, njvevals)); } - -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVSpilsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif diff --git a/src/cvodes/CMakeLists.txt b/src/cvodes/CMakeLists.txt index 480830056d..38cfc129a9 100644 --- a/src/cvodes/CMakeLists.txt +++ b/src/cvodes/CMakeLists.txt @@ -25,7 +25,6 @@ set(cvodes_SOURCES cvodes_bandpre.c cvodes_bbdpre.c cvodes_diag.c - cvodes_direct.c cvodes_io.c cvodes_ls.c cvodes_nls.c @@ -33,7 +32,6 @@ set(cvodes_SOURCES cvodes_nls_stg.c cvodes_nls_stg1.c cvodes_proj.c - cvodes_spils.c ) # Add variable cvodes_HEADERS with the exported CVODES header files @@ -42,10 +40,8 @@ set(cvodes_HEADERS cvodes_bandpre.h cvodes_bbdpre.h cvodes_diag.h - cvodes_direct.h cvodes_ls.h cvodes_proj.h - cvodes_spils.h ) # Add prefix with complete path to the CVODES header files diff --git a/src/cvodes/cvodes_direct.c b/src/cvodes/cvodes_direct.c deleted file mode 100644 index e5bccaf427..0000000000 --- a/src/cvodes/cvodes_direct.c +++ /dev/null @@ -1,65 +0,0 @@ -/* ----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated direct linear solver interface in - * CVODES; these routines now just wrap the updated CVODE generic - * linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in cvodes_ls.h) - =================================================================*/ - -int CVDlsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS, - SUNMatrix A) -{ return(CVodeSetLinearSolver(cvode_mem, LS, A)); } - -int CVDlsSetJacFn(void *cvode_mem, CVDlsJacFn jac) -{ return(CVodeSetJacFn(cvode_mem, jac)); } - -int CVDlsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVDlsGetNumJacEvals(void *cvode_mem, long int *njevals) -{ return(CVodeGetNumJacEvals(cvode_mem, njevals)); } - -int CVDlsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVDlsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVDlsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - -int CVDlsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS, SUNMatrix A) -{ return(CVodeSetLinearSolverB(cvode_mem, which, LS, A)); } - -int CVDlsSetJacFnB(void *cvode_mem, int which, CVDlsJacFnB jacB) -{ return(CVodeSetJacFnB(cvode_mem, which, jacB)); } - -int CVDlsSetJacFnBS(void *cvode_mem, int which, CVDlsJacFnBS jacBS) -{ return(CVodeSetJacFnBS(cvode_mem, which, jacBS)); } - -#ifdef __cplusplus -} -#endif diff --git a/src/cvodes/cvodes_spils.c b/src/cvodes/cvodes_spils.c deleted file mode 100644 index 9f6f6cd037..0000000000 --- a/src/cvodes/cvodes_spils.c +++ /dev/null @@ -1,107 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * ----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - * ----------------------------------------------------------------- - * Header file for the deprecated Scaled, Preconditioned Iterative - * Linear Solver interface in CVODES; these routines now just wrap - * the updated CVODES generic linear solver interface in cvodes_ls.h. - * -----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - CVSSPILS Exported functions (wrappers for equivalent routines in - cvodes_ls.h) - =================================================================*/ - -int CVSpilsSetLinearSolver(void *cvode_mem, SUNLinearSolver LS) -{ return(CVodeSetLinearSolver(cvode_mem, LS, NULL)); } - -int CVSpilsSetEpsLin(void *cvode_mem, realtype eplifac) -{ return(CVodeSetEpsLin(cvode_mem, eplifac)); } - -int CVSpilsSetPreconditioner(void *cvode_mem, CVSpilsPrecSetupFn pset, - CVSpilsPrecSolveFn psolve) -{ return(CVodeSetPreconditioner(cvode_mem, pset, psolve)); } - -int CVSpilsSetJacTimes(void *cvode_mem, CVSpilsJacTimesSetupFn jtsetup, - CVSpilsJacTimesVecFn jtimes) -{ return(CVodeSetJacTimes(cvode_mem, jtsetup, jtimes)); } - -int CVSpilsGetWorkSpace(void *cvode_mem, long int *lenrwLS, - long int *leniwLS) -{ return(CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS)); } - -int CVSpilsGetNumPrecEvals(void *cvode_mem, long int *npevals) -{ return(CVodeGetNumPrecEvals(cvode_mem, npevals)); } - -int CVSpilsGetNumPrecSolves(void *cvode_mem, long int *npsolves) -{ return(CVodeGetNumPrecSolves(cvode_mem, npsolves)); } - -int CVSpilsGetNumLinIters(void *cvode_mem, long int *nliters) -{ return(CVodeGetNumLinIters(cvode_mem, nliters)); } - -int CVSpilsGetNumConvFails(void *cvode_mem, long int *nlcfails) -{ return(CVodeGetNumLinConvFails(cvode_mem, nlcfails)); } - -int CVSpilsGetNumJTSetupEvals(void *cvode_mem, long int *njtsetups) -{ return(CVodeGetNumJTSetupEvals(cvode_mem, njtsetups)); } - -int CVSpilsGetNumJtimesEvals(void *cvode_mem, long int *njvevals) -{ return(CVodeGetNumJtimesEvals(cvode_mem, njvevals)); } - -int CVSpilsGetNumRhsEvals(void *cvode_mem, long int *nfevalsLS) -{ return(CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS)); } - -int CVSpilsGetLastFlag(void *cvode_mem, long int *flag) -{ return(CVodeGetLastLinFlag(cvode_mem, flag)); } - -char *CVSpilsGetReturnFlagName(long int flag) -{ return(CVodeGetLinReturnFlagName(flag)); } - -int CVSpilsSetLinearSolverB(void *cvode_mem, int which, - SUNLinearSolver LS) -{ return(CVodeSetLinearSolverB(cvode_mem, which, LS, NULL)); } - -int CVSpilsSetEpsLinB(void *cvode_mem, int which, realtype eplifacB) -{ return(CVodeSetEpsLinB(cvode_mem, which, eplifacB)); } - -int CVSpilsSetPreconditionerB(void *cvode_mem, int which, - CVSpilsPrecSetupFnB psetB, - CVSpilsPrecSolveFnB psolveB) -{ return(CVodeSetPreconditionerB(cvode_mem, which, psetB, psolveB)); } - -int CVSpilsSetPreconditionerBS(void *cvode_mem, int which, - CVSpilsPrecSetupFnBS psetBS, - CVSpilsPrecSolveFnBS psolveBS) -{ return(CVodeSetPreconditionerBS(cvode_mem, which, psetBS, psolveBS)); } - -int CVSpilsSetJacTimesB(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnB jtsetupB, - CVSpilsJacTimesVecFnB jtimesB) -{ return(CVodeSetJacTimesB(cvode_mem, which, jtsetupB, jtimesB)); } - -int CVSpilsSetJacTimesBS(void *cvode_mem, int which, - CVSpilsJacTimesSetupFnBS jtsetupBS, - CVSpilsJacTimesVecFnBS jtimesBS) -{ return(CVodeSetJacTimesBS(cvode_mem, which, jtsetupBS, jtimesBS)); } - - -#ifdef __cplusplus -} -#endif - diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt index 120f3f9687..b95ee46f48 100644 --- a/src/ida/CMakeLists.txt +++ b/src/ida/CMakeLists.txt @@ -21,21 +21,17 @@ install(CODE "MESSAGE(\"\nInstall IDA\n\")") set(ida_SOURCES ida.c ida_bbdpre.c - ida_direct.c ida_ic.c ida_io.c ida_ls.c ida_nls.c - ida_spils.c ) # Add variable ida_HEADERS with the exported IDA header files set(ida_HEADERS ida.h ida_bbdpre.h - ida_direct.h ida_ls.h - ida_spils.h ) # Add prefix with complete path to the IDA header files diff --git a/src/ida/ida_direct.c b/src/ida/ida_direct.c deleted file mode 100644 index 52ef5ef0b6..0000000000 --- a/src/ida/ida_direct.c +++ /dev/null @@ -1,56 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in ida_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in ida_ls.h) - =================================================================*/ - -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, SUNMatrix A) -{ return(IDASetLinearSolver(ida_mem, LS, A)); } - -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac) -{ return(IDASetJacFn(ida_mem, jac)); } - -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals) -{ return(IDAGetNumJacEvals(ida_mem, njevals)); } - -int IDADlsGetNumResEvals(void *ida_mem, long int *nfevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nfevalsLS)); } - -int IDADlsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDADlsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif - diff --git a/src/ida/ida_spils.c b/src/ida/ida_spils.c deleted file mode 100644 index 50e2cbe94f..0000000000 --- a/src/ida/ida_spils.c +++ /dev/null @@ -1,81 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Alan Hindmarsh, Radu Serban and Aaron Collier @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated Scaled and Preconditioned - * Iterative Linear Solver interface in IDA; these routines now just - * wrap the updated IDA generic linear solver interface in ida_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in ida_ls.h) - =================================================================*/ - -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS) -{ return(IDASetLinearSolver(ida_mem, LS, NULL)); } - -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve) -{ return(IDASetPreconditioner(ida_mem, pset, psolve)); } - -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes) -{ return(IDASetJacTimes(ida_mem, jtsetup, jtimes)); } - -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac) -{ return(IDASetEpsLin(ida_mem, eplifac)); } - -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac) -{ return(IDASetIncrementFactor(ida_mem, dqincfac)); } - -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals) -{ return(IDAGetNumPrecEvals(ida_mem, npevals)); } - -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves) -{ return(IDAGetNumPrecSolves(ida_mem, npsolves)); } - -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters) -{ return(IDAGetNumLinIters(ida_mem, nliters)); } - -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails) -{ return(IDAGetNumLinConvFails(ida_mem, nlcfails)); } - -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups) -{ return(IDAGetNumJTSetupEvals(ida_mem, njtsetups)); } - -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals) -{ return(IDAGetNumJtimesEvals(ida_mem, njvevals)); } - -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nrevalsLS)); } - -int IDASpilsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDASpilsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - -#ifdef __cplusplus -} -#endif - diff --git a/src/idas/CMakeLists.txt b/src/idas/CMakeLists.txt index c825d114c1..b0c6aa4df0 100644 --- a/src/idas/CMakeLists.txt +++ b/src/idas/CMakeLists.txt @@ -21,7 +21,6 @@ install(CODE "MESSAGE(\"\nInstall IDAS\n\")") set(idas_SOURCES idas.c idaa.c - idas_direct.c idas_io.c idas_ic.c idaa_io.c @@ -30,16 +29,13 @@ set(idas_SOURCES idas_nls.c idas_nls_sim.c idas_nls_stg.c - idas_spils.c ) # Add variable idas_HEADERS with the exported IDAS header files set(idas_HEADERS idas.h idas_bbdpre.h - idas_direct.h idas_ls.h - idas_spils.h ) # Add prefix with complete path to the IDAS header files diff --git a/src/idas/idas_direct.c b/src/idas/idas_direct.c deleted file mode 100644 index c42f22c1ff..0000000000 --- a/src/idas/idas_direct.c +++ /dev/null @@ -1,66 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * IDA; these routines now just wrap the updated IDA generic - * linear solver interface in idas_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in idas_ls.h) - =================================================================*/ - -int IDADlsSetLinearSolver(void *ida_mem, SUNLinearSolver LS, - SUNMatrix A) -{ return(IDASetLinearSolver(ida_mem, LS, A)); } - -int IDADlsSetJacFn(void *ida_mem, IDADlsJacFn jac) -{ return(IDASetJacFn(ida_mem, jac)); } - -int IDADlsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDADlsGetNumJacEvals(void *ida_mem, long int *njevals) -{ return(IDAGetNumJacEvals(ida_mem, njevals)); } - -int IDADlsGetNumResEvals(void *ida_mem, long int *nrevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nrevalsLS)); } - -int IDADlsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDADlsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - -int IDADlsSetLinearSolverB(void *ida_mem, int which, - SUNLinearSolver LS, SUNMatrix A) -{ return(IDASetLinearSolverB(ida_mem, which, LS, A)); } - -int IDADlsSetJacFnB(void *ida_mem, int which, IDADlsJacFnB jacB) -{ return(IDASetJacFnB(ida_mem, which, jacB)); } - -int IDADlsSetJacFnBS(void *ida_mem, int which, IDADlsJacFnBS jacBS) -{ return(IDASetJacFnBS(ida_mem, which, jacBS)); } - -#ifdef __cplusplus -} -#endif - diff --git a/src/idas/idas_spils.c b/src/idas/idas_spils.c deleted file mode 100644 index 9ee1b1d311..0000000000 --- a/src/idas/idas_spils.c +++ /dev/null @@ -1,114 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated Scaled and Preconditioned - * Iterative Linear Solver interface in IDAS; these routines now just - * wrap the updated IDA generic linear solver interface in idas_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in idas_ls.h) - =================================================================*/ - -int IDASpilsSetLinearSolver(void *ida_mem, SUNLinearSolver LS) -{ return(IDASetLinearSolver(ida_mem, LS, NULL)); } - -int IDASpilsSetPreconditioner(void *ida_mem, IDASpilsPrecSetupFn pset, - IDASpilsPrecSolveFn psolve) -{ return(IDASetPreconditioner(ida_mem, pset, psolve)); } - -int IDASpilsSetJacTimes(void *ida_mem, IDASpilsJacTimesSetupFn jtsetup, - IDASpilsJacTimesVecFn jtimes) -{ return(IDASetJacTimes(ida_mem, jtsetup, jtimes)); } - -int IDASpilsSetEpsLin(void *ida_mem, realtype eplifac) -{ return(IDASetEpsLin(ida_mem, eplifac)); } - -int IDASpilsSetIncrementFactor(void *ida_mem, realtype dqincfac) -{ return(IDASetIncrementFactor(ida_mem, dqincfac)); } - -int IDASpilsGetWorkSpace(void *ida_mem, long int *lenrwLS, - long int *leniwLS) -{ return(IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS)); } - -int IDASpilsGetNumPrecEvals(void *ida_mem, long int *npevals) -{ return(IDAGetNumPrecEvals(ida_mem, npevals)); } - -int IDASpilsGetNumPrecSolves(void *ida_mem, long int *npsolves) -{ return(IDAGetNumPrecSolves(ida_mem, npsolves)); } - -int IDASpilsGetNumLinIters(void *ida_mem, long int *nliters) -{ return(IDAGetNumLinIters(ida_mem, nliters)); } - -int IDASpilsGetNumConvFails(void *ida_mem, long int *nlcfails) -{ return(IDAGetNumLinConvFails(ida_mem, nlcfails)); } - -int IDASpilsGetNumJTSetupEvals(void *ida_mem, long int *njtsetups) -{ return(IDAGetNumJTSetupEvals(ida_mem, njtsetups)); } - -int IDASpilsGetNumJtimesEvals(void *ida_mem, long int *njvevals) -{ return(IDAGetNumJtimesEvals(ida_mem, njvevals)); } - -int IDASpilsGetNumResEvals(void *ida_mem, long int *nrevalsLS) -{ return(IDAGetNumLinResEvals(ida_mem, nrevalsLS)); } - -int IDASpilsGetLastFlag(void *ida_mem, long int *flag) -{ return(IDAGetLastLinFlag(ida_mem, flag)); } - -char *IDASpilsGetReturnFlagName(long int flag) -{ return(IDAGetLinReturnFlagName(flag)); } - -int IDASpilsSetLinearSolverB(void *ida_mem, int which, - SUNLinearSolver LS) -{ return(IDASetLinearSolverB(ida_mem, which, LS, NULL)); } - -int IDASpilsSetEpsLinB(void *ida_mem, int which, realtype eplifacB) -{ return(IDASetEpsLinB(ida_mem, which, eplifacB)); } - -int IDASpilsSetIncrementFactorB(void *ida_mem, int which, - realtype dqincfacB) -{ return(IDASetIncrementFactorB(ida_mem, which, dqincfacB)); } - -int IDASpilsSetPreconditionerB(void *ida_mem, int which, - IDASpilsPrecSetupFnB psetB, - IDASpilsPrecSolveFnB psolveB) -{ return(IDASetPreconditionerB(ida_mem, which, psetB, psolveB)); } - -int IDASpilsSetPreconditionerBS(void *ida_mem, int which, - IDASpilsPrecSetupFnBS psetBS, - IDASpilsPrecSolveFnBS psolveBS) -{ return(IDASetPreconditionerBS(ida_mem, which, psetBS, psolveBS)); } - -int IDASpilsSetJacTimesB(void *ida_mem, int which, - IDASpilsJacTimesSetupFnB jtsetupB, - IDASpilsJacTimesVecFnB jtimesB) -{ return(IDASetJacTimesB(ida_mem, which, jtsetupB, jtimesB)); } - -int IDASpilsSetJacTimesBS(void *ida_mem, int which, - IDASpilsJacTimesSetupFnBS jtsetupBS, - IDASpilsJacTimesVecFnBS jtimesBS) -{ return(IDASetJacTimesBS(ida_mem, which, jtsetupBS, jtimesBS)); } - - - -#ifdef __cplusplus -} -#endif - diff --git a/src/kinsol/CMakeLists.txt b/src/kinsol/CMakeLists.txt index 20fd1572ec..ff7b5fcbca 100644 --- a/src/kinsol/CMakeLists.txt +++ b/src/kinsol/CMakeLists.txt @@ -21,10 +21,8 @@ install(CODE "MESSAGE(\"\nInstall KINSOL\n\")") set(kinsol_SOURCES kinsol.c kinsol_bbdpre.c - kinsol_direct.c kinsol_io.c kinsol_ls.c - kinsol_spils.c ) # Add variable kinsol_HEADERS with the exported KINSOL header files @@ -33,7 +31,6 @@ set(kinsol_HEADERS kinsol_bbdpre.h kinsol_direct.h kinsol_ls.h - kinsol_spils.h ) # Add prefix with complete path to the KINSOL header files diff --git a/src/kinsol/kinsol_direct.c b/src/kinsol/kinsol_direct.c deleted file mode 100644 index a9427041ea..0000000000 --- a/src/kinsol/kinsol_direct.c +++ /dev/null @@ -1,55 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Radu Serban @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Implementation file for the deprecated direct linear solver interface in - * KINSOL; these routines now just wrap the updated KINSOL generic - * linear solver interface in kinsol_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - =================================================================*/ - -int KINDlsSetLinearSolver(void *kinmem, SUNLinearSolver LS, SUNMatrix A) -{ return(KINSetLinearSolver(kinmem, LS, A)); } - -int KINDlsSetJacFn(void *kinmem, KINDlsJacFn jac) -{ return(KINSetJacFn(kinmem, jac)); } - -int KINDlsGetWorkSpace(void *kinmem, long int *lenrw, long int *leniw) -{ return(KINGetLinWorkSpace(kinmem, lenrw, leniw)); } - -int KINDlsGetNumJacEvals(void *kinmem, long int *njevals) -{ return(KINGetNumJacEvals(kinmem, njevals)); } - -int KINDlsGetNumFuncEvals(void *kinmem, long int *nfevals) -{ return(KINGetNumLinFuncEvals(kinmem, nfevals)); } - -int KINDlsGetLastFlag(void *kinmem, long int *flag) -{ return(KINGetLastLinFlag(kinmem, flag)); } - -char *KINDlsGetReturnFlagName(long int flag) -{ return(KINGetLinReturnFlagName(flag)); } - -#ifdef __cplusplus -} -#endif - diff --git a/src/kinsol/kinsol_spils.c b/src/kinsol/kinsol_spils.c deleted file mode 100644 index aad4005762..0000000000 --- a/src/kinsol/kinsol_spils.c +++ /dev/null @@ -1,73 +0,0 @@ -/*----------------------------------------------------------------- - * Programmer(s): Daniel R. Reynolds @ SMU - * Scott Cohen, Alan Hindmarsh, Radu Serban, - * and Aaron Collier @ LLNL - *----------------------------------------------------------------- - * SUNDIALS Copyright Start - * Copyright (c) 2002-2023, 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 - *----------------------------------------------------------------- - * Header file for the deprecated Scaled Preconditioned Iterative - * Linear Solver interface in KINSOL; these routines now just wrap - * the updated KINSOL generic linear solver interface in kinsol_ls.h. - *-----------------------------------------------------------------*/ - -#include -#include - -#ifdef __cplusplus /* wrapper to enable C++ usage */ -extern "C" { -#endif - -/*================================================================= - Exported Functions (wrappers for equivalent routines in kinsol_ls.h) - =================================================================*/ - -int KINSpilsSetLinearSolver(void *kinmem, SUNLinearSolver LS) -{ return(KINSetLinearSolver(kinmem, LS, NULL)); } - -int KINSpilsSetPreconditioner(void *kinmem, KINSpilsPrecSetupFn psetup, - KINSpilsPrecSolveFn psolve) -{ return(KINSetPreconditioner(kinmem, psetup, psolve)); } - -int KINSpilsSetJacTimesVecFn(void *kinmem, KINSpilsJacTimesVecFn jtv) -{ return(KINSetJacTimesVecFn(kinmem, jtv)); } - -int KINSpilsGetWorkSpace(void *kinmem, long int *lenrwLS, long int *leniwLS) -{ return(KINGetLinWorkSpace(kinmem, lenrwLS, leniwLS)); } - -int KINSpilsGetNumPrecEvals(void *kinmem, long int *npevals) -{ return(KINGetNumPrecEvals(kinmem, npevals)); } - -int KINSpilsGetNumPrecSolves(void *kinmem, long int *npsolves) -{ return(KINGetNumPrecSolves(kinmem, npsolves)); } - -int KINSpilsGetNumLinIters(void *kinmem, long int *nliters) -{ return(KINGetNumLinIters(kinmem, nliters)); } - -int KINSpilsGetNumConvFails(void *kinmem, long int *nlcfails) -{ return(KINGetNumLinConvFails(kinmem, nlcfails)); } - -int KINSpilsGetNumJtimesEvals(void *kinmem, long int *njvevals) -{ return(KINGetNumJtimesEvals(kinmem, njvevals)); } - -int KINSpilsGetNumFuncEvals(void *kinmem, long int *nfevals) -{ return(KINGetNumLinFuncEvals(kinmem, nfevals)); } - -int KINSpilsGetLastFlag(void *kinmem, long int *flag) -{ return(KINGetLastLinFlag(kinmem, flag)); } - -char *KINSpilsGetReturnFlagName(long int flag) -{ return(KINGetLinReturnFlagName(flag)); } - - -#ifdef __cplusplus -} -#endif - From 7091261408c29ad2460b98e15b1e647bd5408fe8 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:35:50 -0700 Subject: [PATCH 27/85] remove more deprecated code --- examples/arkode/C_serial/ark_brusselator_fp.c | 49 +++++++----- examples/cvode/serial/cvKrylovDemo_ls.c | 80 +++++-------------- examples/cvodes/serial/cvsKrylovDemo_ls.c | 79 +++++------------- examples/kinsol/serial/kinAnalytic_fp.c | 8 +- .../kinsol/serial/kinLaplace_picard_kry.c | 8 +- include/nvector/nvector_openmp.h | 16 ---- include/nvector/nvector_openmpdev.h | 16 ---- include/nvector/nvector_parallel.h | 15 ---- include/nvector/nvector_parhyp.h | 18 ----- include/nvector/nvector_petsc.h | 15 ---- include/nvector/nvector_pthreads.h | 18 ----- include/nvector/nvector_serial.h | 15 ---- include/sunlinsol/sunlinsol_pcg.h | 5 -- include/sunlinsol/sunlinsol_spbcgs.h | 6 -- include/sunlinsol/sunlinsol_spfgmr.h | 6 -- include/sunlinsol/sunlinsol_spgmr.h | 7 -- include/sunlinsol/sunlinsol_sptfqmr.h | 6 -- .../sunnonlinsol/sunnonlinsol_fixedpoint.h | 9 --- include/sunnonlinsol/sunnonlinsol_newton.h | 9 --- src/kinsol/kinsol_io.c | 48 ----------- 20 files changed, 75 insertions(+), 358 deletions(-) diff --git a/examples/arkode/C_serial/ark_brusselator_fp.c b/examples/arkode/C_serial/ark_brusselator_fp.c index a8f3084cde..3c99f2d8de 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -59,6 +59,7 @@ #include /* serial N_Vector types, fcts., macros */ #include /* access to FP nonlinear solver */ #include /* def. of type 'realtype' */ +#include #if defined(SUNDIALS_EXTENDED_PRECISION) #define GSYM "Lg" @@ -96,25 +97,40 @@ int main(int argc, char *argv[]) int monitor = 0; /* turn on/off monitoring */ /* general problem variables */ + SUNContext ctx = NULL; + SUNLogger logger = NULL; + const char* info_fname = "ark_brusselator_fp-info.txt"; int flag; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver object */ void *arkode_mem = NULL; /* empty ARKode memory structure */ - FILE *UFID, *INFOFID; + FILE *UFID; realtype t, tout; int iout; long int nst, nst_a, nfe, nfi, nni, ncfn, netf; - /* Create SUNDIALS context */ - SUNContext ctx = NULL; - flag = SUNContext_Create(NULL, &ctx); - if (check_flag(&flag, "SUNContext_Create", 1)) return 1; - /* read inputs */ if (argc == 2) { monitor = atoi(argv[1]); } + /* create SUNDIALS context and a logger which will record + nonlinear solver info (e.g., residual) amongst other things. */ + + flag = SUNContext_Create(NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) return 1; + + flag = SUNLogger_Create(NULL, 0, &logger); + if (check_flag(&flag, "SUNLogger_Create", 1)) return 1; + + if (monitor) { + flag = SUNLogger_SetInfoFilename(logger, info_fname); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + } + + flag = SUNContext_SetLogger(ctx, logger); + if (check_flag(&flag, "SUNContext_SetLogger", 1)) return 1; + /* set up the test problem according to the desired test */ if (test == 1) { u0 = RCONST(3.9); @@ -145,10 +161,6 @@ int main(int argc, char *argv[]) printf(" problem parameters: a = %"GSYM", b = %"GSYM", ep = %"GSYM"\n",a,b,ep); printf(" reltol = %.1"ESYM", abstol = %.1"ESYM"\n\n",reltol,abstol); - /* Open up info output file */ - INFOFID = NULL; - if (monitor) INFOFID = fopen("ark_brusselator_fp-info.txt","w"); - /* Initialize data structures */ rdata[0] = a; /* set user data */ rdata[1] = b; @@ -168,12 +180,7 @@ int main(int argc, char *argv[]) /* Initialize fixed-point nonlinear solver and attach to ARKStep */ NLS = SUNNonlinSol_FixedPoint(y, fp_m, ctx); if (check_flag((void *)NLS, "SUNNonlinSol_FixedPoint", 0)) return 1; - if (monitor) { - flag = SUNNonlinSolSetPrintLevel_FixedPoint(NLS, 1); - if (check_flag(&flag, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - flag = SUNNonlinSolSetInfoFile_FixedPoint(NLS, INFOFID); - if (check_flag(&flag, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - } + flag = ARKStepSetNonlinearSolver(arkode_mem, NLS); if (check_flag(&flag, "ARKStepSetNonlinearSolver", 1)) return 1; @@ -217,7 +224,6 @@ int main(int argc, char *argv[]) } printf(" ----------------------------------------------\n"); fclose(UFID); - if (monitor) fclose(INFOFID); /* Print some final statistics */ flag = ARKStepGetNumSteps(arkode_mem, &nst); @@ -241,10 +247,11 @@ int main(int argc, char *argv[]) printf(" Total number of error test failures = %li\n\n", netf); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNNonlinSolFree(NLS); /* Free NLS object */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); + ARKStepFree(&arkode_mem); + SUNNonlinSolFree(NLS); + SUNLogger_Destroy(&logger); + SUNContext_Free(&ctx); return 0; } diff --git a/examples/cvode/serial/cvKrylovDemo_ls.c b/examples/cvode/serial/cvKrylovDemo_ls.c index 3b4cbf411a..dc89dfc91f 100644 --- a/examples/cvode/serial/cvKrylovDemo_ls.c +++ b/examples/cvode/serial/cvKrylovDemo_ls.c @@ -53,6 +53,7 @@ #include /* serial N_Vector types, fct. and macros */ #include /* use generic DENSE solver in preconditioning */ #include /* definition of realtype */ +#include /* helpful macros */ @@ -195,17 +196,17 @@ int main(int argc, char* argv[]) SUNNonlinearSolver NLS; void *cvode_mem; int linsolver, iout, retval; - FILE* infofp; int nrmfactor; /* LS norm conversion factor flag */ realtype nrmfac; /* LS norm conversion factor */ int monitor; /* LS resiudal monitoring flag */ SUNContext sunctx; + SUNLogger logger; + const char* info_fname = "cvKrylovDemo_ls-info.txt"; u = NULL; data = NULL; LS = NULL; cvode_mem = NULL; - infofp = NULL; nrmfactor = 0; monitor = 0; @@ -213,16 +214,23 @@ int main(int argc, char* argv[]) if (argc > 1) nrmfactor = atoi(argv[1]); if (argc > 2) monitor = atoi(argv[2]); - /* Create SUNDIALS context */ + /* Create SUNDIALS context and a logger which will record + nonlinear solver info (e.g., residual) amongst other things. */ + retval = SUNContext_Create(NULL, &sunctx); - if (check_retval(&retval, "SUNContext_Create", 1)) return(1); + if (check_retval(&retval, "SUNContext_Create", 1)) return 1; + + retval = SUNLogger_Create(NULL, 0, &logger); + if (check_retval(&retval, "SUNLogger_Create", 1)) return 1; - /* Open info file if monitoring is turned on */ if (monitor) { - infofp = fopen("cvKrylovDemo_ls-info.txt", "w+"); - if (check_retval((void *)infofp, "fopen", 0)) return(1); + retval = SUNLogger_SetInfoFilename(logger, info_fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; } + retval = SUNContext_SetLogger(sunctx, logger); + if (check_retval(&retval, "SUNContext_SetLogger", 1)) return 1; + /* Allocate memory, and set problem data, initial values, tolerances */ u = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)u, "N_VNew_Serial", 0)) return(1); @@ -265,14 +273,6 @@ int main(int argc, char* argv[]) /* Create the SUNNonlinearSolver */ NLS = SUNNonlinSol_Newton(u, sunctx); if (check_retval(&retval, "SUNNonlinSol_Newton", 0)) return(1); - if (monitor) { - /* Set the print level set to 1, so that the nonlinear residual - is printed every newton iteration. */ - retval = SUNNonlinSolSetPrintLevel_Newton(NLS, 1); - if (check_retval(&retval, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - retval = SUNNonlinSolSetInfoFile_Newton(NLS, infofp); - if (check_retval(&retval, "SUNNonlinSolSetInfoFile_Newton", 1)) return(1); - } /* Call CVodeSetNonlinearSolver to attach the nonlinear solver to CVode */ retval = CVodeSetNonlinearSolver(cvode_mem, NLS); @@ -309,22 +309,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPGMR |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPGMR to specify the linear solver SPGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -337,22 +327,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPFGMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPFGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPFGMR to specify the linear solver SPFGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPFGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPFGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPFGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPFGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPFGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPFGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -365,22 +345,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPBCGS |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPBCGS |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPBCGS to specify the linear solver SPBCGS with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPBCGS(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPBCGS", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPBCGS(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPBCGS", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPBCGS(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPBCGS", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -393,22 +363,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPTFQMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPTFQMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPTFQMR to specify the linear solver SPTFQMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPTFQMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPTFQMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPTFQMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPTFQMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPTFQMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPTFQMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -454,12 +414,12 @@ int main(int argc, char* argv[]) } /* END: Loop through SPGMR, SPBCG and SPTFQMR linear solver modules */ /* Free memory */ - if (monitor) fclose(infofp); N_VDestroy(u); FreeUserData(data); CVodeFree(&cvode_mem); SUNLinSolFree(LS); SUNNonlinSolFree(NLS); + SUNLogger_Destroy(&logger); SUNContext_Free(&sunctx); return(0); diff --git a/examples/cvodes/serial/cvsKrylovDemo_ls.c b/examples/cvodes/serial/cvsKrylovDemo_ls.c index 02309e0010..e76ccfa5dc 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_ls.c +++ b/examples/cvodes/serial/cvsKrylovDemo_ls.c @@ -192,17 +192,17 @@ int main(int argc, char* argv[]) SUNNonlinearSolver NLS; void *cvode_mem; int linsolver, iout, retval; - FILE* infofp; int nrmfactor; /* LS norm conversion factor flag */ realtype nrmfac; /* LS norm conversion factor */ int monitor; /* LS resiudal monitoring flag */ SUNContext sunctx; + SUNLogger logger; + const char* info_fname = "cvKrylovDemo_ls-info.txt"; u = NULL; data = NULL; LS = NULL; cvode_mem = NULL; - infofp = NULL; nrmfactor = 0; monitor = 0; @@ -210,16 +210,23 @@ int main(int argc, char* argv[]) if (argc > 1) nrmfactor = atoi(argv[1]); if (argc > 2) monitor = atoi(argv[2]); - /* Create SUNDIALS context */ + /* Create SUNDIALS context and a logger which will record + nonlinear solver info (e.g., residual) amongst other things. */ + retval = SUNContext_Create(NULL, &sunctx); - if (check_retval(&retval, "SUNContext_Create", 1)) return(1); + if (check_retval(&retval, "SUNContext_Create", 1)) return 1; + + retval = SUNLogger_Create(NULL, 0, &logger); + if (check_retval(&retval, "SUNLogger_Create", 1)) return 1; - /* Open info file if monitoring is turned on */ if (monitor) { - infofp = fopen("cvKrylovDemo_ls-info.txt", "w+"); - if (check_retval((void *)infofp, "fopen", 0)) return(1); + retval = SUNLogger_SetInfoFilename(logger, info_fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; } + retval = SUNContext_SetLogger(sunctx, logger); + if (check_retval(&retval, "SUNContext_SetLogger", 1)) return 1; + /* Allocate memory, and set problem data, initial values, tolerances */ u = N_VNew_Serial(NEQ, sunctx); if (check_retval((void *)u, "N_VNew_Serial", 0)) return(1); @@ -253,14 +260,6 @@ int main(int argc, char* argv[]) /* Create the SUNNonlinearSolver */ NLS = SUNNonlinSol_Newton(u, sunctx); if (check_retval(&retval, "SUNNonlinSol_Newton", 0)) return(1); - if (monitor) { - /* Set the print level set to 1, so that the nonlinear residual - is printed every newton iteration. */ - retval = SUNNonlinSolSetPrintLevel_Newton(NLS, 1); - if (check_retval(&retval, "SUNNonlinSolSetPrintLevel_Newton", 1)) return(1); - retval = SUNNonlinSolSetInfoFile_Newton(NLS, infofp); - if (check_retval(&retval, "SUNNonlinSolSetInfoFile_Newton", 1)) return(1); - } /* Call CVodeSetNonlinearSolver to attach the nonlinear solver to CVode */ retval = CVodeSetNonlinearSolver(cvode_mem, NLS); @@ -294,22 +293,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPGMR |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPGMR to specify the linear solver SPGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -322,22 +311,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPFGMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPFGMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPFGMR to specify the linear solver SPFGMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPFGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPFGMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPFGMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPFGMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPFGMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPFGMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -350,22 +329,12 @@ int main(int argc, char* argv[]) printf(" -------"); printf(" \n| SPBCGS |\n"); printf(" -------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPBCGS |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPBCGS to specify the linear solver SPBCGS with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPBCGS(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPBCGS", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPBCGS(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPBCGS", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPBCGS(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPBCGS", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -378,22 +347,12 @@ int main(int argc, char* argv[]) printf(" ---------"); printf(" \n| SPTFQMR |\n"); printf(" ---------\n"); - if (monitor) { - fprintf(infofp, " ---------"); - fprintf(infofp, " \n| SPTFQMR |\n"); - fprintf(infofp, " ---------\n"); - } /* Call SUNLinSol_SPTFQMR to specify the linear solver SPTFQMR with left preconditioning and the default maximum Krylov dimension */ LS = SUNLinSol_SPTFQMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void *)LS, "SUNLinSol_SPTFQMR", 0)) return(1); - if (monitor) { - retval = SUNLinSolSetPrintLevel_SPTFQMR(LS, 1); - if (check_retval(&retval, "SUNLinSolSetPrintLevel_SPTFQMR", 1)) return(1); - retval = SUNLinSolSetInfoFile_SPTFQMR(LS, infofp); - if (check_retval(&retval, "SUNLinSolSetInfoFile_SPTFQMR", 1)) return(1); - } + retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) return 1; @@ -439,12 +398,12 @@ int main(int argc, char* argv[]) } /* END: Loop through SPGMR, SPBCG and SPTFQMR linear solver modules */ /* Free memory */ - if (monitor) fclose(infofp); N_VDestroy(u); FreeUserData(data); CVodeFree(&cvode_mem); SUNLinSolFree(LS); SUNNonlinSolFree(NLS); + SUNLogger_Destroy(&logger); SUNContext_Free(&sunctx); return(0); diff --git a/examples/kinsol/serial/kinAnalytic_fp.c b/examples/kinsol/serial/kinAnalytic_fp.c index 9fedd989c7..c635dcb520 100644 --- a/examples/kinsol/serial/kinAnalytic_fp.c +++ b/examples/kinsol/serial/kinAnalytic_fp.c @@ -231,11 +231,11 @@ int main(int argc, char *argv[]) infofp = fopen("kinsol.log", "w"); if (check_retval((void *)infofp, "fopen", 0)) return(1); - retval = KINSetInfoFile(kmem, infofp); - if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); + // retval = KINSetInfoFile(kmem, infofp); + // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - retval = KINSetPrintLevel(kmem, 1); - if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); + // retval = KINSetPrintLevel(kmem, 1); + // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ------------- * Initial guess diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index 30b18a92ba..9122e8b0ef 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -144,11 +144,11 @@ int main() infofp = fopen("KINSOL.log", "w"); - retval = KINSetInfoFile(kmem, infofp); - if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); + // retval = KINSetInfoFile(kmem, infofp); + // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - retval = KINSetPrintLevel(kmem, 3); - if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); + // retval = KINSetPrintLevel(kmem, 3); + // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ---------------------- * Create SUNLinearSolver diff --git a/include/nvector/nvector_openmp.h b/include/nvector/nvector_openmp.h index 9eaf4d8d04..713f1fbd64 100644 --- a/include/nvector/nvector_openmp.h +++ b/include/nvector/nvector_openmp.h @@ -194,22 +194,6 @@ SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector v, booleant SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMP(N_Vector v, booleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMP(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_OpenMP(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_OpenMP(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_OpenMP(N_Vector* vs, int count); - - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_openmpdev.h b/include/nvector/nvector_openmpdev.h index 62cb37e811..fcc2ced766 100644 --- a/include/nvector/nvector_openmpdev.h +++ b/include/nvector/nvector_openmpdev.h @@ -195,22 +195,6 @@ SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_OpenMPDEV(N_Vector v, boole SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_OpenMPDEV(N_Vector v, booleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_OpenMPDEV(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArray_OpenMPDEV(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArrayEmpty_OpenMPDEV(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_OpenMPDEV(N_Vector *vs, int count); - - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_parallel.h b/include/nvector/nvector_parallel.h index bbb29b7de3..127f319c0b 100644 --- a/include/nvector/nvector_parallel.h +++ b/include/nvector/nvector_parallel.h @@ -225,21 +225,6 @@ SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Parallel(N_Vector v, b SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Parallel(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_Parallel(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_Parallel(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Parallel(N_Vector* vs, int count); - #ifdef __cplusplus } diff --git a/include/nvector/nvector_parhyp.h b/include/nvector/nvector_parhyp.h index f2748db746..03e7f66df6 100644 --- a/include/nvector/nvector_parhyp.h +++ b/include/nvector/nvector_parhyp.h @@ -211,24 +211,6 @@ SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_ParHyp(N_Vector v, SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArray_ParHyp(int count, - N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArrayEmpty_ParHyp(int count, - N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_ParHyp(N_Vector *vs, - int count); - SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_ParHyp(N_Vector v, booleantype tf); #ifdef __cplusplus diff --git a/include/nvector/nvector_petsc.h b/include/nvector/nvector_petsc.h index 8ccbdcf2dc..f7745ad98f 100644 --- a/include/nvector/nvector_petsc.h +++ b/include/nvector/nvector_petsc.h @@ -195,21 +195,6 @@ SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, bool SUNDIALS_EXPORT int N_VEnableDotProdMultiLocal_Petsc(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArray_Petsc(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector *N_VCloneVectorArrayEmpty_Petsc(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Petsc(N_Vector *vs, int count); - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_pthreads.h b/include/nvector/nvector_pthreads.h index da6be3e461..4e20c7ad5b 100644 --- a/include/nvector/nvector_pthreads.h +++ b/include/nvector/nvector_pthreads.h @@ -243,24 +243,6 @@ SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Pthreads(N_Vector v, SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Pthreads(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_Pthreads(int count, - N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_Pthreads(int count, - N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Pthreads(N_Vector* vs, - int count); - #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_serial.h b/include/nvector/nvector_serial.h index 7a96499ee9..1b08708c6c 100644 --- a/include/nvector/nvector_serial.h +++ b/include/nvector/nvector_serial.h @@ -184,21 +184,6 @@ SUNDIALS_EXPORT int N_VEnableWrmsNormMaskVectorArray_Serial(N_Vector v, booleant SUNDIALS_EXPORT int N_VEnableScaleAddMultiVectorArray_Serial(N_Vector v, booleantype tf); SUNDIALS_EXPORT int N_VEnableLinearCombinationVectorArray_Serial(N_Vector v, booleantype tf); -/* - * ----------------------------------------------------------------- - * Deprecated functions - * ----------------------------------------------------------------- - */ - -/* use N_VCloneVectorArray */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArray_Serial(int count, N_Vector w); - -/* use N_VCloneVectorArrayEmpty */ -SUNDIALS_DEPRECATED_EXPORT N_Vector* N_VCloneVectorArrayEmpty_Serial(int count, N_Vector w); - -/* use N_VDestroyVectorArray */ -SUNDIALS_DEPRECATED_EXPORT void N_VDestroyVectorArray_Serial(N_Vector* vs, int count); - #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_pcg.h b/include/sunlinsol/sunlinsol_pcg.h index 3b748e813e..28e34ae6f9 100644 --- a/include/sunlinsol/sunlinsol_pcg.h +++ b/include/sunlinsol/sunlinsol_pcg.h @@ -105,11 +105,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_PCG(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_PCG(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_PCG(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_PCG(SUNLinearSolver LS, int print_level); #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_spbcgs.h b/include/sunlinsol/sunlinsol_spbcgs.h index a257d850ee..f2caa1ba06 100644 --- a/include/sunlinsol/sunlinsol_spbcgs.h +++ b/include/sunlinsol/sunlinsol_spbcgs.h @@ -112,12 +112,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPBCGS(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPBCGS(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPBCGS(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPBCGS(SUNLinearSolver LS, int print_level); - diff --git a/include/sunlinsol/sunlinsol_spfgmr.h b/include/sunlinsol/sunlinsol_spfgmr.h index 5814662e6d..39ba18027e 100644 --- a/include/sunlinsol/sunlinsol_spfgmr.h +++ b/include/sunlinsol/sunlinsol_spfgmr.h @@ -119,12 +119,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPFGMR(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPFGMR(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPFGMR(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPFGMR(SUNLinearSolver LS, int print_level); - #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_spgmr.h b/include/sunlinsol/sunlinsol_spgmr.h index 3fe7da9aee..807556b9a3 100644 --- a/include/sunlinsol/sunlinsol_spgmr.h +++ b/include/sunlinsol/sunlinsol_spgmr.h @@ -121,13 +121,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPGMR(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPGMR(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPGMR(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPGMR(SUNLinearSolver LS, int print_level); - - #ifdef __cplusplus } diff --git a/include/sunlinsol/sunlinsol_sptfqmr.h b/include/sunlinsol/sunlinsol_sptfqmr.h index 79f4f5f306..11355d15d9 100644 --- a/include/sunlinsol/sunlinsol_sptfqmr.h +++ b/include/sunlinsol/sunlinsol_sptfqmr.h @@ -112,12 +112,6 @@ SUNDIALS_EXPORT int SUNLinSolSpace_SPTFQMR(SUNLinearSolver S, long int *lenrwLS, long int *leniwLS); SUNDIALS_EXPORT int SUNLinSolFree_SPTFQMR(SUNLinearSolver S); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNLinSolSetInfoFile_SPTFQMR(SUNLinearSolver LS, - FILE* info_file); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -int SUNLinSolSetPrintLevel_SPTFQMR(SUNLinearSolver LS, int print_level); - #ifdef __cplusplus } diff --git a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h index 06c5f386a8..caaea50c20 100644 --- a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h +++ b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h @@ -122,15 +122,6 @@ SUNDIALS_EXPORT int SUNNonlinSolGetNumConvFails_FixedPoint(SUNNonlinearSolver NL SUNDIALS_EXPORT int SUNNonlinSolGetSysFn_FixedPoint(SUNNonlinearSolver NLS, SUNNonlinSolSysFn *SysFn); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNNonlinSolSetInfoFile_FixedPoint(SUNNonlinearSolver NLS, - FILE* info_file); - -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -SUNDIALS_EXPORT int SUNNonlinSolSetPrintLevel_FixedPoint(SUNNonlinearSolver NLS, - int print_level); - - #ifdef __cplusplus } #endif diff --git a/include/sunnonlinsol/sunnonlinsol_newton.h b/include/sunnonlinsol/sunnonlinsol_newton.h index 9f6333cb5c..d6bbe89d4f 100644 --- a/include/sunnonlinsol/sunnonlinsol_newton.h +++ b/include/sunnonlinsol/sunnonlinsol_newton.h @@ -113,15 +113,6 @@ SUNDIALS_EXPORT int SUNNonlinSolGetNumConvFails_Newton(SUNNonlinearSolver NLS, SUNDIALS_EXPORT int SUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver NLS, SUNNonlinSolSysFn *SysFn); -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger_SetInfoFilename instead") -int SUNNonlinSolSetInfoFile_Newton(SUNNonlinearSolver NLS, - FILE* info_file); - -SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNLogger interface instead") -SUNDIALS_EXPORT int SUNNonlinSolSetPrintLevel_Newton(SUNNonlinearSolver NLS, - int print_level); - - #ifdef __cplusplus } #endif diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index 2e393ee383..6645333d90 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -135,54 +135,6 @@ int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, void *ih_data) return(KIN_SUCCESS); } - -/* - * ----------------------------------------------------------------- - * Function : KINSetInfoFile - * DEPRECATED: use SUNLogger_SetInfoFilename instead - * ----------------------------------------------------------------- - */ - -int KINSetInfoFile(void *kinmem, FILE *infofp) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetInfoFile", MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - kin_mem->kin_infofp = infofp; - - return(KIN_SUCCESS); -} - - -/* - * ----------------------------------------------------------------- - * Function : KINSetDebugFile - * DEPRECATED: use SUNLogger_SetDebugFilename instead - * ----------------------------------------------------------------- - */ - -int KINSetDebugFile(void *kinmem, FILE *debugfp) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetDebugFile", - MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - kin_mem->kin_debugfp = debugfp; - - return(KIN_SUCCESS); -} - - /* * ----------------------------------------------------------------- * Function : KINSetUserData From 0388073d98328d79443067aafa2d7862fd4f7387 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 26 Oct 2023 10:51:44 -0700 Subject: [PATCH 28/85] update swig --- src/kinsol/fmod/fkinsol_mod.c | 28 --- src/kinsol/fmod/fkinsol_mod.f90 | 52 ------ src/nvector/openmp/fmod/fnvector_openmp_mod.c | 38 ---- .../openmp/fmod/fnvector_openmp_mod.f90 | 72 -------- .../parallel/fmod/fnvector_parallel_mod.c | 38 ---- .../parallel/fmod/fnvector_parallel_mod.f90 | 72 -------- .../pthreads/fmod/fnvector_pthreads_mod.c | 38 ---- .../pthreads/fmod/fnvector_pthreads_mod.f90 | 72 -------- src/nvector/serial/fmod/fnvector_serial_mod.c | 38 ---- .../serial/fmod/fnvector_serial_mod.f90 | 72 -------- .../fmod/fsundials_linearsolver_mod.c | 80 --------- .../fmod/fsundials_linearsolver_mod.f90 | 164 ------------------ src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c | 28 --- src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 | 52 ------ .../spbcgs/fmod/fsunlinsol_spbcgs_mod.c | 28 --- .../spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 | 52 ------ .../spfgmr/fmod/fsunlinsol_spfgmr_mod.c | 28 --- .../spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 | 52 ------ .../spgmr/fmod/fsunlinsol_spgmr_mod.c | 28 --- .../spgmr/fmod/fsunlinsol_spgmr_mod.f90 | 52 ------ .../sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c | 28 --- .../sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 | 52 ------ .../fmod/fsunnonlinsol_fixedpoint_mod.c | 28 --- .../fmod/fsunnonlinsol_fixedpoint_mod.f90 | 52 ------ .../newton/fmod/fsunnonlinsol_newton_mod.c | 28 --- .../newton/fmod/fsunnonlinsol_newton_mod.f90 | 52 ------ 26 files changed, 1324 deletions(-) diff --git a/src/kinsol/fmod/fkinsol_mod.c b/src/kinsol/fmod/fkinsol_mod.c index 29e070fbb6..2836479531 100644 --- a/src/kinsol/fmod/fkinsol_mod.c +++ b/src/kinsol/fmod/fkinsol_mod.c @@ -683,20 +683,6 @@ SWIGEXPORT int _wrap_FKINSetInfoHandlerFn(void *farg1, KINInfoHandlerFn farg2, v } -SWIGEXPORT int _wrap_FKINSetInfoFile(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)KINSetInfoFile(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -711,20 +697,6 @@ SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { } -SWIGEXPORT int _wrap_FKINSetDebugFile(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)KINSetDebugFile(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINGetWorkSpace(void *farg1, long *farg2, long *farg3) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/kinsol/fmod/fkinsol_mod.f90 b/src/kinsol/fmod/fkinsol_mod.f90 index c60ae37fb3..4928d79822 100644 --- a/src/kinsol/fmod/fkinsol_mod.f90 +++ b/src/kinsol/fmod/fkinsol_mod.f90 @@ -101,9 +101,7 @@ module fkinsol_mod public :: FKINSetErrHandlerFn public :: FKINSetErrFile public :: FKINSetInfoHandlerFn - public :: FKINSetInfoFile public :: FKINSetPrintLevel - public :: FKINSetDebugFile public :: FKINGetWorkSpace public :: FKINGetNumNonlinSolvIters public :: FKINGetNumFuncEvals @@ -440,15 +438,6 @@ function swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) & integer(C_INT) :: fresult end function -function swigc_FKINSetInfoFile(farg1, farg2) & -bind(C, name="_wrap_FKINSetInfoFile") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINSetPrintLevel(farg1, farg2) & bind(C, name="_wrap_FKINSetPrintLevel") & result(fresult) @@ -458,15 +447,6 @@ function swigc_FKINSetPrintLevel(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FKINSetDebugFile(farg1, farg2) & -bind(C, name="_wrap_FKINSetDebugFile") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINGetWorkSpace(farg1, farg2, farg3) & bind(C, name="_wrap_FKINGetWorkSpace") & result(fresult) @@ -1283,22 +1263,6 @@ function FKINSetInfoHandlerFn(kinmem, ihfun, ih_data) & swig_result = fresult end function -function FKINSetInfoFile(kinmem, infofp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_PTR) :: infofp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = kinmem -farg2 = infofp -fresult = swigc_FKINSetInfoFile(farg1, farg2) -swig_result = fresult -end function - function FKINSetPrintLevel(kinmem, printfl) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1315,22 +1279,6 @@ function FKINSetPrintLevel(kinmem, printfl) & swig_result = fresult end function -function FKINSetDebugFile(kinmem, debugfp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_PTR) :: debugfp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = kinmem -farg2 = debugfp -fresult = swigc_FKINSetDebugFile(farg1, farg2) -swig_result = fresult -end function - function FKINGetWorkSpace(kinmem, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.c b/src/nvector/openmp/fmod/fnvector_openmp_mod.c index 4216804206..91edfc2791 100644 --- a/src/nvector/openmp/fmod/fnvector_openmp_mod.c +++ b/src/nvector/openmp/fmod/fnvector_openmp_mod.c @@ -946,44 +946,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector farg1, in } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_OpenMP(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_OpenMP(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_OpenMP(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_OpenMP(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_OpenMP(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_OpenMP(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_OpenMP(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 b/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 index 8518caf673..ab547e6c94 100644 --- a/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 +++ b/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 @@ -80,9 +80,6 @@ module fnvector_openmp_mod public :: FN_VEnableConstVectorArray_OpenMP public :: FN_VEnableWrmsNormVectorArray_OpenMP public :: FN_VEnableWrmsNormMaskVectorArray_OpenMP - public :: FN_VCloneVectorArray_OpenMP - public :: FN_VCloneVectorArrayEmpty_OpenMP - public :: FN_VDestroyVectorArray_OpenMP public :: FN_VGetArrayPointer_OpenMP @@ -564,31 +561,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_OpenMP(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_OpenMP") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_OpenMP") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_OpenMP(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_OpenMP") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_OpenMP(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_OpenMP") & @@ -1473,50 +1445,6 @@ function FN_VEnableWrmsNormMaskVectorArray_OpenMP(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_OpenMP(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_OpenMP(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_OpenMP(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_OpenMP(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_OpenMP(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_OpenMP(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_OpenMP(v) & result(swig_result) diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.c b/src/nvector/parallel/fmod/fnvector_parallel_mod.c index cc4244981e..c2668e3c4c 100644 --- a/src/nvector/parallel/fmod/fnvector_parallel_mod.c +++ b/src/nvector/parallel/fmod/fnvector_parallel_mod.c @@ -1130,44 +1130,6 @@ SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_Parallel(N_Vector farg1, int co } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Parallel(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Parallel(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Parallel(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Parallel(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Parallel(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Parallel(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Parallel(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 b/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 index d8e7fcb23e..43fb070b88 100644 --- a/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 +++ b/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 @@ -92,9 +92,6 @@ module fnvector_parallel_mod public :: FN_VEnableWrmsNormVectorArray_Parallel public :: FN_VEnableWrmsNormMaskVectorArray_Parallel public :: FN_VEnableDotProdMultiLocal_Parallel - public :: FN_VCloneVectorArray_Parallel - public :: FN_VCloneVectorArrayEmpty_Parallel - public :: FN_VDestroyVectorArray_Parallel public :: FN_VGetArrayPointer_Parallel @@ -686,31 +683,6 @@ function swigc_FN_VEnableDotProdMultiLocal_Parallel(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Parallel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Parallel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Parallel(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Parallel") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Parallel(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Parallel") & @@ -1793,50 +1765,6 @@ function FN_VEnableDotProdMultiLocal_Parallel(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Parallel(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Parallel(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Parallel(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Parallel(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Parallel(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Parallel(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Parallel(v) & result(swig_result) diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c index d34088af42..73c8ca0c51 100644 --- a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c +++ b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c @@ -946,44 +946,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector farg1, } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Pthreads(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Pthreads(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Pthreads(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Pthreads(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Pthreads(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Pthreads(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Pthreads(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 index 4456bf0f8a..40fac42471 100644 --- a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 +++ b/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 @@ -80,9 +80,6 @@ module fnvector_pthreads_mod public :: FN_VEnableConstVectorArray_Pthreads public :: FN_VEnableWrmsNormVectorArray_Pthreads public :: FN_VEnableWrmsNormMaskVectorArray_Pthreads - public :: FN_VCloneVectorArray_Pthreads - public :: FN_VCloneVectorArrayEmpty_Pthreads - public :: FN_VDestroyVectorArray_Pthreads public :: FN_VGetArrayPointer_Pthreads @@ -564,31 +561,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_Pthreads(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Pthreads") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Pthreads") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Pthreads(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Pthreads") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Pthreads(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Pthreads") & @@ -1473,50 +1445,6 @@ function FN_VEnableWrmsNormMaskVectorArray_Pthreads(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Pthreads(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Pthreads(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Pthreads(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Pthreads(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Pthreads(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Pthreads(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Pthreads(v) & result(swig_result) diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.c b/src/nvector/serial/fmod/fnvector_serial_mod.c index ed9a774185..591ee2c0f7 100644 --- a/src/nvector/serial/fmod/fnvector_serial_mod.c +++ b/src/nvector/serial/fmod/fnvector_serial_mod.c @@ -940,44 +940,6 @@ SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Serial(N_Vector farg1, in } -SWIGEXPORT void * _wrap_FN_VCloneVectorArray_Serial(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray_Serial(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void * _wrap_FN_VCloneVectorArrayEmpty_Serial(int const *farg1, N_Vector farg2) { - void * fresult ; - int arg1 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; - - arg1 = (int)(*farg1); - arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArrayEmpty_Serial(arg1,arg2); - fresult = result; - return fresult; -} - - -SWIGEXPORT void _wrap_FN_VDestroyVectorArray_Serial(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; - int arg2 ; - - arg1 = (N_Vector *)(farg1); - arg2 = (int)(*farg2); - N_VDestroyVectorArray_Serial(arg1,arg2); -} - - SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Serial(N_Vector farg1) { double * fresult ; diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.f90 b/src/nvector/serial/fmod/fnvector_serial_mod.f90 index 97b2660ec9..8bf8ca4fd9 100644 --- a/src/nvector/serial/fmod/fnvector_serial_mod.f90 +++ b/src/nvector/serial/fmod/fnvector_serial_mod.f90 @@ -80,9 +80,6 @@ module fnvector_serial_mod public :: FN_VEnableConstVectorArray_Serial public :: FN_VEnableWrmsNormVectorArray_Serial public :: FN_VEnableWrmsNormMaskVectorArray_Serial - public :: FN_VCloneVectorArray_Serial - public :: FN_VCloneVectorArrayEmpty_Serial - public :: FN_VDestroyVectorArray_Serial public :: FN_VGetArrayPointer_Serial @@ -561,31 +558,6 @@ function swigc_FN_VEnableWrmsNormMaskVectorArray_Serial(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FN_VCloneVectorArray_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArray_Serial") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -function swigc_FN_VCloneVectorArrayEmpty_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VCloneVectorArrayEmpty_Serial") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR) :: fresult -end function - -subroutine swigc_FN_VDestroyVectorArray_Serial(farg1, farg2) & -bind(C, name="_wrap_FN_VDestroyVectorArray_Serial") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - function swigc_FN_VGetArrayPointer_Serial(farg1) & bind(C, name="_wrap_FN_VGetArrayPointer_Serial") & @@ -1461,50 +1433,6 @@ function FN_VEnableWrmsNormMaskVectorArray_Serial(v, tf) & swig_result = fresult end function -function FN_VCloneVectorArray_Serial(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArray_Serial(farg1, farg2) -swig_result = fresult -end function - -function FN_VCloneVectorArrayEmpty_Serial(count, w) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: swig_result -integer(C_INT), intent(in) :: count -type(N_Vector), target, intent(inout) :: w -type(C_PTR) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 - -farg1 = count -farg2 = c_loc(w) -fresult = swigc_FN_VCloneVectorArrayEmpty_Serial(farg1, farg2) -swig_result = fresult -end function - -subroutine FN_VDestroyVectorArray_Serial(vs, count) -use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs -integer(C_INT), intent(in) :: count -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = vs -farg2 = count -call swigc_FN_VDestroyVectorArray_Serial(farg1, farg2) -end subroutine - function FN_VGetArrayPointer_Serial(v) & result(swig_result) diff --git a/src/sundials/fmod/fsundials_linearsolver_mod.c b/src/sundials/fmod/fsundials_linearsolver_mod.c index c755ea1949..9c6ed9076e 100644 --- a/src/sundials/fmod/fsundials_linearsolver_mod.c +++ b/src/sundials/fmod/fsundials_linearsolver_mod.c @@ -211,26 +211,6 @@ SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, } -SWIGEXPORT int _wrap_FModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { - int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; - int arg3 ; - int arg4 ; - realtype *arg5 = (realtype *) 0 ; - int result; - - arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); - arg3 = (int)(*farg3); - arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); - result = (int)ModifiedGS(arg1,arg2,arg3,arg4,arg5); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; @@ -255,30 +235,6 @@ SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, } -SWIGEXPORT int _wrap_FClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { - int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - realtype **arg2 = (realtype **) 0 ; - int arg3 ; - int arg4 ; - realtype *arg5 = (realtype *) 0 ; - realtype *arg6 = (realtype *) 0 ; - N_Vector *arg7 = (N_Vector *) 0 ; - int result; - - arg1 = (N_Vector *)(farg1); - arg2 = (realtype **)(farg2); - arg3 = (int)(*farg3); - arg4 = (int)(*farg4); - arg5 = (realtype *)(farg5); - arg6 = (realtype *)(farg6); - arg7 = (N_Vector *)(farg7); - result = (int)ClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { int fresult ; int arg1 ; @@ -297,24 +253,6 @@ SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, in } -SWIGEXPORT int _wrap_FQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { - int fresult ; - int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; - int arg4 ; - int result; - - arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (int)(*farg4); - result = (int)QRfact(arg1,arg2,arg3,arg4); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { int fresult ; int arg1 ; @@ -333,24 +271,6 @@ SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, dou } -SWIGEXPORT int _wrap_FQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { - int fresult ; - int arg1 ; - realtype **arg2 = (realtype **) 0 ; - realtype *arg3 = (realtype *) 0 ; - realtype *arg4 = (realtype *) 0 ; - int result; - - arg1 = (int)(*farg1); - arg2 = (realtype **)(farg2); - arg3 = (realtype *)(farg3); - arg4 = (realtype *)(farg4); - result = (int)QRsol(arg1,arg2,arg3,arg4); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; N_Vector *arg1 = (N_Vector *) 0 ; diff --git a/src/sundials/fmod/fsundials_linearsolver_mod.f90 b/src/sundials/fmod/fsundials_linearsolver_mod.f90 index e5fc92eb13..2c4272768e 100644 --- a/src/sundials/fmod/fsundials_linearsolver_mod.f90 +++ b/src/sundials/fmod/fsundials_linearsolver_mod.f90 @@ -18,13 +18,6 @@ module fsundials_linearsolver_mod private ! DECLARATION CONSTRUCTS - enum, bind(c) - enumerator :: PREC_NONE - enumerator :: PREC_LEFT - enumerator :: PREC_RIGHT - enumerator :: PREC_BOTH - end enum - public :: PREC_NONE, PREC_LEFT, PREC_RIGHT, PREC_BOTH enum, bind(c) enumerator :: SUN_PREC_NONE enumerator :: SUN_PREC_LEFT @@ -32,24 +25,15 @@ module fsundials_linearsolver_mod enumerator :: SUN_PREC_BOTH end enum public :: SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH - enum, bind(c) - enumerator :: MODIFIED_GS = 1 - enumerator :: CLASSICAL_GS = 2 - end enum - public :: MODIFIED_GS, CLASSICAL_GS enum, bind(c) enumerator :: SUN_MODIFIED_GS = 1 enumerator :: SUN_CLASSICAL_GS = 2 end enum public :: SUN_MODIFIED_GS, SUN_CLASSICAL_GS public :: FSUNModifiedGS - public :: FModifiedGS public :: FSUNClassicalGS - public :: FClassicalGS public :: FSUNQRfact - public :: FQRfact public :: FSUNQRsol - public :: FQRsol public :: FSUNQRAdd_MGS public :: FSUNQRAdd_ICWY public :: FSUNQRAdd_ICWY_SB @@ -170,18 +154,6 @@ function swigc_FSUNModifiedGS(farg1, farg2, farg3, farg4, farg5) & integer(C_INT) :: fresult end function -function swigc_FModifiedGS(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FModifiedGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT), intent(in) :: farg3 -integer(C_INT), intent(in) :: farg4 -type(C_PTR), value :: farg5 -integer(C_INT) :: fresult -end function - function swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & bind(C, name="_wrap_FSUNClassicalGS") & result(fresult) @@ -196,20 +168,6 @@ function swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) integer(C_INT) :: fresult end function -function swigc_FClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & -bind(C, name="_wrap_FClassicalGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT), intent(in) :: farg3 -integer(C_INT), intent(in) :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -type(C_PTR), value :: farg7 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRfact(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FSUNQRfact") & result(fresult) @@ -221,17 +179,6 @@ function swigc_FSUNQRfact(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function -function swigc_FQRfact(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FQRfact") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -integer(C_INT), intent(in) :: farg4 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRsol(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FSUNQRsol") & result(fresult) @@ -243,17 +190,6 @@ function swigc_FSUNQRsol(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function -function swigc_FQRsol(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FQRsol") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -integer(C_INT) :: fresult -end function - function swigc_FSUNQRAdd_MGS(farg1, farg2, farg3, farg4, farg5, farg6) & bind(C, name="_wrap_FSUNQRAdd_MGS") & result(fresult) @@ -511,31 +447,6 @@ function FSUNModifiedGS(v, h, k, p, new_vk_norm) & swig_result = fresult end function -function FModifiedGS(v, h, k, p, new_vk_norm) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: v -type(C_PTR), target, intent(inout) :: h -integer(C_INT), intent(in) :: k -integer(C_INT), intent(in) :: p -real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -integer(C_INT) :: farg3 -integer(C_INT) :: farg4 -type(C_PTR) :: farg5 - -farg1 = v -farg2 = c_loc(h) -farg3 = k -farg4 = p -farg5 = c_loc(new_vk_norm(1)) -fresult = swigc_FModifiedGS(farg1, farg2, farg3, farg4, farg5) -swig_result = fresult -end function - function FSUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -567,37 +478,6 @@ function FSUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & swig_result = fresult end function -function FClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: v -type(C_PTR), target, intent(inout) :: h -integer(C_INT), intent(in) :: k -integer(C_INT), intent(in) :: p -real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm -real(C_DOUBLE), dimension(*), target, intent(inout) :: stemp -type(C_PTR) :: vtemp -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -integer(C_INT) :: farg3 -integer(C_INT) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 -type(C_PTR) :: farg7 - -farg1 = v -farg2 = c_loc(h) -farg3 = k -farg4 = p -farg5 = c_loc(new_vk_norm(1)) -farg6 = c_loc(stemp(1)) -farg7 = vtemp -fresult = swigc_FClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) -swig_result = fresult -end function - function FSUNQRfact(n, h, q, job) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -620,28 +500,6 @@ function FSUNQRfact(n, h, q, job) & swig_result = fresult end function -function FQRfact(n, h, q, job) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -integer(C_INT), intent(in) :: n -type(C_PTR), target, intent(inout) :: h -real(C_DOUBLE), dimension(*), target, intent(inout) :: q -integer(C_INT), intent(in) :: job -integer(C_INT) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -integer(C_INT) :: farg4 - -farg1 = n -farg2 = c_loc(h) -farg3 = c_loc(q(1)) -farg4 = job -fresult = swigc_FQRfact(farg1, farg2, farg3, farg4) -swig_result = fresult -end function - function FSUNQRsol(n, h, q, b) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -664,28 +522,6 @@ function FSUNQRsol(n, h, q, b) & swig_result = fresult end function -function FQRsol(n, h, q, b) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -integer(C_INT), intent(in) :: n -type(C_PTR), target, intent(inout) :: h -real(C_DOUBLE), dimension(*), target, intent(inout) :: q -real(C_DOUBLE), dimension(*), target, intent(inout) :: b -integer(C_INT) :: fresult -integer(C_INT) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 - -farg1 = n -farg2 = c_loc(h) -farg3 = c_loc(q(1)) -farg4 = c_loc(b(1)) -fresult = swigc_FQRsol(farg1, farg2, farg3, farg4) -swig_result = fresult -end function - function FSUNQRAdd_MGS(q, r, df, m, mmax, qrdata) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c index 3bdb6ea15f..68489d3520 100644 --- a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c +++ b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_PCG(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_PCG(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_PCG(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_PCG(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_PCG(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 index faf98e9503..6334343b52 100644 --- a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 +++ b/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_pcg_mod public :: FSUNLinSolLastFlag_PCG public :: FSUNLinSolSpace_PCG public :: FSUNLinSolFree_PCG - public :: FSUNLinSolSetInfoFile_PCG - public :: FSUNLinSolSetPrintLevel_PCG ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_PCG(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_PCG(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_PCG") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_PCG(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_PCG") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_PCG(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_PCG(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_PCG(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_PCG(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_PCG(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c index 1d58f0c9b1..e6e3e56704 100644 --- a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c +++ b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPBCGS(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPBCGS(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPBCGS(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPBCGS(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPBCGS(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 index 301bcf85d5..2159bfe002 100644 --- a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 +++ b/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_spbcgs_mod public :: FSUNLinSolLastFlag_SPBCGS public :: FSUNLinSolSpace_SPBCGS public :: FSUNLinSolFree_SPBCGS - public :: FSUNLinSolSetInfoFile_SPBCGS - public :: FSUNLinSolSetPrintLevel_SPBCGS ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_SPBCGS(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPBCGS(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPBCGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPBCGS(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPBCGS") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_SPBCGS(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPBCGS(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPBCGS(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPBCGS(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPBCGS(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c index 8332d7967a..69904ab23d 100644 --- a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c +++ b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c @@ -478,32 +478,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPFGMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPFGMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPFGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPFGMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPFGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 index f62b8e6dd8..c6ed64bf5b 100644 --- a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 +++ b/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 @@ -55,8 +55,6 @@ module fsunlinsol_spfgmr_mod public :: FSUNLinSolLastFlag_SPFGMR public :: FSUNLinSolSpace_SPFGMR public :: FSUNLinSolFree_SPFGMR - public :: FSUNLinSolSetInfoFile_SPFGMR - public :: FSUNLinSolSetPrintLevel_SPFGMR ! WRAPPER DECLARATIONS interface @@ -233,24 +231,6 @@ function swigc_FSUNLinSolFree_SPFGMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPFGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPFGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPFGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPFGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -566,37 +546,5 @@ function FSUNLinSolFree_SPFGMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPFGMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPFGMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPFGMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPFGMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c index eec1e72e4a..eaa89837b1 100644 --- a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c +++ b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c @@ -478,32 +478,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPGMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPGMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPGMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPGMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 index d185bd8d43..77873a000a 100644 --- a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 +++ b/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 @@ -55,8 +55,6 @@ module fsunlinsol_spgmr_mod public :: FSUNLinSolLastFlag_SPGMR public :: FSUNLinSolSpace_SPGMR public :: FSUNLinSolFree_SPGMR - public :: FSUNLinSolSetInfoFile_SPGMR - public :: FSUNLinSolSetPrintLevel_SPGMR ! WRAPPER DECLARATIONS interface @@ -233,24 +231,6 @@ function swigc_FSUNLinSolFree_SPGMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPGMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPGMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -566,37 +546,5 @@ function FSUNLinSolFree_SPGMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPGMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPGMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPGMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPGMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c index ebc9c85d8b..9a46dee3a2 100644 --- a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c +++ b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c @@ -464,32 +464,4 @@ SWIGEXPORT int _wrap_FSUNLinSolFree_SPTFQMR(SUNLinearSolver farg1) { } -SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_SPTFQMR(SUNLinearSolver farg1, void *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNLinSolSetInfoFile_SPTFQMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_SPTFQMR(SUNLinearSolver farg1, int const *farg2) { - int fresult ; - SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNLinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNLinSolSetPrintLevel_SPTFQMR(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 index 5f3b43ecf2..c4d9abe539 100644 --- a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 +++ b/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 @@ -53,8 +53,6 @@ module fsunlinsol_sptfqmr_mod public :: FSUNLinSolLastFlag_SPTFQMR public :: FSUNLinSolSpace_SPTFQMR public :: FSUNLinSolFree_SPTFQMR - public :: FSUNLinSolSetInfoFile_SPTFQMR - public :: FSUNLinSolSetPrintLevel_SPTFQMR ! WRAPPER DECLARATIONS interface @@ -222,24 +220,6 @@ function swigc_FSUNLinSolFree_SPTFQMR(farg1) & integer(C_INT) :: fresult end function -function swigc_FSUNLinSolSetInfoFile_SPTFQMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetInfoFile_SPTFQMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNLinSolSetPrintLevel_SPTFQMR(farg1, farg2) & -bind(C, name="_wrap_FSUNLinSolSetPrintLevel_SPTFQMR") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -539,37 +519,5 @@ function FSUNLinSolFree_SPTFQMR(s) & swig_result = fresult end function -function FSUNLinSolSetInfoFile_SPTFQMR(ls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(ls) -farg2 = info_file -fresult = swigc_FSUNLinSolSetInfoFile_SPTFQMR(farg1, farg2) -swig_result = fresult -end function - -function FSUNLinSolSetPrintLevel_SPTFQMR(ls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNLinearSolver), target, intent(inout) :: ls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(ls) -farg2 = print_level -fresult = swigc_FSUNLinSolSetPrintLevel_SPTFQMR(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c index 905b285380..3afafbe18c 100644 --- a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c +++ b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c @@ -416,32 +416,4 @@ SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_FixedPoint(SUNNonlinearSolver farg1, } -SWIGEXPORT int _wrap_FSUNNonlinSolSetInfoFile_FixedPoint(SUNNonlinearSolver farg1, void *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNNonlinSolSetInfoFile_FixedPoint(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNNonlinSolSetPrintLevel_FixedPoint(SUNNonlinearSolver farg1, int const *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNNonlinSolSetPrintLevel_FixedPoint(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 index 4b7cf6dfcb..a1b693a285 100644 --- a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 +++ b/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 @@ -45,8 +45,6 @@ module fsunnonlinsol_fixedpoint_mod public :: FSUNNonlinSolGetCurIter_FixedPoint public :: FSUNNonlinSolGetNumConvFails_FixedPoint public :: FSUNNonlinSolGetSysFn_FixedPoint - public :: FSUNNonlinSolSetInfoFile_FixedPoint - public :: FSUNNonlinSolSetPrintLevel_FixedPoint ! WRAPPER DECLARATIONS interface @@ -182,24 +180,6 @@ function swigc_FSUNNonlinSolGetSysFn_FixedPoint(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNNonlinSolSetInfoFile_FixedPoint(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetInfoFile_FixedPoint") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNNonlinSolSetPrintLevel_FixedPoint(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetPrintLevel_FixedPoint") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -447,37 +427,5 @@ function FSUNNonlinSolGetSysFn_FixedPoint(nls, sysfn) & swig_result = fresult end function -function FSUNNonlinSolSetInfoFile_FixedPoint(nls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(nls) -farg2 = info_file -fresult = swigc_FSUNNonlinSolSetInfoFile_FixedPoint(farg1, farg2) -swig_result = fresult -end function - -function FSUNNonlinSolSetPrintLevel_FixedPoint(nls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(nls) -farg2 = print_level -fresult = swigc_FSUNNonlinSolSetPrintLevel_FixedPoint(farg1, farg2) -swig_result = fresult -end function - end module diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c index ae1c387991..fc17b3040e 100644 --- a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c +++ b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c @@ -426,32 +426,4 @@ SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver farg1, void } -SWIGEXPORT int _wrap_FSUNNonlinSolSetInfoFile_Newton(SUNNonlinearSolver farg1, void *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - FILE *arg2 = (FILE *) 0 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (FILE *)(farg2); - result = (int)SUNNonlinSolSetInfoFile_Newton(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FSUNNonlinSolSetPrintLevel_Newton(SUNNonlinearSolver farg1, int const *farg2) { - int fresult ; - SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; - int arg2 ; - int result; - - arg1 = (SUNNonlinearSolver)(farg1); - arg2 = (int)(*farg2); - result = (int)SUNNonlinSolSetPrintLevel_Newton(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 index 52fb84ca61..634bc969c0 100644 --- a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 +++ b/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 @@ -46,8 +46,6 @@ module fsunnonlinsol_newton_mod public :: FSUNNonlinSolGetCurIter_Newton public :: FSUNNonlinSolGetNumConvFails_Newton public :: FSUNNonlinSolGetSysFn_Newton - public :: FSUNNonlinSolSetInfoFile_Newton - public :: FSUNNonlinSolSetPrintLevel_Newton ! WRAPPER DECLARATIONS interface @@ -190,24 +188,6 @@ function swigc_FSUNNonlinSolGetSysFn_Newton(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNNonlinSolSetInfoFile_Newton(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetInfoFile_Newton") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FSUNNonlinSolSetPrintLevel_Newton(farg1, farg2) & -bind(C, name="_wrap_FSUNNonlinSolSetPrintLevel_Newton") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - end interface @@ -465,37 +445,5 @@ function FSUNNonlinSolGetSysFn_Newton(nls, sysfn) & swig_result = fresult end function -function FSUNNonlinSolSetInfoFile_Newton(nls, info_file) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -type(C_PTR) :: info_file -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = c_loc(nls) -farg2 = info_file -fresult = swigc_FSUNNonlinSolSetInfoFile_Newton(farg1, farg2) -swig_result = fresult -end function - -function FSUNNonlinSolSetPrintLevel_Newton(nls, print_level) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(SUNNonlinearSolver), target, intent(inout) :: nls -integer(C_INT), intent(in) :: print_level -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = c_loc(nls) -farg2 = print_level -fresult = swigc_FSUNNonlinSolSetPrintLevel_Newton(farg1, farg2) -swig_result = fresult -end function - end module From b77a5680df02f539b512d3ef5ab18400de793499 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 27 Oct 2023 11:01:05 -0700 Subject: [PATCH 29/85] Apply suggestions from code review Co-authored-by: Daniel R. Reynolds --- examples/kinsol/serial/kinAnalytic_fp.c | 4 ---- examples/kinsol/serial/kinLaplace_picard_kry.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/examples/kinsol/serial/kinAnalytic_fp.c b/examples/kinsol/serial/kinAnalytic_fp.c index c635dcb520..fb3dbe2106 100644 --- a/examples/kinsol/serial/kinAnalytic_fp.c +++ b/examples/kinsol/serial/kinAnalytic_fp.c @@ -231,11 +231,7 @@ int main(int argc, char *argv[]) infofp = fopen("kinsol.log", "w"); if (check_retval((void *)infofp, "fopen", 0)) return(1); - // retval = KINSetInfoFile(kmem, infofp); - // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - // retval = KINSetPrintLevel(kmem, 1); - // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ------------- * Initial guess diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index 9122e8b0ef..7edd10866b 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -144,11 +144,7 @@ int main() infofp = fopen("KINSOL.log", "w"); - // retval = KINSetInfoFile(kmem, infofp); - // if (check_retval(&retval, "KINSetInfoFile", 1)) return(1); - // retval = KINSetPrintLevel(kmem, 3); - // if (check_retval(&retval, "KINSetPrintLevel", 1)) return(1); /* ---------------------- * Create SUNLinearSolver From bce63fb86cc0415e31c57456afadbe867cac24c0 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 27 Oct 2023 15:43:04 -0700 Subject: [PATCH 30/85] Feature: Fortran interface for lapack dense solver (#353) Added Fortran support for the LAPACK dense SUNLinearSolver implementation. --------- Co-authored-by: Daniel R. Reynolds --- CHANGELOG.md | 1 + doc/arkode/guide/source/Introduction.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d41c15931..0cd68c5a0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ method `ARKODE_VERNER_16_8_9`. Changed the `SUNProfiler` so that it does not rely on `MPI_WTime` in any case. This fixes https://github.com/LLNL/sundials/issues/312. + ## Changes to SUNDIALS in release 6.6.1 Updated the Tpetra NVector interface to support Trilinos 14. diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index dd4e67ae9d..cee6fae45f 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -167,6 +167,7 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. + Changes in v5.6.1 ----------------- From 1c76c856ea0eee2f9902c76c457c2fbce87b56e4 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 30 Oct 2023 16:59:58 -0700 Subject: [PATCH 31/85] remove implementation of SUNLinsSol and SUNNonlinSol printinfo functions --- src/sunlinsol/pcg/sunlinsol_pcg.c | 30 ------------------ src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 30 ------------------ src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 31 ------------------- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 30 ------------------ src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 30 ------------------ .../fixedpoint/sunnonlinsol_fixedpoint.c | 28 ----------------- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 28 ----------------- 7 files changed, 207 deletions(-) diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index eb21a71da2..46d0a24842 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -577,33 +577,3 @@ int SUNLinSolFree_PCG(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_PCG(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - PCG_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_PCG(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - PCG_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index f2e6360251..efdc437f70 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -779,33 +779,3 @@ int SUNLinSolFree_SPBCGS(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPBCGS(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPBCGS_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPBCGS(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPBCGS_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index 23ce66f615..ef5e759eee 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -818,34 +818,3 @@ int SUNLinSolFree_SPFGMR(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPFGMR(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPFGMR_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPFGMR(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPFGMR_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} - diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 3aa0934c13..4922c71740 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -867,33 +867,3 @@ int SUNLinSolFree_SPGMR(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPGMR(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPGMR_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPGMR(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPGMR_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 47c6544819..4a5c5e6c8d 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -906,33 +906,3 @@ int SUNLinSolFree_SPTFQMR(SUNLinearSolver S) free(S); S = NULL; return(SUNLS_SUCCESS); } - - -int SUNLinSolSetInfoFile_SPTFQMR(SUNLinearSolver S, - FILE* info_file) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - SPTFQMR_CONTENT(S)->info_file = info_file; - - return(SUNLS_SUCCESS); -} - - -int SUNLinSolSetPrintLevel_SPTFQMR(SUNLinearSolver S, - int print_level) -{ - /* check that the linear solver is non-null */ - if (S == NULL) - return(SUNLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUNLS_ILL_INPUT); - - SPTFQMR_CONTENT(S)->print_level = print_level; - - return(SUNLS_SUCCESS); -} diff --git a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c index 5204d53be7..64249652b3 100644 --- a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +++ b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c @@ -739,31 +739,3 @@ static void FreeContent(SUNNonlinearSolver NLS) return; } - -int SUNNonlinSolSetInfoFile_FixedPoint(SUNNonlinearSolver NLS, - FILE* info_file) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - FP_CONTENT(NLS)->info_file = info_file; - - return(SUN_NLS_SUCCESS); -} - -int SUNNonlinSolSetPrintLevel_FixedPoint(SUNNonlinearSolver NLS, - int print_level) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUN_NLS_ILL_INPUT); - - FP_CONTENT(NLS)->print_level = print_level; - - return(SUN_NLS_SUCCESS); -} diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index 6422b24963..75781e6018 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -499,31 +499,3 @@ int SUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver NLS, SUNNonlinSolSysFn *SysFn *SysFn = NEWTON_CONTENT(NLS)->Sys; return(SUN_NLS_SUCCESS); } - -int SUNNonlinSolSetInfoFile_Newton(SUNNonlinearSolver NLS, - FILE* info_file) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - NEWTON_CONTENT(NLS)->info_file = info_file; - - return(SUN_NLS_SUCCESS); -} - -int SUNNonlinSolSetPrintLevel_Newton(SUNNonlinearSolver NLS, - int print_level) -{ - /* check that the nonlinear solver is non-null */ - if (NLS == NULL) - return(SUN_NLS_MEM_NULL); - - /* check for valid print level */ - if (print_level < 0 || print_level > 1) - return(SUN_NLS_ILL_INPUT); - - NEWTON_CONTENT(NLS)->print_level = print_level; - - return(SUN_NLS_SUCCESS); -} From 841a6d9334b906790ff51f9cc89657f44156d7c5 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 30 Oct 2023 17:00:20 -0700 Subject: [PATCH 32/85] replace use of SetDiagnostics in some arkode examples --- .../ark_brusselator1D_task_local_nls.cpp | 53 +++++---------- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 67 +++---------------- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 44 +++--------- examples/arkode/CXX_serial/ark_heat2D.cpp | 38 ++--------- .../ark_brusselator1D_task_local_nls.c | 56 +++++----------- .../arkode/C_parallel/ark_diurnal_kry_p.c | 6 +- 6 files changed, 65 insertions(+), 199 deletions(-) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp index a6d081357c..69db66ca35 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -142,6 +142,20 @@ int main(int argc, char *argv[]) retval = SetupProblem(argc, argv, &udata, &uopt, ctx); if (check_retval(&retval, "SetupProblem", 1)) MPI_Abort(comm, 1); + /* Setup diagnostic logging if it is enabled */ + if (uopt.monitor) + { + SUNLogger logger; + + sprintf(fname, "%s/diagnostics.%06d.txt", uopt.outputdir, udata.myid); + + retval = SUNContext_GetLogger(ctx, &logger); + if (check_retval(&retval, "SUNContext_GetLogger", 1)) return 1; + + retval = SUNLogger_SetInfoFilename(logger, fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; + } + /* Create solution vector */ y = N_VMake_MPIPlusX(udata.comm, LocalNvector(udata.NEQ, ctx), ctx); if (check_retval((void *) y, "N_VMake_MPIPlusX", 0)) MPI_Abort(comm, 1); @@ -218,7 +232,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Create the ARK timestepper module */ @@ -241,16 +254,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1)) return 1; - } - /* Create the (non)linear solver */ if (uopt->global) { @@ -278,7 +281,7 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, { /* The custom task-local nonlinear solver handles the linear solve as well, so we do not need a SUNLinearSolver. */ - NLS = TaskLocalNewton(ctx, y, DFID); + NLS = TaskLocalNewton(ctx, y); if (check_retval((void *)NLS, "TaskLocalNewton", 0)) return 1; /* Attach nonlinear solver */ @@ -318,9 +321,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1); @@ -380,7 +380,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - FILE* DFID; /* diagnostics output file */ char fname[MXSTR]; /* Create the ERK timestepper module */ @@ -403,16 +402,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ERKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ERKStepSetDiagnostics", 1)) return 1; - } - /* Output initial condition */ if (udata->myid == 0 && uopt->monitor) { @@ -445,9 +434,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ERKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ERKStepGetNumSteps", 1); @@ -1083,7 +1069,7 @@ int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, } -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { void* tmp_comm; SUNNonlinearSolver NLS; @@ -1135,13 +1121,6 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) content->ncnf = 0; - /* Setup the local nonlinear solver monitoring */ - if (DFID != NULL) - { - SUNNonlinSolSetInfoFile_Newton(LOCAL_NLS(NLS), DFID); - SUNNonlinSolSetPrintLevel_Newton(LOCAL_NLS(NLS), 1); - } - return NLS; } diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 15fac77098..f64b849eaa 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -291,7 +291,6 @@ struct UserData int maxsteps = 0; // max steps between outputs (0 = use default) bool linear = true; // enable/disable linearly implicit option bool diagnostics = false; // output diagnostics - FILE *diagfp = NULL; // diagnostics output file // ----------------------------------------- // Nonlinear solver settings @@ -507,6 +506,17 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "PrintUserData", 1)) return 1; } + if (udata.diagnostics || udata.lsinfo) + { + SUNLogger logger; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) return 1; + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + } + // -------------- // Create vectors // -------------- @@ -519,13 +529,6 @@ int main(int argc, char* argv[]) // Create linear solver // -------------------- - // Open diagnostics file - if (outproc && (udata.diagnostics || udata.lsinfo)) - { - udata.diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) (udata.diagfp), "fopen", 0)) return 1; - } - // Preconditioning type int prectype = (udata.prec) ? SUN_PREC_RIGHT : SUN_PREC_NONE; @@ -536,29 +539,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, udata.diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, udata.diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -708,8 +693,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (outproc && (udata.diagnostics || udata.lsinfo)) fclose(udata.diagfp); - switch(udata.integrator) { case(0): @@ -1029,13 +1012,6 @@ static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, flag = ARKStepSetStopTime(*arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = ARKStepSetDiagnostics(*arkode_mem, udata->diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - return 0; } @@ -1084,13 +1060,6 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, flag = ARKStepSetMaxNumSteps(inner_arkode_mem, udata->maxsteps); if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = ARKStepSetDiagnostics(inner_arkode_mem, udata->diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // Wrap ARKODE as an MRIStepInnerStepper flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, stepper); @@ -1159,13 +1128,6 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, flag = MRIStepSetStopTime(*arkode_mem, udata->tf); if (check_flag(&flag, "MRIStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = MRIStepSetDiagnostics(*arkode_mem, udata->diagfp); - if (check_flag(&flag, "MRIStepSetDiagnostics", 1)) return 1; - } - return 0; } @@ -1319,13 +1281,6 @@ static int SetupMRICVODE(SUNContext ctx, UserData *udata, N_Vector y, flag = MRIStepSetStopTime(*arkode_mem, udata->tf); if (check_flag(&flag, "MRIStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && udata->outproc) - { - flag = MRIStepSetDiagnostics(*arkode_mem, udata->diagfp); - if (check_flag(&flag, "MRIStepSetDiagnostics", 1)) return 1; - } - return 0; } diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 32623f530c..d0029a06a5 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -278,7 +278,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables double t1 = 0.0; @@ -326,13 +325,17 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; + } - // Open diagnostics output file - if (udata->diagnostics || udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } + if (udata->diagnostics || udata->lsinfo) + { + SUNLogger logger = NULL; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) return 1; + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; } // ------------------------ @@ -362,29 +365,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -483,13 +468,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && outproc) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -572,8 +550,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && outproc) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index 3a78042a25..e21a015142 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -207,7 +207,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables chrono::time_point t1; @@ -236,11 +235,15 @@ int main(int argc, char* argv[]) flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - // Open diagnostics output file if (udata->diagnostics || udata->lsinfo) { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; + SUNLogger logger = NULL; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) return 1; + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; } // ---------------------- @@ -270,29 +273,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -391,13 +376,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -477,8 +455,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->diagnostics || udata->lsinfo) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c index bd7b19fccf..e035acb675 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -70,6 +70,7 @@ #include "arkode/arkode_erkstep.h" /* ERKStep */ #include "nvector/nvector_mpiplusx.h" /* MPI+X N_Vector */ #include "nvector/nvector_serial.h" /* serial N_Vector */ +#include "sundials/sundials_logger.h" #include "sunmatrix/sunmatrix_dense.h" /* dense SUNMatrix */ #include "sunlinsol/sunlinsol_dense.h" /* dense SUNLinearSolver */ #include "sunlinsol/sunlinsol_spgmr.h" /* GMRES SUNLinearSolver */ @@ -183,7 +184,7 @@ typedef struct #define LOCAL_NLS(NLS) ( GET_NLS_CONTENT(NLS)->local_nls ) /* SUNNonlinearSolver constructor */ -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID); +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); /* @@ -280,6 +281,20 @@ int main(int argc, char *argv[]) retval = SetupProblem(argc, argv, udata, uopt, ctx); if (check_retval(&retval, "SetupProblem", 1)) MPI_Abort(comm, 1); + /* Setup diagnostic logging if it is enabled */ + if (uopt->monitor) + { + SUNLogger logger; + + sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); + + retval = SUNContext_GetLogger(ctx, &logger); + if (check_retval(&retval, "SUNContext_GetLogger", 1)) return 1; + + retval = SUNLogger_SetInfoFilename(logger, fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; + } + /* Create solution vector */ y = N_VMake_MPIPlusX(udata->comm, N_VNew_Serial(udata->NEQ, ctx), ctx); if (check_retval((void *) y, "N_VMake_MPIPlusX", 0)) MPI_Abort(comm, 1); @@ -351,7 +366,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npre, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Create the ARK timestepper module */ @@ -374,16 +388,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1)) return 1; - } - /* Create the (non)linear solver */ if (uopt->global) { @@ -411,7 +415,7 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, { /* The custom task-local nonlinear solver handles the linear solve as well, so we do not need a SUNLinearSolver */ - NLS = TaskLocalNewton(ctx, y, DFID); + NLS = TaskLocalNewton(ctx, y); if (check_retval((void *)NLS, "TaskLocalNewton", 0)) return 1; /* Attach nonlinear solver */ @@ -451,9 +455,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1); @@ -516,7 +517,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - FILE* DFID; /* diagnostics output file */ char fname[MXSTR]; /* Create the ERK timestepper module */ @@ -539,16 +539,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->monitor) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ERKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ERKStepSetDiagnostics", 1)) return 1; - } - /* Output initial condition */ if (udata->myid == 0 && uopt->monitor) { @@ -581,9 +571,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->monitor) fclose(DFID); - /* Get final statistics */ retval = ERKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ERKStepGetNumSteps", 1); @@ -1173,7 +1160,7 @@ int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, } -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { void* tmp_comm; SUNNonlinearSolver NLS; @@ -1225,13 +1212,6 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) content->ncnf = 0; - /* Setup the local nonlinear solver monitoring */ - if (DFID != NULL) - { - SUNNonlinSolSetInfoFile_Newton(LOCAL_NLS(NLS), DFID); - SUNNonlinSolSetPrintLevel_Newton(LOCAL_NLS(NLS), 1); - } - return NLS; } diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index 1946966c76..8fe41d8e7f 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -834,7 +834,7 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, /* jok = SUNTRUE: Copy Jbd to P */ for (ly = 0; ly < MYSUB; ly++) for (lx = 0; lx < MXSUB; lx++) - denseCopy(Jbd[lx][ly], P[lx][ly], NVARS, NVARS); + SUNDlsMat_denseCopy(Jbd[lx][ly], P[lx][ly], NVARS, NVARS); *jcurPtr = SUNFALSE; @@ -869,7 +869,7 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, IJth(j,1,2) = -Q2*c1 + q4coef; IJth(j,2,1) = Q1*C3 - Q2*c2; IJth(j,2,2) = (-Q2*c1 - q4coef) + diag; - denseCopy(j, a, NVARS, NVARS); + SUNDlsMat_denseCopy(j, a, NVARS, NVARS); } } @@ -880,7 +880,7 @@ static int Precond(realtype tn, N_Vector u, N_Vector fu, /* Scale by -gamma */ for (ly = 0; ly < MYSUB; ly++) for (lx = 0; lx < MXSUB; lx++) - denseScale(-gamma, P[lx][ly], NVARS, NVARS); + SUNDlsMat_denseScale(-gamma, P[lx][ly], NVARS, NVARS); /* Add identity matrix and do LU decompositions on blocks in place */ for (lx = 0; lx < MXSUB; lx++) { From 517928718b5f753f6b222dddc85e1ec0459c004a Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 30 Oct 2023 17:08:48 -0700 Subject: [PATCH 33/85] make INFO level the default for logging --- cmake/SundialsBuildOptionsPre.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index b9959f745d..227c734045 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -76,12 +76,12 @@ sundials_option(SUNDIALS_BUILD_WITH_PROFILING BOOL "${DOCSTR}" OFF) # --------------------------------------------------------------- set(DOCSTR "Build with logging capabilities enabled (0 = no logging, 1 = errors, 2 = +warnings, 3 = +info, 4 = +debug, 5 = +extras") -sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 0 +sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 3 OPTIONS "0;1;2;3;4;5") -if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 1) +if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 4) message(STATUS "SUNDIALS logging level set to ${SUNDIALS_LOGGING_LEVEL}") - message(WARNING "SUNDIALS built with logging turned on, performance may be affected.") + message(WARNING "SUNDIALS built with debug logging turned on, performance may be affected.") endif() set(DOCSTR "Build SUNDIALS logging with MPI support") From 196c32adc734f00fd8d1942f70ebd98287175cdb Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Wed, 1 Nov 2023 21:14:19 -0700 Subject: [PATCH 34/85] change arkode INFO logging to DEBUG --- src/arkode/arkode.c | 8 ++++---- src/arkode/arkode_adapt.c | 16 ++++++++-------- src/arkode/arkode_arkstep.c | 8 ++++---- src/arkode/arkode_erkstep.c | 12 ++++++------ src/arkode/arkode_interp.c | 8 ++++---- src/arkode/arkode_ls.c | 8 ++++---- src/arkode/arkode_mristep.c | 14 +++++++------- src/arkode/arkode_relaxation.c | 8 ++++---- src/sundials/sundials_logger.c | 10 +++++----- 9 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 601abca7ae..2174eab0f6 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -840,8 +840,8 @@ int arkEvolve(ARKodeMem ark_mem, realtype tout, N_Vector yout, attempts++; ark_mem->nst_attempts++; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkEvolve", "start-step", "step = %li, attempt = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, attempts, ark_mem->h, ark_mem->tcur); @@ -2423,8 +2423,8 @@ int arkCompleteStep(ARKodeMem ark_mem, realtype dsm) ark_mem->tcur = ark_mem->tstop; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkCompleteStep", "end-step", "step = %li, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, ark_mem->h, ark_mem->tcur); diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 617681e9f5..1082a565ae 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -183,18 +183,18 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1], hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1], h_acc, h_cfl); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "error-history", "ecur = %"RSYM", ehist[0] = %"RSYM", ehist[0] = %"RSYM, ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1]); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "step-history", "hcur = %"RSYM", hhist[0] = %"RSYM", hhist[0] = %"RSYM, hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1]); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-before-bounds", "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif @@ -213,8 +213,8 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, if (ark_mem->report) fprintf(ark_mem->diagfp, "%"RSYM" %"RSYM" ", h_acc, h_cfl); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-after-max-min-bounds", "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif @@ -248,8 +248,8 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, if (ark_mem->report) fprintf(ark_mem->diagfp, "%"RSYM"\n", ark_mem->eta); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkAdapt", +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-eta", "eta = %"RSYM, ark_mem->eta); #endif diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 3bd782f41f..493983a410 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1638,8 +1638,8 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) else ark_mem->tcur = ark_mem->tn + step_mem->Be->c[is]*ark_mem->h; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "start-stage", "step = %li, stage = %i, implicit = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, is, implicit_stage, ark_mem->h, ark_mem->tcur); @@ -1857,8 +1857,8 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "ARKStep etest %li %"RSYM" %"RSYM"\n", ark_mem->nst, ark_mem->h, *dsmPtr); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "error-test", "step = %li, h = %"RSYM", dsm = %"RSYM, ark_mem->nst, ark_mem->h, *dsmPtr); diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index ebc413e576..2b78f28d6c 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -759,8 +759,8 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) cvals = step_mem->cvals; Xvecs = step_mem->Xvecs; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "start-stage", "step = %li, stage = 0, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, ark_mem->h, ark_mem->tcur); @@ -789,8 +789,8 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "ERKStep step %li %"RSYM" %i %"RSYM"\n", ark_mem->nst, ark_mem->h, is, ark_mem->tcur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "start-stage", "step = %li, stage = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, is, ark_mem->h, ark_mem->tcur); @@ -851,8 +851,8 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "ERKStep etest %li %"RSYM" %"RSYM"\n", ark_mem->nst, ark_mem->h, *dsmPtr); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "error-test", "step = %li, h = %"RSYM", dsm = %"RSYM, ark_mem->nst, ark_mem->h, *dsmPtr); diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index 30ee7aece8..e434175df1 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -504,8 +504,8 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, q = SUNMAX(order, 0); /* respect lower bound */ q = SUNMIN(q, HINT_DEGREE(interp)); /* respect max possible */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkInterpEvaluate_Hermite", "interp-eval", "tau = %"RSYM", d = %i, q = %i", tau, d, q); #endif @@ -1182,8 +1182,8 @@ int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp I, q = SUNMAX(degree, 0); /* respect lower bound */ q = SUNMIN(q, nhist-1); /* respect max possible */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkInterpEvaluate_Lagrange", "interp-eval", "tau = %"RSYM", d = %i, q = %i", tau, deriv, q); #endif diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 71c05682a6..2645a83116 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -2735,8 +2735,8 @@ int arkLsSolve(void* arkode_mem, N_Vector b, realtype tnow, fprintf(ark_mem->diagfp, "ARKLS kry %"RSYM" %"RSYM" %i %i\n", bnorm, resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkLsSolve", +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsSolve", "ls-stats", "bnorm = %"RSYM", resnorm = %"RSYM ", ls_iters = %i, prec_solves = %i", bnorm, resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); @@ -3154,8 +3154,8 @@ int arkLsMassSolve(void *arkode_mem, N_Vector b, realtype nlscoef) fprintf(ark_mem->diagfp, "ARKLS mass %"RSYM" %i %i\n", resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsMassSolve", "mass-ls-stats", "resnorm = %"RSYM", ls_iters = %i, prec_solves = %i", resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 11e74e86a5..610fa2701f 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1507,8 +1507,8 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "MRIStep step %li %"RSYM" %i %"RSYM"\n", ark_mem->nst, ark_mem->h, is, ark_mem->tcur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "start-stage", "step = %li, stage = %i, h = %"RSYM", tcur = %"RSYM, ark_mem->nst, is, ark_mem->h, ark_mem->tcur); @@ -1617,8 +1617,8 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) fprintf(ark_mem->diagfp, "MRIStep etest %li %"RSYM" %"RSYM"\n", ark_mem->nst, ark_mem->h, *dsmPtr); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "error-test", "step = %li, h = %"RSYM", dsm = %"RSYM, ark_mem->nst, ark_mem->h, *dsmPtr); @@ -2744,7 +2744,7 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, if (stepper->ops == NULL) return ARK_ILL_INPUT; if (stepper->ops->evolve == NULL) return ARK_ILL_INPUT; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, "ARKODE::mriStepInnerStepper_Evolve", "start-inner-evolve", "t0 = %"RSYM", tout = %"RSYM, t0, tout); @@ -2752,7 +2752,7 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, stepper->last_flag = stepper->ops->evolve(stepper, t0, tout, y); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, "ARKODE::mriStepInnerStepper_Evolve", "end-inner-evolve", "flag = %i", stepper->last_flag); @@ -2785,7 +2785,7 @@ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, if (stepper == NULL) return ARK_ILL_INPUT; if (stepper->ops == NULL) return ARK_ILL_INPUT; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, "ARKODE::mriStepInnerStepper_Reset", "reset-inner-state", "tR = %"RSYM, tR); diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index cc9fb5d0b8..5e4eca24a4 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -817,8 +817,8 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, realtype* dsm_inout, /* Cut step size and try again */ ark_mem->eta = relax_mem->eta_fail; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "relaxation", "relaxation failed"); #endif @@ -834,8 +834,8 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, realtype* dsm_inout, N_VLinearSum(relax_val, ark_mem->ycur, (ONE - relax_val), ark_mem->yn, ark_mem->ycur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "relaxation", "relaxation parameter = %"RSYM", relaxed h = %"RSYM ", relaxed error = %"RSYM, diff --git a/src/sundials/sundials_logger.c b/src/sundials/sundials_logger.c index b0ae437223..872d1e4730 100644 --- a/src/sundials/sundials_logger.c +++ b/src/sundials/sundials_logger.c @@ -143,7 +143,7 @@ static sunbooleantype sunLoggerIsOutputRank(SUNLogger logger, int* rank_ref) #else if (rank_ref) { - *rank_ref = -1; + *rank_ref = 0; } retval = SUNTRUE; #endif @@ -260,7 +260,7 @@ int SUNLogger_SetErrorFilename(SUNLogger logger, const char* error_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for ERROR, but a ERROR file was provided. " "Set the logging level to >= %d and recompile if ERROR output level " - "is desired.\n", SUN_LOGLEVEL_ERROR, SUNDIALS_LOGGING_LEVEL); + "is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_ERROR); #endif } @@ -306,7 +306,7 @@ int SUNLogger_SetWarningFilename(SUNLogger logger, const char* warning_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for WARNING, but a WARNING file was provided. " "Set the logging level to >= %d and recompile if WARNING output " - "level is desired.\n", SUN_LOGLEVEL_WARNING, SUNDIALS_LOGGING_LEVEL); + "level is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_WARNING); #endif } @@ -352,7 +352,7 @@ int SUNLogger_SetInfoFilename(SUNLogger logger, const char* info_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for INFO, but a INFO file was provided. Set the " "logging level to >= %d and recompile if INFO output level is " - "desired.\n", SUN_LOGLEVEL_INFO, SUNDIALS_LOGGING_LEVEL); + "desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_INFO); #endif } @@ -398,7 +398,7 @@ int SUNLogger_SetDebugFilename(SUNLogger logger, const char* debug_filename) "SUNDIALS_LOGGING_LEVEL=%d (build time option) " "is set too low for DEBUG output, but a DEBUG file was provided. " "Set the logging level to >= %d and recompile if DEBUG output level " - "is desired.\n", SUN_LOGLEVEL_DEBUG, SUNDIALS_LOGGING_LEVEL); + "is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_DEBUG); #endif } From e47a8c3f83e1804d00ee73f74c5898df6d0f7114 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Wed, 1 Nov 2023 21:15:37 -0700 Subject: [PATCH 35/85] add debugging filename --- examples/arkode/CXX_serial/ark_heat2D.cpp | 3 +++ examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index e21a015142..1438406316 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -244,6 +244,9 @@ int main(int argc, char* argv[]) flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; } // ---------------------- diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c index e035acb675..3110dc980f 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -293,6 +293,9 @@ int main(int argc, char *argv[]) retval = SUNLogger_SetInfoFilename(logger, fname); if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; + + retval = SUNLogger_SetDebugFilename(logger, fname); + if (check_retval(&retval, "SUNLogger_SetInfoFilename", 1)) return 1; } /* Create solution vector */ From 32501fae99d3af6c8ffe423d0e4cd089102c6c17 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 3 Nov 2023 11:30:33 -0600 Subject: [PATCH 36/85] clean up use of removed functions --- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 3 ++ examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 3 ++ .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 17 ------ .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 49 ----------------- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 54 ------------------- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 54 ------------------- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 49 ----------------- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 34 ------------ .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 35 ------------ .../CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 6 --- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp | 1 - .../kin_heat2D_nonlin_hypre_pfmg.cpp | 6 --- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 1 - 13 files changed, 6 insertions(+), 306 deletions(-) diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index f64b849eaa..f8ac079fb2 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -515,6 +515,9 @@ int main(int argc, char* argv[]) flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetDebugFilename", 1)) return 1; } // -------------- diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index d0029a06a5..7fc1447690 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -336,6 +336,9 @@ int main(int argc, char* argv[]) flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) return 1; + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetDebugFilename", 1)) return 1; } // ------------------------ diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index f4b27d9bf8..98d0e607be 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -362,7 +362,6 @@ int main(int argc, char* argv[]) SUNMatrix A = NULL; // matrix for Jacobian SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables double t1 = 0.0; @@ -410,13 +409,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if (udata->diagnostics) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -533,13 +525,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && outproc) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -622,8 +607,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->diagnostics && outproc) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver SUNMatDestroy(A); // Free matrix diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index b9468dfc3f..c917d3b737 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -170,13 +170,11 @@ struct UserData int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off bool matvec; // use hypre matrix-vector product - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -321,7 +319,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file // Timing variables double t1 = 0.0; @@ -369,13 +366,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if (udata->diagnostics || udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -405,29 +395,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // --------------------- @@ -536,13 +508,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata->tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (udata->diagnostics && outproc) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -625,8 +590,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && outproc) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -2076,13 +2039,11 @@ static int InitUserData(UserData *udata) udata->controller = 0; // PID controller udata->maxsteps = 0; // use default udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning udata->matvec = false; // use hypre matrix-vector product - udata->lsinfo = false; // output residual history udata->liniters = 10; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -2244,10 +2205,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { @@ -2257,10 +2214,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->matvec = true; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2415,10 +2368,8 @@ static void InputHelp() cout << " --order : method order" << endl; cout << " --fixedstep : used fixed step size" << endl; cout << " --controller : time step adaptivity controller" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --matvec : use hypre matrix-vector product" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index 9aae281556..e5a9c41b4f 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -177,13 +177,11 @@ struct UserData realtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off bool matvec; // use hypre matrix-vector product - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -355,7 +353,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure @@ -405,18 +402,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) - { - stringstream fname; - fname << "diagnostics." << setfill('0') << setw(5) << udata->myid_w - << ".txt"; - - const std::string tmp = fname.str(); - diagfp = fopen(tmp.c_str(), "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -446,29 +431,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // --------------------- @@ -572,13 +539,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) return 1; } - // Set diagnostics output file - if (udata->diagnostics && udata->myid_c == 0) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ------------------------ // Create XBraid interface // ------------------------ @@ -739,8 +699,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -2403,13 +2361,11 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->atol = RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning udata->matvec = false; // use hypre matrix-vector product - udata->lsinfo = false; // output residual history udata->liniters = 100; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -2596,10 +2552,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { @@ -2609,10 +2561,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->matvec = true; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2850,10 +2798,8 @@ static void InputHelp() cout << " --atol : absoltue tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order : method order" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --matvec : use hypre matrix-vector product" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index 938562ce40..256606cf59 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -175,12 +175,10 @@ struct UserData realtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -312,7 +310,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure @@ -362,18 +359,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) - { - stringstream fname; - fname << "diagnostics." << setfill('0') << setw(5) << udata->myid_w - << ".txt"; - - const std::string tmp = fname.str(); - diagfp = fopen(tmp.c_str(), "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -403,29 +388,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -519,13 +486,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) return 1; } - // Set diagnostics output file - if (udata->diagnostics && udata->myid_c == 0) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ------------------------ // Create XBraid interface // ------------------------ @@ -686,8 +646,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if ((udata->diagnostics || udata->lsinfo) && udata->myid_c == 0) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -1668,12 +1626,10 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->atol = RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning - udata->lsinfo = false; // output residual history udata->liniters = 100; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -1827,19 +1783,11 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { udata->pcg = false; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2068,9 +2016,7 @@ static void InputHelp() cout << " --atol : absoltue tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order : method order" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 5e4a0b9104..8b8c36dd82 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -120,12 +120,10 @@ struct UserData realtype atol; // absolute tolerance int order; // ARKode method order bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -244,7 +242,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *arkode_mem = NULL; // ARKODE memory structure - FILE *diagfp = NULL; // diagnostics output file braid_Core core = NULL; // XBraid memory structure braid_App app = NULL; // ARKode + XBraid interface structure @@ -302,18 +299,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "PrintUserData", 1)) return 1; } - // Open diagnostics output file - if (udata->diagnostics || udata->lsinfo) - { - stringstream fname; - fname << "diagnostics." << setfill('0') << setw(5) << udata->myid_w - << ".txt"; - - const std::string tmp = fname.str(); - diagfp = fopen(tmp.c_str(), "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } - // ---------------------- // Create serial vectors // ---------------------- @@ -341,29 +326,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -457,13 +424,6 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) return 1; } - // Set diagnostics output file - if (udata->diagnostics) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ------------------------ // Create XBraid interface // ------------------------ @@ -624,8 +584,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->diagnostics || udata->lsinfo) fclose(diagfp); - ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -1012,12 +970,10 @@ static int InitUserData(UserData *udata, SUNContext ctx) udata->atol = RCONST(1.e-10); // absolute tolerance udata->order = 3; // method order udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning - udata->lsinfo = false; // output residual history udata->liniters = 100; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -1151,10 +1107,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->pcg = false; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1377,7 +1329,6 @@ static void InputHelp() cout << " --order : method order" << endl; cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index 547f6cd342..b7a896014f 100644 --- a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp +++ b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp @@ -168,7 +168,6 @@ struct UserData // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -292,7 +291,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *cvode_mem = NULL; // CVODE memory structure - FILE *diagfp = NULL; // diagnostics output file // SUNDIALS context sundials::Context sunctx(&comm_w); @@ -324,12 +322,6 @@ int main(int argc, char* argv[]) flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - // Open diagnostics output file - if (udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -359,29 +351,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // Allocate preconditioner workspace @@ -520,8 +494,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->lsinfo && outproc) fclose(diagfp); - CVodeFree(&cvode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -1290,7 +1262,6 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) udata->prec = true; // enable preconditioning - udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations udata->msbp = 0; // use default (20 steps) udata->epslin = ZERO; // use default (0.05) @@ -1408,10 +1379,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->pcg = false; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1547,7 +1514,6 @@ static void InputHelp() cout << " --rtol : relative tolerance" << endl; cout << " --atol : absoltue tolerance" << endl; cout << " --gmres : use GMRES linear solver" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index 255520260f..fb783c1cea 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -176,7 +176,6 @@ struct UserData bool pcg; // use PCG (true) or GMRES (false) bool prec; // preconditioner on/off bool matvec; // use hypre matrix-vector product - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor @@ -334,7 +333,6 @@ int main(int argc, char* argv[]) N_Vector u = NULL; // vector for storing solution SUNLinearSolver LS = NULL; // linear solver memory structure void *cvode_mem = NULL; // CVODE memory structure - FILE *diagfp = NULL; // diagnostics output file // SUNDIALS context sundials::Context sunctx(&comm_w); @@ -363,13 +361,6 @@ int main(int argc, char* argv[]) { flag = PrintUserData(udata); if (check_flag(&flag, "PrintUserData", 1)) return 1; - - // Open diagnostics output file - if (udata->lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // ------------------------ @@ -399,29 +390,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else { LS = SUNLinSol_SPGMR(u, prectype, udata->liniters, sunctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (udata->lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } // --------------------- @@ -570,8 +543,6 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - if (udata->lsinfo && outproc) fclose(diagfp); - CVodeFree(&cvode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors @@ -2023,7 +1994,6 @@ UserData::UserData(sundials::Context& sunctx) pcg = true; // use PCG (true) or GMRES (false) prec = true; // enable preconditioning matvec = false; // use hypre matrix-vector product - lsinfo = false; // output residual history liniters = 10; // max linear iterations msbp = 0; // use default (20 steps) epslin = ZERO; // use default (0.05) @@ -2172,10 +2142,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->matvec = true; } - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -2321,7 +2287,6 @@ static void InputHelp() cout << " --atol : absoltue tolerance" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --matvec : use hypre matrix-vector product" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp index e3f1b20711..06ccccb4cc 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp @@ -1282,7 +1282,6 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options - udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations udata->epslin = RCONST(1.e-8); // relative stopping tolerance @@ -1412,10 +1411,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) udata->maxits = stoi((*argv)[arg_idx++]); } // Linear solver settings - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1488,7 +1483,6 @@ static void InputHelp() cout << " --damping : damping for Anderson Acceleration " << endl; cout << " --orthaa : orthogonalization routine used in Anderson Acceleration " << endl; cout << " --C : scalar value on exponential term " << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --pfmg_relax : relaxtion type in PFMG" << endl; diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp index dfdb220127..fb5a8c6ce1 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp @@ -108,7 +108,6 @@ struct UserData int maxits; // max number of fixed point iterations // Linear solver and preconditioner settings - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp index 1cb74e17ca..7a85c6b8d0 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp @@ -1452,7 +1452,6 @@ static int InitUserData(UserData *udata) // Linear solver and preconditioner options - udata->lsinfo = false; // output residual history udata->liniters = 20; // max linear iterations udata->epslin = RCONST(1.e-8); // use default (0.05) @@ -1629,10 +1628,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) udata->c_int = stoi((*argv)[arg_idx++]); } // Linear solver settings - else if (arg == "--lsinfo") - { - udata->lsinfo = true; - } else if (arg == "--liniters") { udata->liniters = stoi((*argv)[arg_idx++]); @@ -1756,7 +1751,6 @@ static void InputHelp() cout << " --damping : damping for Anderson Acceleration " << endl; cout << " --orthaa : orthogonalization routine used in Anderson Acceleration " << endl; cout << " --c : nonlinear function parameter" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --pfmg_relax : relaxtion type in PFMG" << endl; diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp index 409ae447a3..723b93e8f7 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp @@ -139,7 +139,6 @@ struct UserData int maxits; // max number of fixed point iterations // Linear solver and preconditioner settings - bool lsinfo; // output residual history int liniters; // number of linear iterations int msbp; // max number of steps between preconditioner setups realtype epslin; // linear solver tolerance factor From 3ebc6828053400e9071e2d18a4664e70798ec677 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 3 Nov 2023 11:41:23 -0600 Subject: [PATCH 37/85] clean removed functions in benchmarks --- benchmarks/diffusion_2D/main_arkode.cpp | 38 ----------------------- benchmarks/diffusion_2D/main_cvode.cpp | 31 ------------------- benchmarks/diffusion_2D/main_ida.cpp | 41 ------------------------- 3 files changed, 110 deletions(-) diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index 2c6e549360..ba1c7bd68d 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -119,21 +119,11 @@ int main(int argc, char* argv[]) flag = udata.setup(); if (check_flag(&flag, "UserData::setup", 1)) return 1; - // Output problem setup/options - FILE *diagfp = NULL; - if (outproc) { udata.print(); uopts.print(); uout.print(); - - // Open diagnostics output file - if (uopts.diagnostics || uopts.lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // --------------- @@ -194,28 +184,11 @@ int main(int argc, char* argv[]) LS = SUNLinSol_PCG(u, prectype, uopts.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - if (uopts.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else if (uopts.ls == "gmres") { LS = SUNLinSol_SPGMR(u, prectype, uopts.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (uopts.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } else { @@ -343,13 +316,6 @@ int main(int argc, char* argv[]) flag = ARKStepSetStopTime(arkode_mem, udata.tf); if (check_flag(&flag, "ARKStepSetStopTime", 1)) return 1; - // Set diagnostics output file - if (diagfp) - { - flag = ARKStepSetDiagnostics(arkode_mem, diagfp); - if (check_flag(&flag, "ARKStepSetDiagnostics", 1)) return 1; - } - // ----------------------- // Loop over output times // ----------------------- @@ -417,10 +383,6 @@ int main(int argc, char* argv[]) // Free MPI Cartesian communicator MPI_Comm_free(&(udata.comm_c)); - // Close diagnostics output file - if (diagfp) fclose(diagfp); - - // Free integrator and linear solver ARKStepFree(&arkode_mem); SUNLinSolFree(LS); diff --git a/benchmarks/diffusion_2D/main_cvode.cpp b/benchmarks/diffusion_2D/main_cvode.cpp index 77a917970d..92ba352f2f 100644 --- a/benchmarks/diffusion_2D/main_cvode.cpp +++ b/benchmarks/diffusion_2D/main_cvode.cpp @@ -114,21 +114,11 @@ int main(int argc, char* argv[]) flag = udata.setup(); if (check_flag(&flag, "UserData::setup", 1)) return 1; - // Output problem setup/options - FILE *diagfp = NULL; - if (outproc) { udata.print(); uopts.print(); uout.print(); - - // Open diagnostics output file - if (uopts.lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // --------------- @@ -188,29 +178,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, uopts.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (uopts.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else if (uopts.ls == "gmres") { LS = SUNLinSol_SPGMR(u, prectype, uopts.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (uopts.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } else if (uopts.ls == "sludist") { @@ -390,9 +362,6 @@ int main(int argc, char* argv[]) // Free MPI Cartesian communicator MPI_Comm_free(&(udata.comm_c)); - // Close diagnostics output file - if (diagfp) fclose(diagfp); - // Free integrator and linear solver CVodeFree(&cvode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver diff --git a/benchmarks/diffusion_2D/main_ida.cpp b/benchmarks/diffusion_2D/main_ida.cpp index d34dc81948..6fb5d01b3e 100644 --- a/benchmarks/diffusion_2D/main_ida.cpp +++ b/benchmarks/diffusion_2D/main_ida.cpp @@ -28,7 +28,6 @@ struct UserOptions // Linear solver and preconditioner settings std::string ls = "cg"; // linear solver to use bool preconditioning = true; // preconditioner on/off - bool lsinfo = false; // output residual history int liniters = 20; // number of linear iterations realtype epslin = ZERO; // linear solver tolerance factor @@ -113,21 +112,11 @@ int main(int argc, char* argv[]) flag = udata.setup(); if (check_flag(&flag, "UserData::setup", 1)) return 1; - // Output problem setup/options - FILE *diagfp = NULL; - if (outproc) { udata.print(); uopts.print(); uout.print(); - - // Open diagnostics output file - if (uopts.lsinfo) - { - diagfp = fopen("diagnostics.txt", "w"); - if (check_flag((void *) diagfp, "fopen", 0)) return 1; - } } // --------------- @@ -193,29 +182,11 @@ int main(int argc, char* argv[]) { LS = SUNLinSol_PCG(u, prectype, uopts.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_PCG", 0)) return 1; - - if (uopts.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_PCG(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_PCG", 1)) return(1); - - flag = SUNLinSolSetInfoFile_PCG(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_PCG", 1)) return(1); - } } else if (uopts.ls == "gmres") { LS = SUNLinSol_SPGMR(u, prectype, uopts.liniters, ctx); if (check_flag((void *) LS, "SUNLinSol_SPGMR", 0)) return 1; - - if (uopts.lsinfo && outproc) - { - flag = SUNLinSolSetPrintLevel_SPGMR(LS, 1); - if (check_flag(&flag, "SUNLinSolSetPrintLevel_SPGMR", 1)) return(1); - - flag = SUNLinSolSetInfoFile_SPGMR(LS, diagfp); - if (check_flag(&flag, "SUNLinSolSetInfoFile_SPGMR", 1)) return(1); - } } else { @@ -386,9 +357,6 @@ int main(int argc, char* argv[]) // Free MPI Cartesian communicator MPI_Comm_free(&(udata.comm_c)); - // Close diagnostics output file - if (diagfp) fclose(diagfp); - // Free integrator and linear solver IDAFree(&ida_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver @@ -474,12 +442,6 @@ int UserOptions::parse_args(vector &args, bool outproc) args.erase(it, it + 2); } - it = find(args.begin(), args.end(), "--lsinfo"); - if (it != args.end()) - { - lsinfo = true; - args.erase(it); - } it = find(args.begin(), args.end(), "--liniters"); if (it != args.end()) @@ -507,7 +469,6 @@ void UserOptions::help() cout << " --rtol : relative tolerance" << endl; cout << " --atol : absoltue tolerance" << endl; cout << " --ls : linear solver" << endl; - cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; @@ -537,7 +498,6 @@ void UserOptions::print() #else cout << " LS = SuperLU_DIST" << endl; #endif - cout << " LS info = " << lsinfo << endl; cout << " --------------------------------- " << endl; } else @@ -546,7 +506,6 @@ void UserOptions::print() cout << " --------------------------------- " << endl; cout << " LS = " << ls << endl; cout << " precond = " << preconditioning << endl; - cout << " LS info = " << lsinfo << endl; cout << " LS iters = " << liniters << endl; cout << " epslin = " << epslin << endl; cout << " --------------------------------- " << endl; From 1652153df697751564d497247b31b9c2e9c69e91 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 3 Nov 2023 12:03:39 -0600 Subject: [PATCH 38/85] remove _spils and _direct references --- doc/shared/Install.rst | 20 ------------------- .../cvode/superludist/cvAdvDiff_sludist.cpp | 1 - scripts/cvode | 4 ---- scripts/cvodes | 4 ---- scripts/ida | 4 ---- scripts/idas | 4 ---- scripts/kinsol | 4 ---- src/kinsol/CMakeLists.txt | 1 - 8 files changed, 42 deletions(-) diff --git a/doc/shared/Install.rst b/doc/shared/Install.rst index f132538739..2a59762bd1 100644 --- a/doc/shared/Install.rst +++ b/doc/shared/Install.rst @@ -1967,15 +1967,11 @@ configuration file to build against SUNDIALS in their own CMake project. | | +----------------------------------------------+ | | | ``cvode/cvode_diag.h`` | | | +----------------------------------------------+ - | | | ``cvode/cvode_direct.h`` | - | | +----------------------------------------------+ | | | ``cvode/cvode_impl.h`` | | | +----------------------------------------------+ | | | ``cvode/cvode_ls.h`` | | | +----------------------------------------------+ | | | ``cvode/cvode_proj.h`` | - | | +----------------------------------------------+ - | | | ``cvode/cvode_spils.h`` | +------------------------------+--------------+----------------------------------------------+ | CVODES | Libraries | ``libsundials_cvodes.LIB`` | | +--------------+----------------------------------------------+ @@ -1987,13 +1983,9 @@ configuration file to build against SUNDIALS in their own CMake project. | | +----------------------------------------------+ | | | ``cvodes/cvodes_diag.h`` | | | +----------------------------------------------+ - | | | ``cvodes/cvodes_direct.h`` | - | | +----------------------------------------------+ | | | ``cvodes/cvodes_impl.h`` | | | +----------------------------------------------+ | | | ``cvodes/cvodes_ls.h`` | - | | +----------------------------------------------+ - | | | ``cvodes/cvodes_spils.h`` | +------------------------------+--------------+----------------------------------------------+ | ARKODE | Libraries | ``libsundials_arkode.LIB`` | | | +----------------------------------------------+ @@ -2029,13 +2021,9 @@ configuration file to build against SUNDIALS in their own CMake project. | | +----------------------------------------------+ | | | ``ida/ida_bbdpre.h`` | | | +----------------------------------------------+ - | | | ``ida/ida_direct.h`` | - | | +----------------------------------------------+ | | | ``ida/ida_impl.h`` | | | +----------------------------------------------+ | | | ``ida/ida_ls.h`` | - | | +----------------------------------------------+ - | | | ``ida/ida_spils.h`` | +------------------------------+--------------+----------------------------------------------+ | IDAS | Libraries | ``libsundials_idas.LIB`` | | +--------------+----------------------------------------------+ @@ -2043,11 +2031,7 @@ configuration file to build against SUNDIALS in their own CMake project. | | +----------------------------------------------+ | | | ``idas/idas_bbdpre.h`` | | | +----------------------------------------------+ - | | | ``idas/idas_direct.h`` | - | | +----------------------------------------------+ | | | ``idas/idas_impl.h`` | - | | +----------------------------------------------+ - | | | ``idas/idas_spils.h`` | +------------------------------+--------------+----------------------------------------------+ | KINSOL | Libraries | ``libsundials_kinsol.LIB`` | | +--------------+----------------------------------------------+ @@ -2055,11 +2039,7 @@ configuration file to build against SUNDIALS in their own CMake project. | | +----------------------------------------------+ | | | ``kinsol/kinsol_bbdpre.h`` | | | +----------------------------------------------+ - | | | ``kinsol/kinsol_direct.h`` | - | | +----------------------------------------------+ | | | ``kinsol/kinsol_impl.h`` | | | +----------------------------------------------+ | | | ``kinsol/kinsol_ls.h`` | - | | +----------------------------------------------+ - | | | ``kinsol/kinsol_spils.h`` | +------------------------------+--------------+----------------------------------------------+ diff --git a/examples/cvode/superludist/cvAdvDiff_sludist.cpp b/examples/cvode/superludist/cvAdvDiff_sludist.cpp index 08700e17f4..1b9ef77f15 100644 --- a/examples/cvode/superludist/cvAdvDiff_sludist.cpp +++ b/examples/cvode/superludist/cvAdvDiff_sludist.cpp @@ -46,7 +46,6 @@ #include "superlu_ddefs.h" #include /* prototypes for CVODE fcts., consts. */ -#include /* CVODE direct linear solver interface */ #include /* access to MPI-parallel N_Vector */ #include /* access to the SuperLU-DIST SUNLinearSolver */ #include /* access to the SuperLU SLU_NR_loc SUNMatrix */ diff --git a/scripts/cvode b/scripts/cvode index 2f83eb3ebf..d8501d79e0 100755 --- a/scripts/cvode +++ b/scripts/cvode @@ -38,10 +38,8 @@ $tar $tarfile $distrobase/include/cvode/cvode.h $tar $tarfile $distrobase/include/cvode/cvode_bandpre.h $tar $tarfile $distrobase/include/cvode/cvode_bbdpre.h $tar $tarfile $distrobase/include/cvode/cvode_diag.h -$tar $tarfile $distrobase/include/cvode/cvode_direct.h $tar $tarfile $distrobase/include/cvode/cvode_ls.h $tar $tarfile $distrobase/include/cvode/cvode_proj.h -$tar $tarfile $distrobase/include/cvode/cvode_spils.h $tar $tarfile $distrobase/src/cvode/LICENSE $tar $tarfile $distrobase/src/cvode/NOTICE @@ -57,7 +55,6 @@ $tar $tarfile $distrobase/src/cvode/cvode_bbdpre.c $tar $tarfile $distrobase/src/cvode/cvode_bbdpre_impl.h $tar $tarfile $distrobase/src/cvode/cvode_diag.c $tar $tarfile $distrobase/src/cvode/cvode_diag_impl.h -$tar $tarfile $distrobase/src/cvode/cvode_direct.c $tar $tarfile $distrobase/src/cvode/cvode_impl.h $tar $tarfile $distrobase/src/cvode/cvode_io.c $tar $tarfile $distrobase/src/cvode/cvode_ls.c @@ -65,7 +62,6 @@ $tar $tarfile $distrobase/src/cvode/cvode_ls_impl.h $tar $tarfile $distrobase/src/cvode/cvode_nls.c $tar $tarfile $distrobase/src/cvode/cvode_proj.c $tar $tarfile $distrobase/src/cvode/cvode_proj_impl.h -$tar $tarfile $distrobase/src/cvode/cvode_spils.c echo " --- Add cvode F2003 interface to $tarfile" diff --git a/scripts/cvodes b/scripts/cvodes index cab37658ee..88eca7d130 100755 --- a/scripts/cvodes +++ b/scripts/cvodes @@ -38,10 +38,8 @@ $tar $tarfile $distrobase/include/cvodes/cvodes.h $tar $tarfile $distrobase/include/cvodes/cvodes_bandpre.h $tar $tarfile $distrobase/include/cvodes/cvodes_bbdpre.h $tar $tarfile $distrobase/include/cvodes/cvodes_diag.h -$tar $tarfile $distrobase/include/cvodes/cvodes_direct.h $tar $tarfile $distrobase/include/cvodes/cvodes_ls.h $tar $tarfile $distrobase/include/cvodes/cvodes_proj.h -$tar $tarfile $distrobase/include/cvodes/cvodes_spils.h $tar $tarfile $distrobase/src/cvodes/LICENSE $tar $tarfile $distrobase/src/cvodes/NOTICE @@ -57,7 +55,6 @@ $tar $tarfile $distrobase/src/cvodes/cvodes_bbdpre_impl.h $tar $tarfile $distrobase/src/cvodes/cvodes.c $tar $tarfile $distrobase/src/cvodes/cvodes_diag.c $tar $tarfile $distrobase/src/cvodes/cvodes_diag_impl.h -$tar $tarfile $distrobase/src/cvodes/cvodes_direct.c $tar $tarfile $distrobase/src/cvodes/cvodes_impl.h $tar $tarfile $distrobase/src/cvodes/cvodes_io.c $tar $tarfile $distrobase/src/cvodes/cvodes_ls.c @@ -68,7 +65,6 @@ $tar $tarfile $distrobase/src/cvodes/cvodes_nls_stg.c $tar $tarfile $distrobase/src/cvodes/cvodes_nls_stg1.c $tar $tarfile $distrobase/src/cvodes/cvodes_proj.c $tar $tarfile $distrobase/src/cvodes/cvodes_proj_impl.h -$tar $tarfile $distrobase/src/cvodes/cvodes_spils.c $tar $tarfile $distrobase/src/cvodes/fmod/CMakeLists.txt $tar $tarfile $distrobase/src/cvodes/fmod/fcvodes_mod.c diff --git a/scripts/ida b/scripts/ida index cc320c286b..1c4239afc7 100755 --- a/scripts/ida +++ b/scripts/ida @@ -35,11 +35,9 @@ $tar $tarfile $distrobase/doc/ida/guide/Makefile $tar $tarfile $distrobase/doc/ida/guide/source $tar $tarfile $distrobase/include/ida/ida_bbdpre.h -$tar $tarfile $distrobase/include/ida/ida_direct.h $tar $tarfile $distrobase/include/ida/ida.h # $tar $tarfile $distrobase/include/ida/ida_petsc.h $tar $tarfile $distrobase/include/ida/ida_ls.h -$tar $tarfile $distrobase/include/ida/ida_spils.h $tar $tarfile $distrobase/src/ida/LICENSE $tar $tarfile $distrobase/src/ida/NOTICE @@ -49,7 +47,6 @@ $tar $tarfile $distrobase/src/ida/CMakeLists.txt $tar $tarfile $distrobase/src/ida/ida_bbdpre.c $tar $tarfile $distrobase/src/ida/ida_bbdpre_impl.h $tar $tarfile $distrobase/src/ida/ida.c -$tar $tarfile $distrobase/src/ida/ida_direct.c $tar $tarfile $distrobase/src/ida/ida_ic.c $tar $tarfile $distrobase/src/ida/ida_impl.h $tar $tarfile $distrobase/src/ida/ida_io.c @@ -58,7 +55,6 @@ $tar $tarfile $distrobase/src/ida/ida_io.c $tar $tarfile $distrobase/src/ida/ida_ls.c $tar $tarfile $distrobase/src/ida/ida_ls_impl.h $tar $tarfile $distrobase/src/ida/ida_nls.c -$tar $tarfile $distrobase/src/ida/ida_spils.c echo " --- Add ida F2003 interface to $tarfile" diff --git a/scripts/idas b/scripts/idas index 7604bb5983..f1a29ff27d 100755 --- a/scripts/idas +++ b/scripts/idas @@ -36,9 +36,7 @@ $tar $tarfile $distrobase/doc/idas/guide/source $tar $tarfile $distrobase/include/idas/idas.h $tar $tarfile $distrobase/include/idas/idas_bbdpre.h -$tar $tarfile $distrobase/include/idas/idas_direct.h $tar $tarfile $distrobase/include/idas/idas_ls.h -$tar $tarfile $distrobase/include/idas/idas_spils.h $tar $tarfile $distrobase/src/idas/LICENSE $tar $tarfile $distrobase/src/idas/NOTICE @@ -50,7 +48,6 @@ $tar $tarfile $distrobase/src/idas/idaa_io.c $tar $tarfile $distrobase/src/idas/idas.c $tar $tarfile $distrobase/src/idas/idas_bbdpre.c $tar $tarfile $distrobase/src/idas/idas_bbdpre_impl.h -$tar $tarfile $distrobase/src/idas/idas_direct.c $tar $tarfile $distrobase/src/idas/idas_ic.c $tar $tarfile $distrobase/src/idas/idas_impl.h $tar $tarfile $distrobase/src/idas/idas_io.c @@ -59,7 +56,6 @@ $tar $tarfile $distrobase/src/idas/idas_ls_impl.h $tar $tarfile $distrobase/src/idas/idas_nls.c $tar $tarfile $distrobase/src/idas/idas_nls_sim.c $tar $tarfile $distrobase/src/idas/idas_nls_stg.c -$tar $tarfile $distrobase/src/idas/idas_spils.c $tar $tarfile $distrobase/src/idas/fmod/CMakeLists.txt $tar $tarfile $distrobase/src/idas/fmod/fidas_mod.c diff --git a/scripts/kinsol b/scripts/kinsol index c7bf7dc752..dfb9bbc5ad 100755 --- a/scripts/kinsol +++ b/scripts/kinsol @@ -36,9 +36,7 @@ $tar $tarfile $distrobase/doc/kinsol/guide/source $tar $tarfile $distrobase/include/kinsol/kinsol.h $tar $tarfile $distrobase/include/kinsol/kinsol_bbdpre.h -$tar $tarfile $distrobase/include/kinsol/kinsol_direct.h $tar $tarfile $distrobase/include/kinsol/kinsol_ls.h -$tar $tarfile $distrobase/include/kinsol/kinsol_spils.h $tar $tarfile $distrobase/src/kinsol/LICENSE $tar $tarfile $distrobase/src/kinsol/NOTICE @@ -48,12 +46,10 @@ $tar $tarfile $distrobase/src/kinsol/CMakeLists.txt $tar $tarfile $distrobase/src/kinsol/kinsol.c $tar $tarfile $distrobase/src/kinsol/kinsol_bbdpre.c $tar $tarfile $distrobase/src/kinsol/kinsol_bbdpre_impl.h -$tar $tarfile $distrobase/src/kinsol/kinsol_direct.c $tar $tarfile $distrobase/src/kinsol/kinsol_impl.h $tar $tarfile $distrobase/src/kinsol/kinsol_io.c $tar $tarfile $distrobase/src/kinsol/kinsol_ls.c $tar $tarfile $distrobase/src/kinsol/kinsol_ls_impl.h -$tar $tarfile $distrobase/src/kinsol/kinsol_spils.c echo " --- Add kinsol F2003 interface to $tarfile" diff --git a/src/kinsol/CMakeLists.txt b/src/kinsol/CMakeLists.txt index ff7b5fcbca..aa331f6560 100644 --- a/src/kinsol/CMakeLists.txt +++ b/src/kinsol/CMakeLists.txt @@ -29,7 +29,6 @@ set(kinsol_SOURCES set(kinsol_HEADERS kinsol.h kinsol_bbdpre.h - kinsol_direct.h kinsol_ls.h ) From 3841cd5aed14619e9f5a247770e29c428d949f46 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 3 Nov 2023 12:04:03 -0600 Subject: [PATCH 39/85] remove cpodes script --- scripts/cpodes | 81 -------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100755 scripts/cpodes diff --git a/scripts/cpodes b/scripts/cpodes deleted file mode 100755 index ccc4f2bcde..0000000000 --- a/scripts/cpodes +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -tarfile=$1 -distrobase=$2 -doc=$3 - -shift 3 -tar=$* - -echo " --- Add cpodes module to $tarfile" - -#if [ $doc = "T" ]; then -#$tar $tarfile $distrobase/doc/cpodes/cps_guide.ps -#$tar $tarfile $distrobase/doc/cpodes/cps_guide.pdf -#$tar $tarfile $distrobase/doc/cpodes/cps_examples.ps -#$tar $tarfile $distrobase/doc/cpodes/cps_examples.pdf -#fi - -$tar $tarfile $distrobase/include/cpodes/cpodes.h -$tar $tarfile $distrobase/include/cpodes/cpodes_direct.h -$tar $tarfile $distrobase/include/cpodes/cpodes_dense.h -$tar $tarfile $distrobase/include/cpodes/cpodes_band.h -$tar $tarfile $distrobase/include/cpodes/cpodes_lapack.h -$tar $tarfile $distrobase/include/cpodes/cpodes_spgmr.h -$tar $tarfile $distrobase/include/cpodes/cpodes_spbcgs.h -$tar $tarfile $distrobase/include/cpodes/cpodes_sptfqmr.h -$tar $tarfile $distrobase/include/cpodes/cpodes_spils.h -$tar $tarfile $distrobase/include/cpodes/cpodes_bandpre.h -$tar $tarfile $distrobase/include/cpodes/cpodes_bbdpre.h - -$tar $tarfile $distrobase/src/cpodes/LICENSE -$tar $tarfile $distrobase/src/cpodes/NOTICE -$tar $tarfile $distrobase/src/cpodes/README -$tar $tarfile $distrobase/src/cpodes/CMakeLists.txt - -$tar $tarfile $distrobase/src/cpodes/cpodes.c -$tar $tarfile $distrobase/src/cpodes/cpodes_nls.c -$tar $tarfile $distrobase/src/cpodes/cpodes_proj.c -$tar $tarfile $distrobase/src/cpodes/cpodes_root.c -$tar $tarfile $distrobase/src/cpodes/cpodes_io.c -$tar $tarfile $distrobase/src/cpodes/cpodes_ic.c -$tar $tarfile $distrobase/src/cpodes/cpodes_direct.c -$tar $tarfile $distrobase/src/cpodes/cpodes_dense.c -$tar $tarfile $distrobase/src/cpodes/cpodes_band.c -$tar $tarfile $distrobase/src/cpodes/cpodes_lapack.c -$tar $tarfile $distrobase/src/cpodes/cpodes_spils.c -$tar $tarfile $distrobase/src/cpodes/cpodes_spgmr.c -$tar $tarfile $distrobase/src/cpodes/cpodes_spbcgs.c -$tar $tarfile $distrobase/src/cpodes/cpodes_sptfqmr.c -$tar $tarfile $distrobase/src/cpodes/cpodes_bandpre.c -$tar $tarfile $distrobase/src/cpodes/cpodes_bbdpre.c -$tar $tarfile $distrobase/src/cpodes/cpodes_private.h -$tar $tarfile $distrobase/src/cpodes/cpodes_impl.h -$tar $tarfile $distrobase/src/cpodes/cpodes_direct_impl.h -$tar $tarfile $distrobase/src/cpodes/cpodes_spils_impl.h -$tar $tarfile $distrobase/src/cpodes/cpodes_bandpre_impl.h -$tar $tarfile $distrobase/src/cpodes/cpodes_bbdpre_impl.h - -echo " --- Add cpodes examples to $tarfile" - -$tar $tarfile $distrobase/examples/cpodes/CMakeLists.txt - -$tar $tarfile $distrobase/examples/cpodes/serial/README -$tar $tarfile $distrobase/examples/cpodes/serial/CMakeLists.txt -$tar $tarfile $distrobase/examples/cpodes/serial/cpsAdvDiff_bnd.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsAdvDiff_bndL.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsAdvDiff_non.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsAkzoNob_dnsL.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsNewtCrd_dns.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsPend_dns.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsPend_dnsL.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsRoberts_dns.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsRoberts_dnsL.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsSlCrank_dns.c -$tar $tarfile $distrobase/examples/cpodes/serial/cpsVanDPol_non.c - -$tar $tarfile $distrobase/examples/cpodes/parallel/README -$tar $tarfile $distrobase/examples/cpodes/parallel/CMakeLists.txt -$tar $tarfile $distrobase/examples/cpodes/parallel/cpsHeat2D_kry_bbd_p.c -$tar $tarfile $distrobase/examples/cpodes/parallel/cpsHeat2D_kry_bbd_p.out - From b816971c661a6f532d00700f62502643d27c45aa Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 3 Nov 2023 12:15:15 -0600 Subject: [PATCH 40/85] cleanup use of removed PREC_ macro --- benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp | 4 ++-- benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp | 2 +- benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp | 2 +- benchmarks/advection_reaction_3D/raja/arkode_driver.cpp | 4 ++-- benchmarks/advection_reaction_3D/raja/cvode_driver.cpp | 2 +- benchmarks/advection_reaction_3D/raja/ida_driver.cpp | 2 +- benchmarks/diffusion_2D/main_arkode.cpp | 2 +- benchmarks/diffusion_2D/main_cvode.cpp | 2 +- benchmarks/diffusion_2D/main_ida.cpp | 2 +- examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 2 +- examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index e2cf1451e3..5557e5e151 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -107,7 +107,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = uopt->precond ? SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, PREC_NONE, 0, udata->ctx); + LS = uopt->precond ? SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ @@ -282,7 +282,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx); + LS = SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ diff --git a/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp index e147ccd8c4..dd75f4189a 100644 --- a/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/cvode_driver.cpp @@ -70,7 +70,7 @@ int EvolveProblemBDF(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "CVodeSetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = uopt->precond ? SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, PREC_NONE, 0, udata->ctx); + LS = uopt->precond ? SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ diff --git a/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp index 3ae28a43ca..792e805365 100644 --- a/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp @@ -92,7 +92,7 @@ int EvolveDAEProblem(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "IDASetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = uopt->precond ? SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, PREC_NONE, 0, udata->ctx); + LS = uopt->precond ? SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index e2cf1451e3..5557e5e151 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -107,7 +107,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = uopt->precond ? SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, PREC_NONE, 0, udata->ctx); + LS = uopt->precond ? SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ @@ -282,7 +282,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx); + LS = SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ diff --git a/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp b/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp index e147ccd8c4..dd75f4189a 100644 --- a/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/cvode_driver.cpp @@ -70,7 +70,7 @@ int EvolveProblemBDF(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "CVodeSetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = uopt->precond ? SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, PREC_NONE, 0, udata->ctx); + LS = uopt->precond ? SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ diff --git a/benchmarks/advection_reaction_3D/raja/ida_driver.cpp b/benchmarks/advection_reaction_3D/raja/ida_driver.cpp index 3ae28a43ca..792e805365 100644 --- a/benchmarks/advection_reaction_3D/raja/ida_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/ida_driver.cpp @@ -92,7 +92,7 @@ int EvolveDAEProblem(N_Vector y, UserData* udata, UserOptions* uopt) if (check_retval(&retval, "IDASetNonlinearSolver", 1, udata->myid)) return 1; /* Create linear solver */ - LS = uopt->precond ? SUNLinSol_SPGMR(y, PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, PREC_NONE, 0, udata->ctx); + LS = uopt->precond ? SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, udata->ctx) : SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, udata->ctx); if (check_retval((void *)LS, "SUNLinSol_SPGMR", 0, udata->myid)) return 1; /* Attach linear solver */ diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index ba1c7bd68d..d6c9eaefd4 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -177,7 +177,7 @@ int main(int argc, char* argv[]) sunindextype* A_row_ptrs = nullptr; #endif - int prectype = (uopts.preconditioning) ? PREC_RIGHT : PREC_NONE; + int prectype = (uopts.preconditioning) ? SUN_PREC_RIGHT : SUN_PREC_NONE; if (uopts.ls == "cg") { diff --git a/benchmarks/diffusion_2D/main_cvode.cpp b/benchmarks/diffusion_2D/main_cvode.cpp index 92ba352f2f..285a45ecd1 100644 --- a/benchmarks/diffusion_2D/main_cvode.cpp +++ b/benchmarks/diffusion_2D/main_cvode.cpp @@ -172,7 +172,7 @@ int main(int argc, char* argv[]) sunindextype* A_row_ptrs = nullptr; #endif - int prectype = (uopts.preconditioning) ? PREC_RIGHT : PREC_NONE; + int prectype = (uopts.preconditioning) ? SUN_PREC_RIGHT : SUN_PREC_NONE; if (uopts.ls == "cg") { diff --git a/benchmarks/diffusion_2D/main_ida.cpp b/benchmarks/diffusion_2D/main_ida.cpp index 6fb5d01b3e..46cf86d84c 100644 --- a/benchmarks/diffusion_2D/main_ida.cpp +++ b/benchmarks/diffusion_2D/main_ida.cpp @@ -176,7 +176,7 @@ int main(int argc, char* argv[]) sunindextype* A_row_ptrs = nullptr; #endif - int prectype = (uopts.preconditioning) ? PREC_RIGHT : PREC_NONE; + int prectype = (uopts.preconditioning) ? SUN_PREC_RIGHT : SUN_PREC_NONE; if (uopts.ls == "cg") { diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp index 06ccccb4cc..64445583a5 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp @@ -495,7 +495,7 @@ static int SetupLS(N_Vector u, void *user_data, SUNContext sunctx) // Access problem data UserData *udata = (UserData *) user_data; - int prectype = PREC_RIGHT; + int prectype = SUN_PREC_RIGHT; // Create linear solver udata->LS = SUNLinSol_PCG(u, prectype, udata->liniters, sunctx); diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp index 7a85c6b8d0..1c0f12a76c 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp @@ -688,7 +688,7 @@ static int SetupLS(N_Vector u, void *user_data, SUNContext sunctx) // Access problem data UserData *udata = (UserData *) user_data; - int prectype = PREC_RIGHT; + int prectype = SUN_PREC_RIGHT; // Create linear solver udata->LS = SUNLinSol_PCG(u, prectype, udata->liniters, sunctx); From 3cd7a85fe4b8facbb41839e836913e228d65c55f Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Sat, 4 Nov 2023 22:05:43 -0700 Subject: [PATCH 41/85] remove unused flag --- examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 8b8c36dd82..95604e54f1 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -1098,10 +1098,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { From 7764a5b9ca0f0283a2477e74530267209043bfc7 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Sat, 4 Nov 2023 22:27:37 -0700 Subject: [PATCH 42/85] regen fortran --- src/arkode/fmod/farkode_arkstep_mod.f90 | 2 + src/arkode/fmod/farkode_erkstep_mod.f90 | 2 + src/arkode/fmod/farkode_mod.f90 | 10 +++- src/sundials/fmod/fsundials_profiler_mod.c | 30 ++++++++++ src/sundials/fmod/fsundials_profiler_mod.f90 | 58 ++++++++++++++++++++ 5 files changed, 100 insertions(+), 2 deletions(-) diff --git a/src/arkode/fmod/farkode_arkstep_mod.f90 b/src/arkode/fmod/farkode_arkstep_mod.f90 index f9f0c191eb..0cc55e4104 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -44,7 +44,9 @@ module farkode_arkstep_mod integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_4 = ARKODE_ZONNEVELD_5_3_4 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_5 = ARKODE_CASH_KARP_6_4_5 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_6 = ARKODE_VERNER_8_5_6 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_7 = ARKODE_VERNER_10_6_7 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_8 = ARKODE_FEHLBERG_13_7_8 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_9 = ARKODE_VERNER_16_8_9 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_DIRK_2 = ARKODE_SDIRK_2_1_2 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_DIRK_3 = ARKODE_ARK324L2SA_DIRK_4_2_3 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_DIRK_4 = ARKODE_SDIRK_5_3_4 diff --git a/src/arkode/fmod/farkode_erkstep_mod.f90 b/src/arkode/fmod/farkode_erkstep_mod.f90 index 57279f04be..e91065ec09 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -44,7 +44,9 @@ module farkode_erkstep_mod integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_4 = ARKODE_ZONNEVELD_5_3_4 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_5 = ARKODE_CASH_KARP_6_4_5 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_6 = ARKODE_VERNER_8_5_6 + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_7 = ARKODE_VERNER_10_6_7 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_8 = ARKODE_FEHLBERG_13_7_8 + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_9 = ARKODE_VERNER_16_8_9 public :: FERKStepCreate public :: FERKStepResize public :: FERKStepReInit diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 3f51ff8cec..dca1031b8b 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -225,14 +225,20 @@ module farkode_mod enumerator :: ARKODE_ARK548L2SAb_ERK_8_4_5 enumerator :: ARKODE_ARK2_ERK_3_1_2 enumerator :: ARKODE_SOFRONIOU_SPALETTA_5_3_4 - enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_SOFRONIOU_SPALETTA_5_3_4 + enumerator :: ARKODE_SHU_OSHER_3_2_3 + enumerator :: ARKODE_VERNER_9_5_6 + enumerator :: ARKODE_VERNER_10_6_7 + enumerator :: ARKODE_VERNER_13_7_8 + enumerator :: ARKODE_VERNER_16_8_9 + enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_VERNER_16_8_9 end enum integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, 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_MAX_ERK_NUM + 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_MAX_ERK_NUM public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName ! typedef enum ARKODE_SPRKMethodID diff --git a/src/sundials/fmod/fsundials_profiler_mod.c b/src/sundials/fmod/fsundials_profiler_mod.c index f352495a34..75599fa693 100644 --- a/src/sundials/fmod/fsundials_profiler_mod.c +++ b/src/sundials/fmod/fsundials_profiler_mod.c @@ -273,6 +273,36 @@ SWIGEXPORT int _wrap_FSUNProfiler_End(void *farg1, SwigArrayWrapper *farg2) { } +SWIGEXPORT int _wrap_FSUNProfiler_GetTimerResolution(void *farg1, double *farg2) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + double *arg2 = (double *) 0 ; + int result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (double *)(farg2); + result = (int)SUNProfiler_GetTimerResolution(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_GetElapsedTime(void *farg1, SwigArrayWrapper *farg2, double *farg3) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + char *arg2 = (char *) 0 ; + double *arg3 = (double *) 0 ; + int result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (char *)(farg2->data); + arg3 = (double *)(farg3); + result = (int)SUNProfiler_GetElapsedTime(arg1,(char const *)arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNProfiler_Print(void *farg1, void *farg2) { int fresult ; SUNProfiler arg1 = (SUNProfiler) 0 ; diff --git a/src/sundials/fmod/fsundials_profiler_mod.f90 b/src/sundials/fmod/fsundials_profiler_mod.f90 index b1b6c74dc5..328243e3a3 100644 --- a/src/sundials/fmod/fsundials_profiler_mod.f90 +++ b/src/sundials/fmod/fsundials_profiler_mod.f90 @@ -31,6 +31,8 @@ module fsundials_profiler_mod end type public :: FSUNProfiler_Begin public :: FSUNProfiler_End + public :: FSUNProfiler_GetTimerResolution + public :: FSUNProfiler_GetElapsedTime public :: FSUNProfiler_Print public :: FSUNProfiler_Reset @@ -67,6 +69,26 @@ function swigc_FSUNProfiler_End(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNProfiler_GetTimerResolution(farg1, farg2) & +bind(C, name="_wrap_FSUNProfiler_GetTimerResolution") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNProfiler_GetElapsedTime(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNProfiler_GetElapsedTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FSUNProfiler_Print(farg1, farg2) & bind(C, name="_wrap_FSUNProfiler_Print") & result(fresult) @@ -166,6 +188,42 @@ function FSUNProfiler_End(p, name) & swig_result = fresult end function +function FSUNProfiler_GetTimerResolution(p, resolution) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: p +real(C_DOUBLE), target, intent(inout) :: resolution +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = p +farg2 = c_loc(resolution) +fresult = swigc_FSUNProfiler_GetTimerResolution(farg1, farg2) +swig_result = fresult +end function + +function FSUNProfiler_GetElapsedTime(p, name, time) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: p +character(kind=C_CHAR, len=*), target :: name +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +real(C_DOUBLE), target, intent(inout) :: time +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR) :: farg3 + +farg1 = p +call SWIG_string_to_chararray(name, farg2_chars, farg2) +farg3 = c_loc(time) +fresult = swigc_FSUNProfiler_GetElapsedTime(farg1, farg2, farg3) +swig_result = fresult +end function + function FSUNProfiler_Print(p, fp) & result(swig_result) use, intrinsic :: ISO_C_BINDING From 22c9bf3efeeb415d1f4251f0d910eae4f5b96806 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Sat, 4 Nov 2023 22:36:04 -0700 Subject: [PATCH 43/85] clean up more use of Diagnostics --- .../kokkos/arkode_driver.cpp | 55 +------------------ .../raja/arkode_driver.cpp | 55 +------------------ benchmarks/diffusion_2D/README.md | 2 - benchmarks/diffusion_2D/main_arkode.cpp | 10 ---- .../source/benchmarks/diffusion.rst | 4 -- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 7 --- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 1 - ...ark_brusselator1D_task_local_nls_f2003.f90 | 55 +------------------ 8 files changed, 9 insertions(+), 180 deletions(-) diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index 5557e5e151..5535557af4 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -38,7 +38,7 @@ typedef struct #define LOCAL_NLS(NLS) ( GET_NLS_CONTENT(NLS)->local_nls ) /* SUNNonlinearSolver constructor */ -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID); +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); /* -------------------------------------------------------------- @@ -59,7 +59,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ @@ -85,16 +84,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->save) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1, udata->myid)) return 1; - } - /* Create the (non)linear solver */ if (uopt->nls == "newton") { @@ -169,9 +158,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->save) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); @@ -234,7 +220,6 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ @@ -260,16 +245,6 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->save) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1, udata->myid)) return 1; - } - /* Create the (non)linear solver */ if (uopt->nls == "newton") { @@ -297,7 +272,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) { /* The custom task-local nonlinear solver handles the linear solve as well, so we do not need a SUNLinearSolver. */ - NLS = TaskLocalNewton(udata->ctx, y, DFID); + NLS = TaskLocalNewton(udata->ctx, y); if (check_retval((void *)NLS, "TaskLocalNewton", 0, udata->myid)) return 1; /* Attach nonlinear solver */ @@ -355,9 +330,6 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->save) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); @@ -415,7 +387,6 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - FILE* DFID; /* diagnostics output file */ char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ @@ -445,16 +416,6 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) retval = ERKStepSetFixedStep(arkode_mem, 1e-5); if (check_retval(&retval, "ERKStepSetFixedStep", 1, udata->myid)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->save) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ERKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ERKStepSetDiagnostics", 1, udata->myid)) return 1; - } - /* Output initial condition */ if (uopt->nout > 0) { @@ -490,9 +451,6 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->save) fclose(DFID); - /* Get final statistics */ retval = ERKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ERKStepGetNumSteps", 1, udata->myid); @@ -718,7 +676,7 @@ int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, } -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { SUNNonlinearSolver NLS; TaskLocalNewton_Content content; @@ -771,12 +729,5 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) content->ncnf = 0; - /* Setup the local nonlinear solver monitoring */ - if (DFID != NULL) - { - SUNNonlinSolSetInfoFile_Newton(LOCAL_NLS(NLS), DFID); - SUNNonlinSolSetPrintLevel_Newton(LOCAL_NLS(NLS), 1); - } - return NLS; } diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index 5557e5e151..5535557af4 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -38,7 +38,7 @@ typedef struct #define LOCAL_NLS(NLS) ( GET_NLS_CONTENT(NLS)->local_nls ) /* SUNNonlinearSolver constructor */ -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID); +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); /* -------------------------------------------------------------- @@ -59,7 +59,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ @@ -85,16 +84,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->save) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1, udata->myid)) return 1; - } - /* Create the (non)linear solver */ if (uopt->nls == "newton") { @@ -169,9 +158,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->save) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); @@ -234,7 +220,6 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - FILE* DFID = NULL; /* diagnostics output file */ char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ @@ -260,16 +245,6 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->save) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ARKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ARKStepSetDiagnostics", 1, udata->myid)) return 1; - } - /* Create the (non)linear solver */ if (uopt->nls == "newton") { @@ -297,7 +272,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) { /* The custom task-local nonlinear solver handles the linear solve as well, so we do not need a SUNLinearSolver. */ - NLS = TaskLocalNewton(udata->ctx, y, DFID); + NLS = TaskLocalNewton(udata->ctx, y); if (check_retval((void *)NLS, "TaskLocalNewton", 0, udata->myid)) return 1; /* Attach nonlinear solver */ @@ -355,9 +330,6 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->save) fclose(DFID); - /* Get final statistics */ retval = ARKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); @@ -415,7 +387,6 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - FILE* DFID; /* diagnostics output file */ char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ @@ -445,16 +416,6 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) retval = ERKStepSetFixedStep(arkode_mem, 1e-5); if (check_retval(&retval, "ERKStepSetFixedStep", 1, udata->myid)) return 1; - /* Open output file for integrator diagnostics */ - if (uopt->save) - { - sprintf(fname, "%s/diagnostics.%06d.txt", uopt->outputdir, udata->myid); - DFID = fopen(fname, "w"); - - retval = ERKStepSetDiagnostics(arkode_mem, DFID); - if (check_retval(&retval, "ERKStepSetDiagnostics", 1, udata->myid)) return 1; - } - /* Output initial condition */ if (uopt->nout > 0) { @@ -490,9 +451,6 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) iout++; } while (iout < uopt->nout); - /* close output stream */ - if (uopt->save) fclose(DFID); - /* Get final statistics */ retval = ERKStepGetNumSteps(arkode_mem, &nst); check_retval(&retval, "ERKStepGetNumSteps", 1, udata->myid); @@ -718,7 +676,7 @@ int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, } -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { SUNNonlinearSolver NLS; TaskLocalNewton_Content content; @@ -771,12 +729,5 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID) content->ncnf = 0; - /* Setup the local nonlinear solver monitoring */ - if (DFID != NULL) - { - SUNNonlinSolSetInfoFile_Newton(LOCAL_NLS(NLS), DFID); - SUNNonlinSolSetPrintLevel_Newton(LOCAL_NLS(NLS), 1); - } - return NLS; } diff --git a/benchmarks/diffusion_2D/README.md b/benchmarks/diffusion_2D/README.md index 453879953f..f98f058f7f 100644 --- a/benchmarks/diffusion_2D/README.md +++ b/benchmarks/diffusion_2D/README.md @@ -71,7 +71,6 @@ listed below. | `--maxsteps ` | Max number of steps between outputs (0 uses the integrator default) | 0 | | `--onstep ` | Number of steps to run using `ONE_STEP` mode for debugging (0 uses `NORMAL` mode) | 0 | | `--ls ` | Linear solver: CG, GMRES, or SuperLU_DIST | cg | -| `--lsinfo` | Output linear solver diagnostics | Off | | `--liniters ` | Number of linear iterations | 20 | | `--epslin ` | Linear solve tolerance factor (0 uses the integrator default) | 0 | | `--msbp ` | The linear solver setup frequency (CVODE and ARKODE only, 0 uses the integrator default) | 0 | @@ -79,7 +78,6 @@ listed below. | `--order ` | Methods order | 3 | | `--controller ` | Error controller option | 0 | | `--nonlinear` | Treat the problem as nonlinearly implicit | Linear | -| `--diagnostics` | Output integrator diagnostics | Off | ## Building diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index d6c9eaefd4..f45da5fedc 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -28,7 +28,6 @@ struct UserOptions int maxsteps = 0; // max steps between outputs int onestep = 0; // one step mode, number of steps bool linear = true; // linearly implicit RHS - bool diagnostics = false; // output diagnostics // Linear solver and preconditioner settings std::string ls = "cg"; // linear solver to use @@ -487,13 +486,6 @@ int UserOptions::parse_args(vector &args, bool outproc) args.erase(it); } - it = find(args.begin(), args.end(), "--diagnostics"); - if (it != args.end()) - { - diagnostics = true; - args.erase(it); - } - it = find(args.begin(), args.end(), "--ls"); if (it != args.end()) { @@ -544,7 +536,6 @@ void UserOptions::help() cout << " --order : method order" << endl; cout << " --fixedstep : used fixed step size" << endl; cout << " --controller : time step adaptivity controller" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --ls : linear solver" << endl; cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; @@ -567,7 +558,6 @@ void UserOptions::print() cout << " controller = " << controller << endl; cout << " max steps = " << maxsteps << endl; cout << " linear RHS = " << linear << endl; - cout << " diagnostics = " << diagnostics << endl; cout << " --------------------------------- " << endl; cout << endl; diff --git a/doc/sundials_developers/source/benchmarks/diffusion.rst b/doc/sundials_developers/source/benchmarks/diffusion.rst index 5c35ac4ec2..9b96887853 100644 --- a/doc/sundials_developers/source/benchmarks/diffusion.rst +++ b/doc/sundials_developers/source/benchmarks/diffusion.rst @@ -149,8 +149,6 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. | ``--ls`` | Linear solver: ``cg``, ``gmres``, | ``cg`` | | | ``sludist`` | | +-------------------------------+--------------------------------------+---------------+ - | ``--lsinfo`` | Output linear solver diagnostics | Off | - +-------------------------------+--------------------------------------+---------------+ | ``--liniters `` | Number of linear iterations | 20 | +-------------------------------+--------------------------------------+---------------+ | ``--epslin `` | Linear solve tolerance factor | 0 | @@ -169,8 +167,6 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. | ``--nonlinear`` | Treat the problem as nonlinearly | Linear | | | implicit | | +-------------------------------+--------------------------------------+---------------+ - | ``--diagnostics`` | Output integrator diagnostics | Off | - +-------------------------------+--------------------------------------+---------------+ Building diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index 98d0e607be..2f3b5e3bd5 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -170,7 +170,6 @@ struct UserData int controller; // step size adaptivity method int maxsteps; // max number of steps between outputs bool linear; // enable/disable linearly implicit option - bool diagnostics; // output diagnostics // Linear solver and preconditioner settings bool pcg; // use PCG (true) or GMRES (false) @@ -1634,7 +1633,6 @@ static int InitUserData(UserData *udata) udata->controller = 0; // PID controller udata->maxsteps = 0; // use default udata->linear = true; // linearly implicit problem - udata->diagnostics = false; // output diagnostics // Linear solver and preconditioner options udata->pcg = true; // use PCG (true) or GMRES (false) @@ -1762,10 +1760,6 @@ static int ReadInputs(int *argc, char ***argv, UserData *udata, bool outproc) { udata->linear = false; } - else if (arg == "--diagnostics") - { - udata->diagnostics = true; - } // Linear solver settings else if (arg == "--gmres") { @@ -1925,7 +1919,6 @@ static void InputHelp() cout << " --order : method order" << endl; cout << " --fixedstep : used fixed step size" << endl; cout << " --controller : time step adaptivity controller" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 95604e54f1..449ba6517b 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -1323,7 +1323,6 @@ static void InputHelp() cout << " --atol : absoltue tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order : method order" << endl; - cout << " --diagnostics : output diagnostics" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; diff --git a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 index 04d8477122..4e338af38a 100644 --- a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 @@ -110,7 +110,6 @@ module ode_mod real(c_double) :: t0, tf ! initial and final time real(c_double) :: rtol, atol ! relative and absolute tolerance integer(c_int) :: order ! method order - type(c_ptr) :: DFID ! ARKODE diagnostics file logical :: explicit ! use explicit or IMEX method logical :: global ! use global or task-local nonlinear solver @@ -999,7 +998,7 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) use fsunlinsol_dense_mod use fsunmatrix_dense_mod - use ode_mod, only : sunctx, Nvar, comm, DFID, monitor + use ode_mod, only : sunctx, Nvar, comm, monitor !======= Declarations ========= implicit none @@ -1055,20 +1054,6 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) nnlfi = 0 ncnf_loc = 0 - if (monitor) then - retval = FSUNNonlinSolSetInfoFile_Newton(sunnls_LOC, DFID) - if (retval /= 0) then - print *, "Error: FSUNNonlinSolSetInfoFile_Newton returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FSUNNonlinSolSetPrintLevel_Newton(sunnls_LOC, 1) - if (retval /= 0) then - print *, "Error: FSUNNonlinSolSetPrintLevel_Newton returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - end if - end function TaskLocalNewton end module nls_mod @@ -1229,7 +1214,7 @@ subroutine EvolveProblemIMEX(sunvec_y) use fsundials_nonlinearsolver_mod ! Access generic SUNNonlinearSolver use fsunnonlinsol_newton_mod ! Access Newton SUNNonlinearSolver - use ode_mod, only : sunctx, comm, myid, Neq, t0, tf, atol, rtol, order, DFID, & + use ode_mod, only : sunctx, comm, myid, Neq, t0, tf, atol, rtol, order, & monitor, global, nout, umask_s, Advection, Reaction use prec_mod, only : sunls_P, sunmat_P, PSetup, PSolve @@ -1300,20 +1285,6 @@ subroutine EvolveProblemIMEX(sunvec_y) call MPI_Abort(comm, 1, ierr) end if - ! Open output file for integrator diagnostics - if (monitor) then - - write(outname,"(A,I0.6,A)") "diagnostics.",myid,".txt" - DFID = FSUNDIALSFileOpen(trim(outname), "w") - - retval = FARKStepSetDiagnostics(arkode_mem, DFID) - if (retval /= 0) then - print *, "Error: FARKStepSetDiagnostics returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - end if - ! Create the (non)linear solver if (global) then @@ -1423,9 +1394,6 @@ subroutine EvolveProblemIMEX(sunvec_y) print *, "" end if - ! close output stream - if (monitor) call FSUNDIALSFileClose(DFID) - ! Get final statistics retval = FARKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then @@ -1552,7 +1520,7 @@ subroutine EvolveProblemExplicit(sunvec_y) use farkode_erkstep_mod ! Access ERKStep use fsundials_nvector_mod ! Access generic N_Vector - use ode_mod, only : sunctx, comm, myid, t0, tf, atol, rtol, order, DFID, monitor, & + use ode_mod, only : sunctx, comm, myid, t0, tf, atol, rtol, order, monitor, & nout, AdvectionReaction !======= Declarations ========= @@ -1608,20 +1576,6 @@ subroutine EvolveProblemExplicit(sunvec_y) call MPI_Abort(comm, 1, ierr) end if - ! Open output file for integrator diagnotics - if (monitor) then - - write(outname,"(A,I0.6,A)") "diagnostics.",myid,".txt" - DFID = FSUNDIALSFileOpen(trim(outname), "w") - - retval = FERKStepSetDiagnostics(arkode_mem, DFID) - if (retval /= 0) then - print *, "Error: FERKStepSetDiagnostics returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - end if - ! Set initial time, determine output time, and initialize output count t(1) = t0 dtout = (tf - t0) @@ -1668,9 +1622,6 @@ subroutine EvolveProblemExplicit(sunvec_y) print *, "" end if - ! close output stream - if (monitor) call FSUNDIALSFileClose(DFID) - ! Get final statistics retval = FERKStepGetNumSteps(arkode_mem, nst) if (retval /= 0) then From 31d31154e44bbda3db5cf08264417d03d4c62057 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Sun, 5 Nov 2023 21:35:24 -0800 Subject: [PATCH 44/85] remove sundials_lapack.h from install list --- scripts/shared | 1 - src/sundials/CMakeLists.txt | 5 ----- 2 files changed, 6 deletions(-) diff --git a/scripts/shared b/scripts/shared index 1347175464..ac10b9d0e9 100755 --- a/scripts/shared +++ b/scripts/shared @@ -139,7 +139,6 @@ $tar $tarfile $distrobase/include/sundials/sundials_dense.h $tar $tarfile $distrobase/include/sundials/sundials_direct.h $tar $tarfile $distrobase/include/sundials/sundials_futils.h $tar $tarfile $distrobase/include/sundials/sundials_iterative.h -$tar $tarfile $distrobase/include/sundials/sundials_lapack.h $tar $tarfile $distrobase/include/sundials/sundials_linearsolver.h $tar $tarfile $distrobase/include/sundials/sundials_logger.h $tar $tarfile $distrobase/include/sundials/sundials_math.h diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index 08afde2570..0a73f5666a 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -64,11 +64,6 @@ if(ENABLE_SYCL) list(APPEND sundials_HEADERS sundials_sycl_policies.hpp) endif() -# If Blas/Lapack support was enabled, add the Lapack interface headers -if(BUILD_SUNLINSOL_LAPACKBAND OR BUILD_SUNLINSOL_LAPACKDENSE) - list(APPEND sundials_HEADERS sundials_lapack.h) -endif() - # If enabled, add the XBraid interface header if(ENABLE_XBRAID) list(APPEND sundials_HEADERS sundials_xbraid.h) From a10585bc9fe075b9c44f2c04667110d99779ec72 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Sun, 5 Nov 2023 22:20:16 -0800 Subject: [PATCH 45/85] use SUN_RCONST --- src/arkode/arkode_butcher_erk.def | 646 +++++++++++++++--------------- 1 file changed, 323 insertions(+), 323 deletions(-) diff --git a/src/arkode/arkode_butcher_erk.def b/src/arkode/arkode_butcher_erk.def index 579e4655d0..edb11c3aac 100644 --- a/src/arkode/arkode_butcher_erk.def +++ b/src/arkode/arkode_butcher_erk.def @@ -176,20 +176,20 @@ ARK_BUTCHER_TABLE(ARKODE_SHU_OSHER_3_2_3, { /* Shu-Osher-ERK */ B->q = 3; B->p = 2; - B->A[1][0] = RCONST(1.0); - B->A[2][0] = RCONST(1.0)/RCONST(4.0); - B->A[2][1] = RCONST(1.0)/RCONST(4.0); + B->A[1][0] = SUN_RCONST(1.0); + B->A[2][0] = SUN_RCONST(1.0)/SUN_RCONST(4.0); + B->A[2][1] = SUN_RCONST(1.0)/SUN_RCONST(4.0); - B->b[0] = RCONST(1.0)/RCONST(6.0); - B->b[1] = RCONST(1.0)/RCONST(6.0); - B->b[2] = RCONST(2.0)/RCONST(3.0); + B->b[0] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->b[1] = SUN_RCONST(1.0)/SUN_RCONST(6.0); + B->b[2] = SUN_RCONST(2.0)/SUN_RCONST(3.0); - B->d[0] = RCONST(291485418878409.0)/RCONST(1.0e15); - B->d[1] = RCONST(291485418878409.0)/RCONST(1.0e15); - B->d[2] = RCONST(208514581121591.0)/RCONST(5.0e14); + B->d[0] = SUN_RCONST(291485418878409.0)/SUN_RCONST(1.0e15); + B->d[1] = SUN_RCONST(291485418878409.0)/SUN_RCONST(1.0e15); + B->d[2] = SUN_RCONST(208514581121591.0)/SUN_RCONST(5.0e14); - B->c[1] = RCONST(1.0); - B->c[2] = RCONST(1.0)/RCONST(2.0); + B->c[1] = SUN_RCONST(1.0); + B->c[2] = SUN_RCONST(1.0)/SUN_RCONST(2.0); return B; }) @@ -675,58 +675,58 @@ ARK_BUTCHER_TABLE(ARKODE_VERNER_9_5_6, { /* Verner-6-5b (DOI: 10.1007/s11075-009 B->q = 6; B->p = 5; - B->A[1][0] = RCONST(0.06); - B->A[2][0] = RCONST(0.01923996296296296218408805600574851268902); - B->A[2][1] = RCONST(0.07669337037037037008158080197972594760358); - B->A[3][0] = RCONST(0.035975); - B->A[3][2] = RCONST(0.107925); - B->A[4][0] = RCONST(1.318683415233148359391179837984964251518); - B->A[4][2] = RCONST(-5.042058063628561903612990136025473475456); - B->A[4][3] = RCONST(4.220674648395413619539340288611128926277); - B->A[5][0] = RCONST(-41.87259166432750845388000016100704669952); - B->A[5][2] = RCONST(159.432562163137475863550207577645778656); - B->A[5][3] = RCONST(-122.1192135650100425436903606168925762177); - B->A[5][4] = RCONST(5.531743066200053071668207849143072962761); - B->A[6][0] = RCONST(-54.43015693531650356362661113962531089783); - B->A[6][2] = RCONST(207.0672513650184782818541862070560455322); - B->A[6][3] = RCONST(-158.6108137845899932472093496471643447876); - B->A[6][4] = RCONST(6.99181658595024213553870140458457171917); - B->A[6][5] = RCONST(-0.01859723106220323093906721112489321967587); - B->A[7][0] = RCONST(-54.66374178728197819054912542924284934998); - B->A[7][2] = RCONST(207.9528062553893619224254507571458816528); - B->A[7][3] = RCONST(-159.2889574744995115906931459903717041016); - B->A[7][4] = RCONST(7.018743740796944408089075295720249414444); - B->A[7][5] = RCONST(-0.01833878590504572220210022237552038859576); - B->A[7][6] = RCONST(-0.000511948499788209866745436471546781831421); - B->A[8][0] = RCONST(0.0343895786835703570760713887466408777982); - B->A[8][3] = RCONST(0.2582624555633503682372520415810868144035); - B->A[8][4] = RCONST(0.4209371189673536961528554911637911573052); - B->A[8][5] = RCONST(4.405396469669310199890333024086430668831); - B->A[8][6] = RCONST(-176.4831190242986451721662888303399085999); - B->A[8][7] = RCONST(172.3641334014150743314530700445175170898); - - B->b[0] = RCONST(0.0343895786835703570760713887466408777982); - B->b[3] = RCONST(0.2582624555633503682372520415810868144035); - B->b[4] = RCONST(0.4209371189673536961528554911637911573052); - B->b[5] = RCONST(4.405396469669310199890333024086430668831); - B->b[6] = RCONST(-176.4831190242986451721662888303399085999); - B->b[7] = RCONST(172.3641334014150743314530700445175170898); - - B->d[0] = RCONST(0.04909967648382489863179145572757988702506); - B->d[3] = RCONST(0.2251112229516524232408869465871248394251); - B->d[4] = RCONST(0.4694682253029561769253064085205551236868); - B->d[5] = RCONST(0.806579224998886790132246460416354238987); - B->d[7] = RCONST(-0.607119489177795901291290192602900788188); - B->d[8] = RCONST(0.05686113944047568868889186433079885318875); - - B->c[1] = RCONST(0.06); - B->c[2] = RCONST(0.09593333333333333333333333333333333333333); - B->c[3] = RCONST(0.1439); - B->c[4] = RCONST(0.4973); - B->c[5] = RCONST(0.9725); - B->c[6] = RCONST(0.9995); - B->c[7] = RCONST(1.0); - B->c[8] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.06); + B->A[2][0] = SUN_RCONST(0.01923996296296296218408805600574851268902); + B->A[2][1] = SUN_RCONST(0.07669337037037037008158080197972594760358); + B->A[3][0] = SUN_RCONST(0.035975); + B->A[3][2] = SUN_RCONST(0.107925); + B->A[4][0] = SUN_RCONST(1.318683415233148359391179837984964251518); + B->A[4][2] = SUN_RCONST(-5.042058063628561903612990136025473475456); + B->A[4][3] = SUN_RCONST(4.220674648395413619539340288611128926277); + B->A[5][0] = SUN_RCONST(-41.87259166432750845388000016100704669952); + B->A[5][2] = SUN_RCONST(159.432562163137475863550207577645778656); + B->A[5][3] = SUN_RCONST(-122.1192135650100425436903606168925762177); + B->A[5][4] = SUN_RCONST(5.531743066200053071668207849143072962761); + B->A[6][0] = SUN_RCONST(-54.43015693531650356362661113962531089783); + B->A[6][2] = SUN_RCONST(207.0672513650184782818541862070560455322); + B->A[6][3] = SUN_RCONST(-158.6108137845899932472093496471643447876); + B->A[6][4] = SUN_RCONST(6.99181658595024213553870140458457171917); + B->A[6][5] = SUN_RCONST(-0.01859723106220323093906721112489321967587); + B->A[7][0] = SUN_RCONST(-54.66374178728197819054912542924284934998); + B->A[7][2] = SUN_RCONST(207.9528062553893619224254507571458816528); + B->A[7][3] = SUN_RCONST(-159.2889574744995115906931459903717041016); + B->A[7][4] = SUN_RCONST(7.018743740796944408089075295720249414444); + B->A[7][5] = SUN_RCONST(-0.01833878590504572220210022237552038859576); + B->A[7][6] = SUN_RCONST(-0.000511948499788209866745436471546781831421); + B->A[8][0] = SUN_RCONST(0.0343895786835703570760713887466408777982); + B->A[8][3] = SUN_RCONST(0.2582624555633503682372520415810868144035); + B->A[8][4] = SUN_RCONST(0.4209371189673536961528554911637911573052); + B->A[8][5] = SUN_RCONST(4.405396469669310199890333024086430668831); + B->A[8][6] = SUN_RCONST(-176.4831190242986451721662888303399085999); + B->A[8][7] = SUN_RCONST(172.3641334014150743314530700445175170898); + + B->b[0] = SUN_RCONST(0.0343895786835703570760713887466408777982); + B->b[3] = SUN_RCONST(0.2582624555633503682372520415810868144035); + B->b[4] = SUN_RCONST(0.4209371189673536961528554911637911573052); + B->b[5] = SUN_RCONST(4.405396469669310199890333024086430668831); + B->b[6] = SUN_RCONST(-176.4831190242986451721662888303399085999); + B->b[7] = SUN_RCONST(172.3641334014150743314530700445175170898); + + B->d[0] = SUN_RCONST(0.04909967648382489863179145572757988702506); + B->d[3] = SUN_RCONST(0.2251112229516524232408869465871248394251); + B->d[4] = SUN_RCONST(0.4694682253029561769253064085205551236868); + B->d[5] = SUN_RCONST(0.806579224998886790132246460416354238987); + B->d[7] = SUN_RCONST(-0.607119489177795901291290192602900788188); + B->d[8] = SUN_RCONST(0.05686113944047568868889186433079885318875); + + B->c[1] = SUN_RCONST(0.06); + B->c[2] = SUN_RCONST(0.09593333333333333333333333333333333333333); + B->c[3] = SUN_RCONST(0.1439); + B->c[4] = SUN_RCONST(0.4973); + B->c[5] = SUN_RCONST(0.9725); + B->c[6] = SUN_RCONST(0.9995); + B->c[7] = SUN_RCONST(1.0); + B->c[8] = SUN_RCONST(1.0); return B; }) @@ -735,67 +735,67 @@ ARK_BUTCHER_TABLE(ARKODE_VERNER_10_6_7, { /* Verner-7-6 (DOI: 10.1007/s11075-009 B->q = 7; B->p = 6; - B->A[1][0] = RCONST(0.005); - B->A[2][0] = RCONST(-1.076790123456790123456790123456790123457); - B->A[2][1] = RCONST(1.185679012345679012345679012345679012346); - B->A[3][0] = RCONST(0.04083333333333333333333333333333333333333); - B->A[3][2] = RCONST(0.1225); - B->A[4][0] = RCONST(0.6389139236255726439495106205868069082499); - B->A[4][2] = RCONST(-2.45567263822365688952231721486896276474); - B->A[4][3] = RCONST(2.272258714598084150537715686368755996227); - B->A[5][0] = RCONST(-2.661577375018756796976049372460693120956); - B->A[5][2] = RCONST(10.80451388645613874928130826447159051895); - B->A[5][3] = RCONST(-8.353914657396199316963247838430106639862); - B->A[5][4] = RCONST(0.8204875949566569071080834874010179191828); - B->A[6][0] = RCONST(6.067741434696771740675558248767629265785); - B->A[6][2] = RCONST(-24.71127363591108760942915978375822305679); - B->A[6][3] = RCONST(20.42751793078889477328630164265632629395); - B->A[6][4] = RCONST(-1.906157978816647169395537275704555213451); - B->A[6][5] = RCONST(1.006172249242067939789535557792987674475); - B->A[7][0] = RCONST(12.05467007625320441377425595419481396675); - B->A[7][2] = RCONST(-49.75478495046898785858502378687262535095); - B->A[7][3] = RCONST(41.14288863860467415634047938510775566101); - B->A[7][4] = RCONST(-4.461760149974003830664059933042153716087); - B->A[7][5] = RCONST(2.042334822239175284863677006796933710575); - B->A[7][6] = RCONST(-0.0983484366540610666085342472797492519021); - B->A[8][0] = RCONST(10.13814652288180795380867493804544210434); - B->A[8][2] = RCONST(-42.64113603171750099818382295779883861542); - B->A[8][3] = RCONST(35.76384003992257021309342235326766967773); - B->A[8][4] = RCONST(-4.348022840392907539808220462873578071594); - B->A[8][5] = RCONST(2.009862268377035743327496675192378461361); - B->A[8][6] = RCONST(0.3487490460338271702767087845131754875183); - B->A[8][7] = RCONST(-0.2714390051048312657577810114162275567651); - B->A[9][0] = RCONST(-45.03007203429867644217665656469762325287); - B->A[9][2] = RCONST(187.3272437654588884470285847783088684082); - B->A[9][3] = RCONST(-154.0288236935018630902050063014030456543); - B->A[9][4] = RCONST(18.56465306347536170505918562412261962891); - B->A[9][5] = RCONST(-7.141809679295079149596858769655227661133); - B->A[9][6] = RCONST(1.3088085781613787439425777847645804286); - - B->b[0] = RCONST(0.04715561848627222024665783806085528340191); - B->b[3] = RCONST(0.2575056429843415317648691598151344805956); - B->b[4] = RCONST(0.2621665397741262393260797125549288466573); - B->b[5] = RCONST(0.1521609265673855848621798259046045131981); - B->b[6] = RCONST(0.4939969170032484924171001239301403984427); - B->b[7] = RCONST(-0.2943031171403250323415079492406221106648); - B->b[8] = RCONST(0.08131747232495110944139327102675451897085); - - B->d[0] = RCONST(0.04460860660634117375034080055229424033314); - B->d[3] = RCONST(0.2671640378571372709259890143584925681353); - B->d[4] = RCONST(0.2201018300177293163244485185714438557625); - B->d[5] = RCONST(0.2188431703143156881186115469972719438374); - B->d[6] = RCONST(0.2289871705411202773561285539472009986639); - B->d[9] = RCONST(0.02029518466335628046337546948052477091551); - - B->c[1] = RCONST(0.005); - B->c[2] = RCONST(0.1088888888888888888888888888888888888889); - B->c[3] = RCONST(0.1633333333333333333333333333333333333333); - B->c[4] = RCONST(0.4555); - B->c[5] = RCONST(0.6095094489978380991601625282783061265945); - B->c[6] = RCONST(0.884); - B->c[7] = RCONST(0.925); - B->c[8] = RCONST(1.0); - B->c[9] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.005); + B->A[2][0] = SUN_RCONST(-1.076790123456790123456790123456790123457); + B->A[2][1] = SUN_RCONST(1.185679012345679012345679012345679012346); + B->A[3][0] = SUN_RCONST(0.04083333333333333333333333333333333333333); + B->A[3][2] = SUN_RCONST(0.1225); + B->A[4][0] = SUN_RCONST(0.6389139236255726439495106205868069082499); + B->A[4][2] = SUN_RCONST(-2.45567263822365688952231721486896276474); + B->A[4][3] = SUN_RCONST(2.272258714598084150537715686368755996227); + B->A[5][0] = SUN_RCONST(-2.661577375018756796976049372460693120956); + B->A[5][2] = SUN_RCONST(10.80451388645613874928130826447159051895); + B->A[5][3] = SUN_RCONST(-8.353914657396199316963247838430106639862); + B->A[5][4] = SUN_RCONST(0.8204875949566569071080834874010179191828); + B->A[6][0] = SUN_RCONST(6.067741434696771740675558248767629265785); + B->A[6][2] = SUN_RCONST(-24.71127363591108760942915978375822305679); + B->A[6][3] = SUN_RCONST(20.42751793078889477328630164265632629395); + B->A[6][4] = SUN_RCONST(-1.906157978816647169395537275704555213451); + B->A[6][5] = SUN_RCONST(1.006172249242067939789535557792987674475); + B->A[7][0] = SUN_RCONST(12.05467007625320441377425595419481396675); + B->A[7][2] = SUN_RCONST(-49.75478495046898785858502378687262535095); + B->A[7][3] = SUN_RCONST(41.14288863860467415634047938510775566101); + B->A[7][4] = SUN_RCONST(-4.461760149974003830664059933042153716087); + B->A[7][5] = SUN_RCONST(2.042334822239175284863677006796933710575); + B->A[7][6] = SUN_RCONST(-0.0983484366540610666085342472797492519021); + B->A[8][0] = SUN_RCONST(10.13814652288180795380867493804544210434); + B->A[8][2] = SUN_RCONST(-42.64113603171750099818382295779883861542); + B->A[8][3] = SUN_RCONST(35.76384003992257021309342235326766967773); + B->A[8][4] = SUN_RCONST(-4.348022840392907539808220462873578071594); + B->A[8][5] = SUN_RCONST(2.009862268377035743327496675192378461361); + B->A[8][6] = SUN_RCONST(0.3487490460338271702767087845131754875183); + B->A[8][7] = SUN_RCONST(-0.2714390051048312657577810114162275567651); + B->A[9][0] = SUN_RCONST(-45.03007203429867644217665656469762325287); + B->A[9][2] = SUN_RCONST(187.3272437654588884470285847783088684082); + B->A[9][3] = SUN_RCONST(-154.0288236935018630902050063014030456543); + B->A[9][4] = SUN_RCONST(18.56465306347536170505918562412261962891); + B->A[9][5] = SUN_RCONST(-7.141809679295079149596858769655227661133); + B->A[9][6] = SUN_RCONST(1.3088085781613787439425777847645804286); + + B->b[0] = SUN_RCONST(0.04715561848627222024665783806085528340191); + B->b[3] = SUN_RCONST(0.2575056429843415317648691598151344805956); + B->b[4] = SUN_RCONST(0.2621665397741262393260797125549288466573); + B->b[5] = SUN_RCONST(0.1521609265673855848621798259046045131981); + B->b[6] = SUN_RCONST(0.4939969170032484924171001239301403984427); + B->b[7] = SUN_RCONST(-0.2943031171403250323415079492406221106648); + B->b[8] = SUN_RCONST(0.08131747232495110944139327102675451897085); + + B->d[0] = SUN_RCONST(0.04460860660634117375034080055229424033314); + B->d[3] = SUN_RCONST(0.2671640378571372709259890143584925681353); + B->d[4] = SUN_RCONST(0.2201018300177293163244485185714438557625); + B->d[5] = SUN_RCONST(0.2188431703143156881186115469972719438374); + B->d[6] = SUN_RCONST(0.2289871705411202773561285539472009986639); + B->d[9] = SUN_RCONST(0.02029518466335628046337546948052477091551); + + B->c[1] = SUN_RCONST(0.005); + B->c[2] = SUN_RCONST(0.1088888888888888888888888888888888888889); + B->c[3] = SUN_RCONST(0.1633333333333333333333333333333333333333); + B->c[4] = SUN_RCONST(0.4555); + B->c[5] = SUN_RCONST(0.6095094489978380991601625282783061265945); + B->c[6] = SUN_RCONST(0.884); + B->c[7] = SUN_RCONST(0.925); + B->c[8] = SUN_RCONST(1.0); + B->c[9] = SUN_RCONST(1.0); return B; }) @@ -804,94 +804,94 @@ ARK_BUTCHER_TABLE(ARKODE_VERNER_13_7_8, { /* Verner-8-7 (DOI: 10.1007/s11075-009 B->q = 8; B->p = 7; - B->A[1][0] = RCONST(0.05); - B->A[2][0] = RCONST(-0.006993164062499999597544153573380754096434); - B->A[2][1] = RCONST(0.1135556640625000057731597280508140102029); - B->A[3][0] = RCONST(0.0399609375); - B->A[3][2] = RCONST(0.1198828125); - B->A[4][0] = RCONST(0.3613975628004575391116759419674053788185); - B->A[4][2] = RCONST(-1.341524066700492845427561405813321471214); - B->A[4][3] = RCONST(1.370126503900035208616259296832140535116); - B->A[5][0] = RCONST(0.04904720279720279491053602782812959048897); - B->A[5][3] = RCONST(0.2350972042214404811311112553084967657924); - B->A[5][4] = RCONST(0.1808555929813567275665775468951324000955); - B->A[6][0] = RCONST(0.06169289044289043982827180911954201292247); - B->A[6][3] = RCONST(0.112365683146402772774052891691098921001); - B->A[6][4] = RCONST(-0.03885046071451366683779937716280983295292); - B->A[6][5] = RCONST(0.01979188712522046006414555563424073625356); - B->A[7][0] = RCONST(-1.767630240222326953869469434721395373344); - B->A[7][3] = RCONST(-62.5); - B->A[7][4] = RCONST(-6.061889377376669330033109872601926326752); - B->A[7][5] = RCONST(5.6508231982227634659921022830531001091); - B->A[7][6] = RCONST(65.6216964193762350987526588141918182373); - B->A[8][0] = RCONST(-1.180945066554970779293398663867264986038); - B->A[8][3] = RCONST(-41.50473441114321104805640061385929584503); - B->A[8][4] = RCONST(-4.434438319103724879255423729773610830307); - B->A[8][5] = RCONST(4.26040818858613334896290325559675693512); - B->A[8][6] = RCONST(43.75364022446171219371535698883235454559); - B->A[8][7] = RCONST(0.007871425489912309975126802896738809067756); - B->A[9][0] = RCONST(-1.281405999441488363643770753697026520967); - B->A[9][3] = RCONST(-45.04713996013986587740873801521956920624); - B->A[9][4] = RCONST(-4.731362069449575713520061981398612260818); - B->A[9][5] = RCONST(4.514967016593807613844546722248196601868); - B->A[9][6] = RCONST(47.4490955717298490412758837919682264328); - B->A[9][7] = RCONST(0.01059228297111661047658071055366235668771); - B->A[9][8] = RCONST(-0.005746842263844615696088968803678653785028); - B->A[10][0] = RCONST(-1.724470134262485077059068316884804517031); - B->A[10][3] = RCONST(-60.92349008483054007001555874012410640717); - B->A[10][4] = RCONST(-5.951518376222391992769189528189599514008); - B->A[10][5] = RCONST(5.55652373069845673114741657627746462822); - B->A[10][6] = RCONST(63.98301198033306036450085230171680450439); - B->A[10][7] = RCONST(0.01464202825041496271174512600055095390417); - B->A[10][8] = RCONST(0.06460408772358203211005900357122300192714); - B->A[10][9] = RCONST(-0.07930323169008879347074980614706873893738); - B->A[11][0] = RCONST(-3.30162266774707902072805154602974653244); - B->A[11][3] = RCONST(-118.0112723597525103969019255600869655609); - B->A[11][4] = RCONST(-10.14142238845611210251718148356303572655); - B->A[11][5] = RCONST(9.139311332232058049385159392841160297394); - B->A[11][6] = RCONST(123.3759428284042769519146531820297241211); - B->A[11][7] = RCONST(4.623244378874581173022306757047772407532); - B->A[11][8] = RCONST(-3.383277738068201756505004595965147018433); - B->A[11][9] = RCONST(4.527592100324618229478801367804408073425); - B->A[11][10] = RCONST(-5.828495485811623133542980212951079010963); - B->A[12][0] = RCONST(-3.039515033766308604867845133412629365921); - B->A[12][3] = RCONST(-109.260868089417627402326615992933511734); - B->A[12][4] = RCONST(-9.290642497400291688336437800899147987366); - B->A[12][5] = RCONST(8.43050498176491203139448771253228187561); - B->A[12][6] = RCONST(114.2010010378331372749016736634075641632); - B->A[12][7] = RCONST(-0.9637271342145479202656588313402608036995); - B->A[12][8] = RCONST(-5.034884088802189516798080148873850703239); - B->A[12][9] = RCONST(5.958130824002923375815043982584029436111); - - B->b[0] = RCONST(0.04427989419007950788742533632103004492819); - B->b[5] = RCONST(0.3541049391724448991425333588267676532269); - B->b[6] = RCONST(0.2479692154956437688539949704136233776808); - B->b[7] = RCONST(-15.69420203883808540012978482991456985474); - B->b[8] = RCONST(25.08406496555856435293208051007241010666); - B->b[9] = RCONST(-31.73836778626027665950459777377545833588); - B->b[10] = RCONST(22.93828327398878386134128959383815526962); - B->b[11] = RCONST(-0.2361324633071542056228508954518474638462); - - B->d[0] = RCONST(0.04431261522908979538781792939516890328377); - B->d[5] = RCONST(0.3546095642343226606030270886549260467291); - B->d[6] = RCONST(0.2478480431366653080615947146725375205278); - B->d[7] = RCONST(4.448134732475784502980786783155053853989); - B->d[8] = RCONST(19.8468863661187349123338208300992846489); - B->d[9] = RCONST(-23.58162337746561831863800762221217155457); - B->d[12] = RCONST(-0.3601679437289775354003040774841792881489); - - B->c[1] = RCONST(0.05); - B->c[2] = RCONST(0.1065625); - B->c[3] = RCONST(0.15984375); - B->c[4] = RCONST(0.39); - B->c[5] = RCONST(0.465); - B->c[6] = RCONST(0.155); - B->c[7] = RCONST(0.943); - B->c[8] = RCONST(0.9018020417358569851273841777583584189415); - B->c[9] = RCONST(0.909); - B->c[10] = RCONST(0.94); - B->c[11] = RCONST(1.0); - B->c[12] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.05); + B->A[2][0] = SUN_RCONST(-0.006993164062499999597544153573380754096434); + B->A[2][1] = SUN_RCONST(0.1135556640625000057731597280508140102029); + B->A[3][0] = SUN_RCONST(0.0399609375); + B->A[3][2] = SUN_RCONST(0.1198828125); + B->A[4][0] = SUN_RCONST(0.3613975628004575391116759419674053788185); + B->A[4][2] = SUN_RCONST(-1.341524066700492845427561405813321471214); + B->A[4][3] = SUN_RCONST(1.370126503900035208616259296832140535116); + B->A[5][0] = SUN_RCONST(0.04904720279720279491053602782812959048897); + B->A[5][3] = SUN_RCONST(0.2350972042214404811311112553084967657924); + B->A[5][4] = SUN_RCONST(0.1808555929813567275665775468951324000955); + B->A[6][0] = SUN_RCONST(0.06169289044289043982827180911954201292247); + B->A[6][3] = SUN_RCONST(0.112365683146402772774052891691098921001); + B->A[6][4] = SUN_RCONST(-0.03885046071451366683779937716280983295292); + B->A[6][5] = SUN_RCONST(0.01979188712522046006414555563424073625356); + B->A[7][0] = SUN_RCONST(-1.767630240222326953869469434721395373344); + B->A[7][3] = SUN_RCONST(-62.5); + B->A[7][4] = SUN_RCONST(-6.061889377376669330033109872601926326752); + B->A[7][5] = SUN_RCONST(5.6508231982227634659921022830531001091); + B->A[7][6] = SUN_RCONST(65.6216964193762350987526588141918182373); + B->A[8][0] = SUN_RCONST(-1.180945066554970779293398663867264986038); + B->A[8][3] = SUN_RCONST(-41.50473441114321104805640061385929584503); + B->A[8][4] = SUN_RCONST(-4.434438319103724879255423729773610830307); + B->A[8][5] = SUN_RCONST(4.26040818858613334896290325559675693512); + B->A[8][6] = SUN_RCONST(43.75364022446171219371535698883235454559); + B->A[8][7] = SUN_RCONST(0.007871425489912309975126802896738809067756); + B->A[9][0] = SUN_RCONST(-1.281405999441488363643770753697026520967); + B->A[9][3] = SUN_RCONST(-45.04713996013986587740873801521956920624); + B->A[9][4] = SUN_RCONST(-4.731362069449575713520061981398612260818); + B->A[9][5] = SUN_RCONST(4.514967016593807613844546722248196601868); + B->A[9][6] = SUN_RCONST(47.4490955717298490412758837919682264328); + B->A[9][7] = SUN_RCONST(0.01059228297111661047658071055366235668771); + B->A[9][8] = SUN_RCONST(-0.005746842263844615696088968803678653785028); + B->A[10][0] = SUN_RCONST(-1.724470134262485077059068316884804517031); + B->A[10][3] = SUN_RCONST(-60.92349008483054007001555874012410640717); + B->A[10][4] = SUN_RCONST(-5.951518376222391992769189528189599514008); + B->A[10][5] = SUN_RCONST(5.55652373069845673114741657627746462822); + B->A[10][6] = SUN_RCONST(63.98301198033306036450085230171680450439); + B->A[10][7] = SUN_RCONST(0.01464202825041496271174512600055095390417); + B->A[10][8] = SUN_RCONST(0.06460408772358203211005900357122300192714); + B->A[10][9] = SUN_RCONST(-0.07930323169008879347074980614706873893738); + B->A[11][0] = SUN_RCONST(-3.30162266774707902072805154602974653244); + B->A[11][3] = SUN_RCONST(-118.0112723597525103969019255600869655609); + B->A[11][4] = SUN_RCONST(-10.14142238845611210251718148356303572655); + B->A[11][5] = SUN_RCONST(9.139311332232058049385159392841160297394); + B->A[11][6] = SUN_RCONST(123.3759428284042769519146531820297241211); + B->A[11][7] = SUN_RCONST(4.623244378874581173022306757047772407532); + B->A[11][8] = SUN_RCONST(-3.383277738068201756505004595965147018433); + B->A[11][9] = SUN_RCONST(4.527592100324618229478801367804408073425); + B->A[11][10] = SUN_RCONST(-5.828495485811623133542980212951079010963); + B->A[12][0] = SUN_RCONST(-3.039515033766308604867845133412629365921); + B->A[12][3] = SUN_RCONST(-109.260868089417627402326615992933511734); + B->A[12][4] = SUN_RCONST(-9.290642497400291688336437800899147987366); + B->A[12][5] = SUN_RCONST(8.43050498176491203139448771253228187561); + B->A[12][6] = SUN_RCONST(114.2010010378331372749016736634075641632); + B->A[12][7] = SUN_RCONST(-0.9637271342145479202656588313402608036995); + B->A[12][8] = SUN_RCONST(-5.034884088802189516798080148873850703239); + B->A[12][9] = SUN_RCONST(5.958130824002923375815043982584029436111); + + B->b[0] = SUN_RCONST(0.04427989419007950788742533632103004492819); + B->b[5] = SUN_RCONST(0.3541049391724448991425333588267676532269); + B->b[6] = SUN_RCONST(0.2479692154956437688539949704136233776808); + B->b[7] = SUN_RCONST(-15.69420203883808540012978482991456985474); + B->b[8] = SUN_RCONST(25.08406496555856435293208051007241010666); + B->b[9] = SUN_RCONST(-31.73836778626027665950459777377545833588); + B->b[10] = SUN_RCONST(22.93828327398878386134128959383815526962); + B->b[11] = SUN_RCONST(-0.2361324633071542056228508954518474638462); + + B->d[0] = SUN_RCONST(0.04431261522908979538781792939516890328377); + B->d[5] = SUN_RCONST(0.3546095642343226606030270886549260467291); + B->d[6] = SUN_RCONST(0.2478480431366653080615947146725375205278); + B->d[7] = SUN_RCONST(4.448134732475784502980786783155053853989); + B->d[8] = SUN_RCONST(19.8468863661187349123338208300992846489); + B->d[9] = SUN_RCONST(-23.58162337746561831863800762221217155457); + B->d[12] = SUN_RCONST(-0.3601679437289775354003040774841792881489); + + B->c[1] = SUN_RCONST(0.05); + B->c[2] = SUN_RCONST(0.1065625); + B->c[3] = SUN_RCONST(0.15984375); + B->c[4] = SUN_RCONST(0.39); + B->c[5] = SUN_RCONST(0.465); + B->c[6] = SUN_RCONST(0.155); + B->c[7] = SUN_RCONST(0.943); + B->c[8] = SUN_RCONST(0.9018020417358569851273841777583584189415); + B->c[9] = SUN_RCONST(0.909); + B->c[10] = SUN_RCONST(0.94); + B->c[11] = SUN_RCONST(1.0); + B->c[12] = SUN_RCONST(1.0); return B; }) @@ -900,117 +900,117 @@ ARK_BUTCHER_TABLE(ARKODE_VERNER_16_8_9, { /* Verner-9-8 (DOI: 10.1007/s11075-009 B->q = 9; B->p = 8; - B->A[1][0] = RCONST(0.3462e-1); - B->A[2][0] = RCONST(-0.389335438857287327017042687229284478532e-1); - B->A[2][1] = RCONST(0.1359578945245091786499878854939346230295); - B->A[3][0] = RCONST(0.3638413148954266723060635628912731569111e-1); - B->A[3][2] = RCONST(0.1091523944686280016918190688673819470733); - B->A[4][0] = RCONST(2.025763914393969636805657604282571047511); - B->A[4][2] = RCONST(-7.638023836496292020387602153091964592952); - B->A[4][3] = RCONST(6.173259922102322383581944548809393545442); - B->A[5][0] = RCONST(0.5112275589406060872792270881648288397197e-1); - B->A[5][3] = RCONST(0.1770823794555021537929910813839068684087); - B->A[5][4] = RCONST(0.80277624092225014536138698108025283759e-3); - B->A[6][0] = RCONST(0.1316006357975216279279871693164256985334); - B->A[6][3] = RCONST(-0.2957276252669636417685183174672273730699); - B->A[6][4] = RCONST(0.878137803564295237421124704053886667082e-1); - B->A[6][5] = RCONST(0.6213052975225274774321435005639430026100); - B->A[7][0] = RCONST(0.7166666666666666666666666666666666666667e-1); - B->A[7][5] = RCONST(0.3305533578915319409260346730051472207728); - B->A[7][6] = RCONST(0.2427799754418013924072986603281861125606); - B->A[8][0] = RCONST(0.7180664062500000000000000000000000000000e-1); - B->A[8][5] = RCONST(0.3294380283228177160744825466257672816401); - B->A[8][6] = RCONST(0.1165190029271822839255174533742327183599); - B->A[8][7] = RCONST(-0.3401367187500000000000000000000000000000e-1); - B->A[9][0] = RCONST(0.4836757646340646986611287718844085773549e-1); - B->A[9][5] = RCONST(0.3928989925676163974333190042057047002852e-1); - B->A[9][6] = RCONST(0.1054740945890344608263649267140088017604); - B->A[9][7] = RCONST(-0.2143865284648312665982642293830533996214e-1); - B->A[9][8] = RCONST(-0.1041229174627194437759832813847147895623); - B->A[10][0] = RCONST(-0.2664561487201478635337289243849737340534e-1); - B->A[10][5] = RCONST(0.3333333333333333333333333333333333333333e-1); - B->A[10][6] = RCONST(-0.1631072244872467239162704487554706387141); - B->A[10][7] = RCONST(0.3396081684127761199487954930015522928244e-1); - B->A[10][8] = RCONST(0.1572319413814626097110769806810024118077); - B->A[10][9] = RCONST(0.2152267478031879552303534778794770376960); - B->A[11][0] = RCONST(0.3689009248708622334786359863227633989718e-1); - B->A[11][5] = RCONST(-0.1465181576725542928653609891758501156785); - B->A[11][6] = RCONST(0.2242577768172024345345469822625833796001); - B->A[11][7] = RCONST(0.2294405717066072637090897902753790803034e-1); - B->A[11][8] = RCONST(-0.35850052905728761357394424889330334334e-2); - B->A[11][9] = RCONST(0.8669223316444385506869203619044453906053e-1); - B->A[11][10] = RCONST(0.4383840651968337846196219974168630120572); - B->A[12][0] = RCONST(-0.4866012215113340846662212357570395295088); - B->A[12][5] = RCONST(-6.304602650282852990657772792012007122988); - B->A[12][6] = RCONST(-0.281245618289472564778284183790118418111); - B->A[12][7] = RCONST(-2.679019236219849057687906597489223155566); - B->A[12][8] = RCONST(0.518815663924157511565311164615012522024); - B->A[12][9] = RCONST(1.365353187603341710683633635235238678626); - B->A[12][10] = RCONST(5.885091088503946585721274891680604830712); - B->A[12][11] = RCONST(2.802808786272062889819965117517532194812); - B->A[13][0] = RCONST(0.4185367457753471441471025246471931649633); - B->A[13][5] = RCONST(6.724547581906459363100870806514855026676); - B->A[13][6] = RCONST(-0.425444280164611790606983409697113064616); - B->A[13][7] = RCONST(3.343279153001265577811816947557982637749); - B->A[13][8] = RCONST(0.617081663117537759528421117507709784737); - B->A[13][9] = RCONST(-0.929966123939932833937749523988800852013); - B->A[13][10] = RCONST(-6.099948804751010722472962837945508844846); - B->A[13][11] = RCONST(-3.002206187889399044804158084895173690015); - B->A[13][12] = RCONST(0.2553202529443445472336424602988558373637); - B->A[14][0] = RCONST(-0.779374086122884664644623040843840506343); - B->A[14][5] = RCONST(-13.93734253810777678786523664804936051203); - B->A[14][6] = RCONST(1.252048853379357320949735183924200895136); - B->A[14][7] = RCONST(-14.69150040801686878191527989293072091588); - B->A[14][8] = RCONST(-0.494705058533141685655191992136962873577); - B->A[14][9] = RCONST(2.242974909146236657906984549543692874755); - B->A[14][10] = RCONST(13.36789380382864375813864978592679139881); - B->A[14][11] = RCONST(14.39665048665068644512236935340272139005); - B->A[14][12] = RCONST(-0.7975813331776800379127866056663258667437); - B->A[14][13] = RCONST(0.4409353709534277758753793068298041158235); - B->A[15][0] = RCONST(2.058051337466886442151242368989994043993); - B->A[15][5] = RCONST(22.35793772796803295519317565842520212899); - B->A[15][6] = RCONST(0.90949810997556332745009198137971890783); - B->A[15][7] = RCONST(35.89110098240264104710550686568482456493); - B->A[15][8] = RCONST(-3.442515027624453437985000403608480262211); - B->A[15][9] = RCONST(-4.865481358036368826566013387928704014496); - B->A[15][10] = RCONST(-18.90980381354342625688427480879773032857); - B->A[15][11] = RCONST(-34.26354448030451782929251177395134170515); - B->A[15][12] = RCONST(1.264756521695642578827783499806516664686); - - B->b[0] = RCONST(0.1461197685842315252051541915018784713459e-1); - B->b[7] = RCONST(-0.3915211862331339089410228267288242030810); - B->b[8] = RCONST(0.2310932500289506415909675644868993669908); - B->b[9] = RCONST(0.1274766769992852382560589467488989175618); - B->b[10] = RCONST(0.2246434176204157731566981937082069688984); - B->b[11] = RCONST(0.5684352689748512932705226972873692126743); - B->b[12] = RCONST(0.5825871557215827200814768021863420902155e-1); - B->b[13] = RCONST(0.1364317403482215641609022744494239843327); - B->b[14] = RCONST(0.3057013983082797397721005067920369646664e-1); - - B->d[0] = RCONST(0.1996996514886773085518508418098868756464e-1); - B->d[7] = RCONST(2.191499304949330054530747099310837524864); - B->d[8] = RCONST(0.8857071848208438030833722031786358862953e-1); - B->d[9] = RCONST(0.1140560234865965622484956605091432032674); - B->d[10] = RCONST(0.2533163805345107065564577734569651977347); - B->d[11] = RCONST(-2.056564386240941011158999594595981300493); - B->d[12] = RCONST(0.3408096799013119935160094894224543812830); - B->d[15] = RCONST(0.4834231373823958314376726739772871714902e-1); - - B->c[1] = RCONST(0.3462e-1); - B->c[2] = RCONST(0.9702435063878044594828361677100617517633e-1); - B->c[3] = RCONST(0.1455365259581706689224254251565092627645); - B->c[4] = RCONST(0.561); - B->c[5] = RCONST(0.2290079115904850126662751771814700052182); - B->c[6] = RCONST(0.5449920884095149873337248228185299947818); - B->c[7] = RCONST(0.645); - B->c[8] = RCONST(0.48375); - B->c[9] = RCONST(0.6757e-1); - B->c[10] = RCONST(0.25); - B->c[11] = RCONST(0.6590650618730998549405331618649220295334); - B->c[12] = RCONST(0.8206); - B->c[13] = RCONST(0.9012); - B->c[14] = RCONST(1.0); - B->c[15] = RCONST(1.0); + B->A[1][0] = SUN_RCONST(0.3462e-1); + B->A[2][0] = SUN_RCONST(-0.389335438857287327017042687229284478532e-1); + B->A[2][1] = SUN_RCONST(0.1359578945245091786499878854939346230295); + B->A[3][0] = SUN_RCONST(0.3638413148954266723060635628912731569111e-1); + B->A[3][2] = SUN_RCONST(0.1091523944686280016918190688673819470733); + B->A[4][0] = SUN_RCONST(2.025763914393969636805657604282571047511); + B->A[4][2] = SUN_RCONST(-7.638023836496292020387602153091964592952); + B->A[4][3] = SUN_RCONST(6.173259922102322383581944548809393545442); + B->A[5][0] = SUN_RCONST(0.5112275589406060872792270881648288397197e-1); + B->A[5][3] = SUN_RCONST(0.1770823794555021537929910813839068684087); + B->A[5][4] = SUN_RCONST(0.80277624092225014536138698108025283759e-3); + B->A[6][0] = SUN_RCONST(0.1316006357975216279279871693164256985334); + B->A[6][3] = SUN_RCONST(-0.2957276252669636417685183174672273730699); + B->A[6][4] = SUN_RCONST(0.878137803564295237421124704053886667082e-1); + B->A[6][5] = SUN_RCONST(0.6213052975225274774321435005639430026100); + B->A[7][0] = SUN_RCONST(0.7166666666666666666666666666666666666667e-1); + B->A[7][5] = SUN_RCONST(0.3305533578915319409260346730051472207728); + B->A[7][6] = SUN_RCONST(0.2427799754418013924072986603281861125606); + B->A[8][0] = SUN_RCONST(0.7180664062500000000000000000000000000000e-1); + B->A[8][5] = SUN_RCONST(0.3294380283228177160744825466257672816401); + B->A[8][6] = SUN_RCONST(0.1165190029271822839255174533742327183599); + B->A[8][7] = SUN_RCONST(-0.3401367187500000000000000000000000000000e-1); + B->A[9][0] = SUN_RCONST(0.4836757646340646986611287718844085773549e-1); + B->A[9][5] = SUN_RCONST(0.3928989925676163974333190042057047002852e-1); + B->A[9][6] = SUN_RCONST(0.1054740945890344608263649267140088017604); + B->A[9][7] = SUN_RCONST(-0.2143865284648312665982642293830533996214e-1); + B->A[9][8] = SUN_RCONST(-0.1041229174627194437759832813847147895623); + B->A[10][0] = SUN_RCONST(-0.2664561487201478635337289243849737340534e-1); + B->A[10][5] = SUN_RCONST(0.3333333333333333333333333333333333333333e-1); + B->A[10][6] = SUN_RCONST(-0.1631072244872467239162704487554706387141); + B->A[10][7] = SUN_RCONST(0.3396081684127761199487954930015522928244e-1); + B->A[10][8] = SUN_RCONST(0.1572319413814626097110769806810024118077); + B->A[10][9] = SUN_RCONST(0.2152267478031879552303534778794770376960); + B->A[11][0] = SUN_RCONST(0.3689009248708622334786359863227633989718e-1); + B->A[11][5] = SUN_RCONST(-0.1465181576725542928653609891758501156785); + B->A[11][6] = SUN_RCONST(0.2242577768172024345345469822625833796001); + B->A[11][7] = SUN_RCONST(0.2294405717066072637090897902753790803034e-1); + B->A[11][8] = SUN_RCONST(-0.35850052905728761357394424889330334334e-2); + B->A[11][9] = SUN_RCONST(0.8669223316444385506869203619044453906053e-1); + B->A[11][10] = SUN_RCONST(0.4383840651968337846196219974168630120572); + B->A[12][0] = SUN_RCONST(-0.4866012215113340846662212357570395295088); + B->A[12][5] = SUN_RCONST(-6.304602650282852990657772792012007122988); + B->A[12][6] = SUN_RCONST(-0.281245618289472564778284183790118418111); + B->A[12][7] = SUN_RCONST(-2.679019236219849057687906597489223155566); + B->A[12][8] = SUN_RCONST(0.518815663924157511565311164615012522024); + B->A[12][9] = SUN_RCONST(1.365353187603341710683633635235238678626); + B->A[12][10] = SUN_RCONST(5.885091088503946585721274891680604830712); + B->A[12][11] = SUN_RCONST(2.802808786272062889819965117517532194812); + B->A[13][0] = SUN_RCONST(0.4185367457753471441471025246471931649633); + B->A[13][5] = SUN_RCONST(6.724547581906459363100870806514855026676); + B->A[13][6] = SUN_RCONST(-0.425444280164611790606983409697113064616); + B->A[13][7] = SUN_RCONST(3.343279153001265577811816947557982637749); + B->A[13][8] = SUN_RCONST(0.617081663117537759528421117507709784737); + B->A[13][9] = SUN_RCONST(-0.929966123939932833937749523988800852013); + B->A[13][10] = SUN_RCONST(-6.099948804751010722472962837945508844846); + B->A[13][11] = SUN_RCONST(-3.002206187889399044804158084895173690015); + B->A[13][12] = SUN_RCONST(0.2553202529443445472336424602988558373637); + B->A[14][0] = SUN_RCONST(-0.779374086122884664644623040843840506343); + B->A[14][5] = SUN_RCONST(-13.93734253810777678786523664804936051203); + B->A[14][6] = SUN_RCONST(1.252048853379357320949735183924200895136); + B->A[14][7] = SUN_RCONST(-14.69150040801686878191527989293072091588); + B->A[14][8] = SUN_RCONST(-0.494705058533141685655191992136962873577); + B->A[14][9] = SUN_RCONST(2.242974909146236657906984549543692874755); + B->A[14][10] = SUN_RCONST(13.36789380382864375813864978592679139881); + B->A[14][11] = SUN_RCONST(14.39665048665068644512236935340272139005); + B->A[14][12] = SUN_RCONST(-0.7975813331776800379127866056663258667437); + B->A[14][13] = SUN_RCONST(0.4409353709534277758753793068298041158235); + B->A[15][0] = SUN_RCONST(2.058051337466886442151242368989994043993); + B->A[15][5] = SUN_RCONST(22.35793772796803295519317565842520212899); + B->A[15][6] = SUN_RCONST(0.90949810997556332745009198137971890783); + B->A[15][7] = SUN_RCONST(35.89110098240264104710550686568482456493); + B->A[15][8] = SUN_RCONST(-3.442515027624453437985000403608480262211); + B->A[15][9] = SUN_RCONST(-4.865481358036368826566013387928704014496); + B->A[15][10] = SUN_RCONST(-18.90980381354342625688427480879773032857); + B->A[15][11] = SUN_RCONST(-34.26354448030451782929251177395134170515); + B->A[15][12] = SUN_RCONST(1.264756521695642578827783499806516664686); + + B->b[0] = SUN_RCONST(0.1461197685842315252051541915018784713459e-1); + B->b[7] = SUN_RCONST(-0.3915211862331339089410228267288242030810); + B->b[8] = SUN_RCONST(0.2310932500289506415909675644868993669908); + B->b[9] = SUN_RCONST(0.1274766769992852382560589467488989175618); + B->b[10] = SUN_RCONST(0.2246434176204157731566981937082069688984); + B->b[11] = SUN_RCONST(0.5684352689748512932705226972873692126743); + B->b[12] = SUN_RCONST(0.5825871557215827200814768021863420902155e-1); + B->b[13] = SUN_RCONST(0.1364317403482215641609022744494239843327); + B->b[14] = SUN_RCONST(0.3057013983082797397721005067920369646664e-1); + + B->d[0] = SUN_RCONST(0.1996996514886773085518508418098868756464e-1); + B->d[7] = SUN_RCONST(2.191499304949330054530747099310837524864); + B->d[8] = SUN_RCONST(0.8857071848208438030833722031786358862953e-1); + B->d[9] = SUN_RCONST(0.1140560234865965622484956605091432032674); + B->d[10] = SUN_RCONST(0.2533163805345107065564577734569651977347); + B->d[11] = SUN_RCONST(-2.056564386240941011158999594595981300493); + B->d[12] = SUN_RCONST(0.3408096799013119935160094894224543812830); + B->d[15] = SUN_RCONST(0.4834231373823958314376726739772871714902e-1); + + B->c[1] = SUN_RCONST(0.3462e-1); + B->c[2] = SUN_RCONST(0.9702435063878044594828361677100617517633e-1); + B->c[3] = SUN_RCONST(0.1455365259581706689224254251565092627645); + B->c[4] = SUN_RCONST(0.561); + B->c[5] = SUN_RCONST(0.2290079115904850126662751771814700052182); + B->c[6] = SUN_RCONST(0.5449920884095149873337248228185299947818); + B->c[7] = SUN_RCONST(0.645); + B->c[8] = SUN_RCONST(0.48375); + B->c[9] = SUN_RCONST(0.6757e-1); + B->c[10] = SUN_RCONST(0.25); + B->c[11] = SUN_RCONST(0.6590650618730998549405331618649220295334); + B->c[12] = SUN_RCONST(0.8206); + B->c[13] = SUN_RCONST(0.9012); + B->c[14] = SUN_RCONST(1.0); + B->c[15] = SUN_RCONST(1.0); return B; }) From 2b39a12fdd9efa09d4c6ad1b839d32dafc363eaa Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Sun, 5 Nov 2023 22:52:40 -0800 Subject: [PATCH 46/85] remove KINSetInfofile --- doc/kinsol/guide/source/Usage/index.rst | 32 +------------------ .../kinLaplace_picard_kry_f2003.f90 | 10 ------ 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index c55d695dc8..a2414757c3 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -483,8 +483,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. +--------------------------------------------------------+----------------------------------+------------------------------+ | Info handler function | :c:func:`KINSetInfoHandlerFn` | internal fn. | +--------------------------------------------------------+----------------------------------+------------------------------+ - | Pointer to an info file | :c:func:`KINSetInfoFile` | ``stdout`` | - +--------------------------------------------------------+----------------------------------+------------------------------+ | Data for problem-defining function | :c:func:`KINSetUserData` | ``NULL`` | +--------------------------------------------------------+----------------------------------+------------------------------+ | Verbosity level of output | :c:func:`KINSetPrintLevel` | 0 | @@ -601,27 +599,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. ``NULL`` will always be directed to ``stderr``. -.. c:function:: int KINSetInfoFile(void * kin_mem, FILE * infofp) - - The function :c:func:`KINSetInfoFile` specifies the pointer to the file - where all informative (non-error) messages should be directed. - - **Arguments:** - * ``kin_mem`` -- pointer to the KINSOL memory block. - * ``infofp`` -- pointer to output file. - - **Return value:** - * ``KIN_SUCCESS`` -- The optional value has been successfully set. - * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. - - **Notes:** - The default value for ``infofp`` is ``stdout``. - - .. deprecated:: 6.2.0 - - Use :c:func:`SUNLogger_SetInfoFilename` instead. - - .. c:function:: int KINSetInfoHandlerFn(void * kin_mem, KINInfoHandlerFn ihfun, void * ih_data) The function :c:func:`KINSetInfoHandlerFn` specifies the optional @@ -637,11 +614,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. * ``KIN_SUCCESS`` -- The function ``ihfun`` and data pointer ``ih_data`` have been successfully set. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. - **Notes:** - The default internal information handler function directs informative - (non-error) messages to the file specified by the file pointer ``infofp`` - (see :c:func:`KINSetInfoFile` above). - .. c:function:: int KINSetPrintLevel(void * kin_mem, int printfl) @@ -2005,9 +1977,7 @@ follows: Informational message handler function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -As an alternative to the default behavior of directing informational (meaning non-error) messages -to the file pointed to by ``infofp`` (see :c:func:`KINSetInfoFile`), the user may -provide a function of type :c:type:`KINInfoHandlerFn` to process any such messages. +The user may provide a function of type :c:type:`KINInfoHandlerFn` to process any such messages. The function type :c:type:`KINInfoHandlerFn` is defined as follows: .. c:type:: void (*KINInfoHandlerFn)(const char *module, const char *function, char *msg, void *ih_data) diff --git a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 index 0f34228822..21012626c8 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 @@ -215,7 +215,6 @@ program main type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: kmem ! KINSOL memory - type(c_ptr) :: infofp ! info file ! solution and scaling vectors; nx, ny are set in the prob_mod module real(c_double), dimension(nx,ny) :: u, scale @@ -298,14 +297,6 @@ program main ! Set information file - infofp = FSUNDIALSFileOpen("KINSOL.log", "w"); - - ierr = FKINSetInfoFile(kmem, infofp); - if (ierr /= 0) then - print *, 'Error in FKINSetInfoFile, ierr = ', ierr, '; halting' - stop 1 - end if - ierr = FKINSetPrintLevel(kmem, 3); if (ierr /= 0) then print *, 'Error in FKINSetPrintLevel, ierr = ', ierr, '; halting' @@ -372,7 +363,6 @@ program main call PrintFinalStats(kmem) ! clean up - call FSUNDIALSFileClose(infofp) call FKINFree(kmem) ierr = FSUNLinSolFree(sunlinsol_LS) call FN_VDestroy(sunvec_u) From 1cbfa1f590fd2e5ac4cc9f367fa77fe389ffb9c1 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 6 Nov 2023 15:04:44 -0800 Subject: [PATCH 47/85] remove warnings to stdout --- src/sundials/sundials_logger.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/sundials/sundials_logger.c b/src/sundials/sundials_logger.c index 872d1e4730..ce4769c76f 100644 --- a/src/sundials/sundials_logger.c +++ b/src/sundials/sundials_logger.c @@ -254,13 +254,6 @@ int SUNLogger_SetErrorFilename(SUNLogger logger, const char* error_filename) return -1; } } -#else - fprintf(stderr, - "[LOGGER WARNING] " - "SUNDIALS_LOGGING_LEVEL=%d (build time option) " - "is set too low for ERROR, but a ERROR file was provided. " - "Set the logging level to >= %d and recompile if ERROR output level " - "is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_ERROR); #endif } @@ -300,13 +293,6 @@ int SUNLogger_SetWarningFilename(SUNLogger logger, const char* warning_filename) return -1; } } -#else - fprintf(stderr, - "[LOGGER WARNING] " - "SUNDIALS_LOGGING_LEVEL=%d (build time option) " - "is set too low for WARNING, but a WARNING file was provided. " - "Set the logging level to >= %d and recompile if WARNING output " - "level is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_WARNING); #endif } @@ -346,13 +332,6 @@ int SUNLogger_SetInfoFilename(SUNLogger logger, const char* info_filename) return -1; } } -#else - fprintf(stderr, - "[LOGGER WARNING] " - "SUNDIALS_LOGGING_LEVEL=%d (build time option) " - "is set too low for INFO, but a INFO file was provided. Set the " - "logging level to >= %d and recompile if INFO output level is " - "desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_INFO); #endif } @@ -392,13 +371,6 @@ int SUNLogger_SetDebugFilename(SUNLogger logger, const char* debug_filename) return -1; } } -#else - fprintf(stderr, - "[LOGGER WARNING] " - "SUNDIALS_LOGGING_LEVEL=%d (build time option) " - "is set too low for DEBUG output, but a DEBUG file was provided. " - "Set the logging level to >= %d and recompile if DEBUG output level " - "is desired.\n", SUNDIALS_LOGGING_LEVEL, SUN_LOGLEVEL_DEBUG); #endif } From 752c350535c510f87a986ae1eb02e4880124f3bb Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 6 Nov 2023 16:46:17 -0800 Subject: [PATCH 48/85] update action to sunrealtype --- .github/actions/test-driver/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-driver/action.yml b/.github/actions/test-driver/action.yml index 75f09300ff..f56126095e 100644 --- a/.github/actions/test-driver/action.yml +++ b/.github/actions/test-driver/action.yml @@ -26,5 +26,5 @@ runs: run: | git config --global --add safe.directory $GITHUB_WORKSPACE cd test - ./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --realtype ${{ inputs.precision }} --indexsize ${{ inputs.indexsize }} + ./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --sunrealtype ${{ inputs.precision }} --indexsize ${{ inputs.indexsize }} shell: bash From d202111e4f47746966b02d3f2bfe31d1945c5402 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 6 Nov 2023 16:59:21 -0800 Subject: [PATCH 49/85] remove DFID --- examples/arkode/CXX_parallel/ark_brusselator1D.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D.h b/examples/arkode/CXX_parallel/ark_brusselator1D.h index d1e0a83254..b59fda6390 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D.h +++ b/examples/arkode/CXX_parallel/ark_brusselator1D.h @@ -196,7 +196,7 @@ typedef struct #define LOCAL_NLS(NLS) ( GET_NLS_CONTENT(NLS)->local_nls ) /* SUNNonlinearSolver constructor */ -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y, FILE* DFID); +SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); /* From f16bc3cdf5ec1c7a6315d01867c5e0e02e5d0f44 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 7 Nov 2023 14:22:48 -0800 Subject: [PATCH 50/85] remove KINInfoHandler --- .../kinLaplace_picard_kry_f2003.f90 | 8 - include/kinsol/kinsol.h | 6 +- src/kinsol/fmod/fkinsol_mod.c | 30 ---- src/kinsol/fmod/fkinsol_mod.f90 | 56 ------- src/kinsol/kinsol.c | 148 +++++++++--------- src/kinsol/kinsol_io.c | 50 ------ 6 files changed, 76 insertions(+), 222 deletions(-) diff --git a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 index 21012626c8..b6cd3d643b 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 @@ -295,14 +295,6 @@ program main stop 1 end if - ! Set information file - - ierr = FKINSetPrintLevel(kmem, 3); - if (ierr /= 0) then - print *, 'Error in FKINSetPrintLevel, ierr = ', ierr, '; halting' - stop 1 - end if - ! ------------------------- ! Create a linear solver diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index 196b708def..5a306fc967 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -133,14 +133,10 @@ SUNDIALS_EXPORT int KINSetScaledStepTol(void *kinmem, realtype scsteptol); SUNDIALS_EXPORT int KINSetConstraints(void *kinmem, N_Vector constraints); SUNDIALS_EXPORT int KINSetSysFunc(void *kinmem, KINSysFn func); -/* Optional input functions for handling error/info/debug events */ +/* Optional input functions for handling error events */ SUNDIALS_EXPORT int KINSetErrHandlerFn(void *kinmem, KINErrHandlerFn ehfun, void *eh_data); SUNDIALS_EXPORT int KINSetErrFile(void *kinmem, FILE *errfp); -SUNDIALS_EXPORT int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, - void *ih_data); -SUNDIALS_EXPORT int KINSetPrintLevel(void *kinmem, int printfl); - /* Optional output functions */ SUNDIALS_EXPORT int KINGetWorkSpace(void *kinmem, long int *lenrw, diff --git a/src/kinsol/fmod/fkinsol_mod.c b/src/kinsol/fmod/fkinsol_mod.c index 2836479531..11473b35fb 100644 --- a/src/kinsol/fmod/fkinsol_mod.c +++ b/src/kinsol/fmod/fkinsol_mod.c @@ -667,36 +667,6 @@ SWIGEXPORT int _wrap_FKINSetErrFile(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FKINSetInfoHandlerFn(void *farg1, KINInfoHandlerFn farg2, void *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - KINInfoHandlerFn arg2 = (KINInfoHandlerFn) 0 ; - void *arg3 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (KINInfoHandlerFn)(farg2); - arg3 = (void *)(farg3); - result = (int)KINSetInfoHandlerFn(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FKINSetPrintLevel(void *farg1, int const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - int arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)KINSetPrintLevel(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FKINGetWorkSpace(void *farg1, long *farg2, long *farg3) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/kinsol/fmod/fkinsol_mod.f90 b/src/kinsol/fmod/fkinsol_mod.f90 index 4928d79822..325c4dd6c7 100644 --- a/src/kinsol/fmod/fkinsol_mod.f90 +++ b/src/kinsol/fmod/fkinsol_mod.f90 @@ -100,8 +100,6 @@ module fkinsol_mod public :: FKINSetSysFunc public :: FKINSetErrHandlerFn public :: FKINSetErrFile - public :: FKINSetInfoHandlerFn - public :: FKINSetPrintLevel public :: FKINGetWorkSpace public :: FKINGetNumNonlinSolvIters public :: FKINGetNumFuncEvals @@ -428,25 +426,6 @@ function swigc_FKINSetErrFile(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) & -bind(C, name="_wrap_FKINSetInfoHandlerFn") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -type(C_PTR), value :: farg3 -integer(C_INT) :: fresult -end function - -function swigc_FKINSetPrintLevel(farg1, farg2) & -bind(C, name="_wrap_FKINSetPrintLevel") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FKINGetWorkSpace(farg1, farg2, farg3) & bind(C, name="_wrap_FKINGetWorkSpace") & result(fresult) @@ -1244,41 +1223,6 @@ function FKINSetErrFile(kinmem, errfp) & swig_result = fresult end function -function FKINSetInfoHandlerFn(kinmem, ihfun, ih_data) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -type(C_FUNPTR), intent(in), value :: ihfun -type(C_PTR) :: ih_data -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = kinmem -farg2 = ihfun -farg3 = ih_data -fresult = swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) -swig_result = fresult -end function - -function FKINSetPrintLevel(kinmem, printfl) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: kinmem -integer(C_INT), intent(in) :: printfl -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = kinmem -farg2 = printfl -fresult = swigc_FKINSetPrintLevel(farg1, farg2) -swig_result = fresult -end function - function FKINGetWorkSpace(kinmem, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 10e200c49c..3f5171a88c 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -301,18 +301,9 @@ void *KINCreate(SUNContext sunctx) kin_mem->kin_omega_max = OMEGA_MAX; kin_mem->kin_errfp = stderr; - kin_mem->kin_infofp = stdout; - kin_mem->kin_debugfp = stdout; - kin_mem->kin_printfl = PRINTFL_DEFAULT; #if SUNDIALS_LOGGING_LEVEL > 0 kin_mem->kin_errfp = (KIN_LOGGER->error_fp) ? KIN_LOGGER->error_fp : stderr; #endif -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - kin_mem->kin_infofp = (KIN_LOGGER->info_fp) ? KIN_LOGGER->info_fp : stdout; -#endif -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - kin_mem->kin_debugfp = (KIN_LOGGER->debug_fp) ? KIN_LOGGER->debug_fp : stdout; -#endif /* initialize lrw and liw */ @@ -532,8 +523,10 @@ int KINSol(void *kinmem, N_Vector u, int strategy_in, return(KIN_ILL_INPUT); } - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSol", INFO_TOL, kin_mem->kin_scsteptol, kin_mem->kin_fnormtol); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSol", INFO_TOL, kin_mem->kin_scsteptol, + kin_mem->kin_fnormtol); +#endif kin_mem->kin_nfe = kin_mem->kin_nnilset = kin_mem->kin_nnilset_sub = kin_mem->kin_nni = kin_mem->kin_nbcf = kin_mem->kin_nbktrk = 0; ret = KINFP(kin_mem); @@ -685,10 +678,12 @@ int KINSol(void *kinmem, N_Vector u, int strategy_in, kin_mem->kin_f1norm = f1normp; - /* print the current nni, fnorm, and nfe values if printfl > 0 */ + /* print the current nni, fnorm, and nfe values */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSol", INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSol", INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, + kin_mem->kin_fnorm); +#endif if (ret != CONTINUE_ITERATIONS) break; @@ -697,9 +692,9 @@ int KINSol(void *kinmem, N_Vector u, int strategy_in, } /* end of loop; return */ - - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINSol", INFO_RETVAL, ret); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINSol", INFO_RETVAL, ret); +#endif switch(ret) { case KIN_SYSFUNC_FAIL: @@ -1411,9 +1406,10 @@ static int KINSolInit(KINMem kin_mem) } /* all error checking is complete at this point */ - - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSolInit", INFO_TOL, kin_mem->kin_scsteptol, kin_mem->kin_fnormtol); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSolInit", INFO_TOL, kin_mem->kin_scsteptol, + kin_mem->kin_fnormtol); +#endif /* calculate the default value for mxnewtstep (maximum Newton step) */ @@ -1472,8 +1468,9 @@ static int KINSolInit(KINMem kin_mem) return(KIN_INITIAL_GUESS_OK); } - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINSolInit", INFO_FMAX, fmax); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINSolInit", INFO_FMAX, fmax); +#endif /* initialize the linear solver if linit != NULL */ @@ -1490,10 +1487,10 @@ static int KINSolInit(KINMem kin_mem) kin_mem->kin_fnorm = N_VWL2Norm(kin_mem->kin_fval, kin_mem->kin_fscale); kin_mem->kin_f1norm = HALF * kin_mem->kin_fnorm * kin_mem->kin_fnorm; kin_mem->kin_fnorm_sub = kin_mem->kin_fnorm; - - if (kin_mem->kin_printfl > 0) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSolInit", INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#endif /* problem has now been successfully initialized */ @@ -1588,9 +1585,9 @@ static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, N_VScale(ratio, kin_mem->kin_pp, kin_mem->kin_pp); pnorm = kin_mem->kin_mxnewtstep; } - - if (kin_mem->kin_printfl > 0) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, pnorm); +#endif /* If constraints are active, then constrain the step accordingly */ @@ -1604,8 +1601,9 @@ static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, N_VScale(kin_mem->kin_stepmul, kin_mem->kin_pp, kin_mem->kin_pp); pnorm *= kin_mem->kin_stepmul; kin_mem->kin_stepl = pnorm; - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, pnorm); + #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, pnorm); + #endif if (pnorm <= kin_mem->kin_scsteptol) { N_VLinearSum(ONE, kin_mem->kin_uu, ONE, kin_mem->kin_pp, kin_mem->kin_unew); return(STEP_TOO_SMALL);} @@ -1651,8 +1649,9 @@ static int KINFullNewton(KINMem kin_mem, realtype *fnormp, realtype *f1normp, kin_mem->kin_sFdotJp *= ratio; kin_mem->kin_sJpnorm *= ratio; - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FNORM, "KINSOL", "KINFullNewton", INFO_FNORM, *fnormp); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FNORM, "KINSOL", "KINFullNewton", INFO_FNORM, *fnormp); +#endif if (pnorm > (POINT99 * kin_mem->kin_mxnewtstep)) *maxStepTaken = SUNTRUE; @@ -1756,7 +1755,9 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, pnorm *= kin_mem->kin_stepmul; rlmax = ONE; kin_mem->kin_stepl = pnorm; - if (kin_mem->kin_printfl > 0) KINPrintInfo(kin_mem, PRNT_PNORM1, "KINSOL", "KINLineSearch", INFO_PNORM1, pnorm); + #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_PNORM1, "KINSOL", "KINLineSearch", INFO_PNORM1, pnorm); + #endif if (pnorm <= kin_mem->kin_scsteptol) { N_VLinearSum(ONE, kin_mem->kin_uu, ONE, kin_mem->kin_pp, kin_mem->kin_unew); return(STEP_TOO_SMALL);} @@ -1806,8 +1807,9 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, rlmin = (kin_mem->kin_scsteptol) / rlength; rl = ONE; - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_LAM, "KINSOL", "KINLineSearch", INFO_LAM, rlmin, kin_mem->kin_f1norm, pnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_LAM, "KINSOL", "KINLineSearch", INFO_LAM, rlmin, kin_mem->kin_f1norm, pnorm); +#endif /* Loop until the ALPHA condition is satisfied. Terminate if rl becomes too small */ @@ -1817,9 +1819,10 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, alpha_cond = kin_mem->kin_f1norm + (alpha * slpi * rl); - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_ALPHA, "KINSOL", "KINLinesearch", - INFO_ALPHA, *fnormp, *f1normp, alpha_cond, rl); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_ALPHA, "KINSOL", "KINLinesearch", + INFO_ALPHA, *fnormp, *f1normp, alpha_cond, rl); +#endif /* If ALPHA condition is satisfied, break out from loop */ @@ -1908,9 +1911,10 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, alpha_cond = kin_mem->kin_f1norm + (alpha * slpi * rl); beta_cond = kin_mem->kin_f1norm + (beta * slpi * rl); - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_BETA, "KINSOL", "KINLineSearch", - INFO_BETA, *f1normp, beta_cond, rl); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_BETA, "KINSOL", "KINLineSearch", + INFO_BETA, *f1normp, beta_cond, rl); +#endif } while (((*f1normp) <= alpha_cond) && ((*f1normp) < beta_cond) && (rl < rlmax)); @@ -1937,9 +1941,10 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, alpha_cond = kin_mem->kin_f1norm + (alpha * slpi * rl); beta_cond = kin_mem->kin_f1norm + (beta * slpi * rl); - if (kin_mem->kin_printfl > 2) - KINPrintInfo(kin_mem, PRNT_ALPHABETA, "KINSOL", "KINLineSearch", - INFO_ALPHABETA, *f1normp, alpha_cond, beta_cond, rl); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_ALPHABETA, "KINSOL", "KINLineSearch", + INFO_ALPHABETA, *f1normp, alpha_cond, beta_cond, rl); +#endif if ((*f1normp) > alpha_cond) rldiff = rlinc; else if (*f1normp < beta_cond) { @@ -1976,8 +1981,9 @@ static int KINLineSearch(KINMem kin_mem, realtype *fnormp, realtype *f1normp, kin_mem->kin_nbktrk += nbktrk_l; - if (kin_mem->kin_printfl > 1) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_ADJ, "KINSOL", "KINLineSearch", INFO_ADJ, nbktrk_l); +#endif /* scale sFdotJp and sJpnorm by rl * ratio for later use in KINForcingTerm */ @@ -2065,8 +2071,9 @@ static int KINStop(KINMem kin_mem, booleantype maxStepTaken, int sflag) fmax = KINScFNorm(kin_mem, kin_mem->kin_fval, kin_mem->kin_fscale); - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINStop", INFO_FMAX, fmax); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINStop", INFO_FMAX, fmax); +#endif if (fmax <= kin_mem->kin_fnormtol) return(KIN_SUCCESS); @@ -2375,17 +2382,7 @@ void KINInfoHandler(const char *module, const char *function, char *msg, void *data) { KINMem kin_mem; - - /* data points to kin_mem here */ - kin_mem = (KINMem) data; -#ifndef NO_FPRINTF_OUTPUT - if (kin_mem->kin_infofp != NULL && - kin_mem->kin_infofp != kin_mem->kin_sunctx->logger->info_fp) { - fprintf(kin_mem->kin_infofp,"\n[%s] %s\n",module, function); - fprintf(kin_mem->kin_infofp," %s\n",msg); - } -#endif #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_INFO, "KINSOL::KINInfoHandler", function, "%s", msg); @@ -2578,14 +2575,16 @@ static int KINPicardAA(KINMem kin_mem) kin_mem->kin_fnorm = KINScFNorm(kin_mem, kin_mem->kin_fval, kin_mem->kin_fscale); - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINPicardAA", INFO_FMAX, - kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINPicardAA", INFO_FMAX, + kin_mem->kin_fnorm); +#endif - /* print the current iter, fnorm, and nfe values if printfl > 0 */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINPicardAA", INFO_NNI, - kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + /* print the current iter, fnorm, and nfe values */ + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINPicardAA", INFO_NNI, + kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#endif /* Check if the maximum number of iterations is reached */ if (kin_mem->kin_nni >= kin_mem->kin_mxiter) { @@ -2608,9 +2607,9 @@ static int KINPicardAA(KINMem kin_mem) fflush(kin_mem->kin_errfp); } /* end of loop; return */ - - if (kin_mem->kin_printfl > 0) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINPicardAA", INFO_RETVAL, ret); +#endif return(ret); } @@ -2786,14 +2785,16 @@ static int KINFP(KINMem kin_mem) /* measure || g(x) - x || */ kin_mem->kin_fnorm = KINScFNorm(kin_mem, delta, kin_mem->kin_fscale); - if (kin_mem->kin_printfl > 1) - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINFP", INFO_FMAX, - kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINFP", INFO_FMAX, + kin_mem->kin_fnorm); +#endif - /* print the current iter, fnorm, and nfe values if printfl > 0 */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINFP", INFO_NNI, - kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + /* print the current iter, fnorm, and nfe values */ + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINFP", INFO_NNI, + kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); +#endif /* Check if the maximum number of iterations is reached */ if (kin_mem->kin_nni >= kin_mem->kin_mxiter) { @@ -2814,8 +2815,9 @@ static int KINFP(KINMem kin_mem) } /* end of loop; return */ - if (kin_mem->kin_printfl > 0) - KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINFP", INFO_RETVAL, ret); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINFP", INFO_RETVAL, ret); +#endif return(ret); } diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index 6645333d90..e46968053b 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -85,56 +85,6 @@ int KINSetErrFile(void *kinmem, FILE *errfp) return(KIN_SUCCESS); } -/* - * ----------------------------------------------------------------- - * Function : KINSetPrintLevel - * ----------------------------------------------------------------- - */ - -int KINSetPrintLevel(void *kinmem, int printfl) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetPrintLevel", MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - - if ((printfl < 0) || (printfl > 3)) { - KINProcessError(NULL, KIN_ILL_INPUT, "KINSOL", "KINSetPrintLevel", MSG_BAD_PRINTFL); - return(KIN_ILL_INPUT); - } - - kin_mem->kin_printfl = printfl; - - return(KIN_SUCCESS); -} - -/* - * ----------------------------------------------------------------- - * KINSetInfoHandlerFn - * ----------------------------------------------------------------- - */ - -int KINSetInfoHandlerFn(void *kinmem, KINInfoHandlerFn ihfun, void *ih_data) -{ - KINMem kin_mem; - - if (kinmem == NULL) { - KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetInfoHandlerFn", MSG_NO_MEM); - return(KIN_MEM_NULL); - } - - kin_mem = (KINMem) kinmem; - - kin_mem->kin_ihfun = ihfun; - kin_mem->kin_ih_data = ih_data; - - return(KIN_SUCCESS); -} - /* * ----------------------------------------------------------------- * Function : KINSetUserData From afbc36f908478cd8ee858a3e82447153ad707492 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 7 Nov 2023 22:43:46 -0800 Subject: [PATCH 51/85] remove unused variable --- .../arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp | 2 -- examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp index 69db66ca35..2d157c3d8c 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -232,7 +232,6 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Create the ARK timestepper module */ arkode_mem = ARKStepCreate(Advection, Reaction, uopt->t0, y, ctx); @@ -380,7 +379,6 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - char fname[MXSTR]; /* Create the ERK timestepper module */ arkode_mem = ERKStepCreate(AdvectionReaction, uopt->t0, y, ctx); diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c index 3110dc980f..b05278871a 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -369,7 +369,6 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npre, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Create the ARK timestepper module */ arkode_mem = ARKStepCreate(Advection, Reaction, uopt->t0, y, ctx); @@ -520,7 +519,6 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, int iout; /* output counter */ long int nst, nst_a, netf; /* step stats */ long int nfe; /* RHS stats */ - char fname[MXSTR]; /* Create the ERK timestepper module */ arkode_mem = ERKStepCreate(AdvectionReaction, uopt->t0, y, ctx); From 83f2c7cc63dec96df9b71ebe90ae2ca305a580f4 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Thu, 9 Nov 2023 00:14:22 -0800 Subject: [PATCH 52/85] remove unused variables --- .../ark_brusselator1D_task_local_nls_f2003.f90 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 index 4e338af38a..e3888b5fde 100644 --- a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003.f90 @@ -998,7 +998,7 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) use fsunlinsol_dense_mod use fsunmatrix_dense_mod - use ode_mod, only : sunctx, Nvar, comm, monitor + use ode_mod, only : sunctx, Nvar, comm !======= Declarations ========= implicit none @@ -1011,7 +1011,6 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) type(SUNNonlinearSolver_Ops), pointer :: nlsops ! solver operations integer :: ierr ! MPI error status - integer(c_int) :: retval ! SUNDIALS error status !======= Internals ============ @@ -1252,7 +1251,6 @@ subroutine EvolveProblemIMEX(sunvec_y) integer :: ierr ! MPI error status integer :: iout ! output counter double precision :: tout, dtout ! output time and update - character(len=100) :: outname ! diagnostics ouptput file !======= Internals ============ @@ -1544,7 +1542,6 @@ subroutine EvolveProblemExplicit(sunvec_y) integer :: ierr ! output counter integer :: iout ! output counter double precision :: tout, dtout ! output time and update - character(len=100) :: outname ! diagnostics ouptput file !======= Internals ============ From 6fcb7cb9954ef1f08c83b244867f334c9f713af8 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Thu, 9 Nov 2023 11:51:52 -0800 Subject: [PATCH 53/85] Update examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp Co-authored-by: Daniel R. Reynolds --- examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp index 82d4a7b6f2..4bb96c8ab4 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -705,7 +705,7 @@ int main(int argc, char* argv[]) ARKStepFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user dat + FreeUserData(udata); // Free user data delete udata; braid_Destroy(core); // Free braid memory ARKBraid_Free(&app); // Free interface memory From 4cff0ae6548d9223a6671ed6d662719e43e124ac Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:36:46 -0800 Subject: [PATCH 54/85] remove delted functions from soruce --- doc/shared/nvectors/NVector_OpenMP.rst | 12 +++++------- doc/shared/nvectors/NVector_OpenMPDEV.rst | 12 +++++------- doc/shared/nvectors/NVector_PETSc.rst | 12 +++++------- doc/shared/nvectors/NVector_ParHyp.rst | 12 +++++------- doc/shared/nvectors/NVector_Parallel.rst | 12 +++++------- doc/shared/nvectors/NVector_Pthreads.rst | 12 +++++------- doc/shared/nvectors/NVector_Serial.rst | 12 +++++------- doc/shared/nvectors/NVector_Trilinos.rst | 3 +-- src/nvector/openmp/nvector_openmp.c | 19 ------------------- src/nvector/openmpdev/nvector_openmpdev.c | 19 ------------------- src/nvector/parallel/nvector_parallel.c | 20 -------------------- src/nvector/parhyp/nvector_parhyp.c | 21 --------------------- src/nvector/petsc/nvector_petsc.c | 20 -------------------- src/nvector/pthreads/nvector_pthreads.c | 19 ------------------- src/nvector/serial/nvector_serial.c | 19 ------------------- 15 files changed, 36 insertions(+), 188 deletions(-) diff --git a/doc/shared/nvectors/NVector_OpenMP.rst b/doc/shared/nvectors/NVector_OpenMP.rst index dcd63c0709..09e3311bb9 100644 --- a/doc/shared/nvectors/NVector_OpenMP.rst +++ b/doc/shared/nvectors/NVector_OpenMP.rst @@ -289,13 +289,11 @@ options as the vector they are cloned from while vectors created with ``v_data = NV_DATA_OMP(v)`` and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_OMP(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_OpenMP`, :c:func:`N_VMake_OpenMP`, and - :c:func:`N_VCloneVectorArrayEmpty_OpenMP()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_OpenMP()` and - :c:func:`N_VDestroyVectorArray_OpenMP()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointer. +* :c:func:`N_VNewEmpty_OpenMP` and :c:func:`N_VMake_OpenMP` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_OpenMP()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_OPENMP implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_OpenMPDEV.rst b/doc/shared/nvectors/NVector_OpenMPDEV.rst index 8415431485..9db8affe63 100644 --- a/doc/shared/nvectors/NVector_OpenMPDEV.rst +++ b/doc/shared/nvectors/NVector_OpenMPDEV.rst @@ -291,13 +291,11 @@ options as the vector they are cloned from while vectors created with back from the device with ``N_VCopyFromDevice_OpenMPDEV(v)`` to ensure the array is up to date. -* :c:func:`N_VNewEmpty_OpenMPDEV`, :c:func:`N_VMake_OpenMPDEV`, and - :c:func:`N_VCloneVectorArrayEmpty_OpenMPDEV()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_OpenMPDEV()` and - :c:func:`N_VDestroyVectorArray_OpenMPDEV()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointers. +* :c:func:`N_VNewEmpty_OpenMPDEV` and :c:func:`N_VMake_OpenMPDEV` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_OpenMPDEV()` + will not attempt to free the pointer data for any ``N_Vector`` with *own_data* + set to ``SUNFALSE``. In such a case, it is the user's responsibility to + deallocate the data pointers. * To maximize efficiency, vector operations in the NVECTOR_OPENMPDEV implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_PETSc.rst b/doc/shared/nvectors/NVector_PETSc.rst index 6c8549f46c..5857f5d249 100644 --- a/doc/shared/nvectors/NVector_PETSc.rst +++ b/doc/shared/nvectors/NVector_PETSc.rst @@ -179,13 +179,11 @@ options as the vector they are cloned from while vectors created with is recommeded to extract the PETSc vector via ``x_vec = N_VGetVector_Petsc(v);`` and then access components using appropriate PETSc functions. -* The functions :c:func:`N_VNewEmpty_Petsc`, :c:func:`N_VMake_Petsc`, - and :c:func:`N_VCloneVectorArrayEmpty_Petsc()` set the field - *own_data* to ``SUNFALSE``. The routines :c:func:`N_VDestroy_Petsc()` and - :c:func:`N_VDestroyVectorArray_Petsc()` will not attempt to free the - pointer ``pvec`` for any ``N_Vector`` with *own_data* set to - ``SUNFALSE``. In such a case, it is the user's responsibility to - deallocate the ``pvec`` pointer. +* The functions :c:func:`N_VNewEmpty_Petsc` and :c:func:`N_VMake_Petsc`, set the + field *own_data* to ``SUNFALSE``. The routine :c:func:`N_VDestroy_Petsc()` + will not attempt to free the pointer ``pvec`` for any ``N_Vector`` with + *own_data* set to ``SUNFALSE``. In such a case, it is the user's + responsibility to deallocate the ``pvec`` pointer. * To maximize efficiency, vector operations in the NVECTOR_PETSC implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index 92b881bbd6..6009af0424 100644 --- a/doc/shared/nvectors/NVector_ParHyp.rst +++ b/doc/shared/nvectors/NVector_ParHyp.rst @@ -188,13 +188,11 @@ options as the vector they are cloned from while vectors created with ``x_vec = N_VGetVector_ParHyp(v)`` and then access components using appropriate HYPRE functions. -* :c:func:`N_VNewEmpty_ParHyp`, :c:func:`N_VMake_ParHyp`, and - :c:func:`N_VCloneVectorArrayEmpty_ParHyp()` set the field *own_parvector* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_ParHyp()` and - :c:func:`N_VDestroyVectorArray_ParHyp()` will not attempt to delete an - underlying HYPRE vector for any ``N_Vector`` with *own_parvector* - set to ``SUNFALSE``. In such a case, it is the user's responsibility - to delete the underlying vector. +* :c:func:`N_VNewEmpty_ParHyp`, and :c:func:`N_VMake_ParHyp` set the field + *own_parvector* to ``SUNFALSE``. The function :c:func:`N_VDestroy_ParHyp()` + will not attempt to delete an underlying HYPRE vector for any ``N_Vector`` + with *own_parvector* set to ``SUNFALSE``. In such a case, it is the + user's responsibility to delete the underlying vector. * To maximize efficiency, vector operations in the NVECTOR_PARHYP implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Parallel.rst b/doc/shared/nvectors/NVector_Parallel.rst index 0b9b2ae8f7..56721550c1 100644 --- a/doc/shared/nvectors/NVector_Parallel.rst +++ b/doc/shared/nvectors/NVector_Parallel.rst @@ -287,13 +287,11 @@ options as the vector they are cloned from, while vectors created with ``v_data = NV_DATA_P(v)``, and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_P(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_Parallel`, :c:func:`N_VMake_Parallel`, and - :c:func:`N_VCloneVectorArrayEmpty_Parallel()` set the field *own_data* to - ``SUNFALSE``. The routines :c:func:`N_VDestroy_Parallel()` and - :c:func:`N_VDestroyVectorArray_Parallel()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to - ``SUNFALSE``. In such a case, it is the user's responsibility to - deallocate the data pointer. +* :c:func:`N_VNewEmpty_Parallel` and :c:func:`N_VMake_Parallel` set the field + *own_data* to ``SUNFALSE``. The routine :c:func:`N_VDestroy_Parallel()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_PARALLEL implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Pthreads.rst b/doc/shared/nvectors/NVector_Pthreads.rst index fc78cfa323..5669210aa5 100644 --- a/doc/shared/nvectors/NVector_Pthreads.rst +++ b/doc/shared/nvectors/NVector_Pthreads.rst @@ -285,13 +285,11 @@ options as the vector they are cloned from while vectors created with NV_DATA_PT(v)`` and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_S(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_Pthreads`, :c:func:`N_VMake_Pthreads`, and - :c:func:`N_VCloneVectorArrayEmpty_Pthreads()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_Pthreads()` and - :c:func:`N_VDestroyVectorArray_Pthreads()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointer. +* :c:func:`N_VNewEmpty_Pthreads` and :c:func:`N_VMake_Pthreads` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_Pthreads()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_PTHREADS implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Serial.rst b/doc/shared/nvectors/NVector_Serial.rst index 53194e0569..b7b8bcab24 100644 --- a/doc/shared/nvectors/NVector_Serial.rst +++ b/doc/shared/nvectors/NVector_Serial.rst @@ -263,13 +263,11 @@ options as the vector they are cloned, from while vectors created with and then access ``v_data[i]`` within the loop than it is to use ``NV_Ith_S(v,i)`` within the loop. -* :c:func:`N_VNewEmpty_Serial`, :c:func:`N_VMake_Serial`, and - :c:func:`N_VCloneVectorArrayEmpty_Serial()` set the field *own_data* - to ``SUNFALSE``. The functions :c:func:`N_VDestroy_Serial()` and - :c:func:`N_VDestroyVectorArray_Serial()` will not attempt to free the - pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. - In such a case, it is the user's responsibility to deallocate the - data pointer. +* :c:func:`N_VNewEmpty_Serial`, :c:func:`N_VMake_Serial` set the field + *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_Serial()` will + not attempt to free the pointer data for any ``N_Vector`` with *own_data* set + to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate + the data pointer. * To maximize efficiency, vector operations in the NVECTOR_SERIAL implementation that have more than one ``N_Vector`` argument do not diff --git a/doc/shared/nvectors/NVector_Trilinos.rst b/doc/shared/nvectors/NVector_Trilinos.rst index 861ffcacbf..6a47becd0c 100644 --- a/doc/shared/nvectors/NVector_Trilinos.rst +++ b/doc/shared/nvectors/NVector_Trilinos.rst @@ -108,7 +108,6 @@ The module NVECTOR_TRILINOS provides the following additional user-callable rout N_VGetVector_Trilinos(v)`` and then access components using the appropriate Trilinos functions. -* The functions ``N_VDestroy_Trilinos`` and - ``N_VDestroyVectorArray_Trilinos`` only delete the ``N_Vector`` +* The function ``N_VDestroy_Trilinos`` only deletes the ``N_Vector`` wrapper. The underlying Tpetra vector object will exist for as long as there is at least one reference to it. diff --git a/src/nvector/openmp/nvector_openmp.c b/src/nvector/openmp/nvector_openmp.c index d9d3889493..5b8db6e85a 100644 --- a/src/nvector/openmp/nvector_openmp.c +++ b/src/nvector/openmp/nvector_openmp.c @@ -219,25 +219,6 @@ N_Vector* N_VCloneVectorArray_OpenMP(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new vectors with NULL data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_OpenMP(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_OpenMP - */ - -void N_VDestroyVectorArray_OpenMP(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ diff --git a/src/nvector/openmpdev/nvector_openmpdev.c b/src/nvector/openmpdev/nvector_openmpdev.c index 7b8d46bf9b..3d4ccd8355 100644 --- a/src/nvector/openmpdev/nvector_openmpdev.c +++ b/src/nvector/openmpdev/nvector_openmpdev.c @@ -230,25 +230,6 @@ N_Vector *N_VCloneVectorArray_OpenMPDEV(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new vectors with NULL data array. - */ - -N_Vector *N_VCloneVectorArrayEmpty_OpenMPDEV(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_OpenMPDEV - */ - -void N_VDestroyVectorArray_OpenMPDEV(N_Vector *vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ diff --git a/src/nvector/parallel/nvector_parallel.c b/src/nvector/parallel/nvector_parallel.c index 88dee009e6..097e2cd1ee 100644 --- a/src/nvector/parallel/nvector_parallel.c +++ b/src/nvector/parallel/nvector_parallel.c @@ -241,26 +241,6 @@ N_Vector* N_VCloneVectorArray_Parallel(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------- - * Function to create an array of new parallel vectors with empty - * (NULL) data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_Parallel(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Parallel - */ - -void N_VDestroyVectorArray_Parallel(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------- * Function to return global vector length */ diff --git a/src/nvector/parhyp/nvector_parhyp.c b/src/nvector/parhyp/nvector_parhyp.c index c5a7983c7c..5397f0308b 100644 --- a/src/nvector/parhyp/nvector_parhyp.c +++ b/src/nvector/parhyp/nvector_parhyp.c @@ -266,27 +266,6 @@ N_Vector *N_VCloneVectorArray_ParHyp(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------- - * Function to create an array of new parhyp vector wrappers - * without uderlying HYPRE vectors. - */ - -N_Vector *N_VCloneVectorArrayEmpty_ParHyp(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_ParHyp - */ - -void N_VDestroyVectorArray_ParHyp(N_Vector *vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - - /* ---------------------------------------------------------------- * Extract HYPRE vector */ diff --git a/src/nvector/petsc/nvector_petsc.c b/src/nvector/petsc/nvector_petsc.c index 0cd81a84c8..3dbff29050 100644 --- a/src/nvector/petsc/nvector_petsc.c +++ b/src/nvector/petsc/nvector_petsc.c @@ -248,26 +248,6 @@ N_Vector *N_VCloneVectorArray_Petsc(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------- - * Function to create an array of new PETSc vector wrappers with - * empty (NULL) PETSc vectors. - */ - -N_Vector *N_VCloneVectorArrayEmpty_Petsc(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Petsc - */ - -void N_VDestroyVectorArray_Petsc(N_Vector *vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------- * Function to extract PETSc vector */ diff --git a/src/nvector/pthreads/nvector_pthreads.c b/src/nvector/pthreads/nvector_pthreads.c index 62093e6363..d4b3b10caa 100644 --- a/src/nvector/pthreads/nvector_pthreads.c +++ b/src/nvector/pthreads/nvector_pthreads.c @@ -289,25 +289,6 @@ N_Vector* N_VCloneVectorArray_Pthreads(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new vectors with NULL data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_Pthreads(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Pthreads - */ - -void N_VDestroyVectorArray_Pthreads(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ diff --git a/src/nvector/serial/nvector_serial.c b/src/nvector/serial/nvector_serial.c index 980363fbb6..43ced7bc82 100644 --- a/src/nvector/serial/nvector_serial.c +++ b/src/nvector/serial/nvector_serial.c @@ -213,25 +213,6 @@ N_Vector* N_VCloneVectorArray_Serial(int count, N_Vector w) return(N_VCloneVectorArray(count, w)); } -/* ---------------------------------------------------------------------------- - * Function to create an array of new serial vectors with NULL data array. - */ - -N_Vector* N_VCloneVectorArrayEmpty_Serial(int count, N_Vector w) -{ - return(N_VCloneEmptyVectorArray(count, w)); -} - -/* ---------------------------------------------------------------------------- - * Function to free an array created with N_VCloneVectorArray_Serial - */ - -void N_VDestroyVectorArray_Serial(N_Vector* vs, int count) -{ - N_VDestroyVectorArray(vs, count); - return; -} - /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ From b6018207ea6074c37854b7a49ed6aa7a6d056a9e Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:42:56 -0800 Subject: [PATCH 55/85] remove unused kinsol parts --- doc/kinsol/guide/source/Usage/index.rst | 76 ------------------------- src/kinsol/kinsol.c | 29 ++-------- src/kinsol/kinsol_impl.h | 13 ----- 3 files changed, 4 insertions(+), 114 deletions(-) diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index a2414757c3..98deec00ea 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -485,8 +485,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. +--------------------------------------------------------+----------------------------------+------------------------------+ | Data for problem-defining function | :c:func:`KINSetUserData` | ``NULL`` | +--------------------------------------------------------+----------------------------------+------------------------------+ - | Verbosity level of output | :c:func:`KINSetPrintLevel` | 0 | - +--------------------------------------------------------+----------------------------------+------------------------------+ | Max. number of nonlinear iterations | :c:func:`KINSetNumMaxIters` | 200 | +--------------------------------------------------------+----------------------------------+------------------------------+ | No initial matrix setup | :c:func:`KINSetNoInitSetup` | ``SUNFALSE`` | @@ -599,57 +597,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. ``NULL`` will always be directed to ``stderr``. -.. c:function:: int KINSetInfoHandlerFn(void * kin_mem, KINInfoHandlerFn ihfun, void * ih_data) - - The function :c:func:`KINSetInfoHandlerFn` specifies the optional - user-defined function to be used in handling informative (non-error) - messages. - - **Arguments:** - * ``kin_mem`` -- pointer to the KINSOL memory block. - * ``ihfun`` -- is the user's CC information handler function (see :numref:`KINSOL.Usage.CC.user_fct_sim.ihFn`). - * ``ih_data`` -- pointer to user data passed to ``ihfun`` every time it is called. - - **Return value:** - * ``KIN_SUCCESS`` -- The function ``ihfun`` and data pointer ``ih_data`` have been successfully set. - * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. - - -.. c:function:: int KINSetPrintLevel(void * kin_mem, int printfl) - - The function :c:func:`KINSetPrintLevel` specifies the level of verbosity of the output. - - **Arguments:** - * ``kin_mem`` -- pointer to the KINSOL memory block. - * ``printfl`` -- flag indicating the level of verbosity. Must be one of: - - 0 -- no information is displayed. - - 1 -- for each nonlinear iteration display the following information: - - - the scaled Euclidean :math:`\ell_2` norm of the system function evaluated at the current iterate, - - the scaled norm of the Newton step (only if using ``KIN_NONE``), and - - the number of function evaluations performed so far. - - 2 -- display level 1 output and the following values for each iteration: - - - :math:`\|F(u)\|_{D_F}` (only for ``KIN_NONE``). - - :math:`\|F(u)\|_{D_F,\infty}` (for ``KIN_NONE`` and ``KIN_LINESEARCH``). - - 3 -- display level 2 output plus - - - additional values used by the global strategy (only if using ``KIN_LINESEARCH``), and - - statistical information for iterative linear solver modules. - - **Return value:** - * ``KIN_SUCCESS`` -- The optional value has been successfully set. - * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. - * ``KIN_ILL_INPUT`` -- The argument ``printfl`` had an illegal value. - - **Notes:** - The default value for ``printfl`` is :math:`0`. - - .. c:function:: int KINSetUserData(void * kin_mem, void * user_data) The function :c:func:`KINSetUserData` specifies the pointer to user-defined @@ -1972,29 +1919,6 @@ follows: warnings. If a function that returns a pointer to memory encounters an error, it sets ``error_code`` to 0. -.. _KINSOL.Usage.CC.user_fct_sim.ihFn: - -Informational message handler function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The user may provide a function of type :c:type:`KINInfoHandlerFn` to process any such messages. -The function type :c:type:`KINInfoHandlerFn` is defined as follows: - -.. c:type:: void (*KINInfoHandlerFn)(const char *module, const char *function, char *msg, void *ih_data) - - This function processes error and warning messages from KINSOL and its - sub-modules. - - **Arguments:** - * ``error_code`` -- is the error code - * ``module`` -- is the name of the KINSOL module reporting the error - * ``function`` -- is the name of the function in which the error occurred - * ``ih_data`` -- is a pointer to user data, the same as the ``ih_data`` - parameter passed to :c:func:`KINSetInfoHandlerFn` - - **Return value:** - This function has no return value. - .. _KINSOL.Usage.CC.user_fct_sim.jacFn: diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 3f5171a88c..3446f0ff65 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -49,7 +49,6 @@ * KINScSNorm * KINSOL Verbose output functions * KINPrintInfo - * KINInfoHandler * KINSOL Error Handling functions * KINProcessError * KINErrHandler @@ -274,8 +273,6 @@ void *KINCreate(SUNContext sunctx) kin_mem->kin_constraintsSet = SUNFALSE; kin_mem->kin_ehfun = KINErrHandler; kin_mem->kin_eh_data = kin_mem; - kin_mem->kin_ihfun = KINInfoHandler; - kin_mem->kin_ih_data = kin_mem; kin_mem->kin_ret_newest = SUNFALSE; kin_mem->kin_mxiter = MXITER_DEFAULT; kin_mem->kin_noInitSetup = SUNFALSE; @@ -2359,9 +2356,10 @@ void KINPrintInfo(KINMem kin_mem, } - /* call the info message handler */ - - kin_mem->kin_ihfun(module, fname, msg, kin_mem->kin_ih_data); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_INFO, + "KINSOL", fname, "%s", msg); +#endif /* finalize argument processing */ @@ -2370,25 +2368,6 @@ void KINPrintInfo(KINMem kin_mem, return; } - -/* - * KINInfoHandler - * - * This is the default KINSOL info handling function. - * It sends the info message to the stream pointed to by kin_infofp - */ - -void KINInfoHandler(const char *module, const char *function, - char *msg, void *data) -{ - KINMem kin_mem; - kin_mem = (KINMem) data; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_INFO, - "KINSOL::KINInfoHandler", function, "%s", msg); -#endif -} - /* * ================================================================= * KINSOL Error Handling functions diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index 47a684cc73..d76542cfdc 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -47,7 +47,6 @@ extern "C" { /* KINSOL default constants */ -#define PRINTFL_DEFAULT 0 #define MXITER_DEFAULT 200 #define MXNBCF_DEFAULT 10 #define MSBSET_DEFAULT 10 @@ -90,7 +89,6 @@ typedef struct KINMemRec { realtype kin_scsteptol; /* scaled step length tolerance */ int kin_globalstrategy; /* choices are KIN_NONE, KIN_LINESEARCH KIN_PICARD and KIN_FP */ - int kin_printfl; /* level of verbosity of output */ long int kin_mxiter; /* maximum number of nonlinear iterations */ long int kin_msbset; /* maximum number of nonlinear iterations that may be performed between calls to the @@ -279,16 +277,6 @@ typedef struct KINMemRec { void *kin_eh_data; /* dats pointer passed to ehfun */ FILE *kin_errfp; /* KINSOL error messages are sent to errfp */ - KINInfoHandlerFn kin_ihfun; /* Info messages are handled by ihfun */ - void *kin_ih_data; /* dats pointer passed to ihfun */ - FILE *kin_infofp; /* where KINSol info messages are sent */ - - /*--------- - Debugging - ---------*/ - - FILE *kin_debugfp; /* debugging output file */ - } *KINMem; /* @@ -432,7 +420,6 @@ void KINInfoHandler(const char *module, const char *function, #define MSG_FUNC_NULL "func = NULL illegal." #define MSG_NO_MALLOC "Attempt to call before KINMalloc illegal." -#define MSG_BAD_PRINTFL "Illegal value for printfl." #define MSG_BAD_MXITER "Illegal value for mxiter." #define MSG_BAD_MSBSET "Illegal msbset < 0." #define MSG_BAD_MSBSETSUB "Illegal msbsetsub < 0." From 9690f3d199d4b49883ac9b19c9ef9bb9a677d92b Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:50:33 -0800 Subject: [PATCH 56/85] remove use of printfl --- src/kinsol/kinsol_ls.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index 61e9f8f659..59dd1ccb8c 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -1244,9 +1244,11 @@ int kinLsSolve(KINMem kin_mem, N_Vector xx, N_Vector bb, if (kinls_mem->LS->ops->numiters) nli_inc = SUNLinSolNumIters(kinls_mem->LS); - if (kinls_mem->iterative && kin_mem->kin_printfl > 2) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + if (kinls_mem->iterative) KINPrintInfo(kin_mem, PRNT_NLI, "KINLS", "kinLsSolve", INFO_NLI, nli_inc); +#endif /* Increment counters nli and ncfl */ kinls_mem->nli += nli_inc; @@ -1325,9 +1327,11 @@ int kinLsSolve(KINMem kin_mem, N_Vector xx, N_Vector bb, } } - if (kin_mem->kin_inexact_ls && kin_mem->kin_printfl > 2) +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO + if (kin_mem->kin_inexact_ls) KINPrintInfo(kin_mem, PRNT_EPS, "KINLS", "kinLsSolve", INFO_EPS, res_norm, kin_mem->kin_eps); +#endif return(0); } From 4a8ad535ff08f14cc236149d239ecbd5b5434604 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:52:39 -0800 Subject: [PATCH 57/85] change default logging level --- cmake/SundialsBuildOptionsPre.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index 227c734045..3de3b3a29a 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -76,12 +76,12 @@ sundials_option(SUNDIALS_BUILD_WITH_PROFILING BOOL "${DOCSTR}" OFF) # --------------------------------------------------------------- set(DOCSTR "Build with logging capabilities enabled (0 = no logging, 1 = errors, 2 = +warnings, 3 = +info, 4 = +debug, 5 = +extras") -sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 3 +sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 2 OPTIONS "0;1;2;3;4;5") -if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 4) +if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 3) message(STATUS "SUNDIALS logging level set to ${SUNDIALS_LOGGING_LEVEL}") - message(WARNING "SUNDIALS built with debug logging turned on, performance may be affected.") + message(WARNING "SUNDIALS built with additional logging turned on, performance may be affected.") endif() set(DOCSTR "Build SUNDIALS logging with MPI support") From dbf7f3f6a2382b6221c561412928da83e7c46762 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:53:31 -0800 Subject: [PATCH 58/85] remove more unused stuff in arkode --- src/arkode/arkode_impl.h | 5 ----- src/arkode/arkode_io.c | 27 --------------------------- 2 files changed, 32 deletions(-) diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 6cd8b85c25..596d3202a5 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -390,10 +390,6 @@ struct ARKodeMemRec long int netf; /* num error test failures */ long int nconstrfails; /* number of constraint failures */ - /* Diagnostic output */ - booleantype report; /* flag to enable/disable diagnostic output */ - FILE *diagfp; /* diagnostic outputs are sent to diagfp */ - /* Space requirements for ARKODE */ sunindextype lrw1; /* no. of realtype words in 1 N_Vector */ sunindextype liw1; /* no. of integer words in 1 N_Vector */ @@ -1010,7 +1006,6 @@ int arkSetErrHandlerFn(void *arkode_mem, void *eh_data); int arkSetErrFile(void *arkode_mem, FILE *errfp); int arkSetUserData(void *arkode_mem, void *user_data); -int arkSetDiagnostics(void *arkode_mem, FILE *diagfp); int arkSetMaxNumSteps(void *arkode_mem, long int mxsteps); int arkSetMaxHnilWarns(void *arkode_mem, int mxhnil); int arkSetInitStep(void *arkode_mem, realtype hin); diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index cc45123175..51ee41c81c 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -309,33 +309,6 @@ int arkSetUserData(void *arkode_mem, void *user_data) return(ARK_SUCCESS); } - -/*--------------------------------------------------------------- - arkSetDiagnostics: - - Specifies to enable solver diagnostics, and specifies the FILE - pointer for output (diagfp==NULL disables output) - ---------------------------------------------------------------*/ -int arkSetDiagnostics(void *arkode_mem, FILE *diagfp) -{ - ARKodeMem ark_mem; - if (arkode_mem==NULL) { - arkProcessError(NULL, ARK_MEM_NULL, "ARKODE", - "arkSetDiagnostics", MSG_ARK_NO_MEM); - return(ARK_MEM_NULL); - } - ark_mem = (ARKodeMem) arkode_mem; - ark_mem->diagfp = diagfp; - if (diagfp != NULL) { - ark_mem->report = SUNTRUE; - } else { - ark_mem->report = SUNFALSE; - } - - return(ARK_SUCCESS); -} - - /*--------------------------------------------------------------- arkSetAdaptController: From 89dcad3edef3b45c92773bbe4c52112b59318262 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 13:59:48 -0800 Subject: [PATCH 59/85] remove uses of ark_mem->report --- src/arkode/arkode.c | 5 ----- src/arkode/arkode_adapt.c | 8 -------- src/arkode/arkode_arkstep.c | 10 ---------- src/arkode/arkode_erkstep.c | 10 ---------- src/arkode/arkode_io.c | 2 -- src/arkode/arkode_ls.c | 8 -------- src/arkode/arkode_mristep.c | 8 -------- 7 files changed, 51 deletions(-) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 3b85e35e73..2a910b107d 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -102,10 +102,6 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->relax_enabled = SUNFALSE; ark_mem->relax_mem = NULL; - /* Initialize diagnostics reporting variables */ - ark_mem->report = SUNFALSE; - ark_mem->diagfp = NULL; - /* Initialize lrw and liw */ ark_mem->lrw = 18; ark_mem->liw = 41; /* fcn/data ptr, int, long int, sunindextype, booleantype */ @@ -1435,7 +1431,6 @@ void arkPrintMem(ARKodeMem ark_mem, FILE *outfile) fprintf(outfile, "tstopset = %i\n", ark_mem->tstopset); fprintf(outfile, "tstopinterp = %i\n", ark_mem->tstopinterp); fprintf(outfile, "tstop = %" RSYM"\n", ark_mem->tstop); - fprintf(outfile, "report = %i\n", ark_mem->report); fprintf(outfile, "VabstolMallocDone = %i\n", ark_mem->VabstolMallocDone); fprintf(outfile, "MallocDone = %i\n", ark_mem->MallocDone); fprintf(outfile, "initsetup = %i\n", ark_mem->initsetup); diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index a8d4ef9b90..556b931317 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -160,10 +160,6 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, /* enforce minimum bound time step reduction */ h_acc = int_dir * SUNMAX(SUNRabs(h_acc), SUNRabs(hadapt_mem->etamin*hcur)); - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "%"RSYM" %"RSYM" ", h_acc, h_cfl); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-after-max-min-bounds", @@ -195,10 +191,6 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, ark_mem->eta /= SUNMAX(ONE, SUNRabs(hcur) * ark_mem->hmax_inv*ark_mem->eta); - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "%"RSYM"\n", ark_mem->eta); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkAdapt", "new-step-eta", "eta = %"RSYM, ark_mem->eta); diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index fbe130b2de..b1ea90d03f 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1929,11 +1929,6 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); #endif - /* solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKStep step %li %"RSYM" %i %"RSYM"\n", - ark_mem->nst, ark_mem->h, is, ark_mem->tcur); - /* perform implicit solve if required */ if (implicit_stage) { @@ -2082,11 +2077,6 @@ int arkStep_TakeStep_Z(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif - /* solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKStep etest %li %"RSYM" %"RSYM"\n", - ark_mem->nst, ark_mem->h, *dsmPtr); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkStep_TakeStep_Z", "end-step", diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 6929fd92de..78aec3331a 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -804,11 +804,6 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) /* Set current stage time(s) */ ark_mem->tcur = ark_mem->tn + step_mem->B->c[is]*ark_mem->h; - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ERKStep step %li %"RSYM" %i %"RSYM"\n", - ark_mem->nst, ark_mem->h, is, ark_mem->tcur); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "start-stage", @@ -866,11 +861,6 @@ int erkStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif - /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ERKStep etest %li %"RSYM" %"RSYM"\n", - ark_mem->nst, ark_mem->h, *dsmPtr); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", "error-test", diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 51ee41c81c..fe6bd4c5b1 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -86,8 +86,6 @@ int arkSetDefaults(void *arkode_mem) ark_mem->tstopset = SUNFALSE; /* no stop time set */ ark_mem->tstopinterp = SUNFALSE; /* copy at stop time */ ark_mem->tstop = ZERO; /* no fixed stop time */ - ark_mem->diagfp = NULL; /* no solver diagnostics file */ - ark_mem->report = SUNFALSE; /* don't report solver diagnostics */ ark_mem->hadapt_mem->etamx1 = ETAMX1; /* max change on first step */ ark_mem->hadapt_mem->etamxf = ETAMXF; /* max change on error-failed step */ ark_mem->hadapt_mem->etamin = ETAMIN; /* min bound on time step reduction */ diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 2645a83116..95d081ab15 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -2731,10 +2731,6 @@ int arkLsSolve(void* arkode_mem, N_Vector b, realtype tnow, if (retval != SUNLS_SUCCESS) arkls_mem->ncfl++; /* Log solver statistics to diagnostics file (if requested) */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKLS kry %"RSYM" %"RSYM" %i %i\n", - bnorm, resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsSolve", "ls-stats", "bnorm = %"RSYM", resnorm = %"RSYM @@ -3150,10 +3146,6 @@ int arkLsMassSolve(void *arkode_mem, N_Vector b, realtype nlscoef) if (retval != SUNLS_SUCCESS) arkls_mem->ncfl++; /* Log solver statistics to diagnostics file (if requested) */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "ARKLS mass %"RSYM" %i %i\n", - resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsMassSolve", "mass-ls-stats", diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index f118ed0540..e6d32c65b3 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1569,10 +1569,6 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) ark_mem->tcur = ark_mem->tn + step_mem->MRIC->c[is]*ark_mem->h; /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "MRIStep step %li %"RSYM" %i %"RSYM"\n", - ark_mem->nst, ark_mem->h, is, ark_mem->tcur); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "start-stage", @@ -1679,10 +1675,6 @@ int mriStep_TakeStep(void* arkode_mem, realtype *dsmPtr, int *nflagPtr) #endif /* Solver diagnostics reporting */ - if (ark_mem->report) - fprintf(ark_mem->diagfp, "MRIStep etest %li %"RSYM" %"RSYM"\n", - ark_mem->nst, ark_mem->h, *dsmPtr); - #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "error-test", From a0502e3898733b36687ac14f3533d035d5397bef Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:12:45 -0800 Subject: [PATCH 60/85] build with different logging levels and profiling on/off --- .github/workflows/ubuntu-clang-latest.yml | 38 ++++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 71f398d30a..e809bbabc0 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -1,4 +1,4 @@ -name: Ubuntu (clang) short test +name: Ubuntu/Clang build only (no tpls) on: pull_request: @@ -14,9 +14,13 @@ env: BUILD_TYPE: Release jobs: - build: + build_wo_profiling: runs-on: ubuntu-latest + strategy: + matrix: + logging_level: [0, 1, 2, 3, 4, 5] + steps: - name: Install LLVM and Clang uses: KyleMayes/install-llvm-action@v1 @@ -28,14 +32,32 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DSUNDIALS_LOGGING_LEVEL=${{matrix.logging_level}} - name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + build_w_profiling: + runs-on: ubuntu-latest + + strategy: + matrix: + profiling: ['OFF', 'ON'] + + steps: + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "14.0" + + - uses: actions/checkout@v3 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DSUNDIALS_BUILD_WITH_PROFILING=${{matrix.profiling}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} From 4e38f353f0d63dfa88d9dfb27c7efc4914ffa918 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:13:36 -0800 Subject: [PATCH 61/85] remove broken line --- src/arkode/arkode_adapt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 556b931317..a7604fd69a 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -146,8 +146,6 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, "ARKODE::arkAdapt", "step-history", "hcur = %"RSYM", hhist[0] = %"RSYM", hhist[0] = %"RSYM, hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1]); - - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, #endif /* enforce safety factors */ From 90b09247d23418cda6b7c3cc802fc54b1c51442e Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:21:08 -0800 Subject: [PATCH 62/85] rename GitHub actions CI jobs --- .github/workflows/double-precision.yml | 2 +- .github/workflows/extended-precision.yml | 2 +- .github/workflows/macos-latest.yml | 4 ++-- .github/workflows/single-precision.yml | 2 +- .github/workflows/spack-develop.yml | 2 +- .github/workflows/ubuntu-clang-latest.yml | 2 +- .github/workflows/windows-latest-mingw.yml | 4 ++-- .github/workflows/windows-latest.yml | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/double-precision.yml b/.github/workflows/double-precision.yml index 31feaf3ffb..7f49a290fa 100644 --- a/.github/workflows/double-precision.yml +++ b/.github/workflows/double-precision.yml @@ -1,5 +1,5 @@ # -name: double precision build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc double precision (TPLS, no GPUs) on: push: diff --git a/.github/workflows/extended-precision.yml b/.github/workflows/extended-precision.yml index 55d75f7d5d..af23133d87 100644 --- a/.github/workflows/extended-precision.yml +++ b/.github/workflows/extended-precision.yml @@ -1,5 +1,5 @@ # -name: extended precision build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc extended precision (TPLS, no GPUs) on: pull_request: diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 4d5599295e..457d191b5c 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -1,4 +1,4 @@ -name: MacOS short test +name: Build and Test - MacOS (short) on: pull_request: @@ -14,7 +14,7 @@ env: BUILD_TYPE: Release jobs: - build: + build_and_test: # The CMake configure and build commands are platform agnostic and should work equally # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. diff --git a/.github/workflows/single-precision.yml b/.github/workflows/single-precision.yml index 9a87e7f0bd..c61cb57007 100644 --- a/.github/workflows/single-precision.yml +++ b/.github/workflows/single-precision.yml @@ -1,5 +1,5 @@ # -name: single precision build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc single precision (TPLS, no GPUs) on: pull_request: diff --git a/.github/workflows/spack-develop.yml b/.github/workflows/spack-develop.yml index 745a57df7e..388fdd0940 100644 --- a/.github/workflows/spack-develop.yml +++ b/.github/workflows/spack-develop.yml @@ -1,5 +1,5 @@ # -name: spack@develop build and test with GCC+TPLs (no GPUs) +name: Build and Test - Ubuntu/gcc spack@develop (TPLs, no GPUs) on: pull_request: diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index e809bbabc0..78696e520b 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -1,4 +1,4 @@ -name: Ubuntu/Clang build only (no tpls) +name: Build - Ubuntu/Clang (no TPLS) on: pull_request: diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index 5289a953da..ac296c6b1c 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -1,4 +1,4 @@ -name: Windows (mingw) short test +name: Build and Test - Windows/mingw (short) on: pull_request: @@ -14,7 +14,7 @@ env: BUILD_TYPE: Release jobs: - build: + buil_and_test: runs-on: windows-latest steps: diff --git a/.github/workflows/windows-latest.yml b/.github/workflows/windows-latest.yml index 66489fe976..feca1a4e67 100644 --- a/.github/workflows/windows-latest.yml +++ b/.github/workflows/windows-latest.yml @@ -1,4 +1,4 @@ -name: Windows short test +name: Build and Test - Windows/MSVC (short) on: pull_request: @@ -14,7 +14,7 @@ env: BUILD_TYPE: Release jobs: - build: + build_and_test: runs-on: windows-latest steps: From 6e17a61f5009b1389437f9fcdba0fe70ab97df3d Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:23:42 -0800 Subject: [PATCH 63/85] update log levels cycles through --- .github/workflows/ubuntu-clang-latest.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 78696e520b..6951249aa6 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -14,12 +14,13 @@ env: BUILD_TYPE: Release jobs: - build_wo_profiling: + build_cycle_log_levels: runs-on: ubuntu-latest strategy: matrix: - logging_level: [0, 1, 2, 3, 4, 5] + # 2 is what all other builds use (its the default), so skip it here + logging_level: [0, 1, 3, 4, 5] steps: - name: Install LLVM and Clang @@ -38,7 +39,7 @@ jobs: # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - build_w_profiling: + build_cycle_profiling: runs-on: ubuntu-latest strategy: From 1ef6287efce5800754d3634a54607717da84c0b3 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:27:25 -0800 Subject: [PATCH 64/85] dont automatically include sundials_context.hpp --- include/sundials/sundials_context.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/sundials/sundials_context.h b/include/sundials/sundials_context.h index 6fef61b81d..e0cfb0bc6b 100644 --- a/include/sundials/sundials_context.h +++ b/include/sundials/sundials_context.h @@ -40,9 +40,5 @@ SUNDIALS_EXPORT int SUNContext_Free(SUNContext* ctx); #ifdef __cplusplus } -/* We include this here for backwards compatibility - (the contents used to be defined here directly) */ -#include - #endif #endif From c12540975c3526665bfbeffed4baa42c34645f11 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:27:33 -0800 Subject: [PATCH 65/85] add recent changes --- CHANGELOG.md | 3 +++ doc/arkode/guide/source/Introduction.rst | 4 ++++ doc/cvode/guide/source/Introduction.rst | 4 ++++ doc/cvodes/guide/source/Introduction.rst | 4 ++++ doc/ida/guide/source/Introduction.rst | 4 ++++ doc/idas/guide/source/Introduction.rst | 4 ++++ doc/kinsol/guide/source/Introduction.rst | 4 ++++ 7 files changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8968010eb4..3a2cda6550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,9 @@ method `ARKODE_VERNER_16_8_9`. Changed the `SUNProfiler` so that it does not rely on `MPI_WTime` in any case. This fixes https://github.com/LLNL/sundials/issues/312. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. ## Changes to SUNDIALS in release 6.6.1 diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 10108c8025..b6442c8fd8 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -182,6 +182,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v5.6.1 ----------------- diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index b4c2388e34..daa94f9fee 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -134,6 +134,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index d6ff7db84e..be21b803d0 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -137,6 +137,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 369147817e..83a4da2ba8 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -95,6 +95,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 4dc93c7b41..c9a7d91871 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -112,6 +112,10 @@ This fixes `GitHub Issue #312 `_. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v5.6.1 ----------------- diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index a4c33cc470..7ac3cd37c9 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -104,6 +104,10 @@ CMake targets. Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. +**Breaking change** +Functions, types and header files that were previously deprecated have been +removed. + Changes in v6.6.1 ----------------- From aede7e5ebc3e77da783e09c3cda05a00db7fb921 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:29:00 -0800 Subject: [PATCH 66/85] fix indentation --- doc/shared/nvectors/NVector_ParHyp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index 6009af0424..97f3ed0f40 100644 --- a/doc/shared/nvectors/NVector_ParHyp.rst +++ b/doc/shared/nvectors/NVector_ParHyp.rst @@ -189,7 +189,7 @@ options as the vector they are cloned from while vectors created with appropriate HYPRE functions. * :c:func:`N_VNewEmpty_ParHyp`, and :c:func:`N_VMake_ParHyp` set the field - *own_parvector* to ``SUNFALSE``. The function :c:func:`N_VDestroy_ParHyp()` + *own_parvector* to ``SUNFALSE``. The function :c:func:`N_VDestroy_ParHyp()` will not attempt to delete an underlying HYPRE vector for any ``N_Vector`` with *own_parvector* set to ``SUNFALSE``. In such a case, it is the user's responsibility to delete the underlying vector. From 4d3ed8fdb7fd7113cce72cdab77fffb911ee2a22 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:48:10 -0800 Subject: [PATCH 67/85] undo removal of include --- include/sundials/sundials_context.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sundials/sundials_context.h b/include/sundials/sundials_context.h index e0cfb0bc6b..6fef61b81d 100644 --- a/include/sundials/sundials_context.h +++ b/include/sundials/sundials_context.h @@ -40,5 +40,9 @@ SUNDIALS_EXPORT int SUNContext_Free(SUNContext* ctx); #ifdef __cplusplus } +/* We include this here for backwards compatibility + (the contents used to be defined here directly) */ +#include + #endif #endif From 522489314c27dc9dbbd7034ccc778dc20aafd998 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 14:49:18 -0800 Subject: [PATCH 68/85] dont fail fast --- .github/workflows/ubuntu-clang-latest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 6951249aa6..99321866df 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: # 2 is what all other builds use (its the default), so skip it here logging_level: [0, 1, 3, 4, 5] From 3d4661dba127ede5fc9b339d2041e40d0562c94a Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:01:07 -0800 Subject: [PATCH 69/85] fix logging statements in arkode_adapt broken in merge --- .github/workflows/double-precision.yml | 2 +- .github/workflows/extended-precision.yml | 2 +- .github/workflows/single-precision.yml | 2 +- .github/workflows/ubuntu-clang-latest.yml | 2 +- src/arkode/arkode_adapt.c | 18 ++++++------------ 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/double-precision.yml b/.github/workflows/double-precision.yml index 7f49a290fa..6f43b2f2f2 100644 --- a/.github/workflows/double-precision.yml +++ b/.github/workflows/double-precision.yml @@ -1,5 +1,5 @@ # -name: Build and Test - Ubuntu/gcc double precision (TPLS, no GPUs) +name: Build and Test - Ubuntu/gcc double precision (TPLs, no GPUs) on: push: diff --git a/.github/workflows/extended-precision.yml b/.github/workflows/extended-precision.yml index af23133d87..dfb021dc66 100644 --- a/.github/workflows/extended-precision.yml +++ b/.github/workflows/extended-precision.yml @@ -1,5 +1,5 @@ # -name: Build and Test - Ubuntu/gcc extended precision (TPLS, no GPUs) +name: Build and Test - Ubuntu/gcc extended precision (TPLs, no GPUs) on: pull_request: diff --git a/.github/workflows/single-precision.yml b/.github/workflows/single-precision.yml index c61cb57007..a769b09729 100644 --- a/.github/workflows/single-precision.yml +++ b/.github/workflows/single-precision.yml @@ -1,5 +1,5 @@ # -name: Build and Test - Ubuntu/gcc single precision (TPLS, no GPUs) +name: Build and Test - Ubuntu/gcc single precision (TPLs, no GPUs) on: pull_request: diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 99321866df..eb46e250d4 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -1,4 +1,4 @@ -name: Build - Ubuntu/Clang (no TPLS) +name: Build - Ubuntu/Clang (no TPLs) on: pull_request: diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index a7604fd69a..d18cdf5d5a 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -136,16 +136,10 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, } if (h_cfl <= ZERO) h_cfl = RCONST(1.0e30) * SUNRabs(hcur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkAdapt", "error-history", - "ecur = %"RSYM", ehist[0] = %"RSYM", ehist[0] = %"RSYM, - ecur, hadapt_mem->ehist[0], hadapt_mem->ehist[1]); - - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkAdapt", "step-history", - "hcur = %"RSYM", hhist[0] = %"RSYM", hhist[0] = %"RSYM, - hcur, hadapt_mem->hhist[0], hadapt_mem->hhist[1]); +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, + "ARKODE::arkAdapt", "new-step-before-bounds", + "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif /* enforce safety factors */ @@ -158,8 +152,8 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, /* enforce minimum bound time step reduction */ h_acc = int_dir * SUNMAX(SUNRabs(h_acc), SUNRabs(hadapt_mem->etamin*hcur)); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, "ARKODE::arkAdapt", "new-step-after-max-min-bounds", "h_acc = %"RSYM", h_cfl = %"RSYM, h_acc, h_cfl); #endif From 40f5135cbef189cc14d703cd189a5b5262e1f59e Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:05:55 -0800 Subject: [PATCH 70/85] fix compiler warning --- src/arkode/arkode_ls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 95d081ab15..bb88e24be2 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -3151,6 +3151,10 @@ int arkLsMassSolve(void *arkode_mem, N_Vector b, realtype nlscoef) "ARKODE::arkLsMassSolve", "mass-ls-stats", "resnorm = %"RSYM", ls_iters = %i, prec_solves = %i", resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); +#else + /* Suppress warning about set but unused variables due to logging ifdef. */ + (void) nps_inc; + (void) resnorm; #endif /* Interpret solver return value */ From 07f73ccb555434e37915b8621e5decbab17bd8a8 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:14:28 -0800 Subject: [PATCH 71/85] post merge fixes --- .../ARKStep_c_interface/User_callable.rst | 2 +- include/arkode/arkode_arkstep.h | 8 ++-- include/arkode/arkode_erkstep.h | 8 ++-- src/arkode/arkode.c | 4 +- src/arkode/arkode_adapt.c | 2 +- src/arkode/arkode_adapt_impl.h | 18 ++++---- src/arkode/arkode_arkstep.c | 42 +++++++++---------- src/arkode/arkode_arkstep_impl.h | 12 +++--- src/arkode/arkode_arkstep_io.c | 12 +++--- src/arkode/arkode_erkstep.c | 4 +- src/arkode/arkode_erkstep_io.c | 10 ++--- src/arkode/arkode_impl.h | 20 ++++----- src/arkode/arkode_io.c | 4 +- src/arkode/arkode_mristep.c | 2 +- src/arkode/arkode_sprkstep.c | 2 +- src/arkode/arkode_user_controller.c | 6 +-- src/arkode/arkode_user_controller.h | 14 +++---- src/sundials/sundials_cusolver.h | 2 +- src/sundials/sundials_cusparse.h | 2 +- .../fmod/fsunlinsol_lapackdense_mod.c | 4 +- 20 files changed, 89 insertions(+), 89 deletions(-) diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst index e4b1e23b5b..0425ab5bec 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst @@ -1820,7 +1820,7 @@ Explicit stability function :c:func:`ARKStepSetS .. versionadded:: x.x.x -.. c:function:: int ARKStepSetCFLFraction(void* arkode_mem, realtype cfl_frac) +.. c:function:: int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) Specifies the fraction of the estimated explicitly stable step to use. diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index b2c8145b42..b2c68ddcf8 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -142,19 +142,19 @@ SUNDIALS_EXPORT int ARKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust) SUNDIALS_EXPORT int ARKStepSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac); SUNDIALS_EXPORT int ARKStepSetSafetyFactor(void *arkode_mem, - realtype safety); + sunrealtype safety); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ARKStepSetErrorBias(void *arkode_mem, realtype bias); +int ARKStepSetErrorBias(void *arkode_mem, sunrealtype bias); SUNDIALS_EXPORT int ARKStepSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth); SUNDIALS_EXPORT int ARKStepSetMinReduction(void *arkode_mem, sunrealtype eta_min); SUNDIALS_EXPORT int ARKStepSetFixedStepBounds(void *arkode_mem, - realtype lb, realtype ub); + sunrealtype lb, sunrealtype ub); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ARKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, int pq, - realtype adapt_params[3]); + sunrealtype adapt_params[3]); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ARKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data); diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index eb0729832e..3bb3c573d4 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -90,19 +90,19 @@ SUNDIALS_EXPORT int ERKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust) SUNDIALS_EXPORT int ERKStepSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac); SUNDIALS_EXPORT int ERKStepSetSafetyFactor(void *arkode_mem, - realtype safety); + sunrealtype safety); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ERKStepSetErrorBias(void *arkode_mem, realtype bias); +int ERKStepSetErrorBias(void *arkode_mem, sunrealtype bias); SUNDIALS_EXPORT int ERKStepSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth); SUNDIALS_EXPORT int ERKStepSetMinReduction(void *arkode_mem, sunrealtype eta_min); SUNDIALS_EXPORT int ERKStepSetFixedStepBounds(void *arkode_mem, - realtype lb, realtype ub); + sunrealtype lb, sunrealtype ub); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ERKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, int pq, - realtype adapt_params[3]); + sunrealtype adapt_params[3]); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ERKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data); diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 5f0649008b..cbcdc8d326 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1271,7 +1271,7 @@ void arkErrHandler(int error_code, const char *module, int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) { - booleantype stepperOK, nvectorOK, allocOK; + sunbooleantype stepperOK, nvectorOK, allocOK; int retval; sunindextype lrw1, liw1; @@ -2453,7 +2453,7 @@ int arkYddNorm(ARKodeMem ark_mem, sunrealtype hg, sunrealtype *yddnrm) int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm) { int retval; - realtype troundoff; + sunrealtype troundoff; /* Set current time to the end of the step (in case the last stage time does not coincide with the step solution time). diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index ea349043b2..12f6a4ee8b 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -98,7 +98,7 @@ int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, sunrealtype dsm, long int nst) { int retval; - realtype h_acc, h_cfl, int_dir; + sunrealtype h_acc, h_cfl, int_dir; ARKodeMem ark_mem; int controller_order; if (arkode_mem == NULL) { diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index df7697e417..3d3a1368d8 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -76,19 +76,19 @@ typedef struct ARKodeHAdaptMemRec { sunrealtype etamxf; /* h reduction factor on multiple error fails */ sunrealtype etamin; /* eta >= etamin on error test fail */ int small_nef; /* bound to determine 'multiple' above */ - realtype etacf; /* h reduction factor on nonlinear conv fail */ - realtype cfl; /* cfl safety factor */ - realtype safety; /* accuracy safety factor on h */ - realtype growth; /* maximum step growth safety factor */ - realtype lbound; /* eta lower bound to leave h unchanged */ - realtype ubound; /* eta upper bound to leave h unchanged */ + sunrealtype etacf; /* h reduction factor on nonlinear conv fail */ + sunrealtype cfl; /* cfl safety factor */ + sunrealtype safety; /* accuracy safety factor on h */ + sunrealtype growth; /* maximum step growth safety factor */ + sunrealtype lbound; /* eta lower bound to leave h unchanged */ + sunrealtype ubound; /* eta upper bound to leave h unchanged */ int p; /* embedding order */ int q; /* method order */ int pq; /* decision flag for controller order */ int adjust; /* controller order adjustment factor */ SUNAdaptController hcontroller; /* temporal error controller */ - booleantype owncontroller; /* flag indicating hcontroller ownership */ + sunbooleantype owncontroller; /* flag indicating hcontroller ownership */ ARKExpStabFn expstab; /* step stability function */ void *estab_data; /* user pointer passed to expstab */ @@ -106,8 +106,8 @@ typedef struct ARKodeHAdaptMemRec { ARKodeHAdaptMem arkAdaptInit(); void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE *outfile); int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, - N_Vector ycur, realtype tcur, realtype hcur, - realtype dsm, long int nst); + N_Vector ycur, sunrealtype tcur, sunrealtype hcur, + sunrealtype dsm, long int nst); #ifdef __cplusplus diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index fce86586cc..a8b4f8de32 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1232,15 +1232,15 @@ int arkStep_Init(void* arkode_mem, int init_type) { if (!(step_mem->stage_times)) { - step_mem->stage_times = (realtype*) calloc(step_mem->stages, - sizeof(realtype)); + step_mem->stage_times = (sunrealtype*) calloc(step_mem->stages, + sizeof(sunrealtype)); ark_mem->lrw += step_mem->stages; } if (!(step_mem->stage_coefs)) { - step_mem->stage_coefs = (realtype*) calloc(step_mem->stages, - sizeof(realtype)); + step_mem->stage_coefs = (sunrealtype*) calloc(step_mem->stages, + sizeof(sunrealtype)); ark_mem->lrw += step_mem->stages; } } @@ -1372,7 +1372,7 @@ int arkStep_Init(void* arkode_mem, int init_type) when estimating the initial time step size, so we strive to store the intermediate parts so that they do not interfere with the other two modes. ----------------------------------------------------------------------------*/ -int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { ARKodeMem ark_mem; @@ -1381,7 +1381,7 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, sunbooleantype recomputeRHS; sunrealtype* cvals; N_Vector* Xvecs; - realtype stage_coefs = ONE; + sunrealtype stage_coefs = ONE; /* access ARKodeARKStepMem structure */ retval = arkStep_AccessStepMem(arkode_mem, "arkStep_FullRHS", @@ -1737,10 +1737,10 @@ int arkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr) { int retval, is, is_start, mode; - booleantype implicit_stage; - booleantype deduce_stage; - booleantype save_stages; - booleantype stiffly_accurate; + sunbooleantype implicit_stage; + sunbooleantype deduce_stage; + sunbooleantype save_stages; + sunbooleantype stiffly_accurate; ARKodeMem ark_mem; ARKodeARKStepMem step_mem; N_Vector zcor0; @@ -2699,7 +2699,7 @@ int arkStep_StageSetup(ARKodeMem ark_mem, sunbooleantype implicit) int retval, i, j, jmax, nvec; sunrealtype* cj; sunrealtype** Aij; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; /* access ARKodeARKStepMem structure */ @@ -2816,8 +2816,8 @@ int arkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsmPtr) sunrealtype* cj; sunrealtype* bj; sunrealtype* dj; - booleantype stiffly_accurate; - realtype* cvals; + sunbooleantype stiffly_accurate; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeARKStepMem step_mem; @@ -2984,8 +2984,8 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype *dsmPtr) /* local data */ int retval, j, nvec; N_Vector y, yerr; - booleantype stiffly_accurate; - realtype* cvals; + sunbooleantype stiffly_accurate; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeARKStepMem step_mem; @@ -3262,17 +3262,17 @@ int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, combination. ----------------------------------------------------------------------------*/ -void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype* stage_times, - realtype* stage_coefs, int jmax, int* nvec) +void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, sunrealtype* stage_times, + sunrealtype* stage_coefs, int jmax, int* nvec) { - realtype tau, taui; + sunrealtype tau, taui; int j, k; /* Shortcuts to step_mem data */ - realtype* vals = step_mem->cvals; + sunrealtype* vals = step_mem->cvals; N_Vector* vecs = step_mem->Xvecs; - realtype tshift = step_mem->tshift; - realtype tscale = step_mem->tscale; + sunrealtype tshift = step_mem->tshift; + sunrealtype tscale = step_mem->tscale; int nforcing = step_mem->nforcing; N_Vector* forcing = step_mem->forcing; diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index df90fb1582..783b2a82a9 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -156,8 +156,8 @@ typedef struct ARKodeARKStepMemRec { sunrealtype tscale; /* time normalization scaling */ N_Vector* forcing; /* array of forcing vectors */ int nforcing; /* number of forcing vectors */ - realtype* stage_times; /* workspace for applying forcing */ - realtype* stage_coefs; /* workspace for applying forcing */ + sunrealtype* stage_times; /* workspace for applying forcing */ + sunrealtype* stage_coefs; /* workspace for applying forcing */ } *ARKodeARKStepMem; @@ -205,10 +205,10 @@ int arkStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess); int arkStep_StageSetup(ARKodeMem ark_mem, sunbooleantype implicit); int arkStep_NlsInit(ARKodeMem ark_mem); int arkStep_Nls(ARKodeMem ark_mem, int nflag); -int arkStep_ComputeSolutions(ARKodeMem ark_mem, realtype *dsm); -int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, realtype *dsm); -void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, realtype* stage_times, - realtype* stage_coefs, int jmax, int *nvec); +int arkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype *dsm); +int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype *dsm); +void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, sunrealtype* stage_times, + sunrealtype* stage_coefs, int jmax, int *nvec); /* private functions passed to nonlinear solver */ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem); diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index df48551ac5..a9fe5a4d37 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -77,17 +77,17 @@ int ARKStepSetPostprocessStageFn(void *arkode_mem, return(arkSetPostprocessStageFn(arkode_mem, ProcessStage)); } int ARKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust) { return(arkSetAdaptivityAdjustment(arkode_mem, adjust)); } -int ARKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac) { +int ARKStepSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac) { return(arkSetCFLFraction(arkode_mem, cfl_frac)); } int ARKStepSetSafetyFactor(void *arkode_mem, sunrealtype safety) { return(arkSetSafetyFactor(arkode_mem, safety)); } -int ARKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth) { +int ARKStepSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth) { return(arkSetMaxGrowth(arkode_mem, mx_growth)); } int ARKStepSetMinReduction(void *arkode_mem, sunrealtype eta_min) { return(arkSetMinReduction(arkode_mem, eta_min)); } int ARKStepSetFixedStepBounds(void *arkode_mem, sunrealtype lb, sunrealtype ub) { return(arkSetFixedStepBounds(arkode_mem, lb, ub)); } -int ARKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) { +int ARKStepSetMaxFirstGrowth(void *arkode_mem, sunrealtype etamx1) { return(arkSetMaxFirstGrowth(arkode_mem, etamx1)); } int ARKStepSetMaxEFailGrowth(void *arkode_mem, sunrealtype etamxf) { return(arkSetMaxEFailGrowth(arkode_mem, etamxf)); } @@ -103,7 +103,7 @@ int ARKStepSetMaxConvFails(void *arkode_mem, int maxncf) { return(arkSetMaxConvFails(arkode_mem, maxncf)); } int ARKStepSetAdaptController(void *arkode_mem, SUNAdaptController C) { return(arkSetAdaptController(arkode_mem, C)); } -int ARKStepSetFixedStep(void *arkode_mem, realtype hfixed) { +int ARKStepSetFixedStep(void *arkode_mem, sunrealtype hfixed) { return(arkSetFixedStep(arkode_mem, hfixed)); } @@ -349,7 +349,7 @@ int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) specific SUNAdaptController object. ---------------------------------------------------------------*/ int ARKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) { + int pq, sunrealtype adapt_params[3]) { return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } /*--------------------------------------------------------------- @@ -363,7 +363,7 @@ int ARKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { ARKStepSetErrorBias: user should set this value directly in the SUNAdaptController object. ---------------------------------------------------------------*/ -int ARKStepSetErrorBias(void *arkode_mem, realtype bias) { +int ARKStepSetErrorBias(void *arkode_mem, sunrealtype bias) { return(arkSetErrorBias(arkode_mem, bias)); } diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 0081bbce9c..794507058e 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -630,7 +630,7 @@ int erkStep_Init(void* arkode_mem, int init_type) when estimating the initial time step size, so we strive to store the intermediate parts so that they do not interfere with the other two modes. ----------------------------------------------------------------------------*/ -int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int erkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { int retval; @@ -747,7 +747,7 @@ int erkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, int erkStep_TakeStep(void* arkode_mem, sunrealtype *dsmPtr, int *nflagPtr) { int retval, is, js, nvec, mode; - realtype* cvals; + sunrealtype* cvals; N_Vector* Xvecs; ARKodeMem ark_mem; ARKodeERKStepMem step_mem; diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 482776cbd8..f8aec53d5f 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -78,17 +78,17 @@ int ERKStepSetPostprocessStageFn(void *arkode_mem, return(arkSetPostprocessStageFn(arkode_mem, ProcessStage)); } int ERKStepSetAdaptivityAdjustment(void *arkode_mem, int adjust) { return(arkSetAdaptivityAdjustment(arkode_mem, adjust)); } -int ERKStepSetCFLFraction(void *arkode_mem, realtype cfl_frac) { +int ERKStepSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac) { return(arkSetCFLFraction(arkode_mem, cfl_frac)); } int ERKStepSetSafetyFactor(void *arkode_mem, sunrealtype safety) { return(arkSetSafetyFactor(arkode_mem, safety)); } -int ERKStepSetMaxGrowth(void *arkode_mem, realtype mx_growth) { +int ERKStepSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth) { return(arkSetMaxGrowth(arkode_mem, mx_growth)); } int ERKStepSetMinReduction(void *arkode_mem, sunrealtype eta_min) { return(arkSetMinReduction(arkode_mem, eta_min)); } int ERKStepSetFixedStepBounds(void *arkode_mem, sunrealtype lb, sunrealtype ub) { return(arkSetFixedStepBounds(arkode_mem, lb, ub)); } -int ERKStepSetMaxFirstGrowth(void *arkode_mem, realtype etamx1) { +int ERKStepSetMaxFirstGrowth(void *arkode_mem, sunrealtype etamx1) { return(arkSetMaxFirstGrowth(arkode_mem, etamx1)); } int ERKStepSetMaxEFailGrowth(void *arkode_mem, sunrealtype etamxf) { return(arkSetMaxEFailGrowth(arkode_mem, etamxf)); } @@ -239,7 +239,7 @@ int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) specific SUNAdaptController object. ---------------------------------------------------------------*/ int ERKStepSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) { + int pq, sunrealtype adapt_params[3]) { return(arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } /*--------------------------------------------------------------- @@ -253,7 +253,7 @@ int ERKStepSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data) { ERKStepSetErrorBias: user should set this value directly in the SUNAdaptController object. ---------------------------------------------------------------*/ -int ERKStepSetErrorBias(void *arkode_mem, realtype bias) { +int ERKStepSetErrorBias(void *arkode_mem, sunrealtype bias) { return(arkSetErrorBias(arkode_mem, bias)); } diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index a8a9aba54a..f5e5356629 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -333,7 +333,7 @@ struct ARKodeMemRec /* N_Vector storage */ N_Vector ewt; /* error weight vector */ N_Vector rwt; /* residual weight vector */ - booleantype rwt_is_ewt; /* SUNTRUE if rwt is a pointer to ewt */ + sunbooleantype rwt_is_ewt; /* SUNTRUE if rwt is a pointer to ewt */ N_Vector ycur; /* pointer to user-provided solution memory; used as evolving solution by the time stepper modules */ @@ -407,9 +407,9 @@ struct ARKodeMemRec sunbooleantype MallocDone; sunbooleantype initsetup; /* denotes a call to InitialSetup is needed */ int init_type; /* initialization type (see constants above) */ - booleantype firststage; /* denotes first stage in simulation */ - booleantype initialized; /* denotes arkInitialSetup has been done */ - booleantype call_fullrhs; /* denotes the full RHS fn will be called */ + sunbooleantype firststage; /* denotes first stage in simulation */ + sunbooleantype initialized; /* denotes arkInitialSetup has been done */ + sunbooleantype call_fullrhs; /* denotes the full RHS fn will be called */ /* Error handler function and error ouput file */ ARKErrHandlerFn ehfun; /* error messages are handled by ehfun */ @@ -1024,12 +1024,12 @@ int arkSetPostprocessStageFn(void *arkode_mem, int arkSetConstraints(void *arkode_mem, N_Vector constraints); int arkSetMaxNumConstrFails(void *arkode_mem, int maxfails); int arkSetAdaptivityAdjustment(void *arkode_mem, int adjust); -int arkSetCFLFraction(void *arkode_mem, realtype cfl_frac); -int arkSetSafetyFactor(void *arkode_mem, realtype safety); -int arkSetErrorBias(void *arkode_mem, realtype bias); -int arkSetMaxGrowth(void *arkode_mem, realtype mx_growth); -int arkSetMinReduction(void *arkode_mem, realtype eta_min); -int arkSetFixedStepBounds(void *arkode_mem, realtype lb, realtype ub); +int arkSetCFLFraction(void *arkode_mem, sunrealtype cfl_frac); +int arkSetSafetyFactor(void *arkode_mem, sunrealtype safety); +int arkSetErrorBias(void *arkode_mem, sunrealtype bias); +int arkSetMaxGrowth(void *arkode_mem, sunrealtype mx_growth); +int arkSetMinReduction(void *arkode_mem, sunrealtype eta_min); +int arkSetFixedStepBounds(void *arkode_mem, sunrealtype lb, sunrealtype ub); int arkSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, int pq, sunrealtype adapt_params[3]); int arkSetAdaptivityFn(void *arkode_mem, ARKAdaptFn hfun, void *h_data); diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 26d9e1a2c0..2a71f57d2e 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -871,11 +871,11 @@ int arkSetMaxNumConstrFails(void *arkode_mem, int maxfails) via the time-stepping module *SetController routines. ---------------------------------------------------------------*/ int arkSetAdaptivityMethod(void *arkode_mem, int imethod, int idefault, - int pq, realtype adapt_params[3]) + int pq, sunrealtype adapt_params[3]) { int retval; long int lenrw, leniw; - realtype k1, k2, k3; + sunrealtype k1, k2, k3; ARKodeMem ark_mem; SUNAdaptController C; if (arkode_mem==NULL) { diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index ca9dff2403..270b75cc6f 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1239,7 +1239,7 @@ int mriStep_Init(void* arkode_mem, int init_type) Presently ff(t,y) is always called with ARK_FULLRHS_OTHER mode. ----------------------------------------------------------------------------*/ -int mriStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { ARKodeMem ark_mem; diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 7c1185e16a..cf00192884 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -517,7 +517,7 @@ int sprkStep_f2(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, Since RHS values are not stored in SPRKStep we evaluate the RHS functions for all modes. ----------------------------------------------------------------------------*/ -int sprkStep_FullRHS(void* arkode_mem, realtype t, N_Vector y, N_Vector f, +int sprkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { int retval = 0; diff --git a/src/arkode/arkode_user_controller.c b/src/arkode/arkode_user_controller.c index ddf3cbd262..6a51613da1 100644 --- a/src/arkode/arkode_user_controller.c +++ b/src/arkode/arkode_user_controller.c @@ -97,8 +97,8 @@ SUNAdaptController ARKUserControl(SUNContext sunctx, void* arkode_mem, SUNAdaptController_Type SUNAdaptController_GetType_ARKUserControl(SUNAdaptController C) { return SUN_ADAPTCONTROLLER_H; } -int SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, realtype h, - int p, realtype dsm, realtype* hnew) +int SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, sunrealtype h, + int p, sunrealtype dsm, sunrealtype* hnew) { /* call user-provided function to compute new step */ sunrealtype ttmp = (dsm <= ONE) ? SC_ARKMEM(C)->tn + SC_ARKMEM(C)->h : SC_ARKMEM(C)->tn; @@ -137,7 +137,7 @@ int SUNAdaptController_Write_ARKUserControl(SUNAdaptController C, FILE *fptr) return SUNADAPTCONTROLLER_SUCCESS; } -int SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, realtype h, realtype dsm) +int SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, sunrealtype h, sunrealtype dsm) { SC_HPP(C) = SC_HP(C); SC_HP(C) = h; diff --git a/src/arkode/arkode_user_controller.h b/src/arkode/arkode_user_controller.h index 201e622b70..c89e91976f 100644 --- a/src/arkode/arkode_user_controller.h +++ b/src/arkode/arkode_user_controller.h @@ -32,10 +32,10 @@ extern "C" { * --------------------------------------------------- */ struct _ARKUserControlContent { - realtype hp; /* h from previous step */ - realtype hpp; /* h from 2 steps ago */ - realtype ep; /* error from previous step */ - realtype epp; /* error from 2 steps ago */ + sunrealtype hp; /* h from previous step */ + sunrealtype hpp; /* h from 2 steps ago */ + sunrealtype ep; /* error from previous step */ + sunrealtype epp; /* error from 2 steps ago */ ARKodeMem ark_mem; /* main ARKODE memory structure */ ARKAdaptFn hadapt; /* user-provided adaptivity fn */ void* hadapt_data; /* user-provided data pointer */ @@ -53,14 +53,14 @@ SUNAdaptController ARKUserControl(SUNContext sunctx, void* arkode_mem, SUNDIALS_EXPORT SUNAdaptController_Type SUNAdaptController_GetType_ARKUserControl(SUNAdaptController C); SUNDIALS_EXPORT -int SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, realtype h, - int p, realtype dsm, realtype* hnew); +int SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, sunrealtype h, + int p, sunrealtype dsm, sunrealtype* hnew); SUNDIALS_EXPORT int SUNAdaptController_Reset_ARKUserControl(SUNAdaptController C); SUNDIALS_EXPORT int SUNAdaptController_Write_ARKUserControl(SUNAdaptController C, FILE* fptr); SUNDIALS_EXPORT -int SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, realtype h, realtype dsm); +int SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, sunrealtype h, sunrealtype dsm); SUNDIALS_EXPORT int SUNAdaptController_Space_ARKUserControl(SUNAdaptController C, long int *lenrw, long int *leniw); diff --git a/src/sundials/sundials_cusolver.h b/src/sundials/sundials_cusolver.h index b1aee9b266..f61d67c1e8 100644 --- a/src/sundials/sundials_cusolver.h +++ b/src/sundials/sundials_cusolver.h @@ -44,7 +44,7 @@ extern "C" { * Utility functions * ---------------------------------------------------------------------------*/ -inline booleantype SUNDIALS_CUSOLVER_Assert(cusolverStatus_t status, const char *file, int line) +inline sunbooleantype SUNDIALS_CUSOLVER_Assert(cusolverStatus_t status, const char *file, int line) { if (status != CUSOLVER_STATUS_SUCCESS) { diff --git a/src/sundials/sundials_cusparse.h b/src/sundials/sundials_cusparse.h index 3f9c3ae493..0e514c3905 100644 --- a/src/sundials/sundials_cusparse.h +++ b/src/sundials/sundials_cusparse.h @@ -42,7 +42,7 @@ extern "C" { * Utility functions * ---------------------------------------------------------------------------*/ -inline booleantype SUNDIALS_CUSPARSE_Assert(cusparseStatus_t status, const char *file, int line) +inline sunbooleantype SUNDIALS_CUSPARSE_Assert(cusparseStatus_t status, const char *file, int line) { if (status != CUSPARSE_STATUS_SUCCESS) { diff --git a/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c index 2ed9147d9f..f2b2b221d7 100644 --- a/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c +++ b/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c @@ -280,14 +280,14 @@ SWIGEXPORT int _wrap_FSUNLinSolSolve_LapackDense(SUNLinearSolver farg1, SUNMatri SUNMatrix arg2 = (SUNMatrix) 0 ; N_Vector arg3 = (N_Vector) 0 ; N_Vector arg4 = (N_Vector) 0 ; - realtype arg5 ; + sunrealtype arg5 ; int result; arg1 = (SUNLinearSolver)(farg1); arg2 = (SUNMatrix)(farg2); arg3 = (N_Vector)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (realtype)(*farg5); + arg5 = (sunrealtype)(*farg5); result = (int)SUNLinSolSolve_LapackDense(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; From 2f3773b073872cb48abc5cb802473194f80f45a0 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:19:51 -0800 Subject: [PATCH 72/85] post-merge fix: change RCONST to SUN_RCONST --- src/arkode/arkode_adapt_impl.h | 10 +- src/arkode/arkode_arkstep.c | 2 +- src/arkode/arkode_arkstep_io.c | 132 +++++++++--------- src/arkode/arkode_erkstep_io.c | 10 +- src/arkode/arkode_io.c | 2 +- src/arkode/arkode_user_controller.c | 8 +- .../imexgus/sunadaptcontroller_imexgus.c | 18 +-- .../soderlind/sunadaptcontroller_soderlind.c | 74 +++++----- 8 files changed, 128 insertions(+), 128 deletions(-) diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index 3d3a1368d8..45bd882779 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -36,11 +36,11 @@ extern "C" { #define ARK_ADAPT_LIW 7 /* includes function/data pointers */ /* Time step controller default values */ -#define CFLFAC RCONST(0.5) -#define SAFETY RCONST(0.96) /* CVODE uses 1.0 */ -#define GROWTH RCONST(20.0) /* CVODE uses 10.0 */ -#define HFIXED_LB RCONST(1.0) /* CVODE uses 1.0 */ -#define HFIXED_UB RCONST(1.5) /* CVODE uses 1.5 */ +#define CFLFAC SUN_RCONST(0.5) +#define SAFETY SUN_RCONST(0.96) /* CVODE uses 1.0 */ +#define GROWTH SUN_RCONST(20.0) /* CVODE uses 10.0 */ +#define HFIXED_LB SUN_RCONST(1.0) /* CVODE uses 1.0 */ +#define HFIXED_UB SUN_RCONST(1.5) /* CVODE uses 1.5 */ #define ETAMX1 SUN_RCONST(10000.0) /* maximum step size change on first step */ #define ETAMXF SUN_RCONST(0.3) /* step size reduction factor on multiple error diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index a8b4f8de32..1789061ac9 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -3054,7 +3054,7 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype *dsmPtr) /* solve for y update (stored in y) */ retval = step_mem->msolve((void *) ark_mem, y, step_mem->nlscoef); if (retval < 0) { - *dsmPtr = RCONST(2.0); /* indicate too much error, step with smaller step */ + *dsmPtr = SUN_RCONST(2.0); /* indicate too much error, step with smaller step */ N_VScale(ONE, ark_mem->yn, y); /* place old solution into y */ return(CONV_FAIL); } diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index a9fe5a4d37..e7161adc08 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -524,12 +524,12 @@ int ARKStepSetOptimalParams(void *arkode_mem) "SUNAdaptController_PI allocation failure"); return(ARK_MEM_FAIL); } - (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.2)); - (void) SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, RCONST(0.8), - -RCONST(0.31)); - hadapt_mem->safety = RCONST(0.99); - hadapt_mem->growth = RCONST(25.0); - hadapt_mem->etamxf = RCONST(0.3); + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, SUN_RCONST(1.2)); + (void) SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, SUN_RCONST(0.8), + -SUN_RCONST(0.31)); + hadapt_mem->safety = SUN_RCONST(0.99); + hadapt_mem->growth = SUN_RCONST(25.0); + hadapt_mem->etamxf = SUN_RCONST(0.3); hadapt_mem->pq = PQ; /* implicit */ @@ -549,7 +549,7 @@ int ARKStepSetOptimalParams(void *arkode_mem) hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.001); + step_mem->nlscoef = SUN_RCONST(0.001); step_mem->maxcor = 5; step_mem->crdown = CRDOWN; step_mem->rdiv = RDIV; @@ -564,17 +564,17 @@ int ARKStepSetOptimalParams(void *arkode_mem) "SUNAdaptController_I allocation failure"); return(ARK_MEM_FAIL); } - (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.9)); - hadapt_mem->safety = RCONST(0.957); - hadapt_mem->growth = RCONST(17.6); - hadapt_mem->etamxf = RCONST(0.45); + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, SUN_RCONST(1.9)); + hadapt_mem->safety = SUN_RCONST(0.957); + hadapt_mem->growth = SUN_RCONST(17.6); + hadapt_mem->etamxf = SUN_RCONST(0.45); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.22); - step_mem->crdown = RCONST(0.17); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.19); + step_mem->nlscoef = SUN_RCONST(0.22); + step_mem->crdown = SUN_RCONST(0.17); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.19); step_mem->msbp = 60; break; case 4: @@ -585,19 +585,19 @@ int ARKStepSetOptimalParams(void *arkode_mem) "SUNAdaptController_PID allocation failure"); return(ARK_MEM_FAIL); } - (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.2)); - (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.535), - -RCONST(0.209), RCONST(0.148)); - hadapt_mem->safety = RCONST(0.988); - hadapt_mem->growth = RCONST(31.5); - hadapt_mem->etamxf = RCONST(0.33); + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, SUN_RCONST(1.2)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, SUN_RCONST(0.535), + -SUN_RCONST(0.209), SUN_RCONST(0.148)); + hadapt_mem->safety = SUN_RCONST(0.988); + hadapt_mem->growth = SUN_RCONST(31.5); + hadapt_mem->etamxf = SUN_RCONST(0.33); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.24); - step_mem->crdown = RCONST(0.26); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.16); + step_mem->nlscoef = SUN_RCONST(0.24); + step_mem->crdown = SUN_RCONST(0.26); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.16); step_mem->msbp = 31; break; case 5: @@ -608,19 +608,19 @@ int ARKStepSetOptimalParams(void *arkode_mem) "SUNAdaptController_PID allocation failure"); return(ARK_MEM_FAIL); } - (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(3.3)); - (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.56), - -RCONST(0.338), RCONST(0.14)); - hadapt_mem->safety = RCONST(0.937); - hadapt_mem->growth = RCONST(22.0); - hadapt_mem->etamxf = RCONST(0.44); + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, SUN_RCONST(3.3)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, SUN_RCONST(0.56), + -SUN_RCONST(0.338), SUN_RCONST(0.14)); + hadapt_mem->safety = SUN_RCONST(0.937); + hadapt_mem->growth = SUN_RCONST(22.0); + hadapt_mem->etamxf = SUN_RCONST(0.44); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.25); - step_mem->crdown = RCONST(0.4); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.32); + step_mem->nlscoef = SUN_RCONST(0.25); + step_mem->crdown = SUN_RCONST(0.4); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.32); step_mem->msbp = 31; break; } @@ -642,7 +642,7 @@ int ARKStepSetOptimalParams(void *arkode_mem) hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.001); + step_mem->nlscoef = SUN_RCONST(0.001); step_mem->maxcor = 5; step_mem->crdown = CRDOWN; step_mem->rdiv = RDIV; @@ -657,19 +657,19 @@ int ARKStepSetOptimalParams(void *arkode_mem) "SUNAdaptController_PID allocation failure"); return(ARK_MEM_FAIL); } - (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.42)); - (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.54), - -RCONST(0.36), RCONST(0.14)); - hadapt_mem->safety = RCONST(0.965); - hadapt_mem->growth = RCONST(28.7); - hadapt_mem->etamxf = RCONST(0.46); + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, SUN_RCONST(1.42)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, SUN_RCONST(0.54), + -SUN_RCONST(0.36), SUN_RCONST(0.14)); + hadapt_mem->safety = SUN_RCONST(0.965); + hadapt_mem->growth = SUN_RCONST(28.7); + hadapt_mem->etamxf = SUN_RCONST(0.46); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.22); - step_mem->crdown = RCONST(0.17); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.19); + step_mem->nlscoef = SUN_RCONST(0.22); + step_mem->crdown = SUN_RCONST(0.17); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.19); step_mem->msbp = 60; break; case 4: @@ -680,19 +680,19 @@ int ARKStepSetOptimalParams(void *arkode_mem) "SUNAdaptController_PID allocation failure"); return(ARK_MEM_FAIL); } - (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.35)); - (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, RCONST(0.543), - -RCONST(0.297), RCONST(0.14)); - hadapt_mem->safety = RCONST(0.97); - hadapt_mem->growth = RCONST(25.0); - hadapt_mem->etamxf = RCONST(0.47); + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, SUN_RCONST(1.35)); + (void) SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, SUN_RCONST(0.543), + -SUN_RCONST(0.297), SUN_RCONST(0.14)); + hadapt_mem->safety = SUN_RCONST(0.97); + hadapt_mem->growth = SUN_RCONST(25.0); + hadapt_mem->etamxf = SUN_RCONST(0.47); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.24); - step_mem->crdown = RCONST(0.26); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.16); + step_mem->nlscoef = SUN_RCONST(0.24); + step_mem->crdown = SUN_RCONST(0.26); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.16); step_mem->msbp = 31; break; case 5: @@ -703,19 +703,19 @@ int ARKStepSetOptimalParams(void *arkode_mem) "SUNAdaptController_PI allocation failure"); return(ARK_MEM_FAIL); } - (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, RCONST(1.15)); - (void) SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, RCONST(0.8), - -RCONST(0.35)); - hadapt_mem->safety = RCONST(0.993); - hadapt_mem->growth = RCONST(28.5); - hadapt_mem->etamxf = RCONST(0.3); + (void) SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, SUN_RCONST(1.15)); + (void) SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, SUN_RCONST(0.8), + -SUN_RCONST(0.35)); + hadapt_mem->safety = SUN_RCONST(0.993); + hadapt_mem->growth = SUN_RCONST(28.5); + hadapt_mem->etamxf = SUN_RCONST(0.3); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; - step_mem->nlscoef = RCONST(0.25); - step_mem->crdown = RCONST(0.4); - step_mem->rdiv = RCONST(2.3); - step_mem->dgmax = RCONST(0.32); + step_mem->nlscoef = SUN_RCONST(0.25); + step_mem->crdown = SUN_RCONST(0.4); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.32); step_mem->msbp = 31; break; } diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index f8aec53d5f..2d1b92d3a8 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -325,12 +325,12 @@ int ERKStepSetDefaults(void* arkode_mem) step_mem->p = 0; /* embedding order */ step_mem->stages = 0; /* no stages */ step_mem->B = NULL; /* no Butcher table */ - ark_mem->hadapt_mem->etamxf = RCONST(0.3); /* max change on error-failed step */ - ark_mem->hadapt_mem->safety = RCONST(0.99); /* step adaptivity safety factor */ - ark_mem->hadapt_mem->growth = RCONST(25.0); /* step adaptivity growth factor */ - (void) SUNAdaptController_SetErrorBias(ark_mem->hadapt_mem->hcontroller, RCONST(1.2)); + ark_mem->hadapt_mem->etamxf = SUN_RCONST(0.3); /* max change on error-failed step */ + ark_mem->hadapt_mem->safety = SUN_RCONST(0.99); /* step adaptivity safety factor */ + ark_mem->hadapt_mem->growth = SUN_RCONST(25.0); /* step adaptivity growth factor */ + (void) SUNAdaptController_SetErrorBias(ark_mem->hadapt_mem->hcontroller, SUN_RCONST(1.2)); (void) SUNAdaptController_SetParams_PI(ark_mem->hadapt_mem->hcontroller, - RCONST(0.8), -RCONST(0.31)); + SUN_RCONST(0.8), -SUN_RCONST(0.31)); return(ARK_SUCCESS); } diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 2a71f57d2e..36ee1b2891 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -815,7 +815,7 @@ int arkSetConstraints(void *arkode_mem, N_Vector constraints) /* Check the constraints vector */ temptest = N_VMaxNorm(constraints); - if ((temptest > RCONST(2.5)) || (temptest < HALF)) { + if ((temptest > SUN_RCONST(2.5)) || (temptest < HALF)) { arkProcessError(ark_mem, ARK_ILL_INPUT, "ARKODE", "arkSetConstraints", MSG_ARK_BAD_CONSTR); return(ARK_ILL_INPUT); diff --git a/src/arkode/arkode_user_controller.c b/src/arkode/arkode_user_controller.c index 6a51613da1..4e07574b00 100644 --- a/src/arkode/arkode_user_controller.c +++ b/src/arkode/arkode_user_controller.c @@ -112,10 +112,10 @@ int SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, sunreal int SUNAdaptController_Reset_ARKUserControl(SUNAdaptController C) { - SC_EP(C) = RCONST(1.0); - SC_EPP(C) = RCONST(1.0); - SC_HP(C) = RCONST(0.0); - SC_HPP(C) = RCONST(0.0); + SC_EP(C) = SUN_RCONST(1.0); + SC_EPP(C) = SUN_RCONST(1.0); + SC_HP(C) = SUN_RCONST(0.0); + SC_HPP(C) = SUN_RCONST(0.0); return SUNADAPTCONTROLLER_SUCCESS; } diff --git a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c index 9f9f1d39ab..c33adecb1d 100644 --- a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c +++ b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c @@ -39,12 +39,12 @@ * Default parameters * ------------------ */ -#define DEFAULT_K1E RCONST(0.367) -#define DEFAULT_K2E RCONST(0.268) -#define DEFAULT_K1I RCONST(0.95) -#define DEFAULT_K2I RCONST(0.95) -#define DEFAULT_BIAS RCONST(1.5) -#define TINY RCONST(1.0e-10) +#define DEFAULT_K1E SUN_RCONST(0.367) +#define DEFAULT_K2E SUN_RCONST(0.268) +#define DEFAULT_K1I SUN_RCONST(0.95) +#define DEFAULT_K2I SUN_RCONST(0.95) +#define DEFAULT_BIAS SUN_RCONST(1.5) +#define TINY SUN_RCONST(1.0e-10) /* ----------------------------------------------------------------- @@ -128,7 +128,7 @@ int SUNAdaptController_EstimateStep_ImExGus(SUNAdaptController C, sunrealtype h, const int ord = p + 1; /* set usable time-step adaptivity parameters -- first step */ - const sunrealtype k = -RCONST(1.0) / ord; + const sunrealtype k = -SUN_RCONST(1.0) / ord; const sunrealtype e = SUNMAX(SACIMEXGUS_BIAS(C) * dsm, TINY); /* set usable time-step adaptivity parameters -- subsequent steps */ @@ -159,7 +159,7 @@ int SUNAdaptController_EstimateStep_ImExGus(SUNAdaptController C, sunrealtype h, int SUNAdaptController_Reset_ImExGus(SUNAdaptController C) { - SACIMEXGUS_EP(C) = RCONST(1.0); + SACIMEXGUS_EP(C) = SUN_RCONST(1.0); SACIMEXGUS_FIRSTSTEP(C) = SUNTRUE; return SUNADAPTCONTROLLER_SUCCESS; } @@ -203,7 +203,7 @@ int SUNAdaptController_SetErrorBias_ImExGus(SUNAdaptController C, sunrealtype bi { if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } /* set allowed value, otherwise set default */ - if (bias <= RCONST(0.0)) { + if (bias <= SUN_RCONST(0.0)) { SACIMEXGUS_BIAS(C) = DEFAULT_BIAS; } else { SACIMEXGUS_BIAS(C) = bias; diff --git a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c index 4d16ac8f09..70a91eda01 100644 --- a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c +++ b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c @@ -42,23 +42,23 @@ * Default parameters * ------------------ */ -#define DEFAULT_K1 RCONST(1.25) /* H_{0}321 parameters */ -#define DEFAULT_K2 RCONST(0.5) -#define DEFAULT_K3 RCONST(-0.75) -#define DEFAULT_K4 RCONST(0.25) -#define DEFAULT_K5 RCONST(0.75) -#define DEFAULT_PID_K1 RCONST(0.58) /* PID parameters */ -#define DEFAULT_PID_K2 -RCONST(0.21) -#define DEFAULT_PID_K3 RCONST(0.1) -#define DEFAULT_PI_K1 RCONST(0.8) /* PI parameters */ -#define DEFAULT_PI_K2 -RCONST(0.31) -#define DEFAULT_I_K1 RCONST(1.0) /* I parameters */ -#define DEFAULT_EXPGUS_K1 RCONST(0.367) /* Explicit Gustafsson parameters */ -#define DEFAULT_EXPGUS_K2 RCONST(0.268) -#define DEFAULT_IMPGUS_K1 RCONST(0.98) /* Implicit Gustafsson parameters */ -#define DEFAULT_IMPGUS_K2 RCONST(0.95) -#define DEFAULT_BIAS RCONST(1.5) -#define TINY RCONST(1.0e-10) +#define DEFAULT_K1 SUN_RCONST(1.25) /* H_{0}321 parameters */ +#define DEFAULT_K2 SUN_RCONST(0.5) +#define DEFAULT_K3 SUN_RCONST(-0.75) +#define DEFAULT_K4 SUN_RCONST(0.25) +#define DEFAULT_K5 SUN_RCONST(0.75) +#define DEFAULT_PID_K1 SUN_RCONST(0.58) /* PID parameters */ +#define DEFAULT_PID_K2 -SUN_RCONST(0.21) +#define DEFAULT_PID_K3 SUN_RCONST(0.1) +#define DEFAULT_PI_K1 SUN_RCONST(0.8) /* PI parameters */ +#define DEFAULT_PI_K2 -SUN_RCONST(0.31) +#define DEFAULT_I_K1 SUN_RCONST(1.0) /* I parameters */ +#define DEFAULT_EXPGUS_K1 SUN_RCONST(0.367) /* Explicit Gustafsson parameters */ +#define DEFAULT_EXPGUS_K2 SUN_RCONST(0.268) +#define DEFAULT_IMPGUS_K1 SUN_RCONST(0.98) /* Implicit Gustafsson parameters */ +#define DEFAULT_IMPGUS_K2 SUN_RCONST(0.95) +#define DEFAULT_BIAS SUN_RCONST(1.5) +#define TINY SUN_RCONST(1.0e-10) /* ----------------------------------------------------------------- @@ -162,8 +162,8 @@ int SUNAdaptController_SetParams_PID(SUNAdaptController C, SODERLIND_K1(C) = k1; SODERLIND_K2(C) = k2; SODERLIND_K3(C) = k3; - SODERLIND_K4(C) = RCONST(0.0); - SODERLIND_K5(C) = RCONST(0.0); + SODERLIND_K4(C) = SUN_RCONST(0.0); + SODERLIND_K5(C) = SUN_RCONST(0.0); return SUNADAPTCONTROLLER_SUCCESS; } @@ -198,9 +198,9 @@ int SUNAdaptController_SetParams_PI(SUNAdaptController C, if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } SODERLIND_K1(C) = k1; SODERLIND_K2(C) = k2; - SODERLIND_K3(C) = RCONST(0.0); - SODERLIND_K4(C) = RCONST(0.0); - SODERLIND_K5(C) = RCONST(0.0); + SODERLIND_K3(C) = SUN_RCONST(0.0); + SODERLIND_K4(C) = SUN_RCONST(0.0); + SODERLIND_K5(C) = SUN_RCONST(0.0); return SUNADAPTCONTROLLER_SUCCESS; } @@ -231,10 +231,10 @@ int SUNAdaptController_SetParams_I(SUNAdaptController C, sunrealtype k1) { if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } SODERLIND_K1(C) = k1; - SODERLIND_K2(C) = RCONST(0.0); - SODERLIND_K3(C) = RCONST(0.0); - SODERLIND_K4(C) = RCONST(0.0); - SODERLIND_K5(C) = RCONST(0.0); + SODERLIND_K2(C) = SUN_RCONST(0.0); + SODERLIND_K3(C) = SUN_RCONST(0.0); + SODERLIND_K4(C) = SUN_RCONST(0.0); + SODERLIND_K5(C) = SUN_RCONST(0.0); return SUNADAPTCONTROLLER_SUCCESS; } @@ -269,9 +269,9 @@ int SUNAdaptController_SetParams_ExpGus(SUNAdaptController C, if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } SODERLIND_K1(C) = k1+k2; SODERLIND_K2(C) = -k2; - SODERLIND_K3(C) = RCONST(0.0); - SODERLIND_K4(C) = RCONST(0.0); - SODERLIND_K5(C) = RCONST(0.0); + SODERLIND_K3(C) = SUN_RCONST(0.0); + SODERLIND_K4(C) = SUN_RCONST(0.0); + SODERLIND_K5(C) = SUN_RCONST(0.0); return SUNADAPTCONTROLLER_SUCCESS; } @@ -306,9 +306,9 @@ int SUNAdaptController_SetParams_ImpGus(SUNAdaptController C, if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } SODERLIND_K1(C) = k1+k2; SODERLIND_K2(C) = -k2; - SODERLIND_K3(C) = RCONST(0.0); - SODERLIND_K4(C) = RCONST(1.0); - SODERLIND_K5(C) = RCONST(0.0); + SODERLIND_K3(C) = SUN_RCONST(0.0); + SODERLIND_K4(C) = SUN_RCONST(1.0); + SODERLIND_K5(C) = SUN_RCONST(0.0); return SUNADAPTCONTROLLER_SUCCESS; } @@ -358,10 +358,10 @@ int SUNAdaptController_EstimateStep_Soderlind(SUNAdaptController C, sunrealtype int SUNAdaptController_Reset_Soderlind(SUNAdaptController C) { if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } - SODERLIND_EP(C) = RCONST(1.0); - SODERLIND_EPP(C) = RCONST(1.0); - SODERLIND_HP(C) = RCONST(1.0); - SODERLIND_HPP(C) = RCONST(1.0); + SODERLIND_EP(C) = SUN_RCONST(1.0); + SODERLIND_EPP(C) = SUN_RCONST(1.0); + SODERLIND_HP(C) = SUN_RCONST(1.0); + SODERLIND_HPP(C) = SUN_RCONST(1.0); SODERLIND_FIRSTSTEPS(C) = 0; return SUNADAPTCONTROLLER_SUCCESS; } @@ -413,7 +413,7 @@ int SUNAdaptController_SetErrorBias_Soderlind(SUNAdaptController C, sunrealtype { if (C == NULL) { return SUNADAPTCONTROLLER_ILL_INPUT; } /* set allowed value, otherwise set default */ - if (bias <= RCONST(0.0)) { + if (bias <= SUN_RCONST(0.0)) { SODERLIND_BIAS(C) = DEFAULT_BIAS; } else { SODERLIND_BIAS(C) = bias; From 004191f154255a0799777a6d895dbb2cab7046ee Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:21:55 -0800 Subject: [PATCH 73/85] another spot where we need to supress warning of set but unused --- src/arkode/arkode_ls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index bb88e24be2..bd6749d401 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -2736,6 +2736,10 @@ int arkLsSolve(void* arkode_mem, N_Vector b, realtype tnow, "ls-stats", "bnorm = %"RSYM", resnorm = %"RSYM ", ls_iters = %i, prec_solves = %i", bnorm, resnorm, nli_inc, (int) (arkls_mem->nps - nps_inc)); +#else + /* Suppress warning about set but unused variables due to logging ifdef. */ + (void) nps_inc; + (void) resnorm; #endif /* Interpret solver return value */ From 765e947c0a9814d726ab07e796f6ac211799128a Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Fri, 10 Nov 2023 16:47:39 -0800 Subject: [PATCH 74/85] regen fortran --- .../test_fsunlinsol_lapackdense_mod.f90 | 2 +- src/arkode/fmod/farkode_mod.c | 12 ++++++++++ src/arkode/fmod/farkode_mod.f90 | 22 +++++++++++++++++++ .../fmod/fsunadaptcontroller_imexgus_mod.f90 | 4 ++-- .../fsunadaptcontroller_soderlind_mod.f90 | 4 ++-- .../fmod/fsundials_adaptcontroller_mod.f90 | 4 ++-- 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 index 797c77ced5..927a72f2b3 100644 --- a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 +++ b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 @@ -101,7 +101,7 @@ integer(C_INT) function unit_tests() result(fails) ! run tests fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSetup(LS, A, 0) - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 100*UNIT_ROUNDOFF, 0) + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, 100*SUN_UNIT_ROUNDOFF, 0) fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_DIRECT, 0) fails = fails + Test_FSUNLinSolLastFlag(LS, 0) diff --git a/src/arkode/fmod/farkode_mod.c b/src/arkode/fmod/farkode_mod.c index 94f8017cc5..3888d4dec2 100644 --- a/src/arkode/fmod/farkode_mod.c +++ b/src/arkode/fmod/farkode_mod.c @@ -718,6 +718,18 @@ SWIGEXPORT void _wrap_FARKodeButcherTable_Write(void *farg1, void *farg2) { } +SWIGEXPORT int _wrap_FARKodeButcherTable_IsStifflyAccurate(void *farg1) { + int fresult ; + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + int result; + + arg1 = (ARKodeButcherTable)(farg1); + result = (int)ARKodeButcherTable_IsStifflyAccurate(arg1); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeButcherTable_CheckOrder(void *farg1, int *farg2, int *farg3, void *farg4) { int fresult ; ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index f21ebf433b..c0f017e672 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -160,6 +160,7 @@ module farkode_mod public :: FARKodeButcherTable_Space public :: FARKodeButcherTable_Free public :: FARKodeButcherTable_Write + public :: FARKodeButcherTable_IsStifflyAccurate public :: FARKodeButcherTable_CheckOrder public :: FARKodeButcherTable_CheckARKOrder ! typedef enum ARKODE_DIRKTableID @@ -580,6 +581,14 @@ subroutine swigc_FARKodeButcherTable_Write(farg1, farg2) & type(C_PTR), value :: farg2 end subroutine +function swigc_FARKodeButcherTable_IsStifflyAccurate(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_IsStifflyAccurate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + function swigc_FARKodeButcherTable_CheckOrder(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FARKodeButcherTable_CheckOrder") & result(fresult) @@ -1267,6 +1276,19 @@ subroutine FARKodeButcherTable_Write(b, outfile) call swigc_FARKodeButcherTable_Write(farg1, farg2) end subroutine +function FARKodeButcherTable_IsStifflyAccurate(b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = b +fresult = swigc_FARKodeButcherTable_IsStifflyAccurate(farg1) +swig_result = fresult +end function + function FARKodeButcherTable_CheckOrder(b, q, p, outfile) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 index 11443858ac..bb6525471f 100644 --- a/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 +++ b/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 @@ -198,7 +198,7 @@ function FSUNAdaptController_EstimateStep_ImExGus(c, h, p, dsm, hnew) & real(C_DOUBLE), intent(in) :: h integer(C_INT), intent(in) :: p real(C_DOUBLE), intent(in) :: dsm -real(C_DOUBLE), target, intent(inout) :: hnew +real(C_DOUBLE), dimension(*), target, intent(inout) :: hnew integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 @@ -210,7 +210,7 @@ function FSUNAdaptController_EstimateStep_ImExGus(c, h, p, dsm, hnew) & farg2 = h farg3 = p farg4 = dsm -farg5 = c_loc(hnew) +farg5 = c_loc(hnew(1)) fresult = swigc_FSUNAdaptController_EstimateStep_ImExGus(farg1, farg2, farg3, farg4, farg5) swig_result = fresult end function diff --git a/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 index 720482cd6f..c186227418 100644 --- a/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 +++ b/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 @@ -302,7 +302,7 @@ function FSUNAdaptController_EstimateStep_Soderlind(c, h, p, dsm, hnew) & real(C_DOUBLE), intent(in) :: h integer(C_INT), intent(in) :: p real(C_DOUBLE), intent(in) :: dsm -real(C_DOUBLE), target, intent(inout) :: hnew +real(C_DOUBLE), dimension(*), target, intent(inout) :: hnew integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 @@ -314,7 +314,7 @@ function FSUNAdaptController_EstimateStep_Soderlind(c, h, p, dsm, hnew) & farg2 = h farg3 = p farg4 = dsm -farg5 = c_loc(hnew) +farg5 = c_loc(hnew(1)) fresult = swigc_FSUNAdaptController_EstimateStep_Soderlind(farg1, farg2, farg3, farg4, farg5) swig_result = fresult end function diff --git a/src/sundials/fmod/fsundials_adaptcontroller_mod.f90 b/src/sundials/fmod/fsundials_adaptcontroller_mod.f90 index c804548d50..0e59f3f6d3 100644 --- a/src/sundials/fmod/fsundials_adaptcontroller_mod.f90 +++ b/src/sundials/fmod/fsundials_adaptcontroller_mod.f90 @@ -196,7 +196,7 @@ function FSUNAdaptController_EstimateStep(c, h, p, dsm, hnew) & real(C_DOUBLE), intent(in) :: h integer(C_INT), intent(in) :: p real(C_DOUBLE), intent(in) :: dsm -real(C_DOUBLE), target, intent(inout) :: hnew +real(C_DOUBLE), dimension(*), target, intent(inout) :: hnew integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 @@ -208,7 +208,7 @@ function FSUNAdaptController_EstimateStep(c, h, p, dsm, hnew) & farg2 = h farg3 = p farg4 = dsm -farg5 = c_loc(hnew) +farg5 = c_loc(hnew(1)) fresult = swigc_FSUNAdaptController_EstimateStep(farg1, farg2, farg3, farg4, farg5) swig_result = fresult end function From b7468ef4dc58263e329e3234e6098949f1e2fa37 Mon Sep 17 00:00:00 2001 From: "David J. Gardner" Date: Tue, 14 Nov 2023 07:14:33 -0500 Subject: [PATCH 75/85] fix doc build --- doc/shared/sundials/Fortran.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index f654431e5c..ae90b760e0 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -184,9 +184,9 @@ equivalencies with the parameter direction in mind. +-------------------------+-------------------------------+-------------------------------------------+ |``long`` | in, inout, out, return | ``integer(c_long)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``sunbooleantype`` | in, inout, out, return | ``integer(c_int)`` | + |``sunbooleantype`` | in, inout, out, return | ``integer(c_int)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``sunrealtype`` | in, inout, out, return | ``real(c_double)`` | + |``sunrealtype`` | in, inout, out, return | ``real(c_double)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype`` | in, inout, out, return | ``integer(c_long)`` | +-------------------------+-------------------------------+-------------------------------------------+ @@ -202,15 +202,15 @@ equivalencies with the parameter direction in mind. +-------------------------+-------------------------------+-------------------------------------------+ |``long*`` | return | ``real(c_long), pointer, dimension(:)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``sunrealtype*`` | in, inout, out | ``real(c_double), dimension(*)`` | + |``sunrealtype*`` | in, inout, out | ``real(c_double), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``sunrealtype*`` | return | ``real(c_double), pointer, dimension(:)`` | + |``sunrealtype*`` | return | ``real(c_double), pointer, dimension(:)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype*`` | in, inout, out | ``real(c_long), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype*`` | return | ``real(c_long), pointer, dimension(:)`` | +-------------------------+-------------------------------+-------------------------------------------+ - |``sunrealtype[]`` | in, inout, out | ``real(c_double), dimension(*)`` | + |``sunrealtype[]`` | in, inout, out | ``real(c_double), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ |``sunindextype[]`` | in, inout, out | ``integer(c_long), dimension(*)`` | +-------------------------+-------------------------------+-------------------------------------------+ From 93132b1d4bc2c26dd7d5c54e5ac8cd9be7147ad9 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Tue, 14 Nov 2023 08:02:42 -0700 Subject: [PATCH 76/85] Update CHANGELOG.md Co-authored-by: David Gardner --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c47a670c..b78b6d4f4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ ## Changes to SUNDIALS in release 7.0.0 -The previously deprecated types `realtype` and `booleantype` were removed from `sundials_types.h`. -Users should use `sunrealtype` and `sunbooleantype` instead, but the old names for the types -can be used by including the header file `sundials_types_old.h`. +The previously deprecated types `realtype` and `booleantype` were removed from `sundials_types.h` +and replaced with `sunrealtype` and `sunbooleantype`. The deprecated names for these types +can be used by including the header file `sundials_types_deprecated.h` but will be fully removed in the +next major release. ## Changes to SUNDIALS in release X.X.X From b59256efc8281ed05aa3fabcee9fe89299eba5d8 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 14 Nov 2023 08:04:39 -0700 Subject: [PATCH 77/85] rename sundials_types_old --- .../{sundials_types_old.h => sundials_types_deprecated.h} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename include/sundials/{sundials_types_old.h => sundials_types_deprecated.h} (93%) diff --git a/include/sundials/sundials_types_old.h b/include/sundials/sundials_types_deprecated.h similarity index 93% rename from include/sundials/sundials_types_old.h rename to include/sundials/sundials_types_deprecated.h index 2b60006edc..88901f0cff 100644 --- a/include/sundials/sundials_types_old.h +++ b/include/sundials/sundials_types_deprecated.h @@ -14,8 +14,8 @@ * to only use the types defined in sundials_types.h . * -----------------------------------------------------------------*/ -#ifndef _SUNDIALS_TYPES_OLD_H -#define _SUNDIALS_TYPES_OLD_H +#ifndef _SUNDIALS_TYPES_DEPRECATED_H +#define _SUNDIALS_TYPES_DEPRECATED_H #include #include @@ -70,4 +70,4 @@ typedef long double realtype; } #endif -#endif /* _SUNDIALS_TYPES_OLD_H */ +#endif /* _SUNDIALS_TYPES_DEPRECATED_H */ From 50a90ed1a3c1bf228ba3905f947282ed0e195461 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 14 Nov 2023 08:08:05 -0700 Subject: [PATCH 78/85] update recent changes --- CHANGELOG.md | 5 +---- doc/arkode/guide/source/Introduction.rst | 6 ++++++ doc/cvode/guide/source/Introduction.rst | 6 ++++++ doc/cvodes/guide/source/Introduction.rst | 6 ++++++ doc/ida/guide/source/Introduction.rst | 6 ++++++ doc/idas/guide/source/Introduction.rst | 6 ++++++ doc/kinsol/guide/source/Introduction.rst | 6 ++++++ 7 files changed, 37 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b78b6d4f4b..0e33ad8f97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,12 @@ # SUNDIALS Changelog -## Changes to SUNDIALS in release 7.0.0 +## Changes to SUNDIALS in release X.X.X The previously deprecated types `realtype` and `booleantype` were removed from `sundials_types.h` and replaced with `sunrealtype` and `sunbooleantype`. The deprecated names for these types can be used by including the header file `sundials_types_deprecated.h` but will be fully removed in the next major release. - -## Changes to SUNDIALS in release X.X.X - Added the `SUNAdaptController` base class, ported ARKODE's internal implementations of time step controllers into implementations of this class, and updated ARKODE to use these objects instead of its own implementations. diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index b6442c8fd8..7250aa7c28 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -133,6 +133,12 @@ Changes from previous versions Changes in vX.X.X ----------------- +The previously deprecated types ``realtype`` and ``booleantype`` were removed +from ``sundials_types.h`` and replaced with ``sunrealtype`` and +`sunbooleantype`. The deprecated names for these types can be used by including +the header file ``sundials_types_deprecated.h`` but will be fully removed in the +next major release. + Added the :c:type:`SUNAdaptController` base class, ported ARKODE's internal implementations of time step controllers into implementations of this class, and updated ARKODE to use these objects instead of its own implementations. Added diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index daa94f9fee..2cca06e443 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -114,6 +114,12 @@ Changes from previous versions Changes in vX.X.X ----------------- +The previously deprecated types ``realtype`` and ``booleantype`` were removed +from ``sundials_types.h`` and replaced with ``sunrealtype`` and +`sunbooleantype`. The deprecated names for these types can be used by including +the header file ``sundials_types_deprecated.h`` but will be fully removed in the +next major release. + Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index be21b803d0..c5ef54a28f 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -114,6 +114,12 @@ Changes from previous versions Changes in vX.X.X ----------------- +The previously deprecated types ``realtype`` and ``booleantype`` were removed +from ``sundials_types.h`` and replaced with ``sunrealtype`` and +`sunbooleantype`. The deprecated names for these types can be used by including +the header file ``sundials_types_deprecated.h`` but will be fully removed in the +next major release. + Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 83a4da2ba8..fba1657e3e 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -75,6 +75,12 @@ Changes from previous versions Changes in vX.X.X ----------------- +The previously deprecated types ``realtype`` and ``booleantype`` were removed +from ``sundials_types.h`` and replaced with ``sunrealtype`` and +`sunbooleantype`. The deprecated names for these types can be used by including +the header file ``sundials_types_deprecated.h`` but will be fully removed in the +next major release. + Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index c9a7d91871..f500506fdf 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -89,6 +89,12 @@ Changes from previous versions Changes in vX.X.X ----------------- +The previously deprecated types ``realtype`` and ``booleantype`` were removed +from ``sundials_types.h`` and replaced with ``sunrealtype`` and +`sunbooleantype`. The deprecated names for these types can be used by including +the header file ``sundials_types_deprecated.h`` but will be fully removed in the +next major release. + Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 7ac3cd37c9..0bb466742b 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -91,6 +91,12 @@ Changes from previous versions Changes in vX.X.X ----------------- +The previously deprecated types ``realtype`` and ``booleantype`` were removed +from ``sundials_types.h`` and replaced with ``sunrealtype`` and +`sunbooleantype`. The deprecated names for these types can be used by including +the header file ``sundials_types_deprecated.h`` but will be fully removed in the +next major release. + Fixed the build system support for MAGMA when using a NVIDIA HPC SDK installation of CUDA and fixed the targets used for rocBLAS and rocSPARSE. From bcfc49ae0d68354a044f350f374a1ac06fd29ae5 Mon Sep 17 00:00:00 2001 From: "David J. Gardner" Date: Tue, 14 Nov 2023 10:06:52 -0500 Subject: [PATCH 79/85] fix tables --- .../developers/benchmarks/advection_reaction.rst | 14 +++++++------- .../source/developers/benchmarks/diffusion.rst | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/superbuild/source/developers/benchmarks/advection_reaction.rst b/doc/superbuild/source/developers/benchmarks/advection_reaction.rst index a5c4ce846d..046e08c88a 100644 --- a/doc/superbuild/source/developers/benchmarks/advection_reaction.rst +++ b/doc/superbuild/source/developers/benchmarks/advection_reaction.rst @@ -105,17 +105,17 @@ listed in :numref:`Table.3D_advection_reaction_options`. | ``--npxyz `` | Number of MPI tasks in each | 0 0 0 | | | direction (0 forces MPI to decide) | | +-------------------------------+------------------------------------+---------------+ - | ``--xmax `` | Maximum value of :math:`x`, | 1.0 | + | ``--xmax `` | Maximum value of :math:`x`, | 1.0 | | | :math:`y`, and :math:`z` in | | | | :math:`\textbf{x}_{\text{max}}` | | +-------------------------------+------------------------------------+---------------+ - | ``--A `` | Constant concentration of species | 1.0 | + | ``--A `` | Constant concentration of species | 1.0 | | | :math:`A` | | +-------------------------------+------------------------------------+---------------+ - | ``--B `` | Constant concentration of species | 3.5 | + | ``--B `` | Constant concentration of species | 3.5 | | | :math:`B` | | +-------------------------------+------------------------------------+---------------+ - | ``--c `` | Advection speed :math:`c` | 0.01 | + | ``--c `` | Advection speed :math:`c` | 0.01 | +-------------------------------+------------------------------------+---------------+ | ``--order `` | Integration method order | 3 | +-------------------------------+------------------------------------+---------------+ @@ -132,11 +132,11 @@ listed in :numref:`Table.3D_advection_reaction_options`. +-------------------------------+------------------------------------+---------------+ | ``--fused`` | Enabled fused operations | Off | +-------------------------------+------------------------------------+---------------+ - | ``--tf `` | Final integration time :math:`t_f` | 10.0 | + | ``--tf `` | Final integration time :math:`t_f` | 10.0 | +-------------------------------+------------------------------------+---------------+ - | ``--rtol `` | Relative tolerance | 1.0e-6 | + | ``--rtol `` | Relative tolerance | 1.0e-6 | +-------------------------------+------------------------------------+---------------+ - | ``--atol `` | Absolute tolerance | 1.0e-9 | + | ``--atol `` | Absolute tolerance | 1.0e-9 | +-------------------------------+------------------------------------+---------------+ diff --git a/doc/superbuild/source/developers/benchmarks/diffusion.rst b/doc/superbuild/source/developers/benchmarks/diffusion.rst index d4b324fa43..814ec3be82 100644 --- a/doc/superbuild/source/developers/benchmarks/diffusion.rst +++ b/doc/superbuild/source/developers/benchmarks/diffusion.rst @@ -109,19 +109,19 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. | ``--ny `` | Number of mesh points in the | 32 | | | y-direction | | +-------------------------------+--------------------------------------+---------------+ - | ``--xu `` | The domain upper bound in the | 1.0 | + | ``--xu `` | The domain upper bound in the | 1.0 | | | x-direction (:math:`x_\text{max}`) | | +-------------------------------+--------------------------------------+---------------+ - | ``--yu `` | The domain upper bound in the | 1.0 | + | ``--yu `` | The domain upper bound in the | 1.0 | | | y-direction :math:`y_\text{max}` | | +-------------------------------+--------------------------------------+---------------+ - | ``--kx `` | Diffusion coefficient in the | 1.0 | + | ``--kx `` | Diffusion coefficient in the | 1.0 | | | x-direction :math:`k_x` | | +-------------------------------+--------------------------------------+---------------+ - | ``--ky `` | Diffusion coefficient in the | 1.0 | + | ``--ky `` | Diffusion coefficient in the | 1.0 | | | y-direction :math:`k_y` | | +-------------------------------+--------------------------------------+---------------+ - | ``--tf `` | The final time :math:`t_f` | 1.0 | + | ``--tf `` | The final time :math:`t_f` | 1.0 | +-------------------------------+--------------------------------------+---------------+ | ``--noforcing`` | Disable the forcing term | Enabled | +-------------------------------+--------------------------------------+---------------+ @@ -135,9 +135,9 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. +-------------------------------+--------------------------------------+---------------+ | Common Integrator and Solver Options | +-------------------------------+--------------------------------------+---------------+ - | ``--rtol `` | Relative tolerance | 1e-5 | + | ``--rtol `` | Relative tolerance | 1e-5 | +-------------------------------+--------------------------------------+---------------+ - | ``--atol `` | Absolute tolerance | 1e-10 | + | ``--atol `` | Absolute tolerance | 1e-10 | +-------------------------------+--------------------------------------+---------------+ | ``--maxsteps `` | Max number of steps between outputs | 0 | | | (0 uses the integrator default) | | @@ -151,7 +151,7 @@ listed in :numref:`Benchmarks.Table.2D_diffusion_options`. +-------------------------------+--------------------------------------+---------------+ | ``--liniters `` | Number of linear iterations | 20 | +-------------------------------+--------------------------------------+---------------+ - | ``--epslin `` | Linear solve tolerance factor | 0 | + | ``--epslin `` | Linear solve tolerance factor | 0 | | | (0 uses the integrator default) | | +-------------------------------+--------------------------------------+---------------+ | ``--msbp `` | The linear solver setup frequency | 0 | From 28043eaa2dd16734e4310934473b9be123638c60 Mon Sep 17 00:00:00 2001 From: "David J. Gardner" Date: Tue, 14 Nov 2023 10:15:31 -0500 Subject: [PATCH 80/85] fix typo --- doc/arkode/guide/source/Introduction.rst | 2 +- doc/cvode/guide/source/Introduction.rst | 2 +- doc/cvodes/guide/source/Introduction.rst | 2 +- doc/ida/guide/source/Introduction.rst | 2 +- doc/idas/guide/source/Introduction.rst | 2 +- doc/kinsol/guide/source/Introduction.rst | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 7250aa7c28..2ef2b1c5c3 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -135,7 +135,7 @@ Changes in vX.X.X The previously deprecated types ``realtype`` and ``booleantype`` were removed from ``sundials_types.h`` and replaced with ``sunrealtype`` and -`sunbooleantype`. The deprecated names for these types can be used by including +``sunbooleantype``. The deprecated names for these types can be used by including the header file ``sundials_types_deprecated.h`` but will be fully removed in the next major release. diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 2cca06e443..ac240a5d2c 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -116,7 +116,7 @@ Changes in vX.X.X The previously deprecated types ``realtype`` and ``booleantype`` were removed from ``sundials_types.h`` and replaced with ``sunrealtype`` and -`sunbooleantype`. The deprecated names for these types can be used by including +``sunbooleantype``. The deprecated names for these types can be used by including the header file ``sundials_types_deprecated.h`` but will be fully removed in the next major release. diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index c5ef54a28f..6039efb33e 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -116,7 +116,7 @@ Changes in vX.X.X The previously deprecated types ``realtype`` and ``booleantype`` were removed from ``sundials_types.h`` and replaced with ``sunrealtype`` and -`sunbooleantype`. The deprecated names for these types can be used by including +``sunbooleantype``. The deprecated names for these types can be used by including the header file ``sundials_types_deprecated.h`` but will be fully removed in the next major release. diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index fba1657e3e..86d00e6885 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -77,7 +77,7 @@ Changes in vX.X.X The previously deprecated types ``realtype`` and ``booleantype`` were removed from ``sundials_types.h`` and replaced with ``sunrealtype`` and -`sunbooleantype`. The deprecated names for these types can be used by including +``sunbooleantype``. The deprecated names for these types can be used by including the header file ``sundials_types_deprecated.h`` but will be fully removed in the next major release. diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index f500506fdf..9c037a0fd5 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -91,7 +91,7 @@ Changes in vX.X.X The previously deprecated types ``realtype`` and ``booleantype`` were removed from ``sundials_types.h`` and replaced with ``sunrealtype`` and -`sunbooleantype`. The deprecated names for these types can be used by including +``sunbooleantype``. The deprecated names for these types can be used by including the header file ``sundials_types_deprecated.h`` but will be fully removed in the next major release. diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 0bb466742b..00974af502 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -93,7 +93,7 @@ Changes in vX.X.X The previously deprecated types ``realtype`` and ``booleantype`` were removed from ``sundials_types.h`` and replaced with ``sunrealtype`` and -`sunbooleantype`. The deprecated names for these types can be used by including +``sunbooleantype``. The deprecated names for these types can be used by including the header file ``sundials_types_deprecated.h`` but will be fully removed in the next major release. From edb4bb0a4e9b6109d0d08da16017edd0e4f767e2 Mon Sep 17 00:00:00 2001 From: "David J. Gardner" Date: Tue, 14 Nov 2023 10:30:32 -0500 Subject: [PATCH 81/85] install sundials_types_deprecated.h --- src/sundials/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index d782ef0103..13521d9798 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -46,6 +46,7 @@ set(sundials_HEADERS sundials_profiler.hpp sundials_logger.h sundials_types.h + sundials_types_deprecated.h sundials_version.h ) From 2b16b8cd4f91bb04068c6ac8f9189e9296881539 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Tue, 14 Nov 2023 08:45:06 -0700 Subject: [PATCH 82/85] Apply suggestions for READMEs Co-authored-by: Daniel R. Reynolds --- .../advection_reaction_3D/kokkos/README.md | 14 +++++++------- benchmarks/advection_reaction_3D/raja/README.md | 14 +++++++------- benchmarks/diffusion_2D/README.md | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/benchmarks/advection_reaction_3D/kokkos/README.md b/benchmarks/advection_reaction_3D/kokkos/README.md index 711b5ef201..3cf8fca124 100644 --- a/benchmarks/advection_reaction_3D/kokkos/README.md +++ b/benchmarks/advection_reaction_3D/kokkos/README.md @@ -60,19 +60,19 @@ listed below. | `--nout ` | Number of output times | 40 | | `--npts ` | Number of mesh points in each direction | 100 | | `--npxyz ` | Number of MPI tasks in each direction (0 forces MPI to decide) | 0 0 0 | -| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | -| `--A ` | Constant concentration of species `A` | 1.0 | -| `--B ` | Constant concentration of species `B` | 3.5 | -| `--c ` | Advection speed `c` | 0.01 | +| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | +| `--A ` | Constant concentration of species `A` | 1.0 | +| `--B ` | Constant concentration of species `B` | 3.5 | +| `--c ` | Advection speed `c` | 0.01 | | `--order ` | Integration method order | 3 | | `--method ` | Integrator to use: `ERK`, `ARK-DIRK`, `ARK-IMEX`, `CV-BDF`, `CV-ADAMS`, `IDA` | `ARK-DIRK` | | `--nls ` | Nonlinear Solver Method: `newton`, `tl-newton`, `fixedpoint`, `none` | `newton` | | `--fpaccel ` | Number of fixed point acceleration vectors | 3 | | `--nopre` | Disable preconditioning | False | | `--fused` | Enabled fused operations | Off | -| `--tf ` | Final integration time `t_f` | 10.0 | -| `--rtol ` | Relative tolerance | 1.0e-6 | -| `--atol ` | Absolute tolerance | 1.0e-9 | +| `--tf ` | Final integration time `t_f` | 10.0 | +| `--rtol ` | Relative tolerance | 1.0e-6 | +| `--atol ` | Absolute tolerance | 1.0e-9 | ## Building and Running diff --git a/benchmarks/advection_reaction_3D/raja/README.md b/benchmarks/advection_reaction_3D/raja/README.md index 612e4702fd..3f6ea80bb2 100644 --- a/benchmarks/advection_reaction_3D/raja/README.md +++ b/benchmarks/advection_reaction_3D/raja/README.md @@ -60,19 +60,19 @@ listed below. | `--nout ` | Number of output times | 40 | | `--npts ` | Number of mesh points in each direction | 100 | | `--npxyz ` | Number of MPI tasks in each direction (0 forces MPI to decide) | 0 0 0 | -| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | -| `--A ` | Constant concentration of species `A` | 1.0 | -| `--B ` | Constant concentration of species `B` | 3.5 | -| `--c ` | Advection speed `c` | 0.01 | +| `--xmax ` | Maximum value of `x`, `y`, and `z` in :math:`X_max` | 1.0 | +| `--A ` | Constant concentration of species `A` | 1.0 | +| `--B ` | Constant concentration of species `B` | 3.5 | +| `--c ` | Advection speed `c` | 0.01 | | `--order ` | Integration method order | 3 | | `--method ` | Integrator to use: `ERK`, `ARK-DIRK`, `ARK-IMEX`, `CV-BDF`, `CV-ADAMS`, `IDA` | `ARK-DIRK` | | `--nls ` | Nonlinear Solver Method: `newton`, `tl-newton`, `fixedpoint`, `none` | `newton` | | `--fpaccel ` | Number of fixed point acceleration vectors | 3 | | `--nopre` | Disable preconditioning | False | | `--fused` | Enabled fused operations | Off | -| `--tf ` | Final integration time `t_f` | 10.0 | -| `--rtol ` | Relative tolerance | 1.0e-6 | -| `--atol ` | Absolute tolerance | 1.0e-9 | +| `--tf ` | Final integration time `t_f` | 10.0 | +| `--rtol ` | Relative tolerance | 1.0e-6 | +| `--atol ` | Absolute tolerance | 1.0e-9 | ## Building and Running diff --git a/benchmarks/diffusion_2D/README.md b/benchmarks/diffusion_2D/README.md index 65863e8d2a..311bd839fb 100644 --- a/benchmarks/diffusion_2D/README.md +++ b/benchmarks/diffusion_2D/README.md @@ -56,23 +56,23 @@ listed below. | `--npy ` | Number of MPI tasks in the y-direction (0 forces MPI to decide) | 0 | | `--nx ` | Number of mesh points in the x-direction | 32 | | `--ny ` | Number of mesh points in the y-direction | 32 | -| `--xu ` | The domain upper bound in the x-direction $x_{\text{max}}$ | 1.0 | -| `--yu ` | The domain upper bound in the y-direction $y_{\text{max}}$ | 1.0 | -| `--kx ` | Diffusion coefficient in the x-direction $k_x$ | 1.0 | -| `--ky ` | Diffusion coefficient in the y-direction $k_y$ | 1.0 | -| `--tf ` | The final time `tf` | 1.0 | +| `--xu ` | The domain upper bound in the x-direction $x_{\text{max}}$ | 1.0 | +| `--yu ` | The domain upper bound in the y-direction $y_{\text{max}}$ | 1.0 | +| `--kx ` | Diffusion coefficient in the x-direction $k_x$ | 1.0 | +| `--ky ` | Diffusion coefficient in the y-direction $k_y$ | 1.0 | +| `--tf ` | The final time `tf` | 1.0 | | `--noforcing` | Disable the forcing term | Enabled | | Output Options | | | | `--output ` | Output level: `0` no output, `1` output progress and stats, `2` write solution to disk | 1 | | `--nout ` | Number of output times | 20 | | Common Integrator and Solver Options | | | -| `--rtol ` | Relative tolerance | 1e-5 | -| `--atol ` | Absolute tolerance | 1e-10 | +| `--rtol ` | Relative tolerance | 1e-5 | +| `--atol ` | Absolute tolerance | 1e-10 | | `--maxsteps ` | Max number of steps between outputs (0 uses the integrator default) | 0 | | `--onstep ` | Number of steps to run using `ONE_STEP` mode for debugging (0 uses `NORMAL` mode) | 0 | | `--ls ` | Linear solver: CG, GMRES, or SuperLU_DIST | cg | | `--liniters ` | Number of linear iterations | 20 | -| `--epslin ` | Linear solve tolerance factor (0 uses the integrator default) | 0 | +| `--epslin ` | Linear solve tolerance factor (0 uses the integrator default) | 0 | | `--msbp ` | The linear solver setup frequency (CVODE and ARKODE only, 0 uses the integrator default) | 0 | | Additional ARKODE Options | | | | `--order ` | Methods order | 3 | From a779c708536a2a4dc195c72ec3c2dd5a8573a8df Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Tue, 14 Nov 2023 08:48:15 -0700 Subject: [PATCH 83/85] Apply suggestions from code review Co-authored-by: Daniel R. Reynolds --- doc/shared/nvectors/NVector_CUDA.rst | 2 +- doc/shared/nvectors/NVector_HIP.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_API.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst | 4 ++-- doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/shared/nvectors/NVector_CUDA.rst b/doc/shared/nvectors/NVector_CUDA.rst index d9d4d656d1..d7aaf5fa92 100644 --- a/doc/shared/nvectors/NVector_CUDA.rst +++ b/doc/shared/nvectors/NVector_CUDA.rst @@ -28,7 +28,7 @@ is as follows: struct _N_VectorContent_Cuda { sunindextype length; - sunbooleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNCudaExecPolicy* stream_exec_policy; diff --git a/doc/shared/nvectors/NVector_HIP.rst b/doc/shared/nvectors/NVector_HIP.rst index dc33e930cc..d5cf941dc7 100644 --- a/doc/shared/nvectors/NVector_HIP.rst +++ b/doc/shared/nvectors/NVector_HIP.rst @@ -28,7 +28,7 @@ the HIP-clang compiler. The vector content layout is as follows: struct _N_VectorContent_Hip { sunindextype length; - sunbooleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNHipExecPolicy* stream_exec_policy; diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index 0ace53fb7b..200bbee338 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -626,7 +626,7 @@ structure is defined as int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, sunrealtype); int (*numiters)(SUNLinearSolver); - sunrealtype (*resnorm)(SUNLinearSolver); + sunrealtype (*resnorm)(SUNLinearSolver); sunindextype (*lastflag)(SUNLinearSolver); int (*space)(SUNLinearSolver, long int*, long int*); N_Vector (*resid)(SUNLinearSolver); diff --git a/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst b/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst index 2ae31b11d5..37efe8681b 100644 --- a/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst +++ b/doc/shared/sunlinsol/SUNLinSol_MagmaDense.rst @@ -109,7 +109,7 @@ The SUNLinearSolver_MagmaDense module defines the object *content* field of a struct _SUNLinearSolverContent_MagmaDense { int last_flag; - sunbooleantype async; + sunbooleantype async; sunindextype N; SUNMemory pivots; SUNMemory pivotsarr; diff --git a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst index d8083957bd..43c6e59307 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst @@ -141,9 +141,9 @@ The SUNLinSol_SuperLUDIST module defines the *content* field of a .. code-block:: c struct _SUNLinearSolverContent_SuperLUDIST { - sunbooleantype first_factorize; + sunbooleantype first_factorize; int last_flag; - sunrealtype berr; + sunrealtype berr; gridinfo_t *grid; xLUstruct_t *lu; superlu_dist_options_t *options; diff --git a/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst b/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst index ebc6c07a1f..2bafac815b 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SuperLUMT.rst @@ -133,7 +133,7 @@ The SUNLinSol_SuperLUMT module defines the *content* field of a sunindextype *perm_r, *perm_c; sunindextype N; int num_threads; - sunrealtype diag_pivot_thresh; + sunrealtype diag_pivot_thresh; int ordering; superlumt_options_t *options; }; diff --git a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst index cf4ee214b2..a9adfae9b6 100644 --- a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst +++ b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst @@ -143,7 +143,7 @@ The SUNLinSol_cuSolverSp_batchQR module defines the *content* field of a struct _SUNLinearSolverContent_cuSolverSp_batchQR { int last_flag; /* last return flag */ - sunbooleantype first_factorize; /* is this the first factorization? */ + sunbooleantype first_factorize; /* is this the first factorization? */ size_t internal_size; /* size of cusolver buffer for Q and R */ size_t workspace_size; /* size of cusolver memory for factorization */ cusolverSpHandle_t cusolver_handle; /* cuSolverSp context */ From 7baeafe36209bfcc7238da73b30f8839ccc06846 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Tue, 14 Nov 2023 08:48:48 -0700 Subject: [PATCH 84/85] Update doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst Co-authored-by: Daniel R. Reynolds --- doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst b/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst index 65a1f210f4..eec2b9d2a8 100644 --- a/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst +++ b/doc/shared/sunmatrix/SUNMatrix_SLUNRloc.rst @@ -29,7 +29,7 @@ structure: .. code-block:: c struct _SUNMatrixContent_SLUNRloc { - sunbooleantype own_data; + sunbooleantype own_data; gridinfo_t *grid; sunindextype *row_to_proc; pdgsmv_comm_t *gsmv_comm; From 4e891f7b731bd5bd83f28fa5e12abe0ac3a59060 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Tue, 14 Nov 2023 08:48:57 -0700 Subject: [PATCH 85/85] Update doc/shared/nvectors/NVector_SYCL.rst Co-authored-by: Daniel R. Reynolds --- doc/shared/nvectors/NVector_SYCL.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/shared/nvectors/NVector_SYCL.rst b/doc/shared/nvectors/NVector_SYCL.rst index a087b35392..7f6036f925 100644 --- a/doc/shared/nvectors/NVector_SYCL.rst +++ b/doc/shared/nvectors/NVector_SYCL.rst @@ -30,7 +30,7 @@ The vector content layout is as follows: struct _N_VectorContent_Sycl { sunindextype length; - sunbooleantype own_helper; + sunbooleantype own_helper; SUNMemory host_data; SUNMemory device_data; SUNSyclExecPolicy* stream_exec_policy;