Skip to content

Commit

Permalink
Merge branch 'development' of ssh://github.com/AMReX-Codes/AMReX into…
Browse files Browse the repository at this point in the history
… development
  • Loading branch information
zingale committed May 16, 2018
2 parents 77b71f4 + df739c5 commit fc00f44
Show file tree
Hide file tree
Showing 21 changed files with 1,019 additions and 132 deletions.
100 changes: 51 additions & 49 deletions Docs/sphinx_documentation/source/BuildingAMReX.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,55 +254,57 @@ below.

.. table:: AMReX build options

+---------------------------+-------------------------------------------------+-------------+-----------------+
| Option Name | Description | Default | Possible values |
+===========================+=================================================+=============+=================+
| DEBUG | Build AMReX in debug mode | OFF | ONE, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| DIM | Dimension of AMReX build | 3 | 2, 3 |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_DP | Build with double-precision reals | ON | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_PIC | Build Position Independent Code | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_MPI | Build with MPI support | ON | ON OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_OMP | Build with OpenMP support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_FORTRAN_INTERFACES | Build Fortran API | ON | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_LINEAR_SOLVERS | Build AMReX linear solvers | ON | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_FBASELIB | Build (deprecated) Fortran kernel | ON | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_AMRDATA | Build data services | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_PARTICLES | Build particle classes | OFF | ON OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_DP_PARTICLES | Use double-precision reals in particle classes | ON | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_BASE_PROFILE | Build with basic profiling support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_TINY_PROFILE | Build with tiny profiling support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_TRACE_PROFILE | Build with trace-profiling support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_COMM_PROFILE | Build with comm-profiling support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_MEM_PROFILE | Build with memory-profiling support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_PROFPARSER | Build with profile parser support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_BACKTRACE | Build with backtrace support | OFF | ON, OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_FPE | Build with Floating Point Exceptions checks | OFF | ON,OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_ASSERTIONS | Build with assertions turned on | OFF | ON,OFF |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| CMAKE_Fortran_FLAGS | User-defined Fortran flags | | user-defined |
+---------------------------+-------------------------------------------------+-------------+-----------------+
| CMAKE_CXX_FLAGS | User-defined C++ flags | | user-defined |
+---------------------------+-------------------------------------------------+-------------+-----------------+
+------------------------------+-------------------------------------------------+-------------+-----------------+
| Option Name | Description | Default | Possible values |
+==============================+=================================================+=============+=================+
| DEBUG | Build AMReX in debug mode | OFF | ONE, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| DIM | Dimension of AMReX build | 3 | 2, 3 |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_DP | Build with double-precision reals | ON | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_PIC | Build Position Independent Code | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_MPI | Build with MPI support | ON | ON OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_OMP | Build with OpenMP support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_FORTRAN_INTERFACES | Build Fortran API | ON | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_LINEAR_SOLVERS | Build AMReX linear solvers | ON | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_LINEAR_SOLVERS_LEGACY | Build AMReX linear solvers (legacy components) | ON | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_FBASELIB | Build (deprecated) Fortran kernel | ON | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_AMRDATA | Build data services | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_PARTICLES | Build particle classes | OFF | ON OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_DP_PARTICLES | Use double-precision reals in particle classes | ON | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_BASE_PROFILE | Build with basic profiling support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_TINY_PROFILE | Build with tiny profiling support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_TRACE_PROFILE | Build with trace-profiling support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_COMM_PROFILE | Build with comm-profiling support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_MEM_PROFILE | Build with memory-profiling support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_PROFPARSER | Build with profile parser support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_BACKTRACE | Build with backtrace support | OFF | ON, OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_FPE | Build with Floating Point Exceptions checks | OFF | ON,OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| ENABLE_ASSERTIONS | Build with assertions turned on | OFF | ON,OFF |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| CMAKE_Fortran_FLAGS | User-defined Fortran flags | | user-defined |
+------------------------------+-------------------------------------------------+-------------+-----------------+
| CMAKE_CXX_FLAGS | User-defined C++ flags | | user-defined |
+------------------------------+-------------------------------------------------+-------------+-----------------+

.. raw:: latex

Expand Down
20 changes: 1 addition & 19 deletions Docs/sphinx_documentation/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ AMReX Introduction

AMReX is a publicly available software framework designed for building
massively parallel block-structured adaptive mesh refinement (AMR)
applications. AMReX is freely available at
https://github.com/AMReX-Codes/amrex.
applications.

Key features of AMReX include:

Expand All @@ -29,20 +28,3 @@ Key features of AMReX include:

AMReX is developed at LBNL, NREL, and ANL as part of the Block-Structured AMR
Co-Design Center in DOE's Exascale Computing Project.

All of AMReX's development is done in the github repository under the
development branch; anyone can see the latest updates. Changes are merged into
the master branch at the beginning of each month.

We are always happy to have users contribute to the AMReX source code. To
contribute, issue a pull request against the development branch (details at
https://help.github.com/articles/creating-a-pull-request/). Any level of
changes are welcomed: documentation, bug fixes, new test problems, new solvers,
...

To obtain help, simply post an issue in the AMReX GitHub webpage at
https://github.com/AMReX-Codes/amrex

Besides this documentation, there is documentation generated by Doxygen at
https://amrex-codes.github.io/amrex/doxygen. Documentation on migration from
BoxLib is available at Docs/Migration.
20 changes: 13 additions & 7 deletions Docs/sphinx_documentation/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Welcome to AMReX's documentation

AMReX is a software framework library containing all the functionality to write
massively parallel, block-structured adaptive mesh refinement (AMR)
applications. AMReX is freely available at
https://github.com/AMReX-Codes/amrex.
applications. AMReX is freely available `on Github
<https://github.com/AMReX-Codes/amrex>`_.

AMReX is developed at LBNL, NREL, and ANL as part of the Block-Structured AMR
Co-Design Center in DOE's Exascale Computing Project.
Expand All @@ -19,13 +19,19 @@ development branch; anyone can see the latest updates. Changes are merged into
the master branch at the beginning of each month.

We are always happy to have users contribute to the AMReX source code. To
contribute, issue a pull request against the development branch (details at
https://help.github.com/articles/creating-a-pull-request/). Any level of
contribute, issue a pull request against the development branch (details `here
<https://help.github.com/articles/creating-a-pull-request/>`_). Any level of
changes are welcomed: documentation, bug fixes, new test problems, new solvers,
...
etc...

To obtain help, simply post an issue in the AMReX GitHub webpage at
https://github.com/AMReX-Codes/amrex
To obtain help, simply post an `issue
<https://github.com/AMReX-Codes/amrex/issues>`_
on the AMReX GitHub webpage.

Besides this documentation, there is API documentation generated by `Doxygen
<https://amrex-codes.github.io/amrex/doxygen>`_.

Documentation on migration from BoxLib is available in the AMReX repository at Docs/Migration.

.. toctree::
:maxdepth: 1
Expand Down
2 changes: 1 addition & 1 deletion Src/Base/AMReX_MultiFabUtil.H
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace amrex
MultiFab ToMultiFab (const iMultiFab& imf);

//! Extract a slice from the given cell-centered MultiFab at coordinate "coord" along direction "dir".
std::unique_ptr<MultiFab> get_slice_data(int dir, Real coord, const MultiFab& cc, const Geometry& geom, int fstart, int ncomp);
std::unique_ptr<MultiFab> get_slice_data(int dir, Real coord, const MultiFab& cc, const Geometry& geom, int fstart, int ncomp, bool interpolate=false);

// Is it safe to have these two MultiFabs in the same MFiter?
// Ture means safe; false means maybe.
Expand Down
29 changes: 24 additions & 5 deletions Src/Base/AMReX_MultiFabUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,16 @@ namespace amrex
return mf;
}

std::unique_ptr<MultiFab> get_slice_data(int dir, Real coord, const MultiFab& cc, const Geometry& geom, int start_comp, int ncomp) {
std::unique_ptr<MultiFab> get_slice_data(int dir, Real coord, const MultiFab& cc, const Geometry& geom, int start_comp, int ncomp, bool interpolate) {

BL_PROFILE("amrex::get_slice_data");

if (interpolate) {
AMREX_ASSERT(cc.nGrow() >= 1);
}

const Real* dx = geom.CellSize();
const Real* plo = geom.ProbLo();

Vector<int> slice_to_full_ba_map;
std::unique_ptr<MultiFab> slice = allocateSlice(dir, cc, ncomp, geom, coord, slice_to_full_ba_map);
Expand All @@ -567,10 +574,22 @@ namespace amrex
int full_gid = slice_to_full_ba_map[slice_gid];

const Box& tile_box = mfi.tilebox();
amrex_fill_slice(BL_TO_FORTRAN_BOX(tile_box),
BL_TO_FORTRAN_ANYD(cc[full_gid]),
BL_TO_FORTRAN_ANYD((*slice)[slice_gid]),
&start_comp, &nf, &ncomp);

if (interpolate)
{
amrex_fill_slice_interp(BL_TO_FORTRAN_BOX(tile_box),
BL_TO_FORTRAN_ANYD(cc[full_gid]),
BL_TO_FORTRAN_ANYD((*slice)[slice_gid]),
&start_comp, &nf, &ncomp, &dir,
&coord, AMREX_ZFILL(plo), AMREX_ZFILL(dx));
}
else
{
amrex_fill_slice(BL_TO_FORTRAN_BOX(tile_box),
BL_TO_FORTRAN_ANYD(cc[full_gid]),
BL_TO_FORTRAN_ANYD((*slice)[slice_gid]),
&start_comp, &nf, &ncomp);
}
}

return slice;
Expand Down
7 changes: 7 additions & 0 deletions Src/Base/AMReX_MultiFabUtil_F.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ extern "C"
amrex_real* slice_data, const int* slo, const int* shi,
const int* fstart, const int* nfull, const int* ncomp);

void amrex_fill_slice_interp(const int* lo, const int* hi,
const amrex_real* full_data, const int* flo, const int* fhi,
amrex_real* slice_data, const int* slo, const int* shi,
const int* fstart, const int* nfull, const int* ncomp,
const int* dir, const amrex_real* coord, const amrex_real* plo,
const amrex_real* dx);

#ifdef __cplusplus
}
#endif
Expand Down
50 changes: 49 additions & 1 deletion Src/Base/AMReX_MultiFabUtil_nd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ subroutine amrex_fill_slice(tlo, thi, &
integer , intent(in) :: flo(3), fhi(3)
integer , intent(in) :: slo(3), shi(3)
integer , intent(in) :: tlo(3), thi(3)
real(amrex_real), intent(inout) :: full_data(flo(1):fhi(1),flo(2):fhi(2),flo(3):fhi(3), nfull)
real(amrex_real), intent(inout) :: full_data(flo(1):fhi(1),flo(2):fhi(2),flo(3):fhi(3), nfull)
real(amrex_real), intent(inout) :: slice_data(slo(1):shi(1),slo(2):shi(2),slo(3):shi(3), ncomp)

integer n, i, j, k
Expand All @@ -56,5 +56,53 @@ subroutine amrex_fill_slice(tlo, thi, &
end do

end subroutine amrex_fill_slice

subroutine amrex_fill_slice_interp(tlo, thi, &
full_data, flo, fhi, &
slice_data, slo, shi, &
fstart, nfull, ncomp, &
dir, coord, plo, dx) &
bind(C, name="amrex_fill_slice_interp")

use amrex_fort_module, only : amrex_real

integer , intent(in) :: ncomp, fstart, nfull
integer , intent(in) :: flo(3), fhi(3)
integer , intent(in) :: slo(3), shi(3)
integer , intent(in) :: tlo(3), thi(3)
real(amrex_real), intent(inout) :: full_data(flo(1):fhi(1),flo(2):fhi(2),flo(3):fhi(3), nfull)
real(amrex_real), intent(inout) :: slice_data(slo(1):shi(1),slo(2):shi(2),slo(3):shi(3), ncomp)
integer , intent(in) :: dir
real(amrex_real), intent(in) :: coord
real(amrex_real), intent(in) :: plo(3), dx(3)

integer n, i, j, k, hi, lo
real(amrex_real) distance, weight
integer offset(3)

offset = 0

distance = (coord - plo(dir)) / dx(dir) + 0.5d0
distance = distance - floor(distance)
weight = abs(0.5d0 - distance)

if (distance .lt. 0.5d0) then
offset(dir) = -1
else
offset(dir) = 1
end if

do n = 1, ncomp
do k = tlo(3), thi(3)
do j = tlo(2), thi(2)
do i = tlo(1), thi(1)
slice_data(i, j, k, n) = (1.d0 - weight)*full_data(i, j, k, fstart+n) + &
weight*full_data(i+offset(1), j+offset(2), k+offset(3), fstart+n)
end do
end do
end do
end do

end subroutine amrex_fill_slice_interp

end module amrex_multifabutil_nd_module
Loading

0 comments on commit fc00f44

Please sign in to comment.