forked from erf-model/ERF
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented plotting Eulerian quantities derived from particle contai…
…ners; added a mass density function to tracer particle container as an example (erf-model#1463)
- Loading branch information
Showing
11 changed files
with
178 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <AMReX_ParticleInterpolators.H> | ||
#include <ERF_Constants.H> | ||
#include <ERFPC.H> | ||
|
||
#ifdef ERF_USE_PARTICLES | ||
|
||
using namespace amrex; | ||
|
||
void ERFPC::massDensity ( MultiFab& a_mf, | ||
const int& a_lev, | ||
const int& a_comp ) const | ||
{ | ||
BL_PROFILE("ERFPC::massDensity()"); | ||
|
||
AMREX_ASSERT(OK()); | ||
AMREX_ASSERT(numParticlesOutOfRange(*this, 0) == 0); | ||
|
||
const auto& geom = Geom(a_lev); | ||
const auto plo = geom.ProbLoArray(); | ||
const auto dxi = geom.InvCellSizeArray(); | ||
|
||
const Real inv_cell_volume = dxi[0]*dxi[1]*dxi[2]; | ||
a_mf.setVal(0.0); | ||
|
||
ParticleToMesh( *this, a_mf, a_lev, | ||
[=] AMREX_GPU_DEVICE ( const ERFPC::ParticleTileType::ConstParticleTileDataType& ptd, | ||
int i, Array4<Real> const& rho) | ||
{ | ||
auto p = ptd.m_aos[i]; | ||
ParticleInterpolator::Linear interp(p, plo, dxi); | ||
interp.ParticleToMesh ( p, rho, 0, a_comp, 1, | ||
[=] AMREX_GPU_DEVICE ( const ERFPC::ParticleType&, int) | ||
{ | ||
auto mass = ptd.m_rdata[ERFParticlesRealIdxSoA::mass][i]; | ||
return mass*inv_cell_volume; | ||
}); | ||
}); | ||
|
||
return; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
CEXE_sources += ERFTracers.cpp | ||
CEXE_sources += ERFPCInitializations.cpp | ||
CEXE_sources += ERFPCEvolve.cpp | ||
CEXE_sources += ERFPCUtils.cpp | ||
|
||
CEXE_headers += ParticleData.H | ||
CEXE_headers += ERFPC.H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters