← Back to team overview

yade-users team mailing list archive

Re: [Question #701519]: Import packing text file into yade

 

Question #701519 on Yade changed:
https://answers.launchpad.net/yade/+question/701519

    Status: Answered => Open

Soheil Safari is still having a problem:
Dear Jan,

Thank you very much for your kind reply and valuable information.

It was very helpful. I am using Yade 2020.01a.

Also yade I am using, export.text saves files with tabs.

I tried to use the text file without any modification and it works.

I do not know if I can continue my issue here or not.

Because when I ran the code I faced with this error:

TCP python prompt on localhost:9000, auth cookie `sauyce'
XMLRPC info provider on http://localhost:21000
Running script 1.py
Traceback (most recent call last):
  File "/usr/bin/yade", line 336, in runScript
    execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 87, in execfile
    exec_(code, myglobals, mylocals)
  File "1.py", line 50, in <module>
    flow.initialization()
RuntimeError: CGAL ERROR: assertion violation!
Expr: dexp != 2047
File: /usr/include/CGAL/Mpzf.h
Line: 404
Explanation: Creating an Mpzf from infinity or NaN.


Here is my text file data:

#format x_y_z_r
0.108316	0.446354	0.405371	0.1
0.385925	0.584268	0.404164	0.1
0.266271	0.335278	0.779746	0.1
0.699993	0.718399	0.539943	0.1
0.7529       	0.251866	0.260316	0.1
0.101752	0.643533	0.110886	0.1
0.264525	0.734255	0.782473	0.1
0.64595	0.895112	0.332408	0.1
0.24546	0.224601	0.578429	0.1
0.813695	0.529448	0.739774	0.1
0.453208	0.792714	0.68934	0.1
0.142558	0.824175	0.308345	0.1
0.816278	0.497335	0.212273	0.1
0.649266	0.288894	0.899394	0.1
0.76397	0.242682	0.488743	0.1
0.233775	0.102176	0.419037	0.1
0.433978	0.848117	0.162744	0.1
0.770714	0.712419	0.107076	0.1
0.412006	0.591829	0.201775	0.1
0.176013	0.844046	0.561313	0.1
0.370268	0.86723	0.898086	0.1
0.593966	0.593603	0.327687	0.1
0.611039	0.531407	0.533922	0.1
0.476597	0.252552	0.669018	0.1
0.692468	0.802018	0.750006	0.1
0.507422	0.174782	0.476912	0.1
0.508109	0.148976	0.178023	0.1
0.837158	0.180356	0.813804	0.1
0.169296	0.514047	0.855917	0.1
0.893444	0.876796	0.862966	0.1
0.332611	0.110006	0.80685	0.1
0.566253	0.468939	0.750964	0.1
0.899925	0.42476	0.899659	0.1
0.874242	0.700281	0.351331	0.1
0.176129	0.573342	0.659617	0.1
0.285587	0.328712	0.37919	0.1
0.184362	0.60361	0.29202	0.1
0.33723	0.326092	0.136975	0.1
0.184264	0.170793	0.126237	0.1
0.612765	0.487743	0.120558	0.1
0.892392	0.315699	0.108565	0.1
0.233077	0.855653	0.118868	0.1
0.892404	0.438759	0.546704	0.1
0.593431	0.636812	0.893386	0.1
0.863798	0.121867	0.149614	0.1
0.341464	0.833798	0.348334	0.1
0.543872	0.118359	0.835191	0.1
0.876932	0.899792	0.55643	0.1
0.89683	0.104328	0.57049	0.1
0.385368	0.483966	0.599477	0.1
0.899303	0.87534	0.115881	0.1
0.499021	0.323427	0.306233	0.1
0.635067	0.129761	0.647935	0.1
0.401005	0.472595	0.874597	0.1
0.140286	0.149974	0.899759	0.1


and I used this code:

import os
import numpy as np
import pandas as pd
from yade import pack, ymport
from yade import utils, plot, timing
from yade import export

young=1.e6
compFricDegree = 3 # initial contact friction during the confining phase
finalFricDegree = 30 # contact friction during the deviatoric loading
mn,mx=Vector3(0,0,0),Vector3(2,2,2) # corners of the initial packing
graindensity=2600
errors=0
toleranceWarning =1.e-11
toleranceCritical=1.e-6

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=graindensity,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
 
ymport.text('final.txt', shift=Vector3(0, 0, 0), scale=1.0)

O.engines = [
  TwoPhaseFlowEngine(dead=0,label="flow"),
]

press=1000.

flow.dead=0
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=0.1

flow.bndCondIsWaterReservoir=[0,0,1,0,0,0]

flow.bndCondIsPressure=[0,0,1,0,0,0]
flow.bndCondValue=[0,0,press,0,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]
flow.iniVoidVolumes=True

flow.surfaceTension = 0.0
flow.drainageFirst=False
flow.isDrainageActivated=False
flow.isImbibitionActivated=True
flow.isCellLabelActivated=True
flow.initialization()
cs=flow.getClusters()
c0=cs[1]

#flow.getCellVoidVolume(4)
#flow.getCellInSphereRadius(100)
flow.savePoreNetwork() #extract info about the pore

Many thanks in advance.

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