Skip to content

Commit

Permalink
Remove filter files that will now live in PelePhysics (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 authored Dec 1, 2023
1 parent c4e6b4b commit e83cc3d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 719 deletions.
10 changes: 4 additions & 6 deletions CMake/BuildPeleCExe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function(build_pelec_exe pelec_exe_name pelec_lib_name)
add_executable(${pelec_exe_name} "")

if(CLANG_TIDY_EXE)
set_target_properties(${pelec_exe_name} PROPERTIES CXX_CLANG_TIDY
set_target_properties(${pelec_exe_name} PROPERTIES CXX_CLANG_TIDY
"${CLANG_TIDY_EXE};--config-file=${CMAKE_SOURCE_DIR}/.clang-tidy")
endif()

Expand All @@ -15,7 +15,7 @@ function(build_pelec_exe pelec_exe_name pelec_lib_name)
prob.H
prob.cpp
)

#PeleC include directories
target_include_directories(${pelec_exe_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${pelec_exe_name} PRIVATE ${SRC_DIR})
Expand Down Expand Up @@ -83,8 +83,6 @@ function(build_pelec_exe pelec_exe_name pelec_lib_name)
${SRC_DIR}/EB.cpp
${SRC_DIR}/EBStencilTypes.H
${SRC_DIR}/External.cpp
${SRC_DIR}/Filter.H
${SRC_DIR}/Filter.cpp
${SRC_DIR}/Forcing.cpp
${SRC_DIR}/GradUtil.H
${SRC_DIR}/Hydro.H
Expand Down Expand Up @@ -158,10 +156,10 @@ function(build_pelec_exe pelec_exe_name pelec_lib_name)
set_target_properties(${pelec_exe_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_compile_options(${pelec_exe_name} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xptxas --disable-optimizer-constants>)
endif()

target_link_libraries(${pelec_exe_name} PRIVATE ${pelec_lib_name} AMReX::amrex)

#Define what we want to be installed during a make install
#Define what we want to be installed during a make install
install(TARGETS ${pelec_exe_name}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
Expand Down
20 changes: 13 additions & 7 deletions CMake/BuildPeleCLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(build_pelec_lib pelec_lib_name)
endif()

include(SetPeleCCompileFlags)

target_sources(${pelec_lib_name}
PRIVATE
${PELE_PHYSICS_SRC_DIR}/Utility/TurbInflow/turbinflow.cpp
Expand All @@ -34,14 +34,20 @@ function(build_pelec_lib pelec_lib_name)
${PELE_PHYSICS_SRC_DIR}/Utility/Diagnostics/DiagPDF.H
${PELE_PHYSICS_SRC_DIR}/Utility/Diagnostics/DiagPDF.cpp)
target_include_directories(${pelec_lib_name} PUBLIC ${PELE_PHYSICS_SRC_DIR}/Utility/Diagnostics)

target_sources(${pelec_lib_name}
PRIVATE
${PELE_PHYSICS_SRC_DIR}/Utility/PltFileManager/PltFileManager.cpp
${PELE_PHYSICS_SRC_DIR}/Utility/PltFileManager/PltFileManager.H
${PELE_PHYSICS_SRC_DIR}/Utility/PltFileManager/PltFileManagerBCFill.H)
target_include_directories(${pelec_lib_name} PUBLIC ${PELE_PHYSICS_SRC_DIR}/Utility/PltFileManager)


target_sources(${pelec_lib_name}
PRIVATE
${PELE_PHYSICS_SRC_DIR}/Utility/Filter/Filter.cpp
${PELE_PHYSICS_SRC_DIR}/Utility/Filter/Filter.H)
target_include_directories(${pelec_lib_name} PUBLIC ${PELE_PHYSICS_SRC_DIR}/Utility/Filter)

target_sources(${pelec_lib_name} PRIVATE ${AMREX_SUNDIALS_DIR}/AMReX_Sundials.H
${AMREX_SUNDIALS_DIR}/AMReX_Sundials_Core.cpp
${AMREX_SUNDIALS_DIR}/AMReX_Sundials_Core.H
Expand Down Expand Up @@ -123,21 +129,21 @@ function(build_pelec_lib pelec_lib_name)
include(AMReXBuildInfo)
generate_buildinfo(${pelec_lib_name} ${CMAKE_SOURCE_DIR})
target_include_directories(${pelec_lib_name} SYSTEM PUBLIC ${AMREX_SUBMOD_LOCATION}/Tools/C_scripts)

target_link_libraries(${pelec_lib_name} PUBLIC sundials_arkode sundials_cvode)

if(PELEC_ENABLE_CUDA)
target_link_libraries(${pelec_lib_name} PUBLIC sundials_nveccuda sundials_sunlinsolcusolversp sundials_sunmatrixcusparse)
elseif(PELEC_ENABLE_HIP)
target_link_libraries(${pelec_lib_name} PUBLIC sundials_nvechip)
elseif(PELEC_ENABLE_SYCL)
target_link_libraries(${pelec_lib_name} PUBLIC sundials_nvecsycl)
endif()

if(PELEC_ENABLE_MPI)
target_link_libraries(${pelec_lib_name} PUBLIC $<$<BOOL:${MPI_CXX_FOUND}>:MPI::MPI_CXX>)
endif()

#Link to amrex libraries
target_link_libraries(${pelec_lib_name} PUBLIC AMReX::amrex)

Expand Down
43 changes: 5 additions & 38 deletions Docs/sphinx/LES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.. role:: cpp(code)
:language: c++

.. _LES:

LES and Hybrid LES/DNS Support
Expand Down Expand Up @@ -89,22 +89,10 @@ should option should be turned on in the input file:
``pelec.use_explicit_filter = 1``. The user specifies the filter-grid
ratio using ``pelec.les_filter_fgr = NUM``, where ``NUM`` is the
filter-grid ratio desired, e.g. ``pelec.les_filter_fgr = 2``. The user
also specifies a filter type through ``pelec.les_filter_type = NUM``:

* ``les_filter_type = 0``: no filtering
* ``les_filter_type = 1``: standard box filter
* ``les_filter_type = 2``: standard Gaussian filter

We have also implemented a set of filters defined in Sagaut & Grohens (1999) Int. J. Num. Meth. Fluids:

* ``les_filter_type = 3``: 3 point box filter approximation (Eq. 26)
* ``les_filter_type = 4``: 5 point box filter approximation (Eq. 27)
* ``les_filter_type = 5``: 3 point box filter optimized approximation (Table 1)
* ``les_filter_type = 6``: 5 point box filter optimized approximation (Table 1)
* ``les_filter_type = 7``: 3 point Gaussian filter approximation
* ``les_filter_type = 8``: 5 point Gaussian filter approximation (Eq. 29)
* ``les_filter_type = 9``: 3 point Gaussian filter optimized approximation (Table 1)
* ``les_filter_type = 10``: 5 point Gaussian filter optimized approximation (Table 1)
also specifies a filter type through ``pelec.les_filter_type = NUM``.
Explicit filtering utilizes the Filter utility from PelePhysics, and
the set of available filter types may be found in the
`PelePhysics documentation <https://amrex-combustion.github.io/PelePhysics/Utility.html#filter>`_.

An example input file section for a Gaussian filter with a filter-grid
ration of 2 would be:
Expand All @@ -114,24 +102,3 @@ ration of 2 would be:
pelec.use_explicit_filter=1
pelec.les_filter_type=2
pelec.les_filter_fgr=2


Developing
##########

The weights for these filters are set in ``Filter.cpp``. To add a
filter type, one needs to add an enum to the ``filter_types`` and
define a corresponding ``set_NAME_weights`` function to be called at
initialization.

The application of a filter can be done on a Fab or MultiFab. The loop nesting
ordering was chosen to be performant on existing HPC architectures and
discussed in PeleC milestone reports. An example call to the filtering operation is

::

les_filter = Filter(les_filter_type, les_filter_fgr);
...
les_filter.apply_filter(bxtmp, flux[i], filtered_flux[i], Density, NUM_STATE);

The user must ensure that the correct number of grow cells is present in the Fab or MultiFab.
3 changes: 3 additions & 0 deletions Exec/Make.PeleC
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Blocs += $(PELE_PHYSICS_HOME)/Utility/PltFileManager
Bpack += $(PELE_PHYSICS_HOME)/Utility/Diagnostics/Make.package
Blocs += $(PELE_PHYSICS_HOME)/Utility/Diagnostics

Bpack += $(PELE_PHYSICS_HOME)/Utility/Filter/Make.package
Blocs += $(PELE_PHYSICS_HOME)/Utility/Filter

all: $(executable)
ifneq ($(KEEP_BUILDINFO_CPP),TRUE)
$(SILENT) $(RM) AMReX_buildInfo.cpp
Expand Down
2 changes: 1 addition & 1 deletion Source/Constants.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace constants {
AMREX_GPU_HOST_DEVICE constexpr amrex::Real
PI()
{
return 3.14159265358979323846264338327950288;
return amrex::Math::pi<amrex::Real>();
}
AMREX_GPU_HOST_DEVICE constexpr amrex::Real
smallu()
Expand Down
170 changes: 0 additions & 170 deletions Source/Filter.H

This file was deleted.

Loading

0 comments on commit e83cc3d

Please sign in to comment.