diff --git a/ugbase/bridge/disc_bridges/user_data_bridge.cpp b/ugbase/bridge/disc_bridges/user_data_bridge.cpp index 676a33126..cd6bb0a41 100644 --- a/ugbase/bridge/disc_bridges/user_data_bridge.cpp +++ b/ugbase/bridge/disc_bridges/user_data_bridge.cpp @@ -458,7 +458,9 @@ static void Dimension(TRegistry& reg, string grp) typedef CompositeUserData T; reg.template add_class_(name, grp) .template add_constructor("") - .add_method("add", &T::add) + .template add_constructor("continuous") + .add_method("add", static_cast(&T::add), "assign a user data object to a subset index", "si#userdata") + .add_method("add", static_cast, const char *, typename T::ref_type)>(&T::add), "assign a user data object to subsets by names", "names#userdata") .add_method("has", &T::has) .add_method("get", &T::get) .add_method("is_coupled", &T::is_coupled) @@ -473,8 +475,10 @@ static void Dimension(TRegistry& reg, string grp) string name = string("CompositeUserVector").append(dimSuffix); typedef CompositeUserData, dim, void> T; reg.template add_class_(name, grp) - .template add_constructor("") - .add_method("add", &T::add) + .template add_constructor() + .template add_constructor("continuous") + .add_method("add", static_cast(&T::add), "assign a user data object to a subset index", "si#userdata") + .add_method("add", static_cast, const char *, typename T::ref_type)>(&T::add), "assign a user data object to subsets by names", "names#userdata") .add_method("has", &T::has) .add_method("get", &T::get) .add_method("is_coupled", &T::is_coupled) diff --git a/ugbase/lib_disc/domain_util.cpp b/ugbase/lib_disc/domain_util.cpp index af233cc1e..1f853dd79 100644 --- a/ugbase/lib_disc/domain_util.cpp +++ b/ugbase/lib_disc/domain_util.cpp @@ -59,31 +59,19 @@ void LoadDomain(TDomain& domain, const char* filename, int procId) //domain.create_additional_subset_handler("markSH"); vector additionalSHNames = domain.additional_subset_handler_names(); SPProjectionHandler ph = make_sp(new ProjectionHandler(domain.geometry3d(), domain.subset_handler())); + vector > ash(additionalSHNames.size()); - if(additionalSHNames.size()>0){ - SmartPtr sh; - vector> ash(additionalSHNames.size()); - for(size_t i_name = 0; i_name < additionalSHNames.size(); ++i_name){ - SmartPtr sh = domain.additional_subset_handler(additionalSHNames[i_name]); - ash[i_name]= sh; - } - - if(!LoadGridFromFile(*domain.grid(), ph, num_ph, *domain.subset_handler(), additionalSHNames, ash, - filename, domain.position_attachment(), procId)) - { - UG_THROW("LoadDomain: Could not load file: "< 0) - { + if(num_ph != 0) domain.set_refinement_projector(ph); - } } diff --git a/ugbase/lib_disc/spatial_disc/disc_util/conv_shape.h b/ugbase/lib_disc/spatial_disc/disc_util/conv_shape.h index 7422f5057..0f486374a 100644 --- a/ugbase/lib_disc/spatial_disc/disc_util/conv_shape.h +++ b/ugbase/lib_disc/spatial_disc/disc_util/conv_shape.h @@ -140,8 +140,8 @@ update(const TFVGeom* geo, const MathMatrix* DiffDisp, bool computeDeriv) { - UG_ASSERT(geo != NULL, "Null pointer"); - UG_ASSERT(Velocity != NULL, "Null pointer"); + UG_ASSERT(geo != nullptr, "Null pointer"); + UG_ASSERT(Velocity != nullptr, "Null pointer"); // \todo: think about: this should be something like scvf.num_sh() const size_t numSH = geo->num_sh(); @@ -280,8 +280,8 @@ update(const TFVGeom* geo, const MathMatrix* DiffDisp, bool computeDeriv) { - UG_ASSERT(geo != NULL, "Null pointer"); - UG_ASSERT(Velocity != NULL, "Null pointer"); + UG_ASSERT(geo != nullptr, "Null pointer"); + UG_ASSERT(Velocity != nullptr, "Null pointer"); // \todo: think about: this should be something like scvf.num_sh() const size_t numSH = geo->num_sh(); @@ -456,8 +456,8 @@ update(const TFVGeom* geo, const MathMatrix* DiffDisp, bool computeDeriv) { - UG_ASSERT(geo != NULL, "Null pointer"); - UG_ASSERT(Velocity != NULL, "Null pointer"); + UG_ASSERT(geo != nullptr, "Null pointer"); + UG_ASSERT(Velocity != nullptr, "Null pointer"); // \todo: think about: this should be something like scvf.num_sh() const size_t numSH = geo->num_sh(); @@ -618,9 +618,9 @@ update(const TFVGeom* geo, const MathMatrix* DiffDisp, bool computeDeriv) { - UG_ASSERT(geo != NULL, "Null pointer"); - UG_ASSERT(Velocity != NULL, "Null pointer"); -// UG_ASSERT(DiffDisp != NULL, "Null pointer"); + UG_ASSERT(geo != nullptr, "Null pointer"); + UG_ASSERT(Velocity != nullptr, "Null pointer"); +// UG_ASSERT(DiffDisp != nullptr, "Null pointer"); // Compute Volume of Element // typedef typename TFVGeom::ref_elem_type ref_elem_type; @@ -644,7 +644,7 @@ update(const TFVGeom* geo, number lambda = -1; // if DiffDisp-Tensor passed, compute lambda - if(DiffDisp != NULL) + if(DiffDisp != nullptr) { // Get Gradients MathVector DiffGrad; @@ -679,7 +679,7 @@ update(const TFVGeom* geo, // Case 1: // full upwind is used /////////////////////////////////////////////////////////////////// - if(lambda <= 0 || DiffDisp == NULL) + if(lambda <= 0 || DiffDisp == nullptr) { // Choose Upwind corner const size_t up = (flux >= 0) ? scvf.from() : scvf.to(); @@ -902,8 +902,8 @@ bool ConvectionShapesSkewedUpwind:: const MathMatrix *DiffDisp, bool computeDeriv) { - UG_ASSERT(geo != NULL, "Null pointer"); - UG_ASSERT(Velocity != NULL, "Null pointer"); + UG_ASSERT(geo != nullptr, "Null pointer"); + UG_ASSERT(Velocity != nullptr, "Null pointer"); // \todo: think about: this should be something like scvf.num_sh() const size_t numSH = geo->num_sh(); @@ -1071,8 +1071,8 @@ bool ConvectionShapesLinearProfileSkewedUpwind:: const MathMatrix *DiffDisp, bool computeDeriv) { - UG_ASSERT(geo != NULL, "Null pointer"); - UG_ASSERT(Velocity != NULL, "Null pointer"); + UG_ASSERT(geo != nullptr, "Null pointer"); + UG_ASSERT(Velocity != nullptr, "Null pointer"); // \todo: think about: this should be something like scvf.num_sh() const size_t numSH = geo->num_sh(); diff --git a/ugbase/lib_disc/spatial_disc/user_data/common_user_data/composite_user_data.h b/ugbase/lib_disc/spatial_disc/user_data/common_user_data/composite_user_data.h index 03cbca62a..5d006f3df 100644 --- a/ugbase/lib_disc/spatial_disc/user_data/common_user_data/composite_user_data.h +++ b/ugbase/lib_disc/spatial_disc/user_data/common_user_data/composite_user_data.h @@ -33,13 +33,20 @@ #ifndef __LIB_DISC__COMPOSITE_USER_DATA_H_ #define __LIB_DISC__COMPOSITE_USER_DATA_H_ -// UG4 +#include +#include + +// UG4 headers +#include "lib_grid/tools/subset_group.h" #include "lib_disc/spatial_disc/user_data/linker/linker.h" namespace ug{ -//! This is a compositum for user data from different subsets. -/*! This is handy, but the implementation is rather slow. */ +/// This is a compositum for user data defined on different subsets +/** + * This combines user data objects defined on several subsets which is handy, + * but may be slow. + */ template class CompositeUserData : public UserData { @@ -47,47 +54,74 @@ class CompositeUserData : public UserData typedef CplUserData TCplUserData; public: typedef UserData base_type; - typedef SmartPtr ref_type; - typedef std::map map_type; + typedef SmartPtr ref_type; ///< the attached UserData objects should have the same type as this class (i.e. they are "remapped") - CompositeUserData(bool continuous) : m_continuous(continuous), m_bRequiresGridFunction(false) - {} + CompositeUserData() : m_bContinuous(true), m_bRequiresGridFunction(false) {} + + CompositeUserData(bool continuous) : m_bContinuous(continuous), m_bRequiresGridFunction(false) {} virtual ~CompositeUserData(){} - ///! Add 'UserData' for given subset index. - void add(int si, ref_type ref) - + /// Add 'UserData' object for given subset index. + void add + ( + int si, ///< the subset index + ref_type ref ///< pointer to the user-data object + ) { - // UG_ASSERT(ref->continuous() == m_continuous, "ERROR: Mixing continuous and discontinuous data!"); - m_map[si] = ref; - m_continuous = m_continuous && ref->continuous(); + UG_ASSERT (si >= 0, "CompositeUserData: Non-existing subset index!"); + + if ((size_t) si >= m_vData.size ()) + m_vData.resize (si + 1); + m_vData[si] = ref; + + // UG_ASSERT(ref->continuous() == m_continuous, "CompositeUserData: Mixing continuous and discontinuous data!"); + m_bContinuous = m_bContinuous && ref->continuous(); m_bRequiresGridFunction = m_bRequiresGridFunction || ref->requires_grid_fct(); } + + /// Add 'UserData' object for all subsets in a given group + void add + ( + const SubsetGroup & ssg, ///< the subset group + ref_type ref ///< pointer to the user-data object + ) + { + for (size_t i = 0; i < ssg.size (); i++) add (ssg[i], ref); + } + + /// Add 'UserData' object for all subsets by their names + void add + ( + ConstSmartPtr ssh, ///< subset handler of the domain + const char * ss_names, ///< names of the subdomains + ref_type ref ///< pointer to the user-data object + ) + { + std::vector v_ss_names; + SubsetGroup ssg; + + TokenizeTrimString (std::string (ss_names), v_ss_names); + ssg.add (v_ss_names); + add (ssg, ref); + } - ref_type get(int si) - { return (find(si)->second); } - - bool has(int si) - { return find(si) != m_map.end();} - - - bool is_coupled(int si) - { return (has(si) && find(si)->second.template is_of_type()); } + /// Returns the value assigned to a subset index + ref_type get (int si) const { return find(si); } - SmartPtr get_coupled(int si) - { return find(si)->second.template cast_dynamic(); } + /// Checks if anything is assigned to a given subset index + bool has(int si) const { return si >= 0 && (size_t) si < m_vData.size () && find(si).valid ();} + bool is_coupled(int si) { return has(si) && find(si).template is_of_type(); } + SmartPtr get_coupled(int si) { return find(si).template cast_dynamic(); } // Implementing virtual functions - virtual bool continuous() const - {return m_continuous;} - + virtual bool continuous() const {return m_bContinuous;} - //! returns true, if at least one of the underlying UserData requires grid functions. + /// returns true, if at least one of the underlying UserData requires grid functions. virtual bool requires_grid_fct() const { return m_bRequiresGridFunction; @@ -97,66 +131,71 @@ class CompositeUserData : public UserData virtual TRet operator() (TData& value, const MathVector& globIP, number time, int si) const - { return (*find(si)->second)(value, globIP, time, si); } + { return (*find(si)) (value, globIP, time, si); } + + /// returns values for global positions + virtual void operator()(TData vValue[], + const MathVector vGlobIP[], + number time, int si, const size_t nip) const + { return (*find(si)) (vValue, vGlobIP, time, si, nip); } - /// returns values for global positions - virtual void operator()(TData vValue[], + + virtual void operator()(TData vValue[], const MathVector vGlobIP[], - number time, int si, const size_t nip) const - { return (*find(si)->second)(vValue, vGlobIP, time, si, nip); } - - - virtual void operator()(TData vValue[], - const MathVector vGlobIP[], - number time, int si, - GridObject* elem, - const MathVector vCornerCoords[], - const MathVector<1> vLocIP[], - const size_t nip, - LocalVector* u, - const MathMatrix<1, dim>* vJT = NULL) const - { - return (*find(si)->second)(vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT); - } - - virtual void operator()(TData vValue[], - const MathVector vGlobIP[], - number time, int si, - GridObject* elem, - const MathVector vCornerCoords[], - const MathVector<2> vLocIP[], - const size_t nip, - LocalVector* u, - const MathMatrix<2, dim>* vJT = NULL) const - { - return (*find(si)->second)(vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT); - } - - virtual void operator()(TData vValue[], - const MathVector vGlobIP[], - number time, int si, - GridObject* elem, - const MathVector vCornerCoords[], - const MathVector<3> vLocIP[], - const size_t nip, - LocalVector* u, - const MathMatrix<3, dim>* vJT = NULL) const - { - return (*find(si)->second)(vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT); - } + number time, int si, + GridObject* elem, + const MathVector vCornerCoords[], + const MathVector<1> vLocIP[], + const size_t nip, + LocalVector* u, + const MathMatrix<1, dim>* vJT = NULL) const + { + return (*find(si)) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT); + } + virtual void operator()(TData vValue[], + const MathVector vGlobIP[], + number time, int si, + GridObject* elem, + const MathVector vCornerCoords[], + const MathVector<2> vLocIP[], + const size_t nip, + LocalVector* u, + const MathMatrix<2, dim>* vJT = NULL) const + { + return (*find(si)) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT); + } + virtual void operator()(TData vValue[], + const MathVector vGlobIP[], + number time, int si, + GridObject* elem, + const MathVector vCornerCoords[], + const MathVector<3> vLocIP[], + const size_t nip, + LocalVector* u, + const MathMatrix<3, dim>* vJT = NULL) const + { + return (*find(si)) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT); + } -protected: - typename map_type::const_iterator find(int si) const +private: + + // returns the reference to the user data in the given subset + const ref_type & find (int si) const { - typename map_type::const_iterator it = m_map.find(si); - UG_ASSERT(it != m_map.end(), "ERROR: Subset not found!"); - return it; + if (si < 0 || (size_t) si >= m_vData.size ()) + { + UG_THROW ("CompositeUserData: No data for subset " << si); + } + + return m_vData [si]; } - map_type m_map; - bool m_continuous; +private: + + std::vector m_vData; + bool m_bContinuous; bool m_bRequiresGridFunction; }; diff --git a/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.cpp b/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.cpp index 1c66a54db..c89d0c809 100644 --- a/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.cpp +++ b/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.cpp @@ -1183,7 +1183,8 @@ bool SortFaces4DiamondCreation( SubsetHandler& sh, std::vector & assoFac void computeDiamondPointXCrossType( ExpandCrossFracInfo & expCFIBeforeFracEdg, ExpandCrossFracInfo & expCFIAfterFracEdg, Vertex * const & crossPt, Grid::VertexAttachmentAccessor & aaPos, SubsetHandler & sh, Grid & grid, IndexType const & diamantSubsNum, - vector3 & distVecNewVrt2SCrossPt + vector3 & distVecNewVrt2SCrossPt, + bool useTrianglesInDiamonds = false // vector3 & distVecNewVrt2ShiVeBefore = vector3(), vector3 & distVecNewVrt2ShiVeAfter = vector3(), // bool computeDistancesNewVrtsToOldShiVe = false ) @@ -1265,12 +1266,53 @@ void computeDiamondPointXCrossType( ExpandCrossFracInfo & expCFIBeforeFracEdg, E vector3 halfSumShift; - VecScale(halfSumShift,sumShift,0.5); + number scaFa = useTrianglesInDiamonds ? 1 : 0.5; + +// VecScale(halfSumShift, sumShift, 0.5); + VecScale( halfSumShift, sumShift, scaFa ); vector3 posNewVrtOnEdg; VecAdd( posNewVrtOnEdg, posCrossPt, halfSumShift ); + // check if not shifting into the wrong direction TODO FIXME + // if length between posFracEnd and posNewVrtOnEdg bigger than length between posFracEnd and crossPt + // then shifted into the wrong direction, Kommando zurück dann! + +// if( useTrianglesInDiamonds ) +// { + // always + + vector3 distVecOld; + VecSubtract(distVecOld, posFracEnd, posCrossPt ); + vector3 distVecNew; + VecSubtract(distVecNew, posFracEnd, posNewVrtOnEdg); + number oldDistSq = VecLength(distVecOld); + number newDistSq = VecLength(distVecNew); + + if( oldDistSq < newDistSq ) + { + VecScale( halfSumShift, sumShift, - scaFa); + VecAdd(posNewVrtOnEdg, posCrossPt, halfSumShift); + } + else if( oldDistSq == newDistSq ) // cross pt would equal new position + { + if( posNewVrtOnEdg != posCrossPt || distVecNew != distVecOld ) + UG_THROW("Denkfehler, Implementation extemer Spezialfall checken" << std::endl); + + vector3 distCorr; + VecScale( distCorr, distVecOld, 0.05 ); + VecAdd( posNewVrtOnEdg, posCrossPt, distCorr ); + // Versuch, den Punkt ein wenig zu verschieben + } + + // TODO FIXME eventuell noch testen, ob die beiden Punkte in einem kleinen Radius liegen und korrigieren, + // eventuell schon vorher, statt zu werfen + if( posNewVrtOnEdg == posCrossPt ) + UG_THROW("Denkfehler Typ 2, Implementation extemer Spezialfall checken" << std::endl); + +// } + Vertex * newEdgVrtx = *grid.create(); aaPos[newEdgVrtx] = posNewVrtOnEdg; @@ -1326,7 +1368,8 @@ void computeDiamondPointXCrossType( ExpandCrossFracInfo & expCFIBeforeFracEdg, E // } } - +// This function creates the new faces outside the diamond, directly attached to the diamond, +// as part of post processing void createNewFacesForExtXCrossFracs( ExpandCrossFracInfo const & ecf, std::vector & newFracFaceVec, bool & boundAtShiftVrtEdg, //bool & atStartSort, @@ -1529,6 +1572,8 @@ void createNewFacesForExtXCrossFracs( ExpandCrossFracInfo const & ecf, std::vec } +// this function creates the new faces of the diamond center, for XCross, but also for free TEnd type crossing fractures + void createDiamondFacesXCrossType( ExpandCrossFracInfo & expCFIBeforeFracEdg, ExpandCrossFracInfo & expCFIAfterFracEdg, std::vector & newDiamFaceVec, SubsetHandler & sh, Grid & grid, IndexType diamantSubsNum, Vertex * & crossPt, bool isFreeTEnd = false ) @@ -1613,7 +1658,6 @@ void createDiamondFacesXCrossType( ExpandCrossFracInfo & expCFIBeforeFracEdg, Ex vrtxSmallDiamAfter.push_back( shiftVrt ); vrtxSmallDiamAfter.push_back( newVrtAfter ); - Face * newFracFaceBefore = *grid.create( TriangleDescriptor( vrtxSmallDiamBefore[0], vrtxSmallDiamBefore[1], vrtxSmallDiamBefore[2] ) ); @@ -2145,9 +2189,14 @@ void teachAssoFacesNewVrtx( VecVertexOfFaceInfo const & segPart, Grid::FaceAttac #endif bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector const & fracInfos, - bool expandInnerFracBnds, bool expandOuterFracBnds) +// bool expandInnerFracBnds, bool expandOuterFracBnds + bool useTrianglesInDiamonds, bool establishDiamonds +) { + constexpr bool expandInnerFracBnds = false; + constexpr bool expandOuterFracBnds = true; + // for(EdgeIterator iter = sh.begin(1); iter != sh.end(1); ++iter) // { // size_t sm = sh.num_subsets(); @@ -6101,6 +6150,10 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector // return true; + // only Keile, basic system + if( ! establishDiamonds ) + return true; + // alles detachen, was noch attached ist, da ist einiges hinzu gekommen! @@ -6692,7 +6745,8 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector // shift of free shift point to virtual prolongation of ending fracture center line - computeDiamondPointXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, crossPt, aaPos, sh, grid, sudoTEnd, distVecNewVrt2SCrossPt ); +// computeDiamondPointXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, crossPt, aaPos, sh, grid, sudoTEnd, distVecNewVrt2SCrossPt ); + computeDiamondPointXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, crossPt, aaPos, sh, grid, sudoTEnd, distVecNewVrt2SCrossPt, useTrianglesInDiamonds ); constexpr bool shiftFreePt = false; @@ -6936,6 +6990,8 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector // create new edges and new faces + // edges and faces outside the diamond, at the crossing fractures attached to the diamond + std::vector newFracFaceVec = std::vector(); bool boundAtShiftVrtEdg = false; @@ -6948,6 +7004,8 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector createNewFacesForExtXCrossFracs( ecf, newFracFaceVec, boundAtShiftVrtEdg, sh, grid, crossPt, subdomList ); } + // edges and faces of the diamond itself respectively its analogon for the TEnd case here + std::vector newDiamFaceVec = std::vector(); // ExpandCrossFracInfo & expCFIBeforeFracEdg = vecExpCrossFI[ indBeforeT ]; @@ -6973,10 +7031,14 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector ExpandCrossFracInfo & expCFIAfterFracEdg = vecExpCrossFI[ indAfter ]; +// createDiamondFacesXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, +// newDiamFaceVec, sh, grid, sudoTEnd, crossPt, isAtFreeEnd ); createDiamondFacesXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, - newDiamFaceVec, sh, grid, sudoTEnd, crossPt, isAtFreeEnd ); + newDiamFaceVec, sh, grid, sudoTEnd, crossPt, isAtFreeEnd || useTrianglesInDiamonds ); } +// } + std::string diamNam = std::string("spitzDiam_") + std::string(const_cast( sh.get_subset_name( subdomList[0] ) )) @@ -7448,7 +7510,8 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector vector3 distVecNewVrt2SCrossPt; // not ot interest here, but only with c++17 possible to rule out computation in a clever way - computeDiamondPointXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, crossPt, aaPos, sh, grid, diamantSubsNum, distVecNewVrt2SCrossPt ); +// computeDiamondPointXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, crossPt, aaPos, sh, grid, diamantSubsNum, distVecNewVrt2SCrossPt ); + computeDiamondPointXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, crossPt, aaPos, sh, grid, diamantSubsNum, distVecNewVrt2SCrossPt, useTrianglesInDiamonds ); #if 0 @@ -7800,8 +7863,11 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector // std::vector newDiamFaceVec ) #if 1 +// createDiamondFacesXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, +// newDiamFaceVec, sh, grid, diamantSubsNum, crossPt ); + createDiamondFacesXCrossType( expCFIBeforeFracEdg, expCFIAfterFracEdg, - newDiamFaceVec, sh, grid, diamantSubsNum, crossPt ); + newDiamFaceVec, sh, grid, diamantSubsNum, crossPt, useTrianglesInDiamonds ); #else Face * facBefore = expCFIBeforeFracEdg.getFace(); @@ -8019,20 +8085,31 @@ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, vector UG_THROW("hier fehlt ein Gesicht " << std::endl); } - for( auto const & edg : allAssoEdgCP ) + if( ! useTrianglesInDiamonds ) // stamdard case { - if( edg != nullptr && edg != avoidToDeleteEdge ) + for( auto const & edg : allAssoEdgCP ) { - UG_LOG("will erasieren " << edg << std::endl ); - grid.erase(edg); + if( edg != nullptr && edg != avoidToDeleteEdge ) + { + UG_LOG("will erasieren " << edg << std::endl ); + grid.erase(edg); + } + else + { + UG_LOG("hier fehlt eine Ecke " << std::endl); + } } - else + } + else + { + for( auto const & edg : origFracEdg ) { - UG_LOG("hier fehlt eine Ecke " << std::endl); + grid.erase(edg); } } + UG_LOG("ALles erasiert " << std::endl); #endif } diff --git a/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.h b/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.h index f2b17fbc9..ecf584f0f 100644 --- a/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.h +++ b/ugbase/lib_grid/algorithms/extrusion/expand_layers_arte.h @@ -46,7 +46,7 @@ namespace ug * */ bool ExpandFractures2dArte( Grid& grid, SubsetHandler& sh, std::vector const & fracInfos, - bool expandInnerFracBnds, bool expandOuterFracBnds ); + bool useTrianglesInDiamonds, bool establishDiamonds ); diff --git a/ugbase/lib_grid/file_io/file_io_ugx_impl.hpp b/ugbase/lib_grid/file_io/file_io_ugx_impl.hpp index 9cb2df010..67d8a3746 100644 --- a/ugbase/lib_grid/file_io/file_io_ugx_impl.hpp +++ b/ugbase/lib_grid/file_io/file_io_ugx_impl.hpp @@ -84,7 +84,7 @@ bool LoadGridFromUGX(Grid& grid, SPProjectionHandler& ph, size_t& num_ph, ISubse } } - if(ugxReader.num_projection_handlers(0) > 0){ + if((num_ph = ugxReader.num_projection_handlers(0)) != 0){ ugxReader.projection_handler(*ph, 0, 0); size_t shIndex = ugxReader.get_projection_handler_subset_handler_index(0, 0); std::string shName2;