File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 223223Project `vals` to the grid nodes with `proj` and save to `vtk`.
224224"""
225225function write_projection (vtk:: VTKGridFile , proj:: L2Projector , vals, name)
226- data = _evaluate_at_grid_nodes (proj, vals, #= vtk=# Val (true )):: Matrix
227- @assert size (data, 2 ) == getnnodes (get_grid (proj. dh))
228- _vtk_write_node_data (vtk. vtk, data, name; component_names = component_names (eltype (vals)))
226+ if write_discontinuous (vtk)
227+ # @assert first(vals) isa Number
228+ data = evaluate_at_discontinuous_vtkgrid_nodes (proj. dh, vals, only (getfieldnames (proj. dh)), vtk. cellnodes)
229+ comp_names = [" x" , " y" , " z" ][1 : size (data, 1 )]
230+ else
231+ data = _evaluate_at_grid_nodes (proj, vals, #= vtk=# Val (true )):: Matrix
232+ @assert size (data, 2 ) == getnnodes (get_grid (proj. dh))
233+ comp_names = component_names (eltype (vals))
234+ end
235+
236+ _vtk_write_node_data (vtk. vtk, data, name; component_names = comp_names)
229237 return vtk
230238end
231239
You can’t perform that action at this time.
0 commit comments