Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions interfaces/ArrayUtilities.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace ArrayUtil
{
using namespace amrex;
using namespace amrex::literals;

template <int XLO, int XHI>
struct MathArray1D
Expand All @@ -20,18 +20,18 @@ namespace ArrayUtil
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
const Real& operator() (int i) const noexcept {
const amrex::Real& operator() (int i) const noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI);
return arr[i-XLO];
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Real& operator() (int i) noexcept {
amrex::Real& operator() (int i) noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI);
return arr[i-XLO];
}

Real arr[(XHI-XLO+1)];
amrex::Real arr[(XHI-XLO+1)];
};

template <int XLO, int XHI, int YLO, int YHI>
Expand All @@ -46,32 +46,32 @@ namespace ArrayUtil
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void mul (const Real x) noexcept {
void mul (const amrex::Real x) noexcept {
for (int i = 0; i < (YHI-YLO+1)*(XHI-XLO+1); ++i) {
arr[i] *= x;
}
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void set (const int i, const int j, const Real x) noexcept {
void set (const int i, const int j, const amrex::Real x) noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)] = x;
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void add (const int i, const int j, const Real x) noexcept {
void add (const int i, const int j, const amrex::Real x) noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)] += x;
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void mul (const int i, const int j, const Real x) noexcept {
void mul (const int i, const int j, const amrex::Real x) noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)] *= x;
}

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Real get (const int i, const int j) const noexcept {
amrex::Real get (const int i, const int j) const noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
}
Expand All @@ -84,18 +84,18 @@ namespace ArrayUtil
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
const Real& operator() (int i, int j) const noexcept {
const amrex::Real& operator() (int i, int j) const noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Real& operator() (int i, int j) noexcept {
amrex::Real& operator() (int i, int j) noexcept {
AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
}

Real arr[(XHI-XLO+1)*(YHI-YLO+1)];
amrex::Real arr[(XHI-XLO+1)*(YHI-YLO+1)];
};

namespace Math
Expand Down
2 changes: 0 additions & 2 deletions networks/general_null/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <network_properties.H>

using namespace amrex;

void actual_network_init();

const std::string network_name = "general_null";
Expand Down
3 changes: 1 addition & 2 deletions networks/general_null/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
#include <actual_network.H>
#include <jacobian_utilities.H>

using namespace amrex;
using namespace network_rp;

void actual_rhs_init ();

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void actual_rhs (const burn_t& state, Array1D<Real, 1, neqs>& ydot)
void actual_rhs (const burn_t& state, amrex::Array1D<amrex::Real, 1, neqs>& ydot)
{
for (int i=1; i<=neqs; ++i) {
ydot(i) = 0.;
Expand Down
2 changes: 0 additions & 2 deletions networks/vode_example/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <network_properties.H>

using namespace amrex;

AMREX_INLINE
void actual_network_init() {
}
Expand Down
4 changes: 2 additions & 2 deletions networks/vode_example/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <actual_network.H>
#include <burn_type.H>

using namespace amrex;
using namespace amrex::literals;
using namespace network_rp;

AMREX_INLINE
Expand All @@ -14,7 +14,7 @@ void actual_rhs_init () {


AMREX_GPU_HOST_DEVICE AMREX_INLINE
void actual_rhs (burn_t& state, Array1D<Real, 1, neqs>& ydot)
void actual_rhs (burn_t& state, amrex::Array1D<amrex::Real, 1, neqs>& ydot)
{
using namespace Species;

Expand Down
3 changes: 1 addition & 2 deletions nse_solver/make_table/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <AMReX_ParmParse.H>
#include <AMReX_MultiFab.H>
using namespace amrex;

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -18,7 +17,7 @@ int main(int argc, char *argv[]) {

std::cout << "starting the single zone burn..." << std::endl;

ParmParse ppa("amr");
amrex::ParmParse ppa("amr");

init_unit_test();

Expand Down
3 changes: 1 addition & 2 deletions nse_solver/nse_compatibility/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <AMReX_ParmParse.H>
#include <AMReX_MultiFab.H>
using namespace amrex;

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -18,7 +17,7 @@ int main(int argc, char *argv[]) {

std::cout << "starting the single zone burn..." << std::endl;

ParmParse ppa("amr");
amrex::ParmParse ppa("amr");

init_unit_test();

Expand Down
8 changes: 4 additions & 4 deletions nse_tabular/nse_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void
nse_T_abar_from_e(const amrex::Real rho, const amrex::Real e_in, const amrex::Real Ye,
amrex::Real& T, amrex::Real& abar) {

using namespace amrex;
using namespace amrex::literals;
using namespace AuxZero;

const amrex::Real ttol{1.e-6_rt};
Expand Down Expand Up @@ -130,7 +130,7 @@ void
nse_rho_abar_from_e(const amrex::Real T, const amrex::Real e_in, const amrex::Real Ye,
amrex::Real& rho, amrex::Real& abar) {

using namespace amrex;
using namespace amrex::literals;
using namespace AuxZero;

const amrex::Real dtol{1.e-6_rt};
Expand Down Expand Up @@ -221,7 +221,7 @@ void
nse_T_abar_from_p(const amrex::Real rho, const amrex::Real p_in, const amrex::Real Ye,
amrex::Real& T, amrex::Real& abar) {

using namespace amrex;
using namespace amrex::literals;
using namespace AuxZero;

const amrex::Real ttol{1.e-6_rt};
Expand Down Expand Up @@ -312,7 +312,7 @@ void
nse_rho_abar_from_p(const amrex::Real T, const amrex::Real p_in, const amrex::Real Ye,
amrex::Real& rho, amrex::Real& abar) {

using namespace amrex;
using namespace amrex::literals;
using namespace AuxZero;

const amrex::Real dtol{1.e-6_rt};
Expand Down
3 changes: 1 addition & 2 deletions rates/aprox_rates_data.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <aprox_rates_data.H>

using namespace amrex;
using namespace amrex::literals;

AMREX_GPU_MANAGED amrex::Array1D<amrex::Real,1,6> rv = {6.0_rt, 7.0_rt, 8.0_rt, 9.0_rt, 10.0_rt, 11.0_rt};
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real,1,14> tv = {1.0_rt,2.0_rt,3.0_rt,4.0_rt,5.0_rt,6.0_rt,7.0_rt,8.0_rt,9.0_rt,10.0_rt,11.0_rt,12.0_rt,13.0_rt,14.0_rt};
Expand All @@ -13,4 +13,3 @@ AMREX_GPU_MANAGED amrex::Array1D<amrex::Real,1,12> tfdm;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real,1,12> tfd0;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real,1,12> tfd1;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real,1,12> tfd2;

3 changes: 1 addition & 2 deletions unit_test/nse_net_cell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <AMReX_ParmParse.H>
#include <AMReX_MultiFab.H>
using namespace amrex;

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -18,7 +17,7 @@ int main(int argc, char *argv[]) {

std::cout << "starting the single zone burn..." << std::endl;

ParmParse ppa("amr");
amrex::ParmParse ppa("amr");

init_unit_test();

Expand Down
3 changes: 1 addition & 2 deletions unit_test/nse_net_cell/make_table/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <AMReX_ParmParse.H>
#include <AMReX_MultiFab.H>
using namespace amrex;

#include <extern_parameters.H>
#include <eos.H>
Expand All @@ -18,7 +17,7 @@ int main(int argc, char *argv[]) {

std::cout << "starting the single zone burn..." << std::endl;

ParmParse ppa("amr");
amrex::ParmParse ppa("amr");

init_unit_test();

Expand Down
39 changes: 19 additions & 20 deletions unit_test/write_job_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#endif

using namespace std;
using namespace amrex;

void write_job_info(const std::string& dir) {

Expand All @@ -34,7 +33,7 @@ void write_job_info(const std::string& dir) {
jobInfoFile << " Microphysics Job Information\n";
jobInfoFile << PrettyLine;

jobInfoFile << "number of MPI processes: " << ParallelDescriptor::NProcs() << "\n";
jobInfoFile << "number of MPI processes: " << amrex::ParallelDescriptor::NProcs() << "\n";
#ifdef _OPENMP
jobInfoFile << "number of threads: " << omp_get_max_threads() << "\n";
#endif
Expand Down Expand Up @@ -67,8 +66,8 @@ void write_job_info(const std::string& dir) {
jobInfoFile << "GPU Information: " << "\n";
jobInfoFile << PrettyLine;

jobInfoFile << "GPU model name: " << Gpu::Device::deviceName() << "\n";
jobInfoFile << "Number of GPUs used: " << Gpu::Device::numDevicesUsed() << "\n";
jobInfoFile << "GPU model name: " << amrex::Gpu::Device::deviceName() << "\n";
jobInfoFile << "Number of GPUs used: " << amrex::Gpu::Device::numDevicesUsed() << "\n";

jobInfoFile << "\n\n";
#endif
Expand All @@ -78,41 +77,41 @@ void write_job_info(const std::string& dir) {
jobInfoFile << " Build Information\n";
jobInfoFile << PrettyLine;

jobInfoFile << "build date: " << buildInfoGetBuildDate() << "\n";
jobInfoFile << "build machine: " << buildInfoGetBuildMachine() << "\n";
jobInfoFile << "build dir: " << buildInfoGetBuildDir() << "\n";
jobInfoFile << "AMReX dir: " << buildInfoGetAMReXDir() << "\n";
jobInfoFile << "build date: " << amrex::buildInfoGetBuildDate() << "\n";
jobInfoFile << "build machine: " << amrex::buildInfoGetBuildMachine() << "\n";
jobInfoFile << "build dir: " << amrex::buildInfoGetBuildDir() << "\n";
jobInfoFile << "AMReX dir: " << amrex::buildInfoGetAMReXDir() << "\n";

jobInfoFile << "\n";

jobInfoFile << "COMP: " << buildInfoGetComp() << "\n";
jobInfoFile << "COMP version: " << buildInfoGetCompVersion() << "\n";
jobInfoFile << "COMP: " << amrex::buildInfoGetComp() << "\n";
jobInfoFile << "COMP version: " << amrex::buildInfoGetCompVersion() << "\n";

jobInfoFile << "\n";

jobInfoFile << "C++ compiler: " << buildInfoGetCXXName() << "\n";
jobInfoFile << "C++ flags: " << buildInfoGetCXXFlags() << "\n";
jobInfoFile << "C++ compiler: " << amrex::buildInfoGetCXXName() << "\n";
jobInfoFile << "C++ flags: " << amrex::buildInfoGetCXXFlags() << "\n";

jobInfoFile << "\n";

jobInfoFile << "Fortran comp: " << buildInfoGetFName() << "\n";
jobInfoFile << "Fortran flags: " << buildInfoGetFFlags() << "\n";
jobInfoFile << "Fortran comp: " << amrex::buildInfoGetFName() << "\n";
jobInfoFile << "Fortran flags: " << amrex::buildInfoGetFFlags() << "\n";

jobInfoFile << "\n";

jobInfoFile << "Link flags: " << buildInfoGetLinkFlags() << "\n";
jobInfoFile << "Libraries: " << buildInfoGetLibraries() << "\n";
jobInfoFile << "Link flags: " << amrex::buildInfoGetLinkFlags() << "\n";
jobInfoFile << "Libraries: " << amrex::buildInfoGetLibraries() << "\n";

jobInfoFile << "\n";

for (int n = 1; n <= buildInfoGetNumModules(); n++) {
jobInfoFile << buildInfoGetModuleName(n) << ": " << buildInfoGetModuleVal(n) << "\n";
for (int n = 1; n <= amrex::buildInfoGetNumModules(); n++) {
jobInfoFile << amrex::buildInfoGetModuleName(n) << ": " << amrex::buildInfoGetModuleVal(n) << "\n";
}

jobInfoFile << "\n";

const char* githash1 = buildInfoGetGitHash(1);
const char* githash2 = buildInfoGetGitHash(2);
const char* githash1 = amrex::buildInfoGetGitHash(1);
const char* githash2 = amrex::buildInfoGetGitHash(2);
if (strlen(githash1) > 0) {
jobInfoFile << "Microphysics git describe: " << githash1 << "\n";
}
Expand Down
2 changes: 1 addition & 1 deletion util/build_scripts/write_probin.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def write_probin(param_files, out_file, cxx_prefix):
fout.write(f" {cxx_base}_t init_{cxx_base}_parameters() {{\n")

# we need access to _rt
fout.write(" using namespace amrex;\n\n")
fout.write(" using namespace amrex::literals;\n\n")

# create the struct that will hold all the parameters -- this is what
# we will return
Expand Down
Loading