commit 07b08eaca9236016b40042aa9255d00316fa365c
parent c41c192c598f711e292a0520757a8304a7dae01d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 2 Mar 2025 21:34:47 +0100
Write the vtk-data manual
Diffstat:
3 files changed, 110 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
@@ -3,7 +3,6 @@
.config
.gitignore
*.pc
-vtk-cell-data
smsh2vtk
smsh-desc
*.so
@@ -11,3 +10,4 @@ smsh-desc
tags
test*
!test*.[ch]
+vtk-data
diff --git a/Makefile b/Makefile
@@ -133,6 +133,7 @@ install: library utils pkg
install 644 "$(DESTDIR)$(INCPREFIX)/star" src/smsh.h; \
install 644 "$(DESTDIR)$(MANPREFIX)/man1" doc/smsh2vtk.1; \
install 644 "$(DESTDIR)$(MANPREFIX)/man1" doc/smsh-desc.1; \
+ install 644 "$(DESTDIR)$(MANPREFIX)/man1" doc/vtk-data.1; \
install 644 "$(DESTDIR)$(MANPREFIX)/man5" doc/smsh.5; \
install 644 "$(DESTDIR)$(PREFIX)/share/doc/star-mesh" COPYING README.md
@@ -142,6 +143,7 @@ uninstall:
rm -f "$(DESTDIR)$(INCPREFIX)/star/smsh.h"
rm -f "$(DESTDIR)$(MANPREFIX)/man1/smsh2vtk.1"
rm -f "$(DESTDIR)$(MANPREFIX)/man1/smsh-desc.1"
+ rm -f "$(DESTDIR)$(MANPREFIX)/man1/vtk-data.1"
rm -f "$(DESTDIR)$(MANPREFIX)/man5/smsh.5"
rm -f "$(DESTDIR)$(PREFIX)/share/doc/star-mesh/COPYING"
rm -f "$(DESTDIR)$(PREFIX)/share/doc/star-mesh/README.md"
@@ -151,6 +153,7 @@ lint:
mandoc -T lint -Wbase doc/smsh.5
mandoc -T lint -Wbase doc/smsh2vtk.1 || [ $$? -eq 1 ];
mandoc -T lint -Wbase doc/smsh-desc.1 || [ $$? -eq 1 ];
+ mandoc -T lint -Wbase doc/vtk-data.1
clean: clean_test
rm -f $(DEP) $(OBJ) $(LIBNAME)
diff --git a/doc/vtk-data.1 b/doc/vtk-data.1
@@ -0,0 +1,106 @@
+.\" Copyright (C) 2020-2023, 2025 |Méso|Star> (contact@meso-star.com)
+.\"
+.\" This program is free software: you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation, either version 3 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
+.Dd March 2, 2025
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Dt VTK-CELL-DATA 1
+.Os
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh NAME
+.Nm vtk-cell-data
+.Nd transforms a list of values into cell data in VTK format
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh SYNOPSIS
+.Nm
+.Op Fl n Ar name No ...
+.Op Fl o Ar output
+.Fl c Ar cell_count
+.Op Ar data
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh DESCRIPTION
+.Nm
+formats a list of double precision values in cell data sets as defined in the
+legacy VTK format.
+To describe a valid VTK file, the result must then be concatenated with a VTK
+file storing the geometry of the cells to which this data corresponds.
+.Pp
+As input,
+.Nm
+reads a set of
+.Ar cell_count
+floating-point ASCII values from
+.Ar data
+or from standard input if
+.Ar data
+is not specified.
+This continues until no more data is supplied or 8 sets have been read.
+Each set thus represents a data set associated with each cell.
+If a set doesn't contain enough data
+.Pq i.e. less than Ar cell_count ,
+an error is returned.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl n Ar name
+Name of a data set.
+It cannot contain spaces or tabs.
+This option can be repeated as many times as there are data sets to be
+processed.
+By default, the name of each dataset is
+.Qq data Ns Ar i ,
+with
+.Ar i
+in
+.Bq 0,7
+the dataset index.
+.It Fl o Ar output
+Output file.
+If not defined, VTK output data is written to the standard output.
+.It Fl c Ar cell_count
+Number of cells, i.e. number of floating-point values provided per data set.
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh EXIT STATUS
+.Ex -std
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh EXAMPLES
+Formats a list of 200 floating-point ASCII values read from the
+.Pa data.txt
+file into two sets of
+.Ar 100
+values, one value per cell.
+Name the first set of data per cell
+.Dq temperature ,
+and the second
+.Dq flux .
+Output VTK data are written to
+.Pa data.vtk .
+Next, concatenate the cell data with their corresponding geometry stored in the
+.Pa mesh.vtk
+file, and thus define the complete VTK file
+.Pa results.vtk .
+.Bd -literal -offset Ds
+vtk-cell-data -c 100 -n temperature -n flux -o data.vtk data.txt
+cat mesh.vtk data.vtk > result.vtk
+.Ed
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh STANDARDS
+.Rs
+.%B The VTK User's Guide
+.%O Simple Legacy Formats
+.%I Kitware, Inc
+.%N 11
+.%D 2010
+.%P 470--482
+.Re