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

Add function to properly extract global solution #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebastianpech
Copy link
Contributor

As mentioned in JuliaFEM/FEMBeam.jl#22 I had problems with the correct mapping of local to global DOFs for mixed problem with different number of DOFs.

This solved the problem by using the problem specific get_gdofs and then reshapes the result.

Basically get_global_solution is replaced with get_element_solution. I didn't see get_global_solution beeing used anywhere else, so unless it's needed outside the package it could be deleted.

@ahojukka5
Copy link
Member

This also looks good for me, but for some reason, this is breaking one test, test/test_problems.jl, any idea what is going on. The tests in this package are not the best ones, so there might be something not serious though.

@ahojukka5
Copy link
Member

This maybe has something to do with "empty connectivity" for unconnected elements. We have something like this:

element = Element(Seg2, Int[])

which is used to create "placeholder" elements in some applications. Clearly this is having hard time to guess how to update. And this practice is bad anyway. Let's change that so that unconnected elements are created using

element = Element(Seg2, [0, 0])

So we give node number 0 for elements which are not connected with that node to anywhere. This special case should be taken into account in functions updating data from global solution back to elements.

@sebastianpech
Copy link
Contributor Author

sebastianpech commented Nov 30, 2019

Can't test currently. After rebasing on master and getting FEMBasis 0.3.1 to my local env. I get

ERROR: LoadError: LoadError: invalid subtyping in definition of Poi1
Stacktrace:
 [1] top-level scope at /Users/sebastianpech/SynologyDrive/Projekte/julia-dev/FEMBase.jl/src/elements_lagrange.jl:4
 [2] include at ./boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1094
 [4] include at ./Base.jl:31 [inlined]
 [5] include(::String) at /Users/sebastianpech/SynologyDrive/Projekte/julia-dev/FEMBase.jl/src/FEMBase.jl:4
 [6] top-level scope at /Users/sebastianpech/SynologyDrive/Projekte/julia-dev/FEMBase.jl/src/FEMBase.jl:28
 [7] include at ./boot.jl:328 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1094
 [9] include(::Module, ::String) at ./Base.jl:31
 [10] top-level scope at none:2
 [11] eval at ./boot.jl:330 [inlined]
 [12] eval(::Expr) at ./client.jl:432
 [13] top-level scope at ./none:3
in expression starting at /Users/sebastianpech/SynologyDrive/Projekte/julia-dev/FEMBase.jl/src/elements_lagrange.jl:4
in expression starting at /Users/sebastianpech/SynologyDrive/Projekte/julia-dev/FEMBase.jl/src/FEMBase.jl:28

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.

2 participants