Merge branch 'master' of github.com:mfem/mfem into nurbs-nc

This commit is contained in:
Dylan Copeland
2025-06-27 16:22:47 -07:00
83 changed files with 5590 additions and 961 deletions
+14
View File
@@ -15,6 +15,7 @@
#include "array.hpp"
#include "../general/forall.hpp"
#include <fstream>
#include <type_traits>
namespace mfem
{
@@ -110,6 +111,19 @@ void Array<T>::PartialSum()
}
}
template <class T>
void Array<T>::Abs()
{
static_assert(std::is_arithmetic<T>::value, "Use with arithmetic types!");
const bool useDevice = UseDevice();
const int N = size;
auto y = ReadWrite(useDevice);
mfem::forall_switch(useDevice, N, [=] MFEM_HOST_DEVICE (int i)
{
y[i] = std::abs(y[i]);
});
}
// Sum
template <class T>
T Array<T>::Sum() const