Re: [Yade-users] [Question #305894]: track coordinates and size of bond fractures ?

2016-07-28 Thread Jan Stránský
Question #305894 on Yade changed:
https://answers.launchpad.net/yade/+question/305894

Jan Stránský proposed the following answer:
Hi James,

according to docs [1,2], one option is ti use
Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(...,
*recordCracks=True,Key='test'*)
It should not be difficult to add some more information in the source code.

another option (with some modifications also applicable to different
materials) is to use a python function and call it with PyRunner. For this
purpose, set (Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(...,
*neverDamage=True*) [3] to make broken interactions still exist and make
possible to get information form them ("crack width" etc.)

###
def processBrokenInteractions():
print
print 'iter',O.iter
for i in O.interactions:
if i.phys.isBroken:
b1 = O.bodies[i.id1]
b2 = O.bodies[i.id2]
w = i.phys.initD-i.geom.penetrationDepth # not 100% sure
print 'cp',i.geom.contactPoint,'mat',b1.mat,'normal',i.geom.normal,'width',w
# write to file instead of print possible
# extract whatever you want from the interaction i
###

cheers
Jan

[1]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM.recordCracks
[2]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM.Key
[3]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM.neverErase


2016-07-28 0:43 GMT+02:00 James X :

> Question #305894 on Yade changed:
> https://answers.launchpad.net/yade/+question/305894
>
> James X posted a new comment:
> Hi Jan,
>
> Thank you very much. I have included a simplified version of what I am
> trying to do.  It is currently a pseudo-2D simulation, though I would
> ideally like to be able to handle both 3D and 2D. What I would hope for
> is to be able to export, at any user-defined timestep, the fracture
> event coordinates, the coordinates of the element pair that broke, and
> the material of the two elements.
>
> However, having just the coordinates of the fracture event themselves
> itself would be great.
>
> Just as a FYI, the first half is just a 2D gravity-settling script to
> generate a 2D mesh. While I would like to do 3D simulations, the
> limitations of my experimental data does not allow me to go 3D at the
> moment.
>
>
> import numpy as np
> import time
>
> from yade import pack
> from yade import geom
> from yade import polyhedra_utils
> from yade import utils
> from yade import linterpolation
> from yade import export
> from yade import ymport
>
> #other random parameters
> start = time.time()
>
> #this function just makes a 2D sphere mesh and exports it as
> .sphere
> def Make_Packed_file(filename, xSize, ySize, radius, rRelFuzz_value,
> nbIter=3000):
> #filename = filename #output a msh file
> sp=pack.SpherePack()
>
> sp.makeCloud(minCorner=(0,0,0),maxCorner=(xSize,ySize*2.5,0),rMean=radius,
> rRelFuzz = 0)
> sp.toSimulation()
> for b in O.bodies:
> b.state.blockedDOFs = 'zXY'
>
> box=O.bodies.append(utils.geom.facetBox((xSize/2,1.25*ySize,0),(xSize/2,1.25*ySize,radius),wallMask=63))
> # the same box of makeCloud
>
> O.engines=[
> ForceResetter(),
>
> InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
> InteractionLoop(
>
> [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
> [Ip2_FrictMat_FrictMat_FrictPhys()],
> [Law2_ScGeom_FrictPhys_CundallStrack()]
> ),
> NewtonIntegrator(gravity=(0,-2.0,0),damping=.1),
> PyRunner(iterPeriod=500,initRun=False,command='print("elapsed time
> is: " + str(time.time() - start) ) '),
>
> DomainLimiter(lo=(-0.01,-0.01,-0.01),hi=(xSize,ySize,1.1*radius),iterPeriod=nbIter-1)
> ]
> O.dt=utils.PWaveTimeStep()
> O.stopAtIter=nbIter
> O.run()
> O.wait()
> export.text(filename+'.spheres')
>
>
> ###random parameters
> radius = 3
> smoothContact=True
> jointFrict=radians(20)
> jointDil=radians(0)
> new_scale = 1.0
> xSize = 250;
> ySize = 150;
> rRelFuzz_value = 0;
>
> #actually make this packed mesh
> Make_Packed_file("simplified_packed_2D_mesh", xSize, ySize, radius,
> rRelFuzz_value)
>
> O.reset() #reset everything, just in case
>
>
> #defin the material
> def mat_1(): return
> JCFpmMat(type=1,young=30.0e9,poisson=0.3,frictionAngle=radians(30),density=3000,tensileStrength=1.23e8,cohesion=1.23e8,jointNormalStiffness=1e7,jointShearStiffness=1e7,jointCohesion=1e6,jointFrictionAngle=radians(20),jointDilationAngle=0.0)
>
>
> O.materials.append((mat_1()))
>
> #import the mesh created in the previous simulation
> import_spheres =
> ymport.text("simplified_packed_2D_mesh.spheres",scale=new_scale,shift=Vector3(0,0,0),material=mat_1)
> O.bodies.append(import_spheres)
>
>
> #add in wall information, from uniax.py
> young = 90e9
> mn,mx=Vector3(0,0,0),Vector3(xSize*new_scale,1

Re: [Yade-users] [Question #297855]: AttributeError: 'module' object has no attribute 'inGtsSurface'

2016-07-28 Thread Colin Bannister
Question #297855 on Yade changed:
https://answers.launchpad.net/yade/+question/297855

Colin Bannister posted a new comment:
I am not sure what you mean by 'cmake-step':

$ cmake-step
-bash: cmake-step: command not found

Contents of CMakeCache.txt:

# This is the CMakeCache file.
# For build in directory: 
/panfs/panasas01.panfs.cluster/cczcb/builds/yade/yade-build
# It was generated by CMake: /cm/shared/apps/cmake/2.8.12.2/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.


# EXTERNAL cache entries


//Path to a library.
AMD_LIBRARY:FILEPATH=AMD_LIBRARY-NOTFOUND

//Path to a file.
BZIP2_INCLUDE_DIR:PATH=/usr/include

//Path to a library.
BZIP2_LIBRARY_DEBUG:FILEPATH=BZIP2_LIBRARY_DEBUG-NOTFOUND

//Path to a library.
BZIP2_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libbz2.so

//Boost date_time library (debug)
Boost_DATE_TIME_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_date_time.so

//Boost date_time library (release)
Boost_DATE_TIME_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_date_time.so

//The directory containing a CMake configuration file for Boost.
Boost_DIR:PATH=Boost_DIR-NOTFOUND

//Boost filesystem library (debug)
Boost_FILESYSTEM_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_filesystem.so

//Boost filesystem library (release)
Boost_FILESYSTEM_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_filesystem.so

//Path to a file.
Boost_INCLUDE_DIR:PATH=/cm/shared/apps/boost_1_61_0/gcc/include

//Boost iostreams library (debug)
Boost_IOSTREAMS_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_iostreams.so

//Boost iostreams library (release)
Boost_IOSTREAMS_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_iostreams.so

//Boost library directory
Boost_LIBRARY_DIR:PATH=/cm/shared/apps/boost_1_61_0/gcc/lib

//Boost python library (debug)
Boost_PYTHON_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_python.so

//Boost python library (release)
Boost_PYTHON_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_python.so

//Boost regex library (debug)
Boost_REGEX_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_regex.so

//Boost regex library (release)
Boost_REGEX_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_regex.so

//Boost serialization library (debug)
Boost_SERIALIZATION_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_serialization.so

//Boost serialization library (release)
Boost_SERIALIZATION_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_serialization.so

//Boost system library (debug)
Boost_SYSTEM_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_system.so

//Boost system library (release)
Boost_SYSTEM_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_system.so

//Boost thread library (debug)
Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_thread.so

//Boost thread library (release)
Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/cm/shared/apps/boost_1_61_0/gcc/lib/libboost_thread.so

//Path to a library.
CAMD_LIBRARY:FILEPATH=CAMD_LIBRARY-NOTFOUND

//Path to a library.
CCOLAMD_LIBRARY:FILEPATH=CCOLAMD_LIBRARY-NOTFOUND

//Path to a file.
CGAL_INCLUDE_DIR:PATH=CGAL_INCLUDE_DIR-NOTFOUND

//Path to a library.
CGAL_LIBRARIES:FILEPATH=CGAL_LIBRARIES-NOTFOUND

//Path to a file.
CHOLMOD_INCLUDE_DIR:PATH=CHOLMOD_INCLUDE_DIR-NOTFOUND

//Path to a library.
CHOLMOD_LIBRARIES:FILEPATH=CHOLMOD_LIBRARIES-NOTFOUND

//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar

//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=

//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON

//CXX compiler.
CMAKE_CXX_COMPILER:FILEPATH=/cm/shared/apps/gcc/5.2.0/bin/c++

//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=

//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g

//Flags used by the compiler during release minsize builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the compiler during Release with Debug Info builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//C compiler.
CMAKE_C_COMPILER:FILEPA

Re: [Yade-users] [Question #297855]: AttributeError: 'module' object has no attribute 'inGtsSurface'

2016-07-28 Thread Jérôme Duriez
Question #297855 on Yade changed:
https://answers.launchpad.net/yade/+question/297855

Jérôme Duriez posted a new comment:
To compile yade from sources, you have to run (before make install) some 
"cmake" command with attributes, see the first lines of 
https://yade-dem.org/doc/installation.html#compilation
Which will give you some output in the terminal

This is what "cmake-step" is ! ;-)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #297855]: AttributeError: 'module' object has no attribute 'inGtsSurface'

2016-07-28 Thread Colin Bannister
Question #297855 on Yade changed:
https://answers.launchpad.net/yade/+question/297855

Colin Bannister posted a new comment:
OK - obviously I did that before the make!

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #297855]: AttributeError: 'module' object has no attribute 'inGtsSurface'

2016-07-28 Thread Colin Bannister
Question #297855 on Yade changed:
https://answers.launchpad.net/yade/+question/297855

Colin Bannister posted a new comment:
To be clear, I actually used ccmake to add the options - I set

CMAKE_CXX_COMPILER /cm/shared/apps/gcc/5.2.0/bin/c++
CMAKE_C_COMPILER /cm/shared/apps/gcc/5.2.0/bin/gcc
EIGEN_INCLUDE_DIR /cm/shared/apps/eigen-3.2.8/include
PYTHON_INCLUDE_DIR /cm/shared/apps/python/2.7.12/include/python2.7
PYTHON_LIBRARY /cm/shared/apps/python/2.7.12/lib/libpython2.7.so
LOKI_INCLUDE_DIR /cm/shared/apps/loki-0.1.7/gcc/include
LOKI_LIBRARY /cm/shared/apps/loki-0.1.7/gcc/lib
GTS_CONFIG /cm/shared/apps/gts-0.7.6/gcc/bin/gts-config

also set ENABLE_GUI to OFF, and set install directory
(CMAKE_INSTALL_PREFIX)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #305894]: track coordinates and size of bond fractures ?

2016-07-28 Thread James X
Question #305894 on Yade changed:
https://answers.launchpad.net/yade/+question/305894

Status: Answered => Solved

James X confirmed that the question is solved:
Thanks! Option 1 is probably good enough for me now.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp