Skip to content
Snippets Groups Projects
Commit 5bbeb054 authored by Laurent Van Migroet's avatar Laurent Van Migroet
Browse files

added new function to get the number of a physical entity from its name and dimension

getPhysicalNumber(const int &dim, const std::string & name)
parent b837e962
No related branches found
No related tags found
No related merge requests found
......@@ -312,6 +312,15 @@ std::string GModel::getPhysicalName(int dim, int number)
return "";
}
int GModel::getPhysicalNumber(const int &dim, const std::string & name)
{
for(piter physIt=firstPhysicalName();physIt !=lastPhysicalName();++physIt)
if(dim==physIt->first.first && name==physIt->second)
return physIt->first.second;
Msg::Warning("No physical group found with the name :",name);
return -1;
}
void GModel::setSelection(int val)
{
std::vector<GEntity*> entities;
......
......@@ -229,6 +229,10 @@ class GModel
// "dim" and id number "num"
std::string getPhysicalName(int dim, int num);
// get the number of a given physical group of dimension
// "dim" and name "name". return -1 if not found
int getPhysicalNumber(const int &dim, const std::string & name);
// set the selection flag on all entities
void setSelection(int val);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment