Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEM] Assigning conditions to DEM. Possibility to assign them in Mesh Mode #699

Open
farrufat-cimne opened this issue Jan 20, 2020 · 3 comments
Assignees
Labels

Comments

@farrufat-cimne
Copy link
Member

Should the user be able to define conditions applied on DEM particles directly over the mesh?
Currently, the code is limited to applying it on geometry mode, as stated in:

proc DEM::write::GetSpheresGroupsListInConditions { } {
    set conds_groups_dict [dict create ]
    set groups [list ]

    # Get all the groups with spheres
    foreach group [GetSpheresGroups] {
        foreach surface [GiD_EntitiesGroups get $group elements] {
            foreach involved_group [GiD_EntitiesGroups entity_groups elements $surface] {
                set involved_group_id [write::GetWriteGroupName $involved_group]
                if {$involved_group_id ni $groups} {lappend groups $involved_group_id}
            }
        }
    }

    # Find the relations condition -> group
    set xp1 "[spdAux::getRoute [GetAttribute conditions_un]]/condition"
    foreach cond [[customlib::GetBaseRoot] selectNodes $xp1] {
        set condid [$cond @n]
        foreach cond_group [$cond selectNodes "group"] {
            set group [write::GetWriteGroupName [$cond_group @n]]
            if {$group in $groups} {dict lappend conds_groups_dict $condid [$cond_group @n]}
        }
    }
    return $conds_groups_dict
}

Once this question is settled, if we decide to allow applying conditions over mesh, notice that in mesh mode one can apply conditions over 4 items: nodes, l elements, s elements and v elements.

@farrufat-cimne farrufat-cimne self-assigned this Jan 20, 2020
@farrufat-cimne
Copy link
Member Author

@maceligueta , @jginternational

@farrufat-cimne
Copy link
Member Author

@jginternational ,
swapping :

    foreach group [GetSpheresGroups] {
        foreach surface [GiD_EntitiesGroups get $group elements] {
            foreach involved_group [GiD_EntitiesGroups entity_groups elements $surface] {
                set involved_group_id [write::GetWriteGroupName $involved_group]
                if {$involved_group_id ni $groups} {lappend groups $involved_group_id}
            }
        }
    }

for:

# Get all the groups with spheres
    foreach group [GetSpheresGroups] {
        foreach surface [GiD_EntitiesGroups get $group nodes] {
            foreach involved_group [GiD_EntitiesGroups entity_groups nodes $surface] {
                set involved_group_id [write::GetWriteGroupName $involved_group]
                if {$involved_group_id ni $groups} {lappend groups $involved_group_id}
            }
        }
    }

with nodes instead of elements solve the problem.
we get the nodes instead, works both geometry mode and mesh mode.
Is it ok? It doesnt seem to cause any issue

@maceligueta maceligueta changed the title [DEM]Assigning conditions to DEM [DEM] Assigning conditions to DEM. Possibility to assign them in Mesh Mode Jan 23, 2020
@farrufat-cimne
Copy link
Member Author

@jginternational

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant