mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20: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)
|
if(type==MIXED)
|
||||||
{
|
{
|
||||||
bc++;
|
bool have_2d_elements = false;
|
||||||
material++;
|
bool have_3d_elements = false;
|
||||||
mesh.AddFaceDescriptor(FaceDescriptor(bc, 1, 0, 1));
|
|
||||||
mesh.SetBCName(bc-1, ngname);
|
|
||||||
mesh.SetMaterial(material, ngname);
|
|
||||||
|
|
||||||
cgsize_t nv;
|
cgsize_t nv;
|
||||||
cg_ElementDataSize(fn, base, zone, section, &nv);
|
cg_ElementDataSize(fn, base, zone, section, &nv);
|
||||||
@ -312,6 +309,13 @@ namespace netgen::cg
|
|||||||
|
|
||||||
if(dim==2)
|
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);
|
auto el = ReadCGNSElement2D(type, vertices.Range(vi, vertices.Size()), first_vertex);
|
||||||
el.SetIndex(bc);
|
el.SetIndex(bc);
|
||||||
mesh.AddSurfaceElement(el);
|
mesh.AddSurfaceElement(el);
|
||||||
@ -320,6 +324,13 @@ namespace netgen::cg
|
|||||||
|
|
||||||
if(dim==3)
|
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);
|
auto el = ReadCGNSElement3D(type, vertices.Range(vi, vertices.Size()), first_vertex);
|
||||||
el.SetIndex(material);
|
el.SetIndex(material);
|
||||||
mesh.AddVolumeElement(el);
|
mesh.AddVolumeElement(el);
|
||||||
|
Loading…
Reference in New Issue
Block a user