diff --git a/.travis.yml b/.travis.yml index 69fe1ddd3..d76b8c6a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,4 +100,10 @@ script: # we still need to use travis_wait to prevent "build error because of no output" # https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received - travis_wait 45 make -j2 - - if [[ "$TARGET" == "ugshell" ]]; then ../bin/ugshell -call "print(\"it works\")"; fi + - if [[ "$TARGET" == "ugshell" ]]; then ../bin/ugshell -call "print(\"it works\")"; fi + - curl -LO https://raw.github.com/stephanmg/travis-dependent-builds/master/trigger.sh + - chmod +x trigger.sh + - ./trigger.sh NeuroBox3D ProMeshScripts master $TRAVIS_ACCESS_TOKEN "" + +after_script: + - echo "Triggered downstream projects: NeuroBox3D/ProMeshScripts" diff --git a/scripts/util/domain_util.lua b/scripts/util/domain_util.lua index 42f9e677d..cfdaa178a 100644 --- a/scripts/util/domain_util.lua +++ b/scripts/util/domain_util.lua @@ -83,7 +83,7 @@ function util.CreateDomain(gridName, numRefs, neededSubsets, noIntegrityCheck) if noIntegrityCheck ~= true then write("Performing integrity check on domain ... ") - if CheckForUnconnectedSides(dom:grid()) == true then + if CheckForUnconnectedSides(dom) == true then write("WARNING: unconnected sides found (see above).\n") local note = "NOTE: You may disable this check by passing 'true' ".. "to 'noIntegrityCheck' in 'util.CreateDomain'.\n" @@ -178,7 +178,7 @@ function util.CreateAndDistributeDomain(gridName, numRefs, numPreRefs, if noIntegrityCheck ~= true then write("Performing integrity check on domain ... ") - if CheckForUnconnectedSides(dom:grid()) == true then + if CheckForUnconnectedSides(dom) == true then write("WARNING: unconnected sides found (see above).\n") local note = "NOTE: You may disable this check by passing 'true' ".. "to 'noIntegrityCheck' in 'util.CreateAndDistributeDomain'.\n" diff --git a/ugbase/bridge/domain_bridges/domain_bridge.cpp b/ugbase/bridge/domain_bridges/domain_bridge.cpp index 0b47708c4..d414d897b 100644 --- a/ugbase/bridge/domain_bridges/domain_bridge.cpp +++ b/ugbase/bridge/domain_bridges/domain_bridge.cpp @@ -62,6 +62,7 @@ #endif +#include "lib_grid/algorithms/problem_detection_util.h" using namespace std; namespace ug{ @@ -439,6 +440,10 @@ static void Domain(Registry& reg, string grp) reg.add_class_to_group(name, "Domain", tag); } +// CheckForUnconnectedSides + reg.add_function("CheckForUnconnectedSides", static_cast (&CheckForUnconnectedSides), + grp, "foundUnconnectedSides", "domain", "Checks whether unconnected sides exist in the given grid."); + // MaxElementDiameter reg.add_function("MaxElementDiameter", static_cast( diff --git a/ugbase/bridge/grid_bridges/debug_bridge.cpp b/ugbase/bridge/grid_bridges/debug_bridge.cpp index 7cdfd16f5..32030bcfd 100644 --- a/ugbase/bridge/grid_bridges/debug_bridge.cpp +++ b/ugbase/bridge/grid_bridges/debug_bridge.cpp @@ -33,28 +33,22 @@ #include "grid_bridges.h" #include "lib_grid/algorithms/debug_util.h" #include "lib_grid/algorithms/problem_detection_util.h" +#include "../util_domain_dependent.h" +#include "bridge/util.h" using namespace std; -namespace ug{ -namespace bridge{ - -void RegisterGridBridge_Debug(Registry& reg, string parentGroup) -{ - string grp = parentGroup; - - reg.add_function("CheckHangingNodeConsistency", static_cast(&CheckHangingNodeConsistency), grp) - .add_function("CheckMultiGridConsistency", &CheckMultiGridConsistency, grp) - .add_function("CheckDistributedObjectConstraintTypes", &CheckDistributedObjectConstraintTypes, grp) - .add_function("CheckDistributedParentTypes", &CheckDistributedParentTypes, grp) - .add_function("CheckElementConsistency", static_cast(&CheckElementConsistency), grp) - .add_function("CheckElementConsistency", static_cast(&CheckElementConsistency), grp) - .add_function("CheckElementConsistency", static_cast(&CheckElementConsistency), grp); - - reg.add_function("CheckForUnconnectedSides", &CheckForUnconnectedSides, - grp, "foundUnconnectedSides", "grid", - "Checks whether unconnected sides exist in the given grid."); -} - -}// end of namespace -}// end of namespace +namespace ug { + namespace bridge { + void RegisterGridBridge_Debug(Registry& reg, string grp) + { + reg.add_function("CheckHangingNodeConsistency", static_cast(&CheckHangingNodeConsistency), grp) + .add_function("CheckMultiGridConsistency", &CheckMultiGridConsistency, grp) + .add_function("CheckDistributedObjectConstraintTypes", &CheckDistributedObjectConstraintTypes, grp) + .add_function("CheckDistributedParentTypes", &CheckDistributedParentTypes, grp) + .add_function("CheckElementConsistency", static_cast(&CheckElementConsistency), grp) + .add_function("CheckElementConsistency", static_cast(&CheckElementConsistency), grp) + .add_function("CheckElementConsistency", static_cast(&CheckElementConsistency), grp); + } + }// end of namespace bridge +}// end of namespace ug diff --git a/ugbase/lib_disc/function_spaces/error_elem_marking_strategy.h b/ugbase/lib_disc/function_spaces/error_elem_marking_strategy.h index 9dd2f04b9..ca3c31c02 100644 --- a/ugbase/lib_disc/function_spaces/error_elem_marking_strategy.h +++ b/ugbase/lib_disc/function_spaces/error_elem_marking_strategy.h @@ -74,7 +74,7 @@ class IMultigridElementIndicators { typedef typename domain_traits::element_type elem_type; - if (!m_pMG->has_attachment(m_aError)) + if (!pMG->has_attachment(m_aError)) pMG->template attach_to_dv(m_aError, -1.0); // attach with default value m_pMG = pMG; m_aaError = attachment_accessor_type(*m_pMG, m_aError); diff --git a/ugbase/lib_disc/function_spaces/local_transfer.h b/ugbase/lib_disc/function_spaces/local_transfer.h index 5826c5b51..7aa08e662 100644 --- a/ugbase/lib_disc/function_spaces/local_transfer.h +++ b/ugbase/lib_disc/function_spaces/local_transfer.h @@ -411,8 +411,8 @@ class CrouzeixRaviartElemTransfer return false; } - // the following line silences -Woverloaded-virtual - using ElemProlongationBase >::prolongate; + // the following line silences -Woverloaded-virtual and makes GCC 8.2.0 fail + // using ElemProlongationBase >::prolongate; void prolongate(Vertex* parent, TransferValueAccessor& vValueChild, TransferValueAccessor& vValueParent) diff --git a/ugbase/lib_grid/algorithms/debug_util.cpp b/ugbase/lib_grid/algorithms/debug_util.cpp index d35417136..b3e3751c7 100644 --- a/ugbase/lib_grid/algorithms/debug_util.cpp +++ b/ugbase/lib_grid/algorithms/debug_util.cpp @@ -988,6 +988,13 @@ std::string ElementDebugInfo_IMPL(const Grid& grid, TElem* e) return ss.str(); } +std::string ElementSubsetInfo(const ISubsetHandler& sh, GridObject* e) { + std::stringstream ss; + int si = sh.get_subset_index(e); + ss << "Element in subset with index " << si << " and name " << sh.get_subset_name(si); + return ss.str(); +} + std::string ElementDebugInfo(const Grid& grid, GridObject* e) { switch(e->base_object_id()){ diff --git a/ugbase/lib_grid/algorithms/debug_util.h b/ugbase/lib_grid/algorithms/debug_util.h index 722ef52ef..1a0f2aa98 100644 --- a/ugbase/lib_grid/algorithms/debug_util.h +++ b/ugbase/lib_grid/algorithms/debug_util.h @@ -145,6 +145,14 @@ bool CheckElementConsistency(MultiGrid& mg, Face* f); std::string ElementDebugInfo(const Grid& grid, GridObject* e); /** \} */ +/// Returns a string containing information on the given element +/** The string contains the subset index and name of the element + * \return string containing information + * + * \{ */ +std::string ElementSubsetInfo(const ISubsetHandler& grid, GridObject* e); +/** \} */ + /// Performs some tests on a surface-view (checks iterators vs surface-states) //void CheckSurfaceViewConsistency(SurfaceView& sv); diff --git a/ugbase/lib_grid/algorithms/problem_detection_util.cpp b/ugbase/lib_grid/algorithms/problem_detection_util.cpp index 4471a6121..d60dc4a84 100644 --- a/ugbase/lib_grid/algorithms/problem_detection_util.cpp +++ b/ugbase/lib_grid/algorithms/problem_detection_util.cpp @@ -36,6 +36,7 @@ #include "lib_grid/grid/grid.h" #include "debug_util.h" #include "isolated_elements.h" +#include "lib_disc/domain.h" namespace ug{ @@ -67,36 +68,45 @@ int IsSliver(const vector3& v0, const vector3& v1, const vector3& v2, template -static bool CheckForUnconnectedSidesIMPL(Grid& grid) +static bool CheckForUnconnectedSidesIMPL(Grid& grid, const ISubsetHandler& sh) { bool gotOne = false; std::vector sides; - if( CollectUnconnectedSides( sides, + if(CollectUnconnectedSides(sides, grid, - grid.begin(), - grid.end())) + grid.template begin(), + grid.template end())) { gotOne = true; - size_t numSides = sides.size(); - UG_LOG("WARNING: Found " << numSides << " unconnected sides (those may lead to solver issues!): \n"); - UG_ERR_LOG("Found " << numSides << " unconnected sides (those may lead to solver issues!): \n"); + const size_t numSides = sides.size(); + UG_LOG("WARNING: Found " << numSides << " unconnected sides (those may lead to solver issues!):" << std::endl); + UG_ERR_LOG("Found " << numSides << " unconnected sides (those may lead to solver issues!):" << std::endl); for(size_t i = 0; i < numSides; ++i){ UG_LOG(" - " << ElementDebugInfo(grid, sides[i]) << std::endl); UG_ERR_LOG(" - " << ElementDebugInfo(grid, sides[i]) << std::endl); + UG_LOG(" - " << ElementSubsetInfo(sh, sides[i]) << std::endl); + UG_ERR_LOG(" - " << ElementSubsetInfo(sh, sides[i]) << std::endl); } } return gotOne; } -bool CheckForUnconnectedSides(Grid& grid) +template +bool CheckForUnconnectedSides(TDomain& dom) { - if(grid.num() > 0 && CheckForUnconnectedSidesIMPL(grid)) - return true; - if(grid.num() > 0 && CheckForUnconnectedSidesIMPL(grid)) - return true; - if(grid.num() > 0 && CheckForUnconnectedSidesIMPL(grid)) - return true; - return false; + bool foundUnconnectedElements = false; + if (dom.grid().get()->template num() > 0) + foundUnconnectedElements = foundUnconnectedElements || CheckForUnconnectedSidesIMPL(*dom.grid().get(), *dom.subset_handler().get()); + if(dom.grid().get()->template num() > 0) + foundUnconnectedElements = foundUnconnectedElements || CheckForUnconnectedSidesIMPL(*dom.grid().get(), *dom.subset_handler().get()); + if(dom.grid().get()->template num() > 0) + foundUnconnectedElements = foundUnconnectedElements || CheckForUnconnectedSidesIMPL(*dom.grid().get(), *dom.subset_handler().get()); + return foundUnconnectedElements; } +/// explicit template instantiations +template bool CheckForUnconnectedSides(Domain1d& domain); +template bool CheckForUnconnectedSides(Domain2d& domain); +template bool CheckForUnconnectedSides(Domain3d& domain); + }// end of namespace diff --git a/ugbase/lib_grid/algorithms/problem_detection_util.h b/ugbase/lib_grid/algorithms/problem_detection_util.h index 96b8fd9f2..b7b200b34 100644 --- a/ugbase/lib_grid/algorithms/problem_detection_util.h +++ b/ugbase/lib_grid/algorithms/problem_detection_util.h @@ -56,7 +56,8 @@ size_t FindSlivers(std::vector& sliversOut, TAAPos aaPos, bool clearContainer = true); /// Logs all unconnected sides to UG_ERR_LOG and returns true if an unconnected side was found -bool CheckForUnconnectedSides(Grid& grid); +template +bool CheckForUnconnectedSides(TDomain& dom); }// end of namespace