curved elements work, too

This commit is contained in:
Julius Zimmermann 2019-07-16 10:42:27 +02:00
parent bffdf689ae
commit fe782670f8

View File

@ -127,7 +127,7 @@ namespace netgen
cout << "read " << mesh.GetNP() << " points" << endl;
Point3d pmin, pmax;
mesh.GetBox (pmin, pmax);
if(fabs(pmin.Z() - pmax.Z()) < 1e-10) //hard-coded for now
if(fabs(pmin.Z() - pmax.Z()) < 1e-10 * Dist(pmin, pmax))
{
cout << "Set Dimension to 2." << endl;
mesh.SetDimension(2);
@ -186,9 +186,17 @@ namespace netgen
el[1] = nodes[2];
el[2] = nodes[1];
if(dim == 3){
auto nr = tmp_segments.Size();
tmp_segments.Append(el);
element_map[label] = std::make_tuple(nr+1, 2);
}
else if(dim == 2){
el.si = -1; // add label to segment, will be changed later when BC's are assigned
auto nr = mesh.AddSegment(el);
element_map[label] = std::make_tuple(nr+1, 2);
}
break;
}
case 41: // TRIG