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

Rigid body connector #1119

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

lijas
Copy link
Collaborator

@lijas lijas commented Dec 8, 2024

Rigid body connectors

It would be nice to support Rigid body connectors (RBE2 and RBE3) in Ferrite. They are quite common to use in industry, and there has been questions about them in the slack channel before. They are usually modeled with rigid bodies which are connected to some part of the mesh (for example the nodes/facets around a hole).

This PR adds:

  1. Point<:AbstractCell and an interpolation which can be used to add rigid bodies dofs to the system.
  2. A RigidBodyConnector<:Constraint (RBE2) which sets up the affine constraints between the rigid body and connecting mesh (This constraint is pretty specific for solid mechanics problems, so it should probably not be included in core Ferrite).
  3. A simple example illustrating the constraint (a plate with a hole, and a rigid body at the center that is connected to the nodes around the hole. The rigid body is rotated pi/10).
Screenshot 2024-12-08 at 10 28 47

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

Attention: Patch coverage is 1.81818% with 54 lines in your changes missing coverage. Please review.

Project coverage is 90.78%. Comparing base (5153307) to head (be445f8).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/Dofs/ConstraintHandler.jl 2.32% 42 Missing ⚠️
src/interpolations.jl 0.00% 7 Missing ⚠️
src/Grid/grid.jl 0.00% 4 Missing ⚠️
src/Export/VTK.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1119      +/-   ##
==========================================
- Coverage   93.57%   90.78%   -2.80%     
==========================================
  Files          39       39              
  Lines        6071     6260     +189     
==========================================
+ Hits         5681     5683       +2     
- Misses        390      577     +187     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KristofferC
Copy link
Collaborator

This constraint is pretty specific for solid mechanics problems, so it should probably not be included in core Ferrite).

Is there a way to formulate this constraint in a somewhat "general" way? I think it is fine to have in Ferrite even if the most common use case is for a certain class of problems.

@lijas
Copy link
Collaborator Author

lijas commented Dec 9, 2024

I tried to think of way to generalize it, but i dont think there is an analog constraint for e.g. heat problems.

@termi-official
Copy link
Member

I think rather than having this directly in Ferrite we should think about providing the building blocks (and howtos) to build such special constraints in an efficient way. In the end this just another affine constraint, since I think building most affine constraints is right now difficult for most users.

@lijas
Copy link
Collaborator Author

lijas commented Dec 9, 2024

Yes, it could work as a how-to. It would also be fun to replicate this phase field problem, where they use these rigid body connectors to apply the boundary conditions.

Copy link
Member

@KnutAM KnutAM left a comment

Choose a reason for hiding this comment

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

I think the RefPoint and Point are really cool features to get in 🚀

I think that RigidBodyConnector potentially could be generalized by accepting some function as argument, I think it could be nice to think more about how we could have an interface and separate out that part in a standalone PR?

@@ -300,6 +308,7 @@ struct Pyramid <: AbstractCell{RefPyramid}
nodes::NTuple{5, Int}
end

geometric_interpolation(::Type{Point}) = Lagrange{RefPoint, 1}()
Copy link
Member

Choose a reason for hiding this comment

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

Since it is a constant value, shouldn't this be 0th order?

Suggested change
geometric_interpolation(::Type{Point}) = Lagrange{RefPoint, 1}()
geometric_interpolation(::Type{Point}) = Lagrange{RefPoint, 0}()

@@ -4,6 +4,7 @@ export
VectorInterpolation,
ScalarInterpolation,
VectorizedInterpolation,
#RefPoint,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#RefPoint,
RefPoint,

@@ -58,6 +59,7 @@ export
# Grid
Grid,
Node,
#Point,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#Point,
Point,

return [Tensor{1, 0, Float64, 0}(())] # zero dim Vec{0}
end
function reference_shape_value(ip::Lagrange{RefPoint}, ξ::Vec{0}, i::Int)
return i == 1 && 1.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return i == 1 && 1.0
i == 1 && return 1.0

@@ -82,7 +82,7 @@ A collection of constraints associated with the dof handler `dh`.
`T` is the numeric type for stored values.
"""
mutable struct ConstraintHandler{DH <: AbstractDofHandler, T}
const dbcs::Vector{Dirichlet}
const dbcs::Vector{Dirichlet} #TODO: Vector{Constraint}
Copy link
Member

Choose a reason for hiding this comment

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

Not required?

Suggested change
const dbcs::Vector{Dirichlet} #TODO: Vector{Constraint}
const dbcs::Vector{Dirichlet}

@KnutAM
Copy link
Member

KnutAM commented Feb 14, 2025

tried to think of way to generalize it, but i dont think there is an analog constraint for e.g. heat problems.

An equivalent there would be to prescribe a constant, but unknown, temperature on a boundary, AFAIU.

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

Successfully merging this pull request may close these issues.

4 participants