Select Git revision
-
Stéphane Del Pino authoredStéphane Del Pino authored
Mesh.hpp 1.16 KiB
#ifndef MESH_HPP
#define MESH_HPP
#include <Kokkos_Core.hpp>
#include <TinyVector.hpp>
template <typename ConnectivityType>
class Mesh
{
public:
typedef ConnectivityType Connectivity;
static constexpr size_t dimension = ConnectivityType::dimension;
typedef TinyVector<dimension> Rd;
private:
const Connectivity& m_connectivity;
Kokkos::View<Rd*> m_xr;
public:
const Connectivity& connectivity() const
{
return m_connectivity;
}
const size_t& numberOfNodes() const
{
return m_connectivity.numberOfNodes();
}
const size_t& numberOfFaces() const
{
return m_connectivity.numberOfFaces();
}
const size_t& numberOfCells() const
{
return m_connectivity.numberOfCells();
}
#warning PASSER CES NOUVEAUX VECTEURS EN CONST
Kokkos::View<Rd*> xr() const
{
return m_xr;
}
Mesh(const Connectivity& connectivity)
: m_connectivity(connectivity),
m_xr("xr", connectivity.numberOfNodes())
{
const double delta_x = 1./connectivity.numberOfCells();
Kokkos::parallel_for(connectivity.numberOfNodes(), KOKKOS_LAMBDA(const int& r){
m_xr[r][0] = r*delta_x;
});
}
~Mesh()
{
;
}
};
#endif // MESH_HPP