mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-11 21:50:34 +05:00
export mesh from python
This commit is contained in:
parent
5f823a11f2
commit
60063f711f
@ -44,12 +44,10 @@ void RunParallel ( void * (*fun)(void *), void * in)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "writeuser.hpp"
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
#include "writeuser.hpp"
|
|
||||||
|
|
||||||
extern shared_ptr<Mesh> mesh;
|
extern shared_ptr<Mesh> mesh;
|
||||||
extern shared_ptr<NetgenGeometry> ng_geometry;
|
extern shared_ptr<NetgenGeometry> ng_geometry;
|
||||||
|
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
#include "nginterface_v2.hpp"
|
#include "nginterface_v2.hpp"
|
||||||
// #include <visual.hpp>
|
// #include <visual.hpp>
|
||||||
|
|
||||||
|
#include "writeuser.hpp"
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
#include "writeuser.hpp"
|
|
||||||
extern shared_ptr<Mesh> mesh;
|
extern shared_ptr<Mesh> mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
#include <csg.hpp>
|
#include <csg.hpp>
|
||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
|
|
||||||
namespace netgen
|
|
||||||
{
|
|
||||||
#include "writeuser.hpp"
|
#include "writeuser.hpp"
|
||||||
|
|
||||||
|
namespace netgen
|
||||||
|
{
|
||||||
void ReadFile (Mesh & mesh,
|
void ReadFile (Mesh & mesh,
|
||||||
const string & hfilename)
|
const string & hfilename)
|
||||||
{
|
{
|
||||||
|
@ -12,11 +12,11 @@
|
|||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include "writeuser.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
#include "writeuser.hpp"
|
|
||||||
|
|
||||||
extern MeshingParameters mparam;
|
extern MeshingParameters mparam;
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
#include "writeuser.hpp"
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
#include "writeuser.hpp"
|
|
||||||
// Forward declarations (don't know, where to define them, sorry)
|
// Forward declarations (don't know, where to define them, sorry)
|
||||||
int addComponent(string &strComp, string &strSitu, ofstream &out);
|
int addComponent(string &strComp, string &strSitu, ofstream &out);
|
||||||
|
|
||||||
|
@ -10,10 +10,11 @@
|
|||||||
#include <geometry2d.hpp>
|
#include <geometry2d.hpp>
|
||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
|
|
||||||
namespace netgen
|
|
||||||
{
|
|
||||||
#include "writeuser.hpp"
|
#include "writeuser.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace netgen
|
||||||
|
{
|
||||||
extern MeshingParameters mparam;
|
extern MeshingParameters mparam;
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
/* Date: 10. Dec. 97 */
|
/* Date: 10. Dec. 97 */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
|
namespace netgen {
|
||||||
|
|
||||||
DLL_HEADER extern
|
DLL_HEADER extern
|
||||||
void WriteFile (int typ,
|
void WriteFile (int typ,
|
||||||
@ -162,5 +163,7 @@ extern bool DLL_HEADER WriteUserFormat (const string & format,
|
|||||||
const NetgenGeometry & geom,
|
const NetgenGeometry & geom,
|
||||||
const string & filename);
|
const string & filename);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "meshing.hpp"
|
#include "meshing.hpp"
|
||||||
#include <csg.hpp>
|
#include <csg.hpp>
|
||||||
#include <geometry2d.hpp>
|
#include <geometry2d.hpp>
|
||||||
|
#include <../interface/writeuser.hpp>
|
||||||
|
|
||||||
|
|
||||||
using namespace netgen;
|
using namespace netgen;
|
||||||
@ -357,7 +358,22 @@ DLL_HEADER void ExportNetgenMeshing()
|
|||||||
}))
|
}))
|
||||||
// static_cast<void(Mesh::*)(const string & name)>(&Mesh::Load))
|
// static_cast<void(Mesh::*)(const string & name)>(&Mesh::Load))
|
||||||
.def("Save", static_cast<void(Mesh::*)(const string & name)const>(&Mesh::Save))
|
.def("Save", static_cast<void(Mesh::*)(const string & name)const>(&Mesh::Save))
|
||||||
|
.def("Export", FunctionPointer
|
||||||
|
([] (Mesh & self, string filename, string format)
|
||||||
|
{
|
||||||
|
if (WriteUserFormat (format, self, *self.GetGeometry(), filename))
|
||||||
|
{
|
||||||
|
string err = string ("nothing known about format")+format;
|
||||||
|
Array<const char*> names, extensions;
|
||||||
|
RegisterUserFormats (names, extensions);
|
||||||
|
err += "\navailable formats are:\n";
|
||||||
|
for (auto name : names)
|
||||||
|
err += string("'") + name + "'\n";
|
||||||
|
throw NgException (err);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
(bp::arg("self"), bp::arg("filename"), bp::arg("format")))
|
||||||
|
|
||||||
.add_property("dim", &Mesh::GetDimension, &Mesh::SetDimension)
|
.add_property("dim", &Mesh::GetDimension, &Mesh::SetDimension)
|
||||||
|
|
||||||
.def("Elements3D",
|
.def("Elements3D",
|
||||||
|
@ -29,11 +29,10 @@ namespace netgen
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include "../libsrc/interface/writeuser.hpp"
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
#include "../libsrc/interface/writeuser.hpp"
|
|
||||||
//extern string ngdir;
|
|
||||||
Flags parameters;
|
Flags parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,12 +36,12 @@ extern bool nodisplay;
|
|||||||
#include <nginterface.h>
|
#include <nginterface.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "../libsrc/interface/writeuser.hpp"
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
DLL_HEADER extern MeshingParameters mparam;
|
DLL_HEADER extern MeshingParameters mparam;
|
||||||
DLL_HEADER extern void ImportSolution2(const char * filename);
|
DLL_HEADER extern void ImportSolution2(const char * filename);
|
||||||
#include "../libsrc/interface/writeuser.hpp"
|
|
||||||
#include "demoview.hpp"
|
#include "demoview.hpp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user