← Back to team overview

yade-users team mailing list archive

Re: [Question #677876]: FrictPhys disable in contact

 

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

    Status: Needs information => Open

Pawel gave more information on the question:
Hi Jan,
thank you for your message

in c++ i have function VppSaveInteractions with code 
FOREACH(const shared_ptr<Interaction>& I, *scene->interactions){
				if(I)
					{
					const shared_ptr<Body>& b1 = Body::byId(I->getId1(),scene);
					const shared_ptr<Body>& b2 = Body::byId(I->getId2(),scene);
					
					
					State* st1 = static_cast<State*>(b1->state.get());
					State* st2 = static_cast<State*>(b2->state.get());
					
					FrictPhys* physFP = dynamic_cast<FrictPhys*>(I->phys.get());
					cout << "phys "<< physFP;
}
It is only a part of longer code but here i need to gest phys becouse I want to save normal and shear force from connection.
 the pointer physe is 0

here is the python script

# basic simulation showing sphere falling ball gravity,
# bouncing against another sphere representing the support
os.environ['OMP_NUM_THREADS']='8'
import math
import random
# DATA COMPONENTS



promien_k = 0.0002 
promien_f = 0.00015/2 
young_k = 1e9 
poisson_k = 0.25
density_k = 1040

frictAngle = atan(0.6)


O.materials.append(FrictMat(young=young_k, poisson=poisson_k, density=density_k, frictionAngle=atan(0.3), label='kula'))



O.bodies.append([
		utils.sphere(center=(0,0,0),radius=promien_k,fixed=True,material='kula')
		],)
O.bodies.append([
		utils.sphere(center=(0.2*promien_k,0,2*promien_k),radius=promien_k,fixed=False,material='kula')
		],)


O.dt=utils.PWaveTimeStep()


#########################################
nazwaPliku = "wyniki/kule"
nazwaPlikuIter = "wyniki/Kule_iter_30z"
############### Parametry zapisu c++ ########
print("DT do zapisu")
step = O.dt
PiterSave = 10 #ile zapisow w pliku
PtimeSr = 3*step
PtimeStart = 0. #start zapisu
PdeltaTime = 0.005 #1000*step #skok miedzy zapisami

TimeStartAll=1000000
DeltaTimeAll=10000
################################
################################
# FUNCTIONAL COMPONENTS

# simulation loop -- see presentation for the explanation
O.engines=[
	VppSaveInteractions(fileName=nazwaPlikuIter, iterSave= PiterSave, timeSr = PtimeSr, timeStart = PtimeStart, deltaTime= PdeltaTime,timeStartAll = TimeStartAll,deltaTimeAll = DeltaTimeAll ),
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.3),
		Ig2_Wall_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom6D()],
		[Ip2_FrictMat_FrictMat_FrictPhys(),
		Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True),
		],
		[Law2_ScGeom_FrictPhys_CundallStrack(),
		]
	),
   # apply gravity force to particles
   GravityEngine(gravity=(0,0,-9.81)),
   # damping: numerical dissipation of energy
   NewtonIntegrator(damping=0.2)
]

# set timestep to a fraction of the critical timestep
# the fraction is very small, so that the simulation is not too fast
# and the motion can be observed


# save the simulation, so that it can be reloaded later, for experimentation
O.saveTmp()
Gl1_Sphere.stripes=True
Gl1_Sphere.quality=1
yade.qt.Controller(), yade.qt.View();

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