mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +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
|
||||
{
|
||||
#include "writeuser.hpp"
|
||||
|
||||
extern shared_ptr<Mesh> mesh;
|
||||
extern shared_ptr<NetgenGeometry> ng_geometry;
|
||||
|
||||
|
@ -8,9 +8,10 @@
|
||||
#include "nginterface_v2.hpp"
|
||||
// #include <visual.hpp>
|
||||
|
||||
#include "writeuser.hpp"
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#include "writeuser.hpp"
|
||||
extern shared_ptr<Mesh> mesh;
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,10 @@
|
||||
#include <csg.hpp>
|
||||
#include <meshing.hpp>
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#include "writeuser.hpp"
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
void ReadFile (Mesh & mesh,
|
||||
const string & hfilename)
|
||||
{
|
||||
|
@ -12,11 +12,11 @@
|
||||
#include <meshing.hpp>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "writeuser.hpp"
|
||||
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#include "writeuser.hpp"
|
||||
|
||||
extern MeshingParameters mparam;
|
||||
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
#include "writeuser.hpp"
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#include "writeuser.hpp"
|
||||
// Forward declarations (don't know, where to define them, sorry)
|
||||
int addComponent(string &strComp, string &strSitu, ofstream &out);
|
||||
|
||||
|
@ -10,10 +10,11 @@
|
||||
#include <geometry2d.hpp>
|
||||
#include <meshing.hpp>
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#include "writeuser.hpp"
|
||||
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
extern MeshingParameters mparam;
|
||||
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
/* Date: 10. Dec. 97 */
|
||||
/**************************************************************************/
|
||||
|
||||
namespace netgen {
|
||||
|
||||
DLL_HEADER extern
|
||||
void WriteFile (int typ,
|
||||
@ -162,5 +163,7 @@ extern bool DLL_HEADER WriteUserFormat (const string & format,
|
||||
const NetgenGeometry & geom,
|
||||
const string & filename);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "meshing.hpp"
|
||||
#include <csg.hpp>
|
||||
#include <geometry2d.hpp>
|
||||
#include <../interface/writeuser.hpp>
|
||||
|
||||
|
||||
using namespace netgen;
|
||||
@ -357,7 +358,22 @@ DLL_HEADER void ExportNetgenMeshing()
|
||||
}))
|
||||
// static_cast<void(Mesh::*)(const string & name)>(&Mesh::Load))
|
||||
.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)
|
||||
|
||||
.def("Elements3D",
|
||||
|
@ -29,11 +29,10 @@ namespace netgen
|
||||
#endif
|
||||
|
||||
|
||||
#include "../libsrc/interface/writeuser.hpp"
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
#include "../libsrc/interface/writeuser.hpp"
|
||||
//extern string ngdir;
|
||||
Flags parameters;
|
||||
}
|
||||
|
||||
|
@ -36,12 +36,12 @@ extern bool nodisplay;
|
||||
#include <nginterface.h>
|
||||
|
||||
|
||||
#include "../libsrc/interface/writeuser.hpp"
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
DLL_HEADER extern MeshingParameters mparam;
|
||||
DLL_HEADER extern void ImportSolution2(const char * filename);
|
||||
#include "../libsrc/interface/writeuser.hpp"
|
||||
#include "demoview.hpp"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user