mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
basegeometry, disable moveablemem
This commit is contained in:
parent
b455164dfb
commit
f14a04a837
@ -85,7 +85,7 @@ public:
|
||||
/**
|
||||
CSGeometry has the whole geometric information
|
||||
*/
|
||||
class CSGeometry
|
||||
class CSGeometry : public NetgenGeometry
|
||||
{
|
||||
private:
|
||||
/// all surfaces
|
||||
|
@ -492,8 +492,8 @@ namespace netgen
|
||||
|
||||
if (multithread.terminate) return;
|
||||
|
||||
for (int i = oldnf+1; i <= mesh.GetNSE(); i++)
|
||||
mesh.SurfaceElement(i).SetIndex (k);
|
||||
for (SurfaceElementIndex sei = oldnf; sei < mesh.GetNSE(); sei++)
|
||||
mesh[sei].SetIndex (k);
|
||||
|
||||
|
||||
// mesh.CalcSurfacesOfNode();
|
||||
@ -621,8 +621,8 @@ namespace netgen
|
||||
|
||||
if (multithread.terminate) return;
|
||||
|
||||
for (int i = oldnf+1; i <= mesh.GetNSE(); i++)
|
||||
mesh.SurfaceElement(i).SetIndex (k);
|
||||
for (SurfaceElementIndex sei = oldnf; sei < mesh.GetNSE(); sei++)
|
||||
mesh[sei].SetIndex (k);
|
||||
|
||||
|
||||
if (!segments.Size())
|
||||
|
@ -451,9 +451,9 @@ BuildSurfaceElements (Array<Segment> & segs,
|
||||
{
|
||||
Array<int> copy_points;
|
||||
|
||||
for (int i = 1; i <= mesh.GetNSE(); i++)
|
||||
for (SurfaceElementIndex sei = 0; sei < mesh.GetNSE(); sei++)
|
||||
{
|
||||
const Element2d & sel = mesh.SurfaceElement(i);
|
||||
const Element2d & sel = mesh[sei];
|
||||
INDEX_2 fpair (facei, sel.GetIndex());
|
||||
fpair.Sort();
|
||||
if (identfaces.Used (fpair))
|
||||
@ -469,9 +469,9 @@ BuildSurfaceElements (Array<Segment> & segs,
|
||||
|
||||
|
||||
|
||||
for (int i = 1; i <= mesh.GetNSE(); i++)
|
||||
for (SurfaceElementIndex sei = 0; sei < mesh.GetNSE(); sei++)
|
||||
{
|
||||
const Element2d & sel = mesh.SurfaceElement(i);
|
||||
const Element2d & sel = mesh[sei];
|
||||
INDEX_2 fpair (facei, sel.GetIndex());
|
||||
fpair.Sort();
|
||||
if (identfaces.Used (fpair))
|
||||
@ -1341,9 +1341,9 @@ BuildSurfaceElements2 (Array<Segment> & segs,
|
||||
{
|
||||
// (*testout) << "surfaces found" << endl;
|
||||
// copy surface
|
||||
for (int i = 1; i <= mesh.GetNSE(); i++)
|
||||
for (SurfaceElementIndex sei = 0; sei < mesh.GetNSE(); sei++)
|
||||
{
|
||||
const Element2d & sel = mesh.SurfaceElement(i);
|
||||
const Element2d & sel = mesh[sei];
|
||||
INDEX_2 fpair (facei, sel.GetIndex());
|
||||
fpair.Sort();
|
||||
if (identfaces.Used (fpair))
|
||||
|
@ -422,14 +422,13 @@ public:
|
||||
|
||||
|
||||
|
||||
|
||||
///
|
||||
template <class T, int BASE = 0>
|
||||
class MoveableArray
|
||||
{
|
||||
int size;
|
||||
int allocsize;
|
||||
MoveableMem<T> data;
|
||||
DynamicMem<T> data;
|
||||
|
||||
public:
|
||||
|
||||
@ -578,6 +577,7 @@ inline ostream & operator<< (ostream & ost, MoveableArray<T> & a)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// bubble sort array
|
||||
template <class T>
|
||||
inline void BubbleSort (const FlatArray<T> & data)
|
||||
|
@ -167,6 +167,7 @@ namespace netgen
|
||||
|
||||
{
|
||||
|
||||
/*
|
||||
BaseMoveableMem * pm = BaseMoveableMem::first;
|
||||
while (pm)
|
||||
{
|
||||
@ -186,6 +187,7 @@ namespace netgen
|
||||
|
||||
pm = pm->next;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ using namespace std;
|
||||
namespace netgen
|
||||
{
|
||||
|
||||
#ifdef OLD
|
||||
NgMutex mem_mutex;
|
||||
|
||||
size_t BaseMoveableMem::totalsize = 0; // 500000000;
|
||||
@ -266,5 +267,6 @@ namespace netgen
|
||||
cout << " used = " << used << endl;
|
||||
// cout << "******************************************************" << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -9,9 +9,12 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#ifdef OLD
|
||||
|
||||
extern NgMutex mem_mutex;
|
||||
|
||||
|
||||
|
||||
class BaseMoveableMem
|
||||
{
|
||||
public:
|
||||
@ -98,6 +101,8 @@ protected:
|
||||
MoveableMem & operator= (const MoveableMem & m) { ; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
18
libsrc/meshing/basegeom.hpp
Normal file
18
libsrc/meshing/basegeom.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef FILE_BASEGEOM
|
||||
#define FILE_BASEGEOM
|
||||
|
||||
/**************************************************************************/
|
||||
/* File: basegeom.hpp */
|
||||
/* Author: Joachim Schoeberl */
|
||||
/* Date: 23. Aug. 09 */
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
class NetgenGeometry
|
||||
{
|
||||
public:
|
||||
virtual ~NetgenGeometry () { ; }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -731,6 +731,7 @@ HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE<int> & edge
|
||||
{
|
||||
i2.Sort();
|
||||
if(surf_edges.Used(i2) && surf_edges.Get(i2) != fd.SurfNr()+1) // edge not face_edge acc. to surface in which trig lies
|
||||
{
|
||||
if(face_edges.Get(i2)==-1 ||face_edges.Get(i2) == fd.DomainIn() || face_edges.Get(i2) == fd.DomainOut() )
|
||||
{
|
||||
edge_sing[k]=1;
|
||||
@ -741,6 +742,7 @@ HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE<int> & edge
|
||||
point_sing[ep2-1] = 0; // set to edge_point
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* *testout << " pointsing NACH edges UND FACEEDGES UMSETZEN ... " ;
|
||||
for (int k=0;k<3;k++) *testout << "\t" << point_sing[p[k]-1] ;
|
||||
|
@ -581,48 +581,39 @@ namespace netgen
|
||||
|
||||
switch (mesh[i].GetType())
|
||||
{
|
||||
case PRISM:
|
||||
hpel.type = HP_PRISM;
|
||||
break;
|
||||
case HEX:
|
||||
hpel.type = HP_HEX;
|
||||
break;
|
||||
case TET:
|
||||
hpel.type = HP_TET;
|
||||
break;
|
||||
case PYRAMID:
|
||||
hpel.type = HP_PYRAMID;
|
||||
break;
|
||||
case PRISM: hpel.type = HP_PRISM; break;
|
||||
case HEX: hpel.type = HP_HEX; break;
|
||||
case TET: hpel.type = HP_TET; break;
|
||||
case PYRAMID: hpel.type = HP_PYRAMID; break;
|
||||
|
||||
default:
|
||||
cerr << "HPRefElement: illegal elementtype (1) " << mesh[i].GetType() << endl;
|
||||
throw NgException ("HPRefElement: illegal elementtype (1)");
|
||||
|
||||
}
|
||||
elements.Append(hpel);
|
||||
}
|
||||
|
||||
for(SurfaceElementIndex i = 0; i < mesh.GetNSE(); i++)
|
||||
{
|
||||
HPRefElement hpel(mesh.SurfaceElement(i));
|
||||
HPRefElement hpel(mesh[i]);
|
||||
hpel.coarse_elnr = i;
|
||||
switch(mesh.SurfaceElement(i).GetType())
|
||||
switch(mesh[i].GetType())
|
||||
{
|
||||
case TRIG:
|
||||
hpel.type = HP_TRIG;
|
||||
break;
|
||||
case QUAD:
|
||||
hpel.type = HP_QUAD;
|
||||
break;
|
||||
case TRIG: hpel.type = HP_TRIG; break;
|
||||
case QUAD: hpel.type = HP_QUAD; break;
|
||||
|
||||
default:
|
||||
cerr << "HPRefElement: illegal elementtype (1b) " << mesh[i].GetType() << endl;
|
||||
throw NgException ("HPRefElement: illegal elementtype (1b)");
|
||||
}
|
||||
elements.Append(hpel);
|
||||
}
|
||||
|
||||
for(int i=1;i<=mesh.GetNSeg();i++)
|
||||
for(SegmentIndex i = 0; i < mesh.GetNSeg(); i++)
|
||||
{
|
||||
Segment & seg = mesh.LineSegment(i);
|
||||
HPRefElement hpel(seg);
|
||||
hpel.coarse_elnr = i-1;
|
||||
Segment & seg = mesh[i];
|
||||
HPRefElement hpel(mesh[i]);
|
||||
hpel.coarse_elnr = i;
|
||||
hpel.type = HP_SEGM;
|
||||
hpel.index = seg.edgenr + 10000*seg.si;
|
||||
if(seg.edgenr >= 10000)
|
||||
@ -630,7 +621,6 @@ namespace netgen
|
||||
throw NgException("assumption that seg.edgenr < 10000 is wrong");
|
||||
}
|
||||
elements.Append(hpel);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1323,15 +1313,15 @@ namespace netgen
|
||||
PrintMessage (1, "HP Refinement called, levels = ", levels);
|
||||
|
||||
|
||||
NgLock mem_lock (mem_mutex,1);
|
||||
// NgLock mem_lock (mem_mutex,1);
|
||||
|
||||
mesh.coarsemesh = new Mesh;
|
||||
*mesh.coarsemesh = mesh;
|
||||
|
||||
#ifdef CURVEDELEMS_NEW
|
||||
// #ifdef CURVEDELEMS_NEW
|
||||
const_cast<CurvedElements&> (mesh.coarsemesh->GetCurvedElements() ).
|
||||
BuildCurvedElements (ref, mesh.GetCurvedElements().GetOrder());
|
||||
#endif
|
||||
// #endif
|
||||
|
||||
|
||||
delete mesh.hpelements;
|
||||
@ -1737,7 +1727,6 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE<int> & edges, INDEX_2_HAS
|
||||
const Segment & seg = mesh.LineSegment(i);
|
||||
int ind = seg.edgenr;
|
||||
|
||||
|
||||
if (seg.singedge_left * levels >= act_ref)
|
||||
{
|
||||
INDEX_2 i2 (mesh.LineSegment(i)[0],
|
||||
@ -1797,7 +1786,7 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE<int> & edges, INDEX_2_HAS
|
||||
// mark points for refinement that are in corners between two anisotropic edges
|
||||
if (surfonpoint.Get(i).I1())
|
||||
{
|
||||
cornerpoint.Set(i);
|
||||
// cornerpoint.Set(i); // disabled by JS, Aug 2009
|
||||
edgepoint.Set(i);
|
||||
}
|
||||
|
||||
@ -1820,10 +1809,8 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE<int> & edges, INDEX_2_HAS
|
||||
}
|
||||
|
||||
if (!sing)
|
||||
{
|
||||
cout << "PrepareElements no more to do for actual refinement " << act_ref << endl;
|
||||
return(sing);
|
||||
}
|
||||
|
||||
return(sing);
|
||||
}
|
||||
|
||||
@ -1831,7 +1818,6 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE<int> & edges, INDEX_2_HAS
|
||||
|
||||
bool ClassifyHPElements (Mesh & mesh, Array<HPRefElement> & elements, int & act_ref, int & levels)
|
||||
{
|
||||
|
||||
INDEX_2_HASHTABLE<int> edges(mesh.GetNSeg()+1);
|
||||
BitArray edgepoint(mesh.GetNP());
|
||||
INDEX_2_HASHTABLE<int> edgepoint_dom(mesh.GetNSeg()+1);
|
||||
|
@ -271,11 +271,8 @@ public:
|
||||
int GetNSE () const { return surfelements.Size(); }
|
||||
Element2d & SurfaceElement(int i) { return surfelements.Elem(i); }
|
||||
const Element2d & SurfaceElement(int i) const { return surfelements.Get(i); }
|
||||
|
||||
Element2d & SurfaceElement(SurfaceElementIndex i)
|
||||
{ return surfelements[i]; }
|
||||
const Element2d & SurfaceElement(SurfaceElementIndex i) const
|
||||
{ return surfelements[i]; }
|
||||
Element2d & SurfaceElement(SurfaceElementIndex i) { return surfelements[i]; }
|
||||
const Element2d & SurfaceElement(SurfaceElementIndex i) const { return surfelements[i]; }
|
||||
|
||||
const Element2d & operator[] (SurfaceElementIndex ei) const
|
||||
{ return surfelements[ei]; }
|
||||
|
@ -32,6 +32,8 @@ namespace netgen
|
||||
#include "meshing2.hpp"
|
||||
#include "improve2.hpp"
|
||||
|
||||
#include "basegeom.hpp"
|
||||
|
||||
|
||||
#include "geomsearch.hpp"
|
||||
#include "adfront3.hpp"
|
||||
|
@ -88,7 +88,7 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
class STLGeometry : public STLTopology
|
||||
class STLGeometry : public STLTopology, public NetgenGeometry
|
||||
{
|
||||
// edges to be meshed:
|
||||
Array<STLEdge> edges;
|
||||
|
@ -23,6 +23,8 @@ Visualization
|
||||
#include "mvdraw.hpp"
|
||||
#include "soldata.hpp"
|
||||
|
||||
#include <complex>
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#include "vssolution.hpp"
|
||||
|
@ -14,9 +14,7 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
|
||||
extern AutoPtr<Mesh> mesh;
|
||||
|
||||
extern VisualSceneMesh vsmesh;
|
||||
|
||||
|
||||
@ -52,7 +50,6 @@ namespace netgen
|
||||
isolinelist = 0;
|
||||
clipplane_isolinelist = 0;
|
||||
surface_vector_list = 0;
|
||||
// cone_list = 0;
|
||||
isosurface_list = 0;
|
||||
|
||||
fieldlineslist = 0;
|
||||
@ -360,8 +357,8 @@ namespace netgen
|
||||
return;
|
||||
}
|
||||
|
||||
static NgLock mem_lock(mem_mutex);
|
||||
mem_lock.Lock();
|
||||
// static NgLock mem_lock(mem_mutex);
|
||||
// mem_lock.Lock();
|
||||
|
||||
NgLock meshlock1 (mesh->MajorMutex(), true);
|
||||
NgLock meshlock (mesh->Mutex(), true);
|
||||
@ -511,7 +508,7 @@ namespace netgen
|
||||
|
||||
|
||||
// delete lock;
|
||||
mem_lock.UnLock();
|
||||
// mem_lock.UnLock();
|
||||
|
||||
endtime = clock();
|
||||
// cout << 1.0 / (double(endtime - starttime)/CLOCKS_PER_SEC) << " frames/sec" << endl;
|
||||
@ -1087,7 +1084,7 @@ namespace netgen
|
||||
Vec<3> nvs[1100];
|
||||
double values[1100];
|
||||
double mvalues[11000];
|
||||
double valuesc[1100][2];
|
||||
complex<double> valuesc[11000];
|
||||
|
||||
|
||||
int nse = mesh->GetNSE();
|
||||
@ -1146,8 +1143,6 @@ namespace netgen
|
||||
// nv.Normalize();
|
||||
// glNormal3dv (nv);
|
||||
|
||||
|
||||
|
||||
for (int iy = 0, ii = 0; iy <= n; iy++)
|
||||
for (int ix = 0; ix <= n; ix++, ii++)
|
||||
pref[ii] = Point<2> (double(ix)/n, double(iy)/n);
|
||||
@ -1185,7 +1180,7 @@ namespace netgen
|
||||
{
|
||||
if (usetexture == 2)
|
||||
for (int ii = 0; ii < npt; ii++)
|
||||
drawelem = GetSurfValueComplex (sol, sei, pref[ii](0), pref[ii](1), scalcomp, valuesc[ii][0], valuesc[ii][1]);
|
||||
drawelem = GetSurfValueComplex (sol, sei, pref[ii](0), pref[ii](1), scalcomp, valuesc[ii].real(), valuesc[ii].imag());
|
||||
else
|
||||
for (int ii = 0; ii < npt; ii++)
|
||||
drawelem = GetSurfValue (sol, sei, pref[ii](0), pref[ii](1), scalcomp, values[ii]);
|
||||
@ -1219,8 +1214,8 @@ namespace netgen
|
||||
if (usetexture != 2)
|
||||
SetOpenGlColor (values[index[j]]);
|
||||
else
|
||||
glTexCoord2f ( valuesc[index[j]][0],
|
||||
valuesc[index[j]][1] );
|
||||
glTexCoord2f ( valuesc[index[j]].real(),
|
||||
valuesc[index[j]].imag() );
|
||||
}
|
||||
else
|
||||
glColor3fv (col_grey);
|
||||
@ -1253,75 +1248,26 @@ namespace netgen
|
||||
{
|
||||
const Element2d & el = (*mesh)[sei];
|
||||
|
||||
#ifdef PARALLEL
|
||||
// parallel visualization --> dont draw ghost elements
|
||||
if ( el . IsGhost() ) continue;
|
||||
#endif
|
||||
|
||||
// if ( mesh->GetFaceDescriptor(el.GetIndex()).BCProperty() != 1) continue;
|
||||
|
||||
|
||||
if(vispar.drawdomainsurf > 0 &&
|
||||
((mesh->GetDimension() == 3 &&
|
||||
vispar.drawdomainsurf != mesh->GetFaceDescriptor(el.GetIndex()).DomainIn() &&
|
||||
vispar.drawdomainsurf != mesh->GetFaceDescriptor(el.GetIndex()).DomainOut()) ||
|
||||
(mesh->GetDimension() == 2 && el.GetIndex() != vispar.drawdomainsurf))) continue;
|
||||
|
||||
if(vispar.drawdomainsurf > 0)
|
||||
{
|
||||
if (mesh->GetDimension() == 3)
|
||||
{
|
||||
if (vispar.drawdomainsurf != mesh->GetFaceDescriptor(el.GetIndex()).DomainIn() &&
|
||||
vispar.drawdomainsurf != mesh->GetFaceDescriptor(el.GetIndex()).DomainOut())
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (el.GetIndex() != vispar.drawdomainsurf)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( el.GetType() == TRIG || el.GetType() == TRIG6 )
|
||||
{
|
||||
bool curved = curv.IsHighOrder(); // && curv.IsSurfaceElementCurved(sei);
|
||||
// if (el.GetType() == TRIG6) curved = true;
|
||||
|
||||
Point<3> p1, p2, p3;
|
||||
Mat<3,2> dxdxi;
|
||||
|
||||
if (! curved)
|
||||
{
|
||||
GetPointDeformation (el[0]-1, p1, sei);
|
||||
GetPointDeformation (el[1]-1, p2, sei);
|
||||
GetPointDeformation (el[2]-1, p3, sei);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
dxdxi(i, 0) = p1(i)-p3(i);
|
||||
dxdxi(i, 1) = p2(i)-p3(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
for (int iy = 0, ii = 0; iy <= n; iy++)
|
||||
for (int ix = 0; ix <= n-iy; ix++, ii++)
|
||||
{
|
||||
Point<2> pref(ix*invn,iy*invn);
|
||||
if (curved)
|
||||
{
|
||||
mesh->GetCurvedElements().
|
||||
CalcSurfaceTransformation (pref, sei, points[ii], dxdxi);
|
||||
}
|
||||
else
|
||||
{
|
||||
points[ii] = p3 + (invn*ix) * (p1-p3) + (invn*iy) * (p2-p3);
|
||||
}
|
||||
|
||||
nvs[ii] = Cross (dxdxi.Col(0), dxdxi.Col(1));
|
||||
nvs[ii].Normalize();
|
||||
|
||||
if (sol && sol->draw_surface)
|
||||
{
|
||||
if (usetexture == 2)
|
||||
drawelem = GetSurfValueComplex (sol, sei, ix*invn, iy*invn, scalcomp,
|
||||
valuesc[ii][0], valuesc[ii][1]);
|
||||
else
|
||||
drawelem = GetSurfValue (sol, sei, pref, points[ii], &dxdxi(0,0), scalcomp, values[ii]);
|
||||
}
|
||||
|
||||
if (deform)
|
||||
points[ii] += GetSurfDeformation (sei, invn*ix, invn*iy);
|
||||
}
|
||||
*/
|
||||
|
||||
bool curved = curv.IsSurfaceElementCurved(sei);
|
||||
|
||||
for (int iy = 0, ii = 0; iy <= n; iy++)
|
||||
for (int ix = 0; ix <= n-iy; ix++, ii++)
|
||||
@ -1338,14 +1284,15 @@ namespace netgen
|
||||
}
|
||||
else
|
||||
{
|
||||
Vec<3> vx = (p1-p3);
|
||||
Vec<3> vy = (p2-p3);
|
||||
Point<3> p1 = mesh->Point (el[0]);
|
||||
Point<3> p2 = mesh->Point (el[1]);
|
||||
Point<3> p3 = mesh->Point (el[2]);
|
||||
|
||||
Vec<3> vx = p1-p3;
|
||||
Vec<3> vy = p2-p3;
|
||||
for (int ii = 0; ii < npt; ii++)
|
||||
{
|
||||
double x = pref[ii](0);
|
||||
double y = pref[ii](1);
|
||||
points[ii] = p3 + x * vx + y * vy;
|
||||
|
||||
points[ii] = p3 + pref[ii](0) * vx + pref[ii](1) * vy;
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
dxdxis[ii](j,0) = vx(j);
|
||||
@ -1361,31 +1308,24 @@ namespace netgen
|
||||
bool drawelem = false;
|
||||
if (sol && sol->draw_surface)
|
||||
{
|
||||
if (usetexture == 2)
|
||||
for (int ii = 0; ii < npt; ii++)
|
||||
drawelem = GetSurfValueComplex (sol, sei, pref[ii](0), pref[ii](1), scalcomp, valuesc[ii][0], valuesc[ii][1]);
|
||||
else
|
||||
{
|
||||
// for (int ii = 0; ii < npt; ii++)
|
||||
// drawelem = GetSurfValue (sol, sei, &pref[ii](0), &points[ii](0), &dxdxis[ii](0), scalcomp, values[ii]);
|
||||
|
||||
drawelem = GetMultiSurfValues (sol, sei, npt,
|
||||
&pref[0](0), &pref[1](0)-&pref[0](0),
|
||||
&points[0](0), &points[1](0)-&points[0](0),
|
||||
&dxdxis[0](0), &dxdxis[1](0)-&dxdxis[0](0),
|
||||
&mvalues[0], sol->components);
|
||||
|
||||
if (usetexture == 2)
|
||||
for (int ii = 0; ii < npt; ii++)
|
||||
valuesc[ii] = ExtractValueComplex(sol, scalcomp, mvalues+ii*sol->components);
|
||||
else
|
||||
for (int ii = 0; ii < npt; ii++)
|
||||
values[ii] = ExtractValue(sol, scalcomp, mvalues+ii*sol->components);
|
||||
}
|
||||
}
|
||||
|
||||
if (deform)
|
||||
for (int ii = 0; ii < npt; ii++)
|
||||
points[ii] += GetSurfDeformation (sei, pref[ii](0), pref[ii](1));
|
||||
|
||||
|
||||
|
||||
int save_usetexture = usetexture;
|
||||
if (!drawelem)
|
||||
{
|
||||
@ -1407,7 +1347,7 @@ namespace netgen
|
||||
if (usetexture != 2)
|
||||
SetOpenGlColor (values[hi]);
|
||||
else
|
||||
glTexCoord2f ( valuesc[hi][0], valuesc[hi][1] );
|
||||
glTexCoord2f ( valuesc[hi].real(), valuesc[hi].imag() );
|
||||
}
|
||||
else
|
||||
glColor3fv (col_grey);
|
||||
@ -1444,6 +1384,16 @@ namespace netgen
|
||||
|
||||
CurvedElements & curv = mesh->GetCurvedElements();
|
||||
|
||||
int n = 1 << subdivisions;
|
||||
ArrayMem<Point<2>, 65> ptsloc(n+1);
|
||||
ArrayMem<Point<3>, 65> ptsglob(n+1);
|
||||
|
||||
double trigpts[3][2] = { { 0, 0 }, { 1, 0 }, { 0, 1} };
|
||||
double trigvecs[3][2] = { { 1, 0 }, { -1,1 }, { 0, -1} };
|
||||
|
||||
double quadpts[4][2] = { { 0, 0 }, { 1, 0 }, { 1, 1 }, { 0, 1} };
|
||||
double quadvecs[4][2] = { { 1, 0 }, { 0, 1 }, { -1, 0}, { 0, -1} };
|
||||
|
||||
for (SurfaceElementIndex sei = 0; sei < nse; sei++)
|
||||
{
|
||||
Element2d & el = (*mesh)[sei];
|
||||
@ -1463,56 +1413,25 @@ namespace netgen
|
||||
if (nv == 4) p4 = (*mesh)[el[3]];
|
||||
}
|
||||
|
||||
int n = 1 << subdivisions;
|
||||
|
||||
for (int k = 0; k < nv; k++)
|
||||
{
|
||||
Point<2> p0 = 0.0;
|
||||
Vec<2> vtau = 0.0;
|
||||
Point<2> p0;
|
||||
Vec<2> vtau;
|
||||
if (nv == 3)
|
||||
switch (k)
|
||||
{
|
||||
case 0:
|
||||
p0 = Point<2> (0,0);
|
||||
vtau = Vec<2> (1,0);
|
||||
break;
|
||||
case 1:
|
||||
p0 = Point<2> (1,0);
|
||||
vtau = Vec<2> (-1,1);
|
||||
break;
|
||||
case 2:
|
||||
p0 = Point<2> (0,1);
|
||||
vtau = Vec<2> (0,-1);
|
||||
break;
|
||||
p0 = Point<2>(trigpts[k][0], trigpts[k][1]);
|
||||
vtau = Vec<2>(trigvecs[k][0], trigvecs[k][1]);
|
||||
}
|
||||
else
|
||||
switch (k)
|
||||
{
|
||||
case 0:
|
||||
p0 = Point<2> (0,0);
|
||||
vtau = Vec<2> (1,0);
|
||||
break;
|
||||
case 1:
|
||||
p0 = Point<2> (1,0);
|
||||
vtau = Vec<2> (0,1);
|
||||
break;
|
||||
case 2:
|
||||
p0 = Point<2> (1,1);
|
||||
vtau = Vec<2> (-1,0);
|
||||
break;
|
||||
case 3:
|
||||
p0 = Point<2> (0,1);
|
||||
vtau = Vec<2> (0,-1);
|
||||
break;
|
||||
p0 = Point<2>(quadpts[k][0], quadpts[k][1]);
|
||||
vtau = Vec<2>(quadvecs[k][0], quadvecs[k][1]);
|
||||
}
|
||||
|
||||
glBegin (GL_LINE_STRIP);
|
||||
|
||||
if (curved)
|
||||
{
|
||||
ArrayMem<Point<2>, 65> ptsloc(n+1);
|
||||
ArrayMem<Point<3>, 65> ptsglob(n+1);
|
||||
|
||||
for (int ix = 0; ix <= n; ix++)
|
||||
ptsloc[ix] = p0 + (double(ix) / n) * vtau;
|
||||
|
||||
@ -1548,7 +1467,6 @@ namespace netgen
|
||||
glEnd ();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2278,7 +2196,6 @@ namespace netgen
|
||||
int ne = mesh->GetNE();
|
||||
for (int i = 0; i < ne; i++)
|
||||
{
|
||||
// "considerElem": added 07.04.2004 (FB)
|
||||
considerElem = GetValue (sol, i, 0.333, 0.333, 0.333, comp, val);
|
||||
if (considerElem)
|
||||
{
|
||||
@ -2295,7 +2212,6 @@ namespace netgen
|
||||
int nse = mesh->GetNSE();
|
||||
for (int i = 0; i < nse; i++)
|
||||
{
|
||||
// "considerElem": added 07.04.2004 (FB)
|
||||
ELEMENT_TYPE type = mesh->SurfaceElement(i+1).GetType();
|
||||
if (type == QUAD)
|
||||
considerElem = GetSurfValue (sol, i, 0.5, 0.5, comp, val);
|
||||
@ -3062,7 +2978,21 @@ namespace netgen
|
||||
return values[comp-1];
|
||||
}
|
||||
|
||||
|
||||
complex<double> VisualSceneSolution :: ExtractValueComplex (const SolData * data, int comp, double * values) const
|
||||
{
|
||||
double valr, vali;
|
||||
if (!data->iscomplex)
|
||||
{
|
||||
valr = values[comp-1];
|
||||
vali = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
valr = values[comp-1];
|
||||
vali = values[comp];
|
||||
}
|
||||
return complex<double> (valr, vali);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -243,7 +243,6 @@ private:
|
||||
int comp, double & val) const;
|
||||
|
||||
|
||||
|
||||
bool GetSurfValueComplex (const SolData * data, SurfaceElementIndex elnr,
|
||||
double lam1, double lam2,
|
||||
int comp, double & valr, double & vali) const;
|
||||
@ -263,6 +262,7 @@ private:
|
||||
double * val, int sval) const;
|
||||
|
||||
double ExtractValue (const SolData * data, int comp, double * values) const;
|
||||
complex<double> ExtractValueComplex (const SolData * data, int comp, double * values) const;
|
||||
|
||||
|
||||
Vec<3> GetDeformation (ElementIndex elnr, const Point<3> & p) const;
|
||||
|
@ -800,6 +800,8 @@ menu .ngmenu.special.colbndcond
|
||||
#####################################################
|
||||
|
||||
|
||||
|
||||
|
||||
menu .ngmenu.help
|
||||
# .ngmenu.help add command -label "Ng Help..." \
|
||||
\# -command { help_main }
|
||||
@ -883,7 +885,6 @@ tixOptionMenu .bubar.modesel \
|
||||
|
||||
|
||||
|
||||
|
||||
set viewvals { geometry specpoints mesh solution}
|
||||
if { $userlevel == 3} {
|
||||
set viewvals { geometry mesh specpoints surfmeshing modelview solution}
|
||||
@ -909,6 +910,7 @@ foreach viewv $viewvals {
|
||||
}
|
||||
|
||||
|
||||
|
||||
.bubar.selview config -variable selectvisual
|
||||
.bubar.selview config -command { Ng_SetVisParameters; redraw }
|
||||
|
||||
@ -928,6 +930,8 @@ pack .bubar.center .bubar.zoomall .bubar.selview -side right
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################
|
||||
# #
|
||||
# Status bar #
|
||||
@ -996,8 +1000,8 @@ proc timer2 { } {
|
||||
}
|
||||
}
|
||||
|
||||
global mem_moveable
|
||||
set mem_moveable [Ng_MemInfo moveable]
|
||||
# global mem_moveable
|
||||
# set mem_moveable [Ng_MemInfo moveable]
|
||||
|
||||
|
||||
.statbar.per config -value [expr $status_percent/100] -text [format %2.1f [expr 0.1*int(10*$status_percent)]]%
|
||||
@ -1068,7 +1072,6 @@ proc timer2 { } {
|
||||
}
|
||||
|
||||
|
||||
|
||||
if {[winfo exists .memuse_dlg] == 1} {
|
||||
|
||||
global memmark
|
||||
@ -1082,11 +1085,6 @@ proc timer2 { } {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
after 200 { timer2 }
|
||||
}
|
||||
# after 1000 { timer2 }
|
||||
@ -1095,7 +1093,6 @@ timer2
|
||||
|
||||
|
||||
|
||||
|
||||
proc bgerror { error } {
|
||||
global errorInfo userlevel
|
||||
if { $userlevel == 3} {
|
||||
@ -1139,7 +1136,6 @@ bind . <e><p> { editprimitivedialog }
|
||||
bind . <e><s> { newsoliddialog }
|
||||
bind . <g><m> { .ngmenu.mesh invoke "Generate Mesh" } ;
|
||||
|
||||
# bind . <v><m> { .bubar.selview configure activate mesh } ;
|
||||
|
||||
|
||||
|
||||
|
@ -179,7 +179,6 @@ namespace netgen
|
||||
// geometry: either CSG, or, if an other is non-null,
|
||||
// then the other
|
||||
AutoPtr<CSGeometry> geometry (new CSGeometry(""));
|
||||
|
||||
STLGeometry * stlgeometry = NULL;
|
||||
AutoPtr<SplineGeometry2d> geometry2d (0);
|
||||
|
||||
@ -1344,13 +1343,14 @@ namespace netgen
|
||||
{
|
||||
static char buf[100];
|
||||
if (argc < 2) return TCL_ERROR;
|
||||
/*
|
||||
if (strcmp (argv[1], "moveable") == 0)
|
||||
{
|
||||
sprintf (buf, "%6.1f", double(BaseMoveableMem::used)/1048576);
|
||||
Tcl_SetResult (interp, buf, TCL_STATIC);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
if (strcmp (argv[1], "usedmb") == 0)
|
||||
{ // returns string of 512 '0' or '1'
|
||||
@ -2063,7 +2063,7 @@ namespace netgen
|
||||
printmessage_importance = atoi (Tcl_GetVar (interp, "::options.printmsg", 0));
|
||||
printdots = (printmessage_importance >= 4);
|
||||
|
||||
BaseMoveableMem::totalsize = 0;
|
||||
//BaseMoveableMem::totalsize = 0;
|
||||
// 1048576 * atoi (Tcl_GetVar (interp, "::options.memory", 0));
|
||||
if (mesh.Ptr())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user