Commit 07a04e88 authored by Anton Gladky's avatar Anton Gladky

Imported Upstream version 1.20.0

parent cef36918
......@@ -30,3 +30,5 @@ doc/sphinx/yade.polyhedra_utils.rst
*.kdev4
*.pyc
*~
.idea
trunk.iml
This diff is collapsed.
==================================================
yade-1.20.0
Fri, Oct 9 21:20:00 2015 +0200
Anton Gladky (57):
Remove RELEASE file.
Simplify definition of build flags
Fix some warnings during compilation.
For clang use -fstack-protector instead of -fstack-protector-strong
Ignore project files of idea IDE
Refactoring of Math.hpp
Make minieigen external package mandatory.
Add -fstack-protector-strong only for gcc >=4.9
Some warning fixes.
Add ENABLE_PROFILING option
Set some metric-measures in ViscElCap.
Revert adding frounding-math flag
Replace INSTALL_PREFIX by CMAKE_INSTALL_PREFIX
Remove deprecated in Yade BOOST_PYTHON_FUNCTION_OVERLOADS macros.
Fix some more compilation warnings.
Fix some more compilation warnings.
Minor fix in CMakeLists.txt
Fix hexagonal packing, should not be undesired overlap any more.
Make Serializable.hpp more readable.
Remove deprecated parameters.
Move STLReader into STLImporter
+1 master thesis at TU Freiberg.
Fix crash by export-VTK of interactions after body removal.
Split description of ViscoelasticPM to make it more readable.
Let exist interactions between clumpMembers of the same clump.
Skip force calculation in SPH-clump
Add warning about CGAL in Ubuntu 14.04 Trusty
Add ISC_TIMING pre preprocessor directive.
Drop support of Ubuntu 12.04 Precise
Merge pull request #46 from timpovall/master
Non invasive refactoring of InsertionSortCollider
Revert previous commit.
Add a second option to fix the compilation with CGAL on 14.04
Remove deprecated code with very old boost.
Implement viscous damping for capillary phase.
Fix SPH force calculation between clump members.
Fix compilation with QGLViewer>=2.6.3
Prepare Qt5-build.
Fix compilation against gqlviewer-qt4.
Fix check-script
+1 conference
First steps in Qt5.
Prepare Qt5 build.
Update python files due to Qt5.
Some more updates toward Qt5.
Qt5-migration is alsmot finished.
Fix Qt5 compilation.
Fix crash in Qt5.
Fix QThread issue.
Add information about compilation against Qt5.
Add missing function in TesselationWrapper
Remove some unused headers and defs.
Fix compilation if openmp is disabled
Fix compilation introduced in last commit.
Add talk, hold in Particles 2015
Add hourglass example
Add RELEASE file.
Bruno Chareyre (15):
Save relative rotations in ScGeom6D (unmark "nosave") since it is required for reloading correctly.
CohesiveFrictionalInteractions: removed "nosave" flags for contact moments
+1 journal paper
+1 journal paper
add a virtual function returning rotational stiffness of the interactions - returning zero if not overloaded
account for the rotational stiffness of interactions in GlobalStiffnessTimeStepper
apply the spin of the velocity gradient on particles in periodic BCs
small typo
Added book chapter
Installation: http://www.yade-dem.org/packages is required for an external library (eigen or cgal? not sure now)
more accurate defintion of fluctuational velocity/spin for kinetic energy in periodic BCs
correct value of volume for id<6 in TesselationWrapper when O.bodies does not have bounding objects
fix segfault when InteractionContainer::found() access out of bounds
add function has() to O.interactions to check if (id1,id2) exists + fix doc of O.interactions
remove useless int parameter of O.interactions.all(), instead filter non-real interactions optionaly based on bool
Chao Yuan (3):
-add getPotentialPendularSpheresPair() function.
-set pore throat radius between two fictious cells negative in invadeBoundary=true mode.
add a new version of capillary law. (pushed by Caroline)
Francois Kneib (2):
New viewer feature : display tori instead of spheres for 2D simulations. So if the viewer looks toward the right axis, on can see circles instead of disks. Modifications in pkg/common/Gl1_Primitives.*pp 3 new parameters in Gl1_Sphere : circleView, circleRelThickness, circleAllowedRotationAxis. A new condition to enable circleView. The code is based on initGlutGlList() method for spheres.
Add an example script for the tori DISPLAY feature.
Jan Stránský (4):
fixed compilation warning
added Polyhedra.setVertices function, which also updates internal variables (shape.v=... does not)
Added Facet.setVertices function to prevent memory leaks (see bug 1041084, #8)
corrected bug in utils.UnstructuredGrid.updateElements (question #267761)
Janek Kozicki (2):
Fix bug in InteractionContainer::eraseNonReal
Fix: CGAL ERROR: assertion violation!
Jerome Duriez (5):
Add missing space in error message
Doc of sphSph attribute of plotDirections precized
Introduction of surface tension as an attribute, and comments about code objects related to capillary files
Addition in doc of Omega.engines to state it is = to O.engines in python
Removal of python O.engines reference
Raphael Maurin (9):
getStressProfile: output format modification + add calculation of granular temperature and kinetic stress tensor
Law2_ScGeom_ViscElPhys_Basic: add a new formulation + check Add a new formulation of the law when imposing in the material young, poisson, and normal restitution coefficient. The effective spring constants ks and kn are evaluated "classically" with the young modulus and the poisson's ratio. The specificity of the formulation stands in the fact that it is the restitution coefficient of the contact (en = 2*en1*en2/(en1+en2)) that is imposed, and not the damping constant. To achieve this, the damping constant of the contact is evaluated resolving numerically the analytical expression 21 of [Schwager2007] (with a minus sign, there is a mistake in the article) with a Newton-Raphson algorithm (This was made by Francois Kneib). This does not seem to affect the calculation time. With this formulation, there is no tangential viscous damping, and it is usually not possible to access value of normal restitution coefficient lower than 0.1 (in that case the numerical resolution does not converged in the maximum 15 iteration allowed in the code) Together with the new formulation, add a short check script to verify that the imposed restitution coefficient is the one obtained.
Law2_ScGeom_ViscElPhys_Basic: complete the documentation Add a more precise documentation of the law integrating the last commit. I didn't complete the formulation associated with Pournin2001 (precising en,es,tc) as I am not using it and I do not know it much.
Fix compilation error in the documentation of Law2_ScGeom_ViscElPhys_Basic Error inserted in commit d47b8574e8fcc2dc09b926404f08081f2194cfde
Add a function in shop to evaluate average depth profiles of particle velocity (x,y,z components), and solid volume fraction.
HydroForceEngine: switch averageProfile function into a method + modify documentation
Tutorial examples: remove all deprecated 'utils.' and GravityEngine in the example scripts
Modify getDepthProfile to possibly average on spheres of selected radius only
HydroForceEngine: modify averageProfile function to handle bi-disperse sample Add evaluation of the average solid volume fraction and drag force depth profiles considering the two particle size (taken as input) as independent.
Timothy Povall (1):
Removed line calling FindVTK.cmake, as this file no longer exists
thomassweijen (1):
Updates towards merging of both capillarity codes
==================================================
yade-1.14.0
Tue, 21 Apr 2015 22:36:55 +0200
......
......@@ -4,59 +4,22 @@
# QGLVIEWER_FOUND - system has QGLViewer
# QGLVIEWER_INCLUDE_DIR - the QGLViewer include directory
# QGLVIEWER_LIBRARIES - Link these to use QGLViewer
# QGLVIEWER_DEFINITIONS - Compiler switches required for using QGLViewer
#
find_path(QGLVIEWER_INCLUDE_DIR
NAMES QGLViewer/qglviewer.h
PATHS /usr/include
/usr/local/include
ENV QGLVIEWERROOT
NAMES qglviewer.h
PATHS /usr/include/QGLViewer
)
find_library(QGLVIEWER_LIBRARY_RELEASE
NAMES qglviewer-qt4 qglviewer QGLViewer QGLViewer2
PATHS /usr/lib
/usr/local/lib
ENV QGLVIEWERROOT
ENV LD_LIBRARY_PATH
ENV LIBRARY_PATH
PATH_SUFFIXES QGLViewer QGLViewer/release
)
find_library(QGLVIEWER_LIBRARY_DEBUG
NAMES dqglviewer dQGLViewer dQGLViewer2
PATHS /usr/lib
/usr/local/lib
ENV QGLVIEWERROOT
ENV LD_LIBRARY_PATH
ENV LIBRARY_PATH
PATH_SUFFIXES QGLViewer QGLViewer/debug
)
if(QGLVIEWER_LIBRARY_RELEASE)
if(QGLVIEWER_LIBRARY_DEBUG)
set(QGLVIEWER_LIBRARIES_ optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG})
else()
set(QGLVIEWER_LIBRARIES_ ${QGLVIEWER_LIBRARY_RELEASE})
endif()
set(QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARIES_} CACHE FILEPATH "The QGLViewer library")
endif()
find_library(QGLVIEWER_LIBRARIES
NAMES QGLViewer QGLViewer-qt4
)
IF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES)
SET(QGLVIEWER_FOUND TRUE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQGLVIEWER_FOUND")
ENDIF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES)
IF(QGLVIEWER_FOUND)
IF(NOT QGLViewer_FIND_QUIETLY)
MESSAGE(STATUS "Found QGLViewer: ${QGLVIEWER_LIBRARIES}")
ENDIF(NOT QGLViewer_FIND_QUIETLY)
ELSE(QGLVIEWER_FOUND)
IF(QGLViewer_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find QGLViewer")
ENDIF(QGLViewer_FIND_REQUIRED)
ENDIF(QGLVIEWER_FOUND)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(QGLVIEWER DEFAULT_MSG QGLVIEWER_INCLUDE_DIR QGLVIEWER_LIBRARIES)
......@@ -21,7 +21,7 @@
class Bound: public Serializable, public Indexable{
public:
YADE_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(Bound,Serializable,"Object bounding part of space taken by associated body; might be larger, used to optimalize collision detection",
YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(Bound,Serializable,"Object bounding part of space taken by associated body; might be larger, used to optimalize collision detection",
((int,lastUpdateIter,0,Attr::readonly,"record iteration of last reference position update |yupdate|"))
((Vector3r,refPos,Vector3r(NaN,NaN,NaN),Attr::readonly,"Reference position, updated at current body position each time the bound dispatcher update bounds |yupdate|"))
// ((bool,isBounding,false,Attr::readonly,"A flag used to tell when the body moves out of bounds - only used if oriVerlet striding is active :yref:`BoundDispatcher::updatingDispFactor`>0 |yupdate|"))
......@@ -30,8 +30,6 @@ class Bound: public Serializable, public Indexable{
((Vector3r,min,Vector3r(NaN,NaN,NaN),(Attr::noSave | Attr::readonly),"Lower corner of box containing this bound (and the :yref:`Body` as well)"))
((Vector3r,max,Vector3r(NaN,NaN,NaN),(Attr::noSave | Attr::readonly),"Upper corner of box containing this bound (and the :yref:`Body` as well)"))
,
/*deprec*/,
/* init */,
/* ctor*/,
/*py*/
YADE_PY_TOPINDEXABLE(Bound)
......
......@@ -141,13 +141,14 @@ class Cell: public Serializable{
Matrix3r getRotation() { Matrix3r R,U; computePolarDecOfDefGrad(R,U); return R; }
Matrix3r getLeftStretch() { Matrix3r R,U; computePolarDecOfDefGrad(R,U); return U; }
Matrix3r getRightStretch() { Matrix3r R,U; computePolarDecOfDefGrad(R,U); return trsf*R.transpose(); }
Vector3r getSpin() {Matrix3r R=.5*(velGrad-velGrad.transpose()); return Vector3r(-R(1,2),R(0,2),-R(0,1));}
// stress measures
//Matrix3r getStress() { return Shop::getStress(); }
//Matrix3r getCauchyStress() { Matrix3r s=getStress(); return .5*(s+s.transpose()); }
enum { HOMO_NONE=0, HOMO_POS=1, HOMO_VEL=2, HOMO_VEL_2ND=3 };
YADE_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(Cell,Serializable,"Parameters of periodic boundary conditions. Only applies if O.isPeriodic==True.",
YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(Cell,Serializable,"Parameters of periodic boundary conditions. Only applies if O.isPeriodic==True.",
/* overridden below to be modified by getters/setters because of intended side-effects */
((Matrix3r,trsf,Matrix3r::Identity(),,"[overridden]")) //"Current transformation matrix of the cell, which defines how far is the current cell geometry (:yref:`hSize<Cell.hSize>`) from the reference configuration. Changing trsf will not change :yref:`hSize<Cell.hSize>`, it serves only as accumulator for transformations applied via :yref:`velGrad<Cell.velGrad>`."))
((Matrix3r,refHSize,Matrix3r::Identity(),,"Reference cell configuration, only used with :yref:`OpenGLRenderer.dispScale`. Updated automatically when :yref:`hSize<Cell.hSize>` or :yref:`trsf<Cell.trsf>` is assigned directly; also modified by :yref:`yade.utils.setRefSe3` (called e.g. by the ``Reference`` button in the UI)."))
......@@ -157,11 +158,8 @@ class Cell: public Serializable{
((Matrix3r,velGrad,Matrix3r::Zero(),,"[overridden below]"))
((Matrix3r,nextVelGrad,Matrix3r::Zero(),Attr::readonly,"see :yref:`Cell.velGrad`."))
((Matrix3r,prevVelGrad,Matrix3r::Zero(),Attr::readonly,"Velocity gradient in the previous step."))
((bool,homoDeform,true,,"Deform (:yref:`velGrad<Cell.velGrad>`) the cell homothetically, by adjusting positions and velocities of bodies. The velocity change is obtained by deriving the expression v=∇v.x, where ∇v is the macroscopic velocity gradient, giving in an incremental form: Δv=Δ ∇v x + ∇v Δx. As a result, velocities are modified as soon as ``velGrad`` changes, according to the first term: Δv(t)=Δ ∇v x(t), while the 2nd term reflects a convective term: Δv'= ∇v v(t-dt/2)."))
((int,homoDeform,2,,"If >0, deform (:yref:`velGrad<Cell.velGrad>`) the cell homothetically by adjusting positions and velocities of bodies. The velocity change is obtained by deriving the expression v=∇v.x, where ∇v is the macroscopic velocity gradient, giving in an incremental form: Δv=Δ ∇v x + ∇v Δx. As a result, velocities are modified as soon as ``velGrad`` changes, according to the first term: Δv(t)=Δ ∇v x(t), while the 2nd term reflects a convective term: Δv'= ∇v v(t-dt/2). The second term is neglected if homoDeform=1. All terms are included if homoDeform=2 (default)"))
((bool,velGradChanged,false,Attr::readonly,"true when velGrad has been changed manually (see also :yref:`Cell.nextVelGrad`)")),
/*deprec*/
((Hsize,hSize,"conform to Yade's names convention.")),
/*init*/ ,
/*ctor*/ _invTrsf=Matrix3r::Identity(); integrateAndUpdate(0),
/*py*/
// override some attributes above
......@@ -191,6 +189,7 @@ class Cell: public Serializable{
.def("getRotation",&Cell::getRotation,"Returns rotation of the cell (orthogonal matrix $\\mat{R}$ from polar decomposition $\\mat{F}=\\mat{RU}$ )")
.def("getLeftStretch",&Cell::getLeftStretch,"Returns left (spatial) stretch tensor of the cell (matrix $\\mat{U}$ from polar decomposition $\\mat{F}=\\mat{RU}$ )")
.def("getRightStretch",&Cell::getRightStretch,"Returns right (material) stretch tensor of the cell (matrix $\\mat{V}$ from polar decomposition $\\mat{F}=\\mat{RU}=\\mat{VR}\\ \\rightarrow\\ \\mat{V}=\\mat{FR}^T$ )")
.def("getSpin",&Cell::getSpin,"Returns the spin defined by the skew symmetric part of :yref:`velGrad<Cell.velGrad>`")
.def_readonly("shearTrsf",&Cell::_shearTrsf,"Current skew+rot transformation (no resize)")
.def_readonly("unshearTrsf",&Cell::_unshearTrsf,"Inverse of the current skew+rot transformation (no resize)")
.add_property("hSize0",&Cell::getHSize0,"Value of untransformed hSize, with respect to current :yref:`trsf<Cell::trsf>` (computed as :yref:`trsf<Cell::trsf>` ⁻¹ × :yref:`hSize<Cell::hSize>`.")
......
......@@ -52,7 +52,6 @@ class ForceContainer{
vvector _force, _torque, _move, _rot, _permForce, _permTorque;
std::vector<size_t> sizeOfThreads;
size_t size;
size_t permSize;
bool syncedSizes;
int nThreads;
bool synced,moveRotUsed,permForceUsed;
......@@ -74,7 +73,7 @@ class ForceContainer{
// dummy function to avoid template resolution failure
friend class boost::serialization::access; template<class ArchiveT> void serialize(ArchiveT & ar, unsigned int version){}
public:
ForceContainer(): size(0), permSize(0),syncedSizes(true),synced(true),moveRotUsed(false),permForceUsed(false),_zero(Vector3r::Zero()),syncCount(0),lastReset(0){
ForceContainer(): size(0), syncedSizes(true),synced(true),moveRotUsed(false),permForceUsed(false),_zero(Vector3r::Zero()),syncCount(0),lastReset(0){
nThreads=omp_get_max_threads();
for(int i=0; i<nThreads; i++){
_forceData.push_back(vvector()); _torqueData.push_back(vvector());
......@@ -175,7 +174,6 @@ class ForceContainer{
void resizePerm(size_t newSize){
_permForce.resize(newSize,Vector3r::Zero());
_permTorque.resize(newSize,Vector3r::Zero());
permSize = newSize;
if (size<newSize) size=newSize;
syncedSizes=false;
}
......@@ -224,7 +222,7 @@ class ForceContainer {
std::vector<Vector3r> _permForce, _permTorque;
Body::id_t _maxId;
size_t size;
size_t permSize;
bool moveRotUsed, permForceUsed;
inline void ensureSize(Body::id_t id){
const Body::id_t idMaxTmp = max(id, _maxId);
_maxId = 0;
......@@ -234,11 +232,10 @@ class ForceContainer {
const Vector3r& getForceUnsynced (Body::id_t id){ return getForce(id);}
const Vector3r& getTorqueUnsynced(Body::id_t id){ return getForce(id);}
#endif
bool moveRotUsed, permForceUsed;
// dummy function to avoid template resolution failure
friend class boost::serialization::access; template<class ArchiveT> void serialize(ArchiveT & ar, unsigned int version){}
public:
ForceContainer(): size(0), permSize(0), moveRotUsed(false), permForceUsed(false), syncCount(0), lastReset(0), _maxId(0){}
ForceContainer(): _maxId(0), size(0), moveRotUsed(false), permForceUsed(false), syncCount(0), lastReset(0){}
const Vector3r& getForce(Body::id_t id){ensureSize(id); return _force[id];}
void addForce(Body::id_t id,const Vector3r& f){ensureSize(id); _force[id]+=f;}
const Vector3r& getTorque(Body::id_t id){ensureSize(id); return _torque[id];}
......
......@@ -130,7 +130,7 @@ void InteractionContainer::requestErase(Interaction* I){
}
void InteractionContainer::eraseNonReal(){
FOREACH(const shared_ptr<Interaction>& i, *this) if(!i->isReal()) this->erase(i->getId1(),i->getId2());
FOREACH(const shared_ptr<Interaction>& i, *this) if(!i->isReal()) this->erase(i->getId1(),i->getId2(),i->linIx);
}
// compare interaction based on their first id
......
......@@ -72,11 +72,13 @@ class InteractionContainer: public Serializable{
bool insert(Body::id_t id1,Body::id_t id2);
bool insert(const shared_ptr<Interaction>& i);
//3rd parameter is used to remove I from linIntrs (in conditionalyEraseNonReal()) when body b1 has been removed
bool erase(Body::id_t id1,Body::id_t id2,int linPos=-1);
bool erase(Body::id_t id1,Body::id_t id2,int linPos);
const shared_ptr<Interaction>& find(Body::id_t id1,Body::id_t id2);
// bool found(Body::id_t id1,Body::id_t id2);
inline bool found(const Body::id_t& id1,const Body::id_t& id2){
assert(bodies); return (id1>id2)?(*bodies)[id2]->intrs.count(id1):(*bodies)[id1]->intrs.count(id2);}
assert(bodies);
if(id2>=(Body::id_t)bodies->size()) return false;
return (id1>id2)?(*bodies)[id2]->intrs.count(id1):(*bodies)[id1]->intrs.count(id2);}
// index access
shared_ptr<Interaction>& operator[](size_t id){return linIntrs[id];}
const shared_ptr<Interaction>& operator[](size_t id) const { return linIntrs[id];}
......
......@@ -23,19 +23,11 @@
#include<cxxabi.h>
#if BOOST_VERSION<103500
class RenderMutexLock: public boost::try_mutex::scoped_try_lock{
public:
RenderMutexLock(): boost::try_mutex::scoped_try_lock(Omega::instance().renderMutex,true){/*cerr<<"Lock renderMutex"<<endl;*/}
~RenderMutexLock(){/* cerr<<"Unlock renderMutex"<<endl; */}
};
#else
class RenderMutexLock: public boost::mutex::scoped_lock{
public:
RenderMutexLock(): boost::mutex::scoped_lock(Omega::instance().renderMutex){/* cerr<<"Lock renderMutex"<<endl; */}
~RenderMutexLock(){/* cerr<<"Unlock renderMutex"<<endl;*/ }
};
#endif
CREATE_LOGGER(Omega);
SINGLETON_SELF(Omega);
......@@ -65,8 +57,13 @@ void Omega::switchToScene(int i) {
Real Omega::getRealTime(){ return (boost::posix_time::microsec_clock::local_time()-startupLocalTime).total_milliseconds()/1e3; }
boost::posix_time::time_duration Omega::getRealTime_duration(){return boost::posix_time::microsec_clock::local_time()-startupLocalTime;}
Real Omega::getRealTime(){
return (boost::posix_time::microsec_clock::local_time()-startupLocalTime).total_milliseconds()/1e3;
}
boost::posix_time::time_duration Omega::getRealTime_duration(){
return boost::posix_time::microsec_clock::local_time()-startupLocalTime;
}
void Omega::initTemps(){
......@@ -76,8 +73,8 @@ void Omega::initTemps(){
}
void Omega::cleanupTemps(){
boost::filesystem::path tmpPath(tmpFileDir);
boost::filesystem::remove_all(tmpPath);
boost::filesystem::path tmpPath(tmpFileDir);
boost::filesystem::remove_all(tmpPath);
}
std::string Omega::tmpFilename(){
......@@ -93,7 +90,6 @@ void Omega::reset(){
void Omega::init(){
sceneFile="";
//resetScene();
resetAllScenes();
sceneAnother=shared_ptr<Scene>(new Scene);
timeInit();
......@@ -104,8 +100,14 @@ void Omega::timeInit(){
startupLocalTime=boost::posix_time::microsec_clock::local_time();
}
void Omega::createSimulationLoop(){ simulationLoop=shared_ptr<ThreadRunner>(new ThreadRunner(&simulationFlow_));}
void Omega::stop(){ LOG_DEBUG(""); if (simulationLoop&&simulationLoop->looping())simulationLoop->stop(); if (simulationLoop) simulationLoop=shared_ptr<ThreadRunner>(); }
void Omega::createSimulationLoop(){
simulationLoop=shared_ptr<ThreadRunner>(new ThreadRunner(&simulationFlow_));
}
void Omega::stop(){
LOG_DEBUG("");
if (simulationLoop&&simulationLoop->looping())simulationLoop->stop();
if (simulationLoop) simulationLoop=shared_ptr<ThreadRunner>();
}
/* WARNING: even a single simulation step is run asynchronously; the call will return before the iteration is finished. */
void Omega::step(){
......@@ -115,7 +117,7 @@ void Omega::step(){
}
void Omega::run(){
if(!simulationLoop){ LOG_ERROR("No Omega::simulationLoop? Creating one (please report bug)."); createSimulationLoop(); }
if(!simulationLoop){LOG_ERROR("No Omega::simulationLoop? Creating one (please report bug)."); createSimulationLoop(); }
if (simulationLoop && !simulationLoop->looping()){
simulationLoop->start();
}
......
......@@ -14,9 +14,8 @@
class PartialEngine: public Engine{
public:
virtual ~PartialEngine() {};
YADE_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(PartialEngine,Engine,"Engine affecting only particular bodies in the simulation, defined by *ids*.",
((std::vector<int>,ids,,,":yref:`Ids<Body::id>` of bodies affected by this PartialEngine.")),
/*deprec*/, /*init*/, /* ctor */, /* py */
YADE_CLASS_BASE_DOC_ATTRS(PartialEngine,Engine,"Engine affecting only particular bodies in the simulation, defined by *ids*.",
((std::vector<int>,ids,,,":yref:`Ids<Body::id>` of bodies affected by this PartialEngine."))
);
};
REGISTER_SERIALIZABLE(PartialEngine);
......
......@@ -158,7 +158,7 @@ if opts.performance:
checksPath=libDir+'/py/yade/tests/checks/performance'
execfile(checksPath+'/checkPerf.py')
def userSession(qt4=False,qapp=None):
def userSession(gui='none',qapp=None):
# prepare nice namespace for users
import yade.runtime
import sys
......@@ -171,7 +171,7 @@ def userSession(qt4=False,qapp=None):
# IPython.appstart_qt4(qapp)
if len(sys.argv)>0:
arg0=sys.argv[0]
if qt4: yade.qt.Controller();
if (gui<>'none'): yade.qt.Controller();
if sum(bool(arg0.endswith(ext)) for ext in ('.xml','.xml.bz2','.xml.gz','.yade','.yade.gz','.yade.bz2','.bin','.bin.gz','.bin.bz2'))>0:
if len(sys.argv)>1: raise RuntimeError('Extra arguments to saved simulation to run: '+' '.join(sys.argv[1:]))
sys.stderr.write("Running simulation "+arg0+'\n')
......@@ -189,7 +189,7 @@ def userSession(qt4=False,qapp=None):
runScript(arg0)
if yade.runtime.opts.exitAfter: sys.exit(0)
# common ipython configuration
banner='[[ ^L clears screen, ^U kills line. '+', '.join((['F12 controller','F11 3d view (use h-key for showing help)','F10 both','F9 generator'] if (qt4) else [])+['F8 plot'])+'. ]]'
banner='[[ ^L clears screen, ^U kills line. '+', '.join((['F12 controller','F11 3d view (use h-key for showing help)','F10 both','F9 generator'] if (gui<>'none') else [])+['F8 plot'])+'. ]]'
ipconfig=dict( # ipython options, see e.g. http://www.cv.nrao.edu/~rreid/casa/tips/ipy_user_conf.py
prompt_in1='Yade [\#]: ',
prompt_in2=' .\D.: ',
......@@ -200,7 +200,7 @@ def userSession(qt4=False,qapp=None):
'tab: complete',
# only with the gui; the escape codes might not work on non-linux terminals.
]
+(['"\e[24~": "\C-Uyade.qt.Controller();\C-M"','"\e[23~": "\C-Uyade.qt.View();\C-M"','"\e[21~": "\C-Uyade.qt.Controller(), yade.qt.View();\C-M"','"\e[20~": "\C-Uyade.qt.Generator();\C-M"'] if (qt4) else []) #F12,F11,F10,F9
+(['"\e[24~": "\C-Uyade.qt.Controller();\C-M"','"\e[23~": "\C-Uyade.qt.View();\C-M"','"\e[21~": "\C-Uyade.qt.Controller(), yade.qt.View();\C-M"','"\e[20~": "\C-Uyade.qt.Generator();\C-M"'] if (gui<>'none') else []) #F12,F11,F10,F9
+['"\e[19~": "\C-Uimport yade.plot; yade.plot.plot();\C-M"', #F8
'"\e[A": history-search-backward', '"\e[B": history-search-forward', # incremental history forward/backward
]
......@@ -245,6 +245,7 @@ def userSession(qt4=False,qapp=None):
gui=None
yade.runtime.hasDisplay=False # this is the default initialized in the module, anyway
if 'GUI' in features: gui='qt4'
if 'GUI-Qt5' in features: gui='qt5'
if opts.nogui: gui=None
if gui:
import Xlib.display
......@@ -264,7 +265,9 @@ if gui:
# run remote access things, before actually starting the user session (not while imported by other python application)
if __name__ == "__main__":
from yade import remote
yade.remote.useQThread=(gui=='qt4')
if (gui=='qt4' or gui=='qt5'):
yade.remote.useQThread=True
yade.remote.gui=gui
yade.remote.runServers()
if gui==None:
......@@ -277,7 +280,15 @@ elif gui=='qt4':
from PyQt4.QtCore import *
import yade.qt # this yade.qt is different from the one that comes with qt3
qapp=QtGui.QApplication(sys.argv)
userSession(qt4=True,qapp=qapp)
userSession(gui=gui,qapp=qapp)
elif gui=='qt5':
import PyQt5
from PyQt5 import QtGui
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import yade.qt
qapp=QApplication(sys.argv)
userSession(gui=gui,qapp=qapp)
if __name__ == "__main__":
O.exitNoBacktrace()
......@@ -25,7 +25,7 @@ To install daily-version one needs to add this repository to your
sudo apt-get install yadedaily
If you have another distribution, not Ubuntu Trusty (Version 14.04 LTS), be sure to use the
correct name in the first line (for instance, precise, jessie or wheezy). For the list
correct name in the first line (for instance, trusty, jessie or wheezy). For the list
of currently supported distributions, please visit `yade-dem.org/packages <http://yade-dem.org/packages/>`_.
After that you can normally start Yade using "yadedaily" or "yadedaily-batch" command.
......@@ -33,7 +33,7 @@ yadedaily on older distributions can have some disabled features due to older li
versions, shipped with particular distribution.
Git-repository for packaging stuff is available on `GitHub <https://github.com/yade/yadedaily/>`_.
Each branch corresponds to one distribution e.g. precise, jessie etc.
Each branch corresponds to one distribution e.g. trusty, jessie etc.
The scripts for building all of this stuff is `here <https://github.com/yade/trunk/tree/master/scripts/ppa>`_.
It uses pbuilder to build packages, so all packages are building in a clean environment.
......@@ -109,12 +109,12 @@ Some of them are only optional. The last ones are only relevant for using the fl
* `cmake <http://www.cmake.org/>`_ build system
* `gcc <http://www.gcc.gnu.org>`_ compiler (g++); other compilers will not work; you need g++>=4.2 for openMP support
* `boost <http://www.boost.org/>`_ 1.35 or later
* `qt4 <http://www.qt.nokia.com>`_ library
* `Qt <http://www.qt.io/>`_ library
* `freeglut3 <http://freeglut.sourceforge.net>`_
* `libQGLViewer <http://www.libqglviewer.com>`_
* `python <http://www.python.org>`_, `numpy <http://numpy.scipy.org>`_, `ipython <http://ipython.scipy.org>`_
* `matplotlib <http://matplotlib.sf.net>`_
* `eigen3 <http://eigen.tuxfamily.org>`_ algebra library (minimal required version 3.2.1)
* `eigen <http://eigen.tuxfamily.org>`_ algebra library (minimal required version 3.2.1)
* `gdb <http://www.gnu.org/software/gdb>`_ debugger
* `sqlite3 <http://www.sqlite.org>`_ database engine
* `Loki <http://loki-lib.sf.net>`_ library
......@@ -126,7 +126,7 @@ Some of them are only optional. The last ones are only relevant for using the fl
Most of the list above is very likely already packaged for your distribution. In case you are confronted
with some errors concerning not available packages (e.g. Package libmetis-dev is not available) it may be necessary
to add yade external ppa from https://launchpad.net/~yade-users/+archive/external::
to add yade external ppa from https://launchpad.net/~yade-users/+archive/external (see below) as well as http://www.yade-dem.org/packages (see the top of this page)::
sudo add-apt-repository ppa:yade-users/external
sudo apt-get update
......@@ -134,10 +134,6 @@ to add yade external ppa from https://launchpad.net/~yade-users/+archive/externa
The following commands have to be executed in command line of corresponding
distributions. Just copy&paste to the terminal. To perform commands you
should have root privileges
.. warning:: If you have Ubuntu 12.10 or older, you need to install libqglviewer-qt4-dev
package instead of libqglviewer-dev.
* **Ubuntu**, **Debian** and their derivatives::
......@@ -147,7 +143,7 @@ should have root privileges
libgts-dev python-pygraphviz libvtk5-dev python-scientific libeigen3-dev \
python-xlib python-qt4 pyqt4-dev-tools gtk2-engines-pixbuf python-argparse \
libqglviewer-dev python-imaging libjs-jquery python-sphinx python-git python-bibtex \
libxmu-dev libxi-dev libcgal-dev help2man libbz2-dev zlib1g-dev
libxmu-dev libxi-dev libcgal-dev help2man libbz2-dev zlib1g-dev python-minieigen
Some of packages (for example, cmake, eigen3) are mandatory, some of them
......@@ -157,7 +153,7 @@ some of Yade features will be disabled (see the messages at the end of configura
Additional packages, which can become mandatory later::
sudo apt-get install python-gts python-minieigen
sudo apt-get install python-gts
For effective usage of direct solvers in the PFV-type fluid coupling, the following libraries are recommended, together with eigen>=3.1: blas, lapack, suitesparse, and metis.
All four of them are available in many different versions. Different combinations are possible and not all of them will work. The following was found to be effective on recent deb-based systems. On ubuntu 12.04, better compile openblas with USE_OPENMP=1, else yade will run on a single core::
......@@ -174,6 +170,22 @@ If you are using other distribution, than Debian or its derivatives, you should
install the softwares listed above. Their names can differ from the
names of Debian-packages.
.. warning:: If you have Ubuntu 14.04 Trusty, you need to add -DCMAKE_CXX_FLAGS="-frounding-math"
during the configuration step of compilation (see below) or to install libcgal-dev
from our `external PPA <https://launchpad.net/~yade-users/+archive/external/>`_.
Otherwise the following error occurs on AMD64 architectures::
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1)
File: /usr/include/CGAL/Interval_nt.h
Line: 209
Explanation: Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?
Aborted
Compilation
^^^^^^^^^^^
......@@ -188,11 +200,11 @@ and where the source code will be compiled. Here is an example for a folder stru
Then inside this build-directory you should start cmake to configure the compilation process::
cmake -DINSTALL_PREFIX=/path/to/installfolder /path/to/sources
cmake -DCMAKE_INSTALL_PREFIX=/path/to/installfolder /path/to/sources
For the folder structure given above call the following command in folder "build":
cmake -DINSTALL_PREFIX=../install ../trunk
cmake -DCMAKE_INSTALL_PREFIX=../install ../trunk
Additional options can be configured in the same line with the following
syntax::
......@@ -201,7 +213,7 @@ syntax::
The following options are available:
* INSTALL_PREFIX: path where Yade should be installed (/usr/local by default)
* CMAKE_INSTALL_PREFIX: path where Yade should be installed (/usr/local by default)
* LIBRARY_OUTPUT_PATH: path to install libraries (lib by default)
* DEBUG: compile in debug-mode (OFF by default)
* CMAKE_VERBOSE_MAKEFILE: output additional information during compiling (OFF by default)
......@@ -216,12 +228,29 @@ The following options are available:
* ENABLE_GL2PS: enable GL2PS-option (ON by default)
* ENABLE_LINSOLV: enable LINSOLV-option (ON by default)
* ENABLE_PFVFLOW: enable PFVFLOW-option, FlowEngine (ON by default)
* ENABLE_LBMFLOW: enable LBMFLOW-option, LBM_ENGINE (ON by default)
* ENABLE_SPH: enable SPH-option, Smoothed Particle Hydrodynamics (OFF by default)
* ENABLE_LIQMIGRATION: enable LIQMIGRATION-option, see [Mani2013] for details (OFF by default)
* ENABLE_MASK_ARBITRARY: enable MASK_ARBITRARY option (OFF by default)
* ENABLE_PROFILING: enable profiling, e.g. shows some more metrics, which can define bottlenecks of the code (OFF by default)
* runtimePREFIX: used for packaging, when install directory is not the same is runtime directory (/usr/local by default)
* CHUNKSIZE: used, if you want several sources to be compiled at once. Increases compilation speed and RAM-consumption during it (1 by default).
* CHUNKSIZE: used, if you want several sources to be compiled at once. Increases compilation speed and RAM-consumption during it (1 by default)
* VECTORIZE: enables vectorization and alignment in Eigen3 library, experimental (OFF by default)
* USE_QT5: use QT5 for GUI, experimental (OFF by default)
For using an extended parameters of cmake, please, follow the corresponding
documentation on cmake-webpage.
.. warning:: To provide Qt4->Qt5 migration one needed to provide an additional option USE_QT5.
This option should be On or Off according to the Qt version, which was used
to compile libQGLViewer. On Debian/Ubuntu operating systems libQGLViewer
of version 2.6.3 and higher are compiled against Qt5 (for other operating systems
refer to the package archive of your distribution), so if you are using
such version, please switch on this option. Otherwise, if you mix Qt-versions
``Segmentation fault`` will appear just after Yade is started. To provide
necessary build dependencies for Qt5, install ``python-pyqt5 pyqt5-dev-tools ``
instead of ``python-qt4 pyqt4-dev-tools``, which is needed for Qt4.
If the compilation is finished without errors, you will see all enabled
and disabled options. Then start the standard the compilation process::
......
......@@ -611,7 +611,7 @@ There is several macros that hide behind them the functionality of :ref:`sphinxd
#define YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(klass,base,doc,attrs,ctor,py) \
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc,attrs,,ctor,py)
#define YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc,attrs,init,ctor,py) \
YADE_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(klass,base,doc,attrs,,init,ctor,py)
YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(klass,base,doc,attrs,inits,ctor,py)
Expected parameters are indicated by macro name components separated with underscores. Their meaning is as follows:
......@@ -1158,7 +1158,7 @@ Timing within engines (and functors) is based on :yref:`TimingDeltas` class. It
YADE_CLASS_BASE_DOC_ATTRS_CTOR(Law2_ScGeom_CpmPhys_Cpm,LawFunctor,"docstring",
/* attrs */,
/* constructor */
timingDeltas=shared_ptr<TimingDeltas>(new TimingDeltas); // timingDeltas object is automatically initialized when using -DCMAKE_CXX_FLAGS="-DUSE_TIMING_DELTAS" cmake option
timingDeltas=shared_ptr<TimingDeltas>(new TimingDeltas); // timingDeltas object is automatically initialized when using -DENABLE_PROFILING=1 cmake option
);
// ...
};
......@@ -1186,7 +1186,7 @@ Timing within engines (and functors) is based on :yref:`TimingDeltas` class. It
timingDeltas->checkpoint("rest");