mesh interface, deallocation

This commit is contained in:
Joachim Schoeberl 2014-10-19 13:53:57 +00:00
parent 92dbe6aeb0
commit 36803ec256
5 changed files with 15 additions and 0 deletions

View File

@ -27,8 +27,10 @@ namespace netgen
BlockAllocator :: ~BlockAllocator ()
{
// cout << "****************** delete BlockAllocator " << endl;
for (int i = 0; i < bablocks.Size(); i++)
delete [] bablocks[i];
bablocks.SetSize(0);
}
void * BlockAllocator :: Alloc ()

View File

@ -48,6 +48,7 @@ public:
///
void Free (void * p)
{
if (!bablocks.Size()) return;
*(void**)p = freelist;
freelist = p;
}

View File

@ -167,6 +167,7 @@ namespace netgen
void LoadMesh (istream & str);
void SaveMesh (ostream & str) const;
void UpdateTopology ();
void DoArchive (ngstd::Archive & archive);
virtual ~Ngx_Mesh();

View File

@ -6,6 +6,7 @@
#include "nginterface.h"
#include "nginterface_v2.hpp"
#include <visual.hpp>
namespace netgen
{
@ -22,7 +23,11 @@ namespace netgen
shared_ptr<Mesh> Ngx_Mesh :: SelectMesh () const
{
shared_ptr<Mesh> hmesh = netgen::mesh;
netgen::mesh = mesh;
vssolution.SetMesh(mesh);
vsmesh.SetMesh(mesh);
return hmesh;
}
@ -80,6 +85,11 @@ namespace netgen
}
}
void Ngx_Mesh :: UpdateTopology ()
{
if (mesh)
mesh -> UpdateTopology();
}
/*

View File

@ -47,6 +47,7 @@ namespace netgen
Mesh :: ~Mesh()
{
// cout << "******************** deleting Mesh **********" << endl;
delete lochfunc;
delete boundaryedges;
delete surfelementht;