From 3670e02d416fb68a679378ac764c20649ac525a7 Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Tue, 22 May 2018 19:21:21 +0200 Subject: [PATCH] Begining of Boundary definition --- src/mesh/Boundary.hpp | 44 ++++++++++++++++++++++++++++++++ src/scheme/BoundaryCondition.hpp | 12 +++++---- 2 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 src/mesh/Boundary.hpp diff --git a/src/mesh/Boundary.hpp b/src/mesh/Boundary.hpp new file mode 100644 index 000000000..e23097d56 --- /dev/null +++ b/src/mesh/Boundary.hpp @@ -0,0 +1,44 @@ +#ifndef BOUNDARY_HPP +#define BOUNDARY_HPP + +#include <Kokkos_Core.hpp> +#include <RefId.hpp> + +class Boundary +{ + private: + RefId m_ref_id; + Kokkos::View<unsigned int*> m_face_list; + Kokkos::View<unsigned int*> m_node_list; + + public: + const RefId& refId() const + { + return m_ref_id; + } + + const Kokkos::View<const unsigned int*> faceList() const + { + return m_face_list; + } + + const Kokkos::View<const unsigned int*> nodeList() const + { + return m_node_list; + } + + Boundary(const RefId& ref_id, + Kokkos::View<unsigned int*> face_list) + : m_ref_id(ref_id), + m_face_list(face_list) + { + ; + } + + ~Boundary() + { + ; + } +}; + +#endif // BOUNDARY_HPP diff --git a/src/scheme/BoundaryCondition.hpp b/src/scheme/BoundaryCondition.hpp index 83f5fb344..b43bc0c56 100644 --- a/src/scheme/BoundaryCondition.hpp +++ b/src/scheme/BoundaryCondition.hpp @@ -4,6 +4,8 @@ #include <vector> #include <memory> +#include <Kokkos_Core.hpp> + class BoundaryCondition { public: @@ -58,14 +60,14 @@ public: } PressureBoundaryCondition(const double& value, - const std::vector<unsigned int>& faces) + const std::vector<unsigned int>& faces) : BoundaryCondition(BoundaryCondition::pressure), m_value(value), m_number_of_faces(faces.size()), m_face_list("faces_list", m_number_of_faces) { Kokkos::parallel_for(m_number_of_faces, KOKKOS_LAMBDA(const int& f){ - m_face_list[f]=faces[f]; + m_face_list[f]=faces[f]; }); } @@ -98,13 +100,13 @@ public: } SymmetryBoundaryCondition(const std::vector<unsigned int>& nodes, - const Rd& outgoing_normal) + const Rd& outgoing_normal) : BoundaryCondition(BoundaryCondition::symmetry), m_node_list("node_list", nodes.size()), m_outgoing_normal(outgoing_normal) { Kokkos::parallel_for(m_node_list.size(), KOKKOS_LAMBDA(const int& f){ - m_node_list[f]=nodes[f]; + m_node_list[f]=nodes[f]; }); } @@ -121,7 +123,7 @@ public: { return *m_boundary_condition; } - + KOKKOS_INLINE_FUNCTION BoundaryConditionHandler& operator=(BoundaryConditionHandler&) = default; -- GitLab