meshinifile in userdir

This commit is contained in:
Joachim Schoeberl 2010-03-08 20:07:21 +00:00
parent 1b275bf988
commit 9f8f784370
4 changed files with 98 additions and 56 deletions

View File

@ -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);
}
}
}
}

View File

@ -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();

View File

@ -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
}
}
}

View File

@ -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;