Skip to content

Commit

Permalink
no more density function used for ion_population
Browse files Browse the repository at this point in the history
  • Loading branch information
rochSmets committed Sep 10, 2024
1 parent a719584 commit 0c5946d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/diagnostic/detail/types/fluid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void FluidDiagnosticWriter<H5Writer>::getDataSetInfo(DiagnosticProperties& diagn
std::string tree{"/ions/pop/" + pop.name() + "/"};
auto& popAttr = patchAttributes[lvlPatchID]["fluid_" + pop.name()];
if (isActiveDiag(diagnostic, tree, "density"))
infoDS(pop.density(), "density", popAttr);
infoDS(pop.chargeDensity(), "density", popAttr);
if (isActiveDiag(diagnostic, tree, "flux"))
infoVF(pop.flux(), "flux", popAttr);
if (isActiveDiag(diagnostic, tree, "momentum_tensor"))
Expand Down Expand Up @@ -307,7 +307,7 @@ void FluidDiagnosticWriter<H5Writer>::write(DiagnosticProperties& diagnostic)
{
std::string tree{"/ions/pop/" + pop.name() + "/"};
if (isActiveDiag(diagnostic, tree, "density"))
writeDS(path + "density", pop.density());
writeDS(path + "density", pop.chargeDensity());
if (isActiveDiag(diagnostic, tree, "flux"))
writeTF(path + "flux", pop.flux());
if (isActiveDiag(diagnostic, tree, "momentum_tensor"))
Expand Down
2 changes: 1 addition & 1 deletion src/python3/patch_level.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class PatchLevel
if (!pop_data.count(pop.name()))
pop_data.emplace(pop.name(), Inner());

setPatchDataFromField(pop_data.at(pop.name()).emplace_back(), pop.density(), grid,
setPatchDataFromField(pop_data.at(pop.name()).emplace_back(), pop.chargeDensity(), grid,
patchID);
}
};
Expand Down
20 changes: 10 additions & 10 deletions tests/core/numerics/ion_updater/test_updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ struct IonsBuffers
using ParticleArray = typename PHARETypes::ParticleArray_t;
using ParticleInitializerFactory = typename PHARETypes::ParticleInitializerFactory;

Grid ionDensity;
Grid ionParticleDensity;
Grid ionChargeDensity;
Grid ionMassDensity;
Grid protonDensity;
Expand Down Expand Up @@ -240,7 +240,7 @@ struct IonsBuffers
ParticlesPack<ParticleArray> alphaPack;

IonsBuffers(GridLayout const& layout)
: ionDensity{"particleDensity", HybridQuantity::Scalar::rho,
: ionParticleDensity{"particleDensity", HybridQuantity::Scalar::rho,
layout.allocSize(HybridQuantity::Scalar::rho)}
, ionChargeDensity{"chargeDensity", HybridQuantity::Scalar::rho,
layout.allocSize(HybridQuantity::Scalar::rho)}
Expand Down Expand Up @@ -279,7 +279,7 @@ struct IonsBuffers


IonsBuffers(IonsBuffers const& source, GridLayout const& layout)
: ionDensity{"rho", HybridQuantity::Scalar::rho,
: ionParticleDensity{"rho", HybridQuantity::Scalar::rho,
layout.allocSize(HybridQuantity::Scalar::rho)}
, ionChargeDensity{"chargeDensity", HybridQuantity::Scalar::rho,
layout.allocSize(HybridQuantity::Scalar::rho)}
Expand Down Expand Up @@ -315,7 +315,7 @@ struct IonsBuffers
&alphaLevelGhost, &alphaLevelGhostOld, &alphaLevelGhostNew}

{
ionDensity.copyData(source.ionDensity);
ionParticleDensity.copyData(source.ionParticleDensity);
ionChargeDensity.copyData(source.ionChargeDensity);
ionMassDensity.copyData(source.ionMassDensity);
protonDensity.copyData(source.protonDensity);
Expand All @@ -334,7 +334,7 @@ struct IonsBuffers
auto const& [V, m, d, cd, md] = ions.getCompileTimeResourcesViewList();
Vi.set_on(V);
M.set_on(m);
d.setBuffer(&ionDensity);
d.setBuffer(&ionParticleDensity);
cd.setBuffer(&ionChargeDensity);
md.setBuffer(&ionMassDensity);
}
Expand Down Expand Up @@ -560,16 +560,16 @@ struct IonUpdaterTest : public ::testing::Test

for (auto& pop : this->ions)
{
interpolate(makeIndexRange(pop.patchGhostParticles()), pop.density(), pop.chargeDensity(), pop.flux(),
interpolate(makeIndexRange(pop.patchGhostParticles()), pop.particleDensity(), pop.chargeDensity(), pop.flux(),
layout);

double alpha = 0.5;
interpolate(makeIndexRange(pop.levelGhostParticlesNew()), pop.density(), pop.chargeDensity(), pop.flux(),
interpolate(makeIndexRange(pop.levelGhostParticlesNew()), pop.particleDensity(), pop.chargeDensity(), pop.flux(),
layout,
/*coef = */ alpha);


interpolate(makeIndexRange(pop.levelGhostParticlesOld()), pop.density(), pop.chargeDensity(), pop.flux(),
interpolate(makeIndexRange(pop.levelGhostParticlesOld()), pop.particleDensity(), pop.chargeDensity(), pop.flux(),
layout,
/*coef = */ (1. - alpha));
}
Expand Down Expand Up @@ -632,7 +632,7 @@ struct IonUpdaterTest : public ::testing::Test
check(alphaFy, ionsBufferCpy.alphaF(Component::Y));
check(alphaFz, ionsBufferCpy.alphaF(Component::Z));

check(ions.density(), ionsBufferCpy.ionDensity);
check(ions.density(), ionsBufferCpy.ionParticleDensity);
check(ions.velocity().getComponent(Component::X), ionsBufferCpy.Vi(Component::X));
check(ions.velocity().getComponent(Component::Y), ionsBufferCpy.Vi(Component::Y));
check(ions.velocity().getComponent(Component::Z), ionsBufferCpy.Vi(Component::Z));
Expand Down Expand Up @@ -932,7 +932,7 @@ TYPED_TEST(IonUpdaterTest, thatNoNaNsExistOnPhysicalNodesMoments)
{
for (auto ix = ix0; ix <= ix1; ++ix)
{
auto& density = pop.density();
auto& density = pop.particleDensity();
auto& flux = pop.flux();

auto& fx = flux.getComponent(Component::X);
Expand Down
2 changes: 1 addition & 1 deletion tests/diagnostic/test_diagnostics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void validateFluidDump(Simulator& sim, Hi5Diagnostic& hi5)
auto& ions = hi5.modelView.getIons();
for (auto& pop : ions)
{
checkF(layout, path, "/ions/pop/" + pop.name(), "/density"s, pop.density());
checkF(layout, path, "/ions/pop/" + pop.name(), "/density"s, pop.chargeDensity());
checkVF(layout, path, "/ions/pop/" + pop.name(), "/flux"s, pop.flux());
}
checkF(layout, path, "/ions"s, "/density"s, ions.density());
Expand Down

0 comments on commit 0c5946d

Please sign in to comment.