Skip to content

Commit

Permalink
removed setOpenPMDUnit, and it will be handled by applications
Browse files Browse the repository at this point in the history
set default axis labels to be "x/y/z" for 1/2/3-Dims
other behaviours should be done in application codes
removed print statements
  • Loading branch information
guj committed Feb 14, 2024
1 parent 963dcac commit 4281967
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 36 deletions.
2 changes: 0 additions & 2 deletions Src/Extern/openPMD-api/AMReX_PlotFileOPENPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,6 @@ namespace amrex::openpmd_api {
mesh.setAttribute("fieldSmoothing", "none");
mesh_comp.resetDataset(dataset);

helper::setOpenPMDUnit( mesh, varName.m_FieldName );

auto relative_cell_pos = helper::getRelativeCellPosition(mf); // AMReX Fortran index order
std::reverse( relative_cell_pos.begin(), relative_cell_pos.end() ); // now in C order
mesh_comp.setPosition( relative_cell_pos );
Expand Down
30 changes: 0 additions & 30 deletions Src/Extern/openPMD-api/AMReX_PlotFileUtilOPENPMD.H
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,6 @@ namespace amrex::openpmd_api
{
namespace helper
{
inline void
setOpenPMDUnit ( openPMD::Mesh mesh, std::string const& field_name )
{
if (field_name[0] == 'E'){
mesh.setUnitDimension({
{openPMD::UnitDimension::L, 1},
{openPMD::UnitDimension::M, 1},
{openPMD::UnitDimension::T, -3},
{openPMD::UnitDimension::I, -1},
});
} else if (field_name[0] == 'B'){
mesh.setUnitDimension({
{openPMD::UnitDimension::M, 1},
{openPMD::UnitDimension::I, -1},
{openPMD::UnitDimension::T, -2}
});
}else if (field_name[0] == 'j'){ // current
mesh.setUnitDimension({
{openPMD::UnitDimension::L, -2},
{openPMD::UnitDimension::I, 1},
});
} else if (field_name.substr(0,3) == "rho"){ // charge density
mesh.setUnitDimension({
{openPMD::UnitDimension::L, -3},
{openPMD::UnitDimension::I, 1},
{openPMD::UnitDimension::T, 1},
});
}
} // name space helper

// from warpx Utils/RelativeCellPosition.cpp
inline std::vector< double >
getRelativeCellPosition(amrex::MultiFab const& mf)
Expand Down
3 changes: 0 additions & 3 deletions Src/Extern/openPMD-api/AMReX_PlotFileUtilOPENPMD_PTLImpl.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ namespace amrex::openpmd_api
{
BL_PROFILE("amrex::openpmd_api::WriteParticles()");

amrex::Print()<<" Real: "<<pc.NStructReal<<" "<<pc.NumRealComps()<<"\n";
amrex::Print()<<" Int: "<<pc.NStructInt<<" "<<pc.NumIntComps()<<"\n";

if ((m_OpenPMDHandler == nullptr) || (m_OpenPMDHandler->m_Writer == nullptr)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/openPMDTests/ptls/warpxWriter.H
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void AMReX_warpxWriter::SetupMeshComp (openPMD::Mesh& mesh,
mesh.setAttribute("fieldSmoothing", "none");
mesh_comp.resetDataset(dataset);

amrex::openpmd_api::helper::setOpenPMDUnit( mesh, varName.m_FieldName );
//amrex::openpmd_api::helper::setOpenPMDUnit( mesh, varName.m_FieldName ); // removed this function. define in app if needed

auto relative_cell_pos = amrex::openpmd_api::helper::getRelativeCellPosition(mf); // AMReX Fortran index order
std::reverse( relative_cell_pos.begin(), relative_cell_pos.end() ); // now in C order
Expand Down

0 comments on commit 4281967

Please sign in to comment.