Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capability to not perform reinterpolation #57

Merged
merged 53 commits into from
Dec 16, 2022
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
258de35
add flags and capability to convert the raw solution data into vtu f…
andrewwinters5000 Nov 24, 2022
21fe1ac
Merge branch 'main' into convert-raw
ranocha Nov 25, 2022
cadfbff
Merge branch 'main' into convert-raw
andrewwinters5000 Nov 29, 2022
2a4b617
simplify how raw data is copied
andrewwinters5000 Dec 1, 2022
09fe034
working version across all mesh types
andrewwinters5000 Dec 1, 2022
dc3ecc3
Merge branch 'main' into convert-raw
andrewwinters5000 Dec 1, 2022
aaab1d1
rearrange to fix setting incorrect nvisnodes
andrewwinters5000 Dec 1, 2022
0127d98
add tests using ReadVTK instead of comparing hashes
andrewwinters5000 Dec 1, 2022
0a55363
for now add the reference files to this repo. possibly change
andrewwinters5000 Dec 1, 2022
6c59553
remove reference files from repo
andrewwinters5000 Dec 2, 2022
6d8da8d
update all 2d tests. pass locally
andrewwinters5000 Dec 2, 2022
9eb67d3
update the testing functions
andrewwinters5000 Dec 2, 2022
95c0019
remove unnecessary code
andrewwinters5000 Dec 2, 2022
42c9660
remove extra space
andrewwinters5000 Dec 2, 2022
e2b3323
adjust default setting for the mesh visualization
andrewwinters5000 Dec 2, 2022
5120881
new battery of 3D tests. All pass locally
andrewwinters5000 Dec 2, 2022
42f2340
update 2D tests to grab files from Trixi2Vtk_reference_files repo
andrewwinters5000 Dec 2, 2022
ec176e1
add a delete of the local reference files folder
andrewwinters5000 Dec 2, 2022
699b5cf
ignore the reference_files folder
andrewwinters5000 Dec 2, 2022
7be6b50
update 3D tests to grab files from Trixi2Vtk_reference_files repo
andrewwinters5000 Dec 2, 2022
cb545a8
remove unused dependency
andrewwinters5000 Dec 2, 2022
9dd56e4
introduce new testing functions and ability to grab reference files f…
andrewwinters5000 Dec 2, 2022
bc408d8
forgot to update a docstring
andrewwinters5000 Dec 2, 2022
d779e50
remove need for artifacts folder
andrewwinters5000 Dec 3, 2022
b9b62ad
reorganize new tests and clarify filenames.
andrewwinters5000 Dec 5, 2022
c75c5a8
fix broken file paths for Windows system
andrewwinters5000 Dec 5, 2022
a876ccd
reinstate that test files are stored in an artifacts folder for debug…
andrewwinters5000 Dec 5, 2022
89d9634
Merge branch 'main' into convert-raw
andrewwinters5000 Dec 6, 2022
191432e
adjust testing to avoid problematic terms from ReadVTK
andrewwinters5000 Dec 6, 2022
97dd1ad
for now comment out vti stuff to get an idea of code coverage
andrewwinters5000 Dec 6, 2022
c45d4ae
add workaround to get Windows tests to pass
andrewwinters5000 Dec 6, 2022
07ae8a5
add additional manual tests
andrewwinters5000 Dec 7, 2022
190ba92
workaorund to not save artifacts on Windows runners. Hopefully addres…
andrewwinters5000 Dec 7, 2022
d4a96c2
fix broken test due to Windows globbing. Artifacts folder isn't the p…
andrewwinters5000 Dec 7, 2022
69f98b8
Change such that Windows only runs the TreeMesh tests
andrewwinters5000 Dec 7, 2022
46bc2f0
no longer need to load test_skip command
andrewwinters5000 Dec 7, 2022
db9d2c7
put VTI output routines back in
andrewwinters5000 Dec 8, 2022
f071a55
add error message if output format and mesh type are incompatible
andrewwinters5000 Dec 8, 2022
95e260d
update test reference files tag and add new VTI tests
andrewwinters5000 Dec 8, 2022
17c33c5
typo fix
andrewwinters5000 Dec 8, 2022
77e2f72
remove unnecessary comments
andrewwinters5000 Dec 15, 2022
c7a0f7c
improve logic for format and mesh check
andrewwinters5000 Dec 15, 2022
054c0ca
remove empty nodeset declaration
andrewwinters5000 Dec 15, 2022
2150dff
Apply suggestions from code review
andrewwinters5000 Dec 16, 2022
a676f0c
add missing header tests to cell data function
andrewwinters5000 Dec 16, 2022
e071b22
adjust node_set creation and revert function to set the n_visnodes fo…
andrewwinters5000 Dec 16, 2022
b98bdbb
VTI format check only applies to TreeMesh{2}
andrewwinters5000 Dec 16, 2022
aaaabc6
make sure that node_set is always the same type
andrewwinters5000 Dec 16, 2022
2aa5532
name change compare_cell_info -> compare_cell_data
andrewwinters5000 Dec 16, 2022
67a3eb8
name change compare_point_info -> compare_point_data
andrewwinters5000 Dec 16, 2022
c7667c6
remove unnecessary spaces
andrewwinters5000 Dec 16, 2022
ab0617f
remove unnecessary spaces
andrewwinters5000 Dec 16, 2022
a6e4104
Merge branch 'convert-raw' of github.com:trixi-framework/Trixi2Vtk.jl…
andrewwinters5000 Dec 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adjust node_set creation and revert function to set the n_visnodes fo…
…r the mesh conversion
  • Loading branch information
andrewwinters5000 committed Dec 16, 2022
commit e071b226a102e5b6c9892dfc0f66f4b9bad98d91
42 changes: 27 additions & 15 deletions src/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,24 @@ function trixi2vtk(filename::AbstractString...;
if !reinterpolate
n_visnodes = n_nodes
end

# Check if the raw data is uniform (finite difference) or not (dg)
# and create the corresponding node set for reinterpolation / copying.
if (reinterpolate && !data_is_uniform) || (!reinterpolate && data_is_uniform)
# (1) Default settings; presumably the most common
# (2) Finite difference data
node_set = range(-1, 1, length=n_visnodes)
elseif !reinterpolate && !data_is_uniform
# raw data is on a set of LGL nodes
node_set, _ = gauss_lobatto_nodes_weights(n_visnodes)
else # reinterpolate & data_is_uniform
throw(ArgumentError("Uniform data should not be reinterpolated! Set `reinterpolate=false` and try again."))
end
else
# If file is a mesh file, do not interpolate data as detailed
n_visnodes = get_default_nvisnodes_mesh(nvisnodes, mesh)
end

# Check if the raw data is uniform (finite difference) or not (dg)
# and create the corresponding node set for reinterpolation / copying.
if (reinterpolate && !data_is_uniform) || (!reinterpolate && data_is_uniform)
# (1) Default settings; presumably the most common
# (2) Finite difference data
node_set = range(-1, 1, length=n_visnodes)
elseif !reinterpolate && !data_is_uniform
# raw data is on a set of LGL nodes
node_set, _ = gauss_lobatto_nodes_weights(n_visnodes)
else # reinterpolate & data_is_uniform
throw(ArgumentError("Uniform data should not be reinterpolated! Set `reinterpolate=false` and try again."))
# Create an "empty" node set that is unused in the mesh conversion
node_set = Array{Float64}(undef, n_visnodes)
end

# Create output directory if it does not exist
Expand Down Expand Up @@ -314,11 +316,21 @@ function get_default_nvisnodes_solution(nvisnodes, n_nodes,
end


# default number of visualization nodes if only the mesh should be visualized
function get_default_nvisnodes_mesh(nvisnodes, mesh::TreeMesh)
if nvisnodes === nothing
# for a Cartesian mesh, we do not need to interpolate
return 1
else
return nvisnodes
end
end

# default number of visualization nodes if only the mesh should be visualized
function get_default_nvisnodes_mesh(nvisnodes,
mesh::Union{TreeMesh, StructuredMesh, UnstructuredMesh2D, P4estMesh})
mesh::Union{StructuredMesh, UnstructuredMesh2D, P4estMesh})
if nvisnodes === nothing
# we need to get at least the vertices
# for curved meshes, we need to get at least the vertices
return 2
else
return nvisnodes
Expand Down