Error in Gridap

Hi All

I get the following very long error message:

ERROR: MethodError: no method matching Float64(::VectorValue{2, Float64})
Closest candidates are:
(::Type{T})(::T) where T<:Number at boot.jl:760
(::Type{T})(::VectorizationBase.Double{T}) where T<:Union{Float16, Float32, Float64, VectorizationBase.Vec{var"#s38", var"#s37"} where {var"#s38", var"#s37"<:Union{Float16, Float32, Float64}}, VectorizationBase.VecUnroll{var"#s36", var"#s35", var"#s34", V} where {var"#s36", var"#s35", var"#s34"<:Union{Float16, Float32, Float64}, V<:Union{Bool, Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, SIMDTypes.Bit, VectorizationBase.AbstractSIMD{var"#s35", var"#s34"}}}} at C:\Users\larsu.julia\packages\VectorizationBase\G9NJI\src\special\double.jl:111
(::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50

Stacktrace:
[1] convert(#unused#::Type{Float64}, x::VectorValue{2, Float64})
@ Base .\number.jl:7
[2] setindex!(A::Vector{Float64}, x::VectorValue{2, Float64}, i1::Int64)
@ Base .\array.jl:843
[3] setindex!
@ .\multidimensional.jl:645 [inlined]
[4] add_entry!
@ C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\AlgebraInterfaces.jl:98 [inlined]
[5] add_entry!
@ C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\AlgebraInterfaces.jl:87 [inlined]
[6] _add_entries!
@ C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\AlgebraInterfaces.jl:174 [inlined]
[7] add_entries!
@ C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\AlgebraInterfaces.jl:158 [inlined]
[8] evaluate!
@ C:\Users\larsu.julia\packages\Gridap\OTENN\src\Arrays\AlgebraMaps.jl:51 [inlined]
[9] evaluate!(cache::Vector{Nothing}, k::AddEntriesMap{typeof(+)}, A::Vector{Float64}, v::VectorBlock{Vector{VectorValue{2, Float64}}}, I::VectorBlock{Vector{Int32}})
@ Gridap.Fields C:\Users\larsu.julia\packages\Gridap\OTENN\src\Fields\ArrayBlocks.jl:1485
[10] _numeric_loop_vector!(vec::Vector{Float64}, caches::Tuple{Vector{Nothing}, Tuple{Tuple{Nothing,
@ Gridap.FESpaces C:\Users\larsu.julia\packages\Gridap\OTENN\src\FESpaces\SparseMatrixAssemblers.jl:319
[11] numeric_loop_vector!(b::Vector{Float64}, a::GenericSparseMatrixAssembler, vecdata::Tuple{Vector{Any}, Vector{Any}})
@ Gridap.FESpaces C:\Users\larsu.julia\packages\Gridap\OTENN\src\FESpaces\SparseMatrixAssemblers.jl:306
[12] assemble_vector_add!
@ C:\Users\larsu.julia\packages\Gridap\OTENN\src\FESpaces\SparseMatrixAssemblers.jl:71 [inlined]
[13] assemble_vector!(b::Vector{Float64}, a::GenericSparseMatrixAssembler, vecdata::Tuple{Vector{Any}, Vector{Any}})
@ Gridap.FESpaces C:\Users\larsu.julia\packages\Gridap\OTENN\src\FESpaces\SparseMatrixAssemblers.jl:67
[14] residual!(b::Vector{Float64}, op::Gridap.ODEs.TransientFETools.TransientFEOperatorFromWeakForm{Gridap.ODEs.ODETools.Nonlinear}, t::Float64, xh::Gridap.ODEs.TransientFETools.TransientMultiFieldCellField{Gridap.MultiField.MultiFieldFEFunction{Gridap.MultiField.MultiFieldCellField{ReferenceDomain}}}, cache::Tuple{Tuple{MultiFieldFESpace{Gridap.MultiField.ConsecutiveMultiFieldStyle, UnConstrained, Vector{Float64}}, MultiFieldFESpace{Gridap.MultiField.ConsecutiveMultiFieldStyle, UnConstrained, Vector{Float64}}}, Tuple{TransientMultiFieldTrialFESpace, TransientMultiFieldTrialFESpace}, Nothing})
@ Gridap.ODEs.TransientFETools C:\Users\larsu.julia\packages\Gridap\OTENN\src\ODEs\TransientFETools\TransientFEOperators.jl:256
[15] residual!(b::Vector{Float64}, op::Gridap.ODEs.TransientFETools.ODEOpFromFEOp{Gridap.ODEs.ODETools.Nonlinear}, t::Float64, xhF::Tuple{Vector{Float64}, Vector{Float64}}, ode_cache::Tuple{Tuple{MultiFieldFESpace{Gridap.MultiField.ConsecutiveMultiFieldStyle, UnConstrained, Vector{Float64}}, MultiFieldFESpace{Gridap.MultiField.ConsecutiveMultiFieldStyle, UnConstrained, Vector{Float64}}}, Tuple{TransientMultiFieldTrialFESpace, TransientMultiFieldTrialFESpace}, Nothing})
@ Gridap.ODEs.TransientFETools C:\Users\larsu.julia\packages\Gridap\OTENN\src\ODEs\TransientFETools\ODEOperatorInterfaces.jl:74
[16] residual!(b::Vector{Float64}, op::Gridap.ODEs.ODETools.ThetaMethodNonlinearOperator, x::Vector{Float64})
@ Gridap.ODEs.ODETools C:\Users\larsu.julia\packages\Gridap\OTENN\src\ODEs\ODETools\ThetaMethod.jl:74
[17] residual_and_jacobian!(b::Vector{Float64}, A::SparseArrays.SparseMatrixCSC{Float64, Int64}, op::Gridap.ODEs.ODETools.ThetaMethodNonlinearOperator, x::Vector{Float64})
@ Gridap.Algebra C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\NonlinearOperators.jl:52
[18] residual_and_jacobian(op::Gridap.ODEs.ODETools.ThetaMethodNonlinearOperator, x::Vector{Float64})
@ Gridap.Algebra C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\NonlinearOperators.jl:62
[19] _new_nlsolve_cache(x0::Vector{Float64}, nls::NLSolver, op::Gridap.ODEs.ODETools.ThetaMethodNonlinearOperator)
@ Gridap.Algebra C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\NLSolvers.jl:167
[20] solve!(x::Vector{Float64}, nls::NLSolver, op::Gridap.ODEs.ODETools.ThetaMethodNonlinearOperator, cache::Nothing)
@ Gridap.Algebra C:\Users\larsu.julia\packages\Gridap\OTENN\src\Algebra\NLSolvers.jl:138
[21] solve_step!(uf::Vector{Float64}, solver::ThetaMethod, op::Gridap.ODEs.TransientFETools.ODEOpFromFEOp{Gridap.ODEs.ODETools.Nonlinear}, u0::Vector{Float64}, t0::Int64, cache::Nothing)
@ Gridap.ODEs.ODETools C:\Users\larsu.julia\packages\Gridap\OTENN\src\ODEs\ODETools\ThetaMethod.jl:44
[22] solve_step!(uF::Vector{Float64}, solver::ThetaMethod, op::Gridap.ODEs.TransientFETools.ODEOpFromFEOp{Gridap.ODEs.ODETools.Nonlinear}, u0::Vector{Float64}, t0::Int64)
@ Gridap.ODEs.ODETools C:\Users\larsu.julia\packages\Gridap\OTENN\src\ODEs\ODETools\ODESolvers.jl:27
[23] iterate(sol::Gridap.ODEs.ODETools.GenericODESolution{Vector{Float64}})
@ Gridap.ODEs.ODETools C:\Users\larsu.julia\packages\Gridap\OTENN\src\ODEs\ODETools\ODESolutions.jl:47
[24] iterate(sol::TransientFESolution)
@ Gridap.ODEs.TransientFETools C:\Users\larsu.julia\packages\Gridap\OTENN\src\ODEs\TransientFETools\TransientFESolutions.jl:65
[25] top-level scope
@ c:\Users\larsu\Documents\Universiteit Master\Design Project\Julia\Gridap-thermal\thermalfluid.jl:104

as a result of running the following code:

code

using DrWatson
using DifferentialEquations
@quickactivate “PorousMediumFlow”
using Gridap
using ForwardDiff
using LinearAlgebra
using Test
using Gridap.ODEs.TransientFETools
using Gridap.FESpaces
using Gridap.Arrays: test_array
using Plots
using Gmsh
using GridapGmsh
using Gridap.Algebra;
using Gridap.FESpaces
using Gridap.ReferenceFEs
using Gridap.Arrays
using Gridap.Geometry
using Gridap.Fields
using Gridap.CellData
using Gridap.Geometry
#using DifferentialEquations
#using GridapODEs
#using GridapODEs.ODETools
#using GridapODEs.TransientFETools
#using Gridap.ODEs
#using Gridap.ODEs.ODETools
using LineSearches: BackTracking
using WriteVTK
using DelimitedFiles, FileIO, Dates
using JLD2, DataFrames, TimerOutputs
using IncompleteLU, IterativeSolvers
using BenchmarkTools
#using NLsolve
#using NLSolvers
#using NLSolversBase

model = GmshDiscreteModel(“transformer_stedin_thermaltest.msh”)

k = 2;
Ω = Triangulation(model)
degree = 2*k;
dΩ = Measure(Ω,degree)

labels = get_face_labeling(model)

u_wall(x, t::Real) = VectorValue(0.0, 0.0)
u_wall(t::Real) = x → u_wall(x, t)

# Velocity FE space
reffeᵤ = ReferenceFE(lagrangian,VectorValue{2,Float64},k)
V₀ = TestFESpace(model, reffeᵤ, conformity=:H1, dirichlet_tags=["Enclosure", "Core Boundary", "HV windings Boundary", "LV Windings Boundary"])
U = TransientTrialFESpace(V₀, [u_wall,u_wall,u_wall,u_wall])

# Pressure FE space
reffeₚ = ReferenceFE(lagrangian,Float64,1)
Q = FESpace(model, reffeₚ, conformity=:C0)
P = TrialFESpace(Q)

# Temperature FE space
reffeₜ = ReferenceFE(lagrangian,Float64,1)
S₀ = FESpace(model, reffeₜ, conformity=:C0)
S = TransientTrialFESpace(S₀) #T

# Combining in multi-field
Y = MultiFieldFESpace([V₀,Q,S₀])
X = TransientMultiFieldFESpace([U,P,S])

# variables
theta = 0.5 ;
ρ₀  = 1;
cₚ  = 1;
nu  = 1;
g   = 1;
β   =1 ;
T₀  = 1 ;

Residual

a(u,q)          = ∫(∇(u) ⋅ q)dΩ
b((u,p,T),v)    = ∫(ρ₀⋅(∂t(u)⋅v) + ρ₀⋅(((∇(u)')⋅u)⋅v) - ∇(p)⋅v - nu⋅(∇(u)⋅∇(v)) - ρ₀⋅g⋅(1-β⋅(T-T₀))⋅v)dΩ
c((u,T),s)             = ∫(ρ₀⋅cₚ⋅(∂t(T)⋅s) + ρ₀⋅cₚ⋅(u⋅∇(T)⋅s) - ∇(T)⋅∇(s))dΩ

res(t,(u,p,T),(q,v,s)) = a(u,q) + b((u,p,T),v) + c((u,T),s)

op = TransientFEOperator(res,X,Y)



# solver
t0=0
t1=0.2
xh0 = interpolate_everywhere([VectorValue(0.0,0.0),0.0,0.0],X(0.0))
dt = 0.05
θ = 0.5
ls = LUSolver()

using Gridap.Algebra: NewtonRaphsonSolver
nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking())
solver = ThetaMethod(nls,dt,θ)
xh_1 = Gridap.solve(solver, op, xh0, t0, t1)

pvd = paraview_collection(datadir(“sims”)*“\ collection_ups”, append=false)

for (xh_tn, tn) in xh_1
uh, sh, ph, ηh = xh_tn
t_doc = tn #round(tn; digits=3)
pvd[tn] = createvtk(Ω, datadir(“sims”,stage)*“\FS$t_doc.vtu”, cellfields = [“uh” => uh, “ph” => ph, “sh” => sh]) #
end

I am quite positive that there is something wrong with my weak form/residual formulation but I cannot determine what it is. Any insights of experienced users would be greatly appreciated.