From 92cad719e5d9671a373c7fdc04810d47f4c6c88e Mon Sep 17 00:00:00 2001 From: Andy Nonaka Date: Thu, 22 Aug 2024 10:43:47 -0700 Subject: [PATCH] namelist --- exec/reactDiff/GNUmakefile | 14 +++++++++++--- src_reactDiff/Make.package | 3 +++ src_reactDiff/reactDiff_functions.H | 16 ++++++++++++++++ src_reactDiff/reactDiff_functions.cpp | 22 ++++++++++++++++++++++ src_reactDiff/reactDiff_namespace.H | 4 ++++ 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 src_reactDiff/Make.package create mode 100644 src_reactDiff/reactDiff_functions.H create mode 100644 src_reactDiff/reactDiff_functions.cpp create mode 100644 src_reactDiff/reactDiff_namespace.H diff --git a/exec/reactDiff/GNUmakefile b/exec/reactDiff/GNUmakefile index 16102b88..24812ca7 100644 --- a/exec/reactDiff/GNUmakefile +++ b/exec/reactDiff/GNUmakefile @@ -9,6 +9,7 @@ USE_CUDA = FALSE COMP = gnu DIM = 2 MAX_SPEC = 8 +MAX_REAC = 5 TINY_PROFILE = FALSE @@ -19,9 +20,13 @@ include $(AMREX_HOME)/Tools/GNUMake/Make.defs #VPATH_LOCATIONS += . #INCLUDE_LOCATIONS += . -#include ../../src_reactDiff/Make.package -#VPATH_LOCATIONS += ../../src_reactDiff/ -#INCLUDE_LOCATIONS += ../../src_reactDiff/ +include ../../src_reactDiff/Make.package +VPATH_LOCATIONS += ../../src_reactDiff/ +INCLUDE_LOCATIONS += ../../src_reactDiff/ + +include ../../src_chemistry/Make.package +VPATH_LOCATIONS += ../../src_chemistry/ +INCLUDE_LOCATIONS += ../../src_chemistry/ include ../../src_analysis/Make.package VPATH_LOCATIONS += ../../src_analysis/ @@ -54,3 +59,6 @@ endif MAXSPECIES := $(strip $(MAX_SPEC)) DEFINES += -DMAX_SPECIES=$(MAXSPECIES) +MAXREACTION := $(strip $(MAX_REAC)) +DEFINES += -DMAX_REACTION=$(MAXREACTION) + diff --git a/src_reactDiff/Make.package b/src_reactDiff/Make.package new file mode 100644 index 00000000..a2258eb7 --- /dev/null +++ b/src_reactDiff/Make.package @@ -0,0 +1,3 @@ +CEXE_sources += reactDiff_functions.cpp +CEXE_headers += reactDiff_functions.H +CEXE_headers += reactDiff_namespace.H diff --git a/src_reactDiff/reactDiff_functions.H b/src_reactDiff/reactDiff_functions.H new file mode 100644 index 00000000..1c63e846 --- /dev/null +++ b/src_reactDiff/reactDiff_functions.H @@ -0,0 +1,16 @@ +#ifndef _reactdiff_functions_H_ +#define _reactdiff_functions_H_ + +#include + +#include "common_functions.H" +#include "common_namespace.H" +#include "reactDiff_namespace.H" + +using namespace reactDiff; +using namespace amrex; +using namespace common; + +void InitializeReactDiffNamespace(); + +#endif diff --git a/src_reactDiff/reactDiff_functions.cpp b/src_reactDiff/reactDiff_functions.cpp new file mode 100644 index 00000000..20f91086 --- /dev/null +++ b/src_reactDiff/reactDiff_functions.cpp @@ -0,0 +1,22 @@ +#include "reactDiff_functions.H" +#include "AMReX_ParmParse.H" + +// only used for split schemes (temporal_integrator>=0) +// 0=explicit trapezoidal predictor/corrector +// 1=Crank-Nicolson semi-implicit +// 2=explicit midpoint +// 3=multinomial diffusion +// 4=forward Euler + +AMREX_GPU_MANAGED int reactDiff::diffusion_type; + +void InitializeReactDiffNamespace() +{ + // extract inputs parameters + ParmParse pp; + + diffusion_type = 0; + pp.query("diffusion_type",diffusion_type); + + return; +} diff --git a/src_reactDiff/reactDiff_namespace.H b/src_reactDiff/reactDiff_namespace.H new file mode 100644 index 00000000..83fa5db0 --- /dev/null +++ b/src_reactDiff/reactDiff_namespace.H @@ -0,0 +1,4 @@ +namespace reactDiff { + + extern AMREX_GPU_MANAGED int diffusion_type; +}