Skip to content

Failure criterion state printed for CDEM#676

Merged
jginternational merged 9 commits intomasterfrom
dem/results-for-cdem
Dec 9, 2019
Merged

Failure criterion state printed for CDEM#676
jginternational merged 9 commits intomasterfrom
dem/results-for-cdem

Conversation

@maceligueta
Copy link
Copy Markdown
Member

Allows printing a new result. But I need a bit of help here: the modification of the spd showing the new field should only work for CDEM, not in the general DEM.

@jginternational
Copy link
Copy Markdown
Member

If you are using in an app a part of the xml or spd defined in another, and you want to change it without the parent app to notice, there are 2 ways:

  • Fully copy: not a valid option for a small change
  • Use the event [APPID]::xml::CustomTree to modify the resulting spd

For your case, change only a public name of a static parameter, the second is better.
In /apps/CDEM/xml/XmlController.tcl locate the proc CDEM::xml::CustomTree and place there something like

spdAux::SetValueOnTreeItem pn "Show bonds" BondElem ContactMeshOption

@maceligueta
Copy link
Copy Markdown
Member Author

Thanks for the explanation @jginternational but how is this
spdAux::SetValueOnTreeItem pn "Show bonds" BondElem ContactMeshOption
capable of adding all this information? ->
<value n="ContactMeshOption" type="bool" values="true,false" v="false" pn="Show bonds" icon="black1" help="Calculate and show the bonds between particles"/>

Actually, I don't want to add that item. In this case, I want the bonds to be visible in all DEM guis. But when I added this piece of tree:
<value n="TypeOfFailure" type="bool" values="true,false" v="false" pn="Type of failure" icon="black1" state="[getStateFromXPathValue {string(../value[@n='ContactMeshOption']/@v)} true]" help="Displays different numbers for different types of failure. 2: tension. 4: shear or combination of stresses. 6: neighbour not found by search. 8: less bonds than minimum"/>
I want it visible only for CDEM.
Is this possible?

@jginternational
Copy link
Copy Markdown
Member

jginternational commented Nov 27, 2019

I beg your pardon. I thought the only difference was the circled part, and I didn't see the underlined
image

To add a value to the spd, this is the code:

    gid_groups_conds::addF [spdAux::getRoute BondElem] value [list n TypeOfFailure pn "Type of failure" v No values {Yes,No} icon "black1" help "Displays different numbers for different types of failure. 2: tension. 4: shear or combination of stresses. 6: neighbour not found by search. 8: less bonds than minimum"]
    spdAux::SetValueOnTreeItem state {[getStateFromXPathValue {string(../value[@n='ContactMeshOption']/@v)} true]} BondElem TypeOfFailure

Note: I've splitted into 2 functions (1 for everything and the other for the 'state') to explain that each parameter can be in it's own call. You can place all the parameters in the gid_groups_conds::addF function

@maceligueta
Copy link
Copy Markdown
Member Author

I pushed some changes, but they were not tested yet. @farrufat-cimne said he will take care of this.

Comment thread kratos.gid/kratos.unix.bat Outdated
# therefore, we use the OLD_LD_LIBRARY_PATH and prepend the path to the kratos libs
if [ "$OLD_LD_LIBRARY_PATH" != "" ]; then
export LD_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs":$OLD_LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$3/exec/Kratos/bin/Release":"$3/exec/Kratos/bin/Release/libs":$OLD_LD_LIBRARY_PATH
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch! That slipped in!! Will remove it immediately

@maceligueta
Copy link
Copy Markdown
Member Author

Thanks for pointing out @jginternational . I think I undid it.

@maceligueta
Copy link
Copy Markdown
Member Author

I recovered the Parallel configuration, which works in my machine. What type of problem was it giving on your pc, @farrufat-cimne ?
I also recovered Gravity, otherwise we can't modify its values. Please @farrufat-cimne confirm I am not making a mistake.

@maceligueta
Copy link
Copy Markdown
Member Author

maceligueta commented Dec 5, 2019

One more question @farrufat-cimne : it seems that we are removing fields from the tree here

set result_node [$root selectNodes "[spdAux::getRoute "DEMConditions"]/condition\[@n = 'DEM-Cohesive'\]"]

When the procedure should be the opposite, no? I thought the CDEM would increment the fields.
@jginternational , if we reverse the operation, adding fields in CDEM instead of removing in DEM, how can we proceed? Here we are adding one field to the tree
gid_groups_conds::addF [spdAux::getRoute BondElem] value [list n TypeOfFailure pn "Type of failure" v No values {Yes,No} icon "black1" help "Displays different numbers for different types of failure. 2: tension. 4: shear or combination of stresses. 6: neighbour not found by search. 8: less bonds than minimum"]

But I guess adding new conditions is different...

@jginternational
Copy link
Copy Markdown
Member

Solved by phone.
Conditions that must only appear in the child app should not exist in the parent app, They must be loaded in a xml file in the child one

@maceligueta
Copy link
Copy Markdown
Member Author

I think this is ready. I tested examples in DEM and CDEM and they run fine

@maceligueta
Copy link
Copy Markdown
Member Author

@jginternational approve if you think everything is ok

@maceligueta
Copy link
Copy Markdown
Member Author

I am not authorized to merge, even if it's approved...

@jginternational jginternational merged commit e1c7f76 into master Dec 9, 2019
@jginternational
Copy link
Copy Markdown
Member

We are on Christmas ... on release period

@jginternational jginternational deleted the dem/results-for-cdem branch February 19, 2020 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants