-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hierarchy views #787
hierarchy views #787
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,8 +14,8 @@ namespace amr | |||||
template<typename ResourcesUser, typename GridLayoutT> | ||||||
struct UserFieldType | ||||||
{ | ||||||
using patch_data_type = FieldData<GridLayoutT, typename ResourcesUser::field_type>; | ||||||
using variable_type = FieldVariable<GridLayoutT, typename ResourcesUser::field_type>; | ||||||
using patch_data_type = FieldData<GridLayoutT, typename ResourcesUser::grid_type>; | ||||||
using variable_type = FieldVariable<GridLayoutT, typename ResourcesUser::grid_type>; | ||||||
using internal_type_ptr = typename ResourcesUser::field_type*; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The - using internal_type_ptr = typename ResourcesUser::field_type*;
+ using internal_type_ptr = typename ResourcesUser::grid_type*; Committable suggestion
Suggested change
|
||||||
}; | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,6 +12,21 @@ | |||||||||||||
#include "amr/physical_models/physical_model.hpp" | ||||||||||||||
#include "core/def.hpp" | ||||||||||||||
|
||||||||||||||
namespace PHARE::solver | ||||||||||||||
{ | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
class ISolverModelView | ||||||||||||||
{ | ||||||||||||||
public: | ||||||||||||||
using This = ISolverModelView; | ||||||||||||||
|
||||||||||||||
virtual ~ISolverModelView() = default; | ||||||||||||||
}; | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
} // namespace PHARE::solver | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
|
||||||||||||||
namespace PHARE | ||||||||||||||
|
@@ -29,6 +44,10 @@ namespace solver | |||||||||||||
class ISolver | ||||||||||||||
{ | ||||||||||||||
public: | ||||||||||||||
using patch_t = typename AMR_Types::patch_t; | ||||||||||||||
using level_t = typename AMR_Types::level_t; | ||||||||||||||
using hierarchy_t = typename AMR_Types::hierarchy_t; | ||||||||||||||
|
||||||||||||||
/** | ||||||||||||||
* @brief return the name of the ISolver | ||||||||||||||
*/ | ||||||||||||||
|
@@ -67,8 +86,8 @@ namespace solver | |||||||||||||
/** | ||||||||||||||
* @brief advanceLevel advances the given level from t to t+dt | ||||||||||||||
*/ | ||||||||||||||
virtual void advanceLevel(std::shared_ptr<SAMRAI::hier::PatchHierarchy> const& hierarchy, | ||||||||||||||
int const levelNumber, IPhysicalModel<AMR_Types>& model, | ||||||||||||||
virtual void advanceLevel(hierarchy_t const& hierarchy, int const levelNumber, | ||||||||||||||
ISolverModelView& view, | ||||||||||||||
amr::IMessenger<IPhysicalModel<AMR_Types>>& fromCoarser, | ||||||||||||||
const double currentTime, const double newTime) | ||||||||||||||
= 0; | ||||||||||||||
|
@@ -80,7 +99,7 @@ namespace solver | |||||||||||||
* @brief allocate is used to allocate ISolver variables previously registered to the | ||||||||||||||
* ResourcesManager of the given model, onto the given Patch, at the given time. | ||||||||||||||
*/ | ||||||||||||||
virtual void allocate(IPhysicalModel<AMR_Types>& model, SAMRAI::hier::Patch& patch, | ||||||||||||||
virtual void allocate(IPhysicalModel<AMR_Types>& model, patch_t& patch, | ||||||||||||||
double const allocateTime) const = 0; | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
|
@@ -89,6 +108,9 @@ namespace solver | |||||||||||||
virtual ~ISolver() = default; | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
virtual std::shared_ptr<ISolverModelView> make_view(level_t&, IPhysicalModel<AMR_Types>&) | ||||||||||||||
= 0; | ||||||||||||||
|
||||||||||||||
protected: | ||||||||||||||
explicit ISolver(std::string name) | ||||||||||||||
: solverName{std::move(name)} | ||||||||||||||
Comment on lines
115
to
116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The - std::string solverName;
+ protected:
+ std::string solverName; Committable suggestion
Suggested change
|
||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't super sure of the point of the level descriptor system here so I didn't use it.
That might very well be an issue for future usage with varying solvers between levels, tbc