10 bool all_elems_are(std::vector<int> &container)
11 {
return std::all_of(container.begin(), container.end(), [](
int &e_type){return e_type == TYPE;} ); }
17 bool checkNamedObjects(std::vector<T>
const &v_prm,
const int dim_obj)
19 bool existRegions(
true);
20 std::vector<std::pair<int, int> > physGroups;
21 gmsh::model::getPhysicalGroups(physGroups,dim_obj);
22 std::vector<std::string> o_names;
23 std::for_each(physGroups.begin(),physGroups.end(),[&o_names]( std::pair<int, int> &pGroup)
25 std::string physGroupName;
26 gmsh::model::getPhysicalName(pGroup.first, pGroup.second, physGroupName);
27 o_names.push_back(physGroupName);
30 std::for_each(v_prm.begin(),v_prm.end(),[&existRegions,&o_names](
const auto &p)
32 if (p.regName !=
"__default__")
34 if (!std::any_of(o_names.begin(),o_names.end(),
35 [&p] (std::string &elem) { return p.regName == elem; } ) )
37 std::cout <<
"Fatal Error: region " << p.regName <<
" not found.\n";
47 void suppress_copies(std::vector<T> &v_idx)
49 std::sort(v_idx.begin(), v_idx.end());
50 v_idx.resize( std::distance(v_idx.begin(), std::unique(v_idx.begin(), v_idx.end())) );
51 v_idx.shrink_to_fit();