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

Triangular Face element #78

Merged
merged 4 commits into from
Feb 22, 2023
Merged

Triangular Face element #78

merged 4 commits into from
Feb 22, 2023

Conversation

mvanzulli
Copy link
Member

@mvanzulli mvanzulli commented Feb 22, 2023

Addressing #77

In this PR a new AbstractFace abstract type is introduced, this abstract types is useful for processing boundary conditions. In particular, this new leaf is implemented:

"""
A `TriangularFace` represents an element composed by three `Node`s.
### Fields:
- `n₁`             -- stores first triangle node.
- `n₂`             -- stores second triangle node.
- `n₂`             -- stores third triangle node.
- `label`          -- stores the triangle label.
"""
struct TriangularFace{dim,N<:AbstractNode{dim},T<:Real} <: AbstractFace{dim,T}
    n₁::N
    n₂::N
    n₃::N
    label::Symbol
    function TriangularFace(n₁::N, n₂::N, n₃::N, label=:no_labelled_face) where
    {dim,T<:Real,N<:AbstractNode{dim,T}}
        new{dim,N,T}(n₁, n₂, n₃, Symbol(label))
    end
end

"Returns the nodes for the `TriangularFace` `tf`."
nodes(tf::TriangularFace) = [tf.n₁, tf.n₂, tf.n₃]

Also StructuralBoundaryConditions struct can now include faces boundary conditions.

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2023

Codecov Report

Merging #78 (8a383d4) into main (e0807e5) will increase coverage by 0.05%.
The diff coverage is 97.14%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   87.16%   87.21%   +0.05%     
==========================================
  Files          25       26       +1     
  Lines         553      563      +10     
==========================================
+ Hits          482      491       +9     
- Misses         71       72       +1     
Impacted Files Coverage Δ
src/Meshes/Meshes.jl 92.15% <ø> (ø)
src/StructuralModel/StructuralMaterials.jl 100.00% <ø> (ø)
src/StructuralModel/StructuralModel.jl 87.50% <ø> (ø)
src/Elements/Elements.jl 79.24% <91.66%> (+3.63%) ⬆️
src/Elements/Node.jl 66.66% <100.00%> (ø)
src/Elements/TriangularFace.jl 100.00% <100.00%> (ø)
src/Elements/Truss.jl 86.04% <100.00%> (ø)
...rc/StructuralModel/StructuralBoundaryConditions.jl 100.00% <100.00%> (ø)
src/StructuralModel/Structure.jl 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mvanzulli mvanzulli marked this pull request as ready for review February 22, 2023 23:13
Copy link
Member

@jorgepz jorgepz left a comment

Choose a reason for hiding this comment

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

vamo arrucaaaaa

@mvanzulli mvanzulli merged commit 017e607 into main Feb 22, 2023
@mvanzulli mvanzulli deleted the mvanzulli/77 branch February 22, 2023 23:40
end

"Returns a `Vector` of`Node`s for the `TriangularFace` `tf`."
nodes(tf::TriangularFace) = [tf.n₁, tf.n₂, tf.n₃]
Copy link
Collaborator

Choose a reason for hiding this comment

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

this allocates; you may want to revisit later, storing an SVector directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I also considered to store the nodes of the elements into a Vector instead of separated files:

struct TriangularFace{dim,N<:AbstractNode{dim},T<:Real} <: AbstractFace{dim,T}
    nodes::SVector{N}
    label::Symbol
    function TriangularFace(n₁::N, n₂::N, n₃::N, label=:no_labelled_face) where
    {dim,T<:Real,N<:AbstractNode{dim,T}}
        new{dim,N,T}(SVector(n₁, n₂, n₃), Symbol(label))
    end
end

"Returns the nodes for the `TriangularFace` `tf`."
nodes(tf::TriangularFace) = [tf.n₁, tf.n₂, tf.n₃]

Copy link
Member Author

Choose a reason for hiding this comment

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

Open this in this issue #80

@mvanzulli mvanzulli mentioned this pull request Feb 23, 2023
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