Problem about density Scaling

Asked by Henry

Hi all,
   I want to use the desity scaling in a numerical test. The script as follows:

O.engines=[
 ForceResetter(),
     ……
        NewtonIntegrator(damping=0.2, label='Newton'), #damping=0.999
       GlobalStiffnessTimeStepper(label='ts'),
     ……
]

O.timingEnabled=1
timing.reset()
O.dt=.5*utils.PWaveTimeStep()
Newton.densityScaling=True
for b in O.bodies:
    if isinstance(b.shape,Sphere):
        b.state.mass=1.0e10*b.state.mass

However, when the code run after some steps, all the particles have disappeared.

Anyone can help me?
Thanks a lot!

Henry

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Looking at your script fragment, I don't understand what you are trying
to do.
There is an example of use in examples/timeStepperUsage.py.
B

Revision history for this message
Henry (wenjiexu) said :
#2

Many thanks for the reply from Pro. Burno.
I want to simulate a triaxial test of steel spheres. And I write the script according the example file (timeStepperUsage.py). However, the script fails, and all the particles disappear after some steps.
Thanks a lot!

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

>And I write the script according the example

Is that a new script? Because the above is not like in the example.
If it is a new one please show it.

Revision history for this message
Henry (wenjiexu) said :
#4

I modified the "triax.py" file in "example/concrete/", according to the example file of densityscale (timeStepperUsage.py).

The followin script is the modified part:

.....

O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_Sphere_Aabb(aabbEnlargeFactor=enlargeFactor,label='bo1s'),
  Bo1_Facet_Aabb()
 ]),
 InteractionLoop(
  [
   Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=enlargeFactor,label='ss2d3dg'),
   Ig2_Facet_Sphere_ScGeom(),
  ],
  [
   Ip2_CpmMat_CpmMat_CpmPhys(cohesiveThresholdIter=O.iter+5),
   Ip2_FrictMat_CpmMat_FrictPhys(),
   Ip2_FrictMat_FrictMat_FrictPhys(),
  ],
  [
   Law2_ScGeom_CpmPhys_Cpm(),
   Law2_ScGeom_FrictPhys_CundallStrack(),
  ],
 ),
 PyRunner(iterPeriod=1,command="addForces()"),
 NewtonIntegrator(damping=.3,label="newton"),
 CpmStateUpdater(iterPeriod=50,label='cpmStateUpdater'),
 PyRunner(command='plotAddData()',iterPeriod=10),
 PyRunner(iterPeriod=50,command='stopIfDamaged()'),
      GlobalStiffnessTimeStepper(label='ts'),
]

# run one step
O.step()

# reset interaction detection enlargement
bo1s.aabbEnlargeFactor=ss2d3dg.interactionDetectionFactor=1.0

O.timingEnabled=1
ts.active=True
newton.densityScaling=True

#... but not that of cell, hence we have to adjust it or the problem becomes unstable
for b in O.bodies:
    if isinstance(b.shape,Sphere):
        b.state.mass=1.0e20*b.state.mass

# initialize auto-updated plot
if runInGui:
  .........

Thanks a lot!

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

What is that?
> b.state.mass=1.0e20*b.state.mass

You don't find this in the example.

Revision history for this message
Henry (wenjiexu) said :
#6

"
for b in O.bodies:
     if isinstance(b.shape,Sphere):
         b.state.mass=1.0e20*b.state.mass
"
This part is added by myself, to amplify the mass of each particle.
Thanks a lot!

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#7

So?
Removing those lines solved your problem?

Revision history for this message
Launchpad Janitor (janitor) said :
#8

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.