Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions scripts/util/domain_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions ugbase/bridge/domain_bridges/domain_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#endif


#include "lib_grid/algorithms/problem_detection_util.h"
using namespace std;

namespace ug{
Expand Down Expand Up @@ -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<bool (*)(TDomain&)> (&CheckForUnconnectedSides<TDomain>),
grp, "foundUnconnectedSides", "domain", "Checks whether unconnected sides exist in the given grid.");


// MaxElementDiameter
reg.add_function("MaxElementDiameter", static_cast<number (*)(TDomain&, int)>(
Expand Down
38 changes: 16 additions & 22 deletions ugbase/bridge/grid_bridges/debug_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool (*)(MultiGrid&)>(&CheckHangingNodeConsistency), grp)
.add_function("CheckMultiGridConsistency", &CheckMultiGridConsistency, grp)
.add_function("CheckDistributedObjectConstraintTypes", &CheckDistributedObjectConstraintTypes, grp)
.add_function("CheckDistributedParentTypes", &CheckDistributedParentTypes, grp)
.add_function("CheckElementConsistency", static_cast<bool (*)(MultiGrid&, Vertex*)>(&CheckElementConsistency), grp)
.add_function("CheckElementConsistency", static_cast<bool (*)(MultiGrid&, Edge*)>(&CheckElementConsistency), grp)
.add_function("CheckElementConsistency", static_cast<bool (*)(MultiGrid&, Face*)>(&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<bool (*)(MultiGrid&)>(&CheckHangingNodeConsistency), grp)
.add_function("CheckMultiGridConsistency", &CheckMultiGridConsistency, grp)
.add_function("CheckDistributedObjectConstraintTypes", &CheckDistributedObjectConstraintTypes, grp)
.add_function("CheckDistributedParentTypes", &CheckDistributedParentTypes, grp)
.add_function("CheckElementConsistency", static_cast<bool (*)(MultiGrid&, Vertex*)>(&CheckElementConsistency), grp)
.add_function("CheckElementConsistency", static_cast<bool (*)(MultiGrid&, Edge*)>(&CheckElementConsistency), grp)
.add_function("CheckElementConsistency", static_cast<bool (*)(MultiGrid&, Face*)>(&CheckElementConsistency), grp);
}
}// end of namespace bridge
}// end of namespace ug
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class IMultigridElementIndicators
{
typedef typename domain_traits<dim>::element_type elem_type;

if (!m_pMG->has_attachment<elem_type>(m_aError))
if (!pMG->has_attachment<elem_type>(m_aError))
pMG->template attach_to_dv<elem_type>(m_aError, -1.0); // attach with default value
m_pMG = pMG;
m_aaError = attachment_accessor_type(*m_pMG, m_aError);
Expand Down
4 changes: 2 additions & 2 deletions ugbase/lib_disc/function_spaces/local_transfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ class CrouzeixRaviartElemTransfer
return false;
}

// the following line silences -Woverloaded-virtual
using ElemProlongationBase<TDomain, CrouzeixRaviartElemTransfer<TDomain> >::prolongate;
// the following line silences -Woverloaded-virtual and makes GCC 8.2.0 fail
// using ElemProlongationBase<TDomain, CrouzeixRaviartElemTransfer<TDomain> >::prolongate;
void prolongate(Vertex* parent,
TransferValueAccessor& vValueChild,
TransferValueAccessor& vValueParent)
Expand Down
7 changes: 7 additions & 0 deletions ugbase/lib_grid/algorithms/debug_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()){
Expand Down
8 changes: 8 additions & 0 deletions ugbase/lib_grid/algorithms/debug_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
40 changes: 25 additions & 15 deletions ugbase/lib_grid/algorithms/problem_detection_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{

Expand Down Expand Up @@ -67,36 +68,45 @@ int IsSliver(const vector3& v0, const vector3& v1, const vector3& v2,


template <class TSide>
static bool CheckForUnconnectedSidesIMPL(Grid& grid)
static bool CheckForUnconnectedSidesIMPL(Grid& grid, const ISubsetHandler& sh)
{
bool gotOne = false;
std::vector<TSide*> sides;
if( CollectUnconnectedSides( sides,
if(CollectUnconnectedSides(sides,
grid,
grid.begin<TSide>(),
grid.end<TSide>()))
grid.template begin<TSide>(),
grid.template end<TSide>()))
{
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 <typename TDomain>
bool CheckForUnconnectedSides(TDomain& dom)
{
if(grid.num<Edge>() > 0 && CheckForUnconnectedSidesIMPL<Vertex>(grid))
return true;
if(grid.num<Face>() > 0 && CheckForUnconnectedSidesIMPL<Edge>(grid))
return true;
if(grid.num<Volume>() > 0 && CheckForUnconnectedSidesIMPL<Face>(grid))
return true;
return false;
bool foundUnconnectedElements = false;
if (dom.grid().get()->template num<Edge>() > 0)
foundUnconnectedElements = foundUnconnectedElements || CheckForUnconnectedSidesIMPL<Vertex>(*dom.grid().get(), *dom.subset_handler().get());
if(dom.grid().get()->template num<Face>() > 0)
foundUnconnectedElements = foundUnconnectedElements || CheckForUnconnectedSidesIMPL<Edge>(*dom.grid().get(), *dom.subset_handler().get());
if(dom.grid().get()->template num<Volume>() > 0)
foundUnconnectedElements = foundUnconnectedElements || CheckForUnconnectedSidesIMPL<Face>(*dom.grid().get(), *dom.subset_handler().get());
return foundUnconnectedElements;
}

/// explicit template instantiations
template bool CheckForUnconnectedSides<Domain1d>(Domain1d& domain);
template bool CheckForUnconnectedSides<Domain2d>(Domain2d& domain);
template bool CheckForUnconnectedSides<Domain3d>(Domain3d& domain);

}// end of namespace
3 changes: 2 additions & 1 deletion ugbase/lib_grid/algorithms/problem_detection_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ size_t FindSlivers(std::vector<typename TIter::value_type>& 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 <typename TDomain>
bool CheckForUnconnectedSides(TDomain& dom);

}// end of namespace

Expand Down