Loading [MathJax]/extensions/tex2jax.js
MAIA bb96820c
Multiphysics at AIA
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
geometryadt.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef GEOMETRYADT_H
8#define GEOMETRYADT_H
9
10#include <array>
11#include <stack>
12#include <vector>
14#include "INCLUDE/maiatypes.h"
15#include "config.h"
16#include "geometryelement.h"
17
18template <MInt nDim>
19class GeometryElement;
20
38namespace sortFunctions {
39// Function objects for sorting the elements
40template <MInt nDim>
41struct lessMinMax {
43 lessMinMax(const MInt dir, const element* const elements) : m_dir(dir), m_elements(elements) {}
44
46
47 private:
48 const MInt m_dir = -1;
49 const element* const m_elements = nullptr;
50};
51} // namespace sortFunctions
52
53template <MInt nDim>
54class Geometry;
55class GeometryAdtNode;
56
57template <MInt nDim>
59 public:
61 std::array<MFloat, 2 * nDim> m_minMax{};
63 std::array<MFloat, 2 * nDim> m_mbminMax{};
64
65 protected:
68
69 public:
70 explicit GeometryAdt(const Geometry<nDim>* geometry);
71
73 void buildTree();
74 void buildTreeOld();
75 void buildTreeNew();
76 void writeTreeToDx();
77 void retrieveNodes(MFloat* targetRegion, std::vector<MInt>& nodeList) const;
78
79 void splitTree(MInt noSubTrees);
80
81 void buildTreeMB();
82 void retrieveNodesMBElements(const MFloat* targetRegion, std::vector<MInt>& nodeList) const;
83
84 MInt get_root();
85
87
88 private:
89 void writeNode(MInt node);
90};
91
92#endif
void retrieveNodes(MFloat *targetRegion, std::vector< MInt > &nodeList) const
retrieves the nodes that intersect with a given target bounding box
void retrieveNodesMBElements(const MFloat *targetRegion, std::vector< MInt > &nodeList) const
GeometryAdtNode * m_mbnodes
Definition: geometryadt.h:62
std::array< MFloat, 2 *nDim > m_mbminMax
Definition: geometryadt.h:63
std::array< MFloat, 2 *nDim > m_minMax
Definition: geometryadt.h:61
void writeTreeToDx()
void buildTreeNew()
void buildTree()
Create an ADT from the geometry.
Definition: geometryadt.cpp:46
GeometryAdtNode * m_nodes
Definition: geometryadt.h:60
void buildTreeMB()
void splitTree(MInt noSubTrees)
MLong memoryUsage()
Definition: geometryadt.cpp:51
void buildTreeOld()
Definition: geometryadt.cpp:56
const Geometry< nDim > * m_geometry
Definition: geometryadt.h:67
void writeNode(MInt node)
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
int64_t MLong
Definition: maiatypes.h:64
bool MBool
Definition: maiatypes.h:58
Definition: contexttypes.h:19
MBool operator()(const MInt a, const MInt b)
Definition: geometryadt.h:45
lessMinMax(const MInt dir, const element *const elements)
Definition: geometryadt.h:43
const element *const m_elements
Definition: geometryadt.h:49