From aa3ce9653f314bff88b70df87ff569e3c14ed715 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Fri, 26 Sep 2014 11:51:10 +0000 Subject: [PATCH] 2d bc --- libsrc/geom2d/genmesh2d.cpp | 11 +++++------ libsrc/geom2d/python_geom2d.cpp | 5 +++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libsrc/geom2d/genmesh2d.cpp b/libsrc/geom2d/genmesh2d.cpp index 8f6d6050..f8d0f882 100644 --- a/libsrc/geom2d/genmesh2d.cpp +++ b/libsrc/geom2d/genmesh2d.cpp @@ -377,6 +377,8 @@ namespace netgen geometry.PartitionBoundary (mp, h, *mesh); + + PrintMessage (3, "Boundary mesh done, np = ", mesh->GetNP()); // marks mesh points for hp-refinement @@ -413,18 +415,15 @@ namespace netgen // number of bcnames int maxsegmentindex = 0; for (SegmentIndex si = 0; si < mesh->GetNSeg(); si++) - { - if ( (*mesh)[si].si > maxsegmentindex) maxsegmentindex = (*mesh)[si].si; - } + if ( (*mesh)[si].si > maxsegmentindex) maxsegmentindex = (*mesh)[si].si; - mesh->SetNBCNames(maxsegmentindex); + mesh->SetNBCNames(maxsegmentindex+1); - for ( int sindex = 0; sindex < maxsegmentindex; sindex++ ) + for ( int sindex = 0; sindex <= maxsegmentindex; sindex++ ) mesh->SetBCName ( sindex, geometry.GetBCName( sindex+1 ) ); for (SegmentIndex si = 0; si < mesh->GetNSeg(); si++) (*mesh)[si].SetBCName ( (*mesh).GetBCNamePtr( (*mesh)[si].si-1 ) ); - mesh->CalcLocalH(mp.grading); diff --git a/libsrc/geom2d/python_geom2d.cpp b/libsrc/geom2d/python_geom2d.cpp index e8b94ce1..50254525 100644 --- a/libsrc/geom2d/python_geom2d.cpp +++ b/libsrc/geom2d/python_geom2d.cpp @@ -62,7 +62,7 @@ void ExportGeom2d() self.geompoints.Append(GeomPoint<2>(p,1)); return self.geompoints.Size()-1; })) - .def("Append", FunctionPointer([](SplineGeometry2d &self, bp::list segment, int leftdomain, int rightdomain) + .def("Append", FunctionPointer([](SplineGeometry2d &self, bp::list segment, int leftdomain, int rightdomain, int bc) { bp::extract segtype(segment[0]); @@ -94,8 +94,9 @@ void ExportGeom2d() seg->hmax = 1e99; seg->reffak = 1; seg->copyfrom = -1; + seg->bc = (bc >= 0) ? bc : self.GetNSplines(); self.AppendSegment(seg); - }), (bp::arg("self"), bp::arg("point_indices"), bp::arg("leftdomain") = 1, bp::arg("rightdomain") = 0)) + }), (bp::arg("self"), bp::arg("point_indices"), bp::arg("leftdomain") = 1, bp::arg("rightdomain") = 0, bp::arg("bc")=-1)) .def("AppendSegment", FunctionPointer([](SplineGeometry2d &self, bp::list point_indices, int leftdomain, int rightdomain) { int npts = bp::len(point_indices);