diff --git a/src/mesh/Boundary.hpp b/src/mesh/Boundary.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e23097d5699c7966b1676ddff818b3870d981311 --- /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 83f5fb3443571d293cf34fc77e55dc857eb8efb5..b43bc0c561f14ed67333911e0b1fa670cdd23a34 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;