meshing from surface mesh bug fix

This commit is contained in:
Joachim Schoeberl 2010-03-23 12:52:07 +00:00
parent 623619a13c
commit 6cdaec8ece
6 changed files with 70 additions and 8 deletions

View File

@ -146,7 +146,7 @@ namespace netgen
public:
CSGeometry ();
CSGeometry (const string & afilename);
~CSGeometry ();
virtual ~CSGeometry ();
void Clean ();

View File

@ -25,4 +25,4 @@ libmesh_la_SOURCES = adfront2.cpp adfront3.cpp bisect.cpp boundarylayer.cpp \
ruler2.cpp ruler3.cpp secondorder.cpp smoothing2.5.cpp \
smoothing2.cpp smoothing3.cpp specials.cpp tetrarls.cpp \
topology.cpp triarls.cpp validate.cpp zrefine.cpp bcfunctions.cpp \
parallelmesh.cpp paralleltop.cpp paralleltop.hpp
parallelmesh.cpp paralleltop.cpp paralleltop.hpp basegeom.cpp

View File

@ -0,0 +1,51 @@
#include <mystdlib.h>
#include "meshing.hpp"
namespace netgen
{
int NetgenGeometry :: GenerateMesh (Mesh*& mesh,
int perfstepsstart, int perfstepsend, char* optstring)
{
if (!mesh) return 1;
if (perfstepsstart <= MESHCONST_MESHVOLUME)
{
multithread.task = "Volume meshing";
MESHING3_RESULT res =
MeshVolume (mparam, *mesh);
if (res != MESHING3_OK) return 1;
if (multithread.terminate) return 0;
RemoveIllegalElements (*mesh);
if (multithread.terminate) return 0;
MeshQuality3d (*mesh);
}
if (multithread.terminate || perfstepsend <= MESHCONST_MESHVOLUME)
return 0;
if (perfstepsstart <= MESHCONST_OPTVOLUME)
{
multithread.task = "Volume optimization";
OptimizeVolume (mparam, *mesh);
if (multithread.terminate) return 0;
}
return 0;
}
const Refinement & NetgenGeometry :: GetRefinement () const
{
return *new Refinement;;
}
}

View File

@ -14,10 +14,15 @@ public:
virtual ~NetgenGeometry () { ; }
virtual int GenerateMesh (Mesh*& mesh,
int perfstepsstart, int perfstepsend, char* optstring) = 0;
int perfstepsstart, int perfstepsend, char* optstring);
virtual const Refinement & GetRefinement () const = 0;
virtual const Refinement & GetRefinement () const;
};
#endif

View File

@ -183,7 +183,7 @@ namespace netgen
OCCGeometry * occgeometry = NULL;
#endif
NetgenGeometry * ng_geometry;
NetgenGeometry * ng_geometry = new NetgenGeometry;
Tcl_Interp * tcl_interp;
@ -2149,7 +2149,12 @@ namespace netgen
else
{
int res = ng_geometry -> GenerateMesh (mesh.Ptr(), perfstepsstart, perfstepsend, optstringcsg);
if (res != MESHING3_OK) return 0;
if (res != MESHING3_OK)
{
multithread.task = savetask;
multithread.running = 0;
return 0;
}
}
if (mparam.autozrefine && ( (NetgenGeometry*)geometry.Ptr() == ng_geometry))

View File

@ -1,3 +1,4 @@
xxx
8
0 0 0
1 0 0