Assemble load line vector

hi, I want to integrate applied displacement on a load line and assemble the vector on my FE test space(V0_Disp) but it gives me error. is there anyone who knows what should i do to solve this?

dirichlet_tags = ["LeftSupport","RightSupport","LoadLine"],
    dirichlet_masks =[(false ,true), (true ,true), (false ,true)])
uApp3 = VectorValue(0.0,-vAppMax)
labels = get_face_labeling(model)
LoadTagId = get_tag_from_name(labels ,"LoadLine")
Γ_Load = BoundaryTriangulation(model ;tags = LoadTagId)
dΓ_Load = Measure(Γ_Load ,degree)
b_vec = assemble_vector((v->∫(v)fem_params.dΓ_Load)∘ uApp3, fem_params.V0_Disp)

the error is

AssertionError: ndims(eltype(cell_vec)) == 1

 [1] collect_cell_vector(test::Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{VectorValue{2, Int32}}}, a::DomainContribution)
   @ Gridap.FESpaces C:\Users\marya\.julia\packages\Gridap\971dU\src\FESpaces\Assemblers.jl:420
 [2] assemble_vector(f::ComposedFunction{var"#242#243", typeof(uApp3)}, a::Gridap.FESpaces.GenericSparseMatrixAssembler, V::Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{VectorValue{2, Int32}}})
   @ Gridap.FESpaces C:\Users\marya\.julia\packages\Gridap\971dU\src\FESpaces\Assemblers.jl:296
 [3] assemble_vector(f::Function, V::Gridap.FESpaces.UnconstrainedFESpace{Vector{Float64}, Gridap.FESpaces.NodeToDofGlue{VectorValue{2, Int32}}})
   @ Gridap.FESpaces C:\Users\marya\.julia\packages\Gridap\971dU\src\FESpaces\Assemblers.jl:352
 [4] top-level scope
   @ In[95]:7

or any other ways to define load on load line?
thank you!

What is fem_params.V0_Disp? The error message suggests that there’s a Matrix instead of a Vector somewhere.

it is FE test space

are there any suggestion for this issue?

There isn’t really much we can suggest here; the error message communicates that it needs to be a collection of vectors, not matrices. My best guess is that the function you’re passing to assemble_vector returns a matrix instead of a vector.

I’m not familiar with Gridap, but there really isn’t enough information to give more specific help here, sorry :person_shrugging:

1 Like

thank you for your response