oriolcg on mixed_dims
Provide `rand` function for Ten… simplexify: return tet simplex … Merge pull request #532 from es… and 30 more (compare)
fverdugo on gh-pages
build based on 923852a (compare)
grid
and grid_topology
. the grid
seems to be defined in an abstract reference space, and the grid_topology
seems to contain the physical geometry of the grid. is that correct? if so, the name grid_topology
seems to be a misnomer. (no criticism here.)
grid
is also called "triangulation", i.e. a triangulation can consist of cubes, and it doesn't have coordinates attached.
norm(u::MultiValue{Tuple{D1,D2}}) where {D1,D2} = sqrt(inner(u,u))
solves part of the problem (I can call norm∘T with T being tensor), but (norm∘T)^(p-2), still errors. Any clue of what other method I would need to add for this to work. Thanks!
TestFESpace(model,ReferenceFE(lagrangian,TensorValue{2,2,Float64,4},order),conformity=:L2)
the norm is not defined. it works adding the method of my previous message.
p_power∘(norm(T))
when you are applying p_power
to an array of nodal data - @fverdugo would probably answer this question better. It appears that this is not yet defined in Operations.jl
for MultiValue{Tuple{D1,D2}}
but is for MultiValue{Tuple{D}}
. May be worth adding.
using Gridap
u(x) = sin(2pi(x[1]-0.25))*x[2]
f(x) = -Δ(u)(x)
domain = (0,1,0,2)
cells = (10,20)
model = CartesianDiscreteModel(domain,cells;isperiodic=(true,false))
Are you on 1.5? For
(@v1.6) pkg> st Gridap
Status `~/.julia/environments/v1.6/Project.toml`
[56d4f2e9] Gridap v0.15.1 `https://github.com/gridap/Gridap.jl.git#master`
The above example returns
julia> model = CartesianDiscreteModel(domain,cells;isperiodic=(true,false))
ERROR: BoundsError: attempt to access 1-element Vector{Int32} at index [0]
Stacktrace:
[1] getindex
@ ./array.jl:801 [inlined]
[2] _face_to_cells_count!
@ ~/.julia/packages/Gridap/zovI1/src/Geometry/GridTopologies.jl:889 [inlined]
[3] _face_to_cells(cell_to_faces_data::Vector{Int64}, cell_to_faces_ptrs::Vector{Int32}, nfaces::Int64)
@ Gridap.Geometry ~/.julia/packages/Gridap/zovI1/src/Geometry/GridTopologies.jl:867
[4] generate_cells_around
@ ~/.julia/packages/Gridap/zovI1/src/Geometry/GridTopologies.jl:564 [inlined]
[5] Gridap.Geometry.UnstructuredGridTopology(vertex_coordinates::Vector{VectorValue{2, Float64}}, cell_vertices::Gridap.Arrays.Table{Int64, Vector{Int64}, Vector{Int32}}, cell_type::Vector{Int8}, polytopes::Vector{Gridap.ReferenceFEs.ExtrusionPolytope{2}}, orientation_style::Gridap.Geometry.Oriented)
@ Gridap.Geometry ~/.julia/packages/Gridap/zovI1/src/Geometry/UnstructuredGridTopologies.jl:36
[6] _generate_grid_topology_from_grid(grid::Gridap.Geometry.UnstructuredGrid{2, 2, Float64, Gridap.Geometry.Oriented}, cell_to_vertices::Gridap.Arrays.Table{Int64, Vector{Int64}, Vector{Int32}}, vertex_to_node::Vector{Int64})
@ Gridap.Geometry ~/.julia/packages/Gridap/zovI1/src/Geometry/UnstructuredGridTopologies.jl:148
[7] _cartesian_grid_topology_with_periodic_bcs
@ ~/.julia/packages/Gridap/zovI1/src/Geometry/CartesianDiscreteModels.jl:413 [inlined]
[8] CartesianDiscreteModel(desc::Gridap.Geometry.CartesianDescriptor{2, Float64, typeof(identity)})
@ Gridap.Geometry ~/.julia/packages/Gridap/zovI1/src/Geometry/CartesianDiscreteModels.jl:20
[9] #CartesianDiscreteModel#82
@ ~/.julia/packages/Gridap/zovI1/src/Geometry/CartesianDiscreteModels.jl:69 [inlined]
[10] top-level scope
@ REPL[13]:1
Welcome to Gridap @bueschgens. The test that you mention solves a problem with a manufactured analytical solution. That means that you enforce a forcing term such that the solution satisfy a given function. In that case u(x,t)
is the analytical function (or exact solution) and the forcing term is computed using this function: f(t) = x -> ∂t(u)(x,t)-Δ(u(t))(x)
. The Finite Element solution at time tn
, uh_tn
, is obtained when you iterate over the result of the solve
function:
sol_t = solve(solver,op,uh0,t0,tF)
l2(w) = w*w
tol = 1.0e-6
_t_n = t0
for (uh_tn, tn) in sol_t
global _t_n
_t_n += dt
e = u(tn) - uh_tn
el2 = sqrt(sum( ∫(l2(e))dΩ ))
end
Note that you can also use the analytical function to compute the numerical error.
FEFunction
?
evaluate!
for the gradient. i'm currently implementing evaluate!(cache,f::SingleFieldFEFunction,x::Point)
. is that the right signature?
function return_cache(f::CellField,x::Point)
trian = get_triangulation(f)
setup = _setup_kd_tree_search(trian)
cell_f = get_array(f)
c1 = array_cache(cell_f)
f = testitem(cell_f)
c2 = return_cache(f,x)
setup, c1, c2, cell_f, f
end
function evaluate!(cache,f::CellField,x::Point)
setup, c1, c2, cell_g, g = cache
if f === g
cell_f = cell_g
else
cell_f = get_array(f)
end
cell = _find_cell_kd_tree(setup,x)
f = getindex!(c1,cell_f,cell)
fx = evaluate!(c2,f,x)
fx
end
_setup_kd_tree_search
represents a function that set-ups the kd-tree searches. _find_cell_kd_tree
does the search for a given point
UnstructuredGridTopology
. you hint to call get_grid_topology
doesn't work since it requires a model, which i don't have, i only have a triangulation.
Function inverse_map is not implemented yet for objects of type Gridap.Fields.LinearCombinationField{Vector{VectorValue{2, Float64}}, Gridap.Fields.LinearCombinationFieldVector{Matrix{Float64}, Gridap.Polynomials.MonomialBasis{2, Float64}}}