about adding an new InsertionSortCollider
Hello, I add a new engine and new InsertionSortCo
Traceback (most recent call last):
File "./yade-
import yade
File "/home/
import boot
ImportError: /home/xhh/
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
The CMAKE information is as following:
-- Version is set to 2016-10-
-- GTS using gts-config /usr/bin/gts-config
-- Using GTS from /usr
-- GCC Version >= 4.8. Adding -ftrack-
-- GCC Version >= 4.9. Adding -fstack-
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- python
-- thread
-- filesystem
-- iostreams
-- regex
-- serialization
-- system
-- date_time
-- chrono
-- atomic
-- Boost_VERSION: 105800
-- Boost_LIB_VERSION: 1_58
-- Boost_INCLUDE_DIRS: /usr/include
-- Boost_LIBRARIES: /usr/lib/
-- Found Eigen3, version: 3.2.92
-- Disable vectorization
-- The imported target "vtkRenderingPy
"/usr/
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/
but not all the files it references.
-- The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/
but not all the files it references.
-- Found VTK
-- Found OpenMP
-- GTS using gts-config /usr/bin/gts-config
-- Using GTS from /usr
-- Found GTS
-- Found GUI-Qt5-LIBS
-- GMP libs: /usr/lib/
-- GMP libs: /usr/lib/
-- Found CGAL
-- Could NOT find Cholmod (missing: CHOLMOD_LIBRARIES CHOLMOD_INCLUDE_DIR AMD_LIBRARY CAMD_LIBRARY COLAMD_LIBRARY CCOLAMD_LIBRARY)
-- Could NOT find OpenBlas (missing: OPENBLAS_LIBRARY)
-- Could NOT find Metis (missing: METIS_INCLUDE_DIR METIS_LIBRARY)
-- Missing dependency for LINSOLV, disabled
-- Found GL2PS
LBMFLOW is still experimental, building and running LBM engine are at your own risk!
Yade will be installed to /home/xhh/
-- Suffix is set to -2016-10-
-- LIBRARY_OUTPUT_PATH is set to lib/x86_
-- runtimePREFIX is set to /home/xhh/
-- Use system gts version
-- VTK version >5 is found
-- =======
-- Yade configured with following features: Odeint VTK OpenMP GTS GUI-Qt5 CGAL PFVFLOW GL2PS LBMFLOW
-- Disabled features: LINSOLV SPH LIQMIGRATION MASK_ARBITRARY PROFILING PotentialParticles PotentialBlocks
-- Optimized build
-- =======
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xhh/
xhh@xhh:
[ 1%] Automatic moc for target _packPredicates
[ 2%] Automatic moc for target boot
[ 3%] Automatic moc for target _packSpheres
[ 3%] Automatic moc for target _packObb
[ 4%] Automatic moc for target _polyhedra_utils
[ 4%] Automatic moc for target _GLViewer
[ 4%] Automatic moc for target wrapper
[ 5%] Automatic moc for target yade
[ 5%] Built target boot_automoc
[ 5%] Built target _packPredicates
[ 5%] Built target _packSpheres_
[ 5%] Built target _polyhedra_
[ 5%] Built target _packObb_automoc
[ 5%] Built target _GLViewer_automoc
[ 5%] Built target wrapper_automoc
[ 5%] Automatic moc for target WeightedAverage2d
[ 6%] Automatic moc for target _utils
[ 6%] Automatic moc for target _customConverters
[ 6%] Built target yade_automoc
[ 8%] Built target _packObb
[ 9%] Built target _polyhedra_utils
[ 9%] Built target WeightedAverage
[ 9%] Built target _utils_automoc
[ 9%] Built target _customConverte
[ 10%] Built target WeightedAverage2d
[ 14%] Built target _GLViewer
Scanning dependencies of target yade
[ 14%] Building CXX object CMakeFiles/
[ 15%] Building CXX object CMakeFiles/
[ 15%] Linking CXX shared library lib/x86_
[ 93%] Built target yade
[ 93%] Linking CXX shared library lib/x86_
[ 93%] Linking CXX shared library lib/x86_
[ 94%] Linking CXX shared library lib/x86_
[ 94%] Linking CXX shared library lib/x86_
[ 94%] Linking CXX shared library lib/x86_
[ 94%] Linking CXX shared library lib/x86_
[ 95%] Built target _packPredicates
[ 96%] Built target _packSpheres
[ 97%] Built target boot
[ 98%] Built target _customConverters
[ 99%] Built target wrapper
[100%] Built target _utils
Revision history for this message
|
#2 |
Hi,
Have you launched "make install" as well ? [*]
Revision history for this message
|
#5 |
Hello,
would it be possible for you to share the code of the new classes such that
we can test it?
Thanks
Jan
Dne 15. 11. 2016 1:53 dop. napsal uživatel "Haohui Xin" <
<email address hidden>>:
> Question #404070 on Yade changed:
> https:/
>
> Haohui Xin gave more information on the question:
> ~/yade/build$ make install
> [ 0%] Automatic moc for target boot
> [ 0%] Built target boot_automoc
> [ 1%] Automatic moc for target yade
> [ 1%] Built target yade_automoc
> [ 1%] Automatic moc for target _GLViewer
> [ 1%] Built target _GLViewer_automoc
> [ 5%] Built target _GLViewer
> [ 84%] Built target yade
> [ 85%] Built target boot
> [ 86%] Automatic moc for target _polyhedra_utils
> [ 86%] Built target _polyhedra_
> [ 87%] Built target _polyhedra_utils
> [ 88%] Automatic moc for target _packSpheres
> [ 88%] Built target _packSpheres_
> [ 89%] Built target _packSpheres
> [ 90%] Automatic moc for target _packPredicates
> [ 90%] Built target _packPredicates
> [ 91%] Built target _packPredicates
> [ 91%] Automatic moc for target wrapper
> [ 91%] Built target wrapper_automoc
> [ 93%] Built target wrapper
> [ 93%] Automatic moc for target _packObb
> [ 93%] Built target _packObb_automoc
> [ 95%] Built target _packObb
> [ 95%] Automatic moc for target WeightedAverage2d
> [ 95%] Built target WeightedAverage
> [ 96%] Built target WeightedAverage2d
> [ 97%] Automatic moc for target _utils
> [ 97%] Built target _utils_automoc
> [ 98%] Built target _utils
> [ 98%] Automatic moc for target _customConverters
> [ 98%] Built target _customConverte
> [100%] Built target _customConverters
> Install the project...
> -- Install configuration: ""
> -- Installing: /home/xhh/
> batch
> -- Installing: /home/xhh/
> -- Installing: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 1b22b1a/
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Installing: /home/xhh/
> 31.git-
> -- Installing: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Up-to-date: /home/xhh/
> 31.git-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> to "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> to "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> to "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
> -- Installing: /home/xhh/
> 31.git-
> -- Set runtime path of "/home/
> x86_64-
> to "/home/
> 31.git-
> yade-2016-
> x86_64-
> xhh/yade/
> 1b22b1a/
> gnu/yade-
>
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
Revision history for this message
|
#6 |
Hello, Thanks.
The latest error is as following. It could cmakem make and make install. But it appeared problems when I run it.
Traceback (most recent call last):
File "./yade-
import yade
File "/home/
import system
RuntimeError: extension class wrapper for base class HeatCollider has not been created yet
Firstly, I define a new engine.
#pragma once
#include<
class HeatEngine: public Engine {
public :
virtual ~HeatEngine() {};
YADE_CLASS_
};
REGISTER_
Second, I define a new collider
#pragma once
#include<
#include<
#include<
#include<
class HeatCollider: public HeatEngine {
public:
static int avoidSelfIntera
/*! Probe the Bound on a bodies presense. Returns list of body ids with which there is potential overlap. */
virtual vector<Body::id_t> probeBoundingVo
static bool mayCollide(const Body*, const Body*);
virtual void invalidatePersi
// ctor with functors for the integrated BoundDispatcher
virtual void pyHandleCustomC
int get_avoidSelfIn
void set_avoidSelfIn
YADE_CLASS_
((shared_
/*ctor*/,
.add_
);
DECLARE_LOGGER;
};
REGISTER_
#include<
YADE_PLUGIN(
int HeatCollider:
bool HeatCollider:
return
// might be called with deleted bodies, i.e. NULL pointers
(b1!=NULL && b2!=NULL) &&
// only collide if at least one particle is standalone or they belong to different clumps
(b1->
#ifdef YADE_SPH
// If SPH-mode enabled, we do not skip interactions between clump-members
// to get the correct calculation of density b->rho
|| true
#endif
) &&
// do not collide clumps, since they are just containers, never interact
!b1->isClump() && !b2->isClump() &&
// masks must have at least 1 bit in common
b1->maskCompa
// avoid contact between particles having the same mask compatible with the avoidSelfIntera
!( (b1->groupMask == b2->groupMask) && b1->maskCompati
;
}
void HeatCollider:
if(boost:
if(boost:
typedef std::vector<
vecBound vb=boost:
FOREACH(
t=boost:
}
define an new sort methods
/******
* Copyright (C) 2008 by Sergei Dorofeenko *
* <email address hidden> *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*******
#pragma once
#include <pkg/common/
#include <core/Interacti
#include <vector>
class HeatSpatialQuic
protected:
struct AABBBound {
Vector3r min,max;
int id;
};
class xBoundComparator {
public:
bool operator() (shared_
{
return b1->min[0] < b2->min[0];
}
};
vector<
public:
virtual void action();
YADE_CLASS_
};
REGISTER_
/******
* Copyright (C) 2008 by Sergei Dorofeenko *
* <email address hidden> *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*******
#include "HeatSpatialQui
#include <core/Scene.hpp>
#include <core/BodyConta
#include <cmath>
#include <algorithm>
YADE_PLUGIN(
void HeatSpatialQuic
{
// update bounds
boundDispatche
const shared_
// This collider traverses all interactions at every step, therefore all interactions
// that were requested for erase might be erased here and will be recreated if necessary.
scene-
size_t nbElements=
if (nbElements!
{
size_t n = rank.size();
rank.
for (; n<nbElements; ++n)
rank[n] = shared_
}
Vector3r min,max;
int i=0;
FOREACH(const shared_ptr<Body>& b, *bodies){
if(!b->bound) continue;
min = b->bound->min;
max = b->bound->max;
rank[i]->id = b->getId();
rank[i]->min = min;
rank[i]->max = max;
i++;
}
const shared_
scene-
sort(rank.begin(), rank.end(), xBoundComparato
int id,id2; size_t j;
shared_
for(int i=0,e=nbElements-1; i<e; ++i)
{
id = rank[i]->id;
min = rank[i]->min;
max = rank[i]->max;
j=i;
while(
{
if ( rank[j]->min[0] > max[0]) break;
if ( rank[j]->min[1] < max[1]
&& rank[j]->max[1] > min[1]
&& rank[j]->min[2] < max[2]
&& rank[j]->max[2] > min[2])
{
id2=
if ( (interaction = interactions-
{
interaction = shared_
interactio
}
interaction
}
}
}
}
define an new loop
#pragma once
#include<
#include <pkg/common/
#include <pkg/common/
#ifdef USE_TIMING_DELTAS
#define TIMING_
#define TIMING_
#else
#define TIMING_
#define TIMING_
#endif
class HeatInteraction
bool alreadyWarnedNo
using idPair = std::pair<
// store interactions that should be deleted after loop in action, not later
#ifdef YADE_OPENMP
std::
void eraseAfterLoop(
#else
list<idPair> eraseAfterLoopIds;
void eraseAfterLoop(
#endif
public:
virtual void pyHandleCustomC
virtual void action();
YADE_
((shared_
((shared_
((shared_
((vector<
((bool, eraseIntsInLoop, false,,"Defines if the interaction loop should erase pending interactions, else the collider takes care of that alone (depends on what collider is used)."))
,
/*ctor*/ alreadyWarnedNo
#ifdef YADE_OPENMP
eraseAfter
#endif
,
/*py*/
);
DECLARE_LOGGER;
};
REGISTER_
#include"
YADE_PLUGIN(
CREATE_
void HeatInteraction
if(boost:
if(boost:
// parse custom arguments (3 lists) and do in-place modification of args
using vecGeom = std::vector<
using vecPhys = std::vector<
using vecLaw = std::vector<
vecGeom vg=boost:
vecPhys vp=boost:
vecLaw vl=boost:
for(const auto gf : vg) this->geomDispa
for(const auto pf : vp) this->physDispa
for(const auto cf : vl) this->lawDispat
t=boost:
}
void HeatInteraction
// update Scene* of the dispatchers
lawDispatcher-
physDispatcher
geomDispatcher
// ask dispatchers to update Scene* of their functors
geomDispatcher
physDispatcher
lawDispatcher-
/*
initialize callbacks; they return pointer (used only in this timestep) to the function to be called
returning NULL deactivates the callback in this timestep
*/
// pair of callback object and pointer to the function to be called
vector<
for (const auto cb : callbacks){
cb->scene=scene;
callbackPtrs.
}
assert(
const size_t callbacksSize=
// cache transformed cell size
Matrix3r cellHsize = Matrix3r::Zero();
if(scene-
cellHsize=
}
// force removal of interactions that were not encountered by the collider
// (only for some kinds of colliders; see comment for InteractionCont
const bool removeUnseenInt
#ifdef YADE_OPENMP
const long size=scene-
#pragma omp parallel for schedule(guided) num_threads(
for(long i=0; i<size; i++){
const shared_
#else
for (const auto & I : *scene-
#endif
if(removeUnse
eraseAfterLo
continue;
}
const shared_ptr<Body>& b1_=Body:
const shared_ptr<Body>& b2_=Body:
if(!b1_ || !b2_){
LOG_DEBUG("Body #"<<(b1_
scene-
continue;
}
// Skip interaction with clumps
if (b1_->isClump() || b2_->isClump()) { continue; }
// we know there is no geometry functor already, take the short path
if(!I-
// no interaction geometry for either of bodies; no interaction possible
if(!b1_->shape || !b2_->shape) { assert(
bool swap=false;
// IGeomDispatcher
if(!I-
I->functorCa
// returns NULL ptr if no functor exists; remember that and shortcut
if(!
I->
continue;
}
}
// arguments for the geom functor are in the reverse order (dispatcher would normally call goReverse).
// we don't remember the fact that is reverse, so we swap bodies within the interaction
// and can call go in all cases
if(swap)
// body pointers must be updated, in case we swapped
const shared_ptr<Body>& b1=swap?b2_:b1_;
const shared_ptr<Body>& b2=swap?b1_:b2_;
assert(
bool wasReal=
bool geomCreated;
if(!scene-
geomCreated=
} else {
// handle periodicity
Vector3r shift2=
// in sheared cell, apply shear on the mutual position as well
geomCreated=
}
if(!geomCreated){
if(wasReal) LOG_WARN(
if(wasReal) scene->
continue; // in any case don't care about this one anymore
}
// IPhysDispatcher
if(!I-
I->functorCa
assert(!swap); // InteractionPhys
}
if(!I-
throw std::runtime_
}
I->functorCac
assert(I->phys);
if(!wasReal) I->iterMadeReal
// LawDispatcher
// populating constLaw cache must be done after geom and physics dispatchers have been called, since otherwise the interaction
// would not have geom and phys yet.
if(!I-
I->functorCa
if(!
LOG_FATAL("None of given Law2 functors can handle interaction #"<<I->
exit(1);
}
assert(!swap); // reverse call would make no sense, as the arguments are of different types
}
assert(
//If the functor return false, the interaction is reset
if (!I->functorCac
// process callbacks for this interaction
if(!I->isReal()) continue; // it is possible that Law2_ functor called requestErase, hence this check
for(size_t i=0; i<callbacksSize; i++){
if(callbackP
}
}
}
Revision history for this message
|
#7 |
Hi,
did you see that the newly created files were compiled? To be sure,
you should "touch CMakeLists.txt" to regenerate the list of cpp-files
and run compilation process again.
Best regards
Anton
Revision history for this message
|
#8 |
Yes, the created file is compiled. I did not change the "CmakeList.txt". The introduction said it will detect the cpp file in the pkg automatically.
THanks
Revision history for this message
|
#9 |
If you just added files and did not "touch CMakeLists.txt"
the file list for compilation is not regenerated.
Anton
Revision history for this message
|
#10 |
Thanks I am not familiar with CmakeList.txt I will try to learn the Cmake file to solve my problems
Revision history for this message
|
#11 |
Just to clarify Anton's answer, you don't need to learn anything, just run
the commands
touch CMakeLists.txt
cmake
make install
cheers
Jan
2016-11-16 9:38 GMT+01:00 Haohui Xin <email address hidden>:
> Question #404070 on Yade changed:
> https:/
>
> Haohui Xin posted a new comment:
> Thanks I am not familiar with CmakeList.txt I will try to learn the
> Cmake file to solve my problems
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
Can you help with this problem?
Provide an answer of your own, or ask Haohui Xin for more information if necessary.