Skip to content
Open

Vtk hdf #1084

Show file tree
Hide file tree
Changes from 1 commit
Commits
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: 3 additions & 0 deletions pyphare/pyphare/pharein/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ def as_paths(rb):
)

if len(simulation.diagnostics) > 0:
if simulation.diag_options is not None and "format" in simulation.diag_options:
add_string(diag_path + "format", simulation.diag_options["format"])

if simulation.diag_options is not None and "options" in simulation.diag_options:
add_string(
diag_path + "filePath", simulation.diag_options["options"]["dir"]
Expand Down
2 changes: 1 addition & 1 deletion pyphare/pyphare/pharein/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def check_directory(directory, key):
# diag_options = {"format":"phareh5", "options": {"dir": "phare_ouputs/"}}
def check_diag_options(**kwargs):
diag_options = kwargs.get("diag_options", None)
formats = ["phareh5"]
formats = ["phareh5", "pharevtkhdf"]
if diag_options is not None and "format" in diag_options:
if diag_options["format"] not in formats:
raise ValueError("Error - diag_options format is invalid")
Expand Down
3 changes: 3 additions & 0 deletions pyphare/pyphare/pharesee/__init__.py
Original file line number Diff line number Diff line change
@@ -1,0 +1,3 @@
from . import tovtk

__all__ = ["tovtk"]
10 changes: 5 additions & 5 deletions src/amr/physical_models/hybrid_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ class HybridModel : public IPhysicalModel<AMR_Types>
using Interface = IPhysicalModel<AMR_Types>;
using amr_types = AMR_Types;
using electrons_t = Electrons;
using patch_t = typename AMR_Types::patch_t;
using level_t = typename AMR_Types::level_t;
using patch_t = AMR_Types::patch_t;
using level_t = AMR_Types::level_t;
using gridlayout_type = GridLayoutT;
using electromag_type = Electromag;
using vecfield_type = typename Electromag::vecfield_type;
using field_type = typename vecfield_type::field_type;
using vecfield_type = Electromag::vecfield_type;
using field_type = vecfield_type::field_type;
using grid_type = Grid_t;
using ions_type = Ions;
using particle_array_type = typename Ions::particle_array_type;
using particle_array_type = Ions::particle_array_type;
using resources_manager_type = amr::ResourcesManager<gridlayout_type, grid_type>;
using ParticleInitializerFactory
= core::ParticleInitializerFactory<particle_array_type, gridlayout_type>;
Expand Down
2 changes: 1 addition & 1 deletion src/amr/resources_manager/amr_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace amr
iLevel++)
{
visitLevel<GridLayout>(*hierarchy.getPatchLevel(iLevel), resman,
std::forward<Action>(action), std::forward<Args...>(args...));
std::forward<Action>(action), std::forward<Args>(args)...);
}
}

Expand Down
29 changes: 29 additions & 0 deletions src/core/data/grid/gridlayout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,10 @@ namespace core
return GridLayoutImpl::centering(hybridQuantity);
}

NO_DISCARD constexpr static auto centering(auto const& hasQuantity)
{
return centering(hasQuantity.physicalQuantity());
}
Comment on lines +882 to +885
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove ambiguous overload.

This unconstrained centering(auto const& hasQuantity) overload conflicts with the constrained template overload at lines 894-899. For any type with a physicalQuantity() method, both overloads are viable, and the compiler will reject the call as ambiguous since neither is more specialized than the other.

Remove this overload; the constrained version at lines 894-899 already handles all types with physicalQuantity():

-        NO_DISCARD constexpr static auto centering(auto const& hasQuantity)
-        {
-            return centering(hasQuantity.physicalQuantity());
-        }
-
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
NO_DISCARD constexpr static auto centering(auto const& hasQuantity)
{
return centering(hasQuantity.physicalQuantity());
}
🤖 Prompt for AI Agents
In src/core/data/grid/gridlayout.hpp around lines 882-885, remove the
unconstrained NO_DISCARD constexpr static auto centering(auto const&
hasQuantity) overload because it conflicts with the constrained template
overload at lines 894-899; delete the entire ambiguous overload so calls will
resolve to the constrained version that already handles types exposing
physicalQuantity(), then rebuild to ensure no remaining ambiguities.


NO_DISCARD constexpr static std::array<std::array<QtyCentering, dimension>, 6>
centering(HybridQuantity::Tensor hybridQuantity)
Expand Down Expand Up @@ -1027,6 +1031,29 @@ namespace core



/**
* @brief BxToMoments return the indexes and associated coef to compute the linear
* interpolation necessary to project Bx onto moments.
*/
NO_DISCARD auto static constexpr BxToMoments() { return GridLayoutImpl::BxToMoments(); }


/**
* @brief ByToMoments return the indexes and associated coef to compute the linear
* interpolation necessary to project By onto moments.
*/
NO_DISCARD auto static constexpr ByToMoments() { return GridLayoutImpl::ByToMoments(); }


/**
* @brief BzToMoments return the indexes and associated coef to compute the linear
* interpolation necessary to project Bz onto moments.
*/
NO_DISCARD auto static constexpr BzToMoments() { return GridLayoutImpl::BzToMoments(); }




/**
* @brief ExToMoments return the indexes and associated coef to compute the linear
* interpolation necessary to project Ex onto moments.
Expand Down Expand Up @@ -1181,6 +1208,8 @@ namespace core
}));
}



template<typename Field, typename Fn>
void evalOnBox(Field& field, Fn&& fn) const
{
Expand Down
6 changes: 3 additions & 3 deletions src/core/data/grid/gridlayoutdefs.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef PHARE_CORE_GRID_GRIDLAYOUTDEFS_HPP
#define PHARE_CORE_GRID_GRIDLAYOUTDEFS_HPP

#include <cstddef>

#include "core/hybrid/hybrid_quantities.hpp"
#include "core/utilities/types.hpp"
#include "core/utilities/point/point.hpp"
#include "core/hybrid/hybrid_quantities.hpp"

#include <cstddef>

namespace PHARE
{
Expand Down
Loading
Loading