mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Merge branch 'unv_meshes' into 'master'
Unv meshes See merge request jschoeberl/netgen!160
This commit is contained in:
commit
84f453a4be
@ -99,6 +99,7 @@ namespace netgen
|
||||
// map from unv element nr to our element number + an index if it is vol (0), bnd(1), ...
|
||||
std::map<size_t, std::tuple<size_t, int>> element_map;
|
||||
|
||||
Array<Segment> tmp_segments;
|
||||
while (in.good())
|
||||
{
|
||||
in >> reco;
|
||||
@ -155,7 +156,9 @@ namespace netgen
|
||||
el[0] = nodes[0];
|
||||
el[1] = nodes[2];
|
||||
el[2] = nodes[1];
|
||||
auto nr = mesh.AddSegment (el);
|
||||
|
||||
auto nr = tmp_segments.Size();
|
||||
tmp_segments.Append(el);
|
||||
element_map[label] = std::make_tuple(nr+1, 2);
|
||||
break;
|
||||
}
|
||||
@ -229,7 +232,6 @@ namespace netgen
|
||||
|
||||
in >> hi >> index >> hi >> hi;
|
||||
int codim = get<1>(element_map[index]);
|
||||
|
||||
// use first element to determine if boundary or volume
|
||||
|
||||
switch (codim)
|
||||
@ -256,8 +258,9 @@ namespace netgen
|
||||
ed.SetSurfNr(0,bcpr);//?
|
||||
ednr = mesh.AddEdgeDescriptor(ed);
|
||||
mesh.SetCD2Name(bcpr, name);
|
||||
string * bcname = new string(name);
|
||||
mesh.LineSegment(get<0>(element_map[index])).SetBCName(bcname);
|
||||
auto nr = mesh.AddSegment(tmp_segments[get<0>(element_map[index])-1]);
|
||||
mesh[nr].SetBCName(mesh.GetCD2NamePtr(mesh.GetNCD2Names()));
|
||||
mesh[nr].edgenr = ednr+1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -278,7 +281,11 @@ namespace netgen
|
||||
mesh.SurfaceElement(get<0>(element_map[index])).SetIndex(fdnr);
|
||||
break;
|
||||
case 2:
|
||||
mesh.LineSegment(get<0>(element_map[index])).edgenr = ednr+1;
|
||||
{
|
||||
auto nr = mesh.AddSegment(tmp_segments[get<0>(element_map[index])-1]);
|
||||
mesh[nr].edgenr = ednr+1;
|
||||
mesh[nr].SetBCName(mesh.GetCD2NamePtr(mesh.GetNCD2Names()));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user