mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
meshinifile in userdir
This commit is contained in:
parent
1b275bf988
commit
9f8f784370
@ -3160,28 +3160,38 @@ namespace netgen
|
|||||||
(*x)[j] += shapes(i) * coefs[i];
|
(*x)[j] += shapes(i) * coefs[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dxdxi)
|
if (dxdxi)
|
||||||
{
|
{
|
||||||
for (int ip = 0; ip < xi->Size(); ip++)
|
if (info.order == 1 && type == TET)
|
||||||
{
|
{
|
||||||
CalcElementDShapes (info, (*xi)[ip], dshapes);
|
if (xi->Size() > 0)
|
||||||
|
{
|
||||||
/*
|
CalcElementDShapes (info, (*xi)[0], dshapes);
|
||||||
(*dxdxi)[ip] = 0;
|
Mat<3,3> ds;
|
||||||
for (int i = 0; i < coefs.Size(); i++)
|
ds = 0;
|
||||||
for (int j = 0; j < 3; j++)
|
for (int i = 0; i < coefs.Size(); i++)
|
||||||
for (int k = 0; k < 3; k++)
|
for (int j = 0; j < 3; j++)
|
||||||
(*dxdxi)[ip](j,k) += dshapes(i,k) * coefs[i](j);
|
for (int k = 0; k < 3; k++)
|
||||||
*/
|
ds(j,k) += dshapes(i,k) * coefs[i](j);
|
||||||
|
|
||||||
Mat<3,3> ds;
|
for (int ip = 0; ip < xi->Size(); ip++)
|
||||||
ds = 0;
|
(*dxdxi)[ip] = ds;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
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)
|
if (dxdxi)
|
||||||
{
|
{
|
||||||
for (int ip = 0; ip < n; ip++)
|
if (info.order == 1 && type == TET)
|
||||||
{
|
{
|
||||||
Point<3> xij;
|
if (n > 0)
|
||||||
for (int k = 0; k < 3; k++)
|
{
|
||||||
xij(k) = xi[ip*sxi+k];
|
|
||||||
|
|
||||||
CalcElementDShapes (info, xij, dshapes);
|
Point<3> xij;
|
||||||
|
|
||||||
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++)
|
for (int k = 0; k < 3; k++)
|
||||||
dxdxij(j,k) += dshapes(i,k) * coefs[i](j);
|
xij(k) = xi[k];
|
||||||
|
|
||||||
|
CalcElementDShapes (info, xij, dshapes);
|
||||||
for (int j = 0; j < 3; j++)
|
|
||||||
for (int k = 0; k < 3; k++)
|
Mat<3> dxdxij;
|
||||||
dxdxi[ip*sdxdxi+3*j+k] = dxdxij(j,k);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -927,7 +927,8 @@ namespace netgen
|
|||||||
cout << "Preparing visualization (deflection = " << deflection << ") ... " << flush;
|
cout << "Preparing visualization (deflection = " << deflection << ") ... " << flush;
|
||||||
|
|
||||||
BRepTools::Clean (shape);
|
BRepTools::Clean (shape);
|
||||||
BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, deflection, true);
|
// BRepMesh_IncrementalMesh::
|
||||||
|
BRepMesh_IncrementalMesh (shape, deflection, true);
|
||||||
cout << "done" << endl;
|
cout << "done" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1220,7 +1221,7 @@ namespace netgen
|
|||||||
// Fixed a bug in the OpenCascade XDE Colour handling when
|
// Fixed a bug in the OpenCascade XDE Colour handling when
|
||||||
// opening BREP Files, since BREP Files have no colour data.
|
// opening BREP Files, since BREP Files have no colour data.
|
||||||
// Hence, the face_colours Handle needs to be created as a NULL handle.
|
// 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->face_colours.Nullify();
|
||||||
occgeo->changed = 1;
|
occgeo->changed = 1;
|
||||||
occgeo->BuildFMap();
|
occgeo->BuildFMap();
|
||||||
|
@ -360,6 +360,7 @@ set parallel_netgen 0
|
|||||||
|
|
||||||
set optfilename [file join $nguserdir ng.opt]
|
set optfilename [file join $nguserdir ng.opt]
|
||||||
set inifilename [file join $nguserdir ng.ini]
|
set inifilename [file join $nguserdir ng.ini]
|
||||||
|
set meshinifilename [file join $nguserdir ngmesh.ini]
|
||||||
|
|
||||||
global env
|
global env
|
||||||
if { [llength [array names env NG_OPT]] == 1 } {
|
if { [llength [array names env NG_OPT]] == 1 } {
|
||||||
@ -643,15 +644,14 @@ proc saveinifile { } {
|
|||||||
|
|
||||||
|
|
||||||
proc savemeshinifile { } {
|
proc savemeshinifile { } {
|
||||||
uplevel 1 {
|
global meshinifilename
|
||||||
if {[catch { set datei [open ngmesh.ini w] } result ]} {
|
if {[catch { set datei [open $meshinifilename w] } result ]} {
|
||||||
puts "cannot write to $inifilename file"
|
puts "cannot write file $meshinifilename"
|
||||||
} {
|
} {
|
||||||
for { set i [.ngmenu.file.recentmesh index last] } { $i >= 1 } { incr i -1 } {
|
for { set i [.ngmenu.file.recentmesh index last] } { $i >= 1 } { incr i -1 } {
|
||||||
puts $datei "recentfile \"[.ngmenu.file.recentmesh entrycget $i -label]\""
|
puts $datei "recentfile \"[.ngmenu.file.recentmesh entrycget $i -label]\""
|
||||||
}
|
}
|
||||||
close $datei
|
close $datei
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,19 +675,19 @@ proc loadinifile { } {
|
|||||||
|
|
||||||
|
|
||||||
proc loadmeshinifile { } {
|
proc loadmeshinifile { } {
|
||||||
if { [file exists ngmesh.ini] == 1 } {
|
global meshinifilename
|
||||||
set datei [open ngmesh.ini r]
|
if { [file exists $meshinifilename] == 1 } {
|
||||||
|
set datei [open $meshinifilename r]
|
||||||
while { [gets $datei line] >= 0 } {
|
while { [gets $datei line] >= 0 } {
|
||||||
if {[lindex $line 0] == "recentfile"} {
|
if {[lindex $line 0] == "recentfile"} {
|
||||||
set filename [lindex $line 1]
|
set filename [lindex $line 1]
|
||||||
if { [file exists $filename] == 1 } {
|
if { [file exists $filename] == 1 } {
|
||||||
AddRecentMeshFile $filename
|
AddRecentMeshFile $filename
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close $datei
|
close $datei
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -658,7 +658,8 @@ namespace nglib
|
|||||||
OCCGeometry * occgeo = LoadOCC_STEP(filename);
|
OCCGeometry * occgeo = LoadOCC_STEP(filename);
|
||||||
|
|
||||||
// Create the initial triangulation for the OCC
|
// 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;
|
geo = (Ng_OCC_Geometry *)occgeo;
|
||||||
|
|
||||||
@ -675,7 +676,8 @@ namespace nglib
|
|||||||
OCCGeometry * occgeo = LoadOCC_IGES(filename);
|
OCCGeometry * occgeo = LoadOCC_IGES(filename);
|
||||||
|
|
||||||
// Create the initial triangulation for the OCC
|
// 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;
|
geo = (Ng_OCC_Geometry *)occgeo;
|
||||||
|
|
||||||
@ -692,7 +694,8 @@ namespace nglib
|
|||||||
OCCGeometry * occgeo = LoadOCC_BREP(filename);
|
OCCGeometry * occgeo = LoadOCC_BREP(filename);
|
||||||
|
|
||||||
// Create the initial triangulation for the OCC
|
// 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;
|
geo = (Ng_OCC_Geometry *)occgeo;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user