diff --git a/src/language/utils/IntegrateOnCells.hpp b/src/language/utils/IntegrateOnCells.hpp index 82a4c3242aff86d2b719dde80035dd72cf8fef89..fa47bb7856ec695d87d7702d9c561a2ebfe6ca6b 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