Skip to content

Commit

Permalink
Merge branch 'development' into constexprallthethings
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jan 6, 2024
2 parents aa8277c + 8e7784c commit 2b9c8d7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 43 deletions.
5 changes: 2 additions & 3 deletions Docs/preprocess_files.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This script strips out preprocessor directives from C++ headers and Fortran files
This script strips out preprocessor directives from C++ headers
and saves the results in source/preprocessed_files
"""

Expand All @@ -17,8 +17,7 @@ def strip_directives(filename, filepath, outpath):
Read in file, remove all preprocessor directives and output.
This is also going to switch square brackets initializing arrays to
parentheses and remove the new-line characters in these so sphinx
fortran is happy.
parentheses and remove the new-line characters
"""

with open(os.path.join(filepath, filename)) as infile:
Expand Down
20 changes: 0 additions & 20 deletions Docs/source/build_system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ Most of these are parameters from AMReX.
``HYPRE_DIR`` or ``HYPRE_OMP_DIR``.


Fortran Support
^^^^^^^^^^^^^^^

Radiation currently needs Fortran support. All of the other solvers
and problem set ups do not require Fortran. Fortran support in AMReX
is enabled / disabled via:

* ``BL_NO_FORT``: if set to ``TRUE``, then no AMReX Fortran source will be built.
This cannot currently be used for the radiation solver.


Parallelization and GPUs
^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -273,15 +262,6 @@ This is the current build system process.

* These headers are output into ``tmp_build_dir/castro_sources/``.

* (if Fortran support is enabled) The Fortran dependencies file is created

* This creates the ``f90.depends`` file in the ``tmp_build_dir``

* The script ``amrex/Tools/F_scripts/dep.py`` is used

* The hook for this is in ``amrex/Tools/GNUMake/Make.rules`` in the
``$(depEXETempDir)/f90.depends`` target

* The C/C++ dependencies file is created

* This creates the individual ``.d`` files in ``tmp_build_dir``, one for each source file
Expand Down
6 changes: 3 additions & 3 deletions Docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ Debugging
I get more information?*

The best thing to do is to recompile the code with ``TEST=TRUE``
set in the ``GNUmakefile``. This will have AMReX catch the
signals raised in both C++ and Fortran functions. Behind the
set in the ``GNUmakefile``. This will have AMReX catch the
signals raised in C++ functions. Behind the
scenes, this defines the ``AMREX_TESTING`` preprocessor flag, which
will initialize memory allocated in fabs or multifabs to
signaling NaNs (sNaN), and use the ``BLBackTrace::handler()``
function to handle various signals raised in both C++ and Fortran
function to handle various signals raised in C++
functions. This is a Linux/UNIX capability. This gives us a chance
to print out backtrace information. The signals include seg fault,
floating point exceptions (NaNs, divided by zero and overflow), and
Expand Down
10 changes: 2 additions & 8 deletions Docs/source/rp_intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The Castro parameters that control the behavior of the code and
physics modules are listed in ``_cpp_parameters`` and take the form of::

# comment describing the parameter
name type default need in Fortran? ifdef
name type default ifdef

Here,

Expand All @@ -45,13 +45,7 @@ Here,

* `default` is the default value of the parameter.

The next columns are optional, but you need to fill in all of the
information up to and including any of the optional columns you need
(e.g., if you are going to provide "need in Fortran?" and "ifdef").

* `need in Fortran?` is ``y`` if the runtime parameter should be
made available in Fortran (through ``meth_params_module``).
Note: this option is deprecated.
The next column is optional:

* `ifdef` provides the name of a preprocessor name that should
wrap this parameter definition—it will only be compiled in if that
Expand Down
8 changes: 1 addition & 7 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@ EOS_HOME ?= $(MICROPHYSICS_HOME)/EOS
NETWORK_HOME ?= $(MICROPHYSICS_HOME)/networks
CONDUCTIVITY_HOME ?= $(MICROPHYSICS_HOME)/conductivity

# only radiation builds need Fortran
ifeq ($(USE_RAD), TRUE)
BL_NO_FORT := FALSE
else
BL_NO_FORT := TRUE
endif

BL_NO_FORT := TRUE

# AMReX is a git submodule of Castro. By default
# we assume it is in the external/ directory.
Expand Down
30 changes: 28 additions & 2 deletions Exec/science/massive_star/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifdef NSE_TABLE
#include <nse_table_type.H>
#include <nse_table_check.H>
#include <nse_eos.H>
#endif

AMREX_GPU_HOST_DEVICE AMREX_INLINE
Expand Down Expand Up @@ -128,8 +129,33 @@ void problem_initialize_state_data (int i, int j, int k,
}

if (problem::interpolate_pres == 1) {
eos(eos_input_rp, eos_state);
state(i,j,k,UTEMP) = eos_state.T;

// we need to get T from P, rho, but consistent with NSE (if
// we are in NSE)
if (nse_check) {
// this will also change the composition, since the new T
// alters the NSE
nse_T_abar_from_p(eos_state.rho, eos_state.p, eos_state.aux[AuxZero::iye],
eos_state.T, eos_state.aux[AuxZero::iabar]);
state(i,j,k,UTEMP) = eos_state.T;
state(i,j,k,UFX+AuxZero::iabar) = eos_state.aux[AuxZero::iabar];

// now call the EOS with the new T and abar to get e
eos(eos_input_rt, eos_state);

// finally, get the updated B/A
nse_table_t nse_state;
nse_state.T = state(i,j,k,UTEMP);
nse_state.rho = state(i,j,k,URHO);
nse_state.Ye = state(i,j,k,UFX+AuxZero::iye);
nse_interp(nse_state);

state(i,j,k,UFX+AuxZero::ibea) = nse_state.bea;

} else {
eos(eos_input_rp, eos_state);
state(i,j,k,UTEMP) = eos_state.T;
}
} else {
eos(eos_input_rt, eos_state);
}
Expand Down

0 comments on commit 2b9c8d7

Please sign in to comment.