Description
I would like to implement viscous boundary conditions (absorbing boundary conditions) for dynamic simulations. Here, I need to get the stiffness of material in the element attached to the boundary condition. I checked the code but I couldn't figure out how I can get access to elements/constitutive laws from a boundary condition.
Scope
Huuum, that will require additional work. CL are stored in the GP of the element. We need to detect first the corresponding elements associated to the BC, and then retrieve the corresponding CL (that may be greater than 1 in case of not tri and tetra)
Hi @Vahid-Galavi !
You can access the parent element of each condition after having computed the neighbours as we do in the TetrahedralMeshOrientationCheck. As you can see, that process calculates the condition neighbours such that you can do p_parent_element = p_my_condition->GetValue(NEIGHBOUR_ELEMENTS)(0) (the parent element is always saved in the first position of the NEIGHBOUR_ELEMENTS vector).
An alternative is what we used to do in the InitializeSolutionStep of the EmbeddedAusasNavierStokesWallCondition. In there we obtain the parent element from the nodal elemental neighbours, which are computed by executing the FindGlobalNodalElementalNeighboursProcess.
Once you have the pointer to the parent element you can retrieve the constitutive law from one of the Gauss pts. (in here you should consider @loumalouomega 's comment in case the CL involves a plastic/damage behaviour).
Hope this helps.
Thanks @loumalouomega and @rubenzorrilla for your prompt answer. I will try the suggestions in my implementation.
Thanks @loumalouomega and @rubenzorrilla for your prompt answer. I will try the suggestions in my implementation.
Cool. Let us know if you have any issue.