mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
polish
This commit is contained in:
parent
22222d4cbc
commit
bfc7e7772f
@ -88,7 +88,8 @@ namespace netgen
|
|||||||
const TopLevelObject * tlo = geometry -> GetTopLevelObject (i);
|
const TopLevelObject * tlo = geometry -> GetTopLevelObject (i);
|
||||||
if (tlo->GetVisible() && !tlo->GetTransparent())
|
if (tlo->GetVisible() && !tlo->GetTransparent())
|
||||||
{
|
{
|
||||||
float mat_col[] = { tlo->GetRed(), tlo->GetGreen(), tlo->GetBlue(), 1 };
|
float mat_col[] = { float(tlo->GetRed()), float(tlo->GetGreen()),
|
||||||
|
float(tlo->GetBlue()), 1 };
|
||||||
glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat_col);
|
glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat_col);
|
||||||
|
|
||||||
glCallList (trilists[i]);
|
glCallList (trilists[i]);
|
||||||
@ -105,7 +106,8 @@ namespace netgen
|
|||||||
const TopLevelObject * tlo = geometry -> GetTopLevelObject (i);
|
const TopLevelObject * tlo = geometry -> GetTopLevelObject (i);
|
||||||
if (tlo->GetVisible() && tlo->GetTransparent())
|
if (tlo->GetVisible() && tlo->GetTransparent())
|
||||||
{
|
{
|
||||||
float mat_col[] = { tlo->GetRed(), tlo->GetGreen(), tlo->GetBlue(), transp };
|
float mat_col[] = { float(tlo->GetRed()), float(tlo->GetGreen()),
|
||||||
|
float(tlo->GetBlue()), float(transp) };
|
||||||
|
|
||||||
glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat_col);
|
glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat_col);
|
||||||
|
|
||||||
@ -326,9 +328,9 @@ namespace netgen
|
|||||||
if (vispar.drawededgenrs)
|
if (vispar.drawededgenrs)
|
||||||
{
|
{
|
||||||
glEnable (GL_COLOR_MATERIAL);
|
glEnable (GL_COLOR_MATERIAL);
|
||||||
GLfloat textcol[3] = { 1 - backcolor,
|
GLfloat textcol[3] = { GLfloat(1 - backcolor),
|
||||||
1 - backcolor,
|
GLfloat(1 - backcolor),
|
||||||
1 - backcolor };
|
GLfloat(1 - backcolor) };
|
||||||
glColor3fv (textcol);
|
glColor3fv (textcol);
|
||||||
glNormal3d (0, 0, 1);
|
glNormal3d (0, 0, 1);
|
||||||
glPushAttrib (GL_LIST_BIT);
|
glPushAttrib (GL_LIST_BIT);
|
||||||
@ -397,9 +399,9 @@ namespace netgen
|
|||||||
if (vispar.drawedpointnrs)
|
if (vispar.drawedpointnrs)
|
||||||
{
|
{
|
||||||
glEnable (GL_COLOR_MATERIAL);
|
glEnable (GL_COLOR_MATERIAL);
|
||||||
GLfloat textcol[3] = { 1 - backcolor,
|
GLfloat textcol[3] = { GLfloat(1 - backcolor),
|
||||||
1 - backcolor,
|
GLfloat(1 - backcolor),
|
||||||
1 - backcolor };
|
GLfloat(1 - backcolor) };
|
||||||
glColor3fv (textcol);
|
glColor3fv (textcol);
|
||||||
glNormal3d (0, 0, 1);
|
glNormal3d (0, 0, 1);
|
||||||
glPushAttrib (GL_LIST_BIT);
|
glPushAttrib (GL_LIST_BIT);
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
C++ interface to Netgen
|
C++ interface to Netgen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// #include "../general/archive_base.hpp"
|
|
||||||
// namespace ngstd { class Archive; }
|
|
||||||
|
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "nginterface.h"
|
#include "nginterface.h"
|
||||||
#include "nginterface_v2.hpp"
|
#include "nginterface_v2.hpp"
|
||||||
|
|
||||||
|
#include "../general/archive_base.hpp"
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
|
@ -344,7 +344,6 @@ namespace netgen
|
|||||||
if(!surfid.Contains(mesh.LineSegment(j).si))
|
if(!surfid.Contains(mesh.LineSegment(j).si))
|
||||||
{
|
{
|
||||||
int pnt_commelem = 0;
|
int pnt_commelem = 0;
|
||||||
int pnum_commelem = 0;
|
|
||||||
Array<int> pnt1_elems;
|
Array<int> pnt1_elems;
|
||||||
Array<int> pnt2_elems;
|
Array<int> pnt2_elems;
|
||||||
|
|
||||||
@ -366,6 +365,8 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
int pnum_commelem = 0;
|
||||||
for(int k = 1; k <= mesh.SurfaceElement(pnt_commelem).GetNP(); k++)
|
for(int k = 1; k <= mesh.SurfaceElement(pnt_commelem).GetNP(); k++)
|
||||||
{
|
{
|
||||||
if((mesh.SurfaceElement(pnt_commelem).PNum(k) != segpair_p1)
|
if((mesh.SurfaceElement(pnt_commelem).PNum(k) != segpair_p1)
|
||||||
@ -374,6 +375,7 @@ namespace netgen
|
|||||||
pnum_commelem = mesh.SurfaceElement(pnt_commelem).PNum(k);
|
pnum_commelem = mesh.SurfaceElement(pnt_commelem).PNum(k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
Vec3d surfelem_vect, surfelem_vect1;
|
Vec3d surfelem_vect, surfelem_vect1;
|
||||||
|
|
||||||
|
@ -652,16 +652,16 @@ namespace netgen
|
|||||||
|
|
||||||
for (int i2 = 0; i2 < edgenrs.Size(); i2++)
|
for (int i2 = 0; i2 < edgenrs.Size(); i2++)
|
||||||
{
|
{
|
||||||
PointIndex pi1 = el[edges[i2][0]];
|
// PointIndex pi1 = el[edges[i2][0]];
|
||||||
PointIndex pi2 = el[edges[i2][1]];
|
// PointIndex pi2 = el[edges[i2][1]];
|
||||||
|
|
||||||
bool swap = pi1 > pi2;
|
// bool swap = pi1 > pi2;
|
||||||
|
|
||||||
Point<3> p1 = mesh[pi1];
|
// Point<3> p1 = mesh[pi1];
|
||||||
Point<3> p2 = mesh[pi2];
|
// Point<3> p2 = mesh[pi2];
|
||||||
|
|
||||||
int order1 = edgeorder[edgenrs[i2]];
|
// int order1 = edgeorder[edgenrs[i2]];
|
||||||
int ndof = max (0, order1-1);
|
// int ndof = max (0, order1-1);
|
||||||
|
|
||||||
surfnr[edgenrs[i2]] = mesh.GetFaceDescriptor(el.GetIndex()).SurfNr();
|
surfnr[edgenrs[i2]] = mesh.GetFaceDescriptor(el.GetIndex()).SurfNr();
|
||||||
gi0[edgenrs[i2]] = el.GeomInfoPi(edges[i2][0]+1);
|
gi0[edgenrs[i2]] = el.GeomInfoPi(edges[i2][0]+1);
|
||||||
@ -1163,7 +1163,7 @@ namespace netgen
|
|||||||
for (int k = 0; k < verts.Size(); k++)
|
for (int k = 0; k < verts.Size(); k++)
|
||||||
pp += lami[k] * Vec<3> (mesh.Point(verts[k]));
|
pp += lami[k] * Vec<3> (mesh.Point(verts[k]));
|
||||||
|
|
||||||
const ELEMENT_EDGE * edges = MeshTopology::GetEdges0 (TRIG);
|
// const ELEMENT_EDGE * edges = MeshTopology::GetEdges0 (TRIG);
|
||||||
for (int k = 0; k < edgenrs.Size(); k++)
|
for (int k = 0; k < edgenrs.Size(); k++)
|
||||||
{
|
{
|
||||||
int eorder = edgeorder[edgenrs[k]];
|
int eorder = edgeorder[edgenrs[k]];
|
||||||
|
@ -394,7 +394,7 @@ namespace netgen
|
|||||||
|
|
||||||
selbuf.Add (dest, sei);
|
selbuf.Add (dest, sei);
|
||||||
selbuf.Add (dest, sel.GetIndex());
|
selbuf.Add (dest, sel.GetIndex());
|
||||||
selbuf.Add (dest, 0);
|
// selbuf.Add (dest, 0);
|
||||||
selbuf.Add (dest, sel.GetNP());
|
selbuf.Add (dest, sel.GetNP());
|
||||||
|
|
||||||
for ( int ii = 1; ii <= sel.GetNP(); ii++)
|
for ( int ii = 1; ii <= sel.GetNP(); ii++)
|
||||||
@ -636,7 +636,7 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
int globsel = selbuf[ii++];
|
int globsel = selbuf[ii++];
|
||||||
int faceind = selbuf[ii++];
|
int faceind = selbuf[ii++];
|
||||||
bool isghost = selbuf[ii++];
|
//bool isghost = selbuf[ii++];
|
||||||
int nep = selbuf[ii++];
|
int nep = selbuf[ii++];
|
||||||
Element2d tri(nep);
|
Element2d tri(nep);
|
||||||
tri.SetIndex(faceind);
|
tri.SetIndex(faceind);
|
||||||
@ -788,8 +788,8 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
eptr.Append (eind.Size());
|
eptr.Append (eind.Size());
|
||||||
const Segment & el = LineSegment(i+1);
|
const Segment & el = LineSegment(i+1);
|
||||||
eind.Append (el[0]);
|
eind.Append (el[0]-1);
|
||||||
eind.Append (el[1]);
|
eind.Append (el[1]-1);
|
||||||
}
|
}
|
||||||
eptr.Append (eind.Size());
|
eptr.Append (eind.Size());
|
||||||
Array<idx_t> epart(ne), npart(nn);
|
Array<idx_t> epart(ne), npart(nn);
|
||||||
@ -1318,7 +1318,7 @@ namespace netgen
|
|||||||
idxtype *xadj, * adjacency, *v_weights = NULL, *e_weights = NULL;
|
idxtype *xadj, * adjacency, *v_weights = NULL, *e_weights = NULL;
|
||||||
|
|
||||||
int weightflag = 0;
|
int weightflag = 0;
|
||||||
int numflag = 0;
|
// int numflag = 0;
|
||||||
int nparts = ntasks - 1;
|
int nparts = ntasks - 1;
|
||||||
|
|
||||||
int options[5];
|
int options[5];
|
||||||
@ -1485,11 +1485,9 @@ namespace netgen
|
|||||||
idxtype *v_weights = NULL, *e_weights = NULL;
|
idxtype *v_weights = NULL, *e_weights = NULL;
|
||||||
|
|
||||||
int weightflag = 0;
|
int weightflag = 0;
|
||||||
int numflag = 0;
|
// int numflag = 0;
|
||||||
int nparts = ntasks - 1;
|
int nparts = ntasks - 1;
|
||||||
|
|
||||||
int options[5];
|
|
||||||
options[0] = 0;
|
|
||||||
int edgecut;
|
int edgecut;
|
||||||
Array<idxtype> part(ne);
|
Array<idxtype> part(ne);
|
||||||
|
|
||||||
@ -1497,6 +1495,8 @@ namespace netgen
|
|||||||
BubbleSort (adjacency.Range (xadj[el], xadj[el+1]));
|
BubbleSort (adjacency.Range (xadj[el], xadj[el+1]));
|
||||||
|
|
||||||
#ifdef METIS4
|
#ifdef METIS4
|
||||||
|
int options[5];
|
||||||
|
options[0] = 0;
|
||||||
METIS_PartGraphKway ( &ne, &xadj[0], &adjacency[0], v_weights, e_weights, &weightflag,
|
METIS_PartGraphKway ( &ne, &xadj[0], &adjacency[0], v_weights, e_weights, &weightflag,
|
||||||
&numflag, &nparts, options, &edgecut, &part[0] );
|
&numflag, &nparts, options, &edgecut, &part[0] );
|
||||||
#else
|
#else
|
||||||
|
@ -181,17 +181,19 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
static bool firsttime = true;
|
static bool firsttime = true;
|
||||||
static int timers[100];
|
// static int timers[100];
|
||||||
static int timers2[100];
|
// static int timers2[100];
|
||||||
static int timers3[100];
|
// static int timers3[100];
|
||||||
if (firsttime)
|
if (firsttime)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
for (int ri = 0; ri < rules.Size(); ri++)
|
for (int ri = 0; ri < rules.Size(); ri++)
|
||||||
timers[ri] = NgProfiler::CreateTimer (string("netrule ")+rules[ri]->Name());
|
timers[ri] = NgProfiler::CreateTimer (string("netrule ")+rules[ri]->Name());
|
||||||
for (int ri = 0; ri < rules.Size(); ri++)
|
for (int ri = 0; ri < rules.Size(); ri++)
|
||||||
timers2[ri] = NgProfiler::CreateTimer (string("netrule,mapped ")+rules[ri]->Name());
|
timers2[ri] = NgProfiler::CreateTimer (string("netrule,mapped ")+rules[ri]->Name());
|
||||||
for (int ri = 0; ri < rules.Size(); ri++)
|
for (int ri = 0; ri < rules.Size(); ri++)
|
||||||
timers3[ri] = NgProfiler::CreateTimer (string("netrule,lines mapped ")+rules[ri]->Name());
|
timers3[ri] = NgProfiler::CreateTimer (string("netrule,lines mapped ")+rules[ri]->Name());
|
||||||
|
*/
|
||||||
firsttime = false;
|
firsttime = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1527,6 +1527,11 @@ namespace netgen
|
|||||||
|
|
||||||
void MeshTopology :: GetEdgeVertices (int ednr, int & v1, int & v2) const
|
void MeshTopology :: GetEdgeVertices (int ednr, int & v1, int & v2) const
|
||||||
{
|
{
|
||||||
|
// cout << "id = " << id << "getedgevertices, ednr = " << ednr << ", ned = " << edge2vert.Size() << "&v1 = " << &v1 << endl;
|
||||||
|
if (ednr < 1 || ednr > edge2vert.Size())
|
||||||
|
cerr << "illegal edge nr: " << ednr << ", numedges = " << edge2vert.Size()
|
||||||
|
<< " id = " << id
|
||||||
|
<< endl;
|
||||||
v1 = edge2vert.Get(ednr)[0];
|
v1 = edge2vert.Get(ednr)[0];
|
||||||
v2 = edge2vert.Get(ednr)[1];
|
v2 = edge2vert.Get(ednr)[1];
|
||||||
}
|
}
|
||||||
|
@ -2419,7 +2419,6 @@ namespace netgen
|
|||||||
NgProfiler::RegionTimer reg1 (timer1);
|
NgProfiler::RegionTimer reg1 (timer1);
|
||||||
|
|
||||||
int ne = mesh->GetNE();
|
int ne = mesh->GetNE();
|
||||||
|
|
||||||
double hminv = numeric_limits<double>::max();
|
double hminv = numeric_limits<double>::max();
|
||||||
double hmaxv = -numeric_limits<double>::max();
|
double hmaxv = -numeric_limits<double>::max();
|
||||||
bool hhasit = false;
|
bool hhasit = false;
|
||||||
@ -2723,8 +2722,9 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
case SOL_VIRTUALFUNCTION:
|
case SOL_VIRTUALFUNCTION:
|
||||||
{
|
{
|
||||||
|
val = 0.0;
|
||||||
double values[20];
|
double values[20];
|
||||||
ok = data->solclass->GetValue (elnr, lam1, lam2, lam3, values);
|
ok = data->solclass->GetValue (elnr, lam1, lam2, lam3, values);
|
||||||
|
|
||||||
val = values[comp-1];
|
val = values[comp-1];
|
||||||
return ok;
|
return ok;
|
||||||
@ -3662,7 +3662,7 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
static int timer_vals = NgProfiler::CreateTimer ("ClipPlaneTrigs - vertex values");
|
static int timer_vals = NgProfiler::CreateTimer ("ClipPlaneTrigs - vertex values");
|
||||||
static int timer1 = NgProfiler::CreateTimer ("ClipPlaneTrigs1");
|
static int timer1 = NgProfiler::CreateTimer ("ClipPlaneTrigs1");
|
||||||
static int timer1a = NgProfiler::CreateTimer ("ClipPlaneTrigs1a");
|
// static int timer1a = NgProfiler::CreateTimer ("ClipPlaneTrigs1a");
|
||||||
// static int timer2 = NgProfiler::CreateTimer ("ClipPlaneTrigs2");
|
// static int timer2 = NgProfiler::CreateTimer ("ClipPlaneTrigs2");
|
||||||
static int timer3 = NgProfiler::CreateTimer ("ClipPlaneTrigs3");
|
static int timer3 = NgProfiler::CreateTimer ("ClipPlaneTrigs3");
|
||||||
static int timer4 = NgProfiler::CreateTimer ("ClipPlaneTrigs4");
|
static int timer4 = NgProfiler::CreateTimer ("ClipPlaneTrigs4");
|
||||||
|
Loading…
Reference in New Issue
Block a user