From c4b532aac24e5ebc530bbc7a6d37725cb35b2f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Wed, 21 Oct 2015 17:49:23 +0200 Subject: [PATCH] set 2d maxh --- libsrc/geom2d/geometry2d.cpp | 15 ++++++++++++++- libsrc/geom2d/geometry2d.hpp | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libsrc/geom2d/geometry2d.cpp b/libsrc/geom2d/geometry2d.cpp index 6d89b182..cb7631d0 100644 --- a/libsrc/geom2d/geometry2d.cpp +++ b/libsrc/geom2d/geometry2d.cpp @@ -935,7 +935,7 @@ namespace netgen - double SplineGeometry2d :: GetDomainMaxh( const int domnr ) + double SplineGeometry2d :: GetDomainMaxh (const int domnr ) { if ( maxh.Size() >= domnr && domnr > 0) return maxh[domnr-1]; @@ -943,7 +943,20 @@ namespace netgen return -1; } + void SplineGeometry2d :: SetDomainMaxh (int domnr, double h) + { + int oldsize = maxh.Size(); + if (domnr > maxh.Size()) maxh.SetSize (domnr); + for (int i = oldsize; i < domnr; i++) + maxh[i] = 1e99; + + if (domnr >= 1) + maxh[domnr] = h; + else + throw NgException ("material index out of range"); + } + extern void MeshFromSpline2D (SplineGeometry2d & geometry, shared_ptr & mesh, diff --git a/libsrc/geom2d/geometry2d.hpp b/libsrc/geom2d/geometry2d.hpp index 7f435025..47ffec2e 100644 --- a/libsrc/geom2d/geometry2d.hpp +++ b/libsrc/geom2d/geometry2d.hpp @@ -163,6 +163,8 @@ namespace netgen void SetMaterial (int domnr, const string & material); double GetDomainMaxh ( const int domnr ); + void SetDomainMaxh ( const int domnr, double maxh ); + bool GetDomainQuadMeshing ( int domnr ) { if ( quadmeshing.Size() ) return quadmeshing[domnr-1];