use geometry from mesh on export user format

This commit is contained in:
Joachim Schöberl 2017-07-24 22:26:18 +02:00
parent 046f473619
commit 043e3403ba
5 changed files with 9 additions and 8 deletions

View File

@ -58,10 +58,11 @@ namespace netgen
bool WriteUserFormat (const string & format, bool WriteUserFormat (const string & format,
const Mesh & mesh, const Mesh & mesh,
const NetgenGeometry & hgeom,
const string & filename) const string & filename)
{ {
const CSGeometry & geom = *dynamic_cast<const CSGeometry*> (&hgeom); // cout << "write user &hgeom = " << &hgeom << endl;
// const CSGeometry & geom = *dynamic_cast<const CSGeometry*> (&hgeom);
const CSGeometry & geom = *dynamic_pointer_cast<CSGeometry> (mesh.GetGeometry());
PrintMessage (1, "Export mesh to file ", filename, PrintMessage (1, "Export mesh to file ", filename,
", format is ", format); ", format is ", format);

View File

@ -159,9 +159,9 @@ extern void DLL_HEADER RegisterUserFormats (Array<const char*> & names,
extern bool DLL_HEADER WriteUserFormat (const string & format, extern bool DLL_HEADER WriteUserFormat (const string & format,
const Mesh & mesh, const Mesh & mesh,
const NetgenGeometry & geom, // const NetgenGeometry & geom,
const string & filename); const string & filename);
} }

View File

@ -509,7 +509,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
.def("Export", .def("Export",
[] (Mesh & self, string filename, string format) [] (Mesh & self, string filename, string format)
{ {
if (WriteUserFormat (format, self, *self.GetGeometry(), filename)) if (WriteUserFormat (format, self, /* *self.GetGeometry(), */ filename))
{ {
string err = string ("nothing known about format")+format; string err = string ("nothing known about format")+format;
Array<const char*> names, extensions; Array<const char*> names, extensions;

View File

@ -362,7 +362,7 @@ namespace netgen
PrintMessage (1, "Export mesh to file ", filename, ".... Please Wait!"); PrintMessage (1, "Export mesh to file ", filename, ".... Please Wait!");
// CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry); // CSGeometry * geometry = dynamic_cast<CSGeometry*> (ng_geometry);
if (WriteUserFormat (filetype, *mesh, *ng_geometry, filename)) if (WriteUserFormat (filetype, *mesh, /* *ng_geometry, */ filename))
{ {
ostringstream ost; ostringstream ost;
ost << "Sorry, nothing known about file format " << filetype << endl; ost << "Sorry, nothing known about file format " << filetype << endl;

View File

@ -1250,6 +1250,6 @@ void Ng_InitSolutionData (Ng_SolutionData * soldata) { ; }
#include <../interface/writeuser.hpp> #include <../interface/writeuser.hpp>
void MyDummyToForceLinkingLibInterface(Mesh &mesh, NetgenGeometry &geom) void MyDummyToForceLinkingLibInterface(Mesh &mesh, NetgenGeometry &geom)
{ {
netgen::WriteUserFormat("", mesh, geom, ""); netgen::WriteUserFormat("", mesh, /* geom, */ "");
} }