MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
geometry2d.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 GEOMETRY2D_H
8#define GEOMETRY2D_H
9
10#include "geometry.h"
11
15class Geometry2D : public Geometry<2> {
16 public:
17 Geometry2D(const MInt solverId_, const MPI_Comm comm);
18 Geometry2D(const MInt solverId_, const MString filename, const MPI_Comm comm);
20
21 virtual MInt getLineIntersectionElements(MFloat* targetRegion, std::vector<MInt>& nodeList);
22 virtual MInt getLineIntersectionElementsOld1(MFloat* targetRegion, std::vector<MInt>& nodeList);
23 virtual MInt getLineIntersectionElementsOld2(MFloat* targetRegion, MInt* spaceDirection, std::vector<MInt>& nodeList);
24 virtual MInt getIntersectionElements(MFloat* targetRegion, std::vector<MInt>& nodeList);
25 virtual MInt getIntersectionElements(MFloat* targetRegion, std::vector<MInt>& nodeList, MFloat cellHalfLength,
26 const MFloat* const cell_coords);
27 virtual MBool edgeTriangleIntersection(MFloat* trianglePoint1, MFloat* trianglePoint2, MFloat* trianglePoint3,
28 MFloat* edgePoint1, MFloat* edgePoint2);
29
30 virtual MInt getIntersectionMBElements(MFloat* targetRegion, std::vector<MInt>& nodeList);
31 virtual MInt getLineIntersectionMBElements(MFloat* targetRegion, std::vector<MInt>& nodeList);
32 virtual MInt getSphereIntersectionMBElements(MFloat* P, MFloat radius, std::vector<MInt>& nodeList);
33 virtual void MoveAllMBElementVertex(MFloat* dx);
34 virtual void MoveMBElementVertex(MInt e, MInt v, MFloat* dx);
35 virtual void ReplaceMBElementVertex(MInt e, MInt v, MFloat* np);
36 virtual void UpdateMBNormalVector(MInt /*e*/){};
37 virtual void UpdateMBBoundingBox();
38 virtual void UpdateADT();
39
40 protected:
41 virtual void readSegments();
42 inline void countSegmentLinesASCII(const MString& fileName, MInt* noElements);
43 inline void readSegmentLinesASCII(MString fileName, Collector<element<2>>* elemCollector, MInt bndCndId,
44 MInt segmentId, MInt* offset);
46
51
52 static constexpr const MInt nDim = 2;
53};
54
55template <>
56struct GeometryXD<2> {
58};
59
60#endif
void readSegmentLinesASCII(MString fileName, Collector< element< 2 > > *elemCollector, MInt bndCndId, MInt segmentId, MInt *offset)
reads the lines in an ASCII file
virtual MBool edgeTriangleIntersection(MFloat *trianglePoint1, MFloat *trianglePoint2, MFloat *trianglePoint3, MFloat *edgePoint1, MFloat *edgePoint2)
Determine intersection between an edge and a triangle (in 2D between 2 edges)
Definition: geometry2d.cpp:604
MBool m_GFieldInitFromSTL
Definition: geometry2d.h:47
virtual MInt getLineIntersectionElementsOld1(MFloat *targetRegion, std::vector< MInt > &nodeList)
Definition: geometry2d.cpp:679
virtual MInt getIntersectionMBElements(MFloat *targetRegion, std::vector< MInt > &nodeList)
Definition: geometry2d.cpp:688
virtual void ReplaceMBElementVertex(MInt e, MInt v, MFloat *np)
Definition: geometry2d.cpp:970
void calculateBoundingBox()
Calculates the global bounding box of the geometry.
static constexpr const MInt nDim
Definition: geometry2d.h:52
MInt m_noLevelSetIntfBndIds
Definition: geometry2d.h:50
virtual void MoveAllMBElementVertex(MFloat *dx)
Definition: geometry2d.cpp:950
virtual void UpdateMBNormalVector(MInt)
Definition: geometry2d.h:36
virtual MInt getSphereIntersectionMBElements(MFloat *P, MFloat radius, std::vector< MInt > &nodeList)
Definition: geometry2d.cpp:883
virtual MInt getLineIntersectionMBElements(MFloat *targetRegion, std::vector< MInt > &nodeList)
Definition: geometry2d.cpp:856
virtual void UpdateMBBoundingBox()
Definition: geometry2d.cpp:977
MInt m_levelSetIntfBndId
Definition: geometry2d.h:48
virtual void readSegments()
Definition: geometry2d.cpp:141
virtual void UpdateADT()
Definition: geometry2d.cpp:997
virtual MInt getLineIntersectionElementsOld2(MFloat *targetRegion, MInt *spaceDirection, std::vector< MInt > &nodeList)
Definition: geometry2d.cpp:683
virtual MInt getLineIntersectionElements(MFloat *targetRegion, std::vector< MInt > &nodeList)
Returns the ids of all elements, cut by a orthogonal line (or rectangular region)
Definition: geometry2d.cpp:654
virtual void MoveMBElementVertex(MInt e, MInt v, MFloat *dx)
Definition: geometry2d.cpp:962
void countSegmentLinesASCII(const MString &fileName, MInt *noElements)
counts the number of lines in an ASCII file, should be the in the first line
MInt * m_levelSetIntfBndIds
Definition: geometry2d.h:49
virtual MInt getIntersectionElements(MFloat *targetRegion, std::vector< MInt > &nodeList)
Determines all elements that are inside or intersect the target region.
Definition: geometry2d.cpp:432
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58