# Sign convention for incremental shear displacement(Scalar/ Magnitude)

Hi all,

I would like to obtain the incremental shear displacement magnitude with its sign in YADE.

For an example ;

normal displacement case, we have penetration depth, when penetration depth is positive we consider two particles are in compression and if it has negative penetration depth we consider it as in tension.(According to ElasticContactL

If I want to get the incremental normal displacement because of this positive and negative penetration depth, sign convention for this already embeded . (see below code in c++)

-------

initially we will assign value zero for History_un

//shorthands

Real& History_

-------

Real previous_

Real un= geom->penetrati

History_un=un; // update the history varible to current displacement

Real delta_un= un-previous_un; // incremental normal displacement for previous to current step

-------

when two particles are in compression delta_un is positive and if they are in tension, delta_un is negative.

I want to get the similar thing for shear as well.

For shear in yade its a incremental form and its a vector. but I would like to get the magitude of the shear displacment with its sign. for example, in 2D case.:when two particles rotates clockwise consider the sign as postive and if it rotates counterclockwise consider sign as negative.

Now problem is 3D. what should I do for 3d case?

what I did up to now was as follows in .cpp,

initially we will assign value zero for History_us and shear displacement vector to zero vector.

//shorthands

Real& History_

Vector3r& Us(phys->Us);

-------

Real previous_

geom->rotate( Us);

Us += geom->shearIncr

Real Current_

History_us= Us.norm(); // update history shear displacement value to current value

Real delta_us=

-------

The problem is if I consider the incremental shear displacement in this way, it cannot address the loading unloading behaviour in shear. because delta_us is always positive when two particles are in loading or unloading in shear due to norm of any vector is positive.

Therefore, I would like to get the sign (positive or negative) for shear as well with the magnitude of shear incremental displacement like I did in normal displacement.

Could any one suggest a method to address this issue?

Your help is highly appreciated.

Thanks

Chanaka

## Question information

- Language:
- English Edit question

- Status:
- Solved

- For:
- Yade Edit question

- Assignee:
- No assignee Edit question

- Solved by:
- Jan Stránský

- Solved:
- 2019-11-07

- Last query:
- 2019-11-07

- Last reply:
- 2019-11-06

Jan Stránský (honzik) said : | #1 |

Hi Chanaka,

it all depends on how you define sign for a 3d vector (as you noticed, it is somehow artificial).

One way is to dot-product the vector with a unit "plus minus vector", e.g. a unit x vector (1,0,0)

delta_us_scalar = delta_us.

cheers

Jan

chanaka Udaya (chanaka-udaya) said : | #2 |

Thanks Jan Stránský, that solved my question.