Skip to content

Commit

Permalink
Fix up particle compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
drummerdoc committed Jul 12, 2022
1 parent a8e1e47 commit ad1327f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
26 changes: 14 additions & 12 deletions Src/GNUmakefile
@@ -1,8 +1,8 @@
AMREX_HOME ?= ../../../amrex

# AMReX
DEBUG = TRUE
DIM = 3
DEBUG = FALSE
DIM = 3
PRECISION = DOUBLE

# Compilation
Expand All @@ -13,7 +13,7 @@ USE_CUDA = FALSE

# Executable
# Uncomment the desired exec
EBASE = grad
#EBASE = grad
#EBASE = combinePlts
#EBASE = isosurface
#EBASE = stream
Expand All @@ -33,29 +33,31 @@ EBASE = grad
#EBASE = conditionalMean
#EBASE = jpdf
#EBASE = avgToPlane
#EBASE = avgPlotfiles
EBASE = avgPlotfiles
#EBASE = amrToFE

NEEDS_f90_SRC = FALSE
#NEEDS_f90_SRC = TRUE

include $(AMREX_HOME)/Tools/GNUMake/Make.defs
Pdirs := Base Boundary AmrCore Extern/amrdata LinearSolvers/MLMG
Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package)

CEXE_sources += $(EBASE).cpp
ifeq ($(NEEDS_f90_SRC),TRUE)
f90EXE_sources += $(EBASE)_nd.f90
endif
ifeq ($(EBASE),partStream)
USE_PARTICLES = TRUE
Pdirs += Particle
CEXE_headers += StreamData.H StreamPC.H
CEXE_sources += StreamData.cpp StreamPC.cpp
endif

include $(AMREX_HOME)/Tools/GNUMake/Make.defs

CEXE_sources += $(EBASE).cpp
ifeq ($(NEEDS_f90_SRC),TRUE)
f90EXE_sources += $(EBASE)_nd.f90
endif
INCLUDE_LOCATIONS += .
VPATH_LOCATIONS += .

Pdirs := Base Boundary Amr AmrCore Extern/amrdata LinearSolvers/MLMG Particle
Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package)

include $(Ppack)
INCLUDE_LOCATIONS += $(Blocs)
VPATH_LOCATIONS += $(Blocs)
Expand Down
2 changes: 1 addition & 1 deletion Src/StreamData.H
Expand Up @@ -63,7 +63,7 @@ public:

void FlushGrids(int componentIndex);

const amrex::Vector<string> &StreamVarNames() const { return PlotVarNames(); }
const amrex::Vector<std::string> &StreamVarNames() const { return PlotVarNames(); }

static std::string FileFormatName00() { return "Oddball-multilevel-connected-data-format";}
static std::string FileFormatName10() { return "Oddball-multilevel-connected-data-format-1.0";}
Expand Down
8 changes: 4 additions & 4 deletions Src/StreamData.cpp
Expand Up @@ -33,7 +33,7 @@ StreamData::DefineFab(int level, int componentIndex, int fabIndex)
int whichVisMFComponent(compIndexToVisMFComponentMap[componentIndex]);
dataGrids[level][componentIndex]->setFab(
fabIndex,
visMF[level][whichVisMF]->readFAB(fabIndex, whichVisMFComponent));
std::unique_ptr<FArrayBox>(visMF[level][whichVisMF]->readFAB(fabIndex, whichVisMFComponent)));
dataGridsDefined[level][componentIndex][fabIndex] = true;
}
return true;
Expand All @@ -47,7 +47,7 @@ StreamData::getFab (int level,
if (fabIdx<0) {
// Intends to access boundary/ghost data
if (compIdx < boundaryNodes.size()) {
if (!boundaryNodes.size()>compIdx
if (!(boundaryNodes.size()>compIdx)
|| boundaryNodes[compIdx] == nullptr) {
std::cout << "Boundary data not correctly partitioned for component " << compIdx << std::endl;
Abort("Data not correctly partitioned");
Expand Down Expand Up @@ -319,7 +319,7 @@ StreamData::WriteFile(std::string& outfile,
CreateDirectoryFailed(outfile);

// Write Header
const string FullHeaderFileName = outfile + "/" + HeaderFileName_DEF;
const std::string FullHeaderFileName = outfile + "/" + HeaderFileName_DEF;
std::ofstream ofh;
ofh.open(FullHeaderFileName.c_str());
ofh << FileFormatName << '\n';
Expand All @@ -345,7 +345,7 @@ StreamData::WriteFile(std::string& outfile,
ofh.close();

// Write elements
const string FullElementFileName = outfile + "/" + ElementFileName;
const std::string FullElementFileName = outfile + "/" + ElementFileName;
int my_nodes_per_element = global_element_node_ids.size() / num_global_elements;
std::ofstream ofe;
ofe.open(FullElementFileName.c_str());
Expand Down

0 comments on commit ad1327f

Please sign in to comment.