Closed sebastianpech closed 4 years ago
I also tried the version with the extra problem definition for the dirichlet BC, but I get the same error message.
For me everything looks good. It looks that Dirichlet boundary conditions are missing. Here is the code for handling boundary conditions. What about if you do
assemble!(problem, 0.0)
show(sparse(problem.assembly.C2))
There should be ones in diagonal for fixed dofs and it should be same than problem.assembly.C1
.
There should be ones in diagonal for fixed dofs and it should be same than problem.assembly.C1.
That works as expected:
julia> show(sparse(problem.assembly.C2))
[1, 1] = 1.0
[2, 2] = 1.0
[3, 3] = 1.0
[4, 4] = 1.0
[5, 5] = 1.0
[6, 6] = 1.0
julia> show(sparse(problem.assembly.C1))
[1, 1] = 1.0
[2, 2] = 1.0
[3, 3] = 1.0
[4, 4] = 1.0
[5, 5] = 1.0
[6, 6] = 1.0
I debugged the get_boundary_assembly
function and for the code above it returns C1
and C2
beeing 0. I think the loop in get_boundary_assembly
is not running because JuliaFEM.get_boundary_problems(analysis)
returns an empty array due to this.
Hmm yes. I'm not sure why we even have FieldProblem
and BoundaryProblem
types separately. This is not the best kind of design. In earlier stage, we thought that we could have separate boundary conditions assembly which can be used in all problem types, but it's not too much of boilerplate to have boundary assembly done in each problem type separately.
What about, if you do in the script, before assembling,
import FEMBase
FEMBase.is_field_problem(::Problem{Beam}) = true
FEMBase.is_boundary_problem(::Problem{Beam}) = true
@assert is_field_problem(problem)
@assert is_boundary_problem(problem)
does this solve the issue?
Partly. I also had to define FEMBase.get_parent_field_name(p::Problem{Beam}) = p.parent_field_name
. However, the post processing methods are not defined
ERROR: MethodError: no method matching postprocess!(::Problem{Beam}, ::Float64, ::Type{Val{:stress}})
Closest candidates are:
postprocess!(::Problem{Elasticity}, ::Float64, ::Type{Val{:stress}}) at /Users/sebastianpech/.julia/packages/JuliaFEM/DbhTT/src/problems_elasticity.jl:468
postprocess!(::Problem{Elasticity}, ::Float64, ::Type{Val{:strain}}) at /Users/sebastianpech/.julia/packages/JuliaFEM/DbhTT/src/problems_elasticity.jl:462
postprocess!(::Problem{Dirichlet}, ::Float64, ::Type{Val{Symbol("reaction force")}}) at /Users/sebastianpech/.julia/packages/JuliaFEM/DbhTT/src/problems_dirichlet.jl:157
Are there any defined for Beams?
Sure. I removed them for now and I get plausible results. Thanks for the help
So basically we should add
FEMBase.is_field_problem(::Problem{Beam}) = true
FEMBase.is_boundary_problem(::Problem{Beam}) = true
to somewhere to FEMBase.jl code to solve this issue.
You also need
FEMBase.get_parent_field_name(p::Problem{Beam}) = p.parent_field_name
because it's just defined for a BoundaryProblem
here.
Should get_parent_field_name
be implemented for non-boundary problems as well?
I think no. The idea behind this "parent field" was that when the primary field of Dirichlet boundary condition is "lambda" as we are basically building a mixed problem, we needed somehow to transfer the information what is the name of the actual field considered to be solved. So we can use the same Dirichlet
for both Elasticity
and Heat
. But I think this is an over-complicated solution and benefits are minimal. We should have only one kind of problem instead of FieldProblem
and BoundaryProblem
. All problems should also take care of building the boundary conditions like is done in this package, it seems to be a better way.
We use get_parent_field_name
only in a couple of places.
And in some contact algorithms. In those, it's important to know is the contact formulation done for displacement or temperature, but I guess there is better ways to organize that.
What do you mean by
All problems should also take of building the boundary conditions like is done in this package, it seems to be a better way.
With
update!(fix, "fixed displacement 1", 0.0)
update!(fix, "fixed rotation 1", 0.0)
instead of an extra Dirichlet
problem?
I think each package should deal with its own boundary conditions like is done in this package. That makes it much easier to handle all kinds of special cases. For example, for beams, we could have slanted supports and things like that. And the right place for implementation of those is FEMBeams.jl.
Ah, ok
I just noticed that all dofs in the xmf file are collected in a single point array (so displacement also contains the rotations). This causes a problem when viewing the results because for warping paraview needs a three point array. Is it possible to separate the dofs?
I did a dirty workaround when storing eigenmodes. Maybe something similar dirty workaround to here would do the trick. Paraview cannot use or visualize rotation dofs. Another option would be to study Paraview documentation, probably it is possible to apply some kind of filter to the dataset before visualization.
Ok, thanks for your help
I ended up writing my own script using Plots.jl.
I wanted to run a simple linear elastic beam example, however, I didn't manage to get the analysis to run. I used test/test_beam3d_3_beams.jl, test/test_supports.jl and the modal analysis of the frame in JuliaFEM as templates. This is my code:
The script failes with
Can you please check what I'm missing.