Skip to content

Commit

Permalink
Merge pull request #551 from gridap/get_cell_points_for_celldof
Browse files Browse the repository at this point in the history
Implemented get_cell_points for CellDof
  • Loading branch information
fverdugo authored Mar 3, 2021
2 parents ce72a9f + fbd8898 commit 08fea6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/CellData/CellDofs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ function change_domain(a::CellDof,target_trian::RestrictedTriangulation,target_d
CellDof(tcell_dof,target_trian,DomainStyle(a))
end


function get_cell_points(dofs::CellDof)
cell_to_x = lazy_map(get_nodes,get_data(dofs))
CellPoint(cell_to_x,get_triangulation(dofs),DomainStyle(dofs))
end

# Evaluation of CellDof

Expand Down
8 changes: 8 additions & 0 deletions test/CellDataTests/CellDofsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ a = s(v)
r = fill(Matrix(I,4,4),num_cells(trian))
test_array(a,r)

x = get_cell_points(s)
vx = v(x)
test_array(vx,r)

acell_to_cell = [1,3,5,3]
atrian = Triangulation(trian,acell_to_cell)
s_a = change_domain(s,atrian,DomainStyle(s))
Expand All @@ -39,4 +43,8 @@ a = s_a(v_a)
r = fill(Matrix(I,4,4),num_cells(atrian))
test_array(a,r)

x_a = get_cell_points(s_a)
vx_a = v(x_a)
test_array(vx_a,r)

end # module

0 comments on commit 08fea6d

Please sign in to comment.