MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
geometryroot.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 GEOMETRYCONCEPT_H
8#define GEOMETRYCONCEPT_H
9
10#include "COMM/mpioverride.h"
11#include "INCLUDE/maiatypes.h"
12#include "UTIL/functions.h"
13
14template <MInt nDim>
15class Geometry;
16
18 public:
20
21 virtual MBool getCellIntersectingElements(const MFloat* const /*coords*/, const MFloat /*cellHalfLength*/,
22 MBool* const /* cutInfo */) {
23 mTerm(1, AT_, "only virt");
24 return 0;
25 };
26 virtual MInt countLineIntersectingElements(const MFloat* const /* line */) {
27 mTerm(1, AT_, "only virt");
28 return 0;
29 };
30 virtual void boundingBox(MFloat* const /* bbox */) { mTerm(1, AT_, "only virt"); };
31 virtual MInt noSegments() {
32 mTerm(1, AT_, "only virt");
33 return 0;
34 };
35
36 // temporary to make it work with the demand of stl elements
37 virtual void setGeometryPointer(Geometry<2>*& /* geometryPointer */) { mTerm(1, AT_, "only virt"); };
38 virtual void setGeometryPointer(Geometry<3>*& /* geometryPointer */) { mTerm(1, AT_, "only virt"); };
39
40 private:
41};
42
43template <MInt nDim>
45 public:
46 SolverSTLSurface(const MPI_Comm comm, const MInt solver);
47 MBool getCellIntersectingElements(const MFloat* const coords, const MFloat cellHalfLength, MBool* const cutInfo);
48 MInt countLineIntersectingElements(const MFloat* const line);
49 void boundingBox(MFloat* const bbox);
51 void setGeometryPointer(Geometry<nDim>*& geometryPointer) { geometryPointer = m_stlGeometry; }; // temporary
52
53 private:
55};
56
57template <MInt nDim>
59 public:
60 SolverAnalyticBoxSurface(const MFloat* const bbox);
61 MBool getCellIntersectingElements(const MFloat* const cell_coords, const MFloat cellHalfLength, MBool* const cutInfo);
62 MInt countLineIntersectingElements(const MFloat* const line);
63 void boundingBox(MFloat* const bbox);
65
66 private:
67 // just to have something here
68 MFloat m_bbox[2 * nDim];
69};
70
71template <MInt nDim>
73 public:
74 SolverAnalyticSphereSurface(const MFloat* const c, const MFloat R);
75 MBool getCellIntersectingElements(const MFloat* const cell_coords, const MFloat cellHalfLength, MBool* const cutInfo);
76 MInt countLineIntersectingElements(const MFloat* const line);
77 void boundingBox(MFloat* const bbox);
79
80 private:
81 // just to have something here
84};
85
86// hierarchic geometry concept
87
91 MInt** nodeSurfaceIds = nullptr;
92};
93
95 public:
97 GeometryBase(const MPI_Comm comm) : m_mpiComm(comm){};
98 virtual MBool isPointInside(const MFloat* const /* point */) {
99 mTerm(1, AT_, "only virt");
100 return false;
101 };
102
103 virtual MBool isPointInsideNode(const MFloat* const /* point */, const MInt /* node */) {
104 mTerm(1, AT_, "only virt");
105 return false;
106 };
107 virtual MBool getCellIntersectingSurfaces(const MFloat* const /* coords */, const MFloat /* cellHalfLength */,
108 MBool* const* const /* cutInfo */) {
109 mTerm(1, AT_, "only virt");
110 return 0;
111 };
112 virtual MBool getCellIntersectingSurfacesOfNode(const MFloat* const /* coords */, const MFloat /* cellHalfLength */,
113 MBool* const /* cutInfo */, const MInt /* node */) {
114 mTerm(1, AT_, "only virt");
115 return 0;
116 };
117
118
120
121 // The MPI communicator to be used by a node (or the root)
122 MPI_Comm m_mpiComm;
123};
124
126 public:
128 GeometryRoot(const MInt noSolvers, const MInt nDim_, const MPI_Comm comm);
129
130 template <MInt nDim>
131 void initGeometry(const MInt noSolvers);
132
133 MBool isPointInside(const MFloat* const point);
134 MBool isPointInsideNode(const MFloat* const point, const MInt node);
135 MBool getCellIntersectingSurfaces(const MFloat* const coords, const MFloat cellHalfLength,
136 MBool* const* const cutInfo);
137 MBool getCellIntersectingSurfacesOfNode(const MFloat* const coords, const MFloat cellHalfLength, MBool* const cutInfo,
138 const MInt node);
139
140 void boundingBox(MFloat* const bBox);
141 void boundingBoxOfNode(MFloat* const bBox, const MInt node);
142 MInt noSegmentsOfNode(const MInt node);
144 MInt nodeSurfaceType(const MInt node) { return m_solverSurfaceType[node]; };
145
146 // temporary
147 template <MInt nDim>
148 void setGeometryPointerToNode(Geometry<nDim>*& geometryPointer, const MInt node);
149
150 private:
152
156};
157
159 public:
160 GeometryNode(GeometryBase* geometryRoot, MInt node, MPI_Comm comm);
161
162 private:
163 // pointer to lower node (my trees dont grow in australia)
165
166 // node number (identifier) at lower node
168};
169
170#endif // GEOMETRYCONCEPT_H
GeometryDistribution m_distribution
Definition: geometryroot.h:119
MPI_Comm m_mpiComm
Definition: geometryroot.h:122
GeometryBase(const MPI_Comm comm)
Definition: geometryroot.h:97
virtual MBool isPointInside(const MFloat *const)
Definition: geometryroot.h:98
virtual MBool isPointInsideNode(const MFloat *const, const MInt)
Definition: geometryroot.h:103
virtual MBool getCellIntersectingSurfaces(const MFloat *const, const MFloat, MBool *const *const)
Definition: geometryroot.h:107
virtual MBool getCellIntersectingSurfacesOfNode(const MFloat *const, const MFloat, MBool *const, const MInt)
Definition: geometryroot.h:112
GeometryBase * m_geometry
Definition: geometryroot.h:164
SolverSurface ** m_solverSurface
Definition: geometryroot.h:155
MInt nodeSurfaceType(const MInt node)
Definition: geometryroot.h:144
MBool getCellIntersectingSurfaces(const MFloat *const coords, const MFloat cellHalfLength, MBool *const *const cutInfo)
MBool isPointInside(const MFloat *const point)
MInt noNodes()
Definition: geometryroot.h:143
MInt m_noSolverSurfaces
Definition: geometryroot.h:153
void initGeometry(const MInt noSolvers)
void boundingBox(MFloat *const bBox)
MInt noSegmentsOfNode(const MInt node)
void setGeometryPointerToNode(Geometry< nDim > *&geometryPointer, const MInt node)
MBool getCellIntersectingSurfacesOfNode(const MFloat *const coords, const MFloat cellHalfLength, MBool *const cutInfo, const MInt node)
MBool isPointInsideNode(const MFloat *const point, const MInt node)
void boundingBoxOfNode(MFloat *const bBox, const MInt node)
MInt * m_solverSurfaceType
Definition: geometryroot.h:154
MFloat m_bbox[2 *nDim]
Definition: geometryroot.h:68
MInt countLineIntersectingElements(const MFloat *const line)
void boundingBox(MFloat *const bbox)
MBool getCellIntersectingElements(const MFloat *const cell_coords, const MFloat cellHalfLength, MBool *const cutInfo)
MInt countLineIntersectingElements(const MFloat *const line)
MBool getCellIntersectingElements(const MFloat *const cell_coords, const MFloat cellHalfLength, MBool *const cutInfo)
void boundingBox(MFloat *const bbox)
MInt countLineIntersectingElements(const MFloat *const line)
MBool getCellIntersectingElements(const MFloat *const coords, const MFloat cellHalfLength, MBool *const cutInfo)
Geometry< nDim > * m_stlGeometry
Definition: geometryroot.h:54
void setGeometryPointer(Geometry< nDim > *&geometryPointer)
Definition: geometryroot.h:51
void boundingBox(MFloat *const bbox)
virtual void boundingBox(MFloat *const)
Definition: geometryroot.h:30
virtual MInt countLineIntersectingElements(const MFloat *const)
Definition: geometryroot.h:26
virtual MInt noSegments()
Definition: geometryroot.h:31
virtual void setGeometryPointer(Geometry< 3 > *&)
Definition: geometryroot.h:38
virtual MBool getCellIntersectingElements(const MFloat *const, const MFloat, MBool *const)
Definition: geometryroot.h:21
virtual void setGeometryPointer(Geometry< 2 > *&)
Definition: geometryroot.h:37
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29
int32_t MInt
Definition: maiatypes.h:62
MInt noSolvers
Definition: maiatypes.h:73
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58