yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #04326
[Branch ~yade-dev/yade/trunk] Rev 2210: 1. Make yade compile with eigen by default. Use 'wm3' feature to compile with Wm3 instead (beware...
------------------------------------------------------------
revno: 2210
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Sat 2010-05-08 16:53:54 +0200
message:
1. Make yade compile with eigen by default. Use 'wm3' feature to compile with Wm3 instead (beware, you still need eigen installed)
2. Disable the possibility of ocmpiling with external wm3.
3. Add Identity, Ones, Zero, Unit{X,Y,Z} to old wm3 wrapper so that they can be used in python.
renamed:
py/miniWm3Wrap/ => py/mathWrap/
py/miniWm3Wrap/manualWrap.cpp => py/mathWrap/miniEigen.cpp
modified:
SConstruct
core/SConscript
debian/rules
lib/SConscript
lib/base/Math.cpp
lib/base/Math.hpp
lib/opengl/GLTextLabel.hpp
lib/opengl/OpenGLWrapper.hpp
pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.cpp
pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.hpp
pkg/dem/Engine/PartialEngine/KinemCTDEngine.hpp
pkg/dem/PreProcessor/CohesiveTriaxialTest.hpp
py/SConscript
py/mathWrap/miniWm3Wrap.cpp
py/pack/pack.py
py/utils.py
py/yadeWrapper/customConverters.cpp
py/ymport.py
py/mathWrap/miniEigen.cpp
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'SConstruct'
--- SConstruct 2010-05-04 21:57:09 +0000
+++ SConstruct 2010-05-08 14:53:54 +0000
@@ -139,7 +139,7 @@
BoolVariable('optimize','Turn on heavy optimizations',defOptions['optimize']),
ListVariable('exclude','Yade components that will not be built','none',names=['gui','extra','common','dem','lattice','snow']),
EnumVariable('PGO','Whether to "gen"erate or "use" Profile-Guided Optimization','',['','gen','use'],{'no':'','0':'','false':''},1),
- ListVariable('features','Optional features that are turned on','log4cxx,opengl,gts,openmp,vtk',names=['opengl','log4cxx','cgal','openmp','gts','vtk','python','eigen','nowm3','gl2ps','boost-serialization','never_use_this_one']),
+ ListVariable('features','Optional features that are turned on','log4cxx,opengl,gts,openmp,vtk',names=['opengl','log4cxx','cgal','openmp','gts','vtk','python','wm3','gl2ps','boost-serialization','never_use_this_one']),
('jobs','Number of jobs to run at the same time (same as -j, but saved)',2,None,int),
#('extraModules', 'Extra directories with their own SConscript files (must be in-tree) (whitespace separated)',None,None,Split),
('buildPrefix','Where to create build-[version][variant] directory for intermediary files','..'),
@@ -158,7 +158,6 @@
('SHCCFLAGS','Additional compiler flags for linking (for plugins).',None,None,Split),
BoolVariable('QUAD_PRECISION','typedef Real as long double (=quad)',0),
BoolVariable('brief',"Don't show commands being run, only what files are being compiled/linked/installed",True),
- BoolVariable('useMiniWm3','use local miniWm3 library instead of Wm3Foundation',1),
#BoolVariable('useLocalQGLViewer','use in-tree QGLViewer library instead of the one installed in system',1),
)
opts.Update(env)
@@ -217,7 +216,7 @@
# these MUST be first so that builddir's headers are read before any locally installed ones
buildInc='$buildDir/include/yade-$version'
env.Append(CPPPATH=[buildInc])
-if env['useMiniWm3']: env.Append(CPPPATH=[buildInc+'/yade/lib-miniWm3'])
+if 'wm3' in env['features']: env.Append(CPPPATH=[buildInc+'/yade/lib-miniWm3'])
#if env['useLocalQGLViewer']: env.Append(CPPPATH=[buildInc+'/yade/lib-QGLViewer'])
env.SConsignFile(buildDir+'/scons-signatures')
@@ -341,13 +340,11 @@
env['haveForeach']=conf.CheckCXXHeader('boost/foreach.hpp','<>')
if not env['haveForeach']: print "(OK, local version will be used instead)"
ok&=conf.CheckLibWithHeader('sqlite3','sqlite3.h','c++','sqlite3_close(0L);',autoadd=1)
- if not env['useMiniWm3']:
- conf.env.Append(CPPPATH='/usr/include/wm3') # packaged version
- ok&=conf.CheckLibWithHeader('Wm3Foundation','Wm3Math.h','c++','Wm3::Math<double>::PI;',autoadd=1)
ok&=(conf.CheckPython()
and conf.CheckIPython() # not needed now: and conf.CheckScientificPython()
and CheckLib_maybeMT(conf,'boost_python','boost/python.hpp','c++','boost::python::scope();')
and conf.CheckCXXHeader(['Python.h','numpy/ndarrayobject.h'],'<>'))
+ ok&=conf.CheckCXXHeader('Eigen/Core')
# for installable stript's shebang ( http://en.wikipedia.org/wiki/Shebang_(Unix) )
env['pyExecutable']=sys.executable
@@ -385,19 +382,8 @@
ok=conf.CheckLibWithHeader('CGAL','CGAL/Exact_predicates_inexact_constructions_kernel.h','c++','CGAL::Exact_predicates_inexact_constructions_kernel::Point_3();')
env.Append(CXXFLAGS='-frounding-math') # required by cgal, otherwise we get assertion failure at startup
if not ok: featureNotOK('cgal')
- if 'eigen' in env['features']:
- ok=conf.CheckCXXHeader('Eigen/Core')
- ok=conf.CheckCXXHeader('Eigen/Array')
- ok=conf.CheckCXXHeader('Eigen/Geometry')
- ok=conf.CheckCXXHeader('Eigen/Cholesky')
- ok=conf.CheckCXXHeader('Eigen/LU')
- if not ok: featureNotOK('eigen',note="You might have to add eigen header directory (e.g. /usr/include/eigen2) to CPPPATH.")
- if 'nowm3' in env['features'] and 'eigen' not in env['features']:
- featureNotOK("You selected the 'nowm3' feature; you MUST also select the 'eigen' feature in such case.")
- # moved to lib/base/Math.hpp instead
- #if 'nowm3' in env['features']: env.Append(CPPDEFINES=['EIGEN_DONT_VECTORIZE','EIGEN_DONT_ALIGN','EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT'])
-
- if env['useMiniWm3'] and not 'nowm3' in env['features']: env.Append(LIBS='miniWm3',CPPDEFINES=['MINIWM3'])
+ if 'wm3' in env['features']: env.Append(LIBS='miniWm3',CPPDEFINES=['MINIWM3'])
+ else: env.Append(LIBS='yade-support')
env.Append(CPPDEFINES=['YADE_'+f.upper().replace('-','_') for f in env['features']])
=== modified file 'core/SConscript'
--- core/SConscript 2010-04-03 16:40:33 +0000
+++ core/SConscript 2010-05-08 14:53:54 +0000
@@ -58,7 +58,7 @@
'rt', # realtime lib, for clock_gettime
]+
(['$QGLVIEWER_LIB','yade-opengl'] if 'YADE_OPENGL' in env['CPPDEFINES'] else [])
- +(['miniWm3'] if 'nowm3' not in env['features'] else [])
+ +(['miniWm3'] if 'wm3' in env['features'] else [])
,
)
])
=== modified file 'debian/rules'
--- debian/rules 2010-05-04 21:57:09 +0000
+++ debian/rules 2010-05-08 14:53:54 +0000
@@ -46,8 +46,6 @@
# scons clean
## remove builddirs and installation directories
rm -rf debian/build-* `find debian/ -name 'yade-*' -type d`
- ## keep this, it takes very little space and annoyingly wipes local configs
- for f in scons.profile*; do mv $$f $$f~old; done
dh_clean
install: build
@@ -60,11 +58,11 @@
### (a) use fakeroot-tcp instead of fakeroot
### (b) use just 1 job
#debug build
- NO_SCONS_GET_RECENT= scons buildPrefix=debian runtimePREFIX=/usr version=${VERSION} brief=0 chunkSize=4 linkStrategy=monolithic features=vtk,gts,log4cxx,opengl,openmp,eigen exclude=snow PREFIX=debian/yade${_VERSION}-dbg/usr variant=-dbg optimize=0 march= debug=1 CPPPATH=/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4 jobs=1
+ NO_SCONS_GET_RECENT= scons profile=deb buildPrefix=debian runtimePREFIX=/usr version=${VERSION} brief=0 chunkSize=4 linkStrategy=monolithic features=vtk,gts,log4cxx,opengl,openmp exclude=snow PREFIX=debian/yade${_VERSION}-dbg/usr variant=-dbg optimize=0 march= debug=1 CPPPATH=/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/eigen2 jobs=1
#optimized build
- NO_SCONS_GET_RECENT= scons PREFIX=debian/yade${_VERSION}/usr variant='' optimize=1 debug=0
+ NO_SCONS_GET_RECENT= scons profile=deb PREFIX=debian/yade${_VERSION}/usr variant='' optimize=1 debug=0
#install platform-independent files (docs, scripts, examples)
- NO_SCONS_GET_RECENT= scons PREFIX=debian/yade${_VERSION}/usr debian/yade${_VERSION}/usr/share/doc/yade${_VERSION}-doc
+ NO_SCONS_GET_RECENT= scons profile=deb PREFIX=debian/yade${_VERSION}/usr debian/yade${_VERSION}/usr/share/doc/yade${_VERSION}-doc
check: install
dh_testdir
=== modified file 'lib/SConscript'
--- lib/SConscript 2010-05-04 13:56:05 +0000
+++ lib/SConscript 2010-05-08 14:53:54 +0000
@@ -62,14 +62,14 @@
]
# compile TesselationWrapper only if cgal is enabled
+(Split('triangulation/KinematicLocalisationAnalyser.cpp triangulation/Operations.cpp triangulation/RegularTriangulation.cpp triangulation/Timer.cpp triangulation/basicVTKwritter.cpp triangulation/FlowBoundingSphere.cpp triangulation/Deformation.cpp triangulation/Empilement.cpp triangulation/stdafx.cpp triangulation/Tenseur3.cpp triangulation/Tesselation.cpp triangulation/TriaxialState.cpp') if 'cgal' in env['features'] else [])),
- ],LIBS=['dl']+[],CXXFLAGS=env['CXXFLAGS']+['-fPIC']
+ ],LIBS=['dl','m']+[],CXXFLAGS=env['CXXFLAGS']+['-fPIC']
)
#)
#######################
###### 3rd party libs
#######################
-if not 'nowm3' in env['features']:
+if 'wm3' in env['features']:
yadeStaticOrSharedLib('miniWm3',
env.Combine('miniWm3.cpp',['miniWm3/Wm3Math.cpp','miniWm3/Wm3Matrix3.cpp','miniWm3/Wm3Quaternion.cpp','miniWm3/Wm3Vector3.cpp','miniWm3/Wm3Vector2.cpp','miniWm3/Wm3Memory.cpp','miniWm3/Wm3String.cpp','miniWm3/Wm3System.cpp']),
# miniWm3 cannot link with itself, filter it out.
=== modified file 'lib/base/Math.cpp'
--- lib/base/Math.cpp 2010-05-04 15:52:56 +0000
+++ lib/base/Math.cpp 2010-05-08 14:53:54 +0000
@@ -1,5 +1,5 @@
#include<yade/lib-base/Math.hpp>
-#if defined(YADE_NOWM3) and defined(YADE_EIGEN)
+#ifndef YADE_WM3
template<> const Real Math<Real>::EPSILON = DBL_EPSILON;
template<> const Real Math<Real>::ZERO_TOLERANCE = 1e-20;
template<> const Real Math<Real>::MAX_REAL = DBL_MAX;
=== modified file 'lib/base/Math.hpp'
--- lib/base/Math.hpp 2010-05-04 21:57:09 +0000
+++ lib/base/Math.hpp 2010-05-08 14:53:54 +0000
@@ -22,7 +22,7 @@
/*
* use Eigen http://eigen.tuxfamily.org
*/
-#if defined(YADE_EIGEN) and defined(YADE_NOWM3)
+#ifndef YADE_WM3
// different macros for different versions of eigen:
// http://bitbucket.org/eigen/eigen/issue/96/eigen_dont_align-doesnt-exist-in-205-but-appears-in-web
#define EIGEN_DONT_VECTORIZE
@@ -111,6 +111,8 @@
};
typedef Math<Real> Mathr;
#else
+ // wm3 fallback
+
#include<Wm3Vector2.h>
#include<Wm3Vector3.h>
#include<Wm3Matrix3.h>
=== modified file 'lib/opengl/GLTextLabel.hpp'
--- lib/opengl/GLTextLabel.hpp 2010-02-09 20:22:04 +0000
+++ lib/opengl/GLTextLabel.hpp 2010-05-08 14:53:54 +0000
@@ -9,7 +9,6 @@
#pragma once
#include "GLWindow.hpp"
-#include <Wm3Vector3.h>
#include<yade/lib-base/Math.hpp>
class GLTextLabel : public GLWindow
=== modified file 'lib/opengl/OpenGLWrapper.hpp'
--- lib/opengl/OpenGLWrapper.hpp 2010-05-04 13:56:05 +0000
+++ lib/opengl/OpenGLWrapper.hpp 2010-05-08 14:53:54 +0000
@@ -12,7 +12,6 @@
#error "This build doesn't support openGL. Therefore, this header must not be used."
#endif
-#include<Wm3Vector3.h>
#include<yade/lib-base/Math.hpp>
#include<GL/gl.h>
=== modified file 'pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.cpp'
--- pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.cpp 2010-05-03 12:17:44 +0000
+++ pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.cpp 2010-05-08 14:53:54 +0000
@@ -11,7 +11,7 @@
#include<yade/core/State.hpp>
#include<yade/pkg-common/Box.hpp>
#include<yade/core/Scene.hpp>
-#include <yade/lib-miniWm3/Wm3Math.h>
+#include<yade/lib-base/Math.hpp>
YADE_PLUGIN((Disp2DPropLoadEngine));
=== modified file 'pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.hpp'
--- pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.hpp 2010-04-13 21:09:57 +0000
+++ pkg/dem/Engine/PartialEngine/Disp2DPropLoadEngine.hpp 2010-05-08 14:53:54 +0000
@@ -11,8 +11,6 @@
#include<yade/core/Omega.hpp>
#include<yade/pkg-common/BoundaryController.hpp>
#include<yade/core/Body.hpp>
-#include <Wm3Vector3.h>
-// #include<yade/lib-base/yadeWm3.hpp>
=== modified file 'pkg/dem/Engine/PartialEngine/KinemCTDEngine.hpp'
--- pkg/dem/Engine/PartialEngine/KinemCTDEngine.hpp 2010-04-13 21:09:57 +0000
+++ pkg/dem/Engine/PartialEngine/KinemCTDEngine.hpp 2010-05-08 14:53:54 +0000
@@ -10,7 +10,6 @@
#include<yade/pkg-common/BoundaryController.hpp>
#include<yade/core/Body.hpp>
-#include<Wm3Vector3.h>
class KinemCTDEngine : public BoundaryController
=== modified file 'pkg/dem/PreProcessor/CohesiveTriaxialTest.hpp'
--- pkg/dem/PreProcessor/CohesiveTriaxialTest.hpp 2010-04-25 15:46:26 +0000
+++ pkg/dem/PreProcessor/CohesiveTriaxialTest.hpp 2010-05-08 14:53:54 +0000
@@ -9,7 +9,6 @@
#pragma once
#include<yade/core/FileGenerator.hpp>
-#include <Wm3Vector3.h>
#include<yade/lib-base/Math.hpp>
//class ForceRecorder;
=== modified file 'py/SConscript'
--- py/SConscript 2010-05-05 21:36:25 +0000
+++ py/SConscript 2010-05-08 14:53:54 +0000
@@ -49,7 +49,7 @@
# 3rd party modules:
# ==================
env.Install('$PREFIX/lib/yade$SUFFIX/py',[
- env.SharedLibrary('miniEigen',['miniWm3Wrap/manualWrap.cpp' if 'nowm3' in env['features'] else 'miniWm3Wrap/miniWm3Wrap.cpp'],SHLIBPREFIX='',CPPPATH=env['CPPPATH']+['../lib/'],LIBS=env['LIBS']+['core']),
+ env.SharedLibrary('miniEigen',['mathWrap/miniEigen.cpp' if 'wm3' not in env['features'] else 'mathWrap/miniWm3Wrap.cpp'],SHLIBPREFIX='',CPPPATH=env['CPPPATH']+['../lib/'],LIBS=env['LIBS']+['core']),
])
if 'YADE_GTS' in env['CPPDEFINES']:
=== renamed directory 'py/miniWm3Wrap' => 'py/mathWrap'
=== renamed file 'py/miniWm3Wrap/manualWrap.cpp' => 'py/mathWrap/miniEigen.cpp'
--- py/miniWm3Wrap/manualWrap.cpp 2010-05-06 16:09:26 +0000
+++ py/mathWrap/miniEigen.cpp 2010-05-08 14:53:54 +0000
@@ -1,6 +1,7 @@
// 2009 © Václav Šmilauer <eudoxos@xxxxxxxx>
#include<boost/python.hpp>
#include<boost/lexical_cast.hpp>
+#include<boost/algorithm/string/trim.hpp>
#include<string>
#include<stdexcept>
#include<sstream>
@@ -115,10 +116,11 @@
#define WM3_COMPAT
#ifdef WM3_COMPAT
- #define WM3_OLD_METH0(klass,old,neww) static klass klass##_##old(){ std::cerr<<"WARN: "<<#klass<<"."<<#old<<" is deprecated, use "<<#klass<<"."<<#neww<<" instead"<<std::endl; return klass().neww(); }
- #define WM3_OLD_METH1(klass,old,neww,ret) static ret klass##_##old(klass& self){ std::cerr<<"WARN: "<<#klass<<"."<<#old<<" is deprecated, use "<<#klass<<"."<<#neww<<" instead"<<std::endl; if(typeid(ret)!=typeid(void)) return self.neww(); return ret(); }
- #define WM3_OLD_METH2(klass,klass2,old,neww,ret) static ret klass##_##old(klass& self,const klass2& arg){ std::cerr<<"WARN: "<<#klass<<"."<<#old<<" is deprecated, use "<<#klass<<"."<<#neww<<" instead"<<std::endl; if(typeid(ret)!=typeid(void)) return self.neww(arg); return ret(); }
- #define WM3_OLD_METH3(klass,klass2,klass3,old,neww,ret) static ret klass##_##old(klass& self,const klass2& arg1, const klass3& arg2){ std::cerr<<"WARN: "<<#klass<<"."<<#old<<" is deprecated, use "<<#klass<<"."<<#neww<<" instead"<<std::endl; if(typeid(ret)!=typeid(void)) return self.neww(arg1,arg2); return ret(); }
+ #define _PYCLASS(klass) boost::algorithm::trim_right_copy_if(std::string(klass),boost::algorithm::is_any_of("r"))
+ #define WM3_OLD_METH0(klass,old,neww) static klass klass##_##old(){ std::cerr<<"WARN: "<<_PYCLASS(#klass)<<"."<<#old<<" is deprecated, use "<<_PYCLASS(#klass)<<"."<<#neww<<" instead"<<std::endl; return klass().neww(); }
+ #define WM3_OLD_METH1(klass,old,neww,ret) static ret klass##_##old(klass& self){ std::cerr<<"WARN: "<<_PYCLASS(#klass)<<"."<<#old<<" is deprecated, use "<<_PYCLASS(#klass)<<"."<<#neww<<" instead"<<std::endl; if(typeid(ret)!=typeid(void)) return self.neww(); return ret(); }
+ #define WM3_OLD_METH2(klass,klass2,old,neww,ret) static ret klass##_##old(klass& self,const klass2& arg){ std::cerr<<"WARN: "<<_PYCLASS(#klass)<<"."<<#old<<" is deprecated, use "<<_PYCLASS(#klass)<<"."<<#neww<<" instead"<<std::endl; if(typeid(ret)!=typeid(void)) return self.neww(arg); return ret(); }
+ #define WM3_OLD_METH3(klass,klass2,klass3,old,neww,ret) static ret klass##_##old(klass& self,const klass2& arg1, const klass3& arg2){ std::cerr<<"WARN: "<<_PYCLASS(#klass)<<"."<<#old<<" is deprecated, use "<<_PYCLASS(#klass)<<"."<<#neww<<" instead"<<std::endl; if(typeid(ret)!=typeid(void)) return self.neww(arg1,arg2); return ret(); }
WM3_OLD_METH0(Matrix3r,IDENTITY,Identity)
WM3_OLD_METH0(Matrix3r,ZERO,Zero)
WM3_OLD_METH1(Matrix3r,Determinant,determinant,Real)
=== modified file 'py/mathWrap/miniWm3Wrap.cpp'
--- py/miniWm3Wrap/miniWm3Wrap.cpp 2010-05-05 21:36:25 +0000
+++ py/mathWrap/miniWm3Wrap.cpp 2010-05-08 14:53:54 +0000
@@ -18,6 +18,9 @@
}
BOOST_PYTHON_MODULE(miniEigen){
+
+ std::cerr<<"WARN: Using deprecated Wm3-based math, soon to be removed. Recompile without the 'wm3' feature."<<std::endl;
+
{ //Matrix3< double >
typedef bp::class_< Matrix3< double > > Matrix3_exposer_t;
Matrix3_exposer_t Matrix3_exposer = Matrix3_exposer_t( "Matrix3", bp::init< bp::optional< bool > >(( bp::arg("bZero")=(bool)(true) )) );
@@ -246,6 +249,7 @@
Matrix3_exposer.def( bp::other< Real >() * bp::self );
Matrix3_exposer.def("__len__",&::Matrix3_len).staticmethod("__len__") .def("__setitem__",&::Matrix3_set_item) .def("__getitem__",&::Matrix3_get_item) .def("__str__",&::Matrix3_str) .def("__repr__",&::Matrix3_str) /* extras for matrices */ .def("__setitem__",&::Matrix3_set_item_linear).def("__getitem__",&::Matrix3_get_item_linear);
Matrix3_exposer.add_property("ZERO",::Matrix3r_ZERO).add_property("IDENTITY",::Matrix3r_IDENTITY);
+ Matrix3_exposer.add_property("Zero",::Matrix3r_ZERO).add_property("Identity",::Matrix3r_IDENTITY);
}
{ //Quaternion< double >
@@ -474,6 +478,7 @@
Quaternion_exposer.def( bp::self_ns::str( bp::self ) );
Quaternion_exposer.def("__len__",&::Quaternion_len).staticmethod("__len__").def("__setitem__",&::Quaternion_set_item).def("__getitem__",&::Quaternion_get_item).def("__str__",&::Quaternion_str).def("__repr__",&::Quaternion_str);
Quaternion_exposer.add_property("IDENTITY",::Quaternionr_IDENTITY);
+ Quaternion_exposer.add_property("Identity",::Quaternionr_IDENTITY);
}
{ //Vector2< double >
@@ -575,6 +580,7 @@
Vector2_exposer.def( bp::other< Real >() * bp::self );
Vector2_exposer.def("__len__",&::Vector2_len) .staticmethod("__len__").def("__setitem__",&::Vector2_set_item) .def("__getitem__",&::Vector2_get_item) .def("__str__",&::Vector2_str) .def("__repr__",&::Vector2_str);
Vector2_exposer.add_property("ZERO",::Vector2r_ZERO).add_property("UNIT_X",::Vector2r_UNIT_X).add_property("UNIT_Y",::Vector2r_UNIT_Y).add_property("ONE",::Vector2r_ONE);
+ Vector2_exposer.add_property("Zero",::Vector2r_ZERO).add_property("UnitX",::Vector2r_UNIT_X).add_property("UnitY",::Vector2r_UNIT_Y).add_property("Ones",::Vector2r_ONE);
}
custom_Vector3r_from_tuple();
@@ -700,5 +706,6 @@
Vector3_exposer.def( bp::self_ns::str( bp::self ) );
Vector3_exposer.def("__len__",&::Vector3_len) .staticmethod("__len__").def("__setitem__",&::Vector3_set_item) .def("__getitem__",&::Vector3_get_item) .def("__str__",&::Vector3_str) .def("__repr__",&::Vector3_str);
Vector3_exposer.add_property("ZERO",::Vector3r_ZERO).add_property("UNIT_X",::Vector3r_UNIT_X).add_property("UNIT_Y",::Vector3r_UNIT_Y).add_property("UNIT_Z",::Vector3r_UNIT_Z).add_property("ONE",::Vector3r_ONE);
+ Vector3_exposer.add_property("Zero",::Vector3r_ZERO).add_property("UnitX",::Vector3r_UNIT_X).add_property("UnitY",::Vector3r_UNIT_Y).add_property("UnitZ",::Vector3r_UNIT_Z).add_property("Ones",::Vector3r_ONE);
}
}
=== modified file 'py/pack/pack.py'
--- py/pack/pack.py 2010-05-05 21:36:25 +0000
+++ py/pack/pack.py 2010-05-08 14:53:54 +0000
@@ -162,7 +162,7 @@
pts=[Vector3(v.x,v.y,v.z) for v in surf.vertices()]
return cloudBestFitOBB(tuple(pts))
-def revolutionSurfaceMeridians(sects,angles,origin=Vector3().ZERO,orientation=Quaternion().IDENTITY):
+def revolutionSurfaceMeridians(sects,angles,origin=Vector3().ZERO,orientation=Quaternion().Identity):
"""Revolution surface given sequences of 2d points and sequence of corresponding angles,
returning sequences of 3d points representing meridian sections of the revolution surface.
The 2d sections are turned around z-axis, but they can be transformed
@@ -315,7 +315,7 @@
#print cloudPorosity,beta,gamma,N100,x1,y1,z1,O.cell.refSize
#print x1,y1,z1,radius,rRelFuzz
O.materials.append(FrictMat(young=3e10,density=2400))
- num=sp.makeCloud(Vector3().ZERO,O.cell.refSize,radius,rRelFuzz,spheresInCell,True)
+ num=sp.makeCloud(Vector3().Zero,O.cell.refSize,radius,rRelFuzz,spheresInCell,True)
O.engines=[ForceResetter(),BoundDispatcher([Bo1_Sphere_Aabb()]),InsertionSortCollider(nBins=5,sweepLength=.05*radius),InteractionDispatchers([Ig2_Sphere_Sphere_Dem3DofGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_Dem3DofGeom_FrictPhys_Basic()]),PeriIsoCompressor(charLen=2*radius,stresses=[-100e9,-1e8],maxUnbalanced=1e-2,doneHook='O.pause();',globalUpdateInt=5,keepProportions=True),NewtonIntegrator(damping=.6)]
O.materials.append(FrictMat(young=30e9,frictionAngle=.5,poisson=.3,density=1e3))
for s in sp: O.bodies.append(utils.sphere(s[0],s[1]))
=== modified file 'py/utils.py'
--- py/utils.py 2010-05-07 10:47:16 +0000
+++ py/utils.py 2010-05-08 14:53:54 +0000
@@ -247,7 +247,7 @@
b.dynamic=dynamic
return b
-def facetBox(center,extents,orientation=Quaternion().IDENTITY,wallMask=63,**kw):
+def facetBox(center,extents,orientation=Quaternion().Identity,wallMask=63,**kw):
"""
Create arbitrarily-aligned box composed of facets, with given center, extents and orientation.
If any of the box dimensions is zero, corresponding facets will not be created. The facets are oriented outwards from the box.
=== modified file 'py/yadeWrapper/customConverters.cpp'
--- py/yadeWrapper/customConverters.cpp 2010-05-05 21:36:25 +0000
+++ py/yadeWrapper/customConverters.cpp 2010-05-08 14:53:54 +0000
@@ -41,7 +41,7 @@
using namespace boost::python;
// will be removed later
-#ifndef YADE_NOWM3
+#ifdef YADE_WM3
struct custom_Vector3r_from_seq{
custom_Vector3r_from_seq(){
converter::registry::push_back(&convertible,&construct,type_id<Vector3r>());
@@ -142,7 +142,7 @@
// class_<std::vector<int> >("vecInt").def(indexing::container_suite<std::vector<int> >());
custom_Se3r_from_seq(); to_python_converter<Se3r,custom_se3_to_tuple>();
// Vector3i to python (not implemented the other way around yet)
-#ifndef YADE_NOWM3
+#ifdef YADE_WM3
custom_Vector3r_from_seq(); // Vector3r is wrapped, it is returned as a Vector3 instance; no to-python converter needed
custom_vector3i_to_seq(); to_python_converter<Vector3i,custom_vector3i_to_seq>();
#endif
=== modified file 'py/ymport.py'
--- py/ymport.py 2010-05-05 21:36:25 +0000
+++ py/ymport.py 2010-05-08 14:53:54 +0000
@@ -65,7 +65,7 @@
surf.translate(shift)
yade.pack.gtsSurface2Facets(surf,**kw)
-def gmsh(meshfile="file.mesh",shift=[0.0,0.0,0.0],scale=1.0,orientation=Quaternion().IDENTITY,**kw):
+def gmsh(meshfile="file.mesh",shift=[0.0,0.0,0.0],scale=1.0,orientation=Quaternion().Identity,**kw):
""" Imports geometry from mesh file and creates facets.
:Parameters:
@@ -173,7 +173,7 @@
ret.append(utils.sphere([shift[0]+scale*float(data[0]),shift[1]+scale*float(data[1]),shift[2]+scale*float(data[2])],scale*float(data[3]),**kw))
return ret
-def gengeo(mntable,shift=Vector3().ZERO,scale=1.0,**kw):
+def gengeo(mntable,shift=Vector3().Zero,scale=1.0,**kw):
""" Imports geometry from LSMGenGeo library and creates spheres.
:Parameters:
Follow ups