mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 13:30:34 +05:00
create empty mesh before calling mesher (thx jwpeterson)
This commit is contained in:
parent
7cbdcf29cf
commit
bdac0aee24
@ -73,6 +73,9 @@ using namespace netgen;
|
|||||||
|
|
||||||
namespace nglib
|
namespace nglib
|
||||||
{
|
{
|
||||||
|
inline void NOOP_Deleter(void *) { ; }
|
||||||
|
|
||||||
|
|
||||||
// initialize, deconstruct Netgen library:
|
// initialize, deconstruct Netgen library:
|
||||||
DLL_HEADER void Ng_Init ()
|
DLL_HEADER void Ng_Init ()
|
||||||
{
|
{
|
||||||
@ -510,10 +513,10 @@ namespace nglib
|
|||||||
// MeshingParameters mparam;
|
// MeshingParameters mparam;
|
||||||
mp->Transfer_Parameters();
|
mp->Transfer_Parameters();
|
||||||
|
|
||||||
shared_ptr<Mesh> m;
|
shared_ptr<Mesh> m(new Mesh, &NOOP_Deleter);
|
||||||
MeshFromSpline2D (*(SplineGeometry2d*)geom, m, mparam);
|
MeshFromSpline2D (*(SplineGeometry2d*)geom, m, mparam);
|
||||||
new shared_ptr<Mesh> (m); // hack to keep mesh m alive
|
// new shared_ptr<Mesh> (m); // hack to keep mesh m alive
|
||||||
|
|
||||||
cout << m->GetNSE() << " elements, " << m->GetNP() << " points" << endl;
|
cout << m->GetNSE() << " elements, " << m->GetNP() << " points" << endl;
|
||||||
|
|
||||||
*mesh = (Ng_Mesh*)m.get();
|
*mesh = (Ng_Mesh*)m.get();
|
||||||
|
Loading…
Reference in New Issue
Block a user