Commit ca509746 authored by gsell's avatar gsell
Browse files

main CMakeList.txt: conflict resolved

parents 6273668f 3834e6ee
cmake_minimum_required (VERSION 3.0.2)
cmake_minimum_required (VERSION 3.1)
project (OPAL)
set (OPAL_VERSION_MAJOR 1)
SET (OPAL_VERSION_MINOR 9.0)
......@@ -55,7 +55,12 @@ if ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
endif ()
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
<<<<<<< HEAD
add_compile_options (-Werror -Wsign-compare -Wunused-variable -Warray-bounds -DIPPL_RESTRICT_BUG)
=======
add_compile_options (-Werror -Wsign-compare -Wunused-variable -Warray-bounds)
add_definitions(-DIPPL_RESTRICT_BUG)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
if (ENABLE_OpenMP)
add_compile_options (-fopenmp)
endif ()
......@@ -66,6 +71,7 @@ elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
endif ()
# Warning flags, -Wno-unused-local-typedefs is needed for boost versions below 1.59
add_compile_options (-Wno-unused-local-typedefs -Werror=unused-variable)
if (ENABLE_OpenMP)
add_compile_options (-fopenmp)
endif ()
......@@ -117,28 +123,63 @@ option (ENABLE_DKS "Enable DKS" OFF)
if (ENABLE_DKS)
find_package (dKS 1.1.1 REQUIRED HINTS $ENV{DKS_PREFIX} $ENV{DKS_DIR} $ENV{DKS})
set (DKS_VERSION_OPAL \"${DKS_VERSION}\")
<<<<<<< HEAD
message ("Found DKS version: ${DKS_VERSION}")
message ("Found DKS library: ${DKS_LIBRARY}")
message ("Found DKS include dir: ${DKS_INCLUDE_DIR}")
add_compile_options (-DDKS_MPI)
=======
MESSAGE ("Found DKS version: ${DKS_VERSION}")
MESSAGE ("Found DKS library: ${DKS_LIBRARY}")
MESSAGE ("Found DKS include dir: ${DKS_INCLUDE_DIR}")
add_definitions(-DDKS_MPI)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
### OpenCL compiler flags ###
#add_compile_options (-lOpenCL -pthread -DDKS_OPENCL)
### CUDA compiler flags ###
<<<<<<< HEAD
add_compile_options(-DDKS_CUDA)
### if any accelerator enabled set flag to use DKS ###
add_compile_options (-DIPPL_DKS -DIPPL_DKS_CUDA -DOPAL_DKS)
endif ()
=======
add_definitions(-DDKS_CUDA)
### if any accelerator enabled set flag to use DKS ###
add_definitions(-DIPPL_DKS -DIPPL_DKS_CUDA -DOPAL_DKS)
ENDIF (ENABLE_DKS)
### END DKS part ###
# Handle options
OPTION (ENABLE_AMR "Enable AMReX based AMR solver" OFF)
OPTION (ENABLE_AMR_MG_SOLVER "Enable AMR MG solver" OFF)
OPTION (ENABLE_SAAMG_SOLVER "Enable iteartive SA-AMG-PCG self field solver" OFF)
OPTION (DBG_SCALARFIELD "Enable dump of scalar field rho_m" OFF)
OPTION (DBG_STENCIL "Dump stencil of iterative solver in matlab format" OFF)
OPTION (NO_FIELD_ASSIGN_OPTIMIZATION "Disable compiler optimization of IPPL field assignment" OFF)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
<<<<<<< HEAD
# Handle options
option (BUILD_OPAL_UNIT_TESTS "Unit tests" OFF)
if (BUILD_OPAL_UNIT_TESTS)
find_package (GTest REQUIRED HINT $ENV{GTEST_PREFIX})
add_compile_options (-DWITH_UNIT_TESTS)
endif ()
=======
IF (BUILD_OPAL_UNIT_TESTS)
FIND_PACKAGE (GTest REQUIRED)
ADD_DEFINITIONS(-DWITH_UNIT_TESTS)
ENDIF (BUILD_OPAL_UNIT_TESTS)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
OPTION (ENABLE_AMR "Enable AMReX based AMR solver" OFF)
IF (ENABLE_AMR)
......@@ -155,11 +196,26 @@ IF (ENABLE_AMR)
echo_amrex_config_options()
add_definitions(${AMREX_DEFINES})
add_definitions(-DENABLE_AMR)
<<<<<<< HEAD
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_AMR")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-maybe-uninitialized")
ENDIF ()
=======
add_compile_options (-Wno-unused-variable -Wno-unused-but-set-variable -Wno-maybe-uninitialized)
ENDIF (ENABLE_AMR)
# remove digits from hostname: edison03 -> edison
STRING(REGEX MATCH "[^0-9]*" HOSTNAME_BASE "${HOSTNAME}")
# In case of Edison and Cori the find_package(Trilinos) gives the wrong
# Trilinos_TPL_LIBRARIES, instead of cray-tpsl/16.07.1 it uses
# cray-tpsl/16.06.1 libraries -> Linker error.
# We can avoid this issue by not going into the if-statement
IF (ENABLE_SAAMG_SOLVER OR ENABLE_AMR_MG_SOLVER)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
OPTION (ENABLE_AMR_MG_SOLVER "Enable AMR MG solver" OFF)
OPTION (ENABLE_SAAMG_SOLVER "Enable iteartive SA-AMG-PCG self field solver" OFF)
......@@ -197,22 +253,37 @@ endif ()
OPTION (DBG_SCALARFIELD "Enable dump of scalar field rho_m" OFF)
IF (DBG_SCALARFIELD)
MESSAGE ("\nWrite scalar rho_m field is enabled ")
<<<<<<< HEAD
SET (CMAKE_CXX_FLAGS "-DDBG_SCALARFIELD ${CMAKE_CXX_FLAGS}")
ENDIF ()
=======
ADD_DEFINITIONS(-DDBG_SCALARFIELD)
ENDIF (DBG_SCALARFIELD)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
OPTION (DBG_STENCIL "Dump stencil of iterative solver in matlab format" OFF)
IF (DBG_STENCIL)
MESSAGE ("\nWrite stencil is enabled ")
<<<<<<< HEAD
SET (CMAKE_CXX_FLAGS "-DDBG_STENCIL ${CMAKE_CXX_FLAGS}")
ENDIF ()
=======
ADD_DEFINITIONS(-DDBG_STENCIL)
ENDIF (DBG_STENCIL)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
OPTION (NO_FIELD_ASSIGN_OPTIMIZATION "Disable compiler optimization of IPPL field assignment" OFF)
IF (NO_FIELD_ASSIGN_OPTIMIZATION)
MESSAGE ("\nCompiler will not try to optimize field assignment")
<<<<<<< HEAD
SET (CMAKE_CXX_FLAGS
"-DdontOPTIMIZE_FIELD_ASSIGNMENT ${CMAKE_CXX_FLAGS}"
)
ENDIF ()
=======
ADD_DEFINITIONS(-DdontOPTIMIZE_FIELD_ASSIGNMENT)
ENDIF (NO_FIELD_ASSIGN_OPTIMIZATION)
>>>>>>> 3834e6eef6d61f1c54c3582b66db9e5e060f5178
INCLUDE(FindGit)
IF(GIT_FOUND)
......
#
# Find GSL includes and library
#
# FindGSL() shipped with CMake is somehow broken in newer versions (>= 3.9,
# maybe also 3.7 and 3.8). It works only if GSL_ROOT_DIR is set. Hints do
# not work.
#
# :FIXME: For the time being we use our own version.
#
# GSL_INCLUDE_DIR - where to find ippl.h
# GSL_LIBRARY - GSL library to link against.
# GSL_CBLAS_LIBRARY - GSL CBlas library to link against
# GSL_FOUND - do not attempt to use if "no" or undefined.
FIND_PATH (GSL_INCLUDE_DIR gsl/gsl_fft.h
HINTS $ENV{GSL_INCLUDE_PATH} $ENV{GSL_INCLUDE_DIR} $ENV{GSL_PREFIX}/include $ENV{GSL_DIR}/include $ENV{GSL}/include
PATHS ENV CPP_INCLUDE_PATH
)
FIND_LIBRARY (GSL_LIBRARY gsl
HINTS $ENV{GSL_LIBRARY_PATH} $ENV{GSL_LIBRARY_DIR} $ENV{GSL_PREFIX}/lib $ENV{GSL_DIR}/lib $ENV{GSL}/lib
PATHS ENV LIBRARY_PATH
)
FIND_LIBRARY (GSL_CBLAS_LIBRARY gslcblas
HINTS $ENV{GSL_LIBRARY_PATH} $ENV{GSL_LIBRARY_DIR} $ENV{GSL_PREFIX}/lib $ENV{GSL_DIR}/lib $ENV{GSL}/lib
PATHS ENV LIBRARY_PATH
)
IF (GSL_INCLUDE_DIR AND GSL_LIBRARY)
SET( GSL_FOUND "YES" )
ENDIF()
IF (GSL_FOUND)
IF (NOT GSL_FIND_QUIETLY)
MESSAGE(STATUS "Found GSL libraries: ${GSL_LIBRARY}")
MESSAGE(STATUS "Found GSL include dir: ${GSL_INCLUDE_DIR}")
ENDIF (NOT GSL_FIND_QUIETLY)
ELSE ()
IF (GSL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find GSL!")
ENDIF ()
ENDIF ()
......@@ -147,7 +147,6 @@ IF (BUILD_OPAL_UNIT_TESTS)
ENDIF (BUILD_OPAL_UNIT_TESTS)
ELSE(NOT IPPL_USED_FROM_OPAL)
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
PROJECT (IPPL CXX)
SET (IPPL_VERSION_MAJOR 1)
SET (IPPL_VERSION_MINOR 1.4)
......
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
IF (GIT_FOUND)
SET (IPPL_WC_REVISION 0)
EXECUTE_PROCESS (
......
......@@ -55,14 +55,10 @@ class MyParticleContainer
BL_ASSERT(m_gdb != 0);
const int MyProc = ParallelDescriptor::MyProc();
const int NProcs = ParallelDescriptor::NProcs();
const int IOProc = ParallelDescriptor::IOProcessorNumber();
const Real strttime = ParallelDescriptor::second();
const Geometry& geom = m_gdb->Geom(0);
Real r, x, len[AMREX_SPACEDIM] = { D_DECL(geom.ProbLength(0),
geom.ProbLength(1),
geom.ProbLength(2)) };
Real x;
RealBox containing_bx = geom.ProbDomain();
const Real* xlo = containing_bx.lo();
......@@ -223,7 +219,6 @@ void test_assign_density(TestParams& parms)
myPC.SetVerbose(false);
int num_particles = parms.nppc * parms.nx * parms.ny * parms.nz;
bool serialize = true;
int iseed = 451;
Real mass = 10.0;
myPC.InitParticles(num_particles, iseed, mass);
......
......@@ -55,8 +55,6 @@ class MyParticleContainer
const int MyProc = ParallelDescriptor::MyProc();
const int NProcs = ParallelDescriptor::NProcs();
const int IOProc = ParallelDescriptor::IOProcessorNumber();
const Real strttime = ParallelDescriptor::second();
particles_rm.resize(m_gdb->finestLevel()+1);
......
......@@ -639,7 +639,7 @@ void doSolve(AmrOpal& myAmrOpal, amrbunch_t* bunch,
#ifdef HAVE_AMR_MG_SOLVER
if ( params.useTrilinos ) {
std::string interp = "PC";
std::string norm = "L2";
std::string norm = "LINF";
AmrMultiGrid sol(&myAmrOpal, params.bs, params.prec,
params.rebalance, params.bcx, params.bcy,
params.bcz, params.smoother, params.nsweeps,
......
......@@ -638,7 +638,7 @@ void doSolve(AmrOpal& myAmrOpal, amrbunch_t* bunch,
#ifdef HAVE_AMR_MG_SOLVER
if ( params.useTrilinos ) {
std::string interp = "PC";
std::string norm = "L2";
std::string norm = "LINF";
AmrMultiGrid sol(&myAmrOpal, params.bs, params.prec,
params.rebalance, params.bcx, params.bcy,
params.bcz, params.smoother, params.nsweeps,
......
......@@ -532,7 +532,7 @@ void doSolve(AmrOpal& myAmrOpal, amrbunch_t* bunch,
#ifdef HAVE_AMR_MG_SOLVER
if ( params.useTrilinos ) {
std::string interp="PC";
std::string norm="L2";
std::string norm="LINF";
AmrMultiGrid sol(&myAmrOpal, params.bs, params.prec,
params.rebalance, params.bcx, params.bcy,
params.bcz, params.smoother, params.nsweeps,
......
......@@ -593,7 +593,7 @@ void doSolve(AmrOpal& myAmrOpal, amrbunch_t* bunch,
#ifdef HAVE_AMR_MG_SOLVER
if ( params.useTrilinos ) {
std::string interp = "PC";
std::string norm = "L2";
std::string norm = "LINF";
AmrMultiGrid sol(&myAmrOpal, params.bs, params.prec,
params.rebalance, params.bcx, params.bcy,
params.bcz, params.smoother, params.nsweeps,
......
......@@ -9,18 +9,19 @@ template <class Level>
class AmrBoundary {
public:
typedef typename Level::umap_t umap_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::scalar_t scalar_t;
typedef typename Level::basefab_t basefab_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
typedef typename Level::umap_t umap_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::go_t go_t;
typedef typename Level::scalar_t scalar_t;
typedef typename Level::basefab_t basefab_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
public:
/*!
* @param nPoints used in stencil for applying the boundary
*/
AmrBoundary(lo_t nPoints) : nPoints_m(nPoints) { };
AmrBoundary(go_t nPoints) : nPoints_m(nPoints) { };
/*!
......@@ -28,7 +29,7 @@ public:
* @param iv cell to check
* @param nr is the number of grid points
*/
bool isBoundary(const AmrIntVect_t& iv, const lo_t* nr) const {
bool isBoundary(const AmrIntVect_t& iv, const go_t* nr) const {
return AMREX_D_TERM( isBoundary(iv, 0, nr),
|| isBoundary(iv, 1, nr),
|| isBoundary(iv, 2, nr));
......@@ -41,7 +42,7 @@ public:
*/
bool isBoundary(const AmrIntVect_t& iv,
const lo_t& dir,
const lo_t* nr) const {
const go_t* nr) const {
return ( iv[dir] < 0 || iv[dir] >= nr[0] );
}
......@@ -59,17 +60,17 @@ public:
umap_t& map,
const scalar_t& value,
Level* mglevel,
const lo_t* nr) = 0;
const go_t* nr) = 0;
/*!
* @returns the number of stencil points required
*/
const lo_t& getNumberOfPoints() const {
const go_t& getNumberOfPoints() const {
return nPoints_m;
}
private:
const lo_t nPoints_m; ///< Number of points used for boundary
const go_t nPoints_m; ///< Number of points used for boundary
};
#endif
......@@ -13,6 +13,7 @@ class AmrDirichletBoundary : public AmrBoundary<Level> {
public:
typedef typename Level::umap_t umap_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::go_t go_t;
typedef typename Level::scalar_t scalar_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
......@@ -25,7 +26,7 @@ public:
umap_t& map,
const scalar_t& value,
Level* mglevel,
const lo_t* nr);
const go_t* nr);
};
......@@ -35,7 +36,7 @@ void AmrDirichletBoundary<Level>::apply(const AmrIntVect_t& iv,
umap_t& map,
const scalar_t& value,
Level* mglevel,
const lo_t* nr)
const go_t* nr)
{
// find interior neighbour cell
AmrIntVect_t niv = iv;
......
......@@ -8,12 +8,12 @@ template <class Level>
class AmrInterpolater {
public:
typedef typename Level::global_ordinal_t go_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::scalar_t scalar_t;
typedef typename Level::umap_t umap_t;
typedef typename Level::basefab_t basefab_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
typedef typename Level::go_t go_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::scalar_t scalar_t;
typedef typename Level::umap_t umap_t;
typedef typename Level::basefab_t basefab_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
public:
......
......@@ -16,12 +16,12 @@ class AmrLagrangeInterpolater : public AmrInterpolater<Level>
{
public:
typedef typename Level::global_ordinal_t go_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::scalar_t scalar_t;
typedef typename Level::umap_t umap_t;
typedef typename Level::basefab_t basefab_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
typedef typename Level::go_t go_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::scalar_t scalar_t;
typedef typename Level::umap_t umap_t;
typedef typename Level::basefab_t basefab_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
enum Order {
LINEAR = 1,
......
......@@ -38,7 +38,7 @@ AmrMultiGrid::AmrMultiGrid(AmrOpal* itsAmrObject_p,
lfine_m(0),
nlevel_m(1),
nBcPoints_m(0),
eps_m(1.0e-12),
eps_m(1.0e-10),
verbose_m(false),
fname_m(/*OpalData::getInstance()->getInputBasename()*/ "Solver.solver"),
flag_m(std::ios::out)
......@@ -189,7 +189,7 @@ void AmrMultiGrid::initPhysicalBoundary_m(const Boundary* bc)
"This type of boundary is not supported");
}
// we use the maximum in order to build matrices
int tmp = bc_m[i]->getNumberOfPoints();
go_t tmp = bc_m[i]->getNumberOfPoints();
if ( nBcPoints_m < tmp )
nBcPoints_m = tmp;
}
......@@ -714,7 +714,7 @@ void AmrMultiGrid::buildSingleLevel_m(const amrex::Array<AmrField_u>& rho,
for (int k = lo[2]; k <= hi[2]; ++k) {
#endif
AmrIntVect_t iv(D_DECL(i, j, k));
int gidx = mglevel_m[lbase_m]->serialize(iv);
go_t gidx = mglevel_m[lbase_m]->serialize(iv);
this->buildNoFinePoissonMatrix_m(lbase_m, gidx, iv, mfab, invdx2);
......@@ -791,7 +791,7 @@ void AmrMultiGrid::buildMultiLevel_m(const amrex::Array<AmrField_u>& rho,
int kk = k << 1;
#endif
AmrIntVect_t iv(D_DECL(i, j, k));
int gidx = mglevel_m[lev]->serialize(iv);
go_t gidx = mglevel_m[lev]->serialize(iv);
this->buildRestrictionMatrix_m(lev, gidx, iv,
D_DECL(ii, jj, kk), rfab);
......@@ -1681,7 +1681,7 @@ void AmrMultiGrid::map2vector_m(umap_t& map, indices_t& indices,
values.reserve(map.size());
std::for_each(map.begin(), map.end(),
[&](const std::pair<const int, scalar_t>& entry)
[&](const std::pair<const go_t, scalar_t>& entry)
{
indices.push_back(entry.first);
values.push_back(entry.second);
......
......@@ -16,7 +16,7 @@ namespace amr {
// All Tpetra
typedef double scalar_t;
typedef int local_ordinal_t;
typedef int global_ordinal_t;
typedef long global_ordinal_t;
#ifdef AMR_MG_SERIAL_NODE
typedef ::Kokkos::Compat::KokkosSerialWrapperNode node_t;
......
......@@ -33,18 +33,18 @@ public:
typedef amr::comm_t comm_t;
typedef amr::dmap_t dmap_t;
typedef amr::node_t node_t;
typedef amr::global_ordinal_t global_ordinal_t;
typedef amr::global_ordinal_t go_t;
typedef amr::scalar_t scalar_t;
typedef amr::local_ordinal_t lo_t;
/// Type for matrix indices
typedef std::vector<lo_t> indices_t;
typedef std::vector<go_t> indices_t;
/// Type for matrix entries
typedef std::vector<scalar_t> coefficients_t;
// Type with matrix index (column) and coefficient value
typedef std::unordered_map<lo_t, scalar_t> umap_t;
typedef std::unordered_map<go_t, scalar_t> umap_t;
// covered : ghost cells covered by valid cells of this FabArray
// (including periodically shifted valid cells)
......@@ -92,7 +92,7 @@ public:
* Map a 2D / 3D grid point to an array index
* @param iv grid point (i, j, k)
*/
int serialize(const AmrIntVect_t& iv) const;
go_t serialize(const AmrIntVect_t& iv) const;
/*!
* Checks if grid point is on the physical / mesh boundary
......@@ -203,7 +203,7 @@ public:
std::unique_ptr<mask_t> crsemask;
private:
int nr_m[AMREX_SPACEDIM]; ///< number of grid points
go_t nr_m[AMREX_SPACEDIM]; ///< number of grid points
AmrIntVect_t rr_m; ///< refinement
......
......@@ -83,7 +83,8 @@ AmrMultiGridLevel<MatrixType, VectorType>::~AmrMultiGridLevel()
template <class MatrixType, class VectorType>
int AmrMultiGridLevel<MatrixType, VectorType>::serialize(const AmrIntVect_t& iv) const {
typename AmrMultiGridLevel<MatrixType, VectorType>::go_t
AmrMultiGridLevel<MatrixType, VectorType>::serialize(const AmrIntVect_t& iv) const {
#if AMREX_SPACEDIM == 3
return iv[0] + (iv[1] + nr_m[1] * iv[2]) * nr_m[0];
#else
......@@ -189,11 +190,11 @@ void AmrMultiGridLevel<MatrixType, VectorType>::buildMap_m(const Teuchos::RCP<co
const Teuchos::RCP<node_t>& node)
{
int localNumElements = 0;
go_t localNumElements = 0;
coefficients_t values;
// indices_t globalindices;
Teuchos::Array<global_ordinal_t> globalindices;
Teuchos::Array<go_t> globalindices;
for (amrex::MFIter mfi(grids, dmap, true); mfi.isValid(); ++mfi) {
const amrex::Box& tbx = mfi.tilebox();
......@@ -207,7 +208,7 @@ void AmrMultiGridLevel<MatrixType, VectorType>::buildMap_m(const Teuchos::RCP<co
#endif
AmrIntVect_t iv(D_DECL(i, j, k));
int globalidx = serialize(iv);
go_t globalidx = serialize(iv);
globalindices.push_back(globalidx);
......@@ -229,10 +230,10 @@ void AmrMultiGridLevel<MatrixType, VectorType>::buildMap_m(const Teuchos::RCP<co
AmrIntVect_t lowcorner(D_DECL(lo[0], lo[1], lo[2]));
// where to start indexing
amr::global_ordinal_t baseIndex = serialize(lowcorner);
go_t baseIndex = serialize(lowcorner);
// numGlobalElements == N
int N = grids.numPts();
go_t N = grids.numPts();
/*Teuchos::RCP<dmap_t> full = Teuchos::rcp( new dmap_t(N, globalindices, baseIndex, comm, node) );
......
......@@ -9,6 +9,7 @@ class AmrOpenBoundary : public AmrBoundary<Level> {
public:
typedef typename Level::umap_t umap_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::go_t go_t;
typedef typename Level::scalar_t scalar_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
......@@ -21,7 +22,7 @@ public:
umap_t& map,
const scalar_t& value,
Level* mglevel,
const lo_t* nr);
const go_t* nr);
};
......@@ -32,7 +33,7 @@ void AmrOpenBoundary<Level>::apply(const AmrIntVect_t& iv,
umap_t& map,
const scalar_t& value,
Level* mglevel,
const lo_t* nr)
const go_t* nr)
{
/* depending on boundary we need forward
* or backward difference for the gradient
......@@ -54,12 +55,14 @@ void AmrOpenBoundary<Level>::apply(const AmrIntVect_t& iv,
}
// cell size in direction
scalar_t h = 1.0 / scalar_t(nr[dir]);
scalar_t r = 0.718; // + 0.5 * h; //0.358;
scalar_t h = mglevel->cellSize(dir);
scalar_t r = 1.475625 - 0.5 * h; //0.358;
// 1st order
// map[mglevel->serialize(niv)] += 2.0 * r / (2.0 * r + h) * value;
map[mglevel->serialize(niv)] += (1.0 - h / r) * value;
map[mglevel->serialize(niv)] -= 2.0 * h / r * value;
map[mglevel->serialize(n2iv)] += value;
// map[mglevel->serialize(niv)] += (1.0 - h / r) * value;
}
#endif
......@@ -7,12 +7,12 @@ template <class Level>
class AmrPCInterpolater : public AmrInterpolater<Level>
{
public:
typedef typename Level::global_ordinal_t go_t;
typedef typename Level::lo_t lo_t;
typedef typename Level::scalar_t scalar_t;
typedef typename Level::umap_t umap_t;
typedef typename Level::basefab_t basefab_t;
typedef amr::AmrIntVect_t AmrIntVect_t;
typedef typename Level::go_t go_t;