mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
inline GetCD2NamePtr
This commit is contained in:
parent
e1917c8d8a
commit
701d6a2369
@ -74,9 +74,8 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<1> (size_t nr) const
|
|||||||
ret.mat = mesh->GetBCNamePtr(el.si-1);
|
ret.mat = mesh->GetBCNamePtr(el.si-1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mesh->GetDimension() == 3){
|
if (mesh->GetDimension() == 3)
|
||||||
ret.mat = &mesh->GetCD2Name(el.edgenr-1);
|
ret.mat = mesh->GetCD2NamePtr(el.edgenr-1);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
ret.mat = nullptr;
|
ret.mat = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -5832,6 +5832,7 @@ namespace netgen
|
|||||||
cd2names[cd2nr] = nullptr;
|
cd2names[cd2nr] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Mesh :: cd2_default_name = "default";
|
||||||
const string & Mesh :: GetCD2Name (int cd2nr) const
|
const string & Mesh :: GetCD2Name (int cd2nr) const
|
||||||
{
|
{
|
||||||
static string defaultstring = "default";
|
static string defaultstring = "default";
|
||||||
|
@ -606,6 +606,12 @@ namespace netgen
|
|||||||
DLL_HEADER void SetCD2Name (int cd2nr, const string & abcname);
|
DLL_HEADER void SetCD2Name (int cd2nr, const string & abcname);
|
||||||
|
|
||||||
const string & GetCD2Name (int cd2nr ) const;
|
const string & GetCD2Name (int cd2nr ) const;
|
||||||
|
static string cd2_default_name;
|
||||||
|
string * GetCD2NamePtr (int cd2nr ) const
|
||||||
|
{
|
||||||
|
if (cd2nr < cd2names.Size() && cd2names[cd2nr]) return cd2names[cd2nr];
|
||||||
|
return &cd2_default_name;
|
||||||
|
}
|
||||||
size_t GetNCD2Names() const { return cd2names.Size(); }
|
size_t GetNCD2Names() const { return cd2names.Size(); }
|
||||||
|
|
||||||
string * GetBCNamePtr (int bcnr) const
|
string * GetBCNamePtr (int bcnr) const
|
||||||
|
Loading…
Reference in New Issue
Block a user