diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index fe6c0e27..b821521f 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -3160,28 +3160,38 @@ namespace netgen (*x)[j] += shapes(i) * coefs[i]; } } + if (dxdxi) { - for (int ip = 0; ip < xi->Size(); ip++) + if (info.order == 1 && type == TET) { - CalcElementDShapes (info, (*xi)[ip], dshapes); - - /* - (*dxdxi)[ip] = 0; - for (int i = 0; i < coefs.Size(); i++) - for (int j = 0; j < 3; j++) - for (int k = 0; k < 3; k++) - (*dxdxi)[ip](j,k) += dshapes(i,k) * coefs[i](j); - */ - - Mat<3,3> ds; - ds = 0; - for (int i = 0; i < coefs.Size(); i++) - for (int j = 0; j < 3; j++) - for (int k = 0; k < 3; k++) - ds(j,k) += dshapes(i,k) * coefs[i](j); - (*dxdxi)[ip] = ds; + if (xi->Size() > 0) + { + CalcElementDShapes (info, (*xi)[0], dshapes); + Mat<3,3> ds; + ds = 0; + for (int i = 0; i < coefs.Size(); i++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) + ds(j,k) += dshapes(i,k) * coefs[i](j); + + for (int ip = 0; ip < xi->Size(); ip++) + (*dxdxi)[ip] = ds; + } } + else + for (int ip = 0; ip < xi->Size(); ip++) + { + CalcElementDShapes (info, (*xi)[ip], dshapes); + + Mat<3,3> ds; + ds = 0; + for (int i = 0; i < coefs.Size(); i++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) + ds(j,k) += dshapes(i,k) * coefs[i](j); + (*dxdxi)[ip] = ds; + } } } @@ -3325,25 +3335,53 @@ namespace netgen if (dxdxi) { - for (int ip = 0; ip < n; ip++) + if (info.order == 1 && type == TET) { - Point<3> xij; - for (int k = 0; k < 3; k++) - xij(k) = xi[ip*sxi+k]; + if (n > 0) + { - CalcElementDShapes (info, xij, dshapes); - - Mat<3> dxdxij; - dxdxij = 0.0; - for (int i = 0; i < coefs.Size(); i++) - for (int j = 0; j < 3; j++) + Point<3> xij; for (int k = 0; k < 3; k++) - dxdxij(j,k) += dshapes(i,k) * coefs[i](j); - - - for (int j = 0; j < 3; j++) - for (int k = 0; k < 3; k++) - dxdxi[ip*sdxdxi+3*j+k] = dxdxij(j,k); + xij(k) = xi[k]; + + CalcElementDShapes (info, xij, dshapes); + + Mat<3> dxdxij; + dxdxij = 0.0; + for (int i = 0; i < coefs.Size(); i++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) + dxdxij(j,k) += dshapes(i,k) * coefs[i](j); + + + for (int ip = 0; ip < n; ip++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) + dxdxi[ip*sdxdxi+3*j+k] = dxdxij(j,k); + } + } + else + { + for (int ip = 0; ip < n; ip++) + { + Point<3> xij; + for (int k = 0; k < 3; k++) + xij(k) = xi[ip*sxi+k]; + + CalcElementDShapes (info, xij, dshapes); + + Mat<3> dxdxij; + dxdxij = 0.0; + for (int i = 0; i < coefs.Size(); i++) + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) + dxdxij(j,k) += dshapes(i,k) * coefs[i](j); + + + for (int j = 0; j < 3; j++) + for (int k = 0; k < 3; k++) + dxdxi[ip*sdxdxi+3*j+k] = dxdxij(j,k); + } } } } diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index c3657574..6eedc1dc 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -927,7 +927,8 @@ namespace netgen cout << "Preparing visualization (deflection = " << deflection << ") ... " << flush; BRepTools::Clean (shape); - BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, deflection, true); + // BRepMesh_IncrementalMesh:: + BRepMesh_IncrementalMesh (shape, deflection, true); cout << "done" << endl; } @@ -1220,7 +1221,7 @@ namespace netgen // Fixed a bug in the OpenCascade XDE Colour handling when // opening BREP Files, since BREP Files have no colour data. // Hence, the face_colours Handle needs to be created as a NULL handle. - occgeo->face_colours = Handle_XCAFDoc_ColorTool::Handle_XCAFDoc_ColorTool(); + occgeo->face_colours = Handle_XCAFDoc_ColorTool(); occgeo->face_colours.Nullify(); occgeo->changed = 1; occgeo->BuildFMap(); diff --git a/ng/variables.tcl b/ng/variables.tcl index 3148fbfb..52b43121 100644 --- a/ng/variables.tcl +++ b/ng/variables.tcl @@ -360,6 +360,7 @@ set parallel_netgen 0 set optfilename [file join $nguserdir ng.opt] set inifilename [file join $nguserdir ng.ini] +set meshinifilename [file join $nguserdir ngmesh.ini] global env if { [llength [array names env NG_OPT]] == 1 } { @@ -643,15 +644,14 @@ proc saveinifile { } { proc savemeshinifile { } { - uplevel 1 { - if {[catch { set datei [open ngmesh.ini w] } result ]} { - puts "cannot write to $inifilename file" - } { - for { set i [.ngmenu.file.recentmesh index last] } { $i >= 1 } { incr i -1 } { - puts $datei "recentfile \"[.ngmenu.file.recentmesh entrycget $i -label]\"" - } - close $datei - } + global meshinifilename + if {[catch { set datei [open $meshinifilename w] } result ]} { + puts "cannot write file $meshinifilename" + } { + for { set i [.ngmenu.file.recentmesh index last] } { $i >= 1 } { incr i -1 } { + puts $datei "recentfile \"[.ngmenu.file.recentmesh entrycget $i -label]\"" + } + close $datei } } @@ -675,19 +675,19 @@ proc loadinifile { } { proc loadmeshinifile { } { - if { [file exists ngmesh.ini] == 1 } { - set datei [open ngmesh.ini r] + global meshinifilename + if { [file exists $meshinifilename] == 1 } { + set datei [open $meshinifilename r] while { [gets $datei line] >= 0 } { if {[lindex $line 0] == "recentfile"} { - set filename [lindex $line 1] - if { [file exists $filename] == 1 } { - AddRecentMeshFile $filename - } + set filename [lindex $line 1] + if { [file exists $filename] == 1 } { + AddRecentMeshFile $filename + } } } close $datei } - -} + } diff --git a/nglib/nglib.cpp b/nglib/nglib.cpp index 659d21d0..3ef81549 100644 --- a/nglib/nglib.cpp +++ b/nglib/nglib.cpp @@ -658,7 +658,8 @@ namespace nglib OCCGeometry * occgeo = LoadOCC_STEP(filename); // Create the initial triangulation for the OCC - BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh(occgeo->shape,0.1); + // BRepMesh_IncrementalMesh:: + BRepMesh_IncrementalMesh(occgeo->shape,0.1); geo = (Ng_OCC_Geometry *)occgeo; @@ -675,7 +676,8 @@ namespace nglib OCCGeometry * occgeo = LoadOCC_IGES(filename); // Create the initial triangulation for the OCC - BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh(occgeo->shape,0.1); + // BRepMesh_IncrementalMesh:: + BRepMesh_IncrementalMesh(occgeo->shape,0.1); geo = (Ng_OCC_Geometry *)occgeo; @@ -692,7 +694,8 @@ namespace nglib OCCGeometry * occgeo = LoadOCC_BREP(filename); // Create the initial triangulation for the OCC - BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh(occgeo->shape,0.1); + // BRepMesh_IncrementalMesh:: + BRepMesh_IncrementalMesh(occgeo->shape,0.1); geo = (Ng_OCC_Geometry *)occgeo;