mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
CGNS reader: Fix boundary/material names for MIXED elements
This commit is contained in:
parent
a88432cb7f
commit
89cb1e07ff
@ -281,11 +281,8 @@ namespace netgen::cg
|
||||
|
||||
if(type==MIXED)
|
||||
{
|
||||
bc++;
|
||||
material++;
|
||||
mesh.AddFaceDescriptor(FaceDescriptor(bc, 1, 0, 1));
|
||||
mesh.SetBCName(bc-1, ngname);
|
||||
mesh.SetMaterial(material, ngname);
|
||||
bool have_2d_elements = false;
|
||||
bool have_3d_elements = false;
|
||||
|
||||
cgsize_t nv;
|
||||
cg_ElementDataSize(fn, base, zone, section, &nv);
|
||||
@ -312,6 +309,13 @@ namespace netgen::cg
|
||||
|
||||
if(dim==2)
|
||||
{
|
||||
if(!have_2d_elements)
|
||||
{
|
||||
bc++;
|
||||
have_2d_elements = true;
|
||||
mesh.AddFaceDescriptor(FaceDescriptor(bc, 1, 0, 1));
|
||||
mesh.SetBCName(bc-1, ngname);
|
||||
}
|
||||
auto el = ReadCGNSElement2D(type, vertices.Range(vi, vertices.Size()), first_vertex);
|
||||
el.SetIndex(bc);
|
||||
mesh.AddSurfaceElement(el);
|
||||
@ -320,6 +324,13 @@ namespace netgen::cg
|
||||
|
||||
if(dim==3)
|
||||
{
|
||||
if(!have_3d_elements)
|
||||
{
|
||||
material++;
|
||||
have_3d_elements = true;
|
||||
mesh.SetMaterial(material, ngname);
|
||||
}
|
||||
|
||||
auto el = ReadCGNSElement3D(type, vertices.Range(vi, vertices.Size()), first_vertex);
|
||||
el.SetIndex(material);
|
||||
mesh.AddVolumeElement(el);
|
||||
|
Loading…
Reference in New Issue
Block a user