33 enum class GhostType { None, Periodic, Reflective };
36 GhostType ghost_type_x;
37 GhostType ghost_type_y;
38 GhostType ghost_type_z;
41 template<
class Tgr
idVec>
45 TgridVec box_size = sim_box.
upper - sim_box.
lower;
46 TgridVec box_center = (sim_box.
upper + sim_box.
lower) / 2;
52 = {box_center - box_size / 2, box_center + box_size / 2};
53 if (new_box != sim_box) {
55 "Rebuilding AABB from size and center gives a different AABB");
62 mode.ghost_type_x == GhostType::Periodic,
63 mode.ghost_type_y == GhostType::Periodic,
64 mode.ghost_type_z == GhostType::Periodic};
68 void for_each_paving_tile(GhostLayerGenMode mode, Func &&func) {
71 i32 repetition_x = mode.ghost_type_x != GhostType::None;
72 i32 repetition_y = mode.ghost_type_y != GhostType::None;
73 i32 repetition_z = mode.ghost_type_z != GhostType::None;
75 for (
i32 xoff = -repetition_x; xoff <= repetition_x; xoff++) {
76 for (
i32 yoff = -repetition_y; yoff <= repetition_y; yoff++) {
77 for (
i32 zoff = -repetition_z; zoff <= repetition_z; zoff++) {
78 func(xoff, yoff, zoff);
90 template<
class Tgr
idVec>
106 &ghost_layers_candidates;
109 inline void set_edges(
116 ghost_layers_candidates) {
121 inline Edges get_edges() {
123 get_ro_edge<shamrock::solvergraph::IDataEdge<std::vector<u64>>>(0),
125 get_ro_edge<shamrock::solvergraph::SerialPatchTreeRefEdge<TgridVec>>(2),
127 get_rw_edge<shamrock::solvergraph::DDSharedScalar<GhostLayerCandidateInfos>>(0),
133 inline virtual std::string
_impl_get_label()
const {
return "FindGhostLayerCandidates"; };
Shared distributed data layer for patch data management in solver graphs.
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
std::int32_t i32
32 bit integer
#define SHAM_ASSERT(x)
Shorthand for SHAM_ASSERT_NAMED without a message.
virtual std::string _impl_get_label() const
get the label of the node
void _impl_evaluate_internal()
evaluate the node
virtual std::string _impl_get_tex() const
get the tex of the node
Inode is node between data edges, takes multiple inputs, multiple outputs.
void __internal_set_rw_edges(std::vector< std::shared_ptr< IEdge > > new_rw_edges)
Set the read write edges.
void __internal_set_ro_edges(std::vector< std::shared_ptr< IEdge > > new_ro_edges)
Set the read only edges.
const T & get_ro_edge(int slot)
Get a read only edge and cast it to the type T.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
namespace for the basegodunov model modules
Axis-Aligned bounding box.
bool is_volume_not_null() const noexcept
Checks if the AABB has a non-zero volume.
T lower
Lower bound of the AABB.
T upper
Upper bound of the AABB.
A structure for 3D paving functions with general boundary conditions (periodic or reflective per dire...