Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a7dffef
Reading plot file and interpolate directory
nataraj2 Feb 24, 2026
3fbabec
Updating routines
nataraj2 Feb 24, 2026
e33c794
Verifying workflow
nataraj2 Feb 24, 2026
55baf13
Updating with some minor changes
nataraj2 Mar 3, 2026
9f148d7
Correcting some errors in ERF_Prob.cpp
nataraj2 Mar 4, 2026
509c5f3
Interpolation works now
nataraj2 Mar 4, 2026
87979bf
Correcting inputs for coarse
nataraj2 Mar 4, 2026
d7c3e67
Correcting trailing whitespaces and tabs
nataraj2 Mar 4, 2026
fe5821a
Merge remote-tracking branch 'upstream/development' into data_assimil…
nataraj2 Mar 5, 2026
b59e46e
Getting ready for ensemble simulations
nataraj2 Mar 15, 2026
e399f63
Getting ready for ensemble simulations
nataraj2 Mar 15, 2026
b9b9738
Getting ready for ensemble simulations
nataraj2 Mar 15, 2026
81d223d
Coarse basckground state to fine interpolation
nataraj2 Mar 16, 2026
0306ca6
Merge remote-tracking branch 'upstream/development' into data_assimil…
nataraj2 Mar 16, 2026
7f1bbec
Updating with coarse mesh to fine mesh interpolation routines
nataraj2 Mar 26, 2026
4603ab5
Update routines for ensemble simulations
nataraj2 Mar 30, 2026
b8bd13c
Some minor changes
nataraj2 Mar 30, 2026
44d2915
updating ERF.H
nataraj2 Mar 30, 2026
cf28661
Fixing confliccts
nataraj2 Mar 30, 2026
fc43788
Routine for reading plotfile and wrting coarse data
nataraj2 Mar 31, 2026
507a60f
Adding header files for data assimilation simulations
nataraj2 Mar 31, 2026
4a27a03
Correcting trailing whitespaces and tabs
nataraj2 Mar 31, 2026
8aa6090
Merge remote-tracking branch 'upstream/development' into data_assimil…
nataraj2 Mar 31, 2026
3111a62
Adding header file
nataraj2 Mar 31, 2026
9d6313b
Correcting spelling error
nataraj2 Mar 31, 2026
f305641
Correcting unused variables errors
nataraj2 Mar 31, 2026
9b132d4
Correcting unused variable error
nataraj2 Mar 31, 2026
d085cbc
Merge remote-tracking branch 'upstream/development' into data_assimil…
nataraj2 Apr 14, 2026
9a6cb84
Merge branch 'development' into data_assimilation
asalmgren Apr 15, 2026
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
3 changes: 2 additions & 1 deletion .Exec_dev/DataAssimilation/ERF_Prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <string>

#include "AMReX_REAL.H"

#include "ERF_ProbCommon.H"

struct ProbParm : ProbParmDefaults {
Expand All @@ -29,6 +28,8 @@ class Problem : public ProblemBase
public:
Problem(const amrex_real* problo, const amrex_real* probhi);

#include "Prob/ERF_InitDensityHSE.H"
#include "Prob/ERF_InitRayleighDamping.H"
#include "Prob/ERF_InitCustomPert.H"

protected:
Expand Down
6 changes: 5 additions & 1 deletion .Exec_dev/DataAssimilation/ERF_Prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,24 @@ Problem::init_custom_pert_vels (
Array4<Real > const& x_vel_pert,
Array4<Real > const& y_vel_pert,
Array4<Real > const& z_vel_pert,
Array4<Real > const& r_hse,
amrex::Array4<amrex::Real const> const& z_nd,
GeometryData const& geomdata,
Array4<Real const> const& /*mf_u*/,
Array4<Real const> const& /*mf_v*/,
const SolverChoice& /*sc*/,
const int /*lev*/)
{
ignore_unused(z_nd);
// --------------------------------------------------------
// Per-ensemble perturbation controls
// --------------------------------------------------------
Real ens_pert_amplitude = 0.0;
ParmParse pp_ens("ensemble_pert");
pp_ens.query("amplitude", ens_pert_amplitude);

Real xc = parms.xc; Real yc = parms.yc;
Real R = parms.R ; Real beta = parms.beta;
Real sigma = parms.sigma;

// Set the x-velocity
ParallelFor(xbx, [=, parms_d=parms] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
Expand Down
4 changes: 2 additions & 2 deletions .Exec_dev/DataAssimilation/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ USE_ASSERTION = TRUE
Bpack := ./Make.package
Blocs := .

ERF_HOME := ../../..
ERF_PROBLEM_DIR = $(ERF_HOME)/.Exec_dev/Assimilation
ERF_HOME := ../..
ERF_PROBLEM_DIR = $(ERF_HOME)/.Exec_dev/DataAssimilation
include $(ERF_HOME)/Exec/Make.ERF
58 changes: 58 additions & 0 deletions .Exec_dev/DataAssimilation/ReadPltFileAndInterpolate/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@


#---------------------------
# Makefile for AMReX project
#---------------------------
CXX = mpicxx
CXXFLAGS = -O2 -std=c++17 -fopenmp -Wall

# Replace with your AMReX paths
AMREX_INC = /pscratch/sd/n/nataraj2/AIModCon/GitHub/amrex_repos/amrex/include
AMREX_LIB = /pscratch/sd/n/nataraj2/AIModCon/GitHub/amrex_repos/amrex/lib

HDRS = ReadPlotFile.H
LIBS = -lamrex -lpthread -lgfortran -ldl -lm -lstdc++

# Default: do nothing if 'make' is called without target
all:
@echo "Use 'make serial' or 'make parallel'"

# -------------------------
# Serial build
# -------------------------
SRCS_SERIAL = main_serial.cpp ReadPlotFile.cpp
OBJS_SERIAL = $(SRCS_SERIAL:.cpp=.o)
EXE_SERIAL = out_serial

serial: $(EXE_SERIAL)

$(EXE_SERIAL): $(OBJS_SERIAL)
$(CXX) $(CXXFLAGS) -o $@ $^ -L$(AMREX_LIB) $(LIBS)

# -------------------------
# Parallel build
# -------------------------
SRCS_PARALLEL = main_parallel.cpp ReadPlotFile.cpp
OBJS_PARALLEL = $(SRCS_PARALLEL:.cpp=.o)
EXE_PARALLEL = out_parallel

parallel: $(EXE_PARALLEL)

$(EXE_PARALLEL): $(OBJS_PARALLEL)
$(CXX) $(CXXFLAGS) -o $@ $^ -L$(AMREX_LIB) $(LIBS)

# -------------------------
# Compile rules for object files
# -------------------------
%.o: %.cpp $(HDRS)
$(CXX) $(CXXFLAGS) -I$(AMREX_INC) -c $< -o $@

# -------------------------
# Clean
# -------------------------
clean:
rm -f *.o out_serial out_parallel

.PHONY: all serial parallel clean


Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#ifndef READ_PLOTFILE_H_
#define READ_PLOTFILE_H_

#include <string>
#include <AMReX.H>
#include <AMReX_Vector.H>
#include <AMReX_MultiFab.H>
#include <AMReX_PlotFileUtil.H>

amrex::Vector<std::string> ReadVarNames(const std::string& filename);

// ------------------------------------------------------------
// ReadPlotFile
//
// var_filename : text file containing variable names (one per line)
// plot_filename : AMReX plotfile directory
// mf : MultiFab that will be defined and filled
// ------------------------------------------------------------
void ReadPlotFile(const std::string& var_filename,
amrex::PlotFileData& pf,
amrex::MultiFab& mf);

void
GetCoarseMultiFabOnFineDMap(const amrex::Geometry& geom_coarse,
const amrex::Geometry& geom_fine,
const amrex::MultiFab& multifab_coarse,
const amrex::MultiFab& multifab_fine,
amrex::MultiFab& coarse_multifab_on_fine_dmap);

void
CreateNodalMultiFabFromCellCenteredMultiFab (amrex::MultiFab& mf_nc, // output nodal MF
amrex::MultiFab& mf_cc, // input cell-centered MF (coarse)
const amrex::Geometry& geom);

void
CreateCellCenteredMultiFabFromNodalMultiFab(amrex::MultiFab& tmp_cc, // cell-centered output
amrex::MultiFab& mf_nc); // node-centered input

// Populate a fine, cell-centered MultiFab from coarse nodal data using
// trilinear interpolation at fine cell centers.
// mf_cc_fine provides the fine BoxArray + DistributionMapping template.
void
PopulateFineCellCenteredFromCoarseNodal(const amrex::Geometry& geom_coarse,
const amrex::Geometry& geom_fine,
const amrex::MultiFab& coarse_multifab_on_fine_dmap,
const amrex::MultiFab& mf_cc_fine,
amrex::MultiFab& mf_cc_from_coarse);

void
check_large_values(const amrex::MultiFab& mf);

void
ApplyNeumannBCs(const amrex::Geometry& geom,
amrex::MultiFab& mf_cc);

void WriteCustomDataFile(const amrex::Geometry& geom,
const amrex::MultiFab& mf_cc,
const std::string& filename_custom);

#endif
Loading
Loading