-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add possibility to add bcs on edges/vertices #291
Conversation
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
==========================================
- Coverage 85.97% 85.40% -0.57%
==========================================
Files 21 21
Lines 1961 2001 +40
==========================================
+ Hits 1686 1709 +23
- Misses 275 292 +17
Continue to review full report at Codecov.
|
src/Dofs/ConstraintHandler.jl
Outdated
@@ -145,7 +157,7 @@ function _add!(ch::ConstraintHandler, dbc::Dirichlet, bcfaces::Set{Tuple{Int,Int | |||
# loop over all the faces in the set and add the global dofs to `constrained_dofs` | |||
constrained_dofs = Int[] | |||
#_celldofs = fill(0, ndofs_per_cell(ch.dh)) | |||
for (cellidx, faceidx) in bcfaces | |||
for (cellidx, faceidx) in bcfaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (cellidx, faceidx) in bcfaces | |
for (cellidx, faceidx) in bcfaces |
@@ -157,7 +157,7 @@ function assemble_up!(Ke, fe, cell, cellvalues_u, cellvalues_p, facevalues_u, gr | |||
## We loop over all the faces in the cell, then check if the face | |||
## is in our `"traction"` faceset. | |||
@inbounds for face in 1:nfaces(cell) | |||
if onboundary(cell, face) && (cellid(cell), face) ∈ getfaceset(grid, "traction") | |||
if onboundary(cell, face) && FaceIndex(cellid(cell), face) ∈ getfaceset(grid, "traction") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I guess this is pretty breaking. Perhaps we can leave FaceIndex
as const FaceIndex = Tuple{Int, Int}
but use struct for the others?
examples/cantilever.ipynb
Outdated
"output_type": "stream", | ||
"text": [ | ||
" \u001b[1m------------------------------------------------------------------\u001b[22m\n", | ||
" Time Allocations \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this table go away?
src/Dofs/ConstraintHandler.jl
Outdated
@@ -229,6 +241,7 @@ function _update!(values::Vector{Float64}, f::Function, faces::Set{Tuple{Int,Int | |||
_celldofs = fill(0, ndofs_per_cell(dh, _tmp_cellid)) | |||
|
|||
for (cellidx, faceidx) in faces | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Dofs/ConstraintHandler.jl
Outdated
@@ -395,22 +409,30 @@ end | |||
|
|||
#Function for adding constraint when using multiple celltypes | |||
function add!(ch::ConstraintHandler, fh::FieldHandler, dbc::Dirichlet) | |||
dbc.faces isa Set{Tuple{Int}} && error("Can only apply boundary conditions to faces (not nodes).") | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
==========================================
- Coverage 85.97% 85.51% -0.47%
==========================================
Files 21 21
Lines 1961 2002 +41
==========================================
+ Hits 1686 1712 +26
- Misses 275 290 +15
Continue to review full report at Codecov.
|
I added a simple example with shell elements, which is the strongest motivation why one needs to be able to add BCs on edges/vertices. I am planning to write some text for the example so that it can be added to the other tutorials. I would also like some feedback on the structure of the code. Currently in the
where
Do you think it is clear what
Any feedback would be appriciated.. |
I think doing the explicit |
Add image add todo to dofhandler move code to BcValue constructor
add docs for BCValues change JuAFEM -> Ferrite in some places
Close due to #343 |
Useful for for example "simply supported" bcs.
Also useful for shell elements which only has edges.
See Cantilever.ipynb for example usage