Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds to the Paraview docs describing how to create a time series (`.series`) file to load and re-load plotfiles similar to the `.visit` file in VisIt. A bash script to generate the `.series` file is provided and the procedure to generate and (re)load the `.series` file is described.
- Loading branch information
Showing
3 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+148 KB
Docs/sphinx_documentation/source/Visualization/ParaView_series_reload.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions
56
Docs/sphinx_documentation/source/Visualization/write_series_file.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
# Specify the root directory for traversal | ||
root_directory="./" | ||
|
||
# Create a temporary file to store the list of directories | ||
temp_file=$(mktemp) | ||
find "$root_directory" -type d -print0 > "$temp_file" | ||
|
||
# Initialize an empty string to store file information | ||
files_list="" | ||
|
||
# file counter to be used as time entry | ||
count=0 | ||
|
||
ls -d */ | sort -z > temporary_file | ||
|
||
# Read from the temporary file | ||
for dir in */; do | ||
|
||
dir_name=$(basename "$dir") | ||
|
||
# Check if the folder starts with "plt" and contains a file named "Header" | ||
if [[ "$dir_name" == plt* && -f "$dir/Header" ]]; then | ||
# Extract version number from folder name | ||
version="${dir_name#plt}" | ||
echo $version | ||
|
||
# Create file information | ||
files_list+="$(printf "{ \"name\": \"plt$version\", \"time\": $count},")" | ||
files_list+=$'\n' | ||
|
||
((count++)) | ||
fi | ||
done < "$temp_file" | ||
|
||
# Remove trailing comma from the last entry | ||
files_list="${files_list%,}" | ||
|
||
# Create the final JSON structure | ||
# Header line | ||
header_line="{ \"file-series-version\": \"1.0\", \"files\": [" | ||
# Write the files list | ||
all_files="$(printf '%s\n' "$files_list") ] }" | ||
|
||
file_series_data="$header_line" | ||
file_series_data+=$'\n' | ||
file_series_data+="$all_files" | ||
|
||
# Write the generated JSON structure to a file named plot_files.series | ||
echo "$file_series_data" > plot_files.series | ||
|
||
# Remove the temporary file | ||
rm "$temp_file" | ||
|
||
echo "JSON structure has been written to plot_files.series" |