8 #ifndef UGCORE_UGBASE_LIB_GRID_ALGORITHMS_EXTRUSION_SUPPORT3D_H_
9 #define UGCORE_UGBASE_LIB_GRID_ALGORITHMS_EXTRUSION_SUPPORT3D_H_
22 #include <type_traits>
41 template<
typename ELEMTYP,
typename INDEX_TYP>
46 ElemInfo( ELEMTYP
const & elem, INDEX_TYP sudo )
47 : m_elem(elem), m_sudo(sudo)
70 class VertexFractureQuadrupel
74 using ElemInfoFac = ElemInfo<FACETYP,INDEX_TYP>;
82 VertexFractureQuadrupel( ElemInfoFac
const & fracFaceInfo,
83 VOLUMETYP
const & attVolume,
84 NORMALTYP
const & normal,
85 std::pair<EDGETYP,EDGETYP>
const & volCutEdges,
86 std::pair<ElemInfoFac,ElemInfoFac>
const & volCutEdgeFaces )
87 : m_fracFaceInfo(fracFaceInfo),
88 m_attVolume(attVolume),
90 m_volCutEdges(volCutEdges),
91 m_volCutEdgeFaces(volCutEdgeFaces)
104 ElemInfo<FACETYP,INDEX_TYP> m_fracFaceInfo;
105 VOLUMETYP m_attVolume;
107 std::pair<EDGETYP,EDGETYP> m_volCutEdges;
108 std::pair<ElemInfoFac,ElemInfoFac> m_volCutEdgeFaces;
117 VertexFractureQuadrupel()
157 std::vector<bool> test;
159 test.push_back( lowElmOther.first == lowElmThis.first );
160 test.push_back( lowElmOther.second == lowElmThis.first );
161 test.push_back( lowElmOther.first == lowElmThis.second );
162 test.push_back( lowElmOther.second == lowElmThis.second );
164 INDEX_TXP countCorr = 0;
166 for(
auto const t : test )
176 UG_THROW(
"zu viele gleiche Ecken " << std::endl);
182 LOWDIMELM
const & specificLDE )
192 bool otherFirst = ( lowElmOther.first == specificLDE );
193 bool otherSecond = ( lowElmOther.second == specificLDE );
195 bool thisFirst = ( lowElmThis.first == specificLDE );
196 bool thisSecond = ( lowElmThis.second == specificLDE );
198 bool isPartOfThisFace = ( thisFirst || thisSecond );
199 bool isPartOfOtherFace = ( otherFirst || otherSecond );
201 if( ! isPartOfOtherFace || ! isPartOfThisFace )
203 UG_LOG(
"not part of one of the faces " << std::endl);
207 if( otherFirst && thisFirst )
209 if( lowElmOther.first == lowElmThis.first )
212 else if( otherFirst && thisSecond )
214 if( lowElmOther.first == lowElmThis.second )
217 else if( otherSecond && thisFirst )
219 if( lowElmOther.second == lowElmThis.first )
222 else if( otherSecond && thisSecond )
224 if( lowElmOther.second == lowElmThis.second )
266 typename MANIFOLDTYP,
269 typename SENKRECHTENTYP,
284 FULLDIMTYP
const & fullElm,
285 SENKRECHTENTYP
const & normal,
330 template <
typename VRT,
typename IndTyp >
436 INDEX_TXP sudoOther = attElm.
getSudo();
446 if( geomEqu && sudoOther == this->
m_sudo )
671 bool alreadyInList =
false;
675 if( sudo == availSudo )
676 alreadyInList =
true;
679 if( ! alreadyInList )
696 T alreadyKnownMult = 0;
700 T & sudoVal = suSu.first;
701 bool & isClosedVal = suSu.second;
703 if( sudoVal == sudoNow )
707 UG_LOG(
"Reassign sudo surround " << std::endl);
709 if( isClosedVal != isClosedNow )
710 UG_THROW(
"change property sudo surrounded, why?" << std::endl);
712 isClosedVal = isClosedNow;
716 if( alreadyKnownMult == 0 )
718 pairTB infoSudoSurr( sudoNow, isClosedNow );
723 else if( alreadyKnownMult > 1 )
725 UG_THROW(
"zu oft bekannt " << std::endl);
735 T & sudoVal = suSu.first;
736 bool & isClosedVal = suSu.second;
738 if( sudoVal == sudoNow )
742 if( isClosedVal != isClosedNow )
744 UG_THROW(
"NOT set property sudo surrounded, why?" << std::endl);
751 if( testKnownFine == 0 || testKnownFine > 1 )
753 UG_THROW(
"immer noch nicht bekannt?" << std::endl);
765 bool isClosedReturn =
false;
769 T
const & sudoVal = suSu.first;
770 bool const & isClosedVal = suSu.second;
772 if( sudoVal == sudoNow )
775 isClosedReturn = isClosedVal;
779 if( foundMultpl != 1 )
781 UG_THROW(
"not known status closed or not sudo" << std::endl);
785 return isClosedReturn;
804 bool allFracsSame =
true;
809 bool const & isClosedVal = suSu.second;
811 if( isClosedVal != B )
812 allFracsSame =
false;
820 bool alreadyKnown =
false;
824 if( aE.testIfEquals(attElem) )
832 return ! alreadyKnown;
867 UG_THROW(
"zu viele subdomains crossing in one Punkt" << std::endl);
891 template<
typename FULLDIM_ELEM,
929 FULLDIM_ELEM otherFullDimElm = otherFullDimElmInf.
getFulldimElem();
955 template <
typename NOGEN>
1021 if( found && eraseFound )
1033 bool manifNeighbored =
false;
1038 manifNeighbored =
true;
1042 if( manifNeighbored && eraseFoundManif )
1047 return manifNeighbored;
1051 template <
typename NOGEN>
1059 if( found && shiftToGeneral )
1065 MANIFELM
const & manifel = manifFractElemOther.
getManifElm();
1210 typename = std::enable_if<std::is_same<Volume*,FULLDIM_ELEM>::value>,
1211 typename = std::enable_if<std::is_same<Face*,MANIFELM>::value>
1219 for( INDEX_TXP iFac = 0; iFac <
m_fullDimElm->num_faces(); iFac++ )
1226 if( fac == manifEl )
1239 template <
typename ATT_MANIF_ELM_INF >
1241 std::vector<ATT_MANIF_ELM_INF> & memVecManifElem,
1242 bool eraseFound =
true )
1246 for(
typename std::vector<ATT_MANIF_ELM_INF>::iterator afeiIter = memVecManifElem.begin();
1247 afeiIter != memVecManifElem.end();
1251 ATT_MANIF_ELM_INF & manifElmTest = *afeiIter;
1253 if( manifElemOther.testIfEquals(manifElmTest) )
1257 memVecManifElem.erase(afeiIter);
1268 template <
typename ATT_MANIF_ELM_INFO >
1270 std::vector<ATT_MANIF_ELM_INFO> & memVecManifElm,
1282 for(
auto const & me : memVecManifElm )
1284 if( manifElm.testIfEquals(me) )
1291 memVecManifElm.push_back(manifElm);
1301 template <
typename VEC_AVEI,
typename OPERATION,
typename INDX_TYP >
1302 bool switchFulldimInfo( VEC_AVEI & vecAttVolElemInfoCop,
1303 VEC_AVEI
const & vecAttVolElemInfo,
1304 VEC_AVEI & segmentAVEI,
1306 INDX_TYP switchInd = 0
1309 auto & startVolInfoThisSegment = vecAttVolElemInfoCop[switchInd];
1311 auto const & startVol = startVolInfoThisSegment.opera();
1313 for(
auto & possibleOrigVolInfo : vecAttVolElemInfo )
1315 auto const & possVol = possibleOrigVolInfo.opera();
1317 if( possVol == startVol )
1319 segmentAVEI().push_back(possibleOrigVolInfo);
1324 if( segmentAVEI().size() != 1 )
1326 UG_LOG(
"No start volume reconstructible " << std::endl);
1327 UG_THROW(
"No start volume reconstructible " << std::endl);
1331 if( ! vecAttVolElemInfoCop.erase( vecAttVolElemInfoCop.begin() + switchInd ) )
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
Face * get_face(const FaceVertices &fv)
returns the face that is described by fv.
Definition: grid.cpp:1135
Definition: support3D.h:405
INDEX_TXP const getSudo() const
Definition: support3D.h:427
AttachedFractElem(MANIFELM const &manifElm, PairLowEl &lowElm, INDEX_TXP sudo)
Definition: support3D.h:414
INDEX_TXP m_sudo
Definition: support3D.h:559
bool const testIfEquals(AttFractElm const &attElm) const
Definition: support3D.h:429
Definition: support3D.h:897
bool addGenerManifElem(AttachedGenerManifElemInfo const &manifGenerElm, Grid &grid)
Definition: support3D.h:945
std::vector< AttachedFractManifElemInfo > VecAttachedFractManifElemInfo
Definition: support3D.h:904
VecAttachedGenerManifElemInfo m_vecGenerManifElm
Definition: support3D.h:1191
bool const testFullDimElmNeighbour(AttFullDimElmInfo const &attFullDimElmInfOther, bool eraseFoundManif=true)
Definition: support3D.h:1029
VecAttachedGenerManifElemInfo const getVecGenerManifElem() const
Definition: support3D.h:1012
bool const searchGenerManifElem(AttachedGenerManifElemInfo const &manifGenerElemOther, bool eraseFound=true)
Definition: support3D.h:1017
bool addGenerManifElem(NOGEN const &noGener, Grid &grid)=delete
AttachedFullDimElemInfo(FULLDIM_ELEM const &fullDimElm)
Definition: support3D.h:909
void markIt()
Definition: support3D.h:936
bool m_elementMarked
Definition: support3D.h:1182
VecAttachedFractManifElemInfo m_vecFractManifElm
Definition: support3D.h:1184
bool const isMarked() const
Definition: support3D.h:934
bool const searchManifElem(ATT_MANIF_ELM_INF const &manifElemOther, std::vector< ATT_MANIF_ELM_INF > &memVecManifElem, bool eraseFound=true) const
Definition: support3D.h:1240
bool addManifElem(ATT_MANIF_ELM_INFO const &manifElm, std::vector< ATT_MANIF_ELM_INFO > &memVecManifElm, Grid &grid)
Definition: support3D.h:1269
VecAttachedFractManifElemInfo const getVecFractManifElem() const
Definition: support3D.h:1007
bool const hasSameFulldimElem(AttFullDimElmInfo const &otherFullDimElmInf) const
Definition: support3D.h:926
bool addFractManifElem(AttachedFractManifElemInfo const &manifFractElm, Grid &grid)
Definition: support3D.h:940
FULLDIM_ELEM const getFulldimElem() const
Definition: support3D.h:921
bool searchGenerManifElem(NOGEN const &manifGenerElemOther, bool eraseFound)=delete
FULLDIM_ELEM m_fullDimElm
Definition: support3D.h:1180
bool fullDimElmContainsManif(MANIFELM const &manifEl, Grid &grid)
Definition: support3D.h:1215
bool const hasFracture() const
Definition: support3D.h:938
bool const searchFractManifElem(AttachedFractManifElemInfo const &manifFractElemOther, bool shiftToGeneral=true)
Definition: support3D.h:1055
std::vector< AttachedGenerManifElemInfo > VecAttachedGenerManifElemInfo
Definition: support3D.h:905
Definition: support3D.h:129
AttachedGeneralElem(MANIFELM const &manifElm, PairLowEl const &lowElm)
Definition: support3D.h:136
MANIFELM m_manifElm
Definition: support3D.h:250
MANIFELM const getManifElm() const
Definition: support3D.h:144
PairLowEl m_pairLowElm
Definition: support3D.h:251
std::pair< LOWDIMELM, LOWDIMELM > PairLowEl
Definition: support3D.h:131
bool const isNeighbouredAtSpecificSide(AttGenElm const &attElm, LOWDIMELM const &specificLDE) const
Definition: support3D.h:181
PairLowEl const getPairLowElm() const
Definition: support3D.h:146
bool const isNeighboured(AttGenElm const &attElm) const
Definition: support3D.h:148
bool const testIfEquals(AttGenElm const &attElm) const
Definition: support3D.h:231
Definition: support3D.h:332
void setShiftVrtx(std::vector< VRT > const &vecVrt)
Definition: support3D.h:366
std::vector< std::pair< VRT, bool > > m_vecShiftedVrtsWithTypInf
Definition: support3D.h:386
std::vector< VRT > m_vecShiftedVrts
Definition: support3D.h:385
std::vector< std::pair< VRT, bool > > getVecShiftedVrtsWithTypInfo() const
Definition: support3D.h:373
void addShiftVrtx(VRT const &vrt, bool isAtFreeSide=false)
Definition: support3D.h:348
FracTypVol getFracTyp() const
Definition: support3D.h:346
std::vector< VRT > getVecShiftedVrts() const
Definition: support3D.h:368
IndTyp m_numberAtFreeSide
Definition: support3D.h:388
VRT getCrossVertex() const
Definition: support3D.h:344
VRT m_crossVrt
Definition: support3D.h:384
FracTypVol m_fracTyp
Definition: support3D.h:387
CrossingVertexInfoVol(VRT const &crossVrt, FracTypVol fracTyp)
Definition: support3D.h:336
Definition: support3D.h:577
VecPairTB m_sudosClosed
Definition: support3D.h:876
std::vector< ATT_ELEM > const & getAllAttachedFractElems() const
Definition: support3D.h:835
bool getIsAClosedFracture(T sudoNow)
Definition: support3D.h:761
std::pair< T, bool > pairTB
Definition: support3D.h:580
VrtxFracStatus getVrtxFracStatus()
Definition: support3D.h:662
VrtxFracStatus m_status
Definition: support3D.h:845
bool m_isBndFracVertex
Definition: support3D.h:842
std::vector< ATT_ELEM > m_vecAttElem
Definition: support3D.h:885
std::vector< T > const getSudoList() const
Definition: support3D.h:688
VertexFracturePropertiesVol & operator++(int a)
Definition: support3D.h:655
bool addAttachedFractElem(ATT_ELEM const &attElem)
Definition: support3D.h:818
bool setSudoList(std::vector< T > const &sudoList)
Definition: support3D.h:878
bool adaptVrtxFracStatus()
Definition: support3D.h:862
void setNumberCrossingFracsInVertex(T const &nCFIV)
Definition: support3D.h:609
VecPairTB const getInfoAllFracSudosIfClosed() const
Definition: support3D.h:795
bool getIsBndFracVertex()
Definition: support3D.h:614
void setIsBndFracVertex(bool iBDV=true)
Definition: support3D.h:604
bool setVrtxFracStatus(VrtxFracStatus status)
Definition: support3D.h:852
bool setIsAClosedFracture(T sudoNow, bool isClosedNow)
Definition: support3D.h:693
std::vector< T > m_sudoList
Definition: support3D.h:849
static constexpr VrtxFracStatus m_maxStatus
Definition: support3D.h:847
bool setInfoAllFractureSudosIfClosed(VecPairTB const &sudosClosed)
Definition: support3D.h:788
VertexFracturePropertiesVol()
Definition: support3D.h:594
VrtxFracStatus
Definition: support3D.h:589
@ threeFracSuDoAtt
Definition: support3D.h:592
@ oneFracSuDoAtt
Definition: support3D.h:590
@ twoFracSuDoAtt
Definition: support3D.h:591
@ noFracSuDoAtt
Definition: support3D.h:589
std::vector< pairTB > VecPairTB
Definition: support3D.h:581
T getNumberFracEdgesInVertex()
Definition: support3D.h:625
T m_numberCountedFracsInVertex
Definition: support3D.h:843
bool const getInfoAllFracturesSameClosedState() const
Definition: support3D.h:802
bool addFractSudo(T const &sudo)
Definition: support3D.h:669
Definition: support3D.h:274
SENKRECHTENTYP m_newNormal
Definition: support3D.h:316
SENKRECHTENTYP const getNewNormal() const
Definition: support3D.h:306
VertexFractureTripleMF(MANIFOLDTYP const &manifElm, INDEXTYP sudo, FULLDIMTYP const &fullElm, SENKRECHTENTYP const &normal, PairLowEl const &pairLowElm)
Definition: support3D.h:283
std::pair< LOWDIMTYP, LOWDIMTYP > PairLowEl
Definition: support3D.h:281
INDEXTYP m_sudo
Definition: support3D.h:313
INDEXTYP const getSudoElm() const
Definition: support3D.h:298
FULLDIMTYP m_fullElm
Definition: support3D.h:314
SENKRECHTENTYP const getNormal() const
Definition: support3D.h:302
void setNewNormal(SENKRECHTENTYP const &chNorml)
Definition: support3D.h:304
VertexFractureTripleMF()
Definition: support3D.h:319
FULLDIMTYP const getFullElm() const
Definition: support3D.h:300
SENKRECHTENTYP m_normal
Definition: support3D.h:315
#define VRT(locInd)
Definition: file_io_vtu.cpp:713
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
Definition: smart_pointer.h:814
FracTypVol
Definition: support3D.h:328
@ XCross
Definition: support3D.h:328
@ TEnd
Definition: support3D.h:328
@ SingleFrac
Definition: support3D.h:328