1 # ifndef __util__domain_util__h__
2 # define __util__domain_util__h__
25 template <
typename TObject>
37 template <
typename TDomain>
38 bool CheckSubsets(
const TDomain &dom,
const std::vector<std::string> &neededSubsets)
40 auto sh = dom.subset_handler();
42 for (
auto &subset : neededSubsets) {
43 if (sh->get_subset_index(subset.c_str()) == -1) {
44 UG_LOG(
"Domain does not contain subset '" << subset.c_str() <<
"'.");
71 template <
typename TDomain>
73 const std::vector<std::string> &neededSubsets,
bool noIntegrityCheck=
false) {
76 auto dom = make_sp<TDomain>(
new TDomain());
79 UG_LOG(
"Loading Domain " << gridName <<
" ... ")
81 UG_LOG(
"done." << std::endl)
84 if (noIntegrityCheck ==
false) {
85 UG_LOG(
"Performing integrity check on domain ... ");
88 UG_LOG(
"WARNING: unconnected sides found (see above).\n");
89 std::string note(
"NOTE: You may disable this check by passing 'true' to 'noIntegrityCheck' in 'util.CreateDomain'.\n");
112 if (!neededSubsets.empty())
116 "Something wrong with required subsets. Aborting.");
124 template <
typename TDomain>
127 return CreateDomain<TDomain>(gridName,
numRefs, neededSubsets,
false);
130 template <
typename TDomain>
133 return CreateDomain<TDomain>(gridName,
numRefs, std::vector<std::string>());
136 template <
typename TDomain>
139 return CreateDomain<TDomain>(gridName, 0);
parameterNumber numRefs
Definition: evaluate.lua:2
void LoadDomain(TDomain &domain, const char *filename)
#define UG_ASSERT(expr, msg)
void write(TObject &text)
Definition: domain_util.h:26
bool CheckSubsets(const TDomain &dom, const std::vector< std::string > &neededSubsets)
Definition: domain_util.h:38
SmartPtr< TDomain > CreateDomain(const std::string &gridName, int numRefs, const std::vector< std::string > &neededSubsets, bool noIntegrityCheck=false)
Definition: domain_util.h:72
static SmartPtr< IRefiner > GlobalDomainRefiner(TDomain &dom)
bool CheckForUnconnectedSides(Grid &grid)