InteractionVectorFieldSaver

Asked by Michele Griffa

Hello

I've got a few questions and some considerations to share with everybody.

This post is partly related to two other threads, #82823 ("How to create a fieldsaver to store contact forces among particles") and #91547 (" "Force Chains" tool "), the latter by myself.

The context: I've got a model system made of two mainly groups of particles: bonded and not bonded particles.
Beyond the interaction with walls, the particles are subject to either one of two Interaction types: bonded = NRotBondPrms and friction = RotFrictionPrms.

I want to use the InteractionVectorFieldSaverPrms class with parameters interactionName = "friction" and fieldName = "force" in order to store on file the total, vector, contact force among not-bonded particles in touch with each other.
See thread #82823.

Now the questions:

- what's the output format for the corresponding output file ?

- does that FieldSaver write on file the contact force for each couple of not-bonded particles in touch with each other without providing information about the IDs or positions of the two particles in touch ?

- does each line of the FieldSaver's output file refers to a single time step ?

That FieldSaver is useful for plotting the probability density function of contact forces, eventually at each time step, if each line of the output file refers to a single time step.

Now, the connection of this thread with threads #82823 and #91547:

if that FieldSaver associated to each contact force the positions of the two particles in contact with each other and experiencing that force, then it would be easy to visualize the force spatial distribution using the traditional scheme (line connecting the centers of the two particles with thickness proportional to the norm of the force, although that direction is not the actual one for the force itself).

I guess it's not possible (or at least a lot less easy) to produce such spatial visualization starting from the CheckPointer output files because a CheckPointer writes down the total (net) force acting on the particle, which may include the contribution of an interaction with a wall and a body force.

Thanks for your support and attention

Best regards

Michele

Question information

Language:
English Edit question
Status:
Answered
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
ceguo (hhh-guo) said :
#1

Hi Michele,

As I use this InteractionVectorFieldSaver, I only add unbonded particles, and the outputfile format is like:

particle 1's position x,y,z,radius
particle 2's position x,y,z,radius
contact point's position x,y,z
contact force's components in x,y,z
so in each line there are 14 numbers. Attention should be made that it seems when I use rotational particles the recorded force is applied on particle 1; while using non-rotational particles the recorded force is applied on particle 2. Weird!

These data can help you extract normal and tangential forces. Also a lot of particle pairs are recorded while there is no contact forces between them due to neighbor particle detecting algorithm. Maybe I guess.

Revision history for this message
Michele Griffa (michele-griffa) said :
#2

Hi Ning

>As I use this InteractionVectorFieldSaver, I only add unbonded
>particles

Is your system made of only 2 particles or more than 2 ?
As long as I understand, you've got a sequence of 14 numbers for each couple of particles in contact with each other.
In case of more than 2 particles, do you happen to know if sequences of 14 numbers follow each other, in the same line ? I guess so but I'm not sure.

>Attention should be made that it
>seems when I use rotational particles the recorded force is applied on
>particle 1; while using non-rotational particles the recorded force is
>applied on particle 2. Weird!

Do you mean that the force refers associated to the couple of particle is in one case the one acting on particle 1 and in the other case on particle 2 ?

In the case of plotting spatial distributions of contact forces as force chain pictures, the only details needed are the centers of the two particles in contact with each other
and the module of the contact force acting on them. With the centers of the two particles you can draw the line passing through them. With the module, you can setup the thickness
of the line and/or the color. This is one possibility.
The other possibility, to be more precise, consists in recording only the normal component of the force, choosing the value normal_force for the parameter fieldName of the InteractionVectorFieldSaverPrms class, and
using its module as the value for the thickness and/or color of the line.
In the literature, you find both types of implementations. This to relate to your post "How to create a fieldsaver to store contact forces among particles", where you ask about the possibility of visualizing contact forces
as lines of different thickness and/or colors.

Thanks for your help and for sharing your experience

Best regards

Michele
------------------------------------------------------------------------------------------------------------------------------
Michele Griffa, Ph.D.
EMPA, Swiss Federal Laboratories for Materials Testing and Research (ETH Domain)

Überlandstrasse 129
8600, Dübendorf, Switzerland

Ph.: +41 (0) 44 823 4789
Fax: +41 (0) 44 823 4009
email: <email address hidden>
Web site: http://www.empa.ch

Personal web site: http://www.calcolodistr.altervista.org/en/index_en.html
-----------------------------------------------------------------------------------------------------------------------------

>-----Original Message-----
>From: <email address hidden> [mailto:<email address hidden>] On Behalf Of
>ceguo
>Sent: Freitag, 4. Dezember 2009 09:24
>To: Griffa, Michele
>Subject: Re: [Question #92702]: InteractionVectorFieldSaver
>
>Your question #92702 on ESyS-Particle changed:
>https://answers.launchpad.net/esys-particle/+question/92702
>
> Status: Open => Answered
>
>ceguo proposed the following answer:
>Hi Michele,
>
>As I use this InteractionVectorFieldSaver, I only add unbonded
>particles, and the outputfile format is like:
>
>particle 1's position x,y,z,radius
>particle 2's position x,y,z,radius
>contact point's position x,y,z
>contact force's components in x,y,z
>so in each line there are 14 numbers. Attention should be made that it
>seems when I use rotational particles the recorded force is applied on
>particle 1; while using non-rotational particles the recorded force is
>applied on particle 2. Weird!
>
>These data can help you extract normal and tangential forces. Also a lot
>of particle pairs are recorded while there is no contact forces between
>them due to neighbor particle detecting algorithm. Maybe I guess.
>
>--
>If this answers your question, please go to the following page to let us
>know that it is solved:
>https://answers.launchpad.net/esys-
>particle/+question/92702/+confirm?answer_id=0
>
>If you still need help, you can reply to this email or go to the
>following page to enter your feedback:
>https://answers.launchpad.net/esys-particle/+question/92702
>
>You received this question notification because you are a direct
>subscriber of the question.

Revision history for this message
Dion Weatherley (d-weatherley) said :
#3

Hi Michele,

I've not used InteractionVectorFieldSaverPrms for production simulations yet but I just did a little test. I added the following code to the tutorial's hopper_flow.py, just before creating the CheckPointer:

sim.createFieldSaver (
   InteractionVectorFieldSaverPrms (
      interactionName="friction",
      fieldName="force",
      fileName="force_data",
      fileFormat="RAW2",
      beginTimeStep=0,
      endTimeStep=100000,
      timeStepIncr=1
   )
)

When I run the simulation, I get a bunch of output files with names like:
force_data.0.dat
force_data.1.dat
force_data.2.dat
[etc]

Each of these files contains information (as explained by Ning above) on the positions of particle-pairs and the force acting between them...one particle-pair per line. The different files refer to different timesteps i.e. force_data.0.dat is for timestep 0, force_data.1.dat is for timestep 1 etc.

You will need to experiment a bit to figure out exactly what each field means and will have to write your own post-processing tool to create images of force-chains, but these FieldSaver files should contain all the information you need.

Cheers,

Dion.

Revision history for this message
ceguo (hhh-guo) said :
#4

Hi Michele,

May I elaborate my answer.
1. I use tens thousands of particles in my simulation but they are not bonded together, which means no tensile force exists in my simulation, nor bending and tirsion.
2. In the output file

Revision history for this message
ceguo (hhh-guo) said :
#5

2 In the output file(force_data.Num.dat), each line represents a contact, and the sequence is what I just mentioned in last post.
But the forces are imposed in the 1st particle if you use rotational and 2nd particle if you use non-rotational;

3 When I ask this question, I need this data to calculate stress tensor as well as fabric tensor, if you know this terminology. But I also plotted the force chain using post-processing tool (povray). As the position of the contacting particles are given and contact forces, you can calculate the contact normal vector and normal force. Then link the two particles with a line whose width is proportional to the magnitude of normal force. This is what I did!

Cheers.
Ning

Revision history for this message
Jessica (jescarish) said :
#6

hello!!

Just wanted to ask if there is a way to save the velocity data (like e_kin) alone other than using checkpointer? Because I find it a bit inconvenient to plot the data with lots of outputs (i.e. flow_chkpt_00.dat) especially that I had a very large time-step. It would eventually take me a month to finish plotting it. Also, I wanted to know what are the sigma_xx_2d, sigma_xy_2d, etc represents. And lastly, What's the difference between the scalar and vector Fieldsaver?

Hope to get an idea about all of it.

Thanks!!

Jessica

Revision history for this message
Michele Griffa (michele-griffa) said :
#7

Hi Jessica

I wrote by myself a Runnable that records on file, at each recording time step, only certain observables related to a specific subgroup of particles.
For example, the observables are radius, position and linear velocity of each particle tagged with a certain label.
You can find the code of this Runnable and how it is invoked in thread #98741 (mySim.getParticleList(…) used in a Runnable).
The Runnable is called CheckPointerSelectedID(…).
You'd need to modify it such that it records the observables for all the particles and not just a set of them.
Or you can pass to it a "particleList" argument = globalParticleList, where globalParticleList = mySim.getParticleList().

Similarly, you can write any other type of Runnable saving just the particle information you need.

Hope this helps

Michele
------------------------------------------------------------------------------------------------------------------------------
Michele Griffa, Ph.D.
EMPA, Swiss Federal Laboratories for Materials Testing and Research (ETH Domain)

Überlandstrasse 129
8600, Dübendorf, Switzerland

Ph.: +41 (0) 44 823 4789
Fax: +41 (0) 44 823 4009
email: <email address hidden>
Web site: http://www.empa.ch

Personal web site: http://www.calcolodistr.altervista.org/en/index_en.html
-----------------------------------------------------------------------------------------------------------------------------

>-----Original Message-----
>From: <email address hidden> [mailto:<email address hidden>] On Behalf Of
>Jessica
>Sent: Freitag, 29. Januar 2010 07:41
>To: Griffa, Michele
>Subject: RE: [Question #92702]: InteractionVectorFieldSaver
>
>Your question #92702 on ESyS-Particle changed:
>https://answers.launchpad.net/esys-particle/+question/92702
>
>Jessica posted a new comment:
>hello!!
>
>Just wanted to ask if there is a way to save the velocity data (like
>e_kin) alone other than using checkpointer? Because I find it a bit
>inconvenient to plot the data with lots of outputs (i.e.
>flow_chkpt_00.dat) especially that I had a very large time-step. It
>would eventually take me a month to finish plotting it. Also, I wanted
>to know what are the sigma_xx_2d, sigma_xy_2d, etc represents. And
>lastly, What's the difference between the scalar and vector Fieldsaver?
>
>Hope to get an idea about all of it.
>
>Thanks!!
>
>Jessica
>
>--
>You received this question notification because you are a direct
>subscriber of the question.

Revision history for this message
Dion Weatherley (d-weatherley) said :
#8

Hi Jessica,

> if there is a way to save the velocity data (like e_kin) alone
> other than using checkpointer?

Yes, there is a ParticleVectorFieldSaver you can use to output just the velocities of all the particles. The script fragment would look something like this:

sim.createFieldSaver (
   ParticleVectorFieldSaverPrms (
      fieldName="velocity",
      fileName="velocity_data",
      fileFormat="RAW_SERIES",
      beginTimeStep=0,
      endTimeStep=100000,
      timeStepIncr=1
   )
)

> I wanted to know what are the sigma_xx_2d, sigma_xy_2d, etc represents?

These two fields will output per-particle stresses, assuming plane strain I think. You should be a bit careful interpretting these stress values in 3D models though.

> What's the difference between the scalar and vector Fieldsaver?

ScalarFieldSavers store data that are scalars (i.e. only a single number like kinetic energy, mass, density) whereas VectorFieldSavers store vector data (like velocity, force, displacement) where each datapoint is comprised of three vector components.

Cheers,

Dion.

Revision history for this message
Jessica (jescarish) said :
#9

Thanks sir Dion!!

I have another question to raise. I observe that there are two types of file format (i.e. RAW_SERIES and SUM as what I have encountered). I don't know if there are other file types existed but I wanted to know what these file types means?

 Thank you so much for the attention!!!

Jessica

Revision history for this message
Dion Weatherley (d-weatherley) said :
#10

Hi Jessica,

There are quite a few different file types available depending on which type of FieldSaver you wish to use. Unfortunately, we currently do not have any documentation on all the formats available and which FieldSavers use which format. The only way to find out is to hunt around in the source code. The most common formats are actually SUM and RAW_SERIES so explaining these here is a good idea. Thanks for the question!

First a bit of background about FieldSavers: These are used to output specific data during simulations (instead of "everything" like the checkpointer). One can choose what data (known as a field) to output and the format with which to output that data.

Let's take kinetic energy as an example. ESyS-Particle can compute the kinetic energy of each particle every timestep (=0.5 m v^2). If we would like to plot or visualise changes in kinetic energy, there are two ways we can output the kinetic energy in a ParticleScalarFieldSaver:

1) we can output the kinetic energy of each individual particle into a large file allowing us to examine how kinetic energy changes in different parts of the model. This is done using the RAW_SERIES format. The output files contain lists of particle positions and their individual kinetic energies.

2) we can also just output the total kinetic energy of the model (the sum of the kinetic energies of each individual particle). For kinetic energy, we are mostly just interested in the total, not that of individual particles. The SUM file format will create only a single file with a list of single numbers representing the total kinetic energy at different times during a simulation.

Some of the FieldSavers also accept the MAX or MIN format. As the names suggest, these will output just the maximum or minimum particle kinetic energy each timestep. The output file format will be very similar to that for the SUM format.

There are often also other formats in which fields may be output such as POVray format or openDX format. These two formats are legacies of by-gone eras and I urge caution if you use them.

I hope this helps. Have fun!

Dion.

Revision history for this message
Jessica (jescarish) said :
#11

Thanks Sir Dion!! That's a lot of information!! Well I guess I now know which type of file I will appropriately use in saving data. Thank you very much again!!

Revision history for this message
Jessica (jescarish) said :
#12

Hello again!!!

Just asking what are the 3 column represents in using velocity fieldsaver. The file type I used is SUM. I just got confused because I got these negative numbers.

0 -102768 0
0 -200524 0
0 -293513 0
0 -381967 0
3.9617 -466099 1.92409
5.78575 -545929 90.724
0.242269 -621794 200.076
14.7877 -694009 245.336
6.1427 -762550 360.247
-19.4295 -827663 455.432

Thanks!!!

Jessica

Revision history for this message
Anton Gladky (gladky-anton) said :
#13

Hi Jessica,

that is, probably, 3 components of velocity sum: Vector3(x,y,z).
Large numbers can be because of system instability. Try to decrease dt.
______________________________

Anton Gladkyy

2010/2/14 Jessica <email address hidden>

> Question #92702 on ESyS-Particle changed:
> https://answers.launchpad.net/esys-particle/+question/92702
>
> Jessica posted a new comment:
> Hello again!!!
>
> Just asking what are the 3 column represents in using velocity
> fieldsaver. The file type I used is SUM. I just got confused because I
> got these negative numbers.
>
> 0 -102768 0
> 0 -200524 0
> 0 -293513 0
> 0 -381967 0
> 3.9617 -466099 1.92409
> 5.78575 -545929 90.724
> 0.242269 -621794 200.076
> 14.7877 -694009 245.336
> 6.1427 -762550 360.247
> -19.4295 -827663 455.432
>
> Thanks!!!
>
> Jessica
>
> --
> You received this question notification because you are an answer
> contact for ESyS-Particle.
>

Can you help with this problem?

Provide an answer of your own, or ask Michele Griffa for more information if necessary.

To post a message you must log in.