I just did for those points but as i want to plot both togatehr it gives me error because number of nodes are different in 2 optimizations.
writevtk(Ω,"shapmbb",cellfields=["p_opt"=>p_opt, "p_opt2"=>p_opt2])
error
AssertionError:
You are trying to build a CellField from an array of length 20
on a Triangulation with 14573 cells. The length of the given array
and the number of cells should match.
Stacktrace:
[1] macro expansion
@ C:\Users\marya\.julia\packages\Gridap\971dU\src\Helpers\Macros.jl:60 [inlined]
[2] CellField(f::Vector{Float64}, trian::BodyFittedTriangulation{2, 2, UnstructuredDiscreteModel{2, 2, Float64, NonOriented}, UnstructuredGrid{2, 2, Float64, NonOriented, Nothing}, Gridap.Arrays.IdentityVector{Int64}}, domain_style::ReferenceDomain)
@ Gridap.CellData C:\Users\marya\.julia\packages\Gridap\971dU\src\CellData\CellFields.jl:90
[3] CellField
@ C:\Users\marya\.julia\packages\Gridap\971dU\src\CellData\CellFields.jl:104 [inlined]
[4] _prepare_pdata(trian::BodyFittedTriangulation{2, 2, UnstructuredDiscreteModel{2, 2, Float64, NonOriented}, UnstructuredGrid{2, 2, Float64, NonOriented, Nothing}, Gridap.Arrays.IdentityVector{Int64}}, cellfields::Vector{Pair{String, Vector{Float64}}}, samplingpoints::Gridap.Arrays.CompressedArray{Vector{VectorValue{2, Float64}}, 1, Vector{Vector{VectorValue{2, Float64}}}, Vector{Int8}})
@ Gridap.Visualization C:\Users\marya\.julia\packages\Gridap\971dU\src\Visualization\VisualizationData.jl:140
[5] visualization_data(trian::BodyFittedTriangulation{2, 2, UnstructuredDiscreteModel{2, 2, Float64, NonOriented}, UnstructuredGrid{2, 2, Float64, NonOriented, Nothing}, Gridap.Arrays.IdentityVector{Int64}}, filebase::String; order::Int64, nsubcells::Int64, celldata::Dict{Any, Any}, cellfields::Vector{Pair{String, Vector{Float64}}})
@ Gridap.Visualization C:\Users\marya\.julia\packages\Gridap\971dU\src\Visualization\VisualizationData.jl:47
[6] writevtk(::BodyFittedTriangulation{2, 2, UnstructuredDiscreteModel{2, 2, Float64, NonOriented}, UnstructuredGrid{2, 2, Float64, NonOriented, Nothing}, Gridap.Arrays.IdentityVector{Int64}}, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Vector{Pair{String, Vector{Float64}}}, Tuple{Symbol}, NamedTuple{(:cellfields,), Tuple{Vector{Pair{String, Vector{Float64}}}}}})
@ Gridap.Visualization C:\Users\marya\.julia\packages\Gridap\971dU\src\Visualization\Vtk.jl:4
[7] top-level scope
@ In[137]:1
and p_opt2 are optimization in those special points.