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