2014-01-25 21:17:16 +00:00
|
|
|
/**************************************************************************/
|
|
|
|
/* File: nglib.cpp */
|
|
|
|
/* Author: Joachim Schoeberl */
|
|
|
|
/* Date: 7. May. 2000 */
|
|
|
|
/**************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Interface to the netgen meshing kernel
|
|
|
|
|
|
|
|
*/
|
|
|
|
#include <mystdlib.h>
|
|
|
|
#include <myadt.hpp>
|
|
|
|
|
|
|
|
#include <linalg.hpp>
|
|
|
|
#include <csg.hpp>
|
|
|
|
#include <stlgeom.hpp>
|
|
|
|
#include <geometry2d.hpp>
|
|
|
|
#include <meshing.hpp>
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
#include <../interface/writeuser.hpp>
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace netgen {
|
|
|
|
extern void MeshFromSpline2D (SplineGeometry2d & geometry,
|
2014-09-25 22:09:21 +00:00
|
|
|
shared_ptr<Mesh> & mesh,
|
2014-01-25 21:17:16 +00:00
|
|
|
MeshingParameters & mp);
|
2019-03-05 13:04:54 +01:00
|
|
|
extern void Optimize2d(Mesh & mesh, MeshingParameters & mp);
|
2019-08-06 10:42:53 +02:00
|
|
|
extern MeshingParameters mparam;
|
2019-08-06 20:30:10 +02:00
|
|
|
DLL_HEADER extern STLParameters stlparam;
|
2014-01-25 21:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef PARALLEL
|
|
|
|
#include <mpi.h>
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2014-08-30 00:15:59 +00:00
|
|
|
/*
|
2014-01-25 21:17:16 +00:00
|
|
|
namespace netgen
|
|
|
|
{
|
|
|
|
int id = 0, ntasks = 1;
|
|
|
|
}
|
2014-08-30 00:15:59 +00:00
|
|
|
*/
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
// should not be needed (occ currently requires it)
|
|
|
|
namespace netgen {
|
|
|
|
#include "../libsrc/visualization/vispar.hpp"
|
|
|
|
VisualizationParameters vispar;
|
|
|
|
VisualizationParameters :: VisualizationParameters() { ; }
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2019-03-04 14:52:58 +01:00
|
|
|
// Bryn Lloyd - get rid of warning about macro redefinition (previously defined in mydefs.hpp)
|
2023-05-30 14:45:20 +02:00
|
|
|
#if defined(NGLIB_API)
|
|
|
|
#undef NGLIB_API
|
2019-03-04 14:52:58 +01:00
|
|
|
#endif
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
namespace nglib {
|
|
|
|
#include "nglib.h"
|
|
|
|
}
|
|
|
|
|
|
|
|
using namespace netgen;
|
|
|
|
|
|
|
|
// constants and types:
|
|
|
|
|
|
|
|
namespace nglib
|
|
|
|
{
|
2019-02-27 20:32:57 +01:00
|
|
|
inline void NOOP_Deleter(void *) { ; }
|
|
|
|
|
|
|
|
class NullStreambuf : public std::streambuf
|
|
|
|
{
|
|
|
|
char dummyBuffer[64];
|
|
|
|
protected:
|
|
|
|
virtual int overflow(int c)
|
|
|
|
{
|
|
|
|
setp(dummyBuffer, dummyBuffer + sizeof(dummyBuffer));
|
|
|
|
return (c == traits_type::eof()) ? '\0' : c;
|
|
|
|
}
|
|
|
|
};
|
2015-10-22 18:55:54 +02:00
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
// initialize, deconstruct Netgen library:
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_Init (bool cout_to_null, bool cerr_to_null, bool testout_to_null)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
2019-02-27 20:32:57 +01:00
|
|
|
static ostream* null_stream = new ostream(new NullStreambuf);
|
|
|
|
mycout = cout_to_null ? null_stream : &cout;
|
|
|
|
myerr = cerr_to_null ? null_stream : &cerr;
|
|
|
|
testout = testout_to_null ? null_stream : new ofstream("test.out");
|
2014-01-25 21:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_GetStatus(char ** str, double & percent)
|
2019-05-29 16:35:39 +02:00
|
|
|
{
|
|
|
|
::netgen::MyStr s;
|
|
|
|
::netgen::GetStatus(s, percent);
|
|
|
|
*str = new char[s.Length() + 1];
|
|
|
|
strcpy(*str, s.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_SetTerminate(bool abort)
|
2019-05-29 16:35:39 +02:00
|
|
|
{
|
|
|
|
::netgen::multithread.terminate = abort ? 1 : 0;
|
|
|
|
}
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Clean-up functions before ending usage of nglib
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_Exit ()
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create a new netgen mesh object
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Mesh * Ng_NewMesh ()
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * mesh = new Mesh;
|
|
|
|
mesh->AddFaceDescriptor (FaceDescriptor (1, 1, 0, 1));
|
|
|
|
return (Ng_Mesh*)(void*)mesh;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Delete an existing netgen mesh object
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_DeleteMesh (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
if(mesh != NULL)
|
|
|
|
{
|
|
|
|
// Delete the Mesh structures
|
|
|
|
((Mesh*)mesh)->DeleteMesh();
|
|
|
|
|
|
|
|
// Now delete the Mesh class itself
|
|
|
|
delete (Mesh*)mesh;
|
|
|
|
|
|
|
|
// Set the Ng_Mesh pointer to NULL
|
|
|
|
mesh = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Save a netgen mesh in the native VOL format
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_SaveMesh(Ng_Mesh * mesh, const char* filename)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
((Mesh*)mesh)->Save(filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load a netgen native VOL mesh from a given file
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Mesh * Ng_LoadMesh(const char* filename)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * mesh = new Mesh;
|
|
|
|
mesh->Load(filename);
|
|
|
|
return ( (Ng_Mesh*)mesh );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_ExportMesh(Ng_Mesh * ng_mesh, Ng_Export_Formats format, const char* filename)
|
2019-03-01 09:43:47 +01:00
|
|
|
{
|
|
|
|
Mesh * mesh = (Mesh*)ng_mesh;
|
|
|
|
switch (format)
|
|
|
|
{
|
|
|
|
case NG_GMSH:
|
|
|
|
WriteUserFormat( "Gmsh Format", *mesh, filename ); break;
|
|
|
|
case NG_GMSH2:
|
|
|
|
WriteUserFormat( "Gmsh2 Format", *mesh, filename ); break;
|
|
|
|
case NG_VTK:
|
|
|
|
WriteUserFormat( "VTK Format", *mesh, filename ); break;
|
|
|
|
case NG_FLUENT:
|
|
|
|
WriteUserFormat( "Fluent Format", *mesh, filename ); break;
|
|
|
|
case NG_ABAQUS:
|
|
|
|
WriteUserFormat( "Abaqus Format", *mesh, filename ); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
// Merge another mesh file into the currently loaded one
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Result Ng_MergeMesh( Ng_Mesh* mesh, const char* filename)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Ng_Result status = NG_OK;
|
|
|
|
|
|
|
|
ifstream infile(filename);
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
|
|
|
|
if(!infile.good())
|
|
|
|
{
|
|
|
|
status = NG_FILE_NOT_FOUND;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!m)
|
|
|
|
{
|
|
|
|
status = NG_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(status == NG_OK)
|
|
|
|
{
|
|
|
|
const int num_pts = m->GetNP();
|
|
|
|
const int face_offset = m->GetNFD();
|
|
|
|
|
|
|
|
m->Merge(infile, face_offset);
|
|
|
|
|
|
|
|
if(m->GetNP() > num_pts)
|
|
|
|
{
|
|
|
|
status = NG_OK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
status = NG_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Merge another mesh file into the currently loaded one
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Result Ng_MergeMesh( Ng_Mesh* mesh1, Ng_Mesh* mesh2)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
return NG_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Manually add a point to an existing mesh object
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_AddPoint (Ng_Mesh * mesh, double * x)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
m->AddPoint (Point3d (x[0], x[1], x[2]));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-02-27 20:32:57 +01:00
|
|
|
// Manually lock a specific point
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_AddLockedPoint(Ng_Mesh * mesh, int pi)
|
2019-02-27 20:32:57 +01:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
m->AddLockedPoint(pi);
|
|
|
|
}
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_ClearFaceDescriptors (Ng_Mesh * ng_mesh)
|
2019-03-04 14:46:11 +01:00
|
|
|
{
|
|
|
|
Mesh * mesh = (Mesh*)ng_mesh;
|
|
|
|
mesh->ClearFaceDescriptors();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API int Ng_AddFaceDescriptor (Ng_Mesh * ng_mesh, int surfnr, int domin, int domout, int bcp)
|
2019-03-04 14:46:11 +01:00
|
|
|
{
|
|
|
|
Mesh * mesh = (Mesh*)ng_mesh;
|
|
|
|
int nfd = mesh->GetNFD();
|
|
|
|
|
|
|
|
int faceind = 0;
|
|
|
|
for (int j = 1; j <= nfd; j++)
|
|
|
|
{
|
|
|
|
if (mesh->GetFaceDescriptor(j).SurfNr() == surfnr
|
|
|
|
&& mesh->GetFaceDescriptor(j).BCProperty() == bcp
|
|
|
|
&& mesh->GetFaceDescriptor(j).DomainIn() == domin
|
|
|
|
&& mesh->GetFaceDescriptor(j).DomainOut() == domout)
|
|
|
|
{
|
|
|
|
faceind = j;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!faceind)
|
|
|
|
{
|
|
|
|
faceind = mesh->AddFaceDescriptor (FaceDescriptor(surfnr, domin, domout, 0));
|
|
|
|
mesh->GetFaceDescriptor(faceind).SetBCProperty (bcp);
|
|
|
|
}
|
|
|
|
return faceind;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_SetupFacedescriptors (Ng_Mesh * mesh, int maxbc)
|
2019-03-04 14:46:11 +01:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
m->ClearFaceDescriptors();
|
|
|
|
for (int i = 1; i <= maxbc; i++)
|
|
|
|
m->AddFaceDescriptor (FaceDescriptor (i, 0, 0, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
// Manually add a surface element of a given type to an existing mesh object
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_AddSurfaceElement (Ng_Mesh * mesh, Ng_Surface_Element_Type et,
|
2019-03-04 14:46:11 +01:00
|
|
|
int * pi, int facenr)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
2019-02-27 20:32:57 +01:00
|
|
|
int n = 3;
|
|
|
|
switch (et)
|
|
|
|
{
|
|
|
|
case NG_TRIG:
|
|
|
|
n = 3; break;
|
|
|
|
case NG_QUAD:
|
|
|
|
n = 4; break;
|
|
|
|
case NG_QUAD6:
|
|
|
|
n = 6; break;
|
|
|
|
case NG_TRIG6:
|
|
|
|
n = 6; break;
|
|
|
|
case NG_QUAD8:
|
|
|
|
n = 8; break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
Mesh * m = (Mesh*)mesh;
|
2019-02-27 20:32:57 +01:00
|
|
|
Element2d el (n);
|
2019-03-04 14:46:11 +01:00
|
|
|
el.SetIndex (facenr);
|
2019-02-27 20:32:57 +01:00
|
|
|
for (int i=0; i<n; ++i)
|
|
|
|
el.PNum(i+1) = pi[i];
|
2014-01-25 21:17:16 +00:00
|
|
|
m->AddSurfaceElement (el);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Manually add a volume element of a given type to an existing mesh object
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_AddVolumeElement (Ng_Mesh * mesh, Ng_Volume_Element_Type et,
|
2019-02-27 20:32:57 +01:00
|
|
|
int * pi, int domain)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
2019-02-27 20:32:57 +01:00
|
|
|
int n = 4;
|
|
|
|
switch (et)
|
|
|
|
{
|
|
|
|
case NG_TET:
|
|
|
|
n = 4; break;
|
|
|
|
case NG_PYRAMID:
|
|
|
|
n = 5; break;
|
|
|
|
case NG_PRISM:
|
|
|
|
n = 6; break;
|
2019-03-01 09:43:47 +01:00
|
|
|
case NG_HEX:
|
|
|
|
n = 8; break;
|
2019-02-27 20:32:57 +01:00
|
|
|
case NG_TET10:
|
|
|
|
n = 10; break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
Mesh * m = (Mesh*)mesh;
|
2019-02-27 20:32:57 +01:00
|
|
|
Element el (n);
|
|
|
|
el.SetIndex (domain);
|
|
|
|
for (int i=0; i<n; ++i)
|
|
|
|
el.PNum(i+1) = pi[i];
|
2014-01-25 21:17:16 +00:00
|
|
|
m->AddVolumeElement (el);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Obtain the number of points in the mesh
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API int Ng_GetNP (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
return ((Mesh*)mesh) -> GetNP();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Obtain the number of surface elements in the mesh
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API int Ng_GetNSE (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
return ((Mesh*)mesh) -> GetNSE();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Obtain the number of volume elements in the mesh
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API int Ng_GetNE (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
return ((Mesh*)mesh) -> GetNE();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return point coordinates of a given point index in the mesh
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_GetPoint (Ng_Mesh * mesh, int num, double * x)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
const Point3d & p = ((Mesh*)mesh)->Point(num);
|
|
|
|
x[0] = p.X();
|
|
|
|
x[1] = p.Y();
|
|
|
|
x[2] = p.Z();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API bool Ng_GetFaceDescriptor (Ng_Mesh * mesh, int facenr, int &surfnr, int &domin, int &domout, int &bcp)
|
2019-03-04 14:46:11 +01:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
if (facenr <= m->GetNFD())
|
|
|
|
{
|
|
|
|
surfnr = m->GetFaceDescriptor(facenr).SurfNr();
|
|
|
|
domin = m->GetFaceDescriptor(facenr).DomainIn();
|
|
|
|
domout = m->GetFaceDescriptor(facenr).DomainOut();
|
|
|
|
bcp = m->GetFaceDescriptor(facenr).BCProperty();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
// Return the surface element at a given index "pi"
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Surface_Element_Type
|
2019-03-04 14:46:11 +01:00
|
|
|
Ng_GetSurfaceElement (Ng_Mesh * mesh, int num, int * pi, int * facenr)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
const Element2d & el = ((Mesh*)mesh)->SurfaceElement(num);
|
|
|
|
for (int i = 1; i <= el.GetNP(); i++)
|
|
|
|
pi[i-1] = el.PNum(i);
|
|
|
|
Ng_Surface_Element_Type et;
|
|
|
|
switch (el.GetNP())
|
|
|
|
{
|
|
|
|
case 3: et = NG_TRIG; break;
|
|
|
|
case 4: et = NG_QUAD; break;
|
|
|
|
case 6:
|
|
|
|
switch (el.GetNV())
|
|
|
|
{
|
|
|
|
case 3: et = NG_TRIG6; break;
|
|
|
|
case 4: et = NG_QUAD6; break;
|
|
|
|
default:
|
|
|
|
et = NG_TRIG6; break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 8: et = NG_QUAD8; break;
|
|
|
|
default:
|
|
|
|
et = NG_TRIG; break; // for the compiler
|
|
|
|
}
|
2019-03-04 14:46:11 +01:00
|
|
|
if (facenr)
|
|
|
|
*facenr = el.GetIndex();
|
2014-01-25 21:17:16 +00:00
|
|
|
return et;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return the volume element at a given index "pi"
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Volume_Element_Type
|
2019-02-27 20:32:57 +01:00
|
|
|
Ng_GetVolumeElement (Ng_Mesh * mesh, int num, int * pi, int * domain)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
const Element & el = ((Mesh*)mesh)->VolumeElement(num);
|
|
|
|
for (int i = 1; i <= el.GetNP(); i++)
|
|
|
|
pi[i-1] = el.PNum(i);
|
|
|
|
Ng_Volume_Element_Type et;
|
|
|
|
switch (el.GetNP())
|
|
|
|
{
|
|
|
|
case 4: et = NG_TET; break;
|
|
|
|
case 5: et = NG_PYRAMID; break;
|
|
|
|
case 6: et = NG_PRISM; break;
|
2019-03-01 09:43:47 +01:00
|
|
|
case 8: et = NG_HEX; break;
|
2014-01-25 21:17:16 +00:00
|
|
|
case 10: et = NG_TET10; break;
|
|
|
|
default:
|
|
|
|
et = NG_TET; break; // for the compiler
|
|
|
|
}
|
2019-02-27 20:32:57 +01:00
|
|
|
if (domain)
|
2019-03-01 16:40:28 +01:00
|
|
|
*domain = el.GetIndex();
|
2014-01-25 21:17:16 +00:00
|
|
|
return et;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set a global limit on the maximum mesh size allowed
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_RestrictMeshSizeGlobal (Ng_Mesh * mesh, double h)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
((Mesh*)mesh) -> SetGlobalH (h);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set a local limit on the maximum mesh size allowed around the given point
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_RestrictMeshSizePoint (Ng_Mesh * mesh, double * p, double h)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
((Mesh*)mesh) -> RestrictLocalH (Point3d (p[0], p[1], p[2]), h);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set a local limit on the maximum mesh size allowed within a given box region
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_RestrictMeshSizeBox (Ng_Mesh * mesh, double * pmin, double * pmax, double h)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
for (double x = pmin[0]; x < pmax[0]; x += h)
|
|
|
|
for (double y = pmin[1]; y < pmax[1]; y += h)
|
|
|
|
for (double z = pmin[2]; z < pmax[2]; z += h)
|
|
|
|
((Mesh*)mesh) -> RestrictLocalH (Point3d (x, y, z), h);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Generates volume mesh from an existing surface mesh
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Result Ng_GenerateVolumeMesh (Ng_Mesh * mesh, Ng_Meshing_Parameters * mp)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
|
|
|
|
// Philippose - 30/08/2009
|
|
|
|
// Do not locally re-define "mparam" here... "mparam" is a global
|
|
|
|
// object
|
|
|
|
//MeshingParameters mparam;
|
|
|
|
mp->Transfer_Parameters();
|
|
|
|
|
|
|
|
m->CalcLocalH(mparam.grading);
|
|
|
|
|
|
|
|
MeshVolume (mparam, *m);
|
|
|
|
RemoveIllegalElements (*m);
|
|
|
|
OptimizeVolume (mparam, *m);
|
|
|
|
|
|
|
|
return NG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-02-27 20:32:57 +01:00
|
|
|
// Optimize existing mesh
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API Ng_Result Ng_OptimizeVolume(Ng_Mesh *mesh, Ng_Meshing_Parameters *mp)
|
2019-02-27 20:32:57 +01:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
|
|
|
|
mp->Transfer_Parameters();
|
|
|
|
|
|
|
|
m->CalcLocalH(mparam.grading);
|
|
|
|
|
|
|
|
RemoveIllegalElements(*m);
|
|
|
|
OptimizeVolume(mparam, *m);
|
|
|
|
|
|
|
|
return NG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
/* ------------------ 2D Meshing Functions ------------------------- */
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_AddPoint_2D (Ng_Mesh * mesh, double * x)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
|
|
|
|
m->AddPoint (Point3d (x[0], x[1], 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_AddBoundarySeg_2D (Ng_Mesh * mesh, int pi1, int pi2, int domain_in, int domain_out)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
|
|
|
|
Segment seg;
|
|
|
|
seg[0] = pi1;
|
|
|
|
seg[1] = pi2;
|
2019-02-27 20:32:57 +01:00
|
|
|
seg.domin = domain_in;
|
|
|
|
seg.domout = domain_out;
|
2019-03-01 16:40:28 +01:00
|
|
|
m->AddSegment(seg);
|
2014-01-25 21:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API int Ng_GetNP_2D (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
return m->GetNP();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API int Ng_GetNE_2D (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
return m->GetNSE();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API int Ng_GetNSeg_2D (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
return m->GetNSeg();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_GetPoint_2D (Ng_Mesh * mesh, int num, double * x)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
|
|
|
|
Point<3> & p = m->Point(num);
|
|
|
|
x[0] = p(0);
|
|
|
|
x[1] = p(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Surface_Element_Type
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_GetElement_2D (Ng_Mesh * mesh, int num, int * pi, int * matnum)
|
|
|
|
{
|
|
|
|
const Element2d & el = ((Mesh*)mesh)->SurfaceElement(num);
|
|
|
|
for (int i = 1; i <= el.GetNP(); i++)
|
|
|
|
pi[i-1] = el.PNum(i);
|
|
|
|
|
|
|
|
Ng_Surface_Element_Type et;
|
|
|
|
switch (el.GetNP())
|
|
|
|
{
|
|
|
|
case 3: et = NG_TRIG; break;
|
|
|
|
case 4: et = NG_QUAD; break;
|
|
|
|
case 6:
|
|
|
|
switch (el.GetNV())
|
|
|
|
{
|
|
|
|
case 3: et = NG_TRIG6; break;
|
|
|
|
case 4: et = NG_QUAD6; break;
|
|
|
|
default:
|
|
|
|
et = NG_TRIG6; break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 8: et = NG_QUAD8; break;
|
|
|
|
default:
|
|
|
|
et = NG_TRIG; break; // for the compiler
|
|
|
|
}
|
|
|
|
|
|
|
|
if (matnum)
|
|
|
|
*matnum = el.GetIndex();
|
|
|
|
|
|
|
|
return et;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_GetSegment_2D (Ng_Mesh * mesh, int num, int * pi, int * matnum)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
const Segment & seg = ((Mesh*)mesh)->LineSegment(num);
|
|
|
|
pi[0] = seg[0];
|
|
|
|
pi[1] = seg[1];
|
|
|
|
|
|
|
|
if (matnum)
|
|
|
|
*matnum = seg.edgenr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Geometry_2D * Ng_LoadGeometry_2D (const char * filename)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
SplineGeometry2d * geom = new SplineGeometry2d();
|
|
|
|
geom -> Load (filename);
|
|
|
|
return (Ng_Geometry_2D *)geom;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API Ng_Geometry_2D * Ng_NewGeometry_2D ()
|
2019-03-01 22:21:55 +01:00
|
|
|
{
|
|
|
|
SplineGeometry2d * geom = new SplineGeometry2d();
|
|
|
|
return (Ng_Geometry_2D *)geom;
|
|
|
|
}
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_DeleteGeometry_2D (Ng_Geometry_2D * geom)
|
2019-03-01 22:21:55 +01:00
|
|
|
{
|
|
|
|
if (geom)
|
|
|
|
{
|
|
|
|
SplineGeometry2d* spline_geom = (SplineGeometry2d*)geom;
|
|
|
|
delete spline_geom;
|
|
|
|
geom = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_AppendPoint_2D (Ng_Geometry_2D* geom, double * x, double h)
|
2019-03-01 22:21:55 +01:00
|
|
|
{
|
|
|
|
if (geom)
|
|
|
|
{
|
|
|
|
SplineGeometry2d* spline_geom = (SplineGeometry2d*)geom;
|
|
|
|
Point<2> p(x[0],x[1]);
|
|
|
|
spline_geom->AppendPoint(p, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_AppendLineSegment_2D (Ng_Geometry_2D* geom, int n1, int n2,
|
2019-03-01 22:21:55 +01:00
|
|
|
int leftdomain, int rightdomain, double h)
|
|
|
|
{
|
|
|
|
if (geom)
|
|
|
|
{
|
|
|
|
SplineGeometry2d* spline_geom = (SplineGeometry2d*)geom;
|
|
|
|
// zero-offset!
|
|
|
|
LineSeg<2>* line = new LineSeg<2>(spline_geom->geompoints[n1-1], spline_geom->geompoints[n2-1]);
|
|
|
|
SplineSegExt* seg = new SplineSegExt(*line);
|
|
|
|
seg->leftdom = leftdomain;
|
|
|
|
seg->rightdom = rightdomain;
|
|
|
|
seg->hmax = h;
|
|
|
|
seg->copyfrom = -1;
|
|
|
|
seg->bc = 1;
|
|
|
|
spline_geom->AppendSegment(seg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_AppendSplinSegment_2D (Ng_Geometry_2D* geom, int n1, int n2, int n3,
|
2019-03-01 22:21:55 +01:00
|
|
|
int leftdomain, int rightdomain, double h)
|
|
|
|
{
|
|
|
|
if (geom)
|
|
|
|
{
|
|
|
|
SplineGeometry2d* spline_geom = (SplineGeometry2d*)geom;
|
|
|
|
// zero-offset!
|
2023-05-30 14:45:20 +02:00
|
|
|
NgArray<Point<2> > pts;
|
2019-03-01 22:39:03 +01:00
|
|
|
pts.Append(spline_geom->geompoints[n1-1]);
|
|
|
|
pts.Append(spline_geom->geompoints[n2-1]);
|
|
|
|
pts.Append(spline_geom->geompoints[n3-1]);
|
|
|
|
auto line = new BSplineSeg<2,3>(pts);
|
|
|
|
//SplineSeg3<2>* line = new SplineSeg3<2>(spline_geom->geompoints[n1-1], spline_geom->geompoints[n2-1], spline_geom->geompoints[n3-1]);
|
2019-03-01 22:21:55 +01:00
|
|
|
SplineSegExt* seg = new SplineSegExt(*line);
|
|
|
|
seg->leftdom = leftdomain;
|
|
|
|
seg->rightdom = rightdomain;
|
|
|
|
seg->hmax = h;
|
|
|
|
seg->copyfrom = -1;
|
|
|
|
seg->bc = 1;
|
|
|
|
spline_geom->AppendSegment(seg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Result Ng_GenerateMesh_2D (Ng_Geometry_2D * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh ** mesh,
|
|
|
|
Ng_Meshing_Parameters * mp)
|
|
|
|
{
|
|
|
|
// use global variable mparam
|
|
|
|
// MeshingParameters mparam;
|
|
|
|
mp->Transfer_Parameters();
|
|
|
|
|
2015-10-22 18:55:54 +02:00
|
|
|
shared_ptr<Mesh> m(new Mesh, &NOOP_Deleter);
|
2014-01-25 21:17:16 +00:00
|
|
|
MeshFromSpline2D (*(SplineGeometry2d*)geom, m, mparam);
|
|
|
|
|
2014-09-25 22:09:21 +00:00
|
|
|
*mesh = (Ng_Mesh*)m.get();
|
2014-01-25 21:17:16 +00:00
|
|
|
return NG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API Ng_Result Ng_OptimizeMesh_2D(Ng_Mesh *mesh, Ng_Meshing_Parameters * mp)
|
2019-03-05 13:04:54 +01:00
|
|
|
{
|
|
|
|
Mesh * m = (Mesh*)mesh;
|
|
|
|
|
|
|
|
mp->Transfer_Parameters();
|
|
|
|
|
|
|
|
m->CalcLocalH(mparam.grading);
|
|
|
|
|
|
|
|
Optimize2d(*m, mparam);
|
|
|
|
|
|
|
|
return NG_OK;
|
|
|
|
}
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_HP_Refinement (Ng_Geometry_2D * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh * mesh,
|
|
|
|
int levels)
|
|
|
|
{
|
2019-10-02 20:29:18 +02:00
|
|
|
Refinement ref(*(SplineGeometry2d*)geom);
|
2014-01-25 21:17:16 +00:00
|
|
|
HPRefinement (*(Mesh*)mesh, &ref, levels);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_HP_Refinement (Ng_Geometry_2D * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh * mesh,
|
|
|
|
int levels, double parameter)
|
|
|
|
{
|
2019-10-02 20:29:18 +02:00
|
|
|
Refinement ref(*(SplineGeometry2d*)geom);
|
2014-01-25 21:17:16 +00:00
|
|
|
HPRefinement (*(Mesh*)mesh, &ref, levels, parameter);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-09 10:39:16 +02:00
|
|
|
NgArray<STLReadTriangle> readtrias; //only before initstlgeometry
|
|
|
|
NgArray<Point<3> > readedges; //only before init stlgeometry
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
// loads geometry from STL file
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_STL_Geometry * Ng_STL_LoadGeometry (const char * filename, int binary)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
STLGeometry geom;
|
|
|
|
STLGeometry* geo;
|
|
|
|
ifstream ist(filename);
|
|
|
|
|
|
|
|
if (binary)
|
|
|
|
{
|
|
|
|
geo = geom.LoadBinary(ist);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
geo = geom.Load(ist);
|
|
|
|
}
|
|
|
|
|
|
|
|
readtrias.SetSize(0);
|
|
|
|
readedges.SetSize(0);
|
|
|
|
|
|
|
|
Point3d p;
|
|
|
|
Vec3d normal;
|
|
|
|
double p1[3];
|
|
|
|
double p2[3];
|
|
|
|
double p3[3];
|
|
|
|
double n[3];
|
|
|
|
|
|
|
|
Ng_STL_Geometry * geo2 = Ng_STL_NewGeometry();
|
|
|
|
|
|
|
|
for (i = 1; i <= geo->GetNT(); i++)
|
|
|
|
{
|
|
|
|
const STLTriangle& t = geo->GetTriangle(i);
|
|
|
|
p = geo->GetPoint(t.PNum(1));
|
|
|
|
p1[0] = p.X(); p1[1] = p.Y(); p1[2] = p.Z();
|
|
|
|
p = geo->GetPoint(t.PNum(2));
|
|
|
|
p2[0] = p.X(); p2[1] = p.Y(); p2[2] = p.Z();
|
|
|
|
p = geo->GetPoint(t.PNum(3));
|
|
|
|
p3[0] = p.X(); p3[1] = p.Y(); p3[2] = p.Z();
|
|
|
|
normal = t.Normal();
|
|
|
|
n[0] = normal.X(); n[1] = normal.Y(); n[2] = normal.Z();
|
|
|
|
|
|
|
|
Ng_STL_AddTriangle(geo2, p1, p2, p3, n);
|
|
|
|
}
|
|
|
|
|
|
|
|
return geo2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// generate new STL Geometry
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_STL_Geometry * Ng_STL_NewGeometry ()
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
return (Ng_STL_Geometry*)(void*)new STLGeometry;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_STL_DeleteGeometry (Ng_STL_Geometry * geom)
|
2019-03-01 16:40:28 +01:00
|
|
|
{
|
|
|
|
if (geom)
|
|
|
|
{
|
|
|
|
STLGeometry* geometry = (STLGeometry*)geom;
|
|
|
|
geometry->Clear();
|
|
|
|
delete geometry;
|
|
|
|
geometry = NULL;
|
|
|
|
}
|
|
|
|
}
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
// after adding triangles (and edges) initialize
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Result Ng_STL_InitSTLGeometry (Ng_STL_Geometry * geom)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
STLGeometry* geo = (STLGeometry*)geom;
|
|
|
|
geo->InitSTLGeometry(readtrias);
|
|
|
|
readtrias.SetSize(0);
|
|
|
|
|
|
|
|
if (readedges.Size() != 0)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
for (int i = 1; i <= readedges.Size(); i+=2)
|
|
|
|
{
|
|
|
|
cout << "e(" << readedges.Get(i) << "," << readedges.Get(i+1) << ")" << endl;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
geo->AddEdges(readedges);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (geo->GetStatus() == STLTopology::STL_GOOD || geo->GetStatus() == STLTopology::STL_WARNING) return NG_OK;
|
|
|
|
return NG_SURFACE_INPUT_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// automatically generates edges:
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Result Ng_STL_MakeEdges (Ng_STL_Geometry * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh* mesh,
|
2019-03-01 16:40:28 +01:00
|
|
|
Ng_Meshing_Parameters * mp,
|
|
|
|
Ng_STL_Parameters * stlp)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
STLGeometry* stlgeometry = (STLGeometry*)geom;
|
|
|
|
Mesh* me = (Mesh*)mesh;
|
2019-11-22 14:09:07 +01:00
|
|
|
me->SetGeometry( shared_ptr<NetgenGeometry>(stlgeometry, &NOOP_Deleter) );
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
// Philippose - 27/07/2009
|
|
|
|
// Do not locally re-define "mparam" here... "mparam" is a global
|
|
|
|
// object
|
|
|
|
//MeshingParameters mparam;
|
|
|
|
mp->Transfer_Parameters();
|
2019-03-01 16:40:28 +01:00
|
|
|
if (stlp) stlp->Transfer_Parameters();
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
me -> SetGlobalH (mparam.maxh);
|
|
|
|
me -> SetLocalH (stlgeometry->GetBoundingBox().PMin() - Vec3d(10, 10, 10),
|
|
|
|
stlgeometry->GetBoundingBox().PMax() + Vec3d(10, 10, 10),
|
|
|
|
0.3);
|
|
|
|
|
2015-07-18 13:05:37 +02:00
|
|
|
// cout << "meshsize = " << mp->meshsize_filename << endl;
|
|
|
|
if (mp->meshsize_filename)
|
|
|
|
me -> LoadLocalMeshSize (mp->meshsize_filename);
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
/*
|
|
|
|
if (mp->meshsize_filename)
|
2015-07-18 13:05:37 +02:00
|
|
|
{
|
|
|
|
ifstream infile (mp->meshsize_filename);
|
|
|
|
if (!infile.good()) return NG_FILE_NOT_FOUND;
|
|
|
|
me -> LoadLocalMeshSize (infile);
|
|
|
|
}
|
2014-01-25 21:17:16 +00:00
|
|
|
*/
|
|
|
|
|
2019-08-06 10:42:53 +02:00
|
|
|
STLMeshing (*stlgeometry, *me, mparam, stlparam);
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
stlgeometry->edgesfound = 1;
|
|
|
|
stlgeometry->surfacemeshed = 0;
|
|
|
|
stlgeometry->surfaceoptimized = 0;
|
|
|
|
stlgeometry->volumemeshed = 0;
|
|
|
|
|
|
|
|
return NG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// generates mesh, empty mesh be already created.
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Result Ng_STL_GenerateSurfaceMesh (Ng_STL_Geometry * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh* mesh,
|
2019-03-01 16:40:28 +01:00
|
|
|
Ng_Meshing_Parameters * mp,
|
|
|
|
Ng_STL_Parameters * stlp)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
STLGeometry* stlgeometry = (STLGeometry*)geom;
|
|
|
|
Mesh* me = (Mesh*)mesh;
|
2019-11-22 14:09:07 +01:00
|
|
|
me->SetGeometry( shared_ptr<NetgenGeometry>(stlgeometry, &NOOP_Deleter) );
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
// Philippose - 27/07/2009
|
|
|
|
// Do not locally re-define "mparam" here... "mparam" is a global
|
|
|
|
// object
|
|
|
|
//MeshingParameters mparam;
|
|
|
|
mp->Transfer_Parameters();
|
2019-03-01 16:40:28 +01:00
|
|
|
if (stlp) stlp->Transfer_Parameters();
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
me -> SetGlobalH (mparam.maxh);
|
|
|
|
me -> SetLocalH (stlgeometry->GetBoundingBox().PMin() - Vec3d(10, 10, 10),
|
|
|
|
stlgeometry->GetBoundingBox().PMax() + Vec3d(10, 10, 10),
|
|
|
|
0.3);
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
STLMeshing (*stlgeometry, *me);
|
|
|
|
|
|
|
|
stlgeometry->edgesfound = 1;
|
|
|
|
stlgeometry->surfacemeshed = 0;
|
|
|
|
stlgeometry->surfaceoptimized = 0;
|
|
|
|
stlgeometry->volumemeshed = 0;
|
|
|
|
*/
|
2019-08-06 12:16:30 +02:00
|
|
|
int retval = STLSurfaceMeshing (*stlgeometry, *me, mparam, stlparam);
|
2014-01-25 21:17:16 +00:00
|
|
|
if (retval == MESHING3_OK)
|
|
|
|
{
|
|
|
|
(*mycout) << "Success !!!!" << endl;
|
|
|
|
stlgeometry->surfacemeshed = 1;
|
|
|
|
stlgeometry->surfaceoptimized = 0;
|
|
|
|
stlgeometry->volumemeshed = 0;
|
|
|
|
}
|
|
|
|
else if (retval == MESHING3_OUTERSTEPSEXCEEDED)
|
|
|
|
{
|
|
|
|
(*mycout) << "ERROR: Give up because of too many trials. Meshing aborted!" << endl;
|
|
|
|
}
|
|
|
|
else if (retval == MESHING3_TERMINATE)
|
|
|
|
{
|
|
|
|
(*mycout) << "Meshing Stopped!" << endl;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
(*mycout) << "ERROR: Surface meshing not successful. Meshing aborted!" << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
STLSurfaceOptimization (*stlgeometry, *me, mparam);
|
|
|
|
|
|
|
|
return NG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fills STL Geometry
|
|
|
|
// positive orientation
|
|
|
|
// normal vector may be null-pointer
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_STL_AddTriangle (Ng_STL_Geometry * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
double * p1, double * p2, double * p3,
|
|
|
|
double * nv)
|
|
|
|
{
|
|
|
|
Point<3> apts[3];
|
|
|
|
apts[0] = Point<3>(p1[0],p1[1],p1[2]);
|
|
|
|
apts[1] = Point<3>(p2[0],p2[1],p2[2]);
|
|
|
|
apts[2] = Point<3>(p3[0],p3[1],p3[2]);
|
|
|
|
|
|
|
|
Vec<3> n;
|
|
|
|
if (!nv)
|
|
|
|
n = Cross (apts[0]-apts[1], apts[0]-apts[2]);
|
|
|
|
else
|
|
|
|
n = Vec<3>(nv[0],nv[1],nv[2]);
|
|
|
|
|
|
|
|
readtrias.Append(STLReadTriangle(apts,n));
|
|
|
|
}
|
|
|
|
|
|
|
|
// add (optional) edges:
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_STL_AddEdge (Ng_STL_Geometry * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
double * p1, double * p2)
|
|
|
|
{
|
|
|
|
readedges.Append(Point3d(p1[0],p1[1],p1[2]));
|
|
|
|
readedges.Append(Point3d(p2[0],p2[1],p2[2]));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------ Begin - Meshing Parameters related functions ------------------
|
|
|
|
// Constructor for the local nglib meshing parameters class
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API Ng_Meshing_Parameters :: Ng_Meshing_Parameters()
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
uselocalh = 1;
|
|
|
|
|
|
|
|
maxh = 1000;
|
|
|
|
minh = 0.0;
|
|
|
|
|
|
|
|
fineness = 0.5;
|
|
|
|
grading = 0.3;
|
|
|
|
|
|
|
|
elementsperedge = 2.0;
|
|
|
|
elementspercurve = 2.0;
|
|
|
|
|
|
|
|
closeedgeenable = 0;
|
|
|
|
closeedgefact = 2.0;
|
2019-03-01 10:05:24 +01:00
|
|
|
|
|
|
|
minedgelenenable = 0;
|
|
|
|
minedgelen = 1e-4;
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
second_order = 0;
|
|
|
|
quad_dominated = 0;
|
|
|
|
|
|
|
|
meshsize_filename = 0;
|
|
|
|
|
|
|
|
optsurfmeshenable = 1;
|
|
|
|
optvolmeshenable = 1;
|
|
|
|
|
|
|
|
optsteps_2d = 3;
|
|
|
|
optsteps_3d = 3;
|
2019-03-01 10:05:24 +01:00
|
|
|
|
|
|
|
optimize3d = "cmdmustm";
|
|
|
|
optimize2d = "smsmsmSmSmSm";
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
invert_tets = 0;
|
|
|
|
invert_trigs = 0;
|
|
|
|
|
|
|
|
check_overlap = 1;
|
|
|
|
check_overlapping_boundary = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Reset the local meshing parameters to the default values
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_Meshing_Parameters :: Reset_Parameters()
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
2019-03-01 10:05:24 +01:00
|
|
|
(*this) = Ng_Meshing_Parameters();
|
2014-01-25 21:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_Meshing_Parameters :: Transfer_Parameters()
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
mparam.uselocalh = uselocalh;
|
|
|
|
|
|
|
|
mparam.maxh = maxh;
|
|
|
|
mparam.minh = minh;
|
|
|
|
|
|
|
|
mparam.grading = grading;
|
|
|
|
mparam.curvaturesafety = elementspercurve;
|
|
|
|
mparam.segmentsperedge = elementsperedge;
|
|
|
|
|
|
|
|
mparam.secondorder = second_order;
|
|
|
|
mparam.quad = quad_dominated;
|
|
|
|
|
2015-07-18 13:05:37 +02:00
|
|
|
if (meshsize_filename)
|
|
|
|
mparam.meshsizefilename = meshsize_filename;
|
|
|
|
else
|
|
|
|
mparam.meshsizefilename = "";
|
2014-01-25 21:17:16 +00:00
|
|
|
mparam.optsteps2d = optsteps_2d;
|
|
|
|
mparam.optsteps3d = optsteps_3d;
|
2019-03-01 10:05:24 +01:00
|
|
|
|
|
|
|
if (strlen(optimize2d) > 0) mparam.optimize2d = optimize2d;
|
|
|
|
if (strlen(optimize3d) > 0) mparam.optimize3d = optimize3d;
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
mparam.inverttets = invert_tets;
|
|
|
|
mparam.inverttrigs = invert_trigs;
|
|
|
|
|
|
|
|
mparam.checkoverlap = check_overlap;
|
|
|
|
mparam.checkoverlappingboundary = check_overlapping_boundary;
|
|
|
|
}
|
2019-03-01 16:40:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API Ng_STL_Parameters :: Ng_STL_Parameters()
|
2019-03-01 16:40:28 +01:00
|
|
|
{
|
|
|
|
yangle = 30;
|
|
|
|
contyangle = 20;
|
|
|
|
|
|
|
|
chartangle = 10; // original = 15
|
|
|
|
outerchartangle = 80; // original = 70;
|
|
|
|
|
|
|
|
usesearchtree = 0;
|
|
|
|
|
|
|
|
atlasminh = 1.0; // original = 1E-4
|
|
|
|
|
|
|
|
resthatlasenable = 1;
|
|
|
|
resthatlasfac = 2;
|
|
|
|
|
|
|
|
resthchartdistenable = 1;
|
|
|
|
resthchartdistfac = 0.3; // original = 1.2
|
|
|
|
|
|
|
|
resthedgeangleenable = 0;
|
|
|
|
resthedgeanglefac = 1;
|
|
|
|
|
|
|
|
resthsurfmeshcurvenable = 1;
|
|
|
|
resthsurfmeshcurvfac = 1;
|
|
|
|
|
|
|
|
resthlinelengthenable = 1;
|
|
|
|
resthlinelengthfac = 0.2; // original = 0.5
|
|
|
|
|
|
|
|
resthcloseedgefac = 1;
|
|
|
|
resthcloseedgeenable = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_STL_Parameters :: Transfer_Parameters()
|
2019-03-01 16:40:28 +01:00
|
|
|
{
|
|
|
|
stlparam.yangle = yangle;
|
|
|
|
stlparam.contyangle = contyangle;
|
|
|
|
|
|
|
|
stlparam.chartangle = chartangle;
|
|
|
|
stlparam.outerchartangle = outerchartangle;
|
|
|
|
|
|
|
|
stlparam.usesearchtree = usesearchtree;
|
|
|
|
|
|
|
|
stlparam.atlasminh = atlasminh;
|
|
|
|
|
|
|
|
stlparam.resthatlasenable = resthatlasenable;
|
|
|
|
stlparam.resthatlasfac = resthatlasfac;
|
|
|
|
|
|
|
|
stlparam.resthchartdistenable = resthchartdistenable;
|
|
|
|
stlparam.resthchartdistfac = resthchartdistfac;
|
|
|
|
|
|
|
|
stlparam.resthedgeangleenable = resthedgeangleenable;
|
|
|
|
stlparam.resthedgeanglefac = resthedgeanglefac;
|
|
|
|
|
|
|
|
stlparam.resthsurfmeshcurvenable = resthsurfmeshcurvenable;
|
|
|
|
stlparam.resthsurfmeshcurvfac = resthsurfmeshcurvfac;
|
|
|
|
|
|
|
|
stlparam.resthlinelengthenable = resthlinelengthenable;
|
|
|
|
stlparam.resthlinelengthfac = resthlinelengthfac;
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
// stlparam.resthcloseedgeenable = resthcloseedgeenable;
|
|
|
|
// stlparam.resthcloseedgefac = resthcloseedgefac;
|
2019-03-01 16:40:28 +01:00
|
|
|
}
|
2014-01-25 21:17:16 +00:00
|
|
|
// ------------------ End - Meshing Parameters related functions --------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------ Begin - Second Order Mesh generation functions ----------------
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_Generate_SecondOrder(Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
2019-10-02 20:29:18 +02:00
|
|
|
Refinement ref(*((Mesh*) mesh)->GetGeometry());
|
2014-01-25 21:17:16 +00:00
|
|
|
ref.MakeSecondOrder(*(Mesh*) mesh);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_2D_Generate_SecondOrder(Ng_Geometry_2D * geom,
|
2019-03-01 16:40:28 +01:00
|
|
|
Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
( (SplineGeometry2d*)geom ) -> GetRefinement().MakeSecondOrder( * (Mesh*) mesh );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_STL_Generate_SecondOrder(Ng_STL_Geometry * geom,
|
2019-03-01 16:40:28 +01:00
|
|
|
Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
((STLGeometry*)geom)->GetRefinement().MakeSecondOrder(*(Mesh*) mesh);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_CSG_Generate_SecondOrder (Ng_CSG_Geometry * geom,
|
2019-03-01 16:40:28 +01:00
|
|
|
Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
((CSGeometry*)geom)->GetRefinement().MakeSecondOrder(*(Mesh*) mesh);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------ End - Second Order Mesh generation functions ------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------ Begin - Uniform Mesh Refinement functions ---------------------
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_Uniform_Refinement (Ng_Mesh * mesh)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
2023-05-30 14:45:20 +02:00
|
|
|
Refinement ref(*((Mesh*)mesh)->GetGeometry());
|
|
|
|
ref.Refine ( * (Mesh*) mesh );
|
2014-01-25 21:17:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_SetRefinementFlag (Ng_Mesh * ng_mesh, int ei, int flag)
|
2019-03-01 09:43:47 +01:00
|
|
|
{
|
|
|
|
Mesh * mesh = (Mesh*) ng_mesh;
|
|
|
|
|
|
|
|
if (mesh->GetDimension() == 3)
|
|
|
|
{
|
|
|
|
mesh->VolumeElement(ei).SetRefinementFlag (flag != 0);
|
|
|
|
mesh->VolumeElement(ei).SetStrongRefinementFlag (flag >= 10);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mesh->SurfaceElement(ei).SetRefinementFlag (flag != 0);
|
|
|
|
mesh->SurfaceElement(ei).SetStrongRefinementFlag (flag >= 10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_SetSurfaceRefinementFlag (Ng_Mesh * ng_mesh, int ei, int flag)
|
2019-03-01 09:43:47 +01:00
|
|
|
{
|
|
|
|
Mesh * mesh = (Mesh*) ng_mesh;
|
|
|
|
|
|
|
|
if (mesh->GetDimension() == 3)
|
|
|
|
{
|
|
|
|
mesh->SurfaceElement(ei).SetRefinementFlag (flag != 0);
|
|
|
|
mesh->SurfaceElement(ei).SetStrongRefinementFlag (flag >= 10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
NGLIB_API void Ng_Refine (Ng_Mesh * ng_mesh)
|
2019-03-01 09:43:47 +01:00
|
|
|
{
|
|
|
|
Mesh * mesh = (Mesh*) ng_mesh;
|
|
|
|
BisectionOptions biopt;
|
|
|
|
biopt.usemarkedelements = 1;
|
|
|
|
biopt.refine_p = 0; // only h-refinement
|
|
|
|
biopt.refine_hp = 0;
|
|
|
|
|
2023-05-30 14:45:20 +02:00
|
|
|
Refinement ref(*((Mesh*)mesh)->GetGeometry());
|
|
|
|
ref.Bisect(*(Mesh*)mesh, biopt);
|
2019-03-01 09:43:47 +01:00
|
|
|
|
2019-03-01 10:05:24 +01:00
|
|
|
// \todo not sure if this is needed?
|
2019-03-01 09:43:47 +01:00
|
|
|
//mesh -> UpdateTopology();
|
|
|
|
//mesh -> GetCurvedElements().SetIsHighOrder (false);
|
|
|
|
}
|
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_2D_Uniform_Refinement (Ng_Geometry_2D * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh * mesh)
|
|
|
|
{
|
|
|
|
( (SplineGeometry2d*)geom ) -> GetRefinement().Refine ( * (Mesh*) mesh );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_STL_Uniform_Refinement (Ng_STL_Geometry * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh * mesh)
|
|
|
|
{
|
|
|
|
( (STLGeometry*)geom ) -> GetRefinement().Refine ( * (Mesh*) mesh );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_CSG_Uniform_Refinement (Ng_CSG_Geometry * geom,
|
2014-01-25 21:17:16 +00:00
|
|
|
Ng_Mesh * mesh)
|
|
|
|
{
|
|
|
|
( (CSGeometry*)geom ) -> GetRefinement().Refine ( * (Mesh*) mesh );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------ End - Uniform Mesh Refinement functions -----------------------
|
|
|
|
} // End of namespace nglib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compatibility functions:
|
|
|
|
namespace netgen
|
|
|
|
{
|
|
|
|
char geomfilename[255];
|
|
|
|
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void MyError2 (const char * ch)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
cerr << ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Destination for messages, errors, ...
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API void Ng_PrintDest2(const char * s)
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
#ifdef PARALLEL
|
|
|
|
int id = 0;
|
|
|
|
MPI_Comm_rank(MPI_COMM_WORLD, &id);
|
|
|
|
if (id != 0) return;
|
|
|
|
#endif
|
|
|
|
(*mycout) << s << flush;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-08-30 00:15:59 +00:00
|
|
|
/*
|
2021-02-18 11:37:05 +01:00
|
|
|
NGLIB_API double GetTime ()
|
2014-01-25 21:17:16 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2014-08-30 00:15:59 +00:00
|
|
|
*/
|
2014-01-25 21:17:16 +00:00
|
|
|
|
2019-02-02 16:23:46 +01:00
|
|
|
/*
|
2014-09-04 15:15:17 +00:00
|
|
|
#ifndef WIN32
|
2014-01-25 21:17:16 +00:00
|
|
|
void ResetTime ()
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
2014-09-04 15:15:17 +00:00
|
|
|
#endif
|
2019-02-02 16:23:46 +01:00
|
|
|
*/
|
2014-01-25 21:17:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
void MyBeep (int i)
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-09 07:58:21 +00:00
|
|
|
//void Render() { ; }
|
2014-10-06 09:57:44 +00:00
|
|
|
|
2014-01-25 21:17:16 +00:00
|
|
|
} // End of namespace netgen
|
|
|
|
|
|
|
|
|
2014-10-16 16:05:42 +00:00
|
|
|
/*
|
|
|
|
|
2014-10-16 15:14:35 +00:00
|
|
|
#ifndef WIN32
|
2014-01-25 21:17:16 +00:00
|
|
|
void Ng_Redraw () { ; }
|
2014-10-10 11:39:30 +00:00
|
|
|
void Ng_ClearSolutionData() { ; }
|
2014-10-16 15:14:35 +00:00
|
|
|
#endif
|
2014-01-25 21:17:16 +00:00
|
|
|
void Ng_SetSolutionData (Ng_SolutionData * soldata)
|
|
|
|
{
|
|
|
|
delete soldata->solclass;
|
|
|
|
}
|
|
|
|
void Ng_InitSolutionData (Ng_SolutionData * soldata) { ; }
|
2014-10-08 12:46:25 +00:00
|
|
|
*/
|