← Back to team overview

yade-users team mailing list archive

Re: [Question #669990]: error using saveVtk() to get tesselation geometry

 

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

    Status: Answered => Open

rhaven is still having a problem:
Hi,
loading the vtk file in paraview I see a convex mesh. I dont see how to see the triangulated mesh. http://pasteall.org/pic/5aaceafb92ef561b8d5e30c463caac59, the vtk file ive pasted here http://pasteall.org/1008402/text

I've made another MWE where I load clump0.txt reset the scene and use O.bodies.append(sphere(pos,r)) to add the spheres individually. 
(I also dont see anything wrong when I look at the spheres in the 3d viewport. )

When I run the twophaseflowengine I print the cell id and pore size when TwoPhaseFlowEngine::computePoreBodyRadius() runs (I modified the source code of TwoPhaseFlowEngine.cpp):
cout << endl << "Test3 Cell: " << cell->info().id << ": Pore: " << Rin; 

The output is a long list of pores all the same size ending with ***
stack smashing detected ***: /usr/bin/python terminated

.........
Test3 Cell: 914: Pore: 4.92e-10
Test3 Cell: 915: Pore: 4.92e-10
Test3 Cell: 916: Pore: 4.92e-10
Test3 Cell: 917: Pore: 4.92e-10
Test3 Cell: 918: Pore: 4.92e-10
Test3 Cell: 919: Pore: 4.92e-10
Test3 Cell: 920: Pore: 4.92e-10negative volume for an ordinary pore (temp warning, should still be safe)
negative volume for an ordinary pore (temp warning, should still be safe)
negative volume for an ordinary pore (temp warning, should still be safe)
*** stack smashing detected ***: /usr/bin/python terminated
Aborted (core dumped)


When I try to run saveVtk the error is as follows. 

......
148 : Vh==NULL!! id=148 Point=7.42392e-07 6.92963e-07 8.02883e-07 rad=1.23e-08
149 : Vh==NULL!! id=149 Point=8.03578e-07 7.18035e-07 8.15755e-07 rad=1.23e-08
150 : Vh==NULL!! id=150 Point=7.43404e-07 7.82494e-07 7.64931e-07 rad=1.23e-08
151 : Vh==NULL!! id=151 Point=6.77428e-07 7.66925e-07 7.91695e-07 rad=1.23e-08
CHOLMOD error: invalid xtype
CHOLMOD error: argument missing
Segmentation fault (core dumped)


clump0.txt I have pasted here: https://pastebin.com/WY703ZLs


def tryvtk():
	O.engines = [
	   ForceResetter(),
	   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
	   #InteractionLoop(
		  #[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], ##triax only
		#  [Ig2_Sphere_Sphere_ScGeom()],
		#  [Ip2_FrictMat_FrictMat_FrictPhys()],
		#  [Law2_ScGeom_FrictPhys_CundallStrack()]
	   #),
	   FlowEngine(dead=1,label="flow"),#introduced as a dead engine for the moment, see 2nd section
	   GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
	   #PeriTriaxController(dynCell=True,mass=0.2,maxUnbalanced=0.01,relStressTol=0.02,goal=(-1e6,-1e6,-1e6),stressMask=3,globUpdate=5,maxStrainRate=(1e10,1e10,1e10),doneHook='triaxDone()',label='compressor'),
	   #NewtonIntegrator(damping=.6), ##Triaxonly
	   NewtonIntegrator(damping=.2),
	]
	factor = .5
	O.dt = factor * PWaveTimeStep()
	flow.dead=0
	flow.defTolerance=0.3
	flow.meshUpdateInterval=200
	flow.useSolver=3
	flow.permeabilityFactor=1
	flow.viscosity=10
	flow.bndCondIsPressure=[0,0,1,1,0,0]
	flow.bndCondValue=[0,0,1,0,0,0]
	flow.boundaryUseMaxMin=[0,0,0,0,0,0]
	O.dt=0.1e-3
	O.dynDt=False
	flow.emulateAction()
	flow.saveVtk()
	raw_input('FlowEngine saveVtk END')

def main():

	from yade import export,ymport
	import random
	random.seed(1)
	

	dim = Vector3(2e-6,2e-6,2e-6)
	

	O.materials.append(FrictMat(density=1e6,frictionAngle=0))
	O.periodic=True
	O.cell.setBox(1e-6,1e-6,1e-6)
	
	attrs = []
	
	
	#sp = ymport.textExt('/tmp/clump0.txt',format='x_y_z_r_attrs',attrs=attrs)
	sp = ymport.textClumps('/tmp/clump0.txt')

	spheres = []
	for b in O.bodies:
		if b.isClump == False:
			spheres.append([b.state.pos, b.shape.radius])
	
	raw_input('Pause1')
	
	O.resetThisScene() #####!!!!!!!	
	
	raw_input('Pause1.1')
	for pos,r in spheres:
		O.bodies.append(sphere(pos,r))
		#print(pos,r)
	raw_input('Pause1.2')
	#quit()
	
	TwoPhase=TwoPhaseFlowEngine()
	TwoPhase.initialization()
	
	raw_input('Pause2')
	
	tryvtk()
	
	raw_input('Pause3')
	#quit()

	
	
	print('Number of particles = ' , len(O.bodies))
	print('Total particles inc. periodic', len(O.bodies))


	try:
		from yade import qt
		qt.View()
	except:
		pass
	
	

	
if __name__=="__main__":
	main()

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