From 4d801a470af5b58263f60e9efd921d4ceb142a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com> Date: Wed, 9 Feb 2022 12:11:15 +0100 Subject: [PATCH] Fix management list of constant cell ids --- src/language/utils/IntegrateOnCells.hpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/language/utils/IntegrateOnCells.hpp b/src/language/utils/IntegrateOnCells.hpp index 82a4c3242..fa47bb785 100644 --- a/src/language/utils/IntegrateOnCells.hpp +++ b/src/language/utils/IntegrateOnCells.hpp @@ -56,10 +56,10 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu class CellList { private: - const Array<CellId>& m_cell_list; + const Array<const CellId>& m_cell_list; public: - using index_type = Array<CellId>::index_type; + using index_type = Array<const CellId>::index_type; PUGS_INLINE CellId @@ -76,7 +76,7 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu } PUGS_INLINE - CellList(const Array<CellId>& cell_list) : m_cell_list{cell_list} {} + CellList(const Array<const CellId>& cell_list) : m_cell_list{cell_list} {} }; template <typename MeshType, typename OutputArrayT, typename ListTypeT> @@ -609,7 +609,7 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu integrate(const FunctionSymbolId& function_symbol_id, const IQuadratureDescriptor& quadrature_descriptor, const MeshType& mesh, - const ArrayT<CellId>& cell_list) + const ArrayT<const CellId>& cell_list) { ArrayT<OutputType> value(size(cell_list)); if (quadrature_descriptor.isTensorial()) { @@ -622,6 +622,16 @@ class IntegrateOnCells<OutputType(InputType)> : public PugsFunctionAdapter<Outpu return value; } + + template <typename MeshType, template <typename DataType> typename ArrayT> + static PUGS_INLINE ArrayT<OutputType> + integrate(const FunctionSymbolId& function_symbol_id, + const IQuadratureDescriptor& quadrature_descriptor, + const MeshType& mesh, + const ArrayT<CellId>& cell_list) + { + return integrate(function_symbol_id, quadrature_descriptor, mesh, ArrayT<const CellId>{cell_list}); + } }; #endif // INTEGRATE_ON_CELLS_HPP -- GitLab