mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
Merge branch 'master' into remove_tix2
This commit is contained in:
commit
9eee23693e
@ -60,6 +60,7 @@ namespace netgen
|
||||
T operator*() const { return ar[ind]; }
|
||||
T & operator*() { return ar[ind]; }
|
||||
bool operator != (ArrayIterator d2) { return ind != d2.ind; }
|
||||
bool operator == (ArrayIterator d2) { return ind == d2.ind; }
|
||||
};
|
||||
|
||||
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef WIN32
|
||||
#ifndef AVX_OPERATORS_DEFINED
|
||||
#define AVX_OPERATORS_DEFINED
|
||||
inline __m128d operator- (__m128d a) { return _mm_xor_pd(a, _mm_set1_pd(-0.0)); }
|
||||
inline __m128d operator+ (__m128d a, __m128d b) { return _mm_add_pd(a,b); }
|
||||
inline __m128d operator- (__m128d a, __m128d b) { return _mm_sub_pd(a,b); }
|
||||
@ -36,6 +38,7 @@ inline __m256d operator-= (__m256d &a, __m256d b) { return a = a-b; }
|
||||
inline __m256d operator*= (__m256d &a, __m256d b) { return a = a*b; }
|
||||
inline __m256d operator/= (__m256d &a, __m256d b) { return a = a/b; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -7,8 +7,6 @@
|
||||
#include <csg.hpp>
|
||||
#include <geometry2d.hpp>
|
||||
#include <../interface/writeuser.hpp>
|
||||
#include <nginterface.h>
|
||||
#include <nginterface_v2.hpp>
|
||||
|
||||
|
||||
using namespace netgen;
|
||||
@ -22,6 +20,7 @@ namespace netgen
|
||||
template <typename T, int BASE = 0, typename TIND = int>
|
||||
void ExportArray (py::module &m)
|
||||
{
|
||||
using TA = Array<T,BASE,TIND>;
|
||||
string name = string("Array_") + typeid(T).name();
|
||||
py::class_<Array<T,BASE,TIND>>(m, name.c_str())
|
||||
.def ("__len__", [] ( Array<T,BASE,TIND> &self ) { return self.Size(); } )
|
||||
@ -33,6 +32,9 @@ void ExportArray (py::module &m)
|
||||
return self[i];
|
||||
}),
|
||||
py::return_value_policy::reference)
|
||||
.def("__iter__", [] ( TA & self) {
|
||||
return py::make_iterator (self.begin(),self.end());
|
||||
}, py::keep_alive<0,1>()) // keep array alive while iterator is used
|
||||
|
||||
;
|
||||
}
|
||||
@ -300,10 +302,6 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
|
||||
py::implicitly_convertible< int, PointIndex>();
|
||||
|
||||
py::class_<Ngx_Mesh>(m, "Ngx_Mesh")
|
||||
.def(py::init<shared_ptr<Mesh>>())
|
||||
.def_property_readonly("ngmesh", &Ngx_Mesh::GetMesh)
|
||||
;
|
||||
py::class_<Mesh,shared_ptr<Mesh>>(m, "Mesh")
|
||||
// .def(py::init<>("create empty mesh"))
|
||||
|
||||
@ -564,7 +562,6 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
))
|
||||
|
||||
;
|
||||
py::implicitly_convertible< shared_ptr<Mesh>, Ngx_Mesh >();
|
||||
|
||||
|
||||
typedef MeshingParameters MP;
|
||||
|
Loading…
Reference in New Issue
Block a user