-
Notifications
You must be signed in to change notification settings - Fork 248
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
[ContactStructuralMechanicsApplication] Searching the element ID #8148
Comments
forwarding to @AlejandroCornejo and @loumalouomega |
Dear @Joekchu , Maybe @loumalouomega has a better idea because he has been working in this for a long time. If I'd have to do it I would use the You can check here the bool IsInside(
const CoordinatesArrayType& rPoint,
CoordinatesArrayType& rResult,
const double Tolerance = std::numeric_limits<double>::epsilon()
) const override
{
this->PointLocalCoordinates( rResult, rPoint );
if ( (rResult[0] >= (0.0-Tolerance)) && (rResult[0] <= (1.0+Tolerance)) )
{
if ( (rResult[1] >= (0.0-Tolerance)) && (rResult[1] <= (1.0+Tolerance)) )
{
if ( (rResult[0] + rResult[1]) <= (1.0+Tolerance) )
{
return true;
}
}
}
return false;
} |
Dear @AlejandroCornejo , thanks for your suggestion that looks more concise. One more question, I am a rookie of UBLAS, so I am not sure about the Point<3>, does it contain the information of one node with 3 components or this array contains many nodes and each node contain 3 component? Thanks in advance! |
Hi! you can create a Point(double NewX, double NewY = 0, double NewZ = 0) : BaseType()
{
this->operator()(0) = NewX;
this->operator()(1) = NewY;
this->operator()(2) = NewZ;
}
|
or, if I'm not wrong, you could do: auto& r_geometry = elem.GetGeometry(); // beam elem
const auto& r_node_coords = r_geometry[0].GetCoordinates(); // 0, 1 or 2 depending on the node you want of the beam element
triangle_elem.GetGeometry().IsInside(r_node_coords , boolean, 1e-7); |
Let me clarify. @Joekchu
You want to check if the integrations points lies in some element, and the id of that element? |
Hi, Vicente, nice to see you! This is Joe @loumalouomega
Yes, I want to obtain the ID of the solid element where integrations points lie and then calculate the relative displacements between the target points of the pile and the solid element. |
@AlejandroCornejo Also, million thanks to you. I am sure that I learn a lot from your answer. |
In that case (a little bit pesudo-code): #include "utilities/binbased_fast_point_locator.h"
...
// We create the locator
BinBasedFastPointLocator<3> point_locator = BinBasedFastPointLocator<3>(r_model_part);
point_locator.UpdateSearchDatabase();
...
// BEGIN: loop over GP
Vector shape_functions;
Element::Pointer p_element = nullptr;
array_1d<double, 3> coordinates = HERE_THE_COORDINATES_OF_THE_GP_OF_THE_BEAM;// (should we add a method as in the solid for the local coordinates)
const bool is_found = point_locator.FindPointOnMeshSimplified(coordinates, shape_functions, p_element, max_number_of_searchs, 5.0e-2);
if (is_found) {
const auto id_element = p_element->Id();
... more code
}
// END: loop over GP
|
I will update my previous comment to 3D. |
See my previous comment |
If you use Hexahedra I don't know if it will work (I do not remember if we adapted in order to be generic, I think we did for the MPM formulation). |
MPM you mean material point method or others? @loumalouomega |
Yes, the ParticleMechanicsApplication does MPM |
Thanks, sir, one more question: if your MPM application supports GPU acceleration?@loumalouomega |
I don't know, I am not developer, @RiccardoRossi who is the main developer right now? |
It is implicit BTW |
Just mentioning that there is an explicit solver as well. |
I feel old now... |
No GPU BTW? |
I don't think so... |
Description
What is happening?
Hi, everyone!
I have a question about coding the contact algorithm:
I now have some beam element inserting into the solid elements. I want to create some virtual with the same coordinates as the integration point of the beam element. But I don't know how to know the ID of the 3D solid element where the virtual point lies. Do you guys have any suggestions on searching the element ID? The virtual point should lie in a certain position of one element (maybe on the edge or not)? So far, I have an idea is that I search every element and calculate the distance between the nodes of the solid element and the virtual node. If the distance of all nodes smaller than the characteristic length of the element, I assume this element is the object we search for. But it looks too complicated, do you have better suggestions?
Many thanks in advance.
Scope
Which areas of Kratos are involved
The text was updated successfully, but these errors were encountered: