Gyselalib++
 
Loading...
Searching...
No Matches
interface.hpp
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include <ddc/ddc.hpp>
6
7#include "edge.hpp"
8
19template <class Edge1Type, class Edge2Type, bool orientations_agree_bool>
21{
22 static_assert(
23 !std::is_same_v<Edge1Type, OutsideEdge> || !std::is_same_v<Edge2Type, OutsideEdge>,
24 "At least one edge should belong to a patch.");
25
27 using Edge1 = Edge1Type;
29 using Edge2 = Edge2Type;
30
35 template <
36 class Edge,
37 class = std::enable_if_t<std::is_same_v<Edge, Edge1> || std::is_same_v<Edge, Edge2>>>
38 using OtherEdge = std::conditional_t<std::is_same_v<Edge, Edge1>, Edge2, Edge1>;
39
45 static constexpr bool orientations_agree = orientations_agree_bool;
46
52 template <class Patch>
53 static constexpr bool connected_to_patch()
54 {
55 if constexpr (std::is_same_v<Edge1, OutsideEdge>) {
56 return std::is_same_v<typename Edge2::associated_patch, Patch>;
57 } else if constexpr (std::is_same_v<Edge2, OutsideEdge>) {
58 return std::is_same_v<typename Edge1::associated_patch, Patch>;
59 } else {
60 return (std::is_same_v<typename Edge1::associated_patch, Patch>)
61 || (std::is_same_v<typename Edge2::associated_patch, Patch>);
62 }
63 }
64};
Define an edge of a given patch.
Definition edge.hpp:25
Represent a simple sticking of two edges.
Definition interface.hpp:21
Edge1Type Edge1
Edge type of the first patch.
Definition interface.hpp:27
Edge2Type Edge2
Edge type of the second patch.
Definition interface.hpp:29
std::conditional_t< std::is_same_v< Edge, Edge1 >, Edge2, Edge1 > OtherEdge
A tool to get the other edge of an interface.
Definition interface.hpp:38
static constexpr bool connected_to_patch()
A compile-time function to check if an interface is on the edge of a given patch.
Definition interface.hpp:53
static constexpr bool orientations_agree
If True, the parametrisations of the physical edge have the same orientation.
Definition interface.hpp:45