commit 10df8073cc1a3f90a082db9b80b7e47c07c85fec
parent 2e0b73bd98b3f12ec3fcf815fc9dab9ec6201efb
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 9 Feb 2024 15:45:34 +0100
Merge branch 'feature_posix_make' into develop
Diffstat:
11 files changed, 2217 insertions(+), 21 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,12 +1,13 @@
.gitignore
-CMakeCache.txt
-CMakeFiles
-Makefile
-tmp
[Bb]uild*
*.sw[po]
-*.[ao]
+*.[aod]
*~
tags
-*.orig
-
+.config
+src/stardis-default.h
+src/stardis-green-types.h
+src/stardis-prog-properties.h
+src/stardis-version.h
+stardis
+doc/stardis.1
diff --git a/Makefile b/Makefile
@@ -0,0 +1,192 @@
+# Copyright (C) 2018-2023 |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/>.
+
+.POSIX:
+.SUFFIXES: # Clean up default inference rules
+
+include config.mk
+
+MPI_DEF = -DSTARDIS_ENABLE_MPI
+
+# Default target
+all: build_executable man
+
+################################################################################
+# Program building
+################################################################################
+SRC =\
+ src/stardis-app.c\
+ src/stardis-args.c\
+ src/stardis-compute.c\
+ src/stardis-description.c\
+ src/stardis-fluid.c\
+ src/stardis-fluid-prog.c\
+ src/stardis-fbound.c\
+ src/stardis-fbound-prog.c\
+ src/stardis-hbound.c\
+ src/stardis-hbound-prog.c\
+ src/stardis-hfbound.c\
+ src/stardis-hfbound-prog.c\
+ src/stardis-intface.c\
+ src/stardis-main.c\
+ src/stardis-output.c\
+ src/stardis-parsing.c\
+ src/stardis-program.c\
+ src/stardis-sfconnect.c\
+ src/stardis-sfconnect-prog.c\
+ src/stardis-ssconnect.c\
+ src/stardis-ssconnect-prog.c\
+ src/stardis-solid.c\
+ src/stardis-solid-prog.c\
+ src/stardis-tbound.c\
+ src/stardis-tbound-prog.c
+
+# Headers to configure
+HDR=\
+ src/stardis-default.h\
+ src/stardis-green-types.h\
+ src/stardis-prog-properties.h\
+ src/stardis-version.h
+
+OBJ = $(SRC:.c=.o)
+DEP = $(SRC:.c=.d)
+
+build_executable: .config $(HDR) $(DEP)
+ @$(MAKE) -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) stardis
+
+$(DEP) $(OBJ): config.mk
+
+stardis: $(OBJ)
+ $(CC) $(CFLAGS) $(DPDC_CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(DPDC_LIBS)
+
+.config: config.mk
+ @if [ "$(DISTRIB_PARALLELISM)" = "MPI" ]; then \
+ if ! $(PKG_CONFIG) --atleast-version $(MPI_VERSION) $(MPI_PC); then \
+ echo "$(MPI_PC) $(MPI_VERSION) not found" >&2; exit 1; fi; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys; then \
+ echo "rsys $(RSYS_VERSION) not found" >&2; exit 1; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(S3D_VERSION) s3d; then \
+ echo "s3d $(S3D_VERSION) not found" >&2; exit 1; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(SDIS_VERSION) sdis; then \
+ echo "sdis $(SDIS_VERSION) not found" >&2; exit 1; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(SENC3D_VERSION) senc3d; then \
+ echo "senc3d $(SENC3D_VERSION) not found" >&2; exit 1; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(SG3D_VERSION) sg3d; then \
+ echo "sg3d $(SG3D_VERSION) not found" >&2; exit 1; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(SSP_VERSION) star-sp; then \
+ echo "star-sp $(SSP_VERSION) not found" >&2; exit 1; fi
+ @if ! $(PKG_CONFIG) --atleast-version $(SSTL_VERSION) sstl; then \
+ echo "sstl $(SSTL_VERSION) not found" >&2; exit 1; fi
+ @echo "config done" > $@
+
+src/stardis-default.h: config.mk src/stardis-default.h.in
+ sed -e 's/@STARDIS_ARGS_DEFAULT_TRAD@/$(STARDIS_ARGS_DEFAULT_TRAD)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_TRAD_REFERENCE@/$(STARDIS_ARGS_DEFAULT_TRAD_REFERENCE)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_COMPUTE_TIME@/$(STARDIS_ARGS_DEFAULT_COMPUTE_TIME)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_PICARD_ORDER@/$(STARDIS_ARGS_DEFAULT_PICARD_ORDER)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_FOV@/$(STARDIS_ARGS_DEFAULT_RENDERING_FOV)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_IMG_HEIGHT@/$(STARDIS_ARGS_DEFAULT_RENDERING_IMG_HEIGHT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_IMG_WIDTH@/$(STARDIS_ARGS_DEFAULT_RENDERING_IMG_WIDTH)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_OUTPUT_FILE_FMT@/$(STARDIS_ARGS_DEFAULT_RENDERING_OUTPUT_FILE_FMT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_POS@/$(STARDIS_ARGS_DEFAULT_RENDERING_POS)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_SPP@/$(STARDIS_ARGS_DEFAULT_RENDERING_SPP)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_TGT@/$(STARDIS_ARGS_DEFAULT_RENDERING_TGT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_TIME@/$(STARDIS_ARGS_DEFAULT_RENDERING_TIME)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_UP@/$(STARDIS_ARGS_DEFAULT_RENDERING_UP)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_SAMPLES_COUNT@/$(STARDIS_ARGS_DEFAULT_SAMPLES_COUNT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_SCALE_FACTOR@/$(STARDIS_ARGS_DEFAULT_SCALE_FACTOR)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL@/$(STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL)/' \
+ $@.in > $@
+
+src/stardis-version.h: config.mk src/stardis-version.h.in
+ sed -e 's/@STARDIS_APP_VERSION_MAJOR@/$(VERSION_MAJOR)/' \
+ -e 's/@STARDIS_APP_VERSION_MINOR@/$(VERSION_MINOR)/' \
+ -e 's/@STARDIS_APP_VERSION_PATCH@/$(VERSION_PATCH)/' \
+ $@.in > $@
+
+src/stardis-green-types.h: config.mk src/stardis-green-types.h.in
+ sed -e 's/@STARDIS_GREEN_TYPES_VERSION@/$(GREEN_TYPES_VERSION)/' \
+ $@.in > $@
+
+src/stardis-prog-properties.h: config.mk src/stardis-prog-properties.h.in
+ sed -e 's/@STARDIS_PROG_PROPERTIES_VERSION@/$(PROG_PROPERTIES_VERSION)/' \
+ $@.in > $@
+
+.SUFFIXES: .c .d .o
+.c.d:
+ @$(CC) $(CFLAGS) $(DPDC_CFLAGS) $($(DISTRIB_PARALLELISM)_DEF) -MM -MT \
+ "$(@:.d=.o) $@" $< -MF $@
+
+.c.o:
+ $(CC) $(CFLAGS) $(DPDC_CFLAGS) $($(DISTRIB_PARALLELISM)_DEF) -c $< -o $@
+
+################################################################################
+# Man pages
+################################################################################
+man: doc/stardis.1
+
+doc/stardis.1: doc/stardis.1.in
+ sed -e 's/@STARDIS_ARGS_DEFAULT_COMPUTE_TIME@/$(STARDIS_ARGS_DEFAULT_COMPUTE_TIME)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_PICARD_ORDER@/$(STARDIS_ARGS_DEFAULT_PICARD_ORDER)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_FOV@/$(STARDIS_ARGS_DEFAULT_RENDERING_FOV)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_IMG_HEIGHT@/$(STARDIS_ARGS_DEFAULT_RENDERING_IMG_HEIGHT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_IMG_WIDTH@/$(STARDIS_ARGS_DEFAULT_RENDERING_IMG_WIDTH)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_OUTPUT_FILE_FMT@/$(STARDIS_ARGS_DEFAULT_RENDERING_OUTPUT_FILE_FMT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_POS@/$(STARDIS_ARGS_DEFAULT_RENDERING_POS)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_SPP@/$(STARDIS_ARGS_DEFAULT_RENDERING_SPP)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_TGT@/$(STARDIS_ARGS_DEFAULT_RENDERING_TGT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_TIME@/$(STARDIS_ARGS_DEFAULT_RENDERING_TIME)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_RENDERING_UP@/$(STARDIS_ARGS_DEFAULT_RENDERING_UP)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_SAMPLES_COUNT@/$(STARDIS_ARGS_DEFAULT_SAMPLES_COUNT)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_SCALE_FACTOR@/$(STARDIS_ARGS_DEFAULT_SCALE_FACTOR)/' \
+ -e 's/@STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL@/$(STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL)/' \
+ $@.in > $@
+
+################################################################################
+# Installation
+################################################################################
+install: all
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/bin" stardis
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/stardis" src/stardis-green-types.h
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/stardis" src/stardis-prog-properties.h
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/doc/stardis" COPYING README.md
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/man/man1" doc/stardis.1
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/man/man5" doc/stardis-input.5
+ @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/man/man5" doc/stardis-output.5
+
+uninstall:
+ rm -f "$(DESTDIR)$(PREFIX)/bin/stardis"
+ rm -f "$(DESTDIR)$(PREFIX)/include/stardis/stardis-green-types.h"
+ rm -f "$(DESTDIR)$(PREFIX)/include/stardis/stardis-prog-properties.h"
+ rm -f "$(DESTDIR)$(PREFIX)/share/doc/stardis/COPYING"
+ rm -f "$(DESTDIR)$(PREFIX)/share/doc/stardis/README.md"
+ rm -f "$(DESTDIR)$(PREFIX)/share/man/man1/stardis.1"
+ rm -f "$(DESTDIR)$(PREFIX)/share/man/man5/stardis-input.5"
+ rm -f "$(DESTDIR)$(PREFIX)/share/man/man5/stardis-output.5"
+
+################################################################################
+# Miscellaneous targets
+################################################################################
+clean:
+ rm -f $(HDR) $(OBJ) .config stardis doc/stardis.1
+
+distclean: clean
+ rm -f $(DEP)
+
+lint: man
+ shellcheck -o all make.sh
+ mandoc -Tlint -Wall doc/stardis.1 || [ $$? -le 1 ]
+ mandoc -Tlint -Wall doc/stardis-input.5 || [ $$? -le 1 ]
+ mandoc -Tlint -Wall doc/stardis-output.5 || [ $$? -le 1 ]
diff --git a/config.mk b/config.mk
@@ -0,0 +1,154 @@
+VERSION_MAJOR = 0
+VERSION_MINOR = 10
+VERSION_PATCH = 0
+VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
+PREFIX = /usr/local
+
+GREEN_TYPES_VERSION = 4
+PROG_PROPERTIES_VERSION = 1
+
+LIB_TYPE = SHARED
+#LIB_TYPE = STATIC
+
+BUILD_TYPE = RELEASE
+#BUILD_TYPE = DEBUG
+
+# Defines whether distributed parallelism is supported. Any value other
+# than MPI disables its supports. So, simply comment the macro to
+# deactivate it.
+DISTRIB_PARALLELISM = MPI
+
+# MPI pkg-config file
+MPI_PC = ompi
+
+################################################################################
+# Configuration values
+################################################################################
+STARDIS_ARGS_DEFAULT_TRAD = 300
+STARDIS_ARGS_DEFAULT_TRAD_REFERENCE = 300
+STARDIS_ARGS_DEFAULT_COMPUTE_TIME = INF
+STARDIS_ARGS_DEFAULT_PICARD_ORDER = 1
+STARDIS_ARGS_DEFAULT_RENDERING_FOV = 70# Degrees
+STARDIS_ARGS_DEFAULT_RENDERING_IMG_HEIGHT = 480
+STARDIS_ARGS_DEFAULT_RENDERING_IMG_WIDTH = 640
+STARDIS_ARGS_DEFAULT_RENDERING_OUTPUT_FILE_FMT = HT
+#STARDIS_ARGS_DEFAULT_RENDERING_OUTPUT_FILE_FMT = VTK
+STARDIS_ARGS_DEFAULT_RENDERING_POS = 1,1,1
+STARDIS_ARGS_DEFAULT_RENDERING_SPP = 4
+STARDIS_ARGS_DEFAULT_RENDERING_TGT = 0,0,0
+STARDIS_ARGS_DEFAULT_RENDERING_TIME = INF,INF
+STARDIS_ARGS_DEFAULT_RENDERING_UP = 0,0,1
+STARDIS_ARGS_DEFAULT_SAMPLES_COUNT = 10000
+STARDIS_ARGS_DEFAULT_SCALE_FACTOR = 1
+STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL = 1
+
+################################################################################
+# Tools
+################################################################################
+AR = ar
+CC = cc
+LD = ld
+OBJCOPY = objcopy
+PKG_CONFIG = pkg-config
+RANLIB = ranlib
+
+################################################################################
+# Dependencies
+################################################################################
+PCFLAGS_SHARED =
+PCFLAGS_STATIC = --static
+PCFLAGS = $(PCFLAGS_$(LIB_TYPE))
+
+MPI_VERSION = 2
+MPI_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags $(MPI_PC))
+MPI_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs $(MPI_PC))
+
+RSYS_VERSION = 0.14
+RSYS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags rsys)
+RSYS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs rsys)
+
+S3D_VERSION = 0.10
+S3D_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags s3d)
+S3D_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs s3d)
+
+SDIS_VERSION = 0.15
+SDIS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags sdis)
+SDIS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs sdis)
+
+SENC3D_VERSION = 0.5
+SENC3D_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags senc3d)
+SENC3D_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs senc3d)
+
+SG3D_VERSION = 0.2
+SG3D_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags sg3d)
+SG3D_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs sg3d)
+
+SSP_VERSION = 0.14
+SSP_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags star-sp)
+SSP_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs star-sp)
+
+SSTL_VERSION = 0.5
+SSTL_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags sstl)
+SSTL_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs sstl)
+
+DPDC_CFLAGS =\
+ $(RSYS_CFLAGS)\
+ $(S3D_CFLAGS)\
+ $(SDIS_CFLAGS)\
+ $(SENC3D_CFLAGS)\
+ $(SG3D_CFLAGS)\
+ $(SSP_CFLAGS)\
+ $(SSTL_CFLAGS)\
+ $($(DISTRIB_PARALLELISM)_CFLAGS)
+DPDC_LIBS =\
+ $(RSYS_LIBS)\
+ $(S3D_LIBS)\
+ $(SDIS_LIBS)\
+ $(SENC3D_LIBS)\
+ $(SG3D_LIBS)\
+ $(SSP_LIBS)\
+ $(SSTL_LIBS)\
+ $($(DISTRIB_PARALLELISM)_LIBS)\
+ -lm
+
+################################################################################
+# Compilation options
+################################################################################
+WFLAGS =\
+ -Wall\
+ -Wcast-align\
+ -Wconversion\
+ -Wextra\
+ -Wmissing-declarations\
+ -Wmissing-prototypes\
+ -Wshadow
+
+CFLAGS_HARDENED =\
+ -D_FORTIFY_SOURCES=2\
+ -fcf-protection=full\
+ -fstack-clash-protection\
+ -fstack-protector-strong
+
+CFLAGS_COMMON =\
+ -std=c89\
+ -pedantic\
+ -fvisibility=hidden\
+ -fstrict-aliasing\
+ $(CFLAGS_HARDENED)\
+ $(WFLAGS)
+
+CFLAGS_RELEASE = -O3 -DNDEBUG $(CFLAGS_COMMON)
+CFLAGS_DEBUG = -g $(CFLAGS_COMMON)
+CFLAGS = $(CFLAGS_$(BUILD_TYPE)) -fPIE
+
+################################################################################
+# Linker options
+################################################################################
+LDFLAGS_HARDENED = -Wl,-z,relro,-z,now
+LDFLAGS_DEBUG = $(LDFLAGS_HARDENED)
+LDFLAGS_RELEASE = -s $(LDFLAGS_HARDENED)
+LDFLAGS = $(LDFLAGS_$(BUILD_TYPE)) -pie
+
+OCPFLAGS_DEBUG = --localize-hidden
+OCPFLAGS_RELEASE = --localize-hidden --strip-unneeded
+OCPFLAGS = $(OCPFLAGS_$(BUILD_TYPE))
diff --git a/doc/stardis-input.5 b/doc/stardis-input.5
@@ -0,0 +1,363 @@
+.\" Copyright (C) 2018-2023 |Méso|Star>
+.\"
+.\" 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 January 31, 2024
+.Dt STARDIS-INPUT 5
+.Os
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Name and short description
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh NAME
+.Nm stardis-input
+.Nd thermal system description for
+.Xr stardis 1
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Detailed description
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh DESCRIPTION
+.Nm
+is the format used by the
+.Xr stardis 1
+program to describe a thermal system.
+It is a line-by-line ASCII syntax.
+.Pp
+A thermal system is composed of lines of text, each one describing
+either a program
+.Pq an user-provided shared object ,
+a medium frontier
+.Pq solid or fluid ,
+a boundary condition, a connection between two media, the scale of the
+whole geometry, or the radiative temperature around the system.
+In the medium, boundary and connection cases, description lines include
+a list of file names that constitute the limit, boundary or connection.
+.Xr stardis 1
+only accepts triangle mesh geometry files in STL format.
+If a scale is specified, it defines the scaling factor to apply to the
+geometry to have it expressed in meters
+.Pq e.g. 1e-3 if the geometry is in mm .
+.Pp
+Any physical quantity involved in descriptions is expected in the
+International System of Units
+.Pq second, meter, kilogram, kelvin, watt, joule .
+However, the geometry provided to
+.Xr stardis 1
+can be described in any unit, multiple of meters or not, as long as the
+scaling factor is provided.
+.Pp
+Properties are defined directly as constants in the input file.
+Several properties can also be defined by programs, i.e. shared objects
+provided by the user
+.Pq compiled libraries .
+The latter allow user-defined variable properties to be supplied to
+.Xr stardis 1 .
+Depending on the type of description they use, programs must
+export a given list of mandatory functions.
+They can also export some other optional functions.
+The exact list with names and types can be found in the public header
+.Pa stardis-prog.h ,
+which is installed together with
+.Xr stardis 1
+binary.
+.Pp
+A medium limit, a boundary or a connection description can be split
+across files and a single file or description line can describe more
+than one frontier
+.Pq more than one connex region .
+The main semantic constraint on descriptions is that enclosures must be
+defined by a single description line, to ensure that every constitutive
+part of the system is made from a single medium.
+.Pp
+Description lines can be submitted to
+.Xr stardis 1
+in any order, with the exception of programs that must be
+defined before use, and can be split across more than one file, through
+multiple use of option
+.Fl M .
+.Pp
+When a description line is parsed, the first step is to split it in
+different parts.
+.Xr stardis 1
+relies on the
+.Xr wordexp 3
+POSIX function for this step.
+As a consequence the rules that apply at this stage all come from
+the wordexp rules: environment variables can be used and are
+substituted, including inside arithmetic expressions, text inside quote
+pairs is considered a single item, whitespace characters can be escaped
+so that the current item continues past it
+.Po see
+.Xr wordexp 3
+for details
+.Pc .
+Note however that both the use of undefined environment variables and
+the use of command substitution will be reported as an error as these
+features are not enabled in
+.Xr stardis 1 .
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Grammar in Backus-Naur form
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh GRAMMAR
+In what follows, some lines end with a backslash
+.Pq Li \e .
+This is used as a convenience to continue a description next line.
+However, this trick cannot be used in actual description files and
+actual description lines must be kept single-line.
+Text introduced by the sharp character
+.Pq Li #
+in descriptions is a comment and is not part of the description.
+.Pp
+The file format is as follows:
+.Bl -column (description-line) (::) ()
+.It Ao Va thermal-system Ac Ta ::= Ta Ao Va description-line Ac
+.It Ta Ta ...
+.It Ao Va description-line Ac Ta ::= Ta Ao Va comment Ac
+.It Ta \& \& | Ta Ao Va program Ac Op Ao Va comment Ac
+.It Ta \& \& | Ta Ao Va medium Ac Op Ao Va comment Ac
+.It Ta \& \& | Ta Ao Va connection Ac Op Ao Va comment Ac
+.It Ta \& \& | Ta Ao Va boundary-condition Ac Op Ao Va comment Ac
+.It Ta \& \& | Ta Ao Va scaling Ac Op Ao Va comment Ac
+# At most once
+.It Ta \& \& | Ta Ao Va rad-temps Ac Op Ao Va comment Ac
+# At most once
+.It \ Ta Ta
+.It Ao Va comment Ac Ta ::= Ta Li # Vt string
+.It Ao Va program Ac Ta ::= Ta Li PROGRAM Ao Va prog-name Ac Ao Va lib-path Ac Op Ao Va args Ac
+.It Ao Va scaling Ac Ta ::= Ta Li SCALE Vt real
+# Geometry scaling in ]0, INF)
+.It \ Ta Ta
+.It Ao Va rad-temps Ac Ta ::= Ta Li TRAD Ao Va temp Ac Ao Va Tref Ac
+# Radiative temperatures
+.It Ao Va temp Ac Ta ::= Ta Vt real No # Temperature > 0 [K]
+.It Ao Va Tref Ac Ta ::= Ta Vt real No # Reference temperature > 0 [K]
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Media
+.Bl -column (description-line) (::) ()
+.It Ao Va medium Ac Ta ::= Ta Ao Va fluid Ac | Ao Va solid Ac
+.It \ Ta Ta
+.It Ao Va fluid Ac Ta ::= Ta Ao Va fluid-const Ac | Ao Va fluid-prog Ac
+.It Ao Va fluid-const Ac Ta ::= Ta
+.Li FLUID Ao Va medium-name Ac Ao Va rho Ac Ao Va cp Ac \e
+.It Ta Ta Ao Va initial-temp Ac Ao Va imposed-temp Ac \e
+.It Ta Ta Ao Va triangle-sides Ac ...
+.It Ao Va fluid-prog Ac Ta ::= Ta Li FLUID_PROG Ao Va medium-name Ac Ao Va prog-desc Ac
+.It \ Ta Ta
+.It Ao Va solid Ac Ta ::= Ta Ao Va solid-const Ac | Ao Va solid-prog Ac
+.It Ao Va solid-const Ac Ta ::= Ta
+.Li SOLID Ao Va medium-name Ac Ao Va lambda Ac Ao Va rho Ac Ao Va cp Ac \e
+.It Ta Ta Ao Va initial-temp Ac Ao Va imposed-temp Ac \e
+.It Ta Ta Ao Va volumic-power Ac Ao Va triangle-sides Ac No ...
+.It Ao Va solid-prog Ac Ta ::= Ta Li SOLID_PROG Ao Va medium-name Ac Ao Va prog-desc Ac
+.It \ Ta Ta
+.It Ao Va lambda Ac Ta ::= Ta Vt real No # Conductivity > 0 [W/m/K]
+.It Ao Va rho Ac Ta ::= Ta Vt real No # Volumic mass > 0 [kg/m^3]
+.It Ao Va cp Ac Ta ::= Ta Vt real No # Capacity > 0 [J/K/kg]
+.It Ao Va volumic-power Ac Ta ::= Ta Vt real No # [W/m^3]
+.El
+.Pp
+Delta is the numerical parameter that defines the length of a conductive
+random walk step.
+The user can define it manually or let Stardis calculate it
+automatically from the volume of the solid.
+In the latter case, delta is set to V/(6*A), V and A being the solid's
+volume and surface respectively:
+.Bl -column (description-line) (::) ()
+.It Ao Va delta Ac Ta ::= Ta Li AUTO | Vt real
+.El
+.Pp
+Media's descriptions, either solids or fluids, include two possible
+temperatures: initial and imposed.
+If imposed temperature is set
+.Pq that is not Li UNKNOWN ,
+initial temperature must be defined at the same value.
+In other words, one cannot define a medium with an imposed temperature
+that changes at
+.Li t= Ns Ar 0 :
+.Bl -column (description-line) (::) ()
+.It Ao Va initial-temp Ac Ta ::= Ta Vt real No # Temperature > 0 [K]
+.It Ao Va imposed-temp Ac Ta ::= Ta Li UNKNOWN No # Temperature has to be solved
+.It Ta \& \& | Ta Vt real No # Temperature > 0 [K]
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Connection
+.Bl -column (description-line) (::) ()
+.It Ao Va connection Ac Ta ::= Ta Ao Va solid-fluid Ac | Ao Va solid-solid Ac
+.It \ Ta Ta
+.It Ao Va solid-fluid Ac Ta ::= Ta Ao Va solid-fluid-const Ac | Ao Va solid-fluid-prog Ac
+.It Ao Va solid-fluid-const Ac Ta ::= Ta Li SOLID_FLUID_CONNECTION Ao Va connect-name Ac \e
+.It Ta Ta Ao Va Tref Ac Ao Va emissivity Ac Ao Va specular-fraction Ac \e
+.It Ta Ta Ao Va hc Ac Ao Va triangles Ac ...
+.It Ao Va solid-fluid-prog Ac Ta ::= Ta Li SOLID_FLUID_CONNECTION_PROG \e
+.It Ta Ta Ao Va connect-name Ac Ao Va prog-desc Ac
+.It \ Ta Ta
+.It Ao Va solid-solid Ac Ta ::= Ta Ao Va solid-solid-const Ac | Ao Va solid-solid-prog Ac
+.It Ao Va solid-solid-const Ac Ta ::= Ta Li SOLID_SOLID_CONNECTION Ao Va connect-name Ac \e
+.It Ta Ta Ao Va contact-resistance Ac Ao Va triangles Ac ...
+.It Ao Va solid-solid-prog Ac Ta ::= Ta Li SOLID_SOLID_CONNECTION_PROG \e
+.It Ta Ta Ao Va connect-name Ac Ao Va prog-desc Ac
+.It \ Ta Ta
+.It Ao Va emissivity Ac Ta ::= Ta Vt real No # \&In [0,1]
+.It Ao Va specular-fraction Ac Ta ::= Ta Vt real No # \&In [0,1]
+.It Ao Va hc Ac Ta ::= Ta Vt real No # Convective coefficient > 0 [W/m^2/K]
+.It Ao Va contact-resistance Ac Ta ::= Ta Vt real No # > 0 [K/m^-2/W]
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Boundary conditions
+.Bl -column (description-line) (::) ()
+.It Ao Va boundary-condition Ac Ta ::= Ta
+.Aq Va dirichlet
+.It Ta \& \& | Ta Aq Va robin
+.It Ta \& \& | Ta Aq Va neumann
+.It Ta \& \& | Ta Aq Va robin-neumann
+.It \ Ta Ta
+.\" Dirichlet
+.It Ao Va dirichlet Ac Ta ::= Ta Ao Va dirichlet-const Ac | Ao Va dirichlet-prog Ac
+.It Ao Va dirichlet-const Ac Ta ::= Ta Li T_BOUNDARY_FOR_SOLID Ao Va bound-name Ac \e
+.It Ta Ta Ao Va temp Ac Ao Va triangles Ac ...
+.It Ao Va dirichlet-prog Ac Ta ::= Ta Li T_BOUNDARY_FOR_SOLID_PROG Ao Va bound-name Ac \e
+.It Ta Ta Ao Va prog-desc Ac
+.It \ Ta Ta
+.\" Robin
+.It Ao Va robin Ac Ta ::= Ta Ao Va robin-fluid Ac | Ao Va robin-solid Ac
+.It Ao Va robin-fluid Ac Ta ::= Ta Ao Va robin-fluid-const Ac | Ao Va robin-fluid-prog Ac
+.It Ao Va robin-solid Ac Ta ::= Ta Ao Va robin-solid-const Ac | Ao Va robin-solid-prog Ac
+.It Ao Va robin-fluid-const Ac Ta ::= Ta Li H_BOUNDARY_FOR_FLUID Ao Va bound-name Ac \e
+.It Ta Ta Ao Va robin-const-desc Ac
+.It Ao Va robin-solid-const Ac Ta ::= Ta Li H_BOUNDARY_FOR_SOLID Ao Va bound-name Ac \e
+.It Ta Ta Ao Va robin-const-desc Ac
+.It Ao Va robin-const-desc Ac Ta ::= Ta Ao Va Tref Ac Ao Va emissivity Ac Ao Va specular-fraction Ac
+.It Ta Ta Ao Va hc Ac Ao Va outside-temp Ac Ao Va triangles Ac ...
+.It Ao Va robin-fluid-prog Ac Ta ::= Ta Li H_BOUNDARY_FOR_FLUID_PROG Ao Va bound-name Ac \e
+.It Ta Ta Ao Va prog-desc Ac
+.It Ao Va robin-solid-prog Ac Ta ::= Ta Li H_BOUNDARY_FOR_SOLID_PROG Ao Va bound-name Ac \e
+.It Ta Ta Ao Va prog-desc Ac
+.It \ Ta Ta
+.\" Neumann
+.It Ao Va neumann Ac Ta ::= Ta Ao Va neumann-const Ac | Ao Va neumann-prog Ac
+.It Ao Va neumann-const Ac Ta ::= Ta Li F_BOUNDARY_FOR_SOLID Ao Va bound-name Ac \e
+.It Ta Ta Ao Va flux Ac Ao Va triangles Ac ...
+.It Ao Va neumann-prog Ac Ta ::= Ta Li F_BOUNDARY_FOR_SOLID_PROG Ao Va bound-name Ac \e
+.It Ta Ta Ao Va prog-desc Ac
+.It \ Ta Ta
+.\" Robin & Neumann
+.It Ao Va robin-neumann Ac Ta ::= Ta Ao Va robin-neumann-const Ac
+.It Ta \& \& | Ta Ao Va robin-neumann-prog Ac
+.It Ao Va robin-neumann-const Ac Ta ::= Ta Li HF_BOUNDARY_FOR_SOLID Ao Va bound-name Ac \e
+.It Ta Ta Ao Va Tref Ac Ao Va emissivity Ac Ao Va specular-fraction Ac \e
+.It Ta Ta Ao Va hc Ac Ao Va outside-temp Ac Ao Va flux Ac Ao Va triangles Ac ...
+.It Ao Va robin-neumann-prog Ac Ta ::= Ta Li HF_BOUNDARY_FOR_SOLID_PROG Ao Va bound-name Ac \e
+.It Ta Ta Ao Va prog-desc Ac
+.It \ Ta Ta
+.It Ao Va flux Ac Ta ::= Ta Vt real No # [W/m^2]
+.It Ao Va outside-temp Ac Ta ::= Ta Vt real No # Temperature > 0 [K]
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Miscellaneous
+Names, either file names or description names
+.Pq boundary names, medium names, program names, or connection names ,
+are a sequence of one or more ASCII characters, including
+numbers and special characters like
+.Ql \&. ,
+.Ql _ ,
+or
+.Ql -
+as one may consider using in standard file names.
+Description names are case-sensitive and two different description
+lines, either in the same description file or from different description
+files, cannot use the same name.
+Additionally, description names cannot a number, nor be one of the
+keywords defined by the present grammar and their lowercase
+counterparts.
+Finally, description names cannot be longer than 63 characters.
+.Bl -column (description-line) (::) ()
+.It Ao Va bound-name Ac Ta ::= Ta Vt string
+.It Ao Va medium-name Ac Ta ::= Ta Vt string
+.It Ao Va prog-name Ac Ta ::= Ta Vt string
+.It Ao Va connect-name Ac Ta ::= Ta Vt string
+.It \ Ta Ta
+.It Ao Va stl-path Ac Ta ::= Ta Pa path
+.It Ao Va lib-path Ac Ta ::= Ta Pa path
+.It \ Ta Ta
+.It Ao Va args Ac Ta ::= Ta Vt string No ...
+.It Ao Va prog-desc Ac Ta ::= Ta Ao Va prog-name Ac Ao Va triangle-sides Ac ... \e
+.It Ta Ta Op Li PROG_PARAMS Op Ao Va args Ac
+.It \ Ta Ta
+.It Ao Va triangle-sides Ac Ta ::= Ta Ao Va side-specifier Ac Ao Va triangles Ac
+.It Ao Va triangles Ac Ta ::= Ta Ao Va stl-path Ac
+.El
+.Pp
+Side descriptions in side specifiers rely on the following convention:
+we first consider the direct triangle's normal (right-hand rule), then
+we define the
+.Li BACK
+side of a triangle to be the side this normal comes out from.
+That means that a closed set of triangles with normals pointing outside
+should be used with the
+.Li FRONT
+side specifier to describe inside medium:
+.Bl -column (description-line) (::) ()
+.It Ao Va side-specifier Ac Ta ::= Ta Li FRONT | Li BACK | Li BOTH
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" File examples
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh EXAMPLES
+Define a system consisting of a solid cube named
+.Ql Cube 1 ,
+with a Robin-type boundary condition and radiative exchange with the
+environment.
+The cube geometry is read from the file
+.Pa cube.stl
+and the solid medium properties are
+.No lambda= Ns Ar 0.1 No W/m/K ,
+.No rho= Ns Ar 25 No kg/m^3 ,
+.No cp= Ns Ar 2 No J/K/kg .
+The numerical parameter delta, that is used for solid conductive walks, is
+.Ar 0.05 .
+The initial temperature of the cube is
+.Ar 0 No K , its temperature is unknown
+.Pq it has to be solved ,
+and its volumic power is
+.Ar 2.5 No W/m^3 .
+The boundary properties are
+.No emissivity= Ns Ar 0 ,
+.No specular-fraction= Ns Ar 0,
+.No hc= Ns Ar 10 No W/m^2/K
+and
+.No external-temperature= Ns Ar 100 No K .
+The radiative environment is at
+.Ar 300 No K .
+Finally, the linearization of radiative transfer involving Robin's
+boundary condition uses
+.Ar 310 No K
+as reference temperature and is set to
+.Ar 330 No K
+when linearisation involves the radiative environment:
+.Bd -literal -offset Ds
+SOLID Cube\ 1 0.1 25 2 0.05 0 UNKNOWN 2.5 FRONT cube.stl
+H_BOUNDARY_FOR_SOLID HdT 310 0 0 10 100 cube.stl
+TRAD 300 330
+.Ed
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" External references
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh SEE ALSO
+.Xr stardis 1 ,
+.Xr wordexp 3
+.Rs
+.%T The StL Format: Standard Data Format for Fabbers
+.%A Marshall Burns
+.%D 1993
+.%U https://www.fabbers.com/tech/STL_Format
+.Re
diff --git a/doc/stardis-output.5 b/doc/stardis-output.5
@@ -0,0 +1,908 @@
+.\" Copyright (C) 2018-2023 |Méso|Star>
+.\"
+.\" 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 January 31, 2024
+.Dt STARDIS-INPUT 5
+.Os
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Name and short description
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh NAME
+.Nm stardis-output
+.Nd output format of
+.Xr stardis 1
+results
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Detailed description
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh DESCRIPTION
+.Nm
+describes the output format of the
+.Xr stardis 1
+program.
+Any
+.Xr stardis 1
+result is written to standard output, even though some additional
+informations can be written in files.
+.Pp
+The type of the data that are generated depends on the options used when
+.Xr stardis 1 is invoked.
+When invoked with one of the basic computation options
+.Pq Fl p , Fl P , Fl m , Fl s No or Fl F ,
+.Xr stardis 1
+outputs a single Monte Carlo result.
+On the opposite,
+.Xr stardis 1
+ouputs compound results when invoked with
+option
+.Fl S
+or
+.Fl R .
+Additionally, options
+.Fl g
+and
+.Fl G
+make
+.Xr stardis 1
+compute and output a Green function and possibly information on heat
+paths' ends.
+Most of the complex data output is in VTK format.
+.Pp
+Note that some special options
+.Pq Fl v , Fl h No or Fl d
+that does not involve any computation produce output including
+information on the
+.Xr stardis 1
+software
+.Pq their ouputs will not be described thereafter
+or the provided thermal system.
+.Pp
+Any physical quantity in output is in the International System of Units
+.Pq second, metre, kilogram, kelvin
+except the coordinates that are in same system as the geometry.
+.Pp
+In what follows, some lines end with a backslash
+.Pq Li \e .
+This is used as a convenience to continue a description next line.
+However, this trick cannot be used in actual description files and
+actual description lines must be kept single-line.
+Text introduced by the sharp character
+.Pq Li #
+in descriptions is a comment and is not part of the description.
+.Pp
+The output format is as follows:
+.Bl -column (******************) (::=) ()
+.It Ao Va output Ac Ta ::= Ta Aq Va mc-estimate
+.It Ta \& \& | Ta Aq Va green-function
+.It Ta \& \& | Ta Aq Va geometry-dump
+.It Ta \& \& | Ta Aq Va infrared-image
+.It Ta \& \& | Ta Aq Va heat-paths
+.El
+.Pp
+The following sections describe in detail each of these possible
+outputs.
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Single Monte Carlo estimate
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh MONTE CARLO ESTIMATE
+When
+.Xr stardis 1
+is used to calculate a single Monte Carlo estimate, either a temperature
+or a flux, the estimate is output first to standard output, possibly
+followed by some of the heat paths involved in the computation if option
+.Fl D
+was used too.
+Two different formats are possible: a raw, numbers only format
+.Pq the default
+or an extended format that mixes numbers and their descriptions
+.Pq if option Fl e No is used .
+.Bl -column (******************) (::=) ()
+.It Ao Va mc-estimate Ac Ta ::= Ta Ao Va probe-temp Ac # Options Fl P No or Fl p
+.It Ta \& \& | Ta Ao Va medium-temp Ac # Option Fl m
+.It Ta \& \& | Ta Ao Va mean-temp Ac # Option Fl s
+.It Ta \& \& | Ta Ao Va mean-flux Ac # Option Fl F
+.El
+.\" Probe temperature
+.Bl -column (******************) (::=) ()
+.It Ao Va probe-temp Ac Ta ::= Ta Ao Va probe-temp-raw Ac | Ao Va probe-temp-ext Ac
+.It Ao Va probe-temp-raw Ac Ta ::= Ta Ao Va estimate Ac Ao Va failures Ac
+.It Ao Va probe-temp-ext Ac Ta ::= Ta Li Temperature at Ao Va position Ac Ao Va time Ac \e
+.It Ta Ta Ao Va estimate-temp-ext Ac Ao Va failures-ext Ac
+.El
+.\" Medium temperature
+.Bl -column (******************) (::=) ()
+.It Ao Va medium-temp Ac Ta ::= Ta Ao Va medium-temp-raw Ac | Ao Va medium-temp-ext Ac
+.It Ao Va medium-temp-raw Ac Ta ::= Ta Ao Va estimate Ac Ao Va failures Ac
+.It Ao Va medium-temp-ext Ac Ta ::= Ta Li Temperature in medium Ao Va medium-name Ac \e
+.It Ta Ta Ao Va time Ac Ao Va estimate-temp-ext Ac Ao Va failures-ext Ac
+.El
+.\" Mean temperature
+.Bl -column (******************) (::=) ()
+.It Ao Va mean-temp Ac Ta ::= Ta Ao Va mean-temp-raw Ac | Ao Va mean-temp-ext Ac
+.It Ao Va mean-temp-raw Ac Ta ::= Ta Ao Va estimate Ac Ao Va failures Ac
+.It Ao Va mean-temp-ext Ac Ta ::= Ta Li Temperature at boundary Ao Va stl-path Ac \e
+.It Ta Ta Ao Va time Ac Ao Va estimate-temp-ext Ac Ao Va failures-ext Ac
+.El
+.\" Mean flux
+.Bl -column (******************) (::=) ()
+.It Ao Va mean-flux Ac Ta ::= Ta Ao Va mean-flux-raw Ac | Ao Va mean-flux-ext Ac
+.It Ao Va mean-flux-raw Ac Ta ::= Ta Ao Va estimate Ac Ao Va estimate Ac Ao Va estimate Ac \e
+.It Ta Ta Ao Va estimate Ac Ao Va estimate Ac Ao Va failures Ac
+.It Ao Va mean-flux-ext Ac Ta ::= Ta Li Temperature at boundary Ao Va stl-path Ac \e
+.It Ta Ta Ao Va time Ac Ao Va estimate-temp-ext Ac
+.It Ta Ta Li Convective flux at boundary Ao Va stl-path Ac \e
+.It Ta Ta Ao Va time Ac Ao Va estimate-flux-ext Ac
+.It Ta Ta Li Radiative flux at boundary Ao Va stl-path Ac \e
+.It Ta Ta Ao Va time Ac Ao Va estimate-flux-ext Ac
+.It Ta Ta Li Imposed flux at boundary Ao Va stl-path Ac \e
+.It Ta Ta Ao Va time Ac Ao Va estimate-flux-ext Ac
+.It Ta Ta Li Total flux at boundary Ao Va stl-path Ac \e
+.It Ta Ta Ao Va time Ac Ao Va estimate-flux-ext Ac
+.It Ta Ta Ao Va failures-ext Ac
+.El
+.\" Miscellaneous
+.Bl -column (******************) (::=) ()
+.It Ao Va estimate Ac Ta ::= Ta Ao Va expected-value Ac Ao Va standard-error Ac
+.It Ao Va estimate-temp-ext Ac Ta ::= Ta Ao Va expected-value Ac Li K +/- Ao Va standard-error Ac
+.It Ao Va estimate-flux-ext Ac Ta ::= Ta Ao Va expected-value Ac Li W +/- Ao Va standard-error Ac
+.It Ao Va expected-value Ac Ta ::= Ta Vt real
+.It Ao Va standard-error Ac Ta ::= Ta Vt real
+.El
+.Bl -column (******************) (::=) ()
+.It Ao Va failures Ac Ta ::= Ta Ao Va error-count Ac Ao Va success-count Ac
+.It Ao Va error-count Ac Ta ::= Ta Vt integer
+.It Ao Va success-count Ac Ta ::= Ta Vt integer
+.El
+.Bl -column (******************) (::=) ()
+.It Ao Va position Ac Ta ::= Ta [ Vt real , Vt real , Vt real ]
+.It Ao Va time Ac Ta ::= Ta Li at t= Ns Vt real
+.It Ta \& \& | Ta Li with t in [ Vt real , Vt real ]
+.It Ao Va medium-name Ac Ta ::= Ta Vt string
+.It Ao Va stl-path Ac Ta ::= Ta Pa path
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Green function
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh GREEN FUNCTION
+The Green function is generated, either in binary or ascii format, when
+a green-compatible
+.Xr stardis 1
+simulation option is used in conjuction with option
+.Fl G
+for a binary output, or option
+.Fl g
+for an ascii output.
+For every successful heat path sampled carrying out the simulation, the
+solver records all the elements of the path history relevant to link the
+various imposed temperature, flux and volumic power values to the
+simulation result.
+The output is made of tables containing the different media and
+boundaries and their imposed temperature, flux and volumic power values,
+followed by the heat paths' history.
+Also, option
+.Fl G
+make it possible to output heat paths' end information on an ascii, csv
+formated file.
+.Bl -column (******************) (::=) ()
+.It Ao Va green-function Ac Ta ::= Ta Ao Va green-ascii Ac No # Option Fl g
+.It Ta \& \& | Ta Ao Va green-binary Ac Oo Ao Va paths Ac Oc No # Option Fl G
+.El
+.Pp
+The Monte Carlo estimate and standard deviation for a given set of settings can
+be computed as the mean and standard deviation of the samples of the Green
+function computed using these settings.
+Each sample can be computed as follows:
+.Bl -bullet -compact -offset indent
+.It
+get the temperature of the ending boundary, medium or Trad
+.It
+add the temperature gain of each power term
+.It
+add the temperature gain of each flux term
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss ASCII format
+Beyond the file format described below,
+.Xr stardis 1
+could write comments
+.Pq characters behind the hash mark Pq Li #
+or blank lines
+.Pq lines without any characters or composed only of spaces and tabs.
+These are not part of the file format and should be ignored.
+.Pp
+The ASCII file format of a Green function is as follows:
+.Bl -column (******************) (::=) ()
+.It Ao Va green-ascii Ac Ta ::= Ta Li ---BEGIN GREEN---
+.It Ta Ta Aq Va time-range
+.It Ta Ta Ao Va #solids Ac Ao Va #fluids Ac \e
+.It Ta Ta Ao Va #dirichlet-boundaries Ac \e
+.It Ta Ta Ao Va #robin-boundaries Ac \e
+.It Ta Ta Ao Va #neumann-boundaries Ac \e
+.It Ta Ta Ao Va #successes Ac Ao Va #failures Ac
+.It Ta Ta Aq Va solid
+.It Ta Ta ...
+.It Ta Ta Aq Va fluid
+.It Ta Ta ...
+.It Ta Ta Aq Va dirichlet-boundary
+.It Ta Ta ...
+.It Ta Ta Aq Va robin-boundary
+.It Ta Ta ...
+.It Ta Ta Aq Va neumann-boundary
+.It Ta Ta ...
+.It Ta Ta Aq Va rad-temp
+.It Ta Ta Aq Va samples
+.It \ Ta Ta
+.It Ao Va time-rad Ac Ta ::= Ta Vt real Vt real
+.It Ao Va #solids Ac Ta ::= Ta Vt integer
+.It Ao Va #fluids Ac Ta ::= Ta Vt integer
+.It Ao Va #dirichlet-boundaries Ac Ta ::= Ta Vt integer
+.It Ao Va #robin-boundaries Ac Ta ::= Ta Vt integer
+.It Ao Va #neumann-boundaries Ac Ta ::= Ta Vt integer
+.It Ao Va #successes Ac Ta ::= Ta Vt integer
+.It Ao Va #failures Ac Ta ::= Ta Vt integer
+.It \ Ta Ta
+.It Ao Va solid Ac Ta ::= Ta Ao Va green-id Ac Ao Va name Ac Ao Va lambda Ac Ao Va rho Ac Ao Va cp Ac \e
+.It Ta Ta Ao Va power Ac Ao Va initial-temp Ac Ao Va imposed-temp Ac
+.It Ao Va fluid Ac Ta ::= Ta Ao Va green-id Ac Ao Va name Ac Ao Va rho Ac Ao Va cp Ac \e
+.It Ta Ta Ao Va initial-temp Ac Ao Va imposed-temp Ac
+.It Ao Va lambda Ac Ta ::= Ta Vt real No # Conductivity > 0 [W/m/K]
+.It Ao Va rho Ac Ta ::= Ta Vt real No # Volumic mass > 0 [kg/m^3]
+.It Ao Va cp Ac Ta ::= Ta Vt real No # Capacity > 0 [J/K/kg]
+.It Ao Va power Ac Ta ::= Ta Vt real No # Volumic power [W/m^3]
+.It Ao Va initial-temp Ac Ta ::= Ta Vt real No # Temperature [K]
+.It Ao Va imposed-temp Ac Ta ::= Ta Vt real No # Temperature [K]
+.It \ Ta Ta
+.It Ao Va dirichlet-boundary Ac Ta ::= Ta Ao Va green-id Ac Ao Va name Ac Ao Va temp Ac
+.It Ao Va robin-boundary Ac Ta ::= Ta Ao Va green-id Ac Ao Va name Ac Ao Va temp-ref Ac \e
+.It Ta Ta Ao Va emissivity Ac Ao Va specular-fraction Ac Ao Va hc Ac \e
+.It Ta Ta Ao Va temp Ac
+.It Ao Va neumann-boundary Ac Ta ::= Ta Ao Va green-id Ac Ao Va name Ac Ao Va flux Ac
+.It Ao Va emissivity Ac Ta ::= Ta Vt real No # \&In [0,1]
+.It Ao Va specular-fraction Ac Ta ::= Ta Vt real No # \&In [0,1]
+.It Ao Va hc Ac Ta ::= Ta Vt real No # Convective coefficient [W/m^2/K]
+.It Ao Va temp Ac Ta ::= Ta Vt real No # Temperature [K]
+.It Ao Va temp-ref Ac Ta ::= Ta Vt real No # Reference temperature [K]
+.It Ao Va flux Ac Ta ::= Ta Vt real No # [W/m^2]
+.It \ Ta Ta
+.It Ao Va rad-temp Ac Ta ::= Ta Ao Va green-id Ac Ao Va Trad Ac Ao Va Trad-ref Ac
+.It Ao Va Trad Ac Ta ::= Ta Vt real No # Radiative temperature [K]
+.It Ao Va Trad-ref Ac Ta ::= Ta Vt real No # Reference temperature [K]
+.It \ Ta Ta
+.It Ao Va sample Ac Ta ::= Ta Ao Va end-type Ac Ao Va green-id Ac \e
+.It Ta Ta Ao Va #power-terms Ac Ao Va #flux-terms Ac \e
+.It Ta Ta Ao Va power-term Ac ... Ao Va flux-term Ac ...
+.It Ao Va end-type Ac Ta ::= Ta Aq Va end-dirichlet
+.It Ta \& \& | Ta Aq Va end-robin
+.It Ta \& \& | Ta Aq Va end-Trad
+.It Ta \& \& | Ta Ao Va end-fluid Ac No # Fluid temperature
+.It Ta \& \& | Ta Ao Va end-solid Ac No # Solid temperature
+.It Ao Va end-dirichlet Ac Ta ::= Ta Li T
+.It Ao Va end-robin Ac Ta ::= Ta Li H
+.It Ao Va end-Trad Ac Ta ::= Ta Li R
+.It Ao Va end-fluid Ac Ta ::= Ta Li F
+.It Ao Va end-solid Ac Ta ::= Ta Li S
+.It Ao Va #power-terms Ac Ta ::= Ta Vt integer
+.It Ao Va #flux-terms Ac Ta ::= Ta Vt integer
+.It Ao Va power-term Ac Ta ::= Ta Ao Va green-id Ac Ao Va factor Ac
+.It Ao Va flux-term Ac Ta ::= Ta Ao Va green-ud Ac Ao Va factor Ac
+.It Ao Va factor Ac Ta ::= Ta Vt real
+.It \ Ta Ta
+.It Ao Va green-id Ac Ta ::= Ta Vt integer
+.It Ao Va name Ac Ta ::= Ta Vt string
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Binary format
+Binary Green outputs are formated according to the various C types from the
+.Pa stardis-green.h
+header file.
+The output begins with a header
+.Pq of type Vt struct green_file_header
+that includes counts, followed by descriptions
+.Pq of type Vt struct green_description
+and samples.
+Thereafter is the format of binary Green outputs.
+This output is produced by
+.Sy fwrite
+calls and does not take care of endianness.
+.Pp
+The binary file format of a Green function is as follows:
+.Bl -column (******************) (::=) ()
+.It Ao Va green-binary Ac Ta ::= Ta Li GREEN_BIN_FILE\&:
+.It Ta Ta Aq Va file_format_version
+.It Ta Ta Aq Va #descriptions
+.It Ta Ta Aq Va #solids
+.It Ta Ta Aq Va #fluids
+.It Ta Ta Aq Va #robin-boundaries
+.It Ta Ta Aq Va #dirichlet-boundaries
+.It Ta Ta Aq Va #neumann-boundaries
+.It Ta Ta Aq Va #solid-fluid-connects
+.It Ta Ta Aq Va #solid-solid-connects
+.It Ta Ta Aq Va #successes
+.It Ta Ta Aq Va #failures
+.It Ta Ta Aq Va Trad
+.It Ta Ta Aq Va Trad-ref
+.It Ta Ta Aq Va time-range
+.It Ta Ta Ao Va description Ac ...
+.It Ta Ta Ao Va sample Ac ...
+.It \ Ta Ta
+.It Ao Va file_format_version Ac Ta ::= Ta Vt unsigned
+.It Ao Va #descriptions Ac Ta ::= Ta Vt unsigned
+.It Ao Va #solids Ac Ta ::= Ta Vt unsigned
+.It Ao Va #fluids Ac Ta ::= Ta Vt unsigned
+.It Ao Va #robin-boundaries Ac Ta ::= Ta Vt unsigned
+.It Ao Va #dirichlet-boundaries Ac Ta ::= Ta Vt unsigned
+.It Ao Va #neumann-boundaries Ac Ta ::= Ta Vt unsigned
+.It Ao Va #solid-fluid-connects Ac Ta ::= Ta Vt unsigned
+.It Ao Va #solid-solid-connects Ac Ta ::= Ta Vt unsigned
+.It Ao Va #successes Ac Ta ::= Ta Vt size_t
+.It Ao Va #failures Ac Ta ::= Ta Vt size_t
+.It Ao Va Trad Ac Ta ::= Ta Vt double No # Radiative temperature
+.It Ao Va Trad-ref Ac Ta ::= Ta Vt double No # Reference radiative temperature
+.It Ao Va time-range Ac Ta ::= Ta Vt double[2]
+.It \ Ta Ta
+.It Ao Va description Ac Ta ::= Ta Vt struct green_description
+.It \ Ta Ta
+.It Ao Va sample Ac Ta ::= Ta Ao Va sample-header Ac
+.It Ta Ta Ao Va power-id Ac ...
+.It Ta Ta Ao Va flux-id Ac ...
+.It Ta Ta Ao Va power-weight Ac ...
+.It Ta Ta Ao Va flux-weight Ac ...
+.It Ao Va sample-header Ac Ta ::= Ta Vt struct green_sample_header
+.It Ao Va power-id Ac Ta ::= Ta Vt unsigned
+.It Ao Va flux-id Ac Ta ::= Ta Vt unsigned
+.It Ao Va power-weight Ac Ta ::= Ta Vt double
+.It Ao Va flux-weight Ac Ta ::= Ta Vt double
+.El
+.Pp
+Binary Green function can be followed by partial information on the
+sampled paths.
+The output data are restricted to paths' ends.
+.Bl -column (******************) (::=) ()
+.It Ao Va paths Ac Ta ::= Ta Li \&"End\&"\&, \&"End ID\&"\&, \&"X\&"\&, \&"Y\&"\&, \&"Z\&"\&, \e
+.It Ta Ta Li \&"Elapsed Time\&"
+.It Ta Ta Ao Va path-end Ac
+.It Ta Ta ...
+.It \ Ta Ta
+.It Ao Va path-end Ac Ta ::= Ta \
+Ao Va end-name Ac Ns Li \&, \
+Ao Va end-id Ac Ns Li \&, \
+Ao Va x Ac Ns Li \&, \
+Ao Va y Ac Ns Li \&, \
+Ao Va z Ac Ns Li \&, \e
+.It Ta Ta Ao Va elapsed-time Ac
+.It Ao Va end-name Ac Ta ::= Ta Vt string No # Boundary name or TRAD
+.It Ao Va end-id Ac Ta ::= Ta Vt integer
+.It Ao Va x Ac Ta ::= Ta Vt real
+.It Ao Va y Ac Ta ::= Ta Vt real
+.It Ao Va z Ac Ta ::= Ta Vt real
+.It Ao Va elapsed-time Ac Ta ::= Ta Vt real No # [s]
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Geometry
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh GEOMETRY DUMP
+A
+.Aq Va geometry-dump
+is generated when
+.Xr stardis 1
+is invoked with option
+.Fl d .
+In this mode,
+.Xr stardis 1
+outputs the system geometry, as submitted in
+.Xr stardis-input 5
+description, to standard output in VTK format.
+The output geometry is
+.Em not
+the concatenation of the various geometry files
+used in
+.Xr stardis-input 5
+description.
+It is the result of a deduplication process that removes duplicate and
+degenerated triangles from the submited geometry.
+Additionaly, as permitted by the VTK format, the output geometry is
+decorated with many different properties provided to help users
+understand the description processing, including possible errors.
+.Pp
+If errors are detected, some optional error-related data fields are
+included in the geometry file.
+Some errors report a by-triangle error status, other errors report a
+by-enclosure error status.
+.Pp
+Also, holes in the geometry, if any, are reported in geometry dumps.
+A hole is defined by its frontier that is a collection of triangles
+surrounding the hole.
+Such triangles are detected as having their 2 sides in the same
+enclosure, but with a different medium on each side.
+.Pp
+Media information is provided in two different flavours.
+First the medium on front and back sides of triangles can be found
+through the
+.Li Front_medium
+and
+.Li Back_medium
+fields.
+These fields use the special value
+.Sy INT_MAX
+for sides with no defined medium, as one can expect on boundary
+triangles.
+On the other hand, medium information provided by the
+Enclosures_internal_media field displays the id of the medium created to
+hold boundary information for boundary triangles.
+In either case, media numbering information can be found in log messages
+if option
+.Fl V Ar 3
+is used in conjunction with the
+.Fl d
+dump option.
+.Pp
+The VTK layout is as follows:
+.Bl -column (******************) (::=) ()
+.It Ao Va geometry-dump Ac Ta ::= Ta Li # vtk DataFile Version 2.0
+.It Ta Ta Ao Va description Ac
+.It Ta Ta Li ASCII
+.It Ta Ta Li DATASET POLYDATA
+.It Ta Ta Aq Va vertices
+.It Ta Ta Aq Va triangles
+.It Ta Ta Li CELL_DATA Ao Va #triangles Ac
+.It Ta Ta Aq Va front-media
+.It Ta Ta Aq Va back-media
+.It Ta Ta Aq Va interfaces
+.It Ta Ta Aq Va unique-ids
+.It Ta Ta Aq Va user-ids
+.It Ta Ta Op Aq Va merge-conflicts
+.It Ta Ta Op Aq Va property-conflicts
+.It Ta Ta Aq Va file-ids
+.It Ta Ta Aq Va boundaries
+.It Ta Ta Op Aq Va compute-region
+.It Ta Ta Aq Va encl-or-overlaps
+.It \ Ta Ta
+.It Ao Va description Ac Ta ::= Ta Vt string No # Up to 256 characters
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Geometry
+.Bl -column (******************) (::=) ()
+.It Ao Va vertices Ac Ta ::= Ta Li POINTS Ao Va #vertices Ac Li double
+.It Ta Ta Ao Va x Ac Ao Va y Ac Ao Va z Ac
+.It Ta Ta ...
+.It Ao Va triangles Ac Ta ::= Ta Li POLYGONS Ao Va #triangles Ac Ao Va #triangles*4 Ac
+.It Ta Ta Li 3 Ao Va vertex-id Ac Ao Va vertex-id Ac Ao Va vertex-id Ac
+.It Ta Ta ...
+.El
+.Pp
+List triangle indices
+.Em after
+.Xr stardis 1
+deduplication:
+.Bl -column (******************) (::=) ()
+.It Ao Va unique-ids Ac Ta ::= Ta Li SCALARS Unique_ID unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Ao Va triangle-id Ac No # \&In Bq 0, Ao Va #triangles Ac
+.It Ta Ta ... # Up to Aq Va #triangles
+.El
+.Pp
+List triangle indices
+.Em before
+deduplication to let the caller indentify his geometry as submitted to
+.Xr stardis 1 :
+.Bl -column (******************) (::=) ()
+.It Ao Va user-ids Ac Ta ::= Ta Li SCALARS User_ID unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Ao Va triangle-id Ac
+.It Ta Ta ... # Up to Aq Va #triangles
+.El
+.Pp
+List the file identifier in which each triangle first appeared:
+.Bl -column (******************) (::=) ()
+.It Ao Va file-ids Ac Ta ::= Ta Li SCALARS Created_at_sg3d_geometry_add \e
+.It Ta Ta Li unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Aq Va file-rank
+.It Ta Ta ... # Up to Aq Va #triangles
+.El
+.Bl -column (******************) (::=) ()
+.It Ao Va #vertices Ac Ta ::= Ta Vt integer
+.It Ao Va #triangles Ac Ta ::= Ta Vt integer
+.It Ao Va #triangles*4 Ac Ta ::= Ta Vt integer
+.It Ao Va vertex-id Ac Ta ::= Ta Vt integer No # \&In Bq 0, Ao Va #vertices Ac
+.It Ao Va triangle-id Ac Ta ::= Ta Vt integer
+.It Ao Va x Ac Ta ::= Ta Vt real
+.It Ao Va y Ac Ta ::= Ta Vt real
+.It Ao Va z Ac Ta ::= Ta Vt real
+.It Ao Va file-rank Ac Ta ::= Ta Vt integer
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Properties
+.Bl -column (******************) (::=) ()
+.It Ao Va front-media Ac Ta ::= Ta Li SCALARS Front_medium unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Ao Va medium-id Ac | Ao Va undef-medium Ac
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va back-media Ac Ta ::= Ta Li SCALARS Back_medium unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Ao Va medium-id Ac | Ao Va undef-medium Ac
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va interfaces-media Ac Ta ::= Ta Li SCALARS Interface unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Ao Va interface-id Ac
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va boundaries Ac Ta ::= Ta Li SCALARS Boundaries unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Aq Va boundary-id
+.It Ta Ta ... # Up to Aq Va #triangles
+.It \ Ta Ta
+.It Ao Va medium-id Ac Ta ::= Ta Vt integer
+.It Ao Va undef-medium Ac Ta ::= Ta Sy INT_MAX
+.It Ao Va interface-id Ac Ta ::= Ta Vt integer
+.It Ao Va boundary-id Ac Ta ::= Ta Vt integer
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Compute region
+Define which triangles are members of the surface on which
+.Xr stardis 1
+performs the calculation
+.Pq options Fl F , Fl S No or Fl s :
+.Bl -column (******************) (::=) ()
+.It Ao Va compute-region Ac Ta ::= Ta Li SCALARS Compute_region unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Aq Va region-membership
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va region-membership Ac Ta ::= Ta Li 0 No # Not member
+.It Ta \& \& | Ta Li 1 No # The front side is member
+.It Ta \& \& | Ta Li 2 No # The back side is member
+.It Ta \& \& | Ta Li 3 No # Both sides are members
+.It Ta \& \& | Ta Sy INT_MAX No # Error: must not be member
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Check description problems
+Define which triangles have an invalid media definition when merging
+partitions:
+.Bl -column (******************) (::=) ()
+.It Ao Va merge-conflicts Ac Ta ::= Ta Li SCALARS Merge_conflict int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Aq Va merge-conflict-id
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va merge-conflict-id Ac Ta ::= Ta Li 0 No # \&No conflict
+.It Ta \& \& | Ta Li 1 No # Conflict
+.El
+.Pp
+Define which triangles have an invalid limit condition or an invalid
+connection and report what is wrong:
+.Bl -column (******************) (::=) ()
+.It Ao Va property-conflicts Ac Ta ::= Ta Li SCALARS Property_conflict int 1
+.It Ta Ta Aq Va prop-conflict-id
+.It Ta Ta ...
+.It Ao Va prop-conflict-id Ac Ta ::= Ta Li 0 No # \&No conflict
+.It Ta \& \& | Ta Li 1 No # Robin btw 2 defined fluids
+.It Ta \& \& | Ta Li 2 No # Robin btw 2 undefined fluids
+.It Ta \& \& | Ta Li 3 No # Robin on fluid applied to solid
+.It Ta \& \& | Ta Li 4 No # Robin btw 2 defined solids
+.It Ta \& \& | Ta Li 5 No # Robin btw 2 undefined solids
+.It Ta \& \& | Ta Li 6 No # Robin on solid applied to fluid
+.It Ta \& \& | Ta Li 7 No # Robin&Neumann btw 2 defined media
+.It Ta \& \& | Ta Li 8 No # Robin&Neumann btw 2 undefined media
+.It Ta \& \& | Ta Li 9 No # Robin&Neumann applied to fluid
+.It Ta \& \& | Ta Li 10 No # Dirichlet btw 2 defined solids
+.It Ta \& \& | Ta Li 11 No # Dirichlet btw 2 undefined solids
+.It Ta \& \& | Ta Li 12 No # Dirichlet on solid applied to fluid
+.It Ta \& \& | Ta Li 13 No # Neumann btw 2 defined media
+.It Ta \& \& | Ta Li 14 No # Neumann btw 2 undefined media
+.It Ta \& \& | Ta Li 15 No # Neumann applied to fluid
+.It Ta \& \& | Ta Li 16 No # Solid/fluid btw 2 solids
+.It Ta \& \& | Ta Li 17 No # Solid/fluid btw 2 fluids
+.It Ta \& \& | Ta Li 18 No # Solid/fluid used as boundary
+.It Ta \& \& | Ta Li 19 No # Solid/fluid btw 2 undefined media
+.It Ta \& \& | Ta Li 20 No # \&No connection btw fluid/fluid
+.It Ta \& \& | Ta Li 21 No # \&No connection btw solid/fluid
+.It Ta \& \& | Ta Li 22 No # \&No boundary around fluid
+.It Ta \& \& | Ta Li 23 No # \&No boundary around solid
+.It Ta \& \& | Ta Li 24 No # Invalid part of a compute surface
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss Enclosure
+.Bl -column (******************) (::=) ()
+.It Ao Va encl-or-overlaps Ac Ta ::= Ta Ao Va encl-information Ac
+.It Ta \& \& | Ta Ao Va overlappings Ac
+.It \ Ta Ta
+.It Ao Va encl-information Ac Ta ::= Ta Oo Ao Va holes Ac Oc No # If any
+.It Ta Ta Aq Va enclosures
+.It \ Ta Ta
+.It Ao Va enclosures Ac Ta ::= Ta Li FIELD FieldData 2
+.It Ta Ta Ao Va enclosures-geoms Ac
+.It Ta Ta Ao Va enclosures-media Ac
+.El
+.Pp
+Report which triangles surround a hole:
+.Bl -column (******************) (::=) ()
+.It Ao Va holes Ac Ta ::= Ta Li SCALARS Hole_frontiers unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Aq Va hole-membership
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va hole-membership Ac Ta ::= Ta Li 0 No # Not surrounding a hole
+.It Ta Ta Li 1 No # Surrounding a hole
+.El
+.Pp
+List the enclosures to which the triangle belongs and report the
+validity status of the enclosures:
+.Bl -column (******************) (::=) ()
+.It Ao Va enclosures-geoms Ac Ta ::= Ta Li Enclosures Ao Va #enclosures Ac \e
+.It Ta Ta Ao Va #triangles Ac Li unsigned_char
+.It Ta Ta Ao Va encl-status Ac ... # Up to Aq Va #enclosures
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va encl-status Ac Ta ::= Ta Li 0 No # Not part of the enclosure
+.It Ta \& \& | Ta Li 1 No # Enclosure is valid
+.It Ta \& \& | Ta Li 3 No # More than 1 medium
+.It Ta \& \& | Ta Li 5 No # Triangles with undef medium
+.It Ta \& \& | Ta Li 7 No # More than 1 medium including undef
+.El
+.Pp
+List the media that the triangle surrounds for each enclosure and report
+media description problems:
+.Bl -column (******************) (::=) ()
+.It Ao Va enclosures-media Ac Ta ::= Ta Li Enclosures_internal_media Ao Va #enclosures Ac \e
+.It Ta Ta Ao Va #triangles Ac Li unsigned_char
+.It Ta Ta Ao Va encl-media Ac ... # Up to Aq Va #enclosures
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va encl-media Ac Ta ::= Ta Ao Va medium-id Ac No # Medium of the enclosure
+.It Ta \& \& | Ta Sy INT_MAX No # Not part of the enclosure
+.It Ta \& \& | Ta Sy INT_MAX Ns Li -1 No # Error: \&in the enclosure
+.It Ta \& \& | Ta Sy INT_MAX Ns Li -2 No # Error: medium missing
+.El
+.Pp
+Report problems of triangle overlap:
+.Bl -column (******************) (::=) ()
+.It Ao Va overlappings Ac Ta ::= Ta Li SCALARS Overlapping_triangles \e
+.It Ta Ta unsigned_int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Ao Va overlapping-status Ac
+.It Ta Ta ... # Up to Aq Va #triangles
+.It Ao Va overlapping-status Ac Ta ::= Ta Li 0 No # Doesn't overlap another triangle
+.It Ta \& \& | Ta Li 1 No # Error: overlaps another triangle
+.El
+.Bl -column (******************) (::=) ()
+.It Ao Va #enclosures Ac Ta ::= Ta Vt integer
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Infrared image
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh INFRARED IMAGE
+When invoked with option
+.Fl R ,
+.Xr stardis 1
+calculates an infrared image of the system and write it to standard
+output.
+Depending on the
+.Cm fmt
+sub-option, this file can be either in
+.Xr htrdr-image 5
+format or in VTK format.
+.Bl -column (******************) (::=) ()
+.It Ao Va infrared-image Ac Ta ::= Ta Ao Va infrared-image-ht Ac # Option Fl R Cm fmt=HT
+.It Ta \& \& | Ta Ao Va infrared-image-vtk Ac # Option Fl R Cm fmt=VTK
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss htrdr-image format
+The
+.Xr htrdr-image 5
+layout of an infrared image is as follows:
+.Bl -column (******************) (::=) ()
+.It Ao Va infrared-image-ht Ac Ta ::= Ta Ao Va definition Ac
+.It Ta Ta Aq Va pixel
+.It Ta Ta ... # Up to number of pixels
+.It \ Ta Ta
+.It Ao Va definition Ac Ta ::= Ta Ao Va width Ac Ao Va height Ac
+.It Ao Va width Ac Ta ::= Ta Vt integer
+.It Ao Va height Ac Ta ::= Ta Vt integer
+.It \ Ta Ta
+.It Ao Va pixel Ac Ta ::= Ta Ao Va temperature Ac Li 0 0 0 0 Ao Va time Ac
+.It Ao Va temperature Ac Ta ::= Ta Ao Va estimate Ac
+.It Ao Va time Ac Ta ::= Ta Ao Va estimate Ac # Time per realisation
+.It \ Ta Ta
+.It Ao Va estimate Ac Ta ::= Ta Ao Va expected-value Ac Ao Va standard-error Ac
+.It Ao Va expected-value Ac Ta ::= Ta Vt real
+.It Ao Va standard-error Ac Ta ::= Ta Vt real
+.El
+.Pp
+See
+.Xr htpp 1
+to convert images in
+.Xr htrdr-image 5
+format into a regular image.
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Ss VTK format
+An infrared VTK image is an XY plane.
+By convention, the origin
+.Pq 0,0
+pixel is at the top-left corner of the image.
+The result not only includes the computed temperature image, but also
+includes a per-pixel computation time image as well as a per-pixel path
+error count image and per-pixel standard deviation images for both
+temperature and computation time.
+.Pp
+The VTK layout of an infrared image is as follows:
+.Bl -column (******************) (::=) ()
+.It Ao Va infrared-image-vtk Ac Ta ::= Ta Li # vtk DataFile Version 2.0
+.It Ta Ta Ao Va description Ac
+.It Ta Ta Li DATASET STRUCTURED_POINTS
+.It Ta Ta Li DIMENSIONS Ao Va width Ac Ao Va height Ac Li 1
+.It Ta Ta Li ORIGIN 0 0 0
+.It Ta Ta Li SPACING 1 1 1
+.It Ta Ta Li POINT_DATA Ao Va #pixels Ac
+.It Ta Ta Aq Va temp
+.It Ta Ta Aq Va temp-stderr
+.It Ta Ta Aq Va time
+.It Ta Ta Aq Va time-stderr
+.It Ta Ta Aq Va failures-count
+.It \ Ta Ta
+.It Ao Va temp Ac Ta ::= Ta Li SCALARS temperature_estimate float 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt real
+.It Ta Ta ... # Up to Aq Va #pixels
+.It \ Ta Ta
+.It Ao Va temp-stderr Ac Ta ::= Ta Li SCALARS temperature_std_dev float 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt real
+.It Ta Ta ... # Up to Aq Va #pixels
+.It \ Ta Ta
+.It Ao Va time Ac Ta ::= Ta Li SCALARS computation_time float 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt real
+.It Ta Ta ... # Up to Aq Va #pixels
+.It \ Ta Ta
+.It Ao Va time-stderr Ac Ta ::= Ta Li SCALARS computation_time_std_dev float 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt real
+.It Ta Ta ... # Up to Aq Va #pixels
+.It \ Ta Ta
+.It Ao Va failures-count Ac Ta ::= Ta Li SCALARS failures_count \e
+.It Ta Ta Li unsigned_long_long 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt integer
+.It Ta Ta ... # Up to Aq Va #pixels
+.It \ Ta Ta
+.It Ao Va #pixels Ac Ta ::= Ta Vt integer No # = Ao Va width Ac * Ao Va height Ac
+.It Ao Va width Ac Ta ::= Ta Vt integer
+.It Ao Va height Ac Ta ::= Ta Vt integer
+.It Ao Va description Ac Ta ::= Ta Vt string No # Up to 256 characters
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" Heath paths
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh HEAT PATHS
+When the
+.Xr stardis 1
+option
+.Fl D
+is used in conjunction with an option that computes a result, some of
+the heat paths
+.Pq successful paths, erroneous paths, or both
+sampled during the simulation are written to files.
+Each path is written in VTK format, one VTK file per path.
+The path description can include vertices' time if it makes sense, that
+is if the computation time is not
+.Sy INF .
+.Pp
+Due to the branching nature of non-linear Monte Carlo algorithms, paths
+are made of strips.
+With a Picard order of 1
+.Pq option Fl o Ar 1 ,
+there is only a single strip.
+With higher orders, the number of strips can be greater than 1.
+As a result, the whole path is a tree: past the first strip, each strip
+can start from any vertex of one of the previous strips.
+This tree, when displaying the
+.Li Branch_id
+field, starts with id 0, then increments each time a non-linearity leads
+to the creation of a new strip
+.Pq to fetch a temperature .
+.Pp
+The VTK layout of a path is as follows:
+.Bl -column (******************) (::=) ()
+.It Ao Va heat-path Ac Ta ::= Ta Li # vtk DataFile Version 2.0
+.It Ta Ta Aq Va description
+.It Ta Ta Li ASCII
+.It Ta Ta Li DATASET POLYDATA
+.It Ta Ta Aq Va vertices
+.It Ta Ta Aq Va strips
+.It Ta Ta Li CELL_DATA Aq Va #strips
+.It Ta Ta Aq Va status
+.It Ta Ta Li POINT_DATA Aq Va #vertices
+.It Ta Ta Aq Va segment-types
+.It Ta Ta Aq Va weights
+.It Ta Ta Aq Va branch-ids
+.It Ta Ta Oo Ao Va vertices-time Ac Oc # If not steady
+.It \ Ta Ta
+.It Ao Va description Ac Ta ::= Ta Vt string No # Up to 256 characters
+.It Ao Va #vertices Ac Ta ::= Ta Vt integer
+.It Ao Va #strips Ac Ta ::= Ta Vt integer
+.El
+.Pp
+List the vertices of the main trajectory and its branches:
+.Bl -column (******************) (::=) ()
+.It Ao Va vertices Ac Ta ::= Ta Li POINTS Ao Va #vertices Ac Li double
+.It Ta Ta Ao Va x Ac Ao Va y Ac Ao Va z Ac
+.It Ta Ta ... # Up to Aq Va #vertices
+.It Ao Va x Ac Ta ::= Ta Vt real
+.It Ao Va y Ac Ta ::= Ta Vt real
+.It Ao Va z Ac Ta ::= Ta Vt real
+.El
+.Pp
+List the main trajectory and branches of the path:
+.Bl -column (******************) (::=) ()
+.It Ao Va strips Ac Ta ::= Ta Li LINES Ao Va #strips Ac Ao Va strip-list-size Ac
+.It Ta Ta Ao Va #strip-vertices Ac Ao Va vertex-id Ac ...
+.It Ta Ta ... # Up to Aq Va #strips
+.It Ao Va strip-list-size Ac Ta ::= Ta Vt integer No # vertices per strip + Ao Va #strips Ac
+.It Ao Va vertex-id Ac Ta ::= Ta Vt integer No # \&In [0 , Ao Va #vertices Ac Ns [
+.El
+.Pp
+Status of the path:
+.Bl -column (******************) (::=) ()
+.It Ao Va status Ac Ta ::= Ta Li SCALARS Path_Failure unsigned_char 1
+.It Ta Ta Li 0 | Li 1 No # 0: Success; 1: Failure
+.It Ta Ta ... # Up to Aq Va #strips
+.El
+.Pp
+List the type of heat transfert to which each path vertex belongs:
+.Bl -column (******************) (::=) ()
+.It Ao Va segment-types Ac Ta ::= Ta Li SCALARS Segment_Type unsigned_char 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Aq Va segment-type
+.It Ta Ta ... # Up to Aq Va #vertices
+.It Ao Va segment-type Ac Ta ::= Ta Li 0 No # Conduction
+.It Ta \& \& | Ta Li 1 No # Convection
+.It Ta \& \& | Ta Li 2 No # Radiative
+.El
+.Pp
+Monte Carlo weight along the path:
+.Bl -column (******************) (::=) ()
+.It Ao Va weights Ac Ta ::= Ta Li SCALARS Weight double 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt real
+.It Ta Ta ... # Up to Aq Va #vertices
+.El
+.Pp
+List the identifier of the main path and its branches with respect to
+the branch depth:
+.Bl -column (******************) (::=) ()
+.It Ao Va branch-ids Ac Ta ::= Ta Li SCALARS Branch_id int 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt integer No # \&In [0 , Picard_order[
+.It Ta Ta ... # Up to Aq Va #vertices
+.El
+.Pp
+Rewinded time along the path:
+.Bl -column (******************) (::=) ()
+.It Ao Va vertices-time Ac Ta ::= Ta Li SCALARS Time double 1
+.It Ta Ta Li LOOKUP_TABLE default
+.It Ta Ta Vt real No # Time [s]
+.It Ta Ta ... # Up to Aq Va #vertices
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\" External references
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh SEE ALSO
+.Xr htpp 1 ,
+.Xr stardis 1 ,
+.Xr htrdr-image 5 ,
+.Xr stardis-input 5
+.Sh STANDARDS
+.Rs
+.%B The VTK User's Guide
+.%O Simple Legacy Formats
+.%I Kitware, Inc
+.%N 11
+.%D 2010
+.%P 470--482
+.Re
diff --git a/doc/stardis.1.in b/doc/stardis.1.in
@@ -0,0 +1,539 @@
+.\" Copyright (C) 2018-2023 |Méso|Star>
+.\"
+.\" 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 January 31, 2024
+.Dt STARDIS 1
+.Os
+.Sh NAME
+.Nm stardis
+.Nd statistical solving of coupled thermal systems
+.Sh SYNOPSIS
+.Nm
+.Op Fl eghv
+.Op Fl D Ar path_type , Ns Ar files_name_prefix
+.Op Fl d Ar file_base_name
+.Op Fl F Pa surface Ns Op , Ns Ar time Ns Op , Ns Ar time
+.Op Fl G Pa green_bin Ns Op , Ns Pa green_ascii
+.Op Fl m Ar medium_name Ns Op , Ns Ar time Ns Op , Ns Ar time
+.Op Fl n Ar samples_count
+.Op Fl o Ar picard_order
+.Op Fl P Ar x , Ns Ar y , Ns Ar z Ns Oo , Ns Ar time Ns Oo , Ns Ar time Oc Oc \
+ Ns Op : Ns Ar side_indicator
+.Op Fl p Ar x , Ns Ar y , Ns Ar z Ns Op , Ns Ar time Ns Op , Ns Ar time
+.Op Fl R Ar rendering_opt Ns Op : Ns Ar rendering_opt No ...
+.Op Fl S Pa surface Ns Op , Ns Ar time Ns Op , Ns Ar time
+.Op Fl s Pa surface Ns Op , Ns Ar time Ns Op , Ns Ar time
+.Op Fl t Ar threads_count
+.Op Fl V Ar verbosity_level
+.Op Fl X Pa output_rng
+.Op Fl x Pa input_rng
+.Fl M Pa system
+.Sh DESCRIPTION
+.Nm
+solves coupled thermal systems: conductive, convective and radiative transfers
+are solved together.
+The physical model used for conduction is the local unstationary heat conduction
+equation.
+Convection fluxes are assumed to be linear with temperature, and radiation
+is assumed to be integrated over the whole thermal spectral range,
+therefore radiative heat fluxes are proportionnal to a difference of
+temperatures to the power 4.
+.Nm
+can deal with complex geometries as well as high-frequency external
+solicitations over a very long period of time, relative to the characteristic
+time of the system.
+The provided system description should comply with the
+.Xr stardis-input 5
+format.
+.Pp
+.Nm
+can compute a thermal observable, like temperature or flux, at a probe point and
+date or the mean value of an observable over a given surface, volume, or time
+range.
+When a time range
+.Ar t1 , Ns Ar t2
+is provided, the computed value is the mean value over the time range.
+To compute the value at a given time, simply provide a single value
+.Ar t .
+In addition,
+.Nm
+gives access to the evaluation of the propagator (a.k.a the Green function).
+The propagator is of great value for thermicist engineers as it gives some
+crucial information to analyse heat transfers in the system.
+It helps engineers answer questions like
+.Dq Where from does the heat come at this location? .
+Propagators seamlessly aggregate all the provided geometrical and physical
+information on the system in an unbiased and very-fast statistical model.
+.Pp
+.Nm
+also provides two additional functionalities: converting the
+.Xr stardis-input 5 geometry into a VTK file and rendering an infrared image of
+the submitted system.
+.Pp
+.Nm Ns '
+algorithms are based on state-of-the-art Monte Carlo method applied to radiative
+transfer physics (Delatorre et al. 2014) combined with conduction's
+statistical formulation (Kac 1949 and Muller 1956).
+Monte Carlo algorithms associated with convective and conductive processes
+consist in sampling heat paths: this can be seen as an extension of Monte Carlo
+algorithms that solve monochromatic radiative transfer.
+The radiative transfer algorithm, based on the Picard method, is also based on
+sampling radiative paths.
+However, since
+.Nm
+solves the spectrally integrated radiative transfer, the process can be
+recursive: secondary heat paths (convective, conductive and radiative) may be
+necessary along the sampling of an initial radiative path.
+The solution may not be sufficiently converged with a Picard order equal to 1 in
+the presence of high temperature gradients.
+Increasing the Picard order may be necessary in this case, until the required
+convergence is reached.
+.Pp
+A main property of this approach is that the resulting algorithms do
+not rely on a volumic mesh of the system: only the representation
+of interfaces is necessary.
+.Pp
+.Nm
+implements mixed parallelism.
+On a single computer (that is, a node), it uses shared memory parallelism while
+it relies on Message Passing Interface (MPI) to parallelize calculations between
+multiple nodes.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl D Ar path_type , Ns Ar files_name_prefix
+Write sampled heat paths of the given
+.Ar path_type
+to files in VTK format, one file per path.
+Possible values for
+.Ar path_type
+are
+.Cm error
+.Pq write paths ending in error ,
+.Cm success
+.Pq write successful paths ,
+and
+.Cm all
+.Pq write all paths .
+Actual file names are produced by appending
+.Ar files_name_prefix
+and the path rank starting at index
+.Li 00000000 ,
+and possibly followed by
+.Li _err
+for failure paths
+.Pq e.g. Pa prefix00000000.vtk , Pa prefix00000001_err.vtk
+.It Fl d Ar file_base_name
+Write the geometry to a file in VTK format along with various properties,
+including possible errors.
+Also possibly write some problematic parts of the geometry (if any) in OBJ
+format.
+Possible parts are overlapping triangles, riangles with property conflicts, and
+triangles with merge errors.
+The various file are all named after the provided base name.
+If this option is used, no computation occurs.
+.Pp
+Using this option in conjunction with an option that
+specifies a compute region
+.Pq i.e. Fl F , Fl S , Fl s
+has the effect to include the region in the VTK output.
+.It Fl e
+Use extended format to output Monte Carlo results.
+Can only be used in conjunction with options that compute a single Monte-Carlo
+.Pq Fl F , Fl m , Fl P , Fl p No or Fl s No without options Fl g No or Fl G .
+.It Fl F Pa surface Ns Op , Ns Ar time Ns Op , Ns Ar time
+Compute the mean flux on a given 2D surface at a given time, the surface
+being defined as the front sides of the triangles in the provided STL
+file.
+These triangles are not added to the geometry, but must be part of it.
+Flux is accounted positive when going from the front side to the back
+side, at a single-triangle level.
+By default the compute time is @STARDIS_ARGS_DEFAULT_COMPUTE_TIME@.
+The surface does not need to be connex.
+.It Fl G Pa green_bin Ns Op , Ns Pa green_ascii
+Compute the Green function at the specified time and write it to a binary file.
+If a
+.Pa green_ascii
+file name is provided, information on heat paths' ends is also written in this
+second file in ascii csv format.
+.Pp
+This option can only be used in conjunction with one these options:
+.Fl p , Fl P , Fl m , Fl s
+and cannot be used in conjunction with option
+.Fl D .
+.Pp
+The resulting file can be further used through the
+.Xr sgreen 1
+command to apply different temperature, flux or volumic power values.
+.It Fl g
+Compute the Green function at the specified time and write it in ASCII to
+standard output.
+This option can only be used in conjunction with one these options:
+.Fl p , Fl P , Fl m , Fl s
+and cannot be used in conjunction with option
+.Fl D .
+.It Fl h
+Output short help and exit.
+.It Fl M Pa system
+Read a text file containing a possibly partial description of the system.
+Can include programs, media enclosures and boundary conditions.
+Media and boundaries can appear in any order, but programs must be defined
+before their first reference.
+Refer to
+.Xr stardis-input 5
+for a full description of the file format.
+Can be used more than once if the description is split across different files.
+.It Fl m Ar medium_name Ns Op , Ns Ar time Ns Op , Ns Ar time
+Compute the mean temperature in a given medium at a given time.
+The medium name must be part of the
+.Pa system
+description.
+By default the compute time is @STARDIS_ARGS_DEFAULT_COMPUTE_TIME@.
+The medium region does not need to be connex.
+.It Fl o Ar picard_order
+Determine the iteration level used with the Picard method to deal with
+non-linear radiative transfer accross the model.
+By default
+.Ar picard_order
+is set to @STARDIS_ARGS_DEFAULT_PICARD_ORDER@.
+Note that a Picard order greater than 1 is incompatible both with Green
+computations and systems including volumic power sources or non zero flux at a
+boundary.
+.It Fl P Ar x , Ns Ar y , Ns Ar z Ns Oo , Ns Ar time Ns Oo , Ns Ar time Oc Oc \
+Ns Op : Ns Ar side_indicator
+Compute the temperature at the given probe on an interface at a given time.
+If the probe is on an interface where a thermal contact resistance is defined,
+it is mandatory to provide a side indicator
+.Pq either Cm FRONT , Cm BACK , No or a medium name ,
+as the temperature differs between the two sides.
+By default the compute time is @STARDIS_ARGS_DEFAULT_COMPUTE_TIME@.
+The probe is supposed to be on an interface and is moved to the closest point of
+the closest interface before the computation starts.
+The probe coordinates must be in the same system as the geometry.
+.It Fl p Ar x , Ns Ar y , Ns Ar z Ns Op , Ns Ar time Ns Op , Ns Ar time
+Compute the temperature at the given probe at a given time.
+By default the compute time is @STARDIS_ARGS_DEFAULT_COMPUTE_TIME@.
+The probe must be in a medium.
+The probe coordinates must be in the same system as the geometry.
+.It Fl R Ar rendering_opt Ns Op : Ns Ar rendering_opt No ...
+Render an infrared image of the system through a pinhole camera.
+One can use all-default sub-options by simply providing the colon character
+.Pq Li \&:
+alone as an argument.
+Please note that the camera position must be outside the geometry or in a fluid.
+.Pp
+The rendering options are as follows:
+.Bl -tag -width Ds
+.It Cm file= Ns Pa output_file
+File name to use to write the infrared image to.
+If no file name is provided, the result is written to standard output.
+.It Cm fmt= Ns Ar image_file_format
+Format of the image file in output.
+Can be
+.Cm VTK ,
+or
+.Cm HT
+.Pq see Xr htrdr-image 5 No and Xr htpp 1 .
+Default
+.Ar image_file_format
+is @STARDIS_ARGS_DEFAULT_RENDERING_OUTPUT_FILE_FMT@.
+.It Cm fov= Ns Ar angle
+Vertical field of view of the camera in [30,120] degrees.
+The default field of view is @STARDIS_ARGS_DEFAULT_RENDERING_FOV@ degrees.
+.It Cm img= Ns Ar width Ns x Ns Ar height
+Image definition.
+Default is
+@STARDIS_ARGS_DEFAULT_RENDERING_IMG_WIDTH@x@STARDIS_ARGS_DEFAULT_RENDERING_IMG_HEIGHT@.
+.It Cm pos= Ns Ar x , Ns Ar y , Ns Ar z
+Camera position.
+Default is @STARDIS_ARGS_DEFAULT_RENDERING_POS@ unless
+.Cm tgt
+is not defined, in which case the position is automatically calculated to ensure
+that the entire scene is visible.
+.It Cm spp= Ns Ar samples_per_pixel
+Number of samples to solve the Monte Carlo estimation of each pixel.
+Default is @STARDIS_ARGS_DEFAULT_RENDERING_SPP@.
+.It Cm t= Ns Ar time , Ns Op Ns Ar time
+Rendering time.
+Default is @STARDIS_ARGS_DEFAULT_RENDERING_TIME@.
+.It Cm tgt= Ns Ar x , Ns Ar y , Ns Ar z
+Targeted position.
+Default is @STARDIS_ARGS_DEFAULT_RENDERING_TGT@ unless
+.Cm pos
+is not defined, in which case the targeted position is automatically calculated
+to ensure that the entire scene is visible.
+.It Cm up= Ns Ar x , Ns Ar y , Ns Ar z
+Upward vector that the top of the camera is pointing towards.
+Default is @STARDIS_ARGS_DEFAULT_RENDERING_UP@.
+.El
+.It Fl S Pa surface Ns Op , Ns Ar time Ns Op , Ns Ar time
+Compute the by-triangle mean temperature on a given 2D
+.Pa surface
+at a given time,
+the
+.Pa surface
+defined as the front sides of the triangles in the provided STL file.
+These triangles are not added to the geometry, but must be part of it.
+By default the compute time is @STARDIS_ARGS_DEFAULT_COMPUTE_TIME@.
+The
+.Pa surface
+does not need to be connex.
+.It Fl s Pa surface Ns Op , Ns Ar time Ns Op , Ns Ar time
+Compute the mean temperature on a given 2D
+.Pa surface
+at a given time, the
+.Pa surface
+being defined as the front sides of the triangles in the provided STL file.
+By default the compute time is @STARDIS_ARGS_DEFAULT_COMPUTE_TIME@.
+These triangles are not added to the geometry, but must be part of it.
+The
+.Pa surface
+does not need to be connex.
+.It Fl t Ar threads_count
+Advice on the number of threads to use.
+By default,
+.Nm
+uses many threads as processor cores.
+.It Fl V Ar verbosity_level
+Set the verbosity level.
+Possible values are
+.Li 0 Pq no message ,
+.Li 1 Pq error messages only ,
+.Li 2 error and warning messages ,
+and
+.Li 3 Pq error, warning and informative messages .
+All the messages are written to standard error.
+Default is @STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL@.
+.It Fl v
+Output version information and exit.
+.It Fl X Pa output_rng
+Write the random generator's internal state, as it is at the end of the
+computation, to the provided file.
+.It Fl x Pa input_rng
+Read the provided file and use its content to initialize the random generator's
+internal state.
+Used in conjunction with the
+.Fl X
+option, this can be used to ensure statistical independence between subsequent
+computations.
+.El
+.Sh EXIT STATUS
+.Ex -std
+.Sh EXAMPLES
+Preprocess the system as described in
+.Dq Pa scene 5.txt
+when intending to compute the mean flux on the triangles from the file
+.Pa edge.stl ,
+and write its geometry in the file
+.Pa scene.vtk .
+Verbosity level is set to
+.Ar 3 :
+.Pp
+.Dl stardis -M "scene 5.txt" -F edge.stl -d -V 3 > scene.vtk
+.Pp
+Compute the temperature at the probe point
+.Ar 0 , Ns Ar 0.5 , Ns Ar 0
+at steady state.
+The system is read from the file
+.Pa model.txt
+and the number of samples is set to
+.Ar 1000000 :
+.Pp
+.Dl stardis -M model.txt -p 0,0.5,0 -n 1000000
+.Pp
+Compute the mean temperature in the medium
+.Ar med05
+at
+.No t= Ns Ar 100 Ns s .
+The system is read from the file
+.Pa model.txt
+and the result is output with extended format
+.Pq option Fl e :
+.Pp
+.Dl stardis -M model.txt -m med05,100 -e
+.Pp
+Compute the temperature at the probe point
+.Ar 0 , Ns Ar 0 , Ns Ar 0
+at
+.No t= Ns Ar 2500 .
+The system is read from the 2 files
+.Pa media.txt
+and
+.Pa bounds.txt ,
+and the number of samples is set to
+.Ar 1000000 :
+.Pp
+.Dl stardis -M media.txt -M bounds.txt -p 0,0,0,2500 -n 1000000
+.Pp
+Compute the mean temperature at the probe point
+.Ar 1 , Ns Ar 2.5 , Ns Ar 0
+over the
+.Ar 50 , Ns Ar 5000
+time range.
+The system is read from the file
+.Pa model.txt :
+.Pp
+.Dl stardis -M model.txt -p 1,2.5,0,50,5000
+.Pp
+Compute 3 probe temperatures, ensuring statistical independence:
+.Bd -literal -offset Ds
+stardis -M model.txt -p 1,1.5,0,50,5000 -Xstate1
+stardis -M model.txt -p 1,2.5,0,50,5000 -xstate1 -Xstate2
+stardis -M model.txt -p 1,3.5,0,50,5000 -xstate2
+.Ed
+.Pp
+Use
+.Xr mpirun 1
+to launch
+.Nm
+on several hosts defined in the my_hosts file.
+Render the system as described in
+.Pa scene.txt
+with default settings:
+.Pp
+.Dl mpirun --hostfile my_hosts stardis -M scene.txt -R\&:
+.Pp
+Render the system as described in
+.Pa scn.txt
+at
+.Ar 100
+seconds
+Using 2 samples per pixel
+for an image of
+.Ar 800 No by Ar 600
+pixels
+saved in
+.Xr htrdr-image 5
+format
+and all other settings set to their default values.
+The output is redirected to the
+.Pa img.ht
+file.
+If the computation encounters erroneous heat paths, they will be dumped to VTK
+files named
+.Pa err_path_00000000.vtk , err_path_00000001.vtk ,
+etc.
+The image file is then post-processed using
+.Xr htpp 1
+with default settings to obtain a png file:
+.Bd -literal -offset Ds
+stardis -M scn.txt \\
+ -R t=100:spp=2:img=800x600:fmt=ht \\
+ -D error,err_path_ \\
+ > img.ht
+htpp -o img.pgn -v -m default img.ht
+.Ed
+.Pp
+Compute the Green function that computes the temperature at the probe point
+.Ar 0 , Ns Ar 0 , Ns Ar 0
+at steady state.
+The system is read from the file
+.Pa model.txt
+and the Green function is written to the
+.Pa probe.green
+file and the heat paths' ends are written to the
+.Pa probe_ends.csv
+file:
+.Pp
+.Dl stardis -M model.txt -p 0,0,0 -G probe.green,probe_ends.csv
+.Sh SEE ALSO
+.Xr htpp 1 ,
+.Xr mpirun 1 ,
+.Xr sgreen 1 ,
+.Xr htrdr-image 5 ,
+.Xr stardis-input 5 ,
+.Xr stardis-output 5
+.Rs
+.%A Léa Penazzi et al.
+.%T Path integrals formulations leading to propagator evaluation for coupled \
+linear physics in large geometric models
+.%J Computer Physics Communications
+.%V 294
+.%D 2024
+.%U https://doi.org/10.1016/j.cpc.2023.108911
+.Re
+.Rs
+.%A Mégane Bati et al.
+.%T Coupling Conduction, Convection and Radiative Transfer in a Single \
+Path-Space: Application to Infrared Rendering
+.%J ACM Transactions on Graphics
+.%V 42
+.%N 4
+.%D August 2023
+.%U https://doi.org/10.1145/3592121
+.Re
+.Rs
+.%A Jean Marc Tregan et al.
+.%T Coupling radiative, conductive and convective heat-transfers in a single \
+Monte Carlo algorithm: A general theoretical framework for linear situations
+.%J PLOS ONE
+.%V 18
+.%N 4
+.%D 2023
+.%U https://doi.org/10.1371/journal.pone.0283681
+.Re
+.Rs
+.%A Jérémie Delatorre et al.
+.%T Monte Carlo advances and concentrated solar applications
+.%J Solar Energy
+.%V 103
+.%P 653--681
+.%D 2014
+.%U https://doi.org/10.1016/j.solener.2013.02.035
+.Re
+.Rs
+.%A Mervin E Muller
+.%T Some continuous Monte Carlo methods for the Dirichlet problem
+.%J The Annals of Mathematical Statistics
+.%P 569--589
+.%D 1956
+.Re
+.Rs
+.%A Mark Kac
+.%T On distributions of certain Wiener functionals
+.%J Transactions of the American Mathematical Society
+.%V 65
+.%N 1
+.%P 1--13
+.%D 1949
+.Re
+.Sh STANDARDS
+.Rs
+.%B The VTK User's Guide
+.%O Simple Legacy Formats
+.%I Kitware, Inc
+.%N 11
+.%D 2010
+.%P 470--482
+.Re
+.Pp
+.Rs
+.%A OpenMP Architecture Review Board
+.%D March 2002
+.%T OpenMP C and C++ Application Interface
+.%O version 2.0
+.Re
+.Pp
+.Rs
+.%A Message Passing Interface Forum
+.%D July 1997
+.%T MPI-2: Extensions to The Message-Passing Interface
+.Re
+.Pp
+.Rs
+.%T The StL Format: Standard Data Format for Fabbers
+.%A Marshall Burns
+.%D 1993
+.%U https://www.fabbers.com/tech/STL_Format
+.Re
diff --git a/make.sh b/make.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Copyright (C) 2018-2023 |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/>.
+
+set -e
+
+install()
+{
+ prefix=$1
+ shift 1
+
+ mkdir -p "${prefix}"
+
+ for i in "$@"; do
+ dst="${prefix}/${i##*/}"
+
+ if cmp -s "${i}" "${dst}"; then
+ printf "Up to date %s\n" "${dst}"
+ else
+ printf "Installing %s\n" "${dst}"
+ cp "${i}" "${prefix}"
+ fi
+ done
+}
+
+"$@"
diff --git a/src/stardis-app.c b/src/stardis-app.c
@@ -13,11 +13,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <star/sg3d.h>
#ifdef STARDIS_ENABLE_MPI
-#define _POSIX_C_SOURCE 200112L
+ #define _POSIX_C_SOURCE 200112L
#endif
+#include <star/sg3d.h>
+
#include "stardis-app.h"
#include "stardis-args.h"
#include "stardis-description.h"
@@ -43,8 +44,8 @@
#include <string.h>
#ifdef STARDIS_ENABLE_MPI
-#include <stdio.h>
-#include <mpi.h>
+ #include <stdio.h>
+ #include <mpi.h>
#endif
static const struct dummies DUMMIES_NULL = DUMMIES_NULL__;
@@ -893,16 +894,16 @@ void
log_prt_fn
(const char* msg, void* ctx)
{
-#ifdef stardis_enable_mpi
+#ifdef STARDIS_ENABLE_MPI
int initialized, rank = 0;
#endif
ASSERT(msg);
(void)ctx;
-#ifdef stardis_enable_mpi
- chk(mpi_initialized(&initialized) == mpi_success);
- if(initialized) chk(mpi_comm_rank(mpi_comm_world, &rank) == mpi_success);
+#ifdef STARDIS_ENABLE_MPI
+ CHK(MPI_Initialized(&initialized) == MPI_SUCCESS);
+ if(initialized) CHK(MPI_Comm_rank(MPI_COMM_WORLD, &rank) == MPI_SUCCESS);
/* only master prints */
if(rank != 0) return;
#endif
diff --git a/src/stardis-args.c b/src/stardis-args.c
@@ -169,7 +169,7 @@ print_version
"disabled.\n",
#endif
STARDIS_APP_VERSION_MAJOR, STARDIS_APP_VERSION_MINOR, STARDIS_APP_VERSION_PATCH,
- Stardis_VERSION_MAJOR, Stardis_VERSION_MINOR, Stardis_VERSION_PATCH);
+ SDIS_VERSION_MAJOR, SDIS_VERSION_MINOR, SDIS_VERSION_PATCH);
}
res_T
diff --git a/src/stardis-program.h b/src/stardis-program.h
@@ -17,8 +17,7 @@
#define STARDIS_PROGRAM_H
#include "stardis-app.h"
-
-#include <stardis-prog-properties.h>
+#include "stardis-prog-properties.h"
#include <rsys/rsys.h>
#include <rsys/str.h>
diff --git a/src/stardis-version.h.in b/src/stardis-version.h.in
@@ -16,9 +16,9 @@
#ifndef STARDIS_APP_VERSION_H
#define STARDIS_APP_VERSION_H
-#define STARDIS_APP_VERSION_MAJOR @SDIS_VERSION_MAJOR@
-#define STARDIS_APP_VERSION_MINOR @SDIS_VERSION_MINOR@
-#define STARDIS_APP_VERSION_PATCH @SDIS_VERSION_PATCH@
+#define STARDIS_APP_VERSION_MAJOR @STARDIS_APP_VERSION_MAJOR@
+#define STARDIS_APP_VERSION_MINOR @STARDIS_APP_VERSION_MINOR@
+#define STARDIS_APP_VERSION_PATCH @STARDIS_APP_VERSION_PATCH@
#endif /* STARDIS_APP_VERSION_H */