← Back to team overview

yade-users team mailing list archive

[Question #690841]: Damage value from cpm model

 

New question #690841 on Yade:
https://answers.launchpad.net/yade/+question/690841

Dear all,

I would like to obtain the scalar damage value (omega=0-1) from cpm model without using VTK recorder.
Afterthat, I wanted to colour the spheres based on damage value using scalarOnColorScale function. which requres,

yade._utils.scalarOnColorScale((float)x[, (float)xmin=0[, (float)xmax=1]]) → Vector3

Parameters:	

x (float) – scalar value which the function applies to.
xmin (float) – minimum value for the color scale, with a return value of (0,0,1) for x ≤xmin, i.e. blue color in RGB.
xmax (float) – maximum value, with a return value of (1,0,0) for x ≥xmax, i.e. red color in RGB.

Returns:	

a Vector3 depending on the relative position of x on a [xmin;*xmax*] scale.

How can I get this x(float) parameter for this case?

Previously I have added the colour to fully debonded/damaged bonds using following code running inside pyRunner,

def colorspheres():
	for i in O.interactions:
		if hasattr(i.phys, 'isCohesive'):
			if i.phys.isCohesive == 0:
				a=i.id1
				b=i.id2
				O.bodies[a].shape.color = (1,0,0)
				O.bodies[b].shape.color = (1,0,0)

But now I want to color the spheres based on their damage value not only the fully damaged  value

Could you please help me on this?

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