- problem can be now represented using potential energy or residual

force vector, autodiff takes care of linearization

- elasticity equations are now solved using e.g. principle of minimum
  potential energy. syntax is quite good, see notebook.

- updated how to interpolate fields, by introducing function spaces.
  syntax is now good. still have to figure out how to do time derivatives

- etc. etc. tutorial is broken at the moment, i took of get_lhs and
  get_rhs because they didn't really work.
This commit is contained in:
Jukka Aho
2015-10-26 05:40:41 +02:00
parent 2c11b2b2b2
commit 016e3cd8bf
15 changed files with 1870 additions and 826 deletions
+33 -1
View File
@@ -2,7 +2,7 @@
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
using FactCheck
using JuliaFEM: Element, Basis, FieldSet
using JuliaFEM: Element, Basis, Field, FieldSet, FunctionSpace
""" Prototype element
@@ -51,3 +51,35 @@ facts("test adding fieldsets and fields to element") do
@fact fields[2] --> field2
end
facts("interpolation of fields in some function space") do
element = MockElement([1, 2, 3, 4])
fieldset1 = FieldSet("geometry", [Field(0.0, Vector[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]])])
fieldset2 = FieldSet("constant scalar field", [Field(0.0, 1.0)])
fieldset3 = FieldSet("scalar field", [Field(0.0, [1.0, 2.0, 3.0, 4.0])])
fieldset4 = FieldSet("vector field 1", [Field(0.0, Vector[[1.0], [2.0], [3.0], [4.0]])])
fieldset5 = FieldSet("vector field 2", [Field(0.0, Vector[[1.0, 5.0], [2.0, 6.0], [3.0, 7.0], [4.0, 8.0]])])
fieldset6 = FieldSet("vector field 3", [Field(0.0, Vector[[1.0, 5.0, 9.0], [2.0, 6.0, 10.0], [3.0, 7.0, 11.0], [4.0, 8.0, 12.0]])])
fieldset7 = FieldSet("tensor field 1", [Field(0.0, Matrix[[1.0 5.0; 9.0 13.0], [2.0 6.0; 10.0 14.0], [3.0 7.0; 11.0 15.0], [4.0 8.0; 12.0 16.0]])])
push!(element, fieldset1)
push!(element, fieldset2)
push!(element, fieldset3)
push!(element, fieldset4)
push!(element, fieldset5)
push!(element, fieldset6)
push!(element, fieldset7)
xi = [0.0, 0.0]
t = 0.0
u = FunctionSpace(element)
v = FunctionSpace(element)
@fact v("constant scalar field", xi, t) --> 1.0
@fact v("scalar field", xi, t) --> 1/4*(1+2+3+4)
@fact v("vector field 1", xi, t) --> [1/4*(1+2+3+4)]
@fact v("vector field 2", xi, t) --> 1/4*[1+2+3+4, 5+6+7+8]
@fact v("vector field 3", xi, t) --> 1/4*[1+2+3+4, 5+6+7+8, 9+10+11+12]
@fact v("tensor field 1", xi, t) --> 1/4*[1+2+3+4 5+6+7+8; 9+10+11+12 13+14+15+16]
end