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
Branches
Tags
No related merge requests found
...@@ -312,6 +312,15 @@ std::string GModel::getPhysicalName(int dim, int number) ...@@ -312,6 +312,15 @@ std::string GModel::getPhysicalName(int dim, int number)
return ""; 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) void GModel::setSelection(int val)
{ {
std::vector<GEntity*> entities; std::vector<GEntity*> entities;
... ...
......
...@@ -229,6 +229,10 @@ class GModel ...@@ -229,6 +229,10 @@ class GModel
// "dim" and id number "num" // "dim" and id number "num"
std::string getPhysicalName(int dim, int 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 // set the selection flag on all entities
void setSelection(int val); 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