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

More integration tests for different material models #9

Open
TeroFrondelius opened this issue Jul 19, 2019 · 6 comments
Open

More integration tests for different material models #9

TeroFrondelius opened this issue Jul 19, 2019 · 6 comments

Comments

@TeroFrondelius
Copy link
Member

@thelfer as you commented in gitter chat that we should focus the testing to add few more integration tests similar than test_norton_model.jl. Do you have time to do it? I can do, if you can send me a corresponding cxx and mfront files as an example/input.

@thelfer
Copy link

thelfer commented Jul 20, 2019

@TeroFrondelius Well, for the moment there are only the tests that I sent you.

IMHO, there are three ways to go:

  1. develop further unit-tests of MGIS Julia bindings
  2. try in make a first computation in JuliaFEM.jl and make tests in that environment. This means one object of type BehaviourData per integration point
  3. develop the Julia bindings to expose the MaterialDataManager class which handles several integration points

I would think that 1. could be left aside for the moment.

Choices between strategy 2 or 3 depends on JuliaFEM.jl developers choices. Concerning 3. I stopped because I did not knew how to create views of raw arrays (i.e. take a continuous array and turn it into a matrix without copying) which can easily be done in C++ with Eigen or in Python with Numpy). Can you help me on this point ?

@TeroFrondelius
Copy link
Member Author

2. try in make a first computation in JuliaFEM.jl and make tests in that environment. This means one object of type BehaviourData per integration point

This would be the right thing to do. I will also need a help here and all the people who could help are on holiday. We will continue after three weeks.

@TeroFrondelius
Copy link
Member Author

Concerning 3. I stopped because I did not knew how to create views of raw arrays (i.e. take a continuous array and turn it into a matrix without copying) which can easily be done in C++ with Eigen or in Python with Numpy). Can you help me on this point ?

Maybe I misunderstood, but here is the related information: https://pkg.julialang.org/docs/julia/THl1k/1.1.1/devdocs/subarrays.html

julia> A = rand(3,3)
3×3 Array{Float64,2}:
 0.726266   0.92312    0.083372
 0.0676195  0.0912788  0.543187
 0.864321   0.600093   0.888888

julia> S1 = view(A, 1, 2:3)
2-element view(::Array{Float64,2}, 1, 2:3) with eltype Float64:
 0.9231199568455222 
 0.08337203046946584

julia> S1 = view(A, 1:2, 2:3)
2×2 view(::Array{Float64,2}, 1:2, 2:3) with eltype Float64:
 0.92312    0.083372
 0.0912788  0.543187

julia> 

@thelfer
Copy link

thelfer commented Jul 20, 2019

Well, thanks for the view. Indeed, I was looking for a pure C++ solution as I do in Python. But CxxWrap does not provide such functionality right now.
Maybe we shall consider a mixed approach.
Let us consider the get_tangent_operator method. It currently returns a raw array. I think that we shall change this to get_raw_tangent_operator and implement get_tangent_operator in Julia. This new version would return a matrix in standard cases.
Would you help me do this ?

@TeroFrondelius
Copy link
Member Author

Indeed, I was looking for a pure C++ solution as I do in Python. But CxxWrap does not provide such functionality right now.

@thelfer maybe I have misunderstood, but you can call view from C++. Maybe i.e. @barche could point out an example, where julia methods are called from C++ or even better if knows an example where view is called from C++.

I started implementing this in JuliaFEM (Materials.jl to be exact). I will ping you when I will get my initial pull request together.

@TeroFrondelius
Copy link
Member Author

Actually, I think I found the example: https://github.com/JuliaInterop/CxxWrap.jl#working-with-arrays.

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

No branches or pull requests

2 participants