add unified GetMaterial for co-dimension

This commit is contained in:
Joachim Schöberl 2017-02-24 17:18:42 +01:00
parent ea00690a2a
commit a698b57596
2 changed files with 18 additions and 0 deletions

View File

@ -234,6 +234,9 @@ namespace netgen
template <int DIM>
int GetElementIndex (int nr) const;
/// material/boundary label of region, template argument is co-dimension
template <int DIM>
const string & GetMaterialCD (int region_nr) const;
/// Curved Elements:
/// elnr .. element nr

View File

@ -175,8 +175,23 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<3> (int nr) const
template <> NGX_INLINE DLL_HEADER
const string & Ngx_Mesh :: GetMaterialCD<0> (int region_nr) const
{
return mesh->GetMaterial(region_nr+1);
}
template <> NGX_INLINE DLL_HEADER
const string & Ngx_Mesh :: GetMaterialCD<1> (int region_nr) const
{
return mesh->GetBCName(region_nr);
}
template <> NGX_INLINE DLL_HEADER
const string & Ngx_Mesh :: GetMaterialCD<2> (int region_nr) const
{
return mesh->GetCD2Name(region_nr);
}