MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fcbndrycnd.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 FCBNDRYCND_H
8#define FCBNDRYCND_H
9
10#include <map>
11#include <vector>
16#include "INCLUDE/maiamacro.h"
17#include "INCLUDE/maiatypes.h"
18#include "IO/parallelio.h"
19#include "compiler_config.h"
20#include "fccellcollector.h"
21#include "fcdescriptor.h"
22
23template <MInt nDim>
24class FcSolver;
25template <class T>
26class Collector;
27template <MInt nDim>
28class CartesianGrid;
29template <MInt nDim>
30class FcGridBndryCell;
31
32
33template <MInt nDim>
35 public:
36 template <MInt nDim_>
37 friend class FcSolver;
38
40 // Type for cell properties
41 using Cell = GridCell;
44
45 protected:
47 std::vector<FcGridBndryCell<nDim>> m_bndryCells;
48
52 typedef void (FcBndryCnd::*BndryCndHandler)(MInt set);
55
58
59 std::vector<MInt> m_bndryCndIds; // Holds the different BC ids
60 std::vector<MInt> m_bndryCndOffsets; // stores the starting positions
61
62 std::vector<MInt> m_bndryCndSegIds; // Holds the different segment ids
63 std::vector<MInt> m_mapBndryCndSegId2Index; // maps global segmentId to local index (-1 if not available)
64
66
67 MInt m_noSegments{}; // the number of all segments
69
71 // Basic
74
75 // TIMERS
77
80
81 public:
83
84 virtual ~FcBndryCnd();
85
89
90 void initBndryCnds();
91 void setBndryCndHandler();
92 void setBndryCndHandlerMb(MInt* bcTypeList);
94 void sortBoundaryCells();
95 void updateSystemMatrix();
96 void updateForceVector();
98 void calcReactionForces();
100 void calculateCutPoints();
101 void calcAvgFaceNormal(MInt index);
102 void setBoundaryStlElements(std::vector<std::vector<MFloat>> cutPointList, MFloat* normal, MInt segId, MInt i);
103 void writeOutSTLBoundaries(MInt index, MString prefix);
105 const MInt subCellLvl, MFloat* subCellParentCoord, const MInt childPos, const MInt pCellId, MFloat** Ke);
107
108 std::vector<std::vector<MFloat>> createTrianglesFromCutPoints(std::vector<std::vector<MFloat>> cutPointList,
109 MFloat* triangleNormal);
110 std::vector<std::vector<MFloat>> createEdgesFromCutPoints(std::vector<std::vector<MFloat>> cutPointList);
111 MFloat solveIntegrationOnTriangle(std::vector<MFloat> trianglePoints, MFloat* triangleNormal);
112 MBool pointInTriangle(MFloat* A, MFloat* B, MFloat* C, std::vector<MFloat> P);
113 void refineTriangle(MInt index);
114 void getStlNodeList(const MInt cellId, std::vector<MInt>& nodeList);
115 // Specific boundary conditions
116 // Each boundary condition has additional properties,
117 // they carry the number of the boundary condition
118 // in their names (BC.0, BC.1, ...)
119
120 // Dummy bc
121 virtual void bc0(MInt index);
122
123 // Fixation bc
124 void bc8010(MInt index); // constraint fixation
125 void bc8011(MInt index); // constraint fixation
126 void bc8012(MInt index); // constraint fixation
127
128 // Displacement bc
129 void bc8020(MInt index); // constraint displacement
130
131 // Surface tensions bc
132 void bc8030(MInt index); // imposed loads
133
134 // Surface tensions bc
135 void bc8031(MInt index); // imposed loads
136 void bc8032(MInt index); // imposed loads
137 void bc8035(MInt index); // imposed loads
138
139 // Surface tensions bc
140 void bc8040(MInt index); // imposed loads
141};
142
143#endif
GridCell
Grid cell Property Labels.
MBool m_multiBC
Definition: fcbndrycnd.h:73
void setBndryCndHandler()
This function sets the BndryCndHandler objects at solver setup \adaptation 22.04.2021,...
Definition: fcbndrycnd.cpp:464
void sortBoundaryCells()
This function sorts the boundary cells according to the BC id.
Definition: fcbndrycnd.cpp:405
void bc8030(MInt index)
This function applies the loads boundary condition.
Definition: fcbndrycnd.cpp:827
MInt * m_noBndryCellsPerSegment
Definition: fcbndrycnd.h:68
void createBoundaryCells()
Creates boundary cells according to the geometry information.
Definition: fcbndrycnd.cpp:322
std::vector< MInt > m_bndryCndOffsets
Definition: fcbndrycnd.h:60
MInt m_solverId
Definition: fcbndrycnd.h:56
void updateForceVector()
Execution of the force boundary conditions.
void setBndryCndHandlerMb(MInt *bcTypeList)
void initBndryCnds()
Initializes boundary cells.
Definition: fcbndrycnd.cpp:133
void writeOutSTLBoundaries(MInt index, MString prefix)
Write out the boundary segments in stl-file format.
std::vector< FcGridBndryCell< nDim > > m_bndryCells
Definition: fcbndrycnd.h:47
void writeOutModifiedBoundaries()
Write out the boundary segments in stl-file format.
MInt m_t_BCAll
Definition: fcbndrycnd.h:76
void bc8011(MInt index)
This function applies the fixation boundary condition.
Definition: fcbndrycnd.cpp:610
BndryCndHandler * bndryCndHandlerForce
Definition: fcbndrycnd.h:54
BndryCndHandler * bndryCndHandlerSystemMatrix
Definition: fcbndrycnd.h:53
std::vector< std::vector< MFloat > > createEdgesFromCutPoints(std::vector< std::vector< MFloat > > cutPointList)
Calculation of the surface edges.
List< MInt > * m_sortedBndryCells
Definition: fcbndrycnd.h:87
void bc8031(MInt index)
This function applies the loads boundary condition.
Definition: fcbndrycnd.cpp:886
MString m_bndryNormalMethod
Read from property file.
Definition: fcbndrycnd.h:72
void bc8032(MInt index)
This function applies the loads boundary condition.
Definition: fcbndrycnd.cpp:964
void bc8035(MInt index)
This function applies the loads boundary condition.
void bc8012(MInt index)
This function applies the fixation boundary condition.
Definition: fcbndrycnd.cpp:733
MFloat m_kFactor
Definition: fcbndrycnd.h:79
FcBndryCnd(FcSolver< nDim > *solver)
void refineTriangle(MInt index)
Refines the triangles of a segment by deviding them in the middle.
virtual ~FcBndryCnd()
Definition: fcbndrycnd.cpp:113
std::vector< MInt > m_bndryCndSegIds
Definition: fcbndrycnd.h:62
std::vector< std::vector< MFloat > > createTrianglesFromCutPoints(std::vector< std::vector< MFloat > > cutPointList, MFloat *triangleNormal)
Triangulation algorithm of the cut points.
MInt m_noInternalCells
Definition: fcbndrycnd.h:57
void bc8040(MInt index)
void getStlNodeList(const MInt cellId, std::vector< MInt > &nodeList)
Returns a list of all elements cutting the target cell.
void findCellsRequireSubCellIntegration()
Set the subcell tree depth for cells requiring subcell integration.
std::vector< MInt > m_bndryCndIds
Definition: fcbndrycnd.h:59
FcSolver< nDim > * m_solver
pointer to a member function data type
Definition: fcbndrycnd.h:50
MInt * m_boundarySurfaces
Definition: fcbndrycnd.h:88
void subCellIntegration(const MInt subCellLvl, MFloat *subCellParentCoord, const MInt childPos, const MInt pCellId, MFloat **Ke)
Execution of the subcell integration.
MInt * m_mapBndryCndIdSegId
Definition: fcbndrycnd.h:65
void updateSystemMatrix()
Execution of the displacement boundary conditions.
void setBoundaryStlElements(std::vector< std::vector< MFloat > > cutPointList, MFloat *normal, MInt segId, MInt i)
Add cut faces to the collector of the boundary cell.
virtual void bc0(MInt index)
Boundary condition for free surfaces.
void updateTrianglePosition()
Moves a triangle depending on the simulated displacment inside a cell.
MInt * m_subCellLayerDepth
Definition: fcbndrycnd.h:78
void bc8010(MInt index)
This function applies the fixation boundary condition.
Definition: fcbndrycnd.cpp:554
void bc8020(MInt index)
This function applies a non-zero displacement boundary condition.
Definition: fcbndrycnd.cpp:801
void calculateCutPoints()
Calculation of the cutpoints of each segment.
std::vector< MInt > m_mapBndryCndSegId2Index
Definition: fcbndrycnd.h:63
MFloat solveIntegrationOnTriangle(std::vector< MFloat > trianglePoints, MFloat *triangleNormal)
Gauss quadrature on triangles.
List< MInt > * m_bndryCellIds
Definition: fcbndrycnd.h:86
FcGridBndryCell< nDim > * bndryCells
Definition: fcbndrycnd.h:51
void calcReactionForces()
Calculation of reaction forces.
void(FcBndryCnd::* BndryCndHandler)(MInt set)
Definition: fcbndrycnd.h:52
void calcAvgFaceNormal(MInt index)
Calculation of the normal vector of the cut faces.
MBool pointInTriangle(MFloat *A, MFloat *B, MFloat *C, std::vector< MFloat > P)
Checks if a point is inside a triangle.
MInt m_noSegments
Definition: fcbndrycnd.h:67
This class represents a structure solver using the Finite Cell Method.
Definition: fcsolver.h:27
Definition: list.h:16
Class that represents FC cell collector.
FcCell
FC cell Property Labels.
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
LB lattice descriptor for arrays depending on D.
Definition: fcdescriptor.h:168