diff --git a/include/pressiodemoapps/impl/custom_bc_holder.hpp b/include/pressiodemoapps/impl/custom_bc_holder.hpp index 99fec170..bf42c016 100644 --- a/include/pressiodemoapps/impl/custom_bc_holder.hpp +++ b/include/pressiodemoapps/impl/custom_bc_holder.hpp @@ -86,6 +86,22 @@ struct CustomBCsHolder } } + template + void setInternalPointer(GhostRelativeLocation rloc, T* ptr) { + if (rloc == GhostRelativeLocation::Left){ + m_funcLeft.setInternalPtr(ptr); + } + else if (rloc == GhostRelativeLocation::Front){ + m_funcFront.setInternalPtr(ptr); + } + else if (rloc == GhostRelativeLocation::Right){ + m_funcRight.setInternalPtr(ptr); + } + else if (rloc == GhostRelativeLocation::Back) { + m_funcBack.setInternalPtr(ptr); + } + } + private: FuncLeftT m_funcLeft; FuncFrontT m_funcFront; @@ -119,6 +135,22 @@ struct CustomBCsHolder } } + template + void setInternalPointer(GhostRelativeLocation rloc, T* ptr) { + if (rloc == GhostRelativeLocation::Left){ + m_funcLeft.setInternalPtr(ptr); + } + else if (rloc == GhostRelativeLocation::Front){ + m_funcFront.setInternalPtr(ptr); + } + else if (rloc == GhostRelativeLocation::Right){ + m_funcRight.setInternalPtr(ptr); + } + else if (rloc == GhostRelativeLocation::Back) { + m_funcBack.setInternalPtr(ptr); + } + } + private: std::reference_wrapper m_funcLeft; std::reference_wrapper m_funcFront; diff --git a/include/pressiodemoapps/impl/euler_2d_prob_class.hpp b/include/pressiodemoapps/impl/euler_2d_prob_class.hpp index 3c4ed3e4..e2d854dc 100644 --- a/include/pressiodemoapps/impl/euler_2d_prob_class.hpp +++ b/include/pressiodemoapps/impl/euler_2d_prob_class.hpp @@ -67,6 +67,7 @@ #include "mixin_directional_flux_balance_jacobian.hpp" #include "Eigen/Sparse" #include "custom_bcs_functions.hpp" +#include "ghost_relative_locations.hpp" #ifdef PRESSIODEMOAPPS_ENABLE_OPENMP #include @@ -173,6 +174,12 @@ class EigenApp return initialConditionImpl(); } +public: + template + void setBCPointer(::pressiodemoapps::impl::GhostRelativeLocation rloc, T* ptr) { + m_bcFuncsHolder.setInternalPointer(rloc, ptr); + } + protected: int numDofPerCellImpl() const { return numDofPerCell; diff --git a/include/pressiodemoapps/impl/swe_2d_prob_class.hpp b/include/pressiodemoapps/impl/swe_2d_prob_class.hpp index 59ec1274..493571df 100644 --- a/include/pressiodemoapps/impl/swe_2d_prob_class.hpp +++ b/include/pressiodemoapps/impl/swe_2d_prob_class.hpp @@ -62,6 +62,7 @@ #include "mixin_directional_flux_balance_jacobian.hpp" #include "Eigen/Sparse" #include "custom_bcs_functions.hpp" +#include "ghost_relative_locations.hpp" #ifdef PRESSIODEMOAPPS_ENABLE_OPENMP #include @@ -167,6 +168,12 @@ class EigenApp return initialState; } +public: + template + void setBCPointer(::pressiodemoapps::impl::GhostRelativeLocation rloc, T* ptr) { + m_bcFuncsHolder.setInternalPointer(rloc, ptr); + } + protected: int numDofPerCellImpl() const { return numDofPerCell;